hookehuyr

文字修改

...@@ -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成新' },
...@@ -487,7 +489,7 @@ const wearLevelOptions = ref([ ...@@ -487,7 +489,7 @@ const wearLevelOptions = ref([
487 const triggerUpload = (type) => { 489 const triggerUpload = (type) => {
488 // 设置上传标记 490 // 设置上传标记
489 isUploadingImage.value = true 491 isUploadingImage.value = true
490 - 492 +
491 Taro.chooseImage({ 493 Taro.chooseImage({
492 count: 1, 494 count: 1,
493 sizeType: ['compressed'], 495 sizeType: ['compressed'],
...@@ -533,7 +535,7 @@ const uploadImage = (filePath, type) => { ...@@ -533,7 +535,7 @@ const uploadImage = (filePath, type) => {
533 success: () => { 535 success: () => {
534 // 重置上传标记 536 // 重置上传标记
535 isUploadingImage.value = false 537 isUploadingImage.value = false
536 - 538 +
537 if (res.statusCode === 200) { 539 if (res.statusCode === 200) {
538 uploadedImages[type] = upload_data.data.src; 540 uploadedImages[type] = upload_data.data.src;
539 // 同时更新formData中对应的照片字段 541 // 同时更新formData中对应的照片字段
...@@ -557,7 +559,7 @@ const uploadImage = (filePath, type) => { ...@@ -557,7 +559,7 @@ const uploadImage = (filePath, type) => {
557 success: () => { 559 success: () => {
558 // 重置上传标记 560 // 重置上传标记
559 isUploadingImage.value = false 561 isUploadingImage.value = false
560 - 562 +
561 Taro.showToast({ 563 Taro.showToast({
562 icon: 'error', 564 icon: 'error',
563 title: '上传失败,稍后重试!', 565 title: '上传失败,稍后重试!',
...@@ -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成新',
...@@ -1231,7 +1233,12 @@ useDidShow(async () => { ...@@ -1231,7 +1233,12 @@ useDidShow(async () => {
1231 if (isUploadingImage.value) { 1233 if (isUploadingImage.value) {
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 /**
......