diff --git a/.env.development b/.env.development index a427c2f9..4b7a4662 100644 --- a/.env.development +++ b/.env.development @@ -9,10 +9,14 @@ 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入口 +<<<<<<< HEAD + VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' +======= # VITE_APP_BASE_API_Url = 'http://25.18.122.65:7001' # VITE_APP_BASE_API_Url = 'http://25.16.122.65:7001' # VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786' +>>>>>>> f9ef91e5fe7dbec56a29867b9d2d9f7e3792f0f4 diff --git a/src/api/common.js b/src/api/common.js index 443fbd08..a7e27a8f 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -114,4 +114,4 @@ export function previewCacheThumbImage(id, width = 30, height = 30) { } }); }); -} \ No newline at end of file +} 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/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/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..3ee86fc9 --- /dev/null +++ b/src/pages/setting/index.vue @@ -0,0 +1,121 @@ + + + + + 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": { diff --git a/src/static/images/course/play-blue.png b/src/static/images/course/play-blue.png new file mode 100644 index 00000000..7b7072d9 Binary files /dev/null and b/src/static/images/course/play-blue.png differ diff --git a/src/static/images/course/stop-blue.png b/src/static/images/course/stop-blue.png new file mode 100644 index 00000000..43d88e92 Binary files /dev/null and b/src/static/images/course/stop-blue.png differ diff --git a/src/uni_modules/uv-popup/changelog.md b/src/uni_modules/uv-popup/changelog.md new file mode 100644 index 00000000..8bb39925 --- /dev/null +++ b/src/uni_modules/uv-popup/changelog.md @@ -0,0 +1,18 @@ +## 1.0.7(2023-11-20) +修复issues问题:https://gitee.com/climblee/uv-ui/issues/I8HDLO +## 1.0.6(2023-10-13) +1. 优化vue,内容有背景色,设置圆角被遮挡的情况 +## 1.0.5(2023-09-10) +1. 修复H5默认层级过高的问题 +2. 修复全局设置prop无效的问题 +## 1.0.4(2023-08-08) +1. 修复修改zIndex不生效的BUG +## 1.0.3(2023-07-02) +uv-popup 弹出层,代码重构优化,性能翻倍,小程序体验性能更加,避免卡顿。打开和关闭方法更改,详情参考文档:https://www.uvui.cn/components/popup.html +## 1.0.2(2023-06-11) +1. 修复zIndex层级问题 +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +1. 新增uv-popup组件 diff --git a/src/uni_modules/uv-popup/components/uv-popup/keypress.js b/src/uni_modules/uv-popup/components/uv-popup/keypress.js new file mode 100644 index 00000000..62dda461 --- /dev/null +++ b/src/uni_modules/uv-popup/components/uv-popup/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + // this.$once('hook:beforeDestroy', () => { + // document.removeEventListener('keyup', listener) + // }) + }, + render: () => {} +} +// #endif diff --git a/src/uni_modules/uv-popup/components/uv-popup/uv-popup.vue b/src/uni_modules/uv-popup/components/uv-popup/uv-popup.vue new file mode 100644 index 00000000..a63ff9d6 --- /dev/null +++ b/src/uni_modules/uv-popup/components/uv-popup/uv-popup.vue @@ -0,0 +1,539 @@ + + + + diff --git a/src/uni_modules/uv-popup/package.json b/src/uni_modules/uv-popup/package.json new file mode 100644 index 00000000..53c112ce --- /dev/null +++ b/src/uni_modules/uv-popup/package.json @@ -0,0 +1,92 @@ +{ + "id": "uv-popup", + "displayName": "uv-popup 弹出层 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.7", + "description": "uv-popup 弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。", + "keywords": [ + "uv-popup", + "uvui", + "uv-ui", + "popup", + "弹出层" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-overlay", + "uv-transition", + "uv-icon", + "uv-status-bar", + "uv-safe-bottom" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-popup/readme.md b/src/uni_modules/uv-popup/readme.md new file mode 100644 index 00000000..92229a83 --- /dev/null +++ b/src/uni_modules/uv-popup/readme.md @@ -0,0 +1,21 @@ +## Popup 弹出层 + +> **组件名:uv-popup** + +弹出层容器,用于展示弹窗、信息提示等内容,支持上、下、左、右和中部弹出。组件只提供容器,内部内容由用户自定义。 + +该组件已经放弃原来`uview2.x`的写法,参照了官方`uni-popup`的写法进行重构。在小程序端的性能大大提升,打开和关闭避免延迟,调用方法与之前相比也有所差异,具体请查看文档。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/src/uni_modules/uv-safe-bottom/changelog.md b/src/uni_modules/uv-safe-bottom/changelog.md new file mode 100644 index 00000000..dbcd565a --- /dev/null +++ b/src/uni_modules/uv-safe-bottom/changelog.md @@ -0,0 +1,11 @@ +## 1.0.4(2023-09-14) +1. 飞书小程序支持 +## 1.0.3(2023-08-14) +1. 修复百度报错的BUG +## 1.0.2(2023-07-02) +uv-safe-bottom 修复,在百度程序,抖音小程序不生效的BUG +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +uv-safe-bottom 底部安全区组件 diff --git a/src/uni_modules/uv-safe-bottom/components/uv-safe-bottom/uv-safe-bottom.vue b/src/uni_modules/uv-safe-bottom/components/uv-safe-bottom/uv-safe-bottom.vue new file mode 100644 index 00000000..b5439a8b --- /dev/null +++ b/src/uni_modules/uv-safe-bottom/components/uv-safe-bottom/uv-safe-bottom.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/uni_modules/uv-safe-bottom/package.json b/src/uni_modules/uv-safe-bottom/package.json new file mode 100644 index 00000000..5bfaab08 --- /dev/null +++ b/src/uni_modules/uv-safe-bottom/package.json @@ -0,0 +1,87 @@ +{ + "id": "uv-safe-bottom", + "displayName": "uv-safe-bottom 底部安全区 全面兼容小程序、nvue、vue2、vue3等多端", + "version": "1.0.4", + "description": "这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。", + "keywords": [ + "uv-safe-bottom", + "uvui", + "uv-ui", + "bottom", + "底部安全区" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-safe-bottom/readme.md b/src/uni_modules/uv-safe-bottom/readme.md new file mode 100644 index 00000000..8c788826 --- /dev/null +++ b/src/uni_modules/uv-safe-bottom/readme.md @@ -0,0 +1,11 @@ +## SafeBottom 底部安全区 + +> **组件名:uv-safe-bottom** + +这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。 + +### 查看文档 + +### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui) + +#### 如使用过程中有任何问题,或者您对uv-ui有一些好的建议,欢迎加入 uv-ui 交流群:uv-ui官方QQ群 diff --git a/src/uni_modules/uv-status-bar/changelog.md b/src/uni_modules/uv-status-bar/changelog.md new file mode 100644 index 00000000..fc04088f --- /dev/null +++ b/src/uni_modules/uv-status-bar/changelog.md @@ -0,0 +1,7 @@ +## 1.0.2(2023-06-05) +1. 兼容渐变背景色 +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +1. 新增uv-status-bar组件 diff --git a/src/uni_modules/uv-status-bar/components/uv-status-bar/props.js b/src/uni_modules/uv-status-bar/components/uv-status-bar/props.js new file mode 100644 index 00000000..f42e5250 --- /dev/null +++ b/src/uni_modules/uv-status-bar/components/uv-status-bar/props.js @@ -0,0 +1,8 @@ +export default { + props: { + bgColor: { + type: String, + default: 'transparent' + } + } +} diff --git a/src/uni_modules/uv-status-bar/components/uv-status-bar/uv-status-bar.vue b/src/uni_modules/uv-status-bar/components/uv-status-bar/uv-status-bar.vue new file mode 100644 index 00000000..ee887c71 --- /dev/null +++ b/src/uni_modules/uv-status-bar/components/uv-status-bar/uv-status-bar.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/uni_modules/uv-status-bar/package.json b/src/uni_modules/uv-status-bar/package.json new file mode 100644 index 00000000..dd4311ea --- /dev/null +++ b/src/uni_modules/uv-status-bar/package.json @@ -0,0 +1,87 @@ +{ + "id": "uv-status-bar", + "displayName": "uv-status-bar 状态栏占位", + "version": "1.0.2", + "description": "状态栏占位组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。", + "keywords": [ + "uv-status-bar", + "uvui", + "uv-ui", + "status-bar", + "状态栏" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/uv-status-bar/readme.md b/src/uni_modules/uv-status-bar/readme.md new file mode 100644 index 00000000..fc61e0b0 --- /dev/null +++ b/src/uni_modules/uv-status-bar/readme.md @@ -0,0 +1,10 @@ +## StatbusBar 状态栏占位 + +> **组件名:uv-status-bar** + +本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。 + +### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui) + +#### 如使用过程中有任何问题,或者您对uv-ui有一些好的建议,欢迎加入 uv-ui 交流群:uv-ui官方QQ群 +