refactor(导航): 统一使用Taro.redirectTo进行页面跳转
将原本使用go方法的页面跳转统一改为Taro.redirectTo,提高代码一致性 调整首页预约码图标位置和占位元素 优化温馨提示的样式布局
Showing
5 changed files
with
27 additions
and
13 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2024-01-16 10:06:47 | 2 | * @Date: 2024-01-16 10:06:47 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2026-01-07 21:59:47 | 4 | + * @LastEditTime: 2026-01-07 22:27:24 |
| 5 | * @FilePath: /xyxBooking-weapp/src/pages/bookingCode/index.vue | 5 | * @FilePath: /xyxBooking-weapp/src/pages/bookingCode/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -49,17 +49,23 @@ useDidShow(() => { | ... | @@ -49,17 +49,23 @@ useDidShow(() => { |
| 49 | success: (res) => { | 49 | success: (res) => { |
| 50 | const isConnected = ['wifi', '4g', '5g', '3g'].includes(res.networkType); | 50 | const isConnected = ['wifi', '4g', '5g', '3g'].includes(res.networkType); |
| 51 | if (!isConnected) { | 51 | if (!isConnected) { |
| 52 | - go('/pages/weakNetwork/index'); | 52 | + Taro.redirectTo({ |
| 53 | + url: '/pages/weakNetwork/index' | ||
| 54 | + }) | ||
| 53 | } | 55 | } |
| 54 | } | 56 | } |
| 55 | }); | 57 | }); |
| 56 | }) | 58 | }) |
| 57 | 59 | ||
| 58 | const toMy = () => { // 跳转到我的 | 60 | const toMy = () => { // 跳转到我的 |
| 59 | - go('/pages/me/index'); | 61 | + Taro.redirectTo({ |
| 62 | + url: '/pages/me/index' | ||
| 63 | + }) | ||
| 60 | } | 64 | } |
| 61 | const toHome = () => { // 跳转到首页 | 65 | const toHome = () => { // 跳转到首页 |
| 62 | - go('/pages/index/index'); | 66 | + Taro.redirectTo({ |
| 67 | + url: '/pages/index/index' | ||
| 68 | + }) | ||
| 63 | } | 69 | } |
| 64 | 70 | ||
| 65 | </script> | 71 | </script> | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-06-21 10:23:09 | 2 | * @Date: 2023-06-21 10:23:09 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2026-01-06 23:01:43 | 4 | + * @LastEditTime: 2026-01-07 22:25:27 |
| 5 | * @FilePath: /xyxBooking-weapp/src/pages/index/index.vue | 5 | * @FilePath: /xyxBooking-weapp/src/pages/index/index.vue |
| 6 | * @Description: 预约页首页 | 6 | * @Description: 预约页首页 |
| 7 | --> | 7 | --> |
| ... | @@ -32,8 +32,8 @@ | ... | @@ -32,8 +32,8 @@ |
| 32 | 首页 | 32 | 首页 |
| 33 | </view> | 33 | </view> |
| 34 | <view class="nav-logo" @tap="toCode"> | 34 | <view class="nav-logo" @tap="toCode"> |
| 35 | - <image :src="icon_4" style="width: 160rpx; height: 160rpx; position: absolute; top: -170rpx;" /> | 35 | + <image :src="icon_4" style="width: 160rpx; height: 160rpx; position: absolute; top: -110rpx;" /> |
| 36 | - <!-- <van-icon size="48rpx" name="wap-home" color="#FFF" style="opacity: 0;" /> --> | 36 | + <view style="width: 48rpx; height: 48rpx;"></view> |
| 37 | 预约码 | 37 | 预约码 |
| 38 | </view> | 38 | </view> |
| 39 | <view class="nav-logo" @tap="toMy"> | 39 | <view class="nav-logo" @tap="toMy"> |
| ... | @@ -69,10 +69,14 @@ const toSearch = () => { // 跳转到寺院录入 | ... | @@ -69,10 +69,14 @@ const toSearch = () => { // 跳转到寺院录入 |
| 69 | go('/search'); | 69 | go('/search'); |
| 70 | } | 70 | } |
| 71 | const toCode = () => { // 跳转到预约码 | 71 | const toCode = () => { // 跳转到预约码 |
| 72 | - go('/bookingCode'); | 72 | + Taro.redirectTo({ |
| 73 | + url: '/pages/bookingCode/index' | ||
| 74 | + }) | ||
| 73 | } | 75 | } |
| 74 | const toMy = () => { // 跳转到我的 | 76 | const toMy = () => { // 跳转到我的 |
| 75 | - go('/me'); | 77 | + Taro.redirectTo({ |
| 78 | + url: '/pages/me/index' | ||
| 79 | + }) | ||
| 76 | } | 80 | } |
| 77 | 81 | ||
| 78 | useDidShow(async () => { | 82 | useDidShow(async () => { | ... | ... |
| ... | @@ -42,10 +42,14 @@ import icon_invite from '@/assets/images/二维码@2x2.png' | ... | @@ -42,10 +42,14 @@ import icon_invite from '@/assets/images/二维码@2x2.png' |
| 42 | const go = useGo(); | 42 | const go = useGo(); |
| 43 | 43 | ||
| 44 | const toCode = () => { // 跳转到预约码 | 44 | const toCode = () => { // 跳转到预约码 |
| 45 | - go('/pages/bookingCode/index'); | 45 | + Taro.redirectTo({ |
| 46 | + url: '/pages/bookingCode/index' | ||
| 47 | + }) | ||
| 46 | } | 48 | } |
| 47 | const toHome = () => { // 跳转到首页 | 49 | const toHome = () => { // 跳转到首页 |
| 48 | - go('/pages/index/index'); | 50 | + Taro.redirectTo({ |
| 51 | + url: '/pages/index/index' | ||
| 52 | + }) | ||
| 49 | } | 53 | } |
| 50 | 54 | ||
| 51 | const menu_list = [{ | 55 | const menu_list = [{ | ... | ... |
| ... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
| 16 | </view> | 16 | </view> |
| 17 | </view> | 17 | </view> |
| 18 | <view style="color:#A67939; font-size: 30rpx; text-align: center;"> | 18 | <view style="color:#A67939; font-size: 30rpx; text-align: center;"> |
| 19 | - <view> | 19 | + <view style="display: flex; align-items: center; justify-content: center;"> |
| 20 | <IconFont name="tips" /> 温馨提示 | 20 | <IconFont name="tips" /> 温馨提示 |
| 21 | </view> | 21 | </view> |
| 22 | <view style="margin-top: 16rpx;">获取参观码,扫码或识别身份证成功进闸机</view> | 22 | <view style="margin-top: 16rpx;">获取参观码,扫码或识别身份证成功进闸机</view> | ... | ... |
| ... | @@ -18,7 +18,7 @@ | ... | @@ -18,7 +18,7 @@ |
| 18 | <view class="payment-amount">支付金额:<text>¥ {{ billInfo?.total_amt }}</text></view> | 18 | <view class="payment-amount">支付金额:<text>¥ {{ billInfo?.total_amt }}</text></view> |
| 19 | </view> | 19 | </view> |
| 20 | <view class="appointment-notice"> | 20 | <view class="appointment-notice"> |
| 21 | - <view style="margin-bottom: 8rpx;"><IconFont name="tips" /> 温馨提示</view> | 21 | + <view style="margin-bottom: 8rpx; display: flex; align-items: center; justify-content: center;"><IconFont name="tips" /> 温馨提示</view> |
| 22 | <view style="font-size: 27rpx;">1. 一人一码,或拿身份证,扫码或识别身份证成功后进入</view> | 22 | <view style="font-size: 27rpx;">1. 一人一码,或拿身份证,扫码或识别身份证成功后进入</view> |
| 23 | <view style="font-size: 27rpx;">2. 若您无法按时参观,请提前在预约记录中取消您的预约</view> | 23 | <view style="font-size: 27rpx;">2. 若您无法按时参观,请提前在预约记录中取消您的预约</view> |
| 24 | </view> | 24 | </view> | ... | ... |
-
Please register or login to post a comment