xinelu-applet-ui/pagesC/choosedoctor/choosedoctor.vue

160 lines
3.6 KiB
Vue
Raw Normal View History

2023-10-12 09:47:40 +08:00
<template>
<view class="app">
2023-11-07 17:04:46 +08:00
<!-- <view class="inputs">
2023-10-12 09:47:40 +08:00
<i class="icon"></i>
2023-10-16 09:19:16 +08:00
<input type="text" name="" id="" class="input" placeholder="请输入医生姓名" v-model="realname">
2023-11-07 17:04:46 +08:00
</view> -->
<view class="list" v-if="doctorlist">
2023-10-12 09:47:40 +08:00
<view class="item" v-for="item in doctorlist" @tap='emitdata(item)'>
<image src="../../static/docHead.png" mode=""></image>
<view class="name">
{{item.realname?item.realname:''}}
</view>
<view class="address">
{{item.teamName?item.teamName:''}}
</view>
<view class="title">
{{item.teamMemberTypeName?item.teamMemberTypeName:''}}
</view>
2023-10-16 09:19:16 +08:00
<view class="zixunbtn" v-if="item.userNo==userNo">
已选择
</view>
<view class="zixunbtn nobtn" v-else>
2023-10-12 09:47:40 +08:00
选TA
</view>
</view>
</view>
2023-11-07 17:04:46 +08:00
<view class="list" v-if="list">
<view class="item" @tap='emitdata(item)'>
<image src="../../static/docHead.png" mode=""></image>
<view class="name">
{{list.personName}}
</view>
<view class="address">
{{list.personPhone}}
</view>
<!-- <view class="title">
{{list.personPhone}}
</view> -->
<view class="zixunbtn" v-if="list.userNo==userNo">
已选择
</view>
<view class="zixunbtn nobtn" v-else>
选TA
</view>
</view>
</view>
2023-10-12 09:47:40 +08:00
</view>
</template>
<script>
import {
getDoctorList
} from '@/api/pagesC/choosedoctor/index.js'
2023-10-13 13:39:29 +08:00
import {
getDoctorListtwo
} from '@/api/pagesB/myfamilydoctorteam/index.js'
2023-10-12 09:47:40 +08:00
export default {
data() {
return {
orgNo: null,
2023-10-16 09:19:16 +08:00
userNo: null,
2023-10-13 13:39:29 +08:00
teamNo: null,
2023-10-16 09:19:16 +08:00
realname: '',
2023-10-12 09:47:40 +08:00
doctorlist: [],
doctortotal: 0,
2023-11-07 17:04:46 +08:00
list:[{
personPhone:'',
personName:'',
}],
2023-10-12 09:47:40 +08:00
pageNum: 1,
};
},
2023-10-16 09:19:16 +08:00
watch: {
realname: {
handler(newval, oldval) {
this.getDoctorListinfo();
}
}
},
2023-10-12 09:47:40 +08:00
methods: {
getDoctorListinfo() {
2023-10-13 13:39:29 +08:00
if (this.orgNo) {
2023-10-16 11:28:16 +08:00
getDoctorList(this.pageNum, this.orgNo, this.realname).then(res => {
2023-10-13 13:39:29 +08:00
this.doctorlist = res.rows
this.doctortotal = res.total
})
} else {
2023-11-07 17:04:46 +08:00
// getDoctorListtwo(this.pageNum, 10, this.teamNo, this.realname).then(res => {
// this.doctorlist = res.rows
// this.doctortotal = res.total
// })
2023-10-13 13:39:29 +08:00
}
2023-10-12 09:47:40 +08:00
},
emitdata(item) {
2023-11-07 17:04:46 +08:00
console.log(this.list,'474')
if(item){
uni.$emit('doctordata', {
data: JSON.stringify(item),
})
uni.navigateBack({
delta: 1
});
}else{
uni.$emit('doctordata', {
data: JSON.stringify(this.list),
})
uni.navigateBack({
delta: 1
});
}
2023-10-12 09:47:40 +08:00
},
},
onLoad(options) {
2023-11-07 17:04:46 +08:00
if (options.item) {
this.list = JSON.parse(options.item)
console.log(this.list, '58')
}
2023-10-13 13:39:29 +08:00
if (options.orgNo) {
this.orgNo = options.orgNo
2023-10-16 09:19:16 +08:00
this.userNo = options.userNo
2023-11-07 17:04:46 +08:00
this.getDoctorListinfo();
2023-10-13 13:39:29 +08:00
} else {
// this.teamNo = uni.getStorageSync('userinfo').teamNo
this.teamNo = "00bf7f5a02f3460aa975721ff9f5e533"
}
2023-10-12 09:47:40 +08:00
},
onReachBottom() { //上滑加载
if (this.doctorlist.length >= this.doctortotal) {} else {
this.pageNum++;
2023-10-13 13:39:29 +08:00
if (this.orgNo) {
2023-10-16 11:28:16 +08:00
getDoctorList(this.pageNum, this.orgNo, this.realname).then(res => {
2023-10-13 13:39:29 +08:00
res.rows.forEach(e => {
this.doctorlist.push(e)
})
this.doctortotal = res.total
2023-10-12 09:47:40 +08:00
})
2023-10-13 13:39:29 +08:00
} else {
2023-10-16 11:28:16 +08:00
getDoctorListtwo(this.pageNum, 10, this.teamNo, this.realname).then(res => {
2023-10-13 13:39:29 +08:00
res.rows.forEach(e => {
this.doctorlist.push(e)
})
this.doctortotal = res.total
})
}
2023-10-12 09:47:40 +08:00
}
},
onPullDownRefresh() { //下拉刷新
this.pageNum = 1;
this.getDoctorListinfo()
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
@import './choosedoctor.scss';
2023-10-16 11:28:16 +08:00
</style>