From 2d5265187051cb9e9419493942e1d8fba4652938 Mon Sep 17 00:00:00 2001 From: woody Date: Tue, 30 Sep 2025 09:09:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(specialAreaMap):=20=E5=8D=8A=E4=BB=B7?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BA=94=E6=8A=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../special-area-wrapper.vue | 2 +- config/request.js | 2 +- pages/mine/index.vue | 112 +----------------- util/specialAreaMap.js | 2 +- 4 files changed, 4 insertions(+), 114 deletions(-) diff --git a/components/area-product-list/special-area-wrapper.vue b/components/area-product-list/special-area-wrapper.vue index 9520f85..def0630 100644 --- a/components/area-product-list/special-area-wrapper.vue +++ b/components/area-product-list/special-area-wrapper.vue @@ -45,7 +45,7 @@ > - + { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = 'http://192.168.2.105:8080/' + config.baseURL = 'http://192.168.2.86:8080/' //#endif //#ifdef QA_SERVER diff --git a/pages/mine/index.vue b/pages/mine/index.vue index d80d588..fc384de 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -353,50 +353,9 @@ export default { if (!isNormal) { return } - - // this.getUserAwardss() }) }, computed: { - sprintProgress() { - const targetPvStr = this.awards.targetPv - const sumRealPvStr = this.awards.sumRealPv // 这是"小区仅需"的量,即差距 - - const targetPv = parseFloat(targetPvStr) - const sumRealPv = parseFloat(sumRealPvStr) - - let achievedPv = 0 - let percentage = 0 - const numericTargetPv = - Math.floor((isNaN(targetPv) ? 0 : targetPv) * 100) / 100 - - if (!isNaN(targetPv) && targetPv > 0) { - // sumRealPv 是差距,所以已完成的是 targetPv - sumRealPv - achievedPv = targetPv - (isNaN(sumRealPv) ? 0 : sumRealPv) - - achievedPv = Math.max(0, Math.min(achievedPv, targetPv)) - - percentage = (sumRealPvStr / targetPv) * 100 - } else if ( - !isNaN(targetPv) && - targetPv === 0 && - !isNaN(sumRealPv) && - sumRealPv <= 0 - ) { - // 如果目标是0,且差距也是0或负数(表示已满足或超越0目标),则认为是100% - achievedPv = 0 - percentage = 100 - } - - const clampedPercentage = Math.min(100, Math.max(0, percentage)) - - return { - percentageString: `${Math.floor(clampedPercentage)}%`, - achieved: (Math.floor(achievedPv * 100) / 100).toFixed(2), - target: numericTargetPv.toFixed(2), - rawPercentage: clampedPercentage, - } - }, formattedTotalSumPv() { const value = String(this.totalSumPv || '0.00') const parts = value.split('.') @@ -421,8 +380,6 @@ export default { pkBigMember: this.userInfo.memberCode, }).then(res => { if (res.code == 200) { - // this.totalBox = res.data?.totalBox || 0 - // this.smallAreaBox = res.data?.smallAreaBox || 0 this.totalSumPv = res.data?.totalSumPv || 0 this.smallAreaPv = res.data?.smallAreaPv || 0 } @@ -435,62 +392,7 @@ export default { } }) }, - openRegionSelect() { - uni.showLoading({ - title: '加载中...', - }) - this.$refs.regionSelect - ?.open() - .then(() => { - uni.hideLoading() - }) - .catch(() => { - uni.hideLoading() - }) - }, - goYear() { - uni.navigateTo({ - url: '/pages/mine/yearGift/index', - }) - }, - closeShow() { - this.drShow = false - }, - goHonoray() { - uni.navigateTo({ - url: '/pages/mine/honoraryAwards/honoraryAwards', - }) - }, - //获取用户真实奖衔 - getUserAwardss() { - api.getUserAwards().then(res => { - this.awards = res.data || {} - }) - }, - GetPercent(num, total) { - num = parseFloat(num) - total = parseFloat(total) - if (isNaN(num) || isNaN(total)) { - return '-' - } - if (total == 0) { - return '0%' - } else if (total < 0) { - return 100 + '%' - } else { - return Math.round((num / total) * 10000) / 100.0 + '%' - } - }, - yesPercent(left, right) { - left = parseFloat(left) - right = parseFloat(right) - if (isNaN(left) || isNaN(right)) { - return '0%' - } - return right + left == 0 - ? '0%' - : Math.round((left / (right + left)) * 10000) / 100.0 + '%' - }, + orderNum() { api.orderNum().then(res => { this.waitPayNum = res.data.waitPayNum @@ -536,18 +438,6 @@ export default { url: '/pages/mine/order/index?isTab=' + index, }) }, - goRoad(index) { - //1等级2奖衔 - if (index == 1) { - uni.navigateTo({ - url: '/pages/mine/growthRoad/gradeRoad', - }) - } else if (index == 2) { - uni.navigateTo({ - url: '/pages/mine/growthRoad/awardRoad', - }) - } - }, loginOut() { uni.setStorageSync('pkCountry', '') uni.setStorageSync('showInfo', 0) diff --git a/util/specialAreaMap.js b/util/specialAreaMap.js index 8a5f742..f677cea 100644 --- a/util/specialAreaMap.js +++ b/util/specialAreaMap.js @@ -20,5 +20,5 @@ export const REPURCHASE_AREA = { export const HALF_PRICE_AREA = { id: 47, - name: '半价专区', + name: '五折专区', }