Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
jgdl
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-08-13 16:36:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7704cd80b38088e61f82c16aced931f44ee834f6
7704cd80
1 parent
cfefe9c8
文字修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
src/pages/sell/index.vue
src/pages/sell/index.vue
View file @
7704cd8
...
...
@@ -332,7 +332,7 @@
<script setup>
import { ref, reactive, onMounted, computed } from 'vue'
import { Plus, Right, Location, Close } from '@nutui/icons-vue-taro'
import Taro, { useDidShow } from '@tarojs/taro'
import Taro, { useDidShow
, useDidHide
} from '@tarojs/taro'
import BASE_URL from '@/utils/config';
import BrandModelPicker from '@/components/BrandModelPicker.vue'
import PaymentAgreementModal from '@/components/PaymentAgreementModal.vue'
...
...
@@ -423,6 +423,8 @@ const tireWearPickerVisible = ref(false)
const paymentAgreementVisible = ref(false)
// 标记是否是上传图片后触发的useDidShow
const isUploadingImage = ref(false)
// 标记是否已经显示过收款说明弹框(避免应用切换时重复显示)
const hasShownPaymentAgreement = ref(false)
// 新的品牌型号选择器状态
// 品牌型号选择器组件引用
...
...
@@ -465,7 +467,7 @@ const modelOptions = ref([])
const conditionOptions = ref([
{ text: '
全新', value: '全
新' },
{ text: '
9成新', value: '9成
新' },
{ text: '8成新', value: '8成新' },
{ text: '7成新', value: '7成新' },
{ text: '6成新', value: '6成新' },
...
...
@@ -487,7 +489,7 @@ const wearLevelOptions = ref([
const triggerUpload = (type) => {
// 设置上传标记
isUploadingImage.value = true
Taro.chooseImage({
count: 1,
sizeType: ['compressed'],
...
...
@@ -533,7 +535,7 @@ const uploadImage = (filePath, type) => {
success: () => {
// 重置上传标记
isUploadingImage.value = false
if (res.statusCode === 200) {
uploadedImages[type] = upload_data.data.src;
// 同时更新formData中对应的照片字段
...
...
@@ -557,7 +559,7 @@ const uploadImage = (filePath, type) => {
success: () => {
// 重置上传标记
isUploadingImage.value = false
Taro.showToast({
icon: 'error',
title: '上传失败,稍后重试!',
...
...
@@ -858,7 +860,7 @@ const onBrandModelCancel = () => {
const convertTextToScore = (text, type) => {
if (type === 'condition') {
const conditionMap = {
'
全
新': 5,
'
9成
新': 5,
'8成新': 4,
'7成新': 3,
'6成新': 2,
...
...
@@ -884,7 +886,7 @@ const convertTextToScore = (text, type) => {
const convertScoreToText = (score, type) => {
if (type === 'condition') {
const scoreMap = {
5: '
全
新',
5: '
9成
新',
4: '8成新',
3: '7成新',
2: '6成新',
...
...
@@ -1231,7 +1233,12 @@ useDidShow(async () => {
if (isUploadingImage.value) {
return
}
// 如果已经显示过收款说明弹框,则跳过(避免应用切换时重复显示)
if (hasShownPaymentAgreement.value) {
return
}
const hasPermission = await checkUserPermission()
if (!hasPermission) {
...
...
@@ -1240,6 +1247,14 @@ useDidShow(async () => {
// 权限验证通过,显示收款说明弹框
paymentAgreementVisible.value = true
// 标记已经显示过弹框
hasShownPaymentAgreement.value = true
})
// 页面隐藏时执行(切换应用或跳转到其他页面)
useDidHide(() => {
// 重置弹框显示标记,确保下次进入页面时能正常显示
hasShownPaymentAgreement.value = false
})
/**
...
...
Please
register
or
login
to post a comment