123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view style="height: 100%;width: 100%; padding: 20rpx 30rpx;">
- <view class="list" v-for="item,index in doctorList" :key='index' @click.stop="clicklist" :data-id="item.docter.id"
- :data-index="index">
- <!-- 头像 -->
- <view class="portrait">
- <view style="padding-top: 20rpx;">
- <image class="img" :src="item.docter.avatar"></image>
- <view class="bun_true" @click.stop="follow" :data-index="index" :data-id="item.docter.id" v-if="item.docter.is_collect==0">关注</view>
- <view class="bun_false" @click.stop="follow" :data-index="index" :data-id="item.docter.id" v-else>已关注</view>
- </view>
- </view>
- <!-- 文字 -->
- <view class="text">
- <!-- 名字+标签 -->
- <view class="name">
- <view style="margin-right: 15rpx;">{{item.docter.name}}</view>
- <view class="label" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</view>
- </view>
- <!-- 科室 -->
- <view class="department">
- <text>科室:</text>
- <text style="color: #333333;">{{item.docter.office.name||'暂无'}}</text>
- <text style="color: #333333;">{{item.docter.qualification.name||'暂无'}}</text>
- </view>
- <!-- 选项 -->
- <view class="option">
- <view v-if="item.docter.is_chat==1">图文</view>
- <view v-if="item.docter.is_phone==1">电话</view>
- <view v-if="item.docter.is_appoint==1">门诊</view>
- </view>
- </view>
- </view>
- <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
- <u-no-network></u-no-network>
- <view class="cu-tabbar-height"></view>
- <view class="cu-tabbar-height"></view>
- </view>
- </template>
- <script>
- export default {
- mounted() {
- this.gethome_doctor()
- },
- data() {
- return {
- //关注
- isfollow: false,
- //协议
- num: 1,
- imgitem: {
- istrue: false,
- name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
- },
- tcID: '套餐一', //ID
- tcTime: '一年', //套餐有效期
- tcContent: { //套餐内容
- content: '套餐一包含包含疫苗接种、门诊预约、儿保预约三项服务', //内容
- scope: '使用范围:家医团队可用,有效期内无限次、300元额度以内门诊预约与儿保预约无限制', //范围
- giving: '赠送XXXX保险:保险介绍' //赠送
- },
- tcTeam: [],
- doctorList: [],
- pageindex: 1,
- show:false
- }
- },
- onReachBottom() {
- this.gethome_doctor()
- },
- methods: {
- //关注
- follow: async function(e) {
- let res = await this.$request.post("/api/v1/collection/submitCollect", {
- type: 1,
- relation_id: e.currentTarget.dataset.id
- })
- if (res.status == 0) {
- if (res.data.is_collect == 0) {
- uni.showToast({
- title: "取消成功",
- icon: "none"
- })
- this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
- } else {
- uni.showToast({
- title: "关注成功",
- icon: "none"
- })
- this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
- }
- }
- },
- gethome_doctor: async function() {
- let res = await this.$request.post("/api/v1/user/familyDocterList", {
- page: this.pageindex,
- // is_pack_docter:1
- })
- console.log(res)
- if (res.status == 0) {
- if (this.pageindex > res.data.last_page) {
- uni.showToast({
- title: "没有更多了",
- icon: "none"
- })
- } else {
- this.doctorList = this.doctorList.concat(res.data.data)
- this.pageindex++
- }
- }
- if (this.doctorList.length == 0) {
- this.show = true
- } else {
- this.show = false
- }
- console.log(this.doctorList)
- },
- clicklist(e) {
- uni.navigateTo({
- url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id+"&index=1"
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .list {
- margin: 20rpx 0 10rpx 0;
- display: flex;
- width: 100%;
- height: 200rpx;
- border-radius: 15rpx;
- background-color: #FFFFFF;
- box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
- .portrait {
- width: 30%;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- .img {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- .bun_true {
- text-align: center;
- width: 80rpx;
- height: 36rpx;
- background-color: #D92975;
- margin: 0 10rpx;
- border-radius: 60rpx;
- position: relative;
- top: -20rpx;
- font-size: 20rpx;
- color: #FFFFFF;
- padding: 3rpx 0;
- }
- .bun_false {
- border: 1rpx solid #D92975;
- text-align: center;
- width: 80rpx;
- height: 36rpx;
- background-color: #FFFFFF;
- margin: 0 10rpx;
- border-radius: 60rpx;
- position: relative;
- top: -20rpx;
- font-size: 20rpx;
- color: #D92975;
- padding: 3rpx 0;
- }
- }
- //文字
- .text {
- width: 70%;
- height: 100%;
- padding: 20rpx 0;
- //名字+标签
- .name {
- font-size: 30rpx;
- font-weight: bold;
- display: flex;
- align-items: center;
- .label {
- font-weight: 400;
- margin-right: 15rpx;
- background-color: #E5F5FF;
- color: #0B73B9;
- // width: 120rpx;
- height: 28rpx;
- font-size: 20rpx;
- border-radius: 10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- //科室
- .department {
- padding: 20rpx 0;
- color: #666666;
- text {
- margin-right: 15rpx;
- }
- }
- // 选项
- .option {
- display: flex;
- view {
- background-color: #E4E4E4;
- width: 100rpx;
- height: 48rpx;
- border-radius: 12px;
- margin-right: 15rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- }
- }
- </style>
|