From 5778b6e68b571cc95c57261661a7c2fad007993b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E8=BE=89?= <814457906@qq.com> Date: Fri, 24 Feb 2023 17:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/CommodityDetails/CommodityDetails.vue | 72 ++++++++++++++------- pages/Personal/Personal.vue | 27 +------- pages/ProductList/ProductList.vue | 16 ++--- pages/appointmenttime/appointmenttime.vue | 1 + pages/login/login.vue | 2 +- pages/nursestation/nursestation.vue | 2 +- pages/startup/startup.vue | 6 ++ pages/user/user.vue | 2 - 8 files changed, 65 insertions(+), 63 deletions(-) diff --git a/pages/CommodityDetails/CommodityDetails.vue b/pages/CommodityDetails/CommodityDetails.vue index 44a11cc..efa7109 100644 --- a/pages/CommodityDetails/CommodityDetails.vue +++ b/pages/CommodityDetails/CommodityDetails.vue @@ -12,7 +12,7 @@ ¥{{goodsPrice}} - + 已选 @@ -51,7 +51,7 @@ - + 立即购买 @@ -237,6 +237,27 @@ url: '/pages/information/information' }) }, + buyshowtrue() { + var that = this + const value = uni.getStorageSync('openid'); + const value2 = uni.getStorageSync('patientId'); + if (value && value2) { + that.buyshow = true + } else { + that.$refs.uToast.show({ + title: '未登录,请先登录', + type: 'error' + }) + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.navigateTo({ + url: '/pages/login/login' + }) + }, 1000) + } + }, //立即购买跳转确认订单页面 tapbuy() { var that = this @@ -529,27 +550,32 @@ this.baseurl = baseurl this.usershow = false this.goodsDetailsinfo(this.goodsInfoId) - goodPatientInfo(this.updata.patientId).then(res => { - var user = res.data.filter(e => e.id == this.userid) - if (user.length >= 1) { - // user[0].address = user[0].provinceName + user[0].cityName + user[0].regionName + user[0] - // .streetName + user[0].receiveAddress - this.updata.receiver = user[0].receiveName - this.updata.receiveAddress = user[0].areaName + user[0].receiveAddress - this.updata.phone = user[0].receivePhone - this.userid = user[0].id - } else { - // res.data.forEach(e => { - // e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e - // .receiveAddress - // }) - this.updata.receiver = res.data[0].receiveName - // this.updata.receiveAddress = res.data[0].address - this.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress - this.updata.phone = res.data[0].receivePhone - this.userid = res.data[0].id - } - }) + const value = uni.getStorageSync('patientId'); + if (value) { + goodPatientInfo(value).then(res => { + if (res.code == 200) { + var user = res.data.filter(e => e.id == this.userid) + if (user.length >= 1) { + // user[0].address = user[0].provinceName + user[0].cityName + user[0].regionName + user[0] + // .streetName + user[0].receiveAddress + this.updata.receiver = user[0].receiveName + this.updata.receiveAddress = user[0].areaName + user[0].receiveAddress + this.updata.phone = user[0].receivePhone + this.userid = user[0].id + } else { + // res.data.forEach(e => { + // e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e + // .receiveAddress + // }) + this.updata.receiver = res.data[0].receiveName + // this.updata.receiveAddress = res.data[0].address + this.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress + this.updata.phone = res.data[0].receivePhone + this.userid = res.data[0].id + } + } + }) + } else {} let useritem = null uni.$on('updata', function(data) { that.updata = JSON.parse(data.updata) diff --git a/pages/Personal/Personal.vue b/pages/Personal/Personal.vue index 09890ed..09e5424 100644 --- a/pages/Personal/Personal.vue +++ b/pages/Personal/Personal.vue @@ -22,29 +22,7 @@ data() { return {}; }, - onLoad() { - var that = this - try { - const value = uni.getStorageSync('openid'); - const value3 = uni.getStorageSync('token'); - if (value && value3) { - const value2 = uni.getStorageSync('patientId'); - if (value2) {} else { - uni.navigateTo({ - url: '/pages/login/login' - }) - } - } else { - uni.navigateTo({ - url: '/pages/login/login' - }) - } - } catch (e) { - uni.navigateTo({ - url: '/pages/login/login' - }) - } - }, + onLoad() {}, methods: { goorder() { var that = this @@ -106,7 +84,6 @@ uni.removeStorageSync('patientId'); uni.removeStorageSync('openid'); uni.removeStorageSync('phone'); - uni.removeStorageSync('token'); uni.navigateTo({ url: '/pages/login/login' }) @@ -136,6 +113,7 @@