From cad3bd0c69797a15347e6f704282ab7a99b6d2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=80=AA?= <690927457@qq.com> Date: Thu, 21 Mar 2024 16:07:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BA=8B=E5=8A=A1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request.js | 32 +++++++++++++++----------------- config/index.js | 4 ++-- pages/index/done.vue | 20 +++++++++++++++++++- pages/user/userInfo.vue | 7 ++++--- 4 files changed, 40 insertions(+), 23 deletions(-) diff --git a/api/request.js b/api/request.js index 60c1a86..9e9b69b 100644 --- a/api/request.js +++ b/api/request.js @@ -1,8 +1,6 @@ import config from '../config' +import { useStore} from '@/store/index.js' -// import {useStore} from '@/store/index.js' -// console.log(useStore) -// const store = useStore() const loginUrl = 'pages/user/login'; // function JSON_to_URLEncoded(element,key,list){ // var list = list || []; @@ -76,20 +74,20 @@ export default { }); } } - // if(res.data.code === 7) { // 登录失败 - // uni.showToast({ - // title:res.msg, - // icon:"error", - // duration:2000, - // mask:true, - // success() { - // if(res.code === 7) // 登录失败 - // { - // store.afterFailLogin(2000) - // } - // } - // }) - // } + if(res.data.code === 7) { // 登录失败 + const store = useStore() + store.afterFailLogin(2000) + uni.showToast({ + title:res.msg, + icon:"error", + duration:2000, + mask:true, + // success() { + // console.log(1212121) + // store.afterFailLogin(2000) + // } + }) + } return res.data; } else { const reg = /abort/; diff --git a/config/index.js b/config/index.js index bd6fcc9..f891248 100644 --- a/config/index.js +++ b/config/index.js @@ -1,6 +1,6 @@ // isdev 为 true 表示开发环境 false 表示发布环境 -const isdev = false; -const baseUrl = isdev ? 'http://318ca56c.r28.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境 +const isdev = true; +const baseUrl = isdev ? 'https://367a21fd.r12.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境 // const baseUrl = isdev ? 'https://api.jimingyiliao.com' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境 // const baseUrl = isdev ? 'http://707788f2.r1.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境 // const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境 diff --git a/pages/index/done.vue b/pages/index/done.vue index 0199314..f72d8fd 100644 --- a/pages/index/done.vue +++ b/pages/index/done.vue @@ -161,7 +161,7 @@ }) uni.showToast({ title:res_.msg, - icon:"error", + icon:"success", duration:2000, mask:true, success() { @@ -205,6 +205,24 @@ {{handle_info?.content}} + + 待办状态 + + {{handle_info?.remindPeriod?'手术前':'手术后'}} + + + + 用药频率 + + {{handle_info?.frequency}} + + + + 提醒时间 + + {{handle_info?.remindTime}} + + 创建时间 diff --git a/pages/user/userInfo.vue b/pages/user/userInfo.vue index f3d231d..c108ce4 100644 --- a/pages/user/userInfo.vue +++ b/pages/user/userInfo.vue @@ -16,7 +16,7 @@ } else { // 已登录 userinfo.value = JSON.parse(uni.getStorageSync('userInfo')) h_info.value = userinfo.value - h_info.value.surgery_time = h_info.value.surgery_time + h_info.value.surgery_time = h_info.value.SurgeryTime userinfo.value.avatar = uni.getStorageSync('avatarUrl') h_index.value = hospitals.value.findIndex((item,i) => { return item.ID == userinfo.value.HospitalId @@ -33,7 +33,7 @@ pageSize:1000, key:'' }) - const hospitals = ref(null) + const hospitals = ref([]) const userinfo = ref({}) const avatar = ref(null) const h_info = ref({}) @@ -144,6 +144,7 @@ // if(!is_login.value) { // 新用户 - 先登录 // } + userinfo.value.SurgeryTime = obj.surgery_time const res = await api.userinfoUpdae(obj) // 更新用户信息 if(res.code === 0) { uni.showToast({ @@ -175,7 +176,7 @@ }); let res2=await api.wx_login({code:res.code},userId); if(res2.code === 0) { - userinfo.value.HospitalId = hospitals.value[h_index.value].ID + userinfo.value.HospitalId = hospitals.value[h_index.value]?.ID h_info.value.hospitalId = userinfo.value.HospitalId uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))