2021-08-19 06:40:59 +00:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 状态栏 -->
|
|
|
|
|
<status-nav :titleVal="'医生'" :statusTitle="true"></status-nav>
|
|
|
|
|
<!-- 自定义二级分类 -->
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<view :style="{paddingTop: statusHNH+'px'}">
|
|
|
|
|
<view class="bacf mar-s20 pad-s20 pad-y32 pad-x40">
|
|
|
|
|
<view class="disjb">
|
|
|
|
|
<view class="pad-z40">
|
|
|
|
|
<view class="fon28 bold col3">{{doctorObj.name}}</view>
|
|
|
|
|
<view class="disac col80 fon24" style="margin: 6rpx 0;">
|
|
|
|
|
<view>{{['未知','男','女'][doctorObj.gender]}}</view>
|
|
|
|
|
<view class="doctorx"></view>
|
|
|
|
|
<view>从业{{doctorObj.work_time}}年</view>
|
|
|
|
|
<view v-if="doctorObj.dept_name!=''" class="doctorx"></view>
|
|
|
|
|
<view>{{doctorObj.dept_name}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="col80 fon24 disac">
|
|
|
|
|
<view class="flexs">擅长领域:</view>
|
|
|
|
|
<scroll-view scroll-x style="width: 250rpx;">
|
|
|
|
|
<view class="disac">
|
|
|
|
|
<view class="flexs" v-for="(item,index) in doctorObj.diseases" :key="index">
|
|
|
|
|
<text class="bold mar-y10 pcol">{{item.disease_name}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<image class="radius10" :src="doctorObj.headimg || moImg" style="width: 246rpx;height: 188rpx;" mode="aspectFill"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mar-z32">
|
|
|
|
|
<view class="bbot mar-s30"></view>
|
|
|
|
|
<view class="fon28 bold col3 mar-sx20">个人简介</view>
|
|
|
|
|
<view class="fon26 col3" style="line-height: 37rpx;">{{doctorObj.summary}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view id="daoh" :class="isTop?'isTop':''" class="isTops" :style="{top:(statusHNH-10)+'px'}">
|
|
|
|
|
<view class="bacf pad-zy32 mar-s20 pad-sx20">
|
|
|
|
|
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mar-zy32 mar-s20" v-if="dataList.length!=0"><list-pu :list="dataList"></list-pu></view>
|
|
|
|
|
<view style="margin-top: 30%;" v-if="dataList.length==0"><list-pu :list="dataList"></list-pu></view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="pad-zy20 mar-sx30">
|
|
|
|
|
<!-- 返回顶部 -->
|
|
|
|
|
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
statusHNH:uni.getStorageSync('statusHNH'),
|
|
|
|
|
publicColor:uni.getStorageSync('publicColor'),//主题颜色
|
|
|
|
|
cateList:[
|
|
|
|
|
// {title:'问题'},
|
|
|
|
|
// {title:'案例日记'},
|
|
|
|
|
// {title:'效果模拟'},
|
|
|
|
|
// {title:'科普视频'},
|
|
|
|
|
],
|
|
|
|
|
dataList:[
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
showTop:false,
|
|
|
|
|
newCurrent:0,
|
2021-08-22 08:53:12 +00:00
|
|
|
|
category_id:0,//栏目ID
|
2021-08-19 06:40:59 +00:00
|
|
|
|
moImg:'/static/public/logo.png',
|
|
|
|
|
doctorObj:{},//医生详情
|
|
|
|
|
page:1,
|
|
|
|
|
size:10,
|
|
|
|
|
total:'',//总数
|
|
|
|
|
isZanw:true,
|
|
|
|
|
chuTop:'',
|
|
|
|
|
isTop:false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onPageScroll(e) {
|
|
|
|
|
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
|
|
|
|
|
if((this.chuTop - this.statusHNH) - e.scrollTop*1 <= 0) this.isTop = true
|
|
|
|
|
else this.isTop = false
|
|
|
|
|
},
|
|
|
|
|
onReachBottom() {//触底事件
|
|
|
|
|
console.log(this.total,this.dataList.length);
|
|
|
|
|
if(this.total!=this.dataList.length){
|
|
|
|
|
this.page++
|
|
|
|
|
this.checkConList(this.category_id)//调用自主预约列表事件
|
|
|
|
|
} else {
|
|
|
|
|
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
|
|
|
|
|
this.isZanw = false
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-08-22 08:53:12 +00:00
|
|
|
|
onShow() {
|
|
|
|
|
this.$toolAll.tools.isLogin()
|
|
|
|
|
},
|
2021-08-19 06:40:59 +00:00
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.checkDoD(options.doctor_id)
|
|
|
|
|
this.checkConList(this.category_id)
|
|
|
|
|
|
|
|
|
|
const query = wx.createSelectorQuery()
|
|
|
|
|
query.select('#daoh').boundingClientRect((rect) => {
|
|
|
|
|
// console.log('状态栏+标题栏:',rect);
|
|
|
|
|
this.chuTop = rect.top
|
|
|
|
|
}).exec()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkDoD(doctor_id){
|
|
|
|
|
this.$requst.post('user/doctor-info',{doctor_id:doctor_id}).then(res=>{
|
|
|
|
|
// console.log('医生详情:',res);
|
|
|
|
|
if(res.code==0){
|
|
|
|
|
this.doctorObj = res.data
|
|
|
|
|
}
|
|
|
|
|
},error=>{})
|
|
|
|
|
},
|
|
|
|
|
checkConList(category_id){//查询收藏列表
|
|
|
|
|
this.$toolAll.tools.showToast('加载中...')
|
|
|
|
|
let params = {
|
|
|
|
|
category_id:category_id,
|
|
|
|
|
page:this.page,
|
|
|
|
|
size:this.size
|
|
|
|
|
}
|
2021-08-22 08:53:12 +00:00
|
|
|
|
this.$requst.post('archives/hot',params).then(res=>{
|
2021-08-19 06:40:59 +00:00
|
|
|
|
if(res.code==0){
|
|
|
|
|
// 栏目类别
|
|
|
|
|
if(uni.getStorageSync('cateList')==''){//首次渲染栏目
|
|
|
|
|
if(res.data.category.length!=0){
|
|
|
|
|
res.data.category.forEach((item,index)=>{
|
|
|
|
|
let cateObj = {
|
|
|
|
|
id:item.id,//栏目ID
|
|
|
|
|
title:item.title,//栏目名称
|
|
|
|
|
active:item.active,//是否选中
|
|
|
|
|
model_id:item.model_id,//模型ID
|
|
|
|
|
model_name:item.model_name,//模型标识
|
|
|
|
|
sort:item.sort,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.cateList.push(cateObj)
|
|
|
|
|
})
|
|
|
|
|
uni.setStorageSync('cateList',this.cateList)
|
2021-08-22 08:53:12 +00:00
|
|
|
|
this.category_id = this.cateList[0].id
|
2021-08-19 06:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//获取缓存中的栏目
|
|
|
|
|
this.cateList = uni.getStorageSync('cateList')
|
2021-08-22 08:53:12 +00:00
|
|
|
|
this.category_id = this.cateList[0].id
|
2021-08-19 06:40:59 +00:00
|
|
|
|
}
|
|
|
|
|
// 获取列表
|
|
|
|
|
if(this.page==1) this.dataList = []
|
|
|
|
|
this.total = res.data.list.total
|
|
|
|
|
if(res.data.list.list.length!=0){
|
|
|
|
|
uni.hideToast()
|
|
|
|
|
res.data.list.list.forEach(item=>{
|
|
|
|
|
let num = item.video.search(".mp4")
|
|
|
|
|
let isVideo = false
|
|
|
|
|
if(num!='-1') isVideo = true
|
|
|
|
|
let tObj = {
|
|
|
|
|
category_id:item.category_id,//栏目ID
|
|
|
|
|
id:item.id,
|
2021-08-22 09:06:24 +00:00
|
|
|
|
is_collected:item.is_collected,//是否已收藏
|
2021-08-19 06:40:59 +00:00
|
|
|
|
collects:item.collects,//收藏量
|
|
|
|
|
views:item.views,//查看量
|
|
|
|
|
main_img:this.$http + item.cover,//封面图
|
|
|
|
|
video:this.$http + item.video,//视频地址
|
|
|
|
|
title:item.title,//标题
|
|
|
|
|
content:item.subtitle,//副标题
|
|
|
|
|
head_img:'/static/public/logo.png',//发布者头像
|
|
|
|
|
name:'恒美植发',//发布者昵称
|
|
|
|
|
isVideo:isVideo//是否是视频
|
|
|
|
|
}
|
|
|
|
|
if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)
|
|
|
|
|
if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)
|
|
|
|
|
if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)
|
|
|
|
|
if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},error=>{})
|
|
|
|
|
},
|
|
|
|
|
chooseTwo(index){
|
|
|
|
|
this.newCurrent = index
|
|
|
|
|
this.isZanw = true
|
|
|
|
|
this.page = 1
|
|
|
|
|
this.category_id = this.cateList[index].id
|
|
|
|
|
this.checkConList(this.cateList[index].id)
|
|
|
|
|
},
|
|
|
|
|
backTop(){//回到顶部事件
|
|
|
|
|
uni.pageScrollTo({
|
|
|
|
|
scrollTop: 0,
|
|
|
|
|
duration: 300
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|