From 16d41c48578d36b99ed555fce8a124a7176a220b Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 8 May 2025 11:56:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(mine):=E5=B1=95=E7=A4=BA=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB=E4=B8=8B=E4=B8=AA=E5=A5=96=E8=A1=94=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=96=87=E6=A1=88=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/index.vue | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 60344c9..7b0803a 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -57,7 +57,20 @@ + + + 当前距离 + + {{ awards.tarAwardsName }} + + 奖衔,小区仅需 + + {{ + awards.targetPv + }} + + @@ -147,6 +160,7 @@ class="theorderflex1" @click="goTo(item.url)" v-if="item.ifshow" + :key="index" > {{ item.name }} @@ -746,6 +760,27 @@ export default { background: #ffffff; font-size: 24rpx; + .descriptive-text { + font-size: 22rpx; + color: #666666; + margin-right: 8rpx; + } + + .highlight-name { + font-size: 30rpx; /* 示例字号,您可以根据需要调整 */ + font-weight: bold; + color: #005BAC; /* 示例颜色,您可以根据需要调整 */ + padding: 0 8rpx; /* 增加一些内边距,使其更突出 */ + margin-right: 10rpx; /* 在名称和下一个标签之间添加间距 */ + } + + .highlight-pv { + font-size: 30rpx; /* 示例字号,您可以根据需要调整 */ + font-weight: bold; + color: #FF5722; /* 示例颜色,您可以根据需要调整 */ + padding: 0 8rpx; /* 增加一些内边距,使其更突出 */ + } + .ju_title { font-family: Source Han Sans CN; font-weight: bold; From 113e5e61ff4f08ea5417da6f75f07eb3cb89f41d Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 8 May 2025 12:50:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat(mine):=20=E6=B7=BB=E5=8A=A0=E5=A5=96?= =?UTF-8?q?=E8=A1=94=E8=B7=9D=E7=A6=BB=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/request.js | 2 +- pages/mine/index.vue | 115 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 3 deletions(-) diff --git a/config/request.js b/config/request.js index 5fa9b1b..767eacb 100644 --- a/config/request.js +++ b/config/request.js @@ -13,7 +13,7 @@ module.exports = (vm) => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = '/prod-api'; + config.baseURL = 'http://192.168.0.103:8080'; //#endif //#ifdef QA_SERVER diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 7b0803a..8a2f1a2 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -59,7 +59,7 @@ - + 当前距离 {{ awards.tarAwardsName }} @@ -67,7 +67,7 @@ 奖衔,小区仅需 {{ - awards.targetPv + awards.sumRealPv }} @@ -116,6 +116,18 @@ > + + 奖衔冲刺 + + + + 已完成 {{ sprintProgress.achieved }} / 目标 {{ sprintProgress.target }} + + + @@ -459,6 +471,45 @@ export default { 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; + let displayTargetPv = (isNaN(targetPv) ? 0 : targetPv).toFixed(2); + + if (!isNaN(targetPv) && targetPv > 0) { + // sumRealPv 是差距,所以已完成的是 targetPv - sumRealPv + achievedPv = targetPv - (isNaN(sumRealPv) ? 0 : sumRealPv); + + // 确保 achievedPv 不会小于0(如果 sumRealPv > targetPv,理论上不应发生) + // 且不会大于 targetPv (如果 sumRealPv 是负数,表示已超额) + achievedPv = Math.max(0, Math.min(achievedPv, targetPv)); + + percentage = (achievedPv / 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: `${clampedPercentage.toFixed(0)}%`, + achieved: achievedPv.toFixed(2), + target: displayTargetPv, + rawPercentage: clampedPercentage + }; + } + }, + methods: { goYear(){ uni.navigateTo({ @@ -1223,4 +1274,64 @@ export default { margin-top: 30rpx; padding: 20rpx 22rpx 150rpx 22rpx; } + +.sprint-progress-container { + flex: 1; + height: 34rpx; + background: #eeeeee; + border-radius: 20rpx; + margin: 10rpx; + position: relative; + overflow: hidden; +} + +.sprint-current-progress { + position: absolute; + left: 0; + top: 0; + height: 100%; + border-radius: 20rpx; + background: linear-gradient(135deg, #ED9A38 0%, #FDD05F 50%, #E68A2E 100%); + transition: width 0.6s ease-in-out; + box-shadow: none; + overflow: hidden; +} + +.sprint-current-progress::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient( + 100deg, + rgba(255, 255, 255, 0) 20%, + rgba(255, 255, 255, 0.4) 50%, + rgba(255, 255, 255, 0) 80% + ); + transform: translateX(-100%); + animation: premium_shimmer_animation 2.5s infinite linear; +} + +@keyframes premium_shimmer_animation { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(100%); + } +} + +.sprint-progress-text { + width: 100%; + position: absolute; + top: 60%; + left: 0; + transform: translate(0%, -55%); + white-space: nowrap; + text-align: center; + font-size: 24rpx; + color: #333333; +} From 5970497069a0f473eab79cd2f6538b368b18ee5e Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 8 May 2025 12:50:43 +0800 Subject: [PATCH 3/4] feat(request): baseurl --- config/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/request.js b/config/request.js index 767eacb..5fa9b1b 100644 --- a/config/request.js +++ b/config/request.js @@ -13,7 +13,7 @@ module.exports = (vm) => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = 'http://192.168.0.103:8080'; + config.baseURL = '/prod-api'; //#endif //#ifdef QA_SERVER From 7d9d9e2bf3881e6334ea7fcbf8964240eb1892ec Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 8 May 2025 17:57:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix(mine):=20=E5=AD=97=E6=AE=B5=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=80=BB=E8=BE=91=E5=8F=98=E6=9B=B4=EF=BC=8C=20?= =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E4=BB=85=E9=9C=80=E5=AD=97=E6=AE=B5=E5=90=AB?= =?UTF-8?q?=E4=B9=89=E5=8F=98=E4=B8=BA=E9=9C=80=E8=A6=81=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=8E=B7=E5=BE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/index.vue | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 8a2f1a2..bc525c4 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -67,7 +67,8 @@ 奖衔,小区仅需 {{ - awards.sumRealPv + + sprintProgress.achieved }} @@ -124,7 +125,7 @@ :style="{ width: sprintProgress.percentageString }" > - 已完成 {{ sprintProgress.achieved }} / 目标 {{ sprintProgress.target }} + 已完成 {{ awards.sumRealPv }} / 目标 {{ sprintProgress.target }} @@ -481,17 +482,15 @@ export default { let achievedPv = 0; let percentage = 0; - let displayTargetPv = (isNaN(targetPv) ? 0 : targetPv).toFixed(2); + 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 不会小于0(如果 sumRealPv > targetPv,理论上不应发生) - // 且不会大于 targetPv (如果 sumRealPv 是负数,表示已超额) achievedPv = Math.max(0, Math.min(achievedPv, targetPv)); - percentage = (achievedPv / targetPv) * 100; + percentage = (sumRealPvStr / targetPv) * 100; } else if (!isNaN(targetPv) && targetPv === 0 && !isNaN(sumRealPv) && sumRealPv <=0) { // 如果目标是0,且差距也是0或负数(表示已满足或超越0目标),则认为是100% achievedPv = 0; @@ -502,9 +501,9 @@ export default { const clampedPercentage = Math.min(100, Math.max(0, percentage)); return { - percentageString: `${clampedPercentage.toFixed(0)}%`, - achieved: achievedPv.toFixed(2), - target: displayTargetPv, + percentageString: `${Math.floor(clampedPercentage)}%`, + achieved: (Math.floor(achievedPv * 100) / 100).toFixed(2), + target: numericTargetPv.toFixed(2), rawPercentage: clampedPercentage }; }