分包医生

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
+132
View File
@@ -0,0 +1,132 @@
import { API } from '../../../../utils/network/api'
import Toast from 'tdesign-miniprogram/toast/index';
let api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '价格设置', //导航栏 中间的标题
},
inquiry_type: 1,
inquiry_mode: 1,
info:{
is_open: false,
inquiry_price: 0,
work_num_day: 0
},
myprice: "",
config:{
"max_work_num_day": 30,
"min_inquiry_price": 0,
"max_inquiry_price": 0,
"default_inquiry_price": 0,
"times_number": 10,
"duration": 1440,
"system_inquiry_price": [
"0",
"5",
"10"
]
}
},
onLoad(options){
if(options.inquiry_mode){
this.setData({
inquiry_mode:options.inquiry_mode
})
}
},
onShow(){
let params = {};
params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
//获取医生我的账户数据
api.getDoctorInquiryConfig(params).then(response => {
console.log(response);
this.setData({
info: response.data.info,
config: response.data.config,
note: response.data.info.is_open == 1? this.data.open_note : this.data.close_note
})
}).catch(errors => {console.error(errors);})
},
onStepperChange(event) {
console.log(event.detail);
wx.vibrateShort({
"type": "heavy"
})
this.setData({
"info.work_num_day": event.detail
});
},
onPriceChange(e){
console.log(e.detail);
let price = e.detail.value;
this.setData({
"info.inquiry_price": price
})
},
myToast(message){
Toast({
context: this,
selector: '#t-toast',
message: message,
theme: 'error',
direction: 'column',
});
},
checkPrice(price){
let value = Number(price);
let min = Number(this.data.config.min_inquiry_price);
let max = Number(this.data.config.max_inquiry_price);
if(value < min){
value = min;
let message = '价格不能低于' + min + '元';
this.myToast(message);
return false;
}else if(value >= min && value <=max ){
return true;
}else{
value = max;
let message = '价格不能高于' + max + '元';
this.myToast(message);
return false;
}
},
async updateConfig(){
if(this.data.inquiry_mode==1){
let check = this.checkPrice(this.data.info.inquiry_price);
console.log("checkcheckcheck:", check);
if(!check){
return;
}
}
//修改医生问诊配置
let params = {};
params.inquiry_type = this.data.inquiry_type;//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
params.inquiry_mode = this.data.inquiry_mode;//接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
params.inquiry_price = this.data.info.inquiry_price;
params.work_num_day = this.data.info.work_num_day;
const result = await api.putDoctorInquiryConfig(params).then(response => {
console.log(response);
this.myToast("修改成功");
return true;
}).then(res => {
setTimeout(() => {
wx.navigateBack();
}, 1000);
}).catch(errors => {
console.error(errors);
return false;
})
console.log("updateConfig result result: ", result);
return result;
}
})
@@ -0,0 +1,8 @@
{
"usingComponents": {
"te-nav-bar": "../../../../commpents/te_navbar/index",
"van-stepper": "@vant/weapp/stepper/index",
"van-button": "@vant/weapp/button/index",
"t-toast": "tdesign-miniprogram/toast/toast"
}
}
@@ -0,0 +1,49 @@
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="checked_box">
<view class="price_steup_box">
<view class="price_steup_box_top">
<view class="price_steup_box_top_title">每日接诊数量</view>
<view class="price_steup_box_top_stepper">
<van-stepper value="{{ info.work_num_day }}" min="0" max="{{info.work_num_day > config.max_work_num_day?info.work_num_day:config.max_work_num_day}}" integer bind:change="onStepperChange" />
</view>
</view>
<view class="price_steup_box_bottom">
<view class="price_steup_box_bottom_title">问诊单价</view>
<view class="price_steup_box_bottom_num">
<input class="weui-input" bindblur="onPriceChange" type="digit" value="{{ info.inquiry_price }}" placeholder="请输入问诊单价" />
<text class="price">元</text>
</view>
</view>
</view>
</view>
<view class="bottom">
<text class="bottom_txt" wx:if="{{inquiry_mode==1}}">
提示:服务开启后,患者按照所设置的价格向您购买图文问诊服务
1、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}回合沟通
2、若开启公益问诊,图文问诊价格以公益问诊价格为准
3、每日接诊数量和问诊价格每日仅限调整1次,每月仅限调整5次
4、价格修改后立即生效,不影响修改之前已生成的问诊订单
</text>
<text wx:elif="{{inquiry_mode==2}}">
提示:服务开通后,患者可以向您购买视频问诊服务,接诊后<text class="green">需要您主动和患者预约视频时间并同步设置预约时间</text>
1、视频问诊价格<text class="green">每日仅限调整1次,每自然月仅限调整5次</text>
2、单价修改后立即生效,不影响当日已生成的问诊订单
3、<text class="green">24小时不接诊,订单自动取消</text>,并不展示在您的接诊列表中
4、接诊后,您与患者<text class="green">沟通有效期为48小时</text>,同时提供无回合限制图文、语音形式交流
5、患者因服务不满意等原因要求退款时,平台会和您协商处理
</text>
<text wx:else>
提示:服务开通后,患者可以向您购买疑难会诊服务,接诊后需要与患者进行图文沟通。
1、问诊价格<text style="color:#3CC7C0">每日仅限调整1次,每自然月仅限调整5次</text>
2、单价修改后立即生效,不影响当日已生成的问诊订单
3、接诊后,患者根据您设定的服务周期和服务次数进行问诊沟通
4、接诊后出现争议时,平台客服会根据实际问诊情况与您协商进行退款
</text>
</view>
<view class="go">
<van-button bind:click="updateConfig" color="#3CC7C0" custom-style="border-radius: 20rpx;font-size:30rpx;" type="primary" block>确定</van-button>
</view>
<t-toast id="t-toast" />
@@ -0,0 +1,91 @@
page{
background-color: #F6F6F6;
}
.checked_box{
margin-top: 30rpx;
}
.price_title{
width: 90vw;
margin: 20rpx auto 0 auto;
font-size: 32rpx;
margin-bottom: 20rpx;
/* font-family: "AlibabaPuHuiTi-2-55-Regular"; */
color: #333333;
}
.price_steup_box{
display: flex;
width: 90vw;
height: 180rpx;
margin: 0 auto;
border-radius: 20rpx;
flex-direction: column;
background-color: rgb(255, 255, 255);
}
.price_steup_box_top{
position: relative;
display: flex;
justify-content: space-between;
margin: 20rpx 20rpx 20rpx 30rpx;
align-items: center;
padding-bottom: 20rpx;
}
.price_steup_box_bottom{
position: relative;
display: flex;
justify-content: space-between;
margin: 0rpx 20rpx 0rpx 30rpx;
align-items: center;
}
.price_steup_box_top_title, .price_steup_box_bottom_title{
flex: 1;
font-size: 32rpx;
color: #333;
}
.price_steup_box_bottom_num{
flex: 1.5;
display: flex;
align-items: center;
}
.price_steup_box_top::after{
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 0;
left: 0;
bottom: 0;
border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
transform: scaleY(0.5);
}
.price_steup_box_top_stepper{
flex: 1;
text-align: right;
align-items: center;
}
.bottom{
width: 90vw;
margin: -20rpx auto;
color: #999;
letter-spacing: 2rpx;
font-size: 28rpx;
line-height: 40rpx;
}
.go{
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 100rpx;
width: 90vw;
}
.weui-input{
color: red;
display: inline-block;
text-align: right;
}
.price{
text-align: center;
flex: 1;
}
.green{
color:#3CC7C0;
}