ソースを参照

update

- 心理监测首页
    - 增加 页面路由参数 date
master
JinxChen 1年前
コミット
3db4b4c389
4個のファイルの変更39行の追加8行の削除
  1. +7
    -1
      README.md
  2. +1
    -1
      src/config/models.js
  3. +9
    -3
      src/views/health/psychological-main/index.vue
  4. +22
    -3
      src/views/health/psychological/index.vue

+ 7
- 1
README.md ファイルの表示

@@ -534,4 +534,10 @@ update
- 心理监测详情 - 心理监测详情
- 增加 7天 和 30天数据查看功能 - 增加 7天 和 30天数据查看功能
- 优化 页面样式内容 - 优化 页面样式内容
- 增加 返回到随手精灵逻辑
- 增加 返回到随手精灵逻辑

## v1.0.67
`2023.6.26`
update
- 心理监测首页
- 增加 页面路由参数 date

+ 1
- 1
src/config/models.js ファイルの表示

@@ -5,7 +5,7 @@
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description: * @description:
*/ */
export const VERSION_MODEL = '1.0.66F'; //版本号
export const VERSION_MODEL = '1.0.67F'; //版本号
export const IMAGE_URL = { export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/', production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/',


+ 9
- 3
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') }, */ { value: 75, name: '疲劳', class: 'tiredness', result: '中度疲劳', time: '17:52', img: require('@/assets/img/moderate.png') }, */
], ],
uid: '', uid: '',
routeDate: '',
params: {}


} }
}, },
@@ -72,6 +74,8 @@ export default {
let params = this.$route.query; let params = this.$route.query;
if (params) { if (params) {
this.uid = params.uid; this.uid = params.uid;
this.routeDate = params.date;
this.params = params;
} }
}, },
getHomeData() { getHomeData() {
@@ -80,7 +84,7 @@ export default {
let reqUrl = `https://dbmq.rzliot.com/heart/api/Data/GetHomeData`; let reqUrl = `https://dbmq.rzliot.com/heart/api/Data/GetHomeData`;
let reqParams = { let reqParams = {
uid: this.uid, 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, { axios.get(reqUrl, {
params: { ...reqParams }, params: { ...reqParams },
@@ -101,11 +105,13 @@ export default {


}, },
onClick(item) { onClick(item) {
this.$router.push({
this.$router.replace({
name: 'psychological', name: 'psychological',
query: { query: {
name: item.class, name: item.class,
uid: this.uid
uid: this.uid,
date: this.routeDate,
...this.params
} }
}) })
}, },


+ 22
- 3
src/views/health/psychological/index.vue ファイルの表示

@@ -313,7 +313,9 @@ export default {
selectDate: '', selectDate: '',
uid: '', uid: '',
advice: '', advice: '',
surveyTitle: '' || '本周概览'
surveyTitle: '' || '本周概览',
routeDate: '',
params: {}
}; };
}, },
computed: { computed: {
@@ -635,6 +637,18 @@ export default {
this.emoName = EmotionModel[params.name].name; this.emoName = EmotionModel[params.name].name;
this.emoType = EmotionModel[params.name].type; this.emoType = EmotionModel[params.name].type;
this.uid = params.uid; 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); console.log("当前情绪是", EmotionModel[params.name].name);
} }
}, },
@@ -676,7 +690,7 @@ export default {
let reqDate = let reqDate =
date date
? this.$dayjs(date).format("YYYY-MM-DD") ? 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 = { let reqParams = {
uid: this.uid, uid: this.uid,
startDate: startDate || reqDate, startDate: startDate || reqDate,
@@ -986,7 +1000,12 @@ export default {
}, },
// 返回 // 返回
onNavBack() { onNavBack() {
this.$router.go(-1);
this.$router.replace({
name: 'psychologicalMain',
query: {
...this.params
}
});
}, },
// 点击日期选择 // 点击日期选择
onTabClick(value, index) { onTabClick(value, index) {


読み込み中…
キャンセル
保存