add file
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
import { API } from './../../../utils/network/api'
|
||||
import Toast from '@vant/weapp/toast/toast';
|
||||
let api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
navbarData: {
|
||||
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
||||
title: '在线问诊设置', //导航栏 中间的标题
|
||||
},
|
||||
height: app.globalData.height,
|
||||
open_note: "已开启,患者可以向您发起图文问诊",
|
||||
close_note: "已关闭,暂不接诊",
|
||||
note: "",
|
||||
inquiry_type: 1,
|
||||
inquiry_mode: 1,
|
||||
info:{
|
||||
is_open: false,
|
||||
inquiry_price: 0,
|
||||
work_num_day: 0
|
||||
},
|
||||
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(){
|
||||
this.setData({ note: this.data.open_note });
|
||||
},
|
||||
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,
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
onChange({ detail }) {
|
||||
console.log("onChange: ", detail);
|
||||
if(detail){
|
||||
this.setData({ note: this.data.open_note });
|
||||
}else{
|
||||
this.setData({ note: this.data.close_note });
|
||||
}
|
||||
this.setData({ "info.is_open": detail });
|
||||
|
||||
//修改开关
|
||||
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.is_open = detail?1:0;
|
||||
api.putDoctorInquiryOpen(params).then(response => {
|
||||
console.log(response);
|
||||
}).catch(errors => {console.error(errors);})
|
||||
|
||||
},
|
||||
putDoctorInquiryConfig(){
|
||||
//修改医生问诊配置
|
||||
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;
|
||||
api.putDoctorInquiryConfig(params).then(response => {
|
||||
console.log(response);
|
||||
Toast.success("修改成功");
|
||||
wx.switchTab({
|
||||
url: "/Pages/yishi/wenzhen/wenzhen"
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
onStepperChange(event) {
|
||||
console.log(event.detail);
|
||||
this.setData({
|
||||
"info.work_num_day": event.detail
|
||||
});
|
||||
},
|
||||
onPriceChange(e){
|
||||
console.log(e.detail);
|
||||
let value = e.detail.value;
|
||||
let min = this.data.config.min_inquiry_price;
|
||||
let max = this.data.config.max_inquiry_price;
|
||||
if(value < min){
|
||||
value = min;
|
||||
Toast.fail('价格不能低于' + min + '元');
|
||||
}else if(value >= min && value <=max ){
|
||||
value = value;
|
||||
}else{
|
||||
value = max;
|
||||
Toast.fail('价格不能高于' + max + '元');
|
||||
}
|
||||
this.setData({
|
||||
"info.inquiry_price": value
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "/commpents/te_navbar",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index",
|
||||
"van-stepper": "@vant/weapp/stepper/index",
|
||||
"van-switch": "@vant/weapp/switch/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-toast": "@vant/weapp/toast/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container" style="height: calc(100vh - 96rpx - 30rpx - {{height}}px);">
|
||||
<view class="switch_box">
|
||||
<view class="switch_box_top">
|
||||
<view class="switch_box_item">
|
||||
<view class="switch_box_item_name">接诊开关</view>
|
||||
<view class="switch_box_item_btn">
|
||||
<van-switch
|
||||
active-color="#3CC7C0"
|
||||
inactive-color="#E7E7E7"
|
||||
size="40rpx"
|
||||
checked="{{ info.is_open==1 }}"
|
||||
bind:change="onChange" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="switch_box_note">{{ note }}</view>
|
||||
</view>
|
||||
<view class="help">
|
||||
<van-cell url="/Pages/yishi/manual/index" custom-style="font-size:32rpx;" title="图文问诊操作手册" is-link border="{{false}}" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{ info.is_open==1 }}" class="checked_box">
|
||||
<view class="price_title">价格设置</view>
|
||||
<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 }}" max="{{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">
|
||||
提示:服务开通后,患者可以向您购买图文问诊进行问诊,接诊后需要与患者进行图文沟通
|
||||
1、问诊价格每日仅限调整1次,每自然月仅限调整5次
|
||||
2、单价修改后立即生效,不影响当日已生成的问诊订单
|
||||
3、接诊后,患者可与您在{{config.duration/60}}小时内进行{{config.times_number}}个回合沟通
|
||||
4、如有参加公益问诊活动,患者问诊订单价格以参加的公益问诊单价为准
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view class="go" wx:if="{{ info.is_open==1 }}">
|
||||
<van-button bind:click="putDoctorInquiryConfig" color="#3CC7C0" custom-style="border-radius: 20rpx;font-size:30rpx;" type="primary" block>去接诊</van-button>
|
||||
</view>
|
||||
|
||||
<van-toast id="van-toast" />
|
||||
</view>
|
||||
@@ -0,0 +1,134 @@
|
||||
.container{
|
||||
width: 100vw;
|
||||
background-color: #F6F6F6;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
.switch_box{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90vw;
|
||||
/* height: 500rpx; */
|
||||
border-radius: 20rpx;
|
||||
margin: 0 auto;
|
||||
background-color: rgb(255, 255, 255);
|
||||
}
|
||||
.switch_box_top{
|
||||
position: relative;
|
||||
display: flex;
|
||||
/* height: 300rpx; */
|
||||
flex-direction: column;
|
||||
padding: 30rpx 30rpx 20rpx 30rpx;
|
||||
}
|
||||
.switch_box_top::after{
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
pointer-events: none;
|
||||
right: 0;
|
||||
left: 32rpx;
|
||||
bottom: 0;
|
||||
border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #e7e7e7));
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
.switch_box_item{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.switch_box_item_name{
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.switch_box_item_btn{
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
}
|
||||
.switch_box_note{
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.help{
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.price_title{
|
||||
width: 90vw;
|
||||
margin: 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;
|
||||
align-items: center;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.price_steup_box_bottom{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0rpx 20rpx 0rpx 20rpx;
|
||||
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: 0 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;
|
||||
}
|
||||
Reference in New Issue
Block a user