Merge branch 'dev' of 47.94.45.65:angelo/web-zk-h5 into test
This commit is contained in:
commit
5790869c61
|
@ -45,7 +45,7 @@
|
|||
></area-product-list>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 半价 -->
|
||||
<!-- 五折 -->
|
||||
<view key="halfPrice" v-if="halfPriceList.length > 0" class="goods-flexs">
|
||||
<view class="goods-view">
|
||||
<area-product-list
|
||||
|
|
|
@ -20,7 +20,7 @@ module.exports = vm => {
|
|||
|
||||
//#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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -20,5 +20,5 @@ export const REPURCHASE_AREA = {
|
|||
|
||||
export const HALF_PRICE_AREA = {
|
||||
id: 47,
|
||||
name: '半价专区',
|
||||
name: '五折专区',
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue