Procházet zdrojové kódy

Merge branch 'develop' into test

test
JinxChen před 1 rokem
rodič
revize
3112acd9de
7 změnil soubory, kde provedl 54 přidání a 21 odebrání
  1. +8
    -1
      README.md
  2. +2
    -2
      src/config/models.js
  3. +11
    -2
      src/store/index.js
  4. +3
    -1
      src/views/health/psychological-main/index.vue
  5. +4
    -2
      src/views/health/psychological/index.vue
  6. +17
    -8
      src/views/psychological-modeling/index.vue
  7. +9
    -5
      src/views/psychological-questionnaire/index.vue

+ 8
- 1
README.md Zobrazit soubor

@@ -460,4 +460,11 @@ update
## v1.0.56
`2023.6.1`
feature
- 增加 一个心理详情汇总页面
- 增加 一个心理详情汇总页面

## v1.0.57
`2023.6.1`
update
- 心理健康
- 建模进度查询,问卷调查,心理详情汇总和心理健康抑郁,压力和疲劳详情页面
- 增加 接口请求时带上从随手精灵传过来的token

+ 2
- 2
src/config/models.js Zobrazit soubor

@@ -1,11 +1,11 @@
/*
* @Date: 2021-11-20 10:26:39
* @LastEditors: JinxChen
* @LastEditTime: 2023-05-29 17:10:20
* @LastEditTime: 2023-06-01 18:06:38
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description:
*/
export const VERSION_MODEL = '1.0.56F'; //版本号
export const VERSION_MODEL = '1.0.57F'; //版本号
export const IMAGE_URL = {
production: 'http://zfb.ssjlai.com/web/',
test: 'http://zfb.ssjlai.com/web/',


+ 11
- 2
src/store/index.js Zobrazit soubor

@@ -1,7 +1,7 @@
/*
* @Date: 2022-08-17 16:18:02
* @LastEditors: JinxChen
* @LastEditTime: 2023-02-25 15:23:43
* @LastEditTime: 2023-06-01 17:45:48
* @FilePath: \TelpoH5FrontendWeb\src\store\index.js
* @description:
*/
@@ -19,7 +19,8 @@ export default new Vuex.Store({
wxAuthCode: '',
openId: '',
appId: '',
isFromWx: null
isFromWx: null,
ssjlToken: '',
},
mutations: {
imei(state, imei) {
@@ -50,6 +51,10 @@ export default new Vuex.Store({
state.isFromWx = isFromWx;
window.localStorage[prefix + 'isFromWx'] = isFromWx;
},
ssjlToken(state, ssjlToken) {
state.ssjlToken = ssjlToken;
window.localStorage[prefix + 'ssjlToken'] = ssjlToken;
},
},
getters: {
imei: state => {
@@ -80,6 +85,10 @@ export default new Vuex.Store({
if (state.isFromWx != '') return state.isFromWx;
return window.localStorage[prefix + 'isFromWx'] == null ? '' : window.localStorage[prefix + 'isFromWx'];
},
ssjlToken: state => {
if (state.ssjlToken != '') return state.ssjlToken;
return window.localStorage[prefix + 'ssjlToken'] == null ? '' : window.localStorage[prefix + 'ssjlToken'];
},
},
actions: {},
modules: {}

+ 3
- 1
src/views/health/psychological-main/index.vue Zobrazit soubor

@@ -62,13 +62,15 @@ export default {
},
getHomeData() {
this.$toast.loading('数据加载中');
console.log("this.$store.getters.ssjlToken", this.$store.getters.ssjlToken);
let reqUrl = `https://dbmq.rzliot.com/heart/api/Data/GetHomeData`;
let reqParams = {
uid: this.uid,
date: this.$dayjs(new Date()).format('YYYY-MM-DD')
};
axios.get(reqUrl, {
params: { ...reqParams }
params: { ...reqParams },
headers: { 'AuthToken': this.$store.getters.ssjlToken }
}).then(res => {
console.log("res", res);
const data = res.data.response;


+ 4
- 2
src/views/health/psychological/index.vue Zobrazit soubor

@@ -643,7 +643,8 @@ export default {
month: this.$dayjs(new Date()).format('YYYY-MM')
};
axios.get(reqUrl, {
params: { ...reqParams }
params: { ...reqParams },
headers: { 'AuthToken': this.$store.getters.ssjlToken }
}).then(res => {
console.log("res", res);
if (res.data) {
@@ -683,7 +684,8 @@ export default {
let reqUrl = `https://dbmq.rzliot.com/heart/api/Data/GetHisData`;
axios
.get(reqUrl, {
params: { ...reqParams }
params: { ...reqParams },
headers: { 'AuthToken': this.$store.getters.ssjlToken }
})
.then(res => {
console.log("res", res);


+ 17
- 8
src/views/psychological-modeling/index.vue Zobrazit soubor

@@ -73,7 +73,7 @@ export default {
name: 'PsychologicalModeling',
data() {
return {
info: null,
info: null,
}
},
mounted() {
@@ -84,8 +84,9 @@ export default {
let params = { ...this.$route.query }

if (params.uid) {
this.uid = params.uid

this.uid = params.uid;
// 缓存从随后精灵传过来的token
this.$store.commit('ssjlToken', params.token);
//初始化
this.init()
} else {
@@ -94,18 +95,22 @@ export default {
},
methods: {
async init() {
let ssjlToken = this.$store.getters.ssjlToken;
let re = await this.api('/api/Question/Progress', {
method: 'GET',
sslVerify: false,
withCredentials: false,
params: {
uid: this.uid,
},
})
},
}, ssjlToken)
if (re.success) {
if (re.response && re.response.state === -1) {
this.$toast('用户不存在或未绑定手表')
} else {
} else if (re.response && re.response.state === 1) {
// 2023.6.1 需求变更,建模完成直接跳到心理健康汇总页面
this.$router.push(`/psychologicalMain?uid=${this.uid}`);
} else {
this.info = re.response
}
} else {
@@ -115,7 +120,7 @@ export default {
toQuestion() {
this.$router.push(`/PsychologicalQuestionnaire?uid=${this.uid}`)
},
api(url, config) {
api(url, config, token) {
let baseUrl = 'https://dbmq.rzliot.com/heart'
setTimeout(() => {
this.$toast.loading({
@@ -127,7 +132,11 @@ export default {
return new Promise((res) => {
axios({
url: `${baseUrl}${url}`,
...config,
...config,
// 增加请求头部 token
headers: {
'AuthToken': token
}
})
.then((re) => {
if (re) {


+ 9
- 5
src/views/psychological-questionnaire/index.vue Zobrazit soubor

@@ -133,7 +133,7 @@ export default {
params: {
// uid: this.uid,
},
})
}, this.$store.getters.ssjlToken)
if (re.success) {
if (re.response && re.response.length) {
let temp = re.response[0]
@@ -147,7 +147,7 @@ export default {
params: {
code: code,
},
})
}, this.$store.getters.ssjlToken)
if (re1.success) {
if (re1.response && re1.response.length) {
let topic = []
@@ -199,7 +199,7 @@ export default {
sslVerify: false,
withCredentials: false,
data: temp,
})
}, this.$store.getters.ssjlToken)
if (re.success) {
this.$toast('问卷提交成功', 3000)
setTimeout(() => {
@@ -221,7 +221,7 @@ export default {
console.log(error)
}
},
api(url, config) {
api(url, config, token) {
setTimeout(() => {
this.$toast.loading({
message: '',
@@ -233,7 +233,11 @@ export default {
return new Promise((res) => {
axios({
url: `${baseUrl}${url}`,
...config,
...config,
// 增加请求头部 token
headers: {
'AuthToken': token
}
})
.then((re) => {
if (re) {


Načítá se…
Zrušit
Uložit