体检app bug修复
This commit is contained in:
parent
d2bb0079e6
commit
cc913afb9a
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue