Browse Source

Merge branch 'feat' into develop

master
JinxChen 1 year ago
parent
commit
27e2f7e038
7 changed files with 54 additions and 21 deletions
  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 View File

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

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

+ 2
- 2
src/config/models.js View File

@@ -1,11 +1,11 @@
/* /*
* @Date: 2021-11-20 10:26:39 * @Date: 2021-11-20 10:26:39
* @LastEditors: JinxChen * @LastEditors: JinxChen
* @LastEditTime: 2023-05-29 17:10:20
* @LastEditTime: 2023-06-01 18:06:38
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @FilePath: \TelpoH5FrontendWeb\src\config\models.js
* @description: * @description:
*/ */
export const VERSION_MODEL = '1.0.56F'; //版本号
export const VERSION_MODEL = '1.0.57F'; //版本号
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/',


+ 11
- 2
src/store/index.js View File

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

+ 3
- 1
src/views/health/psychological-main/index.vue View File

@@ -62,13 +62,15 @@ export default {
}, },
getHomeData() { getHomeData() {
this.$toast.loading('数据加载中'); this.$toast.loading('数据加载中');
console.log("this.$store.getters.ssjlToken", this.$store.getters.ssjlToken);
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.$dayjs(new Date()).format('YYYY-MM-DD')
}; };
axios.get(reqUrl, { axios.get(reqUrl, {
params: { ...reqParams }
params: { ...reqParams },
headers: { 'AuthToken': this.$store.getters.ssjlToken }
}).then(res => { }).then(res => {
console.log("res", res); console.log("res", res);
const data = res.data.response; const data = res.data.response;


+ 4
- 2
src/views/health/psychological/index.vue View File

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


+ 17
- 8
src/views/psychological-modeling/index.vue View File

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


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

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


+ 9
- 5
src/views/psychological-questionnaire/index.vue View File

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


Loading…
Cancel
Save