From 3db4b4c38976faffe1a2bcdea31f616e7439582b Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Mon, 26 Jun 2023 14:41:10 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E5=BF=83=E7=90=86=E7=9B=91?= =?UTF-8?q?=E6=B5=8B=E9=A6=96=E9=A1=B5=20=20=20=20=20-=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20=E9=A1=B5=E9=9D=A2=E8=B7=AF=E7=94=B1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++- src/config/models.js | 2 +- src/views/health/psychological-main/index.vue | 12 ++++++--- src/views/health/psychological/index.vue | 25 ++++++++++++++++--- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9f221da..3eb60d5 100644 --- a/README.md +++ b/README.md @@ -534,4 +534,10 @@ update - 心理监测详情 - 增加 7天 和 30天数据查看功能 - 优化 页面样式内容 - - 增加 返回到随手精灵逻辑 \ No newline at end of file + - 增加 返回到随手精灵逻辑 + +## v1.0.67 +`2023.6.26` +update +- 心理监测首页 + - 增加 页面路由参数 date \ No newline at end of file diff --git a/src/config/models.js b/src/config/models.js index b3c84c4..1a5ad2a 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -5,7 +5,7 @@ * @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.66F'; //版本号 +export const VERSION_MODEL = '1.0.67F'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', diff --git a/src/views/health/psychological-main/index.vue b/src/views/health/psychological-main/index.vue index 441a6d6..52d4230 100644 --- a/src/views/health/psychological-main/index.vue +++ b/src/views/health/psychological-main/index.vue @@ -52,6 +52,8 @@ export default { { value: 75, name: '疲劳', class: 'tiredness', result: '中度疲劳', time: '17:52', img: require('@/assets/img/moderate.png') }, */ ], uid: '', + routeDate: '', + params: {} } }, @@ -72,6 +74,8 @@ export default { let params = this.$route.query; if (params) { this.uid = params.uid; + this.routeDate = params.date; + this.params = params; } }, getHomeData() { @@ -80,7 +84,7 @@ export default { let reqUrl = `https://dbmq.rzliot.com/heart/api/Data/GetHomeData`; let reqParams = { uid: this.uid, - date: this.$dayjs(new Date()).format('YYYY-MM-DD') + date: this.routeDate || this.$dayjs(new Date()).format('YYYY-MM-DD') }; axios.get(reqUrl, { params: { ...reqParams }, @@ -101,11 +105,13 @@ export default { }, onClick(item) { - this.$router.push({ + this.$router.replace({ name: 'psychological', query: { name: item.class, - uid: this.uid + uid: this.uid, + date: this.routeDate, + ...this.params } }) }, diff --git a/src/views/health/psychological/index.vue b/src/views/health/psychological/index.vue index bb651f6..da5d8b7 100644 --- a/src/views/health/psychological/index.vue +++ b/src/views/health/psychological/index.vue @@ -313,7 +313,9 @@ export default { selectDate: '', uid: '', advice: '', - surveyTitle: '' || '本周概览' + surveyTitle: '' || '本周概览', + routeDate: '', + params: {} }; }, computed: { @@ -635,6 +637,18 @@ export default { this.emoName = EmotionModel[params.name].name; this.emoType = EmotionModel[params.name].type; this.uid = params.uid; + this.routeDate = params.date; + this.params = params; + if(params.date) { + this.dateList[0].text = this.$dayjs(params.date).format("YYYY-MM-DD") === this.$dayjs(new Date()).format("YYYY-MM-DD") ? '今天' : this.$dayjs(params.date).format("MM-DD"); + this.defaultDate = new Date( + this.$dayjs(params.date) + .hour(0) + .minute(0) + .second(0) + .format() + ); + } console.log("当前情绪是", EmotionModel[params.name].name); } }, @@ -676,7 +690,7 @@ export default { let reqDate = date ? this.$dayjs(date).format("YYYY-MM-DD") - : this.$dayjs(this.defaultDate).format("YYYY-MM-DD") /* "2023-05-23" */; + : this.routeDate || this.$dayjs(this.defaultDate).format("YYYY-MM-DD") /* "2023-05-23" */; let reqParams = { uid: this.uid, startDate: startDate || reqDate, @@ -986,7 +1000,12 @@ export default { }, // 返回 onNavBack() { - this.$router.go(-1); + this.$router.replace({ + name: 'psychologicalMain', + query: { + ...this.params + } + }); }, // 点击日期选择 onTabClick(value, index) {