Browse Source

增加就诊人页面交互

master
kuaileWu 1 year ago
parent
commit
146b0720c9
  1. 11
      main.js
  2. 18
      pages/modify_visitor/modify_visitor.vue
  3. 50
      pages/visitors/visitors.vue

11
main.js

@ -224,11 +224,7 @@ function req(url, data={}, method = 'POST', header={}) {
try{ try{
var rdata = res.data; var rdata = res.data;
if(rdata.code != CODE_SUCCESS) { if(rdata.code != CODE_SUCCESS) {
if(rdata.code==CODE_LOGIN_EXIPRE && data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5 && url != getWxH5LoginConfigUri && data.repeat != 1){ if((rdata.msg.indexOf('Signature verification failed')>-1 || rdata.msg.indexOf('身份认证信息未提供'))>-1 && rdata.code==CODE_LOGIN_EXIPRE && data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5 && url != getWxH5LoginConfigUri && data.repeat != 1){
if(headerObj.Authorization) {
console.log(headerObj.Authorization, url)
return
}
removeLogin(); removeLogin();
var logindatac = new Object(); var logindatac = new Object();
@ -249,17 +245,16 @@ function req(url, data={}, method = 'POST', header={}) {
showCancel: false, showCancel: false,
content: rdata.msg ? rdata.msg : '网络错误,请重试|'+res.statusCode, content: rdata.msg ? rdata.msg : '网络错误,请重试|'+res.statusCode,
success: function (rs) { success: function (rs) {
if (rs.confirm && rdata.code==CODE_LOGIN_EXIPRE) { if (rs.confirm && rdata.code==CODE_LOGIN_EXIPRE && (rdata.msg.indexOf('Signature verification failed')>-1 || rdata.msg.indexOf('身份认证信息未提供')>-1)) {
removeLogin(); removeLogin();
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
let pageUrl = '/'+currentPage.route; let pageUrl = '/'+currentPage.route;
if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5){ if(data.xcx_scource == Vue.prototype.USER_SOURCE_WX_H5){
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/index?url='+encodeURIComponent(pageUrl) url: '/pages/index/index'
}); });
}else{ }else{
} }
return; return;
} }

18
pages/modify_visitor/modify_visitor.vue

@ -28,19 +28,34 @@
idcardExtRule:false, idcardExtRule:false,
phone:'', phone:'',
phoneRule:false, phoneRule:false,
type:1,
adding:false
} }
}, },
components:{ components:{
InputBox InputBox
},
onLoad(option) {
if(option.type) this.type = option.type
}, },
methods: { methods: {
add() { add() {
if(this.adding) return
this.adding = true
console.log(123)
var param = new Object() var param = new Object()
param.real_name = this.name param.real_name = this.name
param.id_no = this.idcardExt param.id_no = this.idcardExt
param.mobile = this.phone param.mobile = this.phone
this.$http.req('client/user/visit_user/', param, 'POST').then(data=>{ var that = this
var addtimer = setTimeout(function() {
that.adding = false
}, 5000);
this.$http.req('client/user/visit_user/', param, 'POST', true).then(data=>{
clearTimeout(addtimer)
this.adding = false
if(data == -1) return if(data == -1) return
this.$func.toPage('/pages/visitors/visitors?type='+this.type);
}); });
}, },
nameBlurEvent(value, res){ nameBlurEvent(value, res){
@ -65,6 +80,7 @@
}, },
submit(){ submit(){
this.checkSubmit() this.checkSubmit()
this.canSubmit = true
if(!this.canSubmit) return if(!this.canSubmit) return
this.add() this.add()
} }

50
pages/visitors/visitors.vue

@ -4,13 +4,13 @@
<img :src="cssUrl+'add.svg'">增加就诊人 <img :src="cssUrl+'add.svg'">增加就诊人
</view> </view>
<view class="list-wrapper" v-if="type == 1"> <view class="list-wrapper" v-if="type == 1">
<view class="item block"> <view :class="'item block'+(item.select?' active':'')" v-for="(item,key) in visitUsers" @click="chooseVisitor(item, key)">
<view class="top flex"> <view class="top flex">
<view class="PfScSemibold">张杨明</view> <view class="name PfScSemibold">{{item.real_name}}</view>
<view>剩余3</view> <view class="aam_times" v-if="item.aam_times">剩余{{item.aam_times}}</view>
</view> </view>
<view class="bot line36"> <view class="bot line36">
身份证尾号0909备份 身份证尾号{{item.id_no}}
</view> </view>
<img class="status" :src="cssUrl+'visitor_select_active.svg'"> <img class="status" :src="cssUrl+'visitor_select_active.svg'">
<img class="bg" :src="cssUrl+'visitor_list__bg.svg'"> <img class="bg" :src="cssUrl+'visitor_list__bg.svg'">
@ -18,16 +18,16 @@
</view> </view>
<view class="submit" v-if="type == 1" @click="toPrebook"> <view class="submit" v-if="type == 1" @click="toPrebook">
<view class="bot primary btn btn2 submitbtn" hover-class="hover"> <view class="bot primary btn btn2 submitbtn" hover-class="hover">
确认预约已选1 确认预约已选{{selectCount}}
</view> </view>
<view class="tip height40">请确保预约就诊前在门诊先挂号</view> <view class="tip height40">请确保预约就诊前在门诊先挂号</view>
</view> </view>
<view class="list-wrapper2" v-if="type == 2"> <view class="list-wrapper2" v-if="type == 2">
<view class="item block"> <view class="item block" v-for="(item,key) in visitUsers">
<view class="top flex"> <view class="top flex">
<view class="PfScSemibold">张杨明</view> <view class="PfScSemibold">{{item.name}}</view>
<view>身份证尾号9000</view> <view>身份证尾号{{item.id_no}}</view>
</view> </view>
<view class="bt"> <view class="bt">
<view class="bt-item flex"> <view class="bt-item flex">
@ -80,7 +80,9 @@
res:true, res:true,
popContent:'删除张杨明后,就诊记录还可以查到,确定删除吗?', popContent:'删除张杨明后,就诊记录还可以查到,确定删除吗?',
popTitle:'确认删除', popTitle:'确认删除',
popShowCancel:true popShowCancel:true,
visitUsers:false,
selectCount:0
} }
}, },
components:{ components:{
@ -91,12 +93,24 @@
this.getVisitors() this.getVisitors()
}, },
methods: { methods: {
chooseVisitor(info, key){
this.selectCount = 0
this.visitUsers[key].select = !this.visitUsers[key].select
this.$set(this.visitUsers, key, this.visitUsers[key])
for (let i = 0; i < this.visitUsers.length; i++) {
if(this.visitUsers[i].select) ++this.selectCount
}
},
getVisitors() { getVisitors() {
var param = new Object() var param = new Object()
param.page = 1 param.page = 1
param.limit = 10000 param.limit = 10000
this.$http.req('client/user/visit_user/', param, 'GET').then(data=>{ this.$http.req('client/user/visit_user/', param, 'GET').then(data=>{
if(data == -1) return if(data == -1) return
this.visitUsers = data.data
for (var i = 0; i < this.visitUsers.length; i++) {
this.visitUsers[i].select = false
}
}); });
}, },
showPopCom() { showPopCom() {
@ -112,6 +126,10 @@
}) })
}, },
toPrebook(){ toPrebook(){
if(this.selectCount <= 0){
this.$pop.modelShow('请选择就诊人')
return
}
uni.navigateTo({ uni.navigateTo({
url:"/pages/prebook/prebook" url:"/pages/prebook/prebook"
}) })
@ -156,19 +174,20 @@
line-height: 50rpx; line-height: 50rpx;
height: 50rpx; height: 50rpx;
align-items: center; align-items: center;
view:first-of-type{ .name{
font-size: 38rpx; font-size: 38rpx;
color: #333333; color: #333333;
letter-spacing: 3rpx; letter-spacing: 3rpx;
} }
view:last-of-type{ .aam_times{
width: 134rpx; min-width: 134rpx;
color: #79624A; color: #79624A;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
background: rgba(254, 232, 198, 0.66); background: rgba(254, 232, 198, 0.66);
border-radius: 6rpx; border-radius: 6rpx;
height: 44rpx; height: 44rpx;
padding: 0 10rpx;
line-height: 44rpx; line-height: 44rpx;
margin-left: 56rpx; margin-left: 56rpx;
} }
@ -181,11 +200,18 @@
img{ img{
position: absolute; position: absolute;
} }
&.active{
border: 2rpx solid #39D067;
.status{
display: block;
}
}
.status{ .status{
right: 0; right: 0;
top: 0; top: 0;
width: 98rpx; width: 98rpx;
height: 98rpx; height: 98rpx;
display: none;
} }
.bg{ .bg{
bottom: 0; bottom: 0;

Loading…
Cancel
Save