This commit is contained in:
曹辉 2023-05-23 09:55:43 +08:00
parent c9d7f861e5
commit a31fe92fce
3 changed files with 70 additions and 41 deletions

View File

@ -85,12 +85,14 @@
stationId: null, stationId: null,
stationItemId: null, stationItemId: null,
stationItemPriceId: null, stationItemPriceId: null,
hospitalcare:false,
} }
}, },
onLoad(options) { onLoad(options) {
this.stationId = options.stationId this.stationId = options.stationId
this.stationItemId = options.stationItemId this.stationItemId = options.stationItemId
this.stationItemPriceId = options.stationItemPriceId this.stationItemPriceId = options.stationItemPriceId
this.hospitalcare = options.hospitalcare
}, },
onShow() { onShow() {
this.baseurl = baseurl this.baseurl = baseurl
@ -160,9 +162,22 @@
if (res.code == 200) { if (res.code == 200) {
if (res.data.loginFlag) { if (res.data.loginFlag) {
that.usershow = false that.usershow = false
const scenenurseStationId = uni.getStorageSync('scenenurseStationId');
if (scenenurseStationId) {
if (that.hospitalcare) {
uni.navigateTo({
url: `/pages/hospitalcare/hospitalcare?stationId=${this.stationId}&stationItemId=${this.stationItemId}&stationItemPriceId=${this.stationItemPriceId}`,
})
} else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${this.stationId}&stationItemId=${this.stationItemId}&stationItemPriceId=${this.stationItemPriceId}`, url: `/pages/appointmenttime/appointmenttime?stationId=${this.stationId}&stationItemId=${this.stationItemId}&stationItemPriceId=${this.stationItemPriceId}`,
}) })
}
} else {
uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${this.stationId}&stationItemId=${this.stationItemId}&stationItemPriceId=${this.stationItemPriceId}`,
})
}
} else { } else {
that.usershow = true that.usershow = true
} }

View File

@ -67,6 +67,7 @@
}, },
data() { data() {
return { return {
timer: null,
companionDays: 1, companionDays: 1,
orderlist: { orderlist: {
patientName: undefined, patientName: undefined,
@ -127,20 +128,35 @@
signType: response.data.signType, signType: response.data.signType,
paySign: response.data.paySign, paySign: response.data.paySign,
success: function(res) { success: function(res) {
uni.removeStorageSync('scenenurseStationId');
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '预约成功', title: '预约成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.redirectTo({
url: `/pages/paysuccess/paysuccess` url: `/pages/paysuccess/paysuccess`
}) })
}, 1500)
}, },
fail: function(err) { fail: function(err) {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '取消预约', title: '取消预约',
type: 'error', type: 'error',
duration: 1500, duration: 1500,
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.redirectTo({
url: `/pages/menttimeorder/menttimeorder?list=${JSON.stringify(obj)}` url: `/pages/menttimeorder/menttimeorder?list=${JSON.stringify(obj)}`
}) })
}, 1500)
} }
}); });
} else { } else {

View File

@ -222,7 +222,6 @@
// scene 使 decodeURIComponent scene // scene 使 decodeURIComponent scene
if (options.scene) { if (options.scene) {
this.nurseStationId = decodeURIComponent(options.scene) this.nurseStationId = decodeURIComponent(options.scene)
this.hospitalcare = true
if (this.nurseStationId) { if (this.nurseStationId) {
createMobileToken().then(res => { createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token) uni.setStorageSync("token", res.data.token)
@ -308,37 +307,29 @@
goappointments(item) { goappointments(item) {
let that = this let that = this
const value = uni.getStorageSync('openid'); const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId'); const patientId = uni.getStorageSync('patientId');
if (value && value2) { if (value && patientId) {
if (that.hospitalcare) {
const scenenurseStationId = uni.getStorageSync('scenenurseStationId');
// if (scenenurseStationId) {
uni.navigateTo({
url: `/pages/hospitalcare/hospitalcare?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
})
// } else {
// that.goAppIdentification(value2, item)
// }
} else {
that.goAppIdentification(value2, item)
}
} else {
that.$refs.uToast.show({
title: '未登录,请先登录',
type: 'error',
url: '/pages/login/login'
})
}
},
goAppIdentification(value, item) {
let that = this let that = this
AppIdentification(value).then(res => { AppIdentification(patientId).then(res => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.loginFlag) { if (res.data.loginFlag) {
that.usershow = false that.usershow = false
const scenenurseStationId = uni.getStorageSync('scenenurseStationId');
if (scenenurseStationId) {
if (that.hospitalcare) {
uni.navigateTo({
url: `/pages/hospitalcare/hospitalcare?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
})
} else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`, url: `/pages/appointmenttime/appointmenttime?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
}) })
}
} else {
uni.navigateTo({
url: `/pages/appointmenttime/appointmenttime?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`,
})
}
} else { } else {
that.usershow = true that.usershow = true
} }
@ -350,6 +341,13 @@
}) })
} }
}) })
} else {
that.$refs.uToast.show({
title: '未登录,请先登录',
type: 'error',
url: '/pages/login/login'
})
}
}, },
getInfo() { getInfo() {
introductionList(this.nurseStationId).then(res => { introductionList(this.nurseStationId).then(res => {
@ -435,7 +433,7 @@
}, },
goProjectDetails(item) { goProjectDetails(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/ProjectDetails/ProjectDetails?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}`, url: `/pages/ProjectDetails/ProjectDetails?stationId=${item.stationId}&stationItemId=${item.stationItemId}&stationItemPriceId=${item.stationItemPriceId}&hospitalcare=${this.hospitalcare}`,
}) })
}, },
gophone() { gophone() {