体检app bug修复

This commit is contained in:
binbin_pan 2024-09-19 11:32:22 +08:00
parent d2bb0079e6
commit cc913afb9a
4 changed files with 72 additions and 20 deletions

View File

@ -96,7 +96,9 @@
<!-- 体检时间 -->
<u-calendar :show="showTime" mode="single" @confirm="confirmTime" @close="showTime = false"></u-calendar>
<div v-if="healthTime" class="reservation-number">当天剩余可预约人数{{ reservationNumber }}</div>
<div v-if="healthTime" class="reservation-number">
当天剩余可预约人数{{ reservationNumber < 0 ? '0' : reservationNumber }}
</div>
<div class="content" v-if="hospitalInfo.hospitalName">
<h3>医院信息</h3>
@ -107,7 +109,7 @@
<div>联系方式: {{ hospitalInfo.telPhone }}</div>
</div>
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber != 0">
<div style="margin: 30px 60px" v-if="hospital && checkType && healthTime && reservationNumber > 0">
<u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
</div>
</view>
@ -146,7 +148,8 @@ export default {
checkTypeContentList: [],
showIcon: false,
reservationNumber: 0,
isDisabled: true
isDisabled: true,
checkId: ''
}
},
onLoad(opt) {
@ -236,6 +239,7 @@ export default {
},
//
getCheckTypeContent(item) {
this.checkId = item.id
const params = {
token: this.token,
checkId: item.id,
@ -343,6 +347,7 @@ export default {
phyAppontTime: this.healthTime,
setMealType: '2',
combName: this.checkTypeContent,
checkId: this.checkId,
// token: this.token
}
console.log('🚀 ~ handleSave ~ params:', params)
@ -361,7 +366,7 @@ export default {
res = res.data
console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) {
uni.setStorageSync('appoint', true)
// uni.setStorageSync('appoint', true)
uni.showToast({
title: '预约成功',
icon: 'success'
@ -369,6 +374,11 @@ export default {
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
} else {
uni.showToast({
title: res.resMsg,
icon: 'none'
})
}
},
fail: err => {

View File

@ -97,7 +97,9 @@ export default {
],
//
avatar:
'https://img.zcool.cn/community/0104c958b69c23a801219c77ba5da2.png?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100'
'https://img.zcool.cn/community/0104c958b69c23a801219c77ba5da2.png?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100',
//
isAppoint: true
}
},
mounted() {
@ -115,19 +117,54 @@ export default {
},
//
handlePage(url) {
if (
(url == 'appointment' && uni.getStorageSync('appoint')) ||
(url == 'jobAppointment' && uni.getStorageSync('jobAppoint'))
) {
uni.showToast({
title: '您已经预约过,无法再次预约!',
icon: 'none'
if (url == 'appointment' || url == 'jobAppointment') {
const params = {
appoint: url == 'appointment' ? '2' : '3',
token: this.token
}
console.log('🚀 ~ getStatus ~ params:', params)
uni.request({
url: config.tjBaseUrl + '/app/getphyappoint',
method: 'post',
data: params,
header: {
'content-type': 'application/x-www-form-urlencoded',
token: this.token
},
success: res => {
console.log('🚀 ~ getStatus ~ res:', res)
res = res.data
if (res.res == 1 && res.obj == 1) {
this.isAppoint = false
}
},
fail: err => {
console.log('🚀 ~ getStatus ~ err:', err)
uni.showToast({
title: '系统异常,请联系管理员',
icon: 'none'
})
}
})
setTimeout(() => {
if (this.isAppoint) {
uni.showToast({
title: '您已经预约过,无法再次预约!',
icon: 'none'
})
return
} else {
uni.navigateTo({
url: `/pages/HealthExaminationApp/${url}/${url}?params=${JSON.stringify(this.userInfo)}`
})
}
}, 200)
} else {
uni.navigateTo({
url: `/pages/HealthExaminationApp/${url}/${url}?params=${JSON.stringify(this.userInfo)}`
})
return
}
uni.navigateTo({
url: `/pages/HealthExaminationApp/${url}/${url}?params=${JSON.stringify(this.userInfo)}`
})
},
//
getStatus() {

View File

@ -206,7 +206,7 @@ export default {
token: this.token,
hosId: this.hospitalInfo.id,
phyAppontTime: this.healthTime,
type: '2'
type: '3'
}
console.log('🚀 ~ getReservationNumber ~ params:', params)
uni.request({
@ -244,7 +244,7 @@ export default {
const params = {
hospitalId: this.hospitalInfo.id,
setMealId: this.setMealId,
checkId: '',
checkId: undefined,
phyAppontTime: this.healthTime,
setMealType: '3',
combName: this.checkType,
@ -266,7 +266,7 @@ export default {
res = res.data
console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) {
uni.setStorageSync('jobAppoint', true)
// uni.setStorageSync('jobAppoint', true)
uni.showToast({
title: '预约成功',
icon: 'success'
@ -274,6 +274,11 @@ export default {
uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
})
} else {
uni.showToast({
title: res.resMsg,
icon: 'none'
})
}
},
fail: err => {

View File

@ -12,7 +12,7 @@
<u-button type="primary" text="查询" @click="handleQuery"></u-button>
</div>
</div>
<u-picker :show="show" :columns="columns" keyName="label" @close="show = false" @confirm="handleSearch"></u-picker>
<u-picker :show="show" :columns="columns" keyName="label" @cancel="show = false" @confirm="handleSearch"></u-picker>
<div class="tip">提示向左滑动取消预约</div>