From f9f74be132acd2e5c83775428982154933653cac Mon Sep 17 00:00:00 2001 From: chenJinxu <2183691628@qq.com> Date: Fri, 29 Dec 2023 10:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20vconsole=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20=E5=A2=9E=E5=8A=A0=20=E4=BB=8A=E6=97=A5-?= =?UTF-8?q?=E6=83=85=E7=BB=AA=E5=BF=83=E7=90=86=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AF=B9=E6=8E=A5=20=E5=A2=9E=E5=8A=A0=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=8E=88=E6=9D=83code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/psychological.js | 23 + src/main.js | 20 +- src/views/insight/index.vue | 20 +- src/views/login/login.vue | 5 +- src/views/today/emotionDetails.vue | 267 ++---- src/views/today/index.vue | 69 +- src/views/today/scss/emotion-details.scss | 991 +++++++++++----------- src/views/today/scss/signs-details.scss | 780 +++++++++-------- src/views/today/signsDetails.vue | 858 ++++++++++++++++--- 10 files changed, 1838 insertions(+), 1196 deletions(-) create mode 100644 src/api/psychological.js diff --git a/package.json b/package.json index 7e496b1..6f9fb9f 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "js-base64": "^2.5.2", "regenerator-runtime": "^0.13.5", "vant": "^2.12.48", + "vconsole": "^3.15.1", "vue": "^2.7.8", "vue-router": "^3.5.4", "vuex": "^3.6.2", diff --git a/src/api/psychological.js b/src/api/psychological.js new file mode 100644 index 0000000..8256153 --- /dev/null +++ b/src/api/psychological.js @@ -0,0 +1,23 @@ +import axios from 'axios'; +import prefix from '@/store/prefix'; +import { PsyBaseUrl } from '@/config/models'; +const service = axios.create({ + baseURL: PsyBaseUrl +}); +service.interceptors.request.use(request => { + if (localStorage.getItem(prefix + 'ssjlToken')) { + request.headers.AccessToken = localStorage.getItem(prefix + 'ssjlToken'); + } + return request; +}); +export const APIPsy = { + getHomeData +}; +export default APIPsy; +function getHomeData(data) { + return service({ + url: `/api/Data/GetHomeData`, + method: 'get', + params: data + }); +} diff --git a/src/main.js b/src/main.js index 4dceb70..43a7303 100644 --- a/src/main.js +++ b/src/main.js @@ -18,13 +18,31 @@ import '@/plugins/vant'; import '@/assets/css/index.scss'; // 移动端适配 import 'amfe-flexible'; +import VConsole from 'vconsole'; Vue.prototype.$dayjs = dayjs; Vue.prototype.$echarts = echarts; Vue.prototype.$store = store; Vue.prototype.$own = own; Vue.prototype.$axios = request; Vue.prototype.$green = '#189b3b'; - +// 判断是否是pc设备 +const isPc = () => { + const userAgentInfo = navigator.userAgent; + const Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']; + let flag = true; + for (let v = 0; v < Agents.length; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; +}; +//如果不是生产环境并且不是pc设备那么就显示调试 +if (process.env.NODE_ENV == 'test' && !isPc()) { + // eslint-disable-next-line no-unused-vars + const vConsole = new VConsole(); +} // filters import './filters'; Vue.config.productionTip = false; diff --git a/src/views/insight/index.vue b/src/views/insight/index.vue index f124b9f..bd84124 100644 --- a/src/views/insight/index.vue +++ b/src/views/insight/index.vue @@ -152,6 +152,7 @@