From 32b304bc153977e32571d0437e87811b367be30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B3=89=E5=BE=B7?= Date: Wed, 25 Jun 2025 13:58:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/pages.json | 9 + src/pages/me/index.vue | 590 ++++++++++++++++++------------------ src/pages/setting/index.vue | 144 +++++++++ src/pagesOther.json | 9 + 5 files changed, 451 insertions(+), 305 deletions(-) create mode 100644 src/pages/setting/index.vue diff --git a/.env.development b/.env.development index 9e88b879..eeaca914 100644 --- a/.env.development +++ b/.env.development @@ -9,8 +9,8 @@ ENV = 'development' # VITE_APP_BASE_API_Url = 'http://25.64.16.133:9786' -VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' +# VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001' app入口 -# VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' + VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' diff --git a/src/pages.json b/src/pages.json index 9cd6dcfe..d85cf603 100644 --- a/src/pages.json +++ b/src/pages.json @@ -27,6 +27,15 @@ } } }, + { + "path": "pages/setting/index", + "style": { + "navigationBarTitleText": "设置", + "app-plus": { + "titleNView": false + } + } + }, { "path": "pages/study/index", "style": { diff --git a/src/pages/me/index.vue b/src/pages/me/index.vue index e34556a1..1b4e75f2 100644 --- a/src/pages/me/index.vue +++ b/src/pages/me/index.vue @@ -14,19 +14,14 @@ - {{user_info.userName}} + {{ user_info.userName }} - - - - + + - - 工号:{{user_info.userId}} - + 工号:{{ user_info.userId }} @@ -35,22 +30,31 @@ 累计学习时长 - h + + h 累计完成任务 - + 累计获得积分 - + @@ -79,18 +83,17 @@ - - - - + + + + - - - + + + @@ -98,310 +101,291 @@ \ No newline at end of file +.main_div { + display: flex; + flex-direction: column; + background-color: #f6f8ff; +} + diff --git a/src/pages/setting/index.vue b/src/pages/setting/index.vue new file mode 100644 index 00000000..6146c3d8 --- /dev/null +++ b/src/pages/setting/index.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/src/pagesOther.json b/src/pagesOther.json index 04435044..bda555b2 100644 --- a/src/pagesOther.json +++ b/src/pagesOther.json @@ -26,6 +26,15 @@ "titleNView": false } } + }, + { + "path": "pages/setting/index", + "style": { + "navigationBarTitleText": "设置", + "app-plus": { + "titleNView": false + } + } } ], "tabBar": { From d7007f607b05806f34a3615ec753ced4f3c0029c Mon Sep 17 00:00:00 2001 From: yanghang Date: Wed, 25 Jun 2025 20:57:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/talkingItem.vue | 24 +++-- src/pages/course/study.vue | 100 ++++++++++++-------- src/static/images/course/play-blue.png | Bin 0 -> 1287 bytes src/static/images/course/stop-blue.png | Bin 0 -> 1155 bytes 4 files changed, 80 insertions(+), 44 deletions(-) create mode 100644 src/static/images/course/play-blue.png create mode 100644 src/static/images/course/stop-blue.png diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 09fcbc06..0767cd92 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -10,13 +10,13 @@ - + 阿列克山大是快乐的你艾德卡省的mask安东拉森扣篮大赛了快递那里是啊克里斯蒂娜老师的阿萨是看, - - + @@ -61,8 +61,8 @@ --> - - + + @@ -119,8 +119,13 @@ .talking-gif{ width: 140rpx; height: 38rpx; - background-color: #999; + background: url(@/static/images/course/voice-gray.png) no-repeat; + background-size: 100%; margin-bottom: 16rpx; + &.is-play{ + background: url(@/static/images/course/voice-gif.gif) no-repeat; + background-size: 100%; + } } .talking-cont{ .talking-text{ @@ -268,8 +273,13 @@ .talking-gif{ width: 140rpx; height: 38rpx; - background-color: #999; + background: url(@/static/images/course/voice-gray.png) no-repeat; + background-size: 100%; margin-bottom: 16rpx; + &.is-play{ + background: url(@/static/images/course/voice-gif.gif) no-repeat; + background-size: 100%; + } } .talking-cont{ .talking-text{ diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 576cb08a..eff1bbc6 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -16,7 +16,7 @@ {{item.teacherName}} - 描述:{{item.teacheDesc || '--'}} + 描述:{{item.voiceDesc || '--'}} @@ -117,7 +117,7 @@ const getData = async () => { // videoUrlShow.value = res.tempFilePath // }) }; -let WS = {} +var WS = null const nextStep = () => { if(choiceTeacher.value){ initWS(1) @@ -129,47 +129,67 @@ const nextStep = () => { }); } } -const initWS = async (step) => { +const reconnectTimer = null // 重连timer +const isManualClose = false // 是否手动关闭 + +const initWS = ($step) => { WS = uni.connectSocket({ url: get_base_url() + '/trastudy/trasoket/open?summary=' + getToken(), - header:{ - 'summary': getToken(), - 'content-type': 'application/json;charset=UTF-8' - }, - success:function(res){ - WS.onMessage = (event) => { - console.log(event) - } - let _params = step === 1 ?{ + complete: function(cv){ + console.log(cv) + } + }) + WS.onMessage = (event) => { + console.log(event,111) + } + WS.onSocketMessage = (event) => { + console.log(event,222) + } + WS.onOpen = () =>{ + console.log('建立链接') + } + WS.onError = (event) => { + console.log('error',event) + } + // WS.onclose = () => { + // // 重连 + // // initWS() + // } + setTimeout(()=>{ + console.log(WS , WS.readyState) + if( WS && WS.readyState === 1){ + let _params = $step === 1 ?{ "commond" : 'open', "body" : { crsId: crsId.value, teacherNo: choiceTeacher.value } - }:{ - - } - WS.send(_params) - }, - fail:function(err){ - console.log(err) - }, - complete:function(res){ - console.log(res) + }:{} + sendMessage(_params) + step.value = 2 } - }) - WS.onOpen = () =>{ - console.log('建立链接') - step.value = 2 - } - // WS.onerror = (event) => { - // console.log(event) - // } - // WS.onclose = () => { - // // 重连 - // // initWS() - // } + },100) } +const reconnect = ()=> { + if(reconnectTimer || isManualClose) return + reconnectTimer = setTimeout(()=>{ + initWS(2) + },3000) +} +const sendMessage = (data) => { + WS.send({ + data: JSON.stringify(data) + }) +} +const closeWebSocket = () => { + isManualClose = true + if(WS){ + WS.close() + WS = null + } +} + + onLoad((params) => { crsId.value = params.crsId||''; crsNum.value = params.crsNum||''; @@ -208,10 +228,10 @@ onShow(()=>{ getData(); }) onHide(()=>{ - WS.close?.() + closeWebSocket() }) onUnmounted(()=>{ - WS.close?.() + closeWebSocket() }) const playRecord = () => { audioObj.src = audioPath.value @@ -393,9 +413,15 @@ const handleMove = (obj) => { .talking-gif{ width: 140rpx; height: 40rpx; - background-color: #ccc; + // background-color: #ccc; + background: url(@/static/images/course/voice-gray.png) no-repeat; + background-size: 100%; box-sizing: border-box; float: left; + &.is-play{ + background: url(@/static/images/course/voice-gif.gif) no-repeat; + background-size: 100%; + } } .talking-time{ float: right; diff --git a/src/static/images/course/play-blue.png b/src/static/images/course/play-blue.png new file mode 100644 index 0000000000000000000000000000000000000000..7b7072d9f2120c5ba5067307ff768bec96124a4f GIT binary patch literal 1287 zcmV+i1^D`jP)}P8Z~+z@G{zJ`jmEe@4Tb~=rU6M@xYF97(Xx;Q8WDok)X+54#z&$o ztR|XTV~la70@{!&aVMz@HAD$9Ky64sY!l?scINQ^pLvye_1-)0$@%7<`R@1lefOSo z?wM;4@Y6GD7d$^?H*6oa`?h~(zv~*dC)l5)%u=jRk?o}OWeoc4Q%uDUhy&jRbPd_t zyFRz?OpIe9VsM0sy5V872eh%jgc70nZL(eBd_8QYQ@3I&wsI&Jb-voX1#J7o-pniY zfoE{Svv|q#u*_HF5Jrmaaxj;2D))S0iWa~jvT0!xj`K>r$Usp_wOUj;m0JwOk`^q0 zj=Sl2n6jKwtESwClPq}|@)kgcx8PwvCGYvXkt(J1I8Vvqn2`I)0i@w>g73;Tt+B?# zF2|OIaa{p4*u?XFlzMG_Nyao^x&SxhJq+>cr*&zodg*vD}LE7 z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