优化
This commit is contained in:
@@ -53,9 +53,6 @@ Page({
|
||||
},
|
||||
onChange({ detail }) {
|
||||
console.log("onChange: ", detail);
|
||||
|
||||
|
||||
|
||||
if(detail){
|
||||
let inquiry_price = this.data.info.inquiry_price;
|
||||
let check = this.checkPrice(inquiry_price);
|
||||
@@ -105,39 +102,12 @@ Page({
|
||||
})
|
||||
|
||||
},
|
||||
onStepperChange(event) {
|
||||
console.log(event.detail);
|
||||
this.setData({
|
||||
"info.work_num_day": event.detail
|
||||
});
|
||||
let price = this.data.info.inquiry_price;
|
||||
this.updateConfig(price);
|
||||
|
||||
},
|
||||
onPriceChange(e){
|
||||
console.log(e.detail);
|
||||
let price = e.detail.value;
|
||||
let check = this.checkPrice(price);
|
||||
if(!check){
|
||||
price = this.data.info.inquiry_price
|
||||
return
|
||||
}
|
||||
let result = this.updateConfig(price);
|
||||
console.log("result result result:", result);
|
||||
result.then((res)=>{
|
||||
console.log(res)
|
||||
if(!res) price = this.data.info.inquiry_price
|
||||
this.setData({
|
||||
"info.inquiry_price": price
|
||||
})
|
||||
})
|
||||
},
|
||||
myToast(message){
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: message,
|
||||
theme: 'success',
|
||||
theme: 'error',
|
||||
direction: 'column',
|
||||
});
|
||||
},
|
||||
@@ -159,23 +129,4 @@ Page({
|
||||
return false;
|
||||
}
|
||||
},
|
||||
async updateConfig(price){
|
||||
//修改医生问诊配置
|
||||
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 = 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;
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
return false;
|
||||
})
|
||||
|
||||
console.log("updateConfig result result: ", result);
|
||||
return result;
|
||||
}
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container" style="height: calc(100vh - 96rpx - 30rpx - {{height}}px);">
|
||||
<view class="container">
|
||||
<view class="switch_box">
|
||||
<view class="switch_box_top">
|
||||
<view class="switch_box_item">
|
||||
@@ -23,19 +23,16 @@
|
||||
<view 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 }}" min="1" max="{{config.max_work_num_day}}" integer bind:change="onStepperChange" />
|
||||
<van-cell size="large" url="/Pages/yishi/onlinesetupprice/index" custom-style="font-size:32rpx;" title="每日接诊数量" is-link border="{{true}}" >
|
||||
<view class="cell_value">
|
||||
{{info.work_num_day}}
|
||||
</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>
|
||||
</van-cell>
|
||||
<van-cell size="large" url="/Pages/yishi/onlinesetupprice/index" custom-style="font-size:32rpx;" title="问诊单价(元)" is-link border="{{false}}" >
|
||||
<view class="cell_value">
|
||||
{{info.inquiry_price}}元
|
||||
</view>
|
||||
</view>
|
||||
</van-cell>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
page{
|
||||
background-color: #F6F6F6;
|
||||
}
|
||||
.container{
|
||||
width: 100vw;
|
||||
background-color: #F6F6F6;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
.switch_box{
|
||||
@@ -59,6 +61,7 @@
|
||||
color: #333333;
|
||||
}
|
||||
.price_steup_box{
|
||||
padding-top: 10rpx;
|
||||
display: flex;
|
||||
width: 90vw;
|
||||
height: 180rpx;
|
||||
@@ -131,4 +134,7 @@
|
||||
.price{
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
}
|
||||
.cell_value{
|
||||
color: #000;
|
||||
}
|
||||
Reference in New Issue
Block a user