fix:事务处理

This commit is contained in:
阿怪 2024-03-21 16:07:51 +08:00
parent 90b72393be
commit cad3bd0c69
4 changed files with 40 additions and 23 deletions

View File

@ -1,8 +1,6 @@
import config from '../config' 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'; const loginUrl = 'pages/user/login';
// function JSON_to_URLEncoded(element,key,list){ // function JSON_to_URLEncoded(element,key,list){
// var list = list || []; // var list = list || [];
@ -76,20 +74,20 @@ export default {
}); });
} }
} }
// if(res.data.code === 7) { // 登录失败 if(res.data.code === 7) { // 登录失败
// uni.showToast({ const store = useStore()
// title:res.msg, store.afterFailLogin(2000)
// icon:"error", uni.showToast({
// duration:2000, title:res.msg,
// mask:true, icon:"error",
duration:2000,
mask:true,
// success() { // success() {
// if(res.code === 7) // 登录失败 // console.log(1212121)
// {
// store.afterFailLogin(2000) // store.afterFailLogin(2000)
// } // }
// } })
// }) }
// }
return res.data; return res.data;
} else { } else {
const reg = /abort/; const reg = /abort/;

View File

@ -1,6 +1,6 @@
// isdev 为 true 表示开发环境 false 表示发布环境 // isdev 为 true 表示开发环境 false 表示发布环境
const isdev = false; const isdev = true;
const baseUrl = isdev ? 'http://318ca56c.r28.cpolar.top' : 'https://api.jimingyiliao.com';// 办公室接口 & 测试环境 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 ? '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://707788f2.r1.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境 // const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境

View File

@ -161,7 +161,7 @@
}) })
uni.showToast({ uni.showToast({
title:res_.msg, title:res_.msg,
icon:"error", icon:"success",
duration:2000, duration:2000,
mask:true, mask:true,
success() { success() {
@ -205,6 +205,24 @@
{{handle_info?.content}} {{handle_info?.content}}
</view> </view>
</view> </view>
<view class="pb-item">
<view class="pb-item-left">待办状态</view>
<view class="pb-item-right">
{{handle_info?.remindPeriod?'手术前':'手术后'}}
</view>
</view>
<view class="pb-item">
<view class="pb-item-left">用药频率</view>
<view class="pb-item-right">
{{handle_info?.frequency}}
</view>
</view>
<view class="pb-item">
<view class="pb-item-left">提醒时间</view>
<view class="pb-item-right">
{{handle_info?.remindTime}}
</view>
</view>
<view class="pb-item"> <view class="pb-item">
<view class="pb-item-left">创建时间</view> <view class="pb-item-left">创建时间</view>
<view class="pb-item-right"> <view class="pb-item-right">

View File

@ -16,7 +16,7 @@
} else { // } else { //
userinfo.value = JSON.parse(uni.getStorageSync('userInfo')) userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
h_info.value = userinfo.value 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') userinfo.value.avatar = uni.getStorageSync('avatarUrl')
h_index.value = hospitals.value.findIndex((item,i) => { h_index.value = hospitals.value.findIndex((item,i) => {
return item.ID == userinfo.value.HospitalId return item.ID == userinfo.value.HospitalId
@ -33,7 +33,7 @@
pageSize:1000, pageSize:1000,
key:'' key:''
}) })
const hospitals = ref(null) const hospitals = ref([])
const userinfo = ref({}) const userinfo = ref({})
const avatar = ref(null) const avatar = ref(null)
const h_info = ref({}) const h_info = ref({})
@ -144,6 +144,7 @@
// if(!is_login.value) { // - // if(!is_login.value) { // -
// } // }
userinfo.value.SurgeryTime = obj.surgery_time
const res = await api.userinfoUpdae(obj) // const res = await api.userinfoUpdae(obj) //
if(res.code === 0) { if(res.code === 0) {
uni.showToast({ uni.showToast({
@ -175,7 +176,7 @@
}); });
let res2=await api.wx_login({code:res.code},userId); let res2=await api.wx_login({code:res.code},userId);
if(res2.code === 0) { 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 h_info.value.hospitalId = userinfo.value.HospitalId
uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl uni.setStorageSync('avatarUrl', userinfo.value.avatar);//avatarUrl
uni.setStorageSync('userInfo',JSON.stringify(userinfo.value)) uni.setStorageSync('userInfo',JSON.stringify(userinfo.value))