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