体检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> <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"> <div class="content" v-if="hospitalInfo.hospitalName">
<h3>医院信息</h3> <h3>医院信息</h3>
@ -107,7 +109,7 @@
<div>联系方式: {{ hospitalInfo.telPhone }}</div> <div>联系方式: {{ hospitalInfo.telPhone }}</div>
</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> <u-button type="primary" text="确定预约" shape="circle" size="small" @click="handleSave"></u-button>
</div> </div>
</view> </view>
@ -146,7 +148,8 @@ export default {
checkTypeContentList: [], checkTypeContentList: [],
showIcon: false, showIcon: false,
reservationNumber: 0, reservationNumber: 0,
isDisabled: true isDisabled: true,
checkId: ''
} }
}, },
onLoad(opt) { onLoad(opt) {
@ -236,6 +239,7 @@ export default {
}, },
// //
getCheckTypeContent(item) { getCheckTypeContent(item) {
this.checkId = item.id
const params = { const params = {
token: this.token, token: this.token,
checkId: item.id, checkId: item.id,
@ -343,6 +347,7 @@ export default {
phyAppontTime: this.healthTime, phyAppontTime: this.healthTime,
setMealType: '2', setMealType: '2',
combName: this.checkTypeContent, combName: this.checkTypeContent,
checkId: this.checkId,
// token: this.token // token: this.token
} }
console.log('🚀 ~ handleSave ~ params:', params) console.log('🚀 ~ handleSave ~ params:', params)
@ -361,7 +366,7 @@ export default {
res = res.data res = res.data
console.log('🚀 ~ handleSave ~ res:', res) console.log('🚀 ~ handleSave ~ res:', res)
if (res.res == 1) { if (res.res == 1) {
uni.setStorageSync('appoint', true) // uni.setStorageSync('appoint', true)
uni.showToast({ uni.showToast({
title: '预约成功', title: '预约成功',
icon: 'success' icon: 'success'
@ -369,6 +374,11 @@ export default {
uni.reLaunch({ uni.reLaunch({
url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully' url: '/pages/HealthExaminationApp/myAppointment/bookSuccessfully'
}) })
} else {
uni.showToast({
title: res.resMsg,
icon: 'none'
})
} }
}, },
fail: err => { fail: err => {

View File

@ -97,7 +97,9 @@ export default {
], ],
// //
avatar: 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() { mounted() {
@ -115,19 +117,54 @@ export default {
}, },
// //
handlePage(url) { handlePage(url) {
if ( if (url == 'appointment' || url == 'jobAppointment') {
(url == 'appointment' && uni.getStorageSync('appoint')) || const params = {
(url == 'jobAppointment' && uni.getStorageSync('jobAppoint')) appoint: url == 'appointment' ? '2' : '3',
) { token: this.token
uni.showToast({ }
title: '您已经预约过,无法再次预约!', console.log('🚀 ~ getStatus ~ params:', params)
icon: 'none' 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() { getStatus() {

View File

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

View File

@ -12,7 +12,7 @@
<u-button type="primary" text="查询" @click="handleQuery"></u-button> <u-button type="primary" text="查询" @click="handleQuery"></u-button>
</div> </div>
</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> <div class="tip">提示向左滑动取消预约</div>