Browse Source

修复签到添加患者相关问题

master
8889998@qq.com 2 months ago
parent
commit
a23cca37fb
  1. 6
      components/FormItem.vue
  2. 165
      pages/modify_visitor/modify_visitor.vue
  3. 5
      pages/visitors/visitors.vue
  4. 12
      pages/waiting_method/waiting_method.vue

6
components/FormItem.vue

@ -111,14 +111,10 @@ export default {
height: 44rpx; height: 44rpx;
flex-grow: 1; flex-grow: 1;
font-size: 32rpx; font-size: 32rpx;
flex: 1;
padding-left: 20rpx; padding-left: 20rpx;
color: #000000; color: #000000;
display: flex;
justify-content: flex-end;
align-items: center;
flex-grow: 1;
text-align: right; text-align: right;
box-sizing: border-box;
} }
.picker { .picker {

165
pages/modify_visitor/modify_visitor.vue

@ -12,11 +12,14 @@
<view class="submit-wrapper btPadding" v-if="!vid"> <view class="submit-wrapper btPadding" v-if="!vid">
<view :class="'btn btn3 PfScMedium submit' + (canSubmit ? ' primary' : ' noclick')" <view :class="'btn btn3 PfScMedium submit' + (canSubmit ? ' primary' : ' noclick')"
:hover-class="(canSubmit ? 'hover' : '')" @click="submit" v-if="!vid"> :hover-class="(canSubmit ? 'hover' : '')" @click="submit" v-if="!vid && (doctorInfo.aid || !canSubmit)">
确认新增 确认新增
</view> </view>
<button :class="'btn btn3 PfScMedium submit' + (canSubmit ? ' primary' : ' noclick')" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!doctorInfo.aid && canSubmit && !vid">确认新增</button>
<view :class="'btn btn3 PfScMedium submit' + (canSubmit ? ' primary' : ' noclick')" <view :class="'btn btn3 PfScMedium submit' + (canSubmit ? ' primary' : ' noclick')"
:hover-class="(canSubmit ? 'hover' : '')" @click="submit" v-else> :hover-class="(canSubmit ? 'hover' : '')" @click="submit" v-if="vid">
确认修改 确认修改
</view> </view>
</view> </view>
@ -30,6 +33,23 @@
<SexPop ref="genderPopup" v-model="sex" @confirm="handleConfirm" /> <SexPop ref="genderPopup" v-model="sex" @confirm="handleConfirm" />
<uni-popup ref="nameWrap" :safe-area="false" v-if="!vid">
<view class="popup-container">
<view class="header">
<view class="title PfScMedium">需要填写真实姓名来确保您账号的唯一性</view>
</view>
<view class="label">真实姓名</view>
<input type="text" class="realName" v-model="realName" placeholder-class="placeholder-style" placeholder="请填写">
<view class="confirm-button-wrapper btPadding">
<view class="confirm-button PfScMedium" @click="handleConfirmPhone">
完成
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -60,6 +80,8 @@ export default {
0:'男', 0:'男',
1:'女' 1:'女'
}, },
doctorInfo:false,
realName:'',
} }
}, },
components: { components: {
@ -82,9 +104,52 @@ export default {
} }
}, },
onShow() { onShow() {
if (this.vid) this.getVisitorInfo() if (this.vid) {
this.getVisitorInfo()
}else{
this.getDoctorInfo()
}
}, },
methods: { methods: {
handleConfirmPhone(){
if(!this.realName.trim()){
uni.showModal({
title:'提示',
content: '姓名不可为空',
})
return
}
this.$http.req('/api/user/set_realname', { realname:this.realName}, 'POST').then(data => {
if (data == -1) return
this.$refs.nameWrap.close()
});
},
getPhoneNumber(e) {
console.log(e)
if (e.detail.errMsg === 'getPhoneNumber:ok') {
this.$http.req('api/user/bind_phone', {phonecode:e.detail.code}, 'POST').then(data=>{
if(data == -1) return
this.getDoctorInfo()
});
} else {
}
},
async getDoctorInfo() {
this.$http.req('api/user/index_info', {}, 'GET').then(data=>{
if(data == -1) return
this.doctorInfo = data;
if(!data.realname && data.aid) {
this.$nextTick(() => {
this.$refs.nameWrap.open('bottom')
})
}
console.log(this.doctorInfo)
});
},
handleConfirm(sex){ handleConfirm(sex){
this.sex = sex; this.sex = sex;
this.checkSubmit() this.checkSubmit()
@ -177,9 +242,101 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.getphone-box{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
z-index: 8999999999;
opacity: 0;
}
.popup-container {
position: relative;
max-height: calc(100vh - 200rpx);
overflow-y: scroll;
background: #ffffff;
border-radius: 40rpx 40rpx 0px 0px;
padding: 42rpx 48rpx 16rpx;
.header {
position: relative;
text-align: left;
.title {
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
letter-spacing: normal;
color: #000000;
}
}
.label {
margin-top: 54rpx;
font-family: PingFang SC;
font-size: 34rpx;
font-weight: 500;
line-height: 47.6rpx;
letter-spacing: normal;
color: #000000;
}
.realName {
color: #000000;
font-size: 34rpx;
line-height: 40rpx;
height: 40rpx;
font-family: PingFang SC;
font-weight: normal;
letter-spacing: normal;
padding: 22rpx 0;
border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
margin-bottom: 160rpx;
margin-top: 22rpx;
&::placeholder {
opacity: 0.3;
}
}
.placeholder-style {
opacity: 0.3;
}
.confirm-button-wrapper {
display: flex;
align-items: center;
justify-content: center;
.confirm-button {
justify-content: center;
display: flex;
align-items: center;
font-weight: 600;
font-size: 34rpx;
color: #ffffff;
text-align: center;
width: 368rpx;
height: 80rpx;
border-radius: 8rpx;
background: #07C160;
}
}
.date {
margin: 12rpx 36rpx 42rpx;
text-align: center;
color: #000000;
font-size: 26rpx;
font-family: PingFang SC;
}
}
.visitor-form-page { .visitor-form-page {
background: #F8F8F8; background: #F8F8F8;
height: 100vh; height: 100vh;
overflow-y: scroll; overflow-y: scroll;

5
pages/visitors/visitors.vue

@ -32,7 +32,7 @@
<view class="submit flex baodao-submit" v-if="type == 0 && !is_preview"> <view class="submit flex baodao-submit" v-if="type == 0 && !is_preview">
<view :class="'btn cancel btn1 PfScMedium'" hover-class="hover" @click="reback">返回</view> <view :class="'btn cancel btn1 PfScMedium'" hover-class="hover" @click="reback">返回</view>
<view class="btn primary btn1 PfScMedium" hover-class="hover" @click="appointTime">预约时间</view> <view class="btn primary btn1 PfScMedium" hover-class="hover" @click="appointTime">现在预约</view>
</view> </view>
<view class="submit" v-if="is_preview" @click="toPrebook"> <view class="submit" v-if="is_preview" @click="toPrebook">
@ -321,7 +321,7 @@
this.$http.req('api/user/get_visitors', obj, 'POST').then(data=>{ this.$http.req('api/user/get_visitors', obj, 'POST').then(data=>{
this.visitUsers = data; this.visitUsers = data;
if(this.visitUsers.length == 0) { if(this.visitUsers.length == 0 && !obj.get_preview) {
this.addVisitor() this.addVisitor()
return; return;
} }
@ -386,6 +386,7 @@
uni.setStorageSync('active_visitors', JSON.stringify(this.activeVisitors)) uni.setStorageSync('active_visitors', JSON.stringify(this.activeVisitors))
// => // =>
if((this.type == 0 || this.type == 1) && !this.is_preview){ if((this.type == 0 || this.type == 1) && !this.is_preview){
uni.setStorageSync('methods_set_wait', 1)
this.$nav.navToPath('/pages/waiting_method/waiting_method') this.$nav.navToPath('/pages/waiting_method/waiting_method')
return return
} }

12
pages/waiting_method/waiting_method.vue

@ -1,5 +1,5 @@
<template> <template>
<view class='waiting-method-page'> <view class='waiting-method-page' v-if="pageshow">
<view class="h-name over PfScSemibold"> <view class="h-name over PfScSemibold">
{{hospital_depart_name}} {{hospital_depart_name}}
</view> </view>
@ -28,6 +28,7 @@
active_visitors:[], active_visitors:[],
hospital_depart_name:'', hospital_depart_name:'',
submitting:false, submitting:false,
pageshow:false
} }
}, },
components:{ components:{
@ -48,6 +49,13 @@
return return
} }
}, },
onShow() {
if(!uni.getStorageSync('methods_set_wait')) {
this.$nav.navToPath('/pages/index/index')
return
}
this.pageshow = true
},
methods: { methods: {
changeType(info) { changeType(info) {
// //
@ -79,8 +87,8 @@
this.$http.req('api/user/checkin', obj, 'POST').then(data => { this.$http.req('api/user/checkin', obj, 'POST').then(data => {
//
if(data == -1) return if(data == -1) return
uni.removeStorageSync('methods_set_wait')
this.$nav.navToPath('/pages/prebook_list/prebook_list') this.$nav.navToPath('/pages/prebook_list/prebook_list')
}).catch(err => { }).catch(err => {
this.$pop.msg('提交失败,请重试'); this.$pop.msg('提交失败,请重试');

Loading…
Cancel
Save