fix(页面样式): 调整多个页面高度和背景色
修复滚动区域高度计算问题,统一从100vh改为92vh以减去header和TabBar高度 将myFavorites和myAuthCar页面背景色从白色改为#f8f9fa 在myAuthCar页面添加useDidShow钩子确保数据同步
Showing
3 changed files
with
18 additions
and
10 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-18 14:39:24 | 4 | + * @LastEditTime: 2025-07-18 15:20:04 |
| 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue |
| 6 | * @Description: 我的认证车页面 | 6 | * @Description: 我的认证车页面 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | - <view class="flex flex-col bg-white min-h-screen"> | 9 | + <view class="flex flex-col min-h-screen" style="background-color: #f8f9fa;"> |
| 10 | <!-- Auth Car List --> | 10 | <!-- Auth Car List --> |
| 11 | <view class="flex-1"> | 11 | <view class="flex-1"> |
| 12 | <!-- 滚动列表 --> | 12 | <!-- 滚动列表 --> |
| ... | @@ -111,7 +111,7 @@ | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | ||
| 112 | <script setup> | 112 | <script setup> |
| 113 | import { ref, computed, onMounted } from 'vue' | 113 | import { ref, computed, onMounted } from 'vue' |
| 114 | -import Taro from '@tarojs/taro' | 114 | +import Taro, { useDidShow } from '@tarojs/taro' |
| 115 | import './index.less' | 115 | import './index.less' |
| 116 | // 导入接口 | 116 | // 导入接口 |
| 117 | import { getMyListingVehicleAPI } from '@/api/car' | 117 | import { getMyListingVehicleAPI } from '@/api/car' |
| ... | @@ -144,7 +144,7 @@ const pageSize = ref(10) | ... | @@ -144,7 +144,7 @@ const pageSize = ref(10) |
| 144 | */ | 144 | */ |
| 145 | const scrollStyle = computed(() => { | 145 | const scrollStyle = computed(() => { |
| 146 | return { | 146 | return { |
| 147 | - height: 'calc(100vh)' // 减去header和TabBar的高度 | 147 | + height: 'calc(92vh)' // 减去header和TabBar的高度 |
| 148 | } | 148 | } |
| 149 | }) | 149 | }) |
| 150 | 150 | ||
| ... | @@ -254,8 +254,8 @@ const onItemClick = (item) => { | ... | @@ -254,8 +254,8 @@ const onItemClick = (item) => { |
| 254 | * @param {Object} item - 车辆信息 | 254 | * @param {Object} item - 车辆信息 |
| 255 | */ | 255 | */ |
| 256 | const handleSellClick = (item) => { | 256 | const handleSellClick = (item) => { |
| 257 | - // 翻车的状态为待审核 | 257 | + // 不在这里修改状态,让下一个页面处理状态修改 |
| 258 | - item.review_status = 1; | 258 | + // 页面返回时会通过 useDidShow 重新加载数据 |
| 259 | Taro.navigateTo({ | 259 | Taro.navigateTo({ |
| 260 | url: `/pages/sell/index?id=${item.id}&mode=edit&type=auth` | 260 | url: `/pages/sell/index?id=${item.id}&mode=edit&type=auth` |
| 261 | }) | 261 | }) |
| ... | @@ -291,6 +291,14 @@ const authCar = (carId) => { | ... | @@ -291,6 +291,14 @@ const authCar = (carId) => { |
| 291 | onMounted(() => { | 291 | onMounted(() => { |
| 292 | initData() | 292 | initData() |
| 293 | }) | 293 | }) |
| 294 | + | ||
| 295 | +// 页面显示时重新加载数据,确保状态同步 | ||
| 296 | +useDidShow(() => { | ||
| 297 | + // 如果不是首次加载,重新获取数据 | ||
| 298 | + if (authCars.value.length > 0) { | ||
| 299 | + initData() | ||
| 300 | + } | ||
| 301 | +}) | ||
| 294 | </script> | 302 | </script> |
| 295 | 303 | ||
| 296 | <script> | 304 | <script> | ... | ... |
| ... | @@ -186,7 +186,7 @@ const getVerificationStatusClass = (status) => { | ... | @@ -186,7 +186,7 @@ const getVerificationStatusClass = (status) => { |
| 186 | */ | 186 | */ |
| 187 | const scrollStyle = computed(() => { | 187 | const scrollStyle = computed(() => { |
| 188 | return { | 188 | return { |
| 189 | - height: 'calc(100vh)' // 减去header和TabBar的高度 | 189 | + height: 'calc(92vh)' // 减去header和TabBar的高度 |
| 190 | } | 190 | } |
| 191 | }) | 191 | }) |
| 192 | 192 | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-11 10:01:52 | 4 | + * @LastEditTime: 2025-07-18 15:19:27 |
| 5 | * @FilePath: /jgdl/src/pages/myFavorites/index.vue | 5 | * @FilePath: /jgdl/src/pages/myFavorites/index.vue |
| 6 | * @Description: 我的关注页面 | 6 | * @Description: 我的关注页面 |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | - <view class="flex flex-col bg-white min-h-screen"> | 9 | + <view class="flex flex-col min-h-screen" style="background-color: #f8f9fa;"> |
| 10 | <!-- Favorites List --> | 10 | <!-- Favorites List --> |
| 11 | <view class="flex-1"> | 11 | <view class="flex-1"> |
| 12 | <!-- 滚动列表 --> | 12 | <!-- 滚动列表 --> |
| ... | @@ -189,7 +189,7 @@ const toastType = ref('success') | ... | @@ -189,7 +189,7 @@ const toastType = ref('success') |
| 189 | */ | 189 | */ |
| 190 | const scrollStyle = computed(() => { | 190 | const scrollStyle = computed(() => { |
| 191 | return { | 191 | return { |
| 192 | - height: 'calc(100vh)' // 减去header和TabBar的高度 | 192 | + height: 'calc(92vh)' // 减去header和TabBar的高度 |
| 193 | } | 193 | } |
| 194 | }) | 194 | }) |
| 195 | 195 | ... | ... |
-
Please register or login to post a comment