Showing
1 changed file
with
19 additions
and
4 deletions
| ... | @@ -332,7 +332,7 @@ | ... | @@ -332,7 +332,7 @@ |
| 332 | <script setup> | 332 | <script setup> |
| 333 | import { ref, reactive, onMounted, computed } from 'vue' | 333 | import { ref, reactive, onMounted, computed } from 'vue' |
| 334 | import { Plus, Right, Location, Close } from '@nutui/icons-vue-taro' | 334 | import { Plus, Right, Location, Close } from '@nutui/icons-vue-taro' |
| 335 | -import Taro, { useDidShow } from '@tarojs/taro' | 335 | +import Taro, { useDidShow, useDidHide } from '@tarojs/taro' |
| 336 | import BASE_URL from '@/utils/config'; | 336 | import BASE_URL from '@/utils/config'; |
| 337 | import BrandModelPicker from '@/components/BrandModelPicker.vue' | 337 | import BrandModelPicker from '@/components/BrandModelPicker.vue' |
| 338 | import PaymentAgreementModal from '@/components/PaymentAgreementModal.vue' | 338 | import PaymentAgreementModal from '@/components/PaymentAgreementModal.vue' |
| ... | @@ -423,6 +423,8 @@ const tireWearPickerVisible = ref(false) | ... | @@ -423,6 +423,8 @@ const tireWearPickerVisible = ref(false) |
| 423 | const paymentAgreementVisible = ref(false) | 423 | const paymentAgreementVisible = ref(false) |
| 424 | // 标记是否是上传图片后触发的useDidShow | 424 | // 标记是否是上传图片后触发的useDidShow |
| 425 | const isUploadingImage = ref(false) | 425 | const isUploadingImage = ref(false) |
| 426 | +// 标记是否已经显示过收款说明弹框(避免应用切换时重复显示) | ||
| 427 | +const hasShownPaymentAgreement = ref(false) | ||
| 426 | 428 | ||
| 427 | // 新的品牌型号选择器状态 | 429 | // 新的品牌型号选择器状态 |
| 428 | // 品牌型号选择器组件引用 | 430 | // 品牌型号选择器组件引用 |
| ... | @@ -465,7 +467,7 @@ const modelOptions = ref([]) | ... | @@ -465,7 +467,7 @@ const modelOptions = ref([]) |
| 465 | 467 | ||
| 466 | 468 | ||
| 467 | const conditionOptions = ref([ | 469 | const conditionOptions = ref([ |
| 468 | - { text: '全新', value: '全新' }, | 470 | + { text: '9成新', value: '9成新' }, |
| 469 | { text: '8成新', value: '8成新' }, | 471 | { text: '8成新', value: '8成新' }, |
| 470 | { text: '7成新', value: '7成新' }, | 472 | { text: '7成新', value: '7成新' }, |
| 471 | { text: '6成新', value: '6成新' }, | 473 | { text: '6成新', value: '6成新' }, |
| ... | @@ -858,7 +860,7 @@ const onBrandModelCancel = () => { | ... | @@ -858,7 +860,7 @@ const onBrandModelCancel = () => { |
| 858 | const convertTextToScore = (text, type) => { | 860 | const convertTextToScore = (text, type) => { |
| 859 | if (type === 'condition') { | 861 | if (type === 'condition') { |
| 860 | const conditionMap = { | 862 | const conditionMap = { |
| 861 | - '全新': 5, | 863 | + '9成新': 5, |
| 862 | '8成新': 4, | 864 | '8成新': 4, |
| 863 | '7成新': 3, | 865 | '7成新': 3, |
| 864 | '6成新': 2, | 866 | '6成新': 2, |
| ... | @@ -884,7 +886,7 @@ const convertTextToScore = (text, type) => { | ... | @@ -884,7 +886,7 @@ const convertTextToScore = (text, type) => { |
| 884 | const convertScoreToText = (score, type) => { | 886 | const convertScoreToText = (score, type) => { |
| 885 | if (type === 'condition') { | 887 | if (type === 'condition') { |
| 886 | const scoreMap = { | 888 | const scoreMap = { |
| 887 | - 5: '全新', | 889 | + 5: '9成新', |
| 888 | 4: '8成新', | 890 | 4: '8成新', |
| 889 | 3: '7成新', | 891 | 3: '7成新', |
| 890 | 2: '6成新', | 892 | 2: '6成新', |
| ... | @@ -1232,6 +1234,11 @@ useDidShow(async () => { | ... | @@ -1232,6 +1234,11 @@ useDidShow(async () => { |
| 1232 | return | 1234 | return |
| 1233 | } | 1235 | } |
| 1234 | 1236 | ||
| 1237 | + // 如果已经显示过收款说明弹框,则跳过(避免应用切换时重复显示) | ||
| 1238 | + if (hasShownPaymentAgreement.value) { | ||
| 1239 | + return | ||
| 1240 | + } | ||
| 1241 | + | ||
| 1235 | const hasPermission = await checkUserPermission() | 1242 | const hasPermission = await checkUserPermission() |
| 1236 | 1243 | ||
| 1237 | if (!hasPermission) { | 1244 | if (!hasPermission) { |
| ... | @@ -1240,6 +1247,14 @@ useDidShow(async () => { | ... | @@ -1240,6 +1247,14 @@ useDidShow(async () => { |
| 1240 | 1247 | ||
| 1241 | // 权限验证通过,显示收款说明弹框 | 1248 | // 权限验证通过,显示收款说明弹框 |
| 1242 | paymentAgreementVisible.value = true | 1249 | paymentAgreementVisible.value = true |
| 1250 | + // 标记已经显示过弹框 | ||
| 1251 | + hasShownPaymentAgreement.value = true | ||
| 1252 | +}) | ||
| 1253 | + | ||
| 1254 | +// 页面隐藏时执行(切换应用或跳转到其他页面) | ||
| 1255 | +useDidHide(() => { | ||
| 1256 | + // 重置弹框显示标记,确保下次进入页面时能正常显示 | ||
| 1257 | + hasShownPaymentAgreement.value = false | ||
| 1243 | }) | 1258 | }) |
| 1244 | 1259 | ||
| 1245 | /** | 1260 | /** | ... | ... |
-
Please register or login to post a comment