feat: 积分徽章

This commit is contained in:
杨航
2025-11-19 17:47:29 +08:00
parent 66c257e138
commit 51c0546ba0
2 changed files with 30 additions and 22 deletions
+22 -18
View File
@@ -120,7 +120,7 @@
</uv-overlay>
<PreviewDetail />
<badge ref="badgeRef"></badge>
<points ref="pointsRef" @confirm="pointsConfirm"></points>
<points ref="pointsRef"></points>
</view>
</template>
@@ -136,8 +136,10 @@ import TalkingItem from '@/pages/course/components/talkingItem.vue'
import ImagePreview from '@/components/image-preview/image-preview.vue'
import PreviewDetail from '@/components/image-preview/preview-detail.vue'
import TouchBtn from '@/pages/course/components/touchBtn.vue'
import badge from '@/components/points-and-badge/badge';
import points from '@/components/points-and-badge/points';
import badge from '@/components/points-and-badge/badge';
import points from '@/components/points-and-badge/points';
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
import { useSocketStore } from '@/store/socket.js'
import { useStorageStore } from '@/store/storage.js'
@@ -163,8 +165,8 @@ const flagVal = ref('1')
const isUploadingVoice = ref(false)
const isPreview = ref(false)
const IsAndEnv = ref(getPhoneEnvBool('AND'))
const badgeRef = ref(null);
const pointsRef = ref(null);
// const badgeRef = ref(null);
// const pointsRef = ref(null);
const ajaxApi = computed(() => (isPreview.value ? textChartPreviewApi : textChartApi))
@@ -426,19 +428,21 @@ const getGraphInfoUnStudy = (flag = 0, lastPgrphId = '') => {
})
.finally(() => {})
} else {
common
.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论')
.then(res => {
if (res) {
// 去评论
common.redirectTo(`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`)
} else {
// 取消
common.navigateBack()
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
})
.finally(() => {})
pointAndBadgesRun('02', crsId.value, ()=>{
common
.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论')
.then(res => {
if (res) {
// 去评论
common.redirectTo(`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`)
} else {
// 取消
common.navigateBack()
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
})
.finally(() => {})
})
}
return
+8 -4
View File
@@ -84,7 +84,7 @@
</view>
</view>
<badge ref="badgeRef"></badge>
<points ref="pointsRef" @confirm="pointsConfirm"></points>
<points ref="pointsRef"></points>
</view>
</template>
@@ -123,6 +123,8 @@
import TalkingItem from './components/talking-item.vue'
import badge from '@/components/points-and-badge/badge';
import points from '@/components/points-and-badge/points';
import usePointsAndBadge from '@/components/points-and-badge/usePointsAndBadge';
const { pointAndBadgesRun, badgeRef, pointsRef } = usePointsAndBadge();
const socketStore = useSocketStore();
@@ -133,8 +135,8 @@
const traId = ref('')
const chaId = ref('')
const talkingType = ref('')
const badgeRef = ref(null);
const pointsRef = ref(null);
// const badgeRef = ref(null);
// const pointsRef = ref(null);
const isPreview = ref(false)
const detailInfo = ref({})
const currentIndex = ref(0)
@@ -416,7 +418,9 @@
}).then(res=>{
watchFlag.value = 1;
socketStore?.closeSocket();
common.navigateTo('/pages/sparring/result?traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
pointAndBadgesRun(talkingType.value === '01'? '07': '08', null, ()=>{
common.navigateTo('/pages/sparring/result?traId=' + traId.value + '&execId=' + execId.value + '&type=' + talkingType.value + '&isPreview=' + (isPreview.value ?'1':''))
})
})
}
const getPointsList = (pointsList = [], badgesList = []) => {