分包医生

This commit is contained in:
zoujiandong
2024-01-16 14:59:06 +08:00
parent 562d4e9691
commit d5a9339ddd
1060 changed files with 3177 additions and 44707 deletions
+90
View File
@@ -0,0 +1,90 @@
import { API } from '../../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '患者评价', //导航栏 中间的标题
},
height: app.globalData.height,
stickyProps: {
offsetTop: app.globalData.height*2 + 20,
zIndex: 99
},
doctor_id: "",
evaluation_type: 1,
appraise_list_1: [],
appraise_list_2: [],
appraise_list_3: [],
current_page: 0,
total: 0,
per_page: 0,
last_page: 0,
total_quantity: 0,
good_quantity: 0,
bad_quantity: 0,
},
onPullDownRefresh(){
console.log('===下拉动作===');
this.setData({
current_page: 0,
})
this.getDoctorEvaluationList();
},
onReachBottom() {
console.log('===触底了!!===');
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
this.getDoctorEvaluationList(this.data.evaluation_type)
}
},
onLoad(option){
console.log(option.doctor_id);
this.setData({
doctor_id: option.doctor_id
})
},
onShow(){
console.log("onShow");
this.getDoctorEvaluationList(1);
},
onTabsChange(e){
console.log(e);
let list_name = "appraise_list_" + e.detail.name;
this.setData({
evaluation_type: e.detail.name,
current_page: 0,
last_page: 0,
[list_name]: []
})
this.getDoctorEvaluationList(e.detail.name)
},
getDoctorEvaluationList(evaluation_type){
//获取评价列表
let params = {};
params.page = this.data.current_page + 1;
params.doctor_id = this.data.doctor_id;
params.evaluation_type = evaluation_type;
api.getDoctorEvaluation(params).then(response => {
if(response.data.total > 0){
let list_name = "appraise_list_" + evaluation_type;
console.log(list_name);
let apprise_list = this.data[list_name];
this.setData({
[list_name]: apprise_list.concat(response.data.data),
current_page: response.data.current_page,
total: response.data.total,
per_page: response.data.per_page,
last_page: response.data.last_page,
total_quantity: response.data.total_quantity,
good_quantity: response.data.good_quantity,
bad_quantity: response.data.bad_quantity,
})
}
}).catch(errors => {
console.error(errors);
})
}
})
+13
View File
@@ -0,0 +1,13 @@
{
"component": true,
"usingComponents": {
"te-nav-bar": "../../../../commpents/te_navbar/index",
"appraise-data": "../../../commpents/appraise_data/index",
"van-empty": "@vant/weapp/empty/index",
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"t-rate": "tdesign-miniprogram/rate/rate",
"van-divider": "@vant/weapp/divider/index"
},
"onReachBottomDistance": 100
}
+111
View File
@@ -0,0 +1,111 @@
<wxs module="dateSubstr" src="/utils/substr.wxs"></wxs>
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="container">
<van-tabs active="1"
color="#3CC7C0"
title-active-color="#3CC7C0"
bind:change="onTabsChange"
border="{{true}}"
>
<van-tab title="全部({{total_quantity}})" name="1">
<view class="item_list">
<view class="item" wx:for="{{appraise_list_1}}">
<view class="top">
<view class="name">{{item.name_mask}}</view>
<view class="start">
<t-rate value="{{item.avg_score}}" count="5" color="#ED9C00"/>
</view>
</view>
<view class="content">{{item.content}}</view>
<view class="date">{{dateSubstr.substring(item.created_at,0,16)}}</view>
</view>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_1.length == 0}}" />
<van-divider contentPosition="center" wx:if="{{appraise_list_1.length > 0 && current_page == last_page}}">到底了~</van-divider>
</van-tab>
<van-tab title="好评({{good_quantity}})" name="2">
<view class="item_list">
<view class="item" wx:for="{{appraise_list_2}}">
<view class="top">
<view class="name">{{item.name_mask}}</view>
<view class="start">
<t-rate value="{{item.avg_score}}" count="5" color="#ED9C00"/>
</view>
</view>
<view class="content">{{item.content}}</view>
<view class="date">{{dateSubstr.substring(item.created_at,0,16)}}</view>
</view>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_2.length == 0}}" />
<van-divider contentPosition="center" wx:if="{{appraise_list_2.length > 0 && current_page == last_page}}">到底了~</van-divider>
</van-tab>
<van-tab title="中/差评({{bad_quantity}})" name="3">
<view class="item_list">
<view class="item" wx:for="{{appraise_list_3}}">
<view class="top">
<view class="name">{{item.name_mask}}</view>
<view class="start">
<t-rate value="{{item.avg_score}}" count="5" color="#ED9C00"/>
</view>
</view>
<view class="content">{{item.content}}</view>
<view class="date">{{dateSubstr.substring(item.created_at,0,16)}}</view>
</view>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_3.length == 0}}" />
<van-divider contentPosition="center" wx:if="{{appraise_list_3.length > 0 && current_page == last_page}}">到底了~</van-divider>
</van-tab>
</van-tabs>
<!-- <t-tabs
defaultValue="{{1}}"
sticky
stickyProps="{{stickyProps}}"
bind:change="onTabsChange"
bind:click="onTabsClick"
t-class="custom-tabs"
catch:scroll="onStickyScroll"
theme="line"
custom-style="font-size: 32rpx"
>
<t-tab-panel label="全部({{total_quantity}})" value="1">
<view class="item_list">
<appraise-data
name="{{item.name_mask}}"
start="{{item.avg_score }}"
content="{{item.content}}"
date="{{item.created_at}}"
wx:for="{{appraise_list_1}}"
/>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_1.length == 0}}" />
</t-tab-panel>
<t-tab-panel label="好评({{good_quantity}})" value="2">
<view class="item_list">
<appraise-data
name="{{item.name_mask}}"
start="{{item.avg_score }}"
content="{{item.content}}"
date="{{item.created_at}}"
wx:for="{{appraise_list_2}}"
/>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_2.length == 0}}" />
</t-tab-panel>
<t-tab-panel label="中/差评({{bad_quantity}})" value="3">
<view class="item_list">
<appraise-data
name="{{item.name_mask}}"
start="{{item.avg_score }}"
content="{{item.content}}"
date="{{item.created_at}}"
wx:for="{{appraise_list_3}}"
/>
</view>
<van-empty description="暂无数据" wx:if="{{appraise_list_3.length == 0}}" />
</t-tab-panel>
</t-tabs> -->
</view>
+50
View File
@@ -0,0 +1,50 @@
page{
background-color: #F6F6F6;
}
.container{
width: 100vw;
}
.item_list{
width: 92vw;
margin: 20rpx auto;
background-color: #fff;
border-radius: 20rpx;
}
.item{
display: flex;
padding: 20rpx;
flex-direction: column;
}
.item:not(:last-child){
border-bottom: 1px solid #E7E7E7;
}
.top{
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
}
.name{
flex: 1;
font-size: 30rpx;
color: #666666;
}
.start{
flex: 1;
display: flex;
justify-content: flex-end;
}
.content{
flex: 2;
font-size: 34rpx;
color: #333333;
margin: 20rpx 0;
}
.date{
flex: 1;
font-size: 28rpx;
color: #666666;
}