修改课程记录bug

This commit is contained in:
田岩
2025-09-16 14:33:42 +08:00
parent 5d1ba8a22e
commit 7f3b3829a2
10 changed files with 81 additions and 128 deletions
-1
View File
@@ -6,7 +6,6 @@ import common from '@/common/common.js'
const ENV = import.meta.env
export const get_base_url = (url = '') => {
if (ENV.MODE === 'development') { // 开发环境
// #ifdef H5
if (url) {
+17 -2
View File
@@ -28,13 +28,17 @@
<script>
import { downloadFile,getPreviewFileUrl } from'@/api/common.js'
import { useStorageStore } from "@/store/storage.js"
import { get_base_url } from '@/api/request.js'
export default {
name:"video-preview",
props:{
fileId:{
default:'',
type:String
},
src:{
default:'',
type:String
}
},
data() {
@@ -42,7 +46,8 @@
showModel: false,
fileUrlShow:'',
watching:false,
videoContext: null
videoContext: null,
base_url: get_base_url()
};
},
computed:{
@@ -65,6 +70,16 @@
},
immediate: true,
deep: true,
},
src: {
handler(newval, oldval) {
// if (newval && this.watching) {
this.fileUrlShow = this.base_url + newval
console.log('this.fileUrlShow', this.fileUrlShow);
// }
},
immediate: true,
deep: true,
}
},
methods: {
@@ -12,7 +12,7 @@
<view class="analysis_title">
<view class="success_answer">正确答案{{ dataInfo.itemAnswer }}</view>
</view>
<view class="analysis_note">解析{{ dataInfo?.analyContent }}</view>
<view class="analysis_note">题解析{{ dataInfo?.analyContent }}</view>
</view>
</view>
</template>
@@ -21,6 +21,7 @@
<view class="talking-cont">
<!-- 题干/段落内容 -->
<view class="talking-num"> {{dataInfo.titleNum||''}} </view>
<view class="talking-num"> {{dataInfo.title||''}} </view>
<text class="talking-text" v-if="[3, 5, 6, 9].indexOf(type) >= 0 && !dataInfo.isLoading">
{{ showContent }}
</text>
@@ -42,9 +43,17 @@
<!-- 试题问题反馈 -->
<!-- <RadioSubjectRequest v-if="[8].indexOf(type) >= 0 && dataInfo.qnsTyp !== 'ES'" :item="dataInfo" :mode="mode" @subject_click="subject_click" /> -->
<!-- 段落图片视频预览 -->
<view v-if="type === 3" style="overflow: hidden;">
<!-- <view v-if="type === 3" style="overflow: hidden;">
<ImagePreview class="cont-img-box" v-if="(dataInfo.imageAddrs||[]).length>0" :imgId="dataInfo.imageAddrs[0]" :previewDetail="true"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="(dataInfo.vidoAddrs||[]).length>0" :fileId="dataInfo.vidoAddrs[0]"></VideoPreview>
</view> -->
<!-- 举例预览 -->
<view class="talking-text" v-if="type === 3 && dataInfo.exampie " style="overflow: hidden;">
举例{{ dataInfo.exampie }}
</view>
<view style="overflow: hidden;">
<ImagePreview class="cont-img-box" v-if="dataInfo.imgAddr" :src="dataInfo.imgAddr" :previewDetail="true"></ImagePreview>
<VideoPreview class="cont-img-box" v-if="dataInfo.vidAddr" :src="dataInfo.vidAddr"></VideoPreview>
</view>
<!-- 维度信息预览 -->
<view v-if="[4, 8].indexOf(type) >= 0 && dataInfo.qnsTyp === 'ES'" style="padding-top: 16rpx;">
@@ -56,10 +65,7 @@
<view class="talking-text" v-if="type === 5 && !dataInfo.isLoading" style="overflow: hidden;">
参考答案{{ dataInfo.itemAnswer }}
</view>
<!-- 举例预览 -->
<view class="talking-text" v-if="type === 3 && dataInfo.exampie " style="overflow: hidden;">
举例{{ dataInfo.exampie }}
</view>
</view>
<view class="btns-cont" v-show="!dataInfo.isLoading" v-if="!([3, 8, 4].indexOf(type) >= 0)">
<!-- 重新播放 -->
@@ -5,13 +5,13 @@
<view class="course-study-body">
<view class="body-title">
<uv-icon class="arrow-icon" name="arrow-left" @click="backRouter()" />
{{ recordTitle }}
学习记录
</view>
<scroll-view class="talking-list" :scroll-y="true" :scroll-top="scrollTop" :show-scrollbar="false"
:scroll-with-animation="true">
<talkingItem v-for="item in talkingList" :type="item.type"
:dataInfo="item" :activeVoiceId="activeVoiceTalkingItemId" :isPlaying="activeVoiceTalkingItemId === item.id"
:voiceRate="chooseRate" />
:voiceRate="chooseRate"/>
</scroll-view>
</view>
</view>
@@ -54,7 +54,8 @@
...t,
id: 'prgh-'+index,
chatContent:( t.pgrphContent || ''),
titleNum: '知识点'+(index+1)+''+ t.title,
titleNum: '知识点'+(index+1)+'',
title:t.title,
type: 3
})
if(t.qnsInfoVos && t.qnsInfoVos.length>0){
+3 -2
View File
@@ -2,8 +2,9 @@
<view class="main_div max_page">
<nav-bar :is_seat="true"></nav-bar>
<view class="nav-div">
<view class="title ellipsis-text">考试结算</view>
<view class="title ellipsis-text">
{{result.mode==='record'?'考试纪录':'考试结算'}}
</view>
<view class="back_div" @click="goto_back()">
<view class="back-icon"></view>
</view>
+1 -1
View File
@@ -117,7 +117,7 @@
// 登录方法
const login_fun = (): void => {
// 验证
if (login_button_status.value) return common.msg('请阅读并同意《隐私政策》');
if (login_button_status.value) return common.msg('请阅读并同意《用户隐私协议》');
if (account.value === '') return common.msg('账号不能为空');
if (password.value === '') return common.msg('密码不能为空');
try {
+41 -112
View File
@@ -1,35 +1,26 @@
<template>
<view class="main_div max_page">
<view class="body-title">
<view class="back_div" @click="common.navigateBack()">
<view class="back-icon"></view>
<z-paging ref="pagingRef" v-model="data_list" @query="queryList" class="scroll_div" empty-view-text="暂无数据">
<template #top>
<view class="main_div">
<view class="body-title">
<view class="back_div" @click="common.navigateBack()">
<view class="back-icon"></view>
</view>
<view>消息</view>
<view class="delete_div" @click="oneClickReadMessage">
<image
class="img"
src="@/static/images/messageNotification/delete_icon.png"
mode="aspectFit"
></image>
</view>
</view>
</view>
<view>消息</view>
<view class="delete_div" @click="oneClickReadMessage">
<image class="img" src="@/static/images/messageNotification/delete_icon.png" mode="aspectFit"></image>
</view>
</view>
<scroll-view
ref="scrollRef"
:scroll-y="true"
class="scroll-Y"
:refresher-enabled="false"
:show-scrollbar="false"
@scrolltolower="scrolltolower"
@refresherrefresh="onRefresh"
@refresherrestore="triggered = 'restore'"
:refresher-triggered="triggered"
refresher-default-style="none"
>
</template>
<view class="scroll-Y">
<view class="item" v-for="(item, index) in data_list" @click="readMessageOpen(item)">
<view class="icon">
<image class="img_100" :src="imageMap[item.noticeTyp]" mode="widthFix"></image>
<!-- <image
v-if="item.noticeTyp == '02'"
class="img_100"
src="@/static/images/messageNotification/type_02.png"
mode="widthFix"
></image> -->
</view>
<view class="right">
<view class="top">
@@ -44,16 +35,20 @@
<view class="note ellipsis-text">
{{ item.noticeContent }}
</view>
<!-- <view class="num_div"></view> -->
<view class="read_div" v-if="item?.isRead === '01'"></view>
</view>
</view>
</view>
<list-no-data v-if="total === 0 && status == 'nomore'">暂无数据</list-no-data>
<uv-load-more v-if="total !== 0" :status="status" loadmore-text="轻轻上拉加载" :height="30"></uv-load-more>
</scroll-view>
</view>
<uni-popup ref="popup" type="bottom">
<view class="popup">
<view
class="popup"
@touchmove.stop.prevent="
() => {
return false;
}
"
>
<view class="message_popup_div">
<view class="title">
{{ popup_info.title }}
@@ -65,11 +60,11 @@
</view>
</view>
</uni-popup>
</view>
</z-paging>
</template>
<script setup>
import { ref, reactive, nextTick, onMounted } from 'vue';
import { ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { queryTraPersonalMessageNoticePaging, readNotice, oneTimeRead } from '@/api/messageNotification.js';
import common from '../../common/common';
@@ -78,24 +73,18 @@
import type_02 from '@/static/images/messageNotification/type_02.png';
import type_03 from '@/static/images/messageNotification/type_03.png';
import type_04 from '@/static/images/messageNotification/type_04.png';
import useZpaging from '@/composables/useZpaging.js';
const { pagingRef, queryList, data_list, reload } = useZpaging({
fetchFunction: queryTraPersonalMessageNoticePaging
});
const imageMap = {
'01': type_01,
'02': type_02,
'03': type_03,
'04': type_04
};
const status = ref('loadmore'); // loadmore - 加载前,loading - 加载中,nomore - 没有数据
const limit = 20;
const total = ref(-1);
const page = ref(0);
const data_list = reactive([]);
const triggered = ref(false);
const _freshing = ref(false);
const readLoading = ref(false);
const offset = ref(0);
const scrollRef = ref(null);
const popup_info = reactive({
id: '',
title: '',
@@ -104,55 +93,6 @@
});
const popup = ref(null);
// 下拉过程中触发
const onPulling = (e) => {
page.value = 1;
total.value = -1;
page.data_list.length = 0;
getData();
};
// 刷新处理函数
const onRefresh = () => {
if (_freshing.value) return;
_freshing.value = true;
setTimeout(() => {
triggered.value = false;
_freshing.value = false;
}, 1000);
};
const getData = (from = '') => {
if (from === 'first') {
if (total.value !== -1) {
return;
}
status.value = 'loading';
total.value = -1;
page.value = 1;
data_list.length = 0;
} else {
if (status.value !== 'loadmore' && status.value !== '') return;
status.value = 'loading';
page.value++;
}
queryTraPersonalMessageNoticePaging({
page: page.value,
limit: limit
})
.then((res) => {
total.value = res.total;
data_list.push(...res.body);
})
.finally(() => {
if (data_list.length >= total.value) {
status.value = 'nomore';
} else {
status.value = 'loadmore';
}
});
};
const readMessage = () => {
if (popup_info.isRead === '02') {
popup.value.close();
@@ -163,7 +103,7 @@
.then((res) => {
popup.value.close();
readLoading.value = false;
data_list.forEach((item) => {
data_list.value.forEach((item) => {
if (item.noticeId === popup_info.id) {
item.isRead = res.body.isRead;
return;
@@ -174,8 +114,9 @@
readLoading.value = false;
});
};
const oneClickReadMessage = () => {
const state = data_list.every((res) => res.isRead === '02');
const state = data_list.value.every((res) => res.isRead === '02');
if (state) {
common.msg('暂无未读消息');
return;
@@ -183,7 +124,7 @@
common.loading();
oneTimeRead()
.then((res) => {
data_list.forEach((item) => {
data_list.value.forEach((item) => {
item.isRead = '02';
});
common.hideLoading();
@@ -205,12 +146,6 @@
popup_info.isRead = item.isRead;
popup.value.open();
};
const scrolltolower = (item) => {
getData();
};
onMounted(() => {
getData();
});
</script>
<style scoped lang="scss">
@@ -266,17 +201,11 @@
}
}
}
.scroll-Y {
// 70rpx 改成100 78没了
height: calc(100vh - 100rpx - var(--status-bar-height) - 40rpx);
height: 100%;
position: relative;
overflow: hidden;
border-radius: 20rpx 20rpx 0 0;
position: relative;
background-color: #fff;
box-shadow: 0 -12rpx 12rpx #c3dbff;
.item {
height: 154rpx;
padding: 38rpx 0 38rpx 0;
@@ -284,7 +213,7 @@
display: flex;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #efefef;
border-bottom: 2rpx solid #efefef;
.icon {
width: 78rpx;
height: 78rpx;
@@ -370,12 +299,12 @@
background-repeat: no-repeat; /* 防止渐变重复平铺 */
padding-top: var(--status-bar-height);
overflow: hidden;
margin-bottom: -20rpx;
}
.body-title {
width: 100%;
height: 100rpx;
// 80改成100
height: 120rpx;
font-size: 33rpx;
padding-top: 10rpx;
font-weight: 500;
+2
View File
@@ -15,6 +15,7 @@ export const useSocketStore = defineStore('socketStore',{
},
actions:{
creatSocket(url = '/trastudy/trasoket/open?summary='){
console.log('打开websocket');
if(this.SocketObj && this.SocketObj?.close && !this.SocketObj?.isClose) {
return
}
@@ -25,6 +26,7 @@ export const useSocketStore = defineStore('socketStore',{
this.SocketObj = new SocketClass(_baseUrl + url + getToken());
},
closeSocket() {
console.log('关闭websocket');
if(!(this.SocketObj && this.SocketObj?.close)) return
this.SocketObj && this.SocketObj.close()
},