From d620a54795be547e2a540d7e8c12eac42854cc08 Mon Sep 17 00:00:00 2001 From: song Date: Wed, 9 Feb 2022 11:25:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B0=8F=E7=BA=A2=E7=82=B9=EF=BC=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=B7=A5=E5=85=B7=E7=AE=B1=E4=BD=BF=E7=94=A8=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- src/App.vue | 1 + src/apis/yanyuan.js | 2 + src/components/Projects/ProjectItem.vue | 11 ++++- src/pages/index/index.vue | 30 ++++++++++++++ src/pagesYanyuan/hold-all/hold-all.vue | 55 +++++++++---------------- src/store/socket/actions.js | 5 --- 7 files changed, 63 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c496a..c852f23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2022-02-08) +# 0.1.0 (2022-02-09) ### 🌟 新功能 范围|描述|commitId @@ -78,6 +78,7 @@ - | 项目列表, 项目url | [32e005b](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/32e005b) - | 项目列表排序 | [224c58b](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/224c58b) - | 项目api url设置 | [6cd5245](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/6cd5245) + - | 修改连接WiFi逻辑 | [74248c7](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/74248c7) - | 修改时间轴滚动 | [537df8c](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/537df8c) - | 修改小程序id | [4206bf2](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/4206bf2) - | 修改config | [eb5f9c5](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/eb5f9c5) diff --git a/src/App.vue b/src/App.vue index 1c19d21..4e4ead2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,6 +41,7 @@ export default { } } /* #endif */ + this.initSocket(); }, diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index c8740e2..b729da2 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -56,6 +56,8 @@ const install = (Vue, vm) => { vm.$u.api.queryFamilyList = param => vm.$u.post(`${yanyuan}/family/queryList`, param); // 查询用户是否是项目成员 vm.$u.api.familyIsMember = param => vm.$u.post(`${yanyuan}/family/isMember`, param); + // 查询项目待审核家属成员数量 + vm.$u.api.queryProjectAuditNum = param => vm.$u.post(`${yanyuan}/family/queryProjectAuditNum`, param); // 试题答案保存 vm.$u.api.chooseTool = param => vm.$u.post(`${yanyuan}/trainPlan/chooseTool`, param); diff --git a/src/components/Projects/ProjectItem.vue b/src/components/Projects/ProjectItem.vue index 3066077..afb64e1 100644 --- a/src/components/Projects/ProjectItem.vue +++ b/src/components/Projects/ProjectItem.vue @@ -4,18 +4,25 @@ - + - {{ item.name }} + + {{ item.name }} + 进行中 + + {{ $moment(+item.startTime).format('MM-DD HH:mm') }}{{ $moment(+item.endTime).format('MM-DD HH:mm') }} + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 01df4e5..fc2b16e 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -121,10 +121,40 @@ export default { item.show = false; }); this.setProjects(data); + // 查询项目待审核家属成员数量 + this.handleProjectAuditNum(data); } }); }, + /** + * 查询项目待审核家属成员数量 + */ + async handleProjectAuditNum(projects) { + try { + const params = []; + projects.forEach(item => { + let project = { projectId: '' }; + project.projectId = item.id; + params.push(project); + }); + const res = await this.$u.api.queryProjectAuditNum(params); + let data = projects; + data.forEach(project => { + if (res && res.length) { + res.forEach(item => { + if (project.id === item.traineeId) { + project.auditNum = item.auditNum; + } + }); + } + }); + this.setProjects(data); + } catch (error) { + console.log('error: ', error); + } + }, + /** * 查询小红点 * @param { string } endTime 结束时间 diff --git a/src/pagesYanyuan/hold-all/hold-all.vue b/src/pagesYanyuan/hold-all/hold-all.vue index 2857719..8de7380 100644 --- a/src/pagesYanyuan/hold-all/hold-all.vue +++ b/src/pagesYanyuan/hold-all/hold-all.vue @@ -1,9 +1,11 @@ @@ -127,8 +107,10 @@ export default { */ async getUserName(equipmentId) { try { + this.$t.ui.showLoading(); const params = { equipmentId }; const data = await this.$u.api.getUserName(params); + this.$t.ui.hideLoading(); if (data.status === -2) { this.show = true; this.content = '使用前请先选择长者!'; @@ -139,9 +121,10 @@ export default { } if (data.status === 0) { this.show = true; - this.content = `绑定者为 ${data.userName},性别 ${data.sex === 1 ? '男' : '女'}`; + this.content = `使用者为 ${data.userName}(${data.sex === 1 ? '男' : '女'})`; } } catch (error) { + this.$t.ui.hideLoading(); console.error('error: ', error); this.$t.ui.showToast(error.msg || '工具箱的使用者查询失败'); } diff --git a/src/store/socket/actions.js b/src/store/socket/actions.js index f7f3e87..549d7e3 100644 --- a/src/store/socket/actions.js +++ b/src/store/socket/actions.js @@ -23,7 +23,6 @@ const actions = { onSocketOpen({ dispatch, commit, state }) { // eslint-disable-next-line no-unused-vars state.socket.onOpen(res => { - // console.log('ws open: ', res); commit('setConnected', true); prevTime = Date.now(); // this.auth(); @@ -38,7 +37,6 @@ const actions = { // 监听收到的ws消息 onSocketMessage({ dispatch, state }) { state.socket.onMessage(res => { - // console.log('收到消息:', res); prevTime = Date.now(); if (!res || !res.data || !JSON.parse(res.data)) return; const resData = JSON.parse(res.data); @@ -63,7 +61,6 @@ const actions = { commit('task/setTaskStatus', data.data, { root: true }); break; // case 'Chrome': // !收到开始游戏的消息 - // console.log('handleMessagesData', data); // // @ts-ignore // util.openGameApp({ // type: data.data.type, @@ -82,7 +79,6 @@ const actions = { // dispatch('home/getProjectById', data.data.projectId, { root: true }); // break; // case 'startDrill': // 康复开始训练相关消息 - // console.log('setStartDrillInfo', data.data); // commit('home/setStartDrillMessages', data.data, { root: true }); // break; default: @@ -102,7 +98,6 @@ const actions = { // 监听关闭事件 onSocketClose({ dispatch, commit, state }) { - // console.log('onSocketClose'); state.socket.onClose(() => { commit('setConnected', false); if (sendHeartTimer) clearInterval(sendHeartTimer);