解决积分徽章墙bug

This commit is contained in:
田岩
2025-11-24 20:45:23 +08:00
parent 3d90a6e6ad
commit b02cab32c0
14 changed files with 77 additions and 64 deletions
+4 -7
View File
@@ -6,20 +6,17 @@ ENV = 'development'
#VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001' #VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' #VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
# VITE_APP_BASE_API_Url = 'http://192.168.247.200' # VITE_APP_BASE_API_Url = 'http://192.168.247.200'
# VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001' # VITE_APP_BASE_API_Url = 'http://aitscdn.jlbank.com.cn:7001'
# VITE_APP_BASE_API_Url = 'http://192.168.108.129' # VITE_APP_BASE_API_Url = 'http://192.168.108.129'
# dev # dev
# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' #VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001'
# sit # sit
VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
# UAT # UAT
# VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786' # VITE_APP_BASE_API_Url = 'http://25.18.122.78:9786'
+1 -19
View File
@@ -97,15 +97,6 @@
nextTick(() => { nextTick(() => {
popup.value.close(); popup.value.close();
}); });
// uni.showTabBar({
// success() {
// opacity.value = 0;
// nextTick(() => {
// popup.value.close();
// });
// }
// });
}; };
// 点击 // 点击
const clickFun = (status = true) => { const clickFun = (status = true) => {
@@ -124,19 +115,10 @@
pointsList.value = points; pointsList.value = points;
opacity.value = 1; opacity.value = 1;
console.log('成功'); console.log('成功');
uni.$emit('update_me_data', true);
popup.value.open('center'); popup.value.open('center');
// uni.hideTabBar({
// success() {
// opacity.value = 1;
// console.log('成功');
// popup.value.open('center');
// }
// });
}; };
onUnmounted(() => { onUnmounted(() => {
// uni.showTabBar({
// success() {}
// });
}); });
defineExpose({ open, close }); defineExpose({ open, close });
</script> </script>
@@ -76,6 +76,7 @@
showData.value['num'] = firstItem['changePoints']; showData.value['num'] = firstItem['changePoints'];
showData.value['message'] = firstItem['message']; showData.value['message'] = firstItem['message'];
pointsList.value = remainingPoints; pointsList.value = remainingPoints;
uni.$emit('update_me_data', true);
popup.value.open(); popup.value.open();
}; };
const close = () => { const close = () => {
@@ -2,11 +2,11 @@
完成课程学习 首次完成1分 每天最多获取5分 完成课程学习 crsId 02 完成调用 杨航 完成课程学习 首次完成1分 每天最多获取5分 完成课程学习 crsId 02 完成调用 杨航
完成课程练习 首次完成1分 每天最多获取5分 完成课程练习 crsId 04 完成练习调用 田岩 已完成 完成课程练习 首次完成1分 每天最多获取5分 完成课程练习 crsId 04 完成练习调用 田岩 已完成
通过课程考试 首次完成1分 每天最多获取5分 通过课程考试 crsId 03 通过调用 田岩 已完成 通过课程考试 首次完成1分 每天最多获取5分 通过课程考试 crsId 03 通过调用 田岩 已完成
完成考试中心考试 首次完成1分 每天最多获取5分 完成考试中心考试 papersId 05 完成调用 田岩 已完成 完成考试中心考试 首次完成1分 每天最多获取5分 完成考试中心考试 papersId 05 完成调用 田岩 已完成
完成竞赛PK 每次1分 每天最多获取5分 完成竞赛PK 11 完成调用 田岩 已完成 完成竞赛PK 每次1分 每天最多获取5分 完成竞赛PK 11 完成调用 田岩 已完成
获取AI问答 次数徽章 06 建立ws完成调用 杨航 获取AI问答 次数徽章 06 建立ws完成调用 杨航
通过AI陪练练习 每次1分 每天最多获取5分 通过AI陪练练习 07 通过调用 杨航 通过AI陪练练习 每次1分 每天最多获取5分 通过AI陪练练习 07 通过调用 杨航
通过AI陪练考试 每次1分 每天最多获取5分 通过AI陪练考试 08 通过调用 杨航 通过AI陪练考试 每次1分 每天最多获取5分 通过AI陪练考试 08 通过调用 杨航
签到 每日1积分, 签到 每日1积分,
第七天5积分, 第七天5积分,
第30天20积分, 第30天20积分,
+8 -7
View File
@@ -44,17 +44,17 @@
<view class="topic-div number"> <view class="topic-div number">
<text class="loadingNoText font-size-54">{{ pkData.correctNub }}</text> <text class="loadingNoText font-size-54">{{ pkData.correctNub }}</text>
<text class="loadingNoText">/{{ pkData.qnsNub }}</text> <text class="loadingNoText">/{{ pkData.qnsNub }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
<view class="title">总分</view> <view class="title">总分</view>
<view class="score-div number"> <view class="score-div number">
<text class="font-size-54 loadingNoText">{{ pkData.totalScore }}</text> <text class="font-size-54 loadingNoText">{{ pkData.totalScore }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
<view class="title">用时</view> <view class="title">用时</view>
<view class="time-div number"> <view class="time-div number">
<text class="loadingNoText">{{ formatSecondsToMS(pkData.timeTaken) }}</text> <text class="loadingNoText">{{ formatSecondsToMS(pkData.timeTaken) }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
</view> </view>
<view class="pk-msg-right-div"> <view class="pk-msg-right-div">
@@ -69,17 +69,17 @@
<view class="topic-div number"> <view class="topic-div number">
<text class="loadingNoText font-size-54">{{ pkData.correctNubPk }}</text> <text class="loadingNoText font-size-54">{{ pkData.correctNubPk }}</text>
<text class="loadingNoText">/{{ pkData.qnsNubPk }}</text> <text class="loadingNoText">/{{ pkData.qnsNubPk }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
<view class="title">总分</view> <view class="title">总分</view>
<view class="score-div number"> <view class="score-div number">
<text class="font-size-54 loadingNoText">{{ pkData.totalScorePk }}</text> <text class="font-size-54 loadingNoText">{{ pkData.totalScorePk }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
<view class="title">用时</view> <view class="title">用时</view>
<view class="time-div number"> <view class="time-div number">
<text class="loadingNoText">{{ formatSecondsToMS(pkData.timeTakenPk) }}</text> <text class="loadingNoText">{{ formatSecondsToMS(pkData.timeTakenPk) }}</text>
<text class="loadingText">结算中</text> <text class="loadingText">{{resultStr}}</text>
</view> </view>
</view> </view>
</view> </view>
@@ -116,6 +116,7 @@
import points from '@/components/points-and-badge/points'; import points from '@/components/points-and-badge/points';
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge'; import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge(); const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
const resultStr = computed(() => mode.value === 'pk_result'?"加载中":"结算中")
const action = ref(''); const action = ref('');
const mode = ref(''); // 模式 PK中 pk_in Pk列表查询 pk_result const mode = ref(''); // 模式 PK中 pk_in Pk列表查询 pk_result
const autoSub = ref('00'); // 是否是自动提交 00 不是 01是 const autoSub = ref('00'); // 是否是自动提交 00 不是 01是
@@ -216,7 +217,7 @@
} }
}, delayTime); }, delayTime);
}); });
}, 2000); }, mode.value === 'pk_result'?0:1000);
}); });
</script> </script>
@@ -44,7 +44,7 @@
</view> </view>
</view> </view>
<view class="mb-64" v-if="(modelValue.fileList || []).length>0"> <view class="mb-64" v-if="(modelValue.fileList || []).length>0">
<view class="fz-30 font_pf fw-400 mb-4">知识资料</view> <view class="fz-30 font_pf fw-600 mb-4">知识资料</view>
<view class="file-item" v-for="item in modelValue.fileList" @click="previewFile(item)"> <view class="file-item" v-for="item in modelValue.fileList" @click="previewFile(item)">
{{item.fileName}} {{item.fileName}}
</view> </view>
+20 -5
View File
@@ -17,7 +17,7 @@
<view class="detail-body"> <view class="detail-body">
<view class="head-title font_pf"> <view class="head-title font_pf">
<view class="title-text"> <view class="title-text">
{{form.crsName}} {{ form.crsName }}
</view> </view>
<view class="title-num"> <view class="title-num">
<view class="num-item"> <view class="num-item">
@@ -93,10 +93,11 @@
<uv-button type="primary" @click="goto_study()">去学习</uv-button> <uv-button type="primary" @click="goto_study()">去学习</uv-button>
</view> </view>
<view class="fl1" @click="goto_practice()"> <view class="fl1" @click="goto_practice()">
<uv-button type="primary" :disabled="practiceButtonDisabled">去练习</uv-button> <uv-button type="success" :disabled="practiceButtonDisabled">去练习</uv-button>
</view> </view>
<view class="fl1" @click="goto_examination()"> <view class="fl1" @click="goto_examination()">
<uv-button type="primary" :disabled="examinationButtonDisabled">去考试</uv-button> <uv-button type="success" :disabled="examinationButtonDisabled">去考试</uv-button>
<!-- <uv-button type="success" :disabled="true">去考试</uv-button> -->
</view> </view>
</template> </template>
<template v-if="tabAct === 2"> <template v-if="tabAct === 2">
@@ -225,7 +226,7 @@
name: form.value.crsName, name: form.value.crsName,
crsId: crsId.value crsId: crsId.value
}); });
common.navigateTo('/pages/practice/index?examStat='+form.value.examStat); common.navigateTo('/pages/practice/index?examStat=' + form.value.examStat);
}) })
.finally(() => { .finally(() => {
common.hideLoading(); common.hideLoading();
@@ -290,7 +291,6 @@
// prevPage.$vm.$?.exposed?.reload('course', form.value); // prevPage.$vm.$?.exposed?.reload('course', form.value);
// } // }
uni.$emit('update_course_item', form.value); uni.$emit('update_course_item', form.value);
} }
} }
} }
@@ -298,6 +298,21 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// 1124新改样式 ↓ ↓ ↓ ↓ ↓ ↓
.btn-box {
:deep(.uv-button--disabled) {
background-color: #ededed;
color: #999999;
opacity: 1;
border-color: #ededed;
}
:deep(.uv-button--success:not(.uv-button--disabled)) {
background-color: #dcedff;
color: #0066ff;
border-color: #dcedff;
}
}
// 1124新改样式 ↑↑↑↑↑
.back_div { .back_div {
margin-right: 10rpx; margin-right: 10rpx;
position: fixed; position: fixed;
+19 -6
View File
@@ -166,7 +166,7 @@
<script setup> <script setup>
import { ref, computed, reactive, nextTick } from 'vue'; import { ref, computed, reactive, nextTick } from 'vue';
import { onLoad, onShow, onHide } from '@dcloudio/uni-app'; import { onLoad, onShow, onHide, onUnload } from '@dcloudio/uni-app';
import common from '@/common/common'; import common from '@/common/common';
import { getUserInfo } from '@/common/common'; import { getUserInfo } from '@/common/common';
import { onPullDownRefresh } from '@dcloudio/uni-app'; import { onPullDownRefresh } from '@dcloudio/uni-app';
@@ -278,31 +278,38 @@
this.currentRankName = points_data.currentRankName; this.currentRankName = points_data.currentRankName;
} }
} }
// 解构赋值获取最新值 // 解构赋值获取最新值
const { badgeNum = 0, currentPoints = 0 } = points_data; const { badgeNum = 0, currentPoints = 0, currentRankAddr = '' } = points_data;
this.currentRankAddr = currentRankAddr; // 赋值段位变化
// 更新数据并触发动画 // 更新数据并触发动画
if (badgeNum !== this.badgeNum) { if (badgeNum !== this.badgeNum) {
this.startBadgeNum = this.badgeNum; this.startBadgeNum = this.badgeNum;
this.badgeNum = badgeNum; this.badgeNum = badgeNum;
badgeNumRef.value.start(); badgeNumRef.value.start();
} }
if (currentPoints !== this.currentPoints) { if (currentPoints !== this.currentPoints) {
this.startCurrentPoints = this.currentPoints; this.startCurrentPoints = this.currentPoints;
this.currentPoints = currentPoints; this.currentPoints = currentPoints;
currentPointsRef.value.start(); currentPointsRef.value.start();
} }
} catch (error) { } catch (error) {
console.error('获取统计数据失败:', error); console.error('获取统计数据失败:', error);
// 可以在这里添加更多的错误处理逻辑,比如显示错误提示
} }
} }
}); });
onLoad(() => { onLoad(() => {
statistics_data['init'](); // 初始化数据 statistics_data['init'](); // 初始化数据
uni.$on('update_me_data', (status) => {
// 获取了徽章或者积分,把缓存时间重置,以便下次进入me页实时获取
console.log('获取了徽章或者积分,把缓存时间重置,以便下次进入me页实时获取');
if(status) {
statistics_data.request_time = 0;
}
});
}); });
onShow(() => { onShow(() => {
setMascot(); setMascot();
@@ -320,6 +327,12 @@
onPullDownRefresh(() => { onPullDownRefresh(() => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}); });
onUnload(() => {
uni.$off('update_me_data');
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
+1 -1
View File
@@ -49,7 +49,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, defineExpose } from 'vue'; import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
import { import {
queryTraPersonalMessageNoticePaging, queryTraPersonalMessageNoticePaging,
+1 -4
View File
@@ -75,11 +75,9 @@
const fetchFunction = (params) => { const fetchFunction = (params) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
queryRankWall().then(({ body }) => { queryRankWall().then(({ body }) => {
console.log('body', body);
let originalData = body; let originalData = body;
// 处理逻辑:构建二维数组(外层分类列表 + 内层徽章列表) // 处理逻辑:构建二维数组(外层分类列表 + 内层徽章列表)
const twoDimensionalArray = []; const twoDimensionalArray = [];
// 遍历每个分类,生成二维数组的每一项 // 遍历每个分类,生成二维数组的每一项
Object.entries(originalData).forEach(([categoryKey, badgeArray]) => { Object.entries(originalData).forEach(([categoryKey, badgeArray]) => {
// 构建外层列表项:包含 name 和子列表 badgeList // 构建外层列表项:包含 name 和子列表 badgeList
@@ -87,11 +85,10 @@
name: categoryKey, // 第一维度的 name 是原始键 name: categoryKey, // 第一维度的 name 是原始键
child: badgeArray // 子列表:直接放入当前分类的所有徽章数据 child: badgeArray // 子列表:直接放入当前分类的所有徽章数据
}; };
// 将分类项加入二维数组 // 将分类项加入二维数组
twoDimensionalArray.push(categoryItem); twoDimensionalArray.push(categoryItem);
}); });
console.log('resultList', twoDimensionalArray); uni.$emit('update_me_data', true);
resolve({ resolve({
body: twoDimensionalArray body: twoDimensionalArray
}); });
+13 -5
View File
@@ -63,11 +63,20 @@
const startVal = ref(0); const startVal = ref(0);
const endVal = ref(0); const endVal = ref(0);
const countToRef = ref(null); const countToRef = ref(null);
const points_data = ref({});
const fetchFunction = (params) => { const fetchFunction = (params) => {
queryCurrentStatus().then(({ body }) => { queryCurrentStatus().then(({ body }) => {
const { currentPoints } = body; const { currentPoints } = body;
if (currentPoints !== endVal.value) { if (currentPoints !== endVal.value) {
endVal.value = currentPoints; endVal.value = currentPoints;
points_data.value = {
badgeNum: body['badgeNum'], // 徽章数
currentPoints: body['currentPoints'], // 当前积分
currentRankAddr: body['ossAddr'], // 当前段位图片
currentRankName: body['currentRankName'] // 当前段位名称
};
common.setValue('points_data', points_data.value);
countToRef.value.start(); countToRef.value.start();
} }
}); });
@@ -76,12 +85,11 @@
const { pagingRef, queryList, data_list, search } = useZpaging({ const { pagingRef, queryList, data_list, search } = useZpaging({
fetchFunction fetchFunction
}); });
onLoad(() => { onLoad(() => {
const points_data = common.getValue('points_data'); points_data.value = common.getValue('points_data');
if (points_data) { if (points_data.value) {
startVal.value = points_data.currentPoints; // 徽章数 startVal.value = points_data.value.currentPoints; // 徽章数
endVal.value = points_data.currentPoints; // 徽章数 endVal.value = points_data.value.currentPoints; // 徽章数
} }
}); });
onUnload(() => {}); onUnload(() => {});
+1
View File
@@ -118,6 +118,7 @@
data.actStatus = body.actStatus; data.actStatus = body.actStatus;
data.actStatusText = body.actStatusText; data.actStatusText = body.actStatusText;
common.msg(body.result); common.msg(body.result);
uni.$emit('update_me_data', true);
}) })
.finally(() => { .finally(() => {
buttonLoading.value = false; buttonLoading.value = false;
+1
View File
@@ -178,6 +178,7 @@
if (points?.length > 0) { if (points?.length > 0) {
showData.value.num = points[0]['changePoints']; showData.value.num = points[0]['changePoints'];
showData.value.message = message; showData.value.message = message;
uni.$emit('update_me_data', true);
} }
if (pointsBadges.length > 0) { if (pointsBadges.length > 0) {
nextTick(() => { nextTick(() => {
@@ -51,7 +51,6 @@
} }
.item { .item {
// height: 170rpx;
margin: 22rpx 22rpx; margin: 22rpx 22rpx;
display: flex; display: flex;
.img_div { .img_div {
@@ -61,12 +60,10 @@
overflow: hidden; overflow: hidden;
border-radius: 16rpx; border-radius: 16rpx;
.img { .img {
// width: 224rpx;
// height: 168rpx;
width: 256rpx; width: 256rpx;
height: 144rpx; height: 144rpx;
} }
.subscript { .subscript {
position: absolute; position: absolute;
right: 0; right: 0;