4.7提交
This commit is contained in:
@@ -16,6 +16,7 @@ Page({
|
||||
note: "",
|
||||
inquiry_type: 1,
|
||||
inquiry_mode: 1,
|
||||
multi_point_status:'',
|
||||
config_setting:{},
|
||||
info:{
|
||||
is_open: false,
|
||||
@@ -24,6 +25,7 @@ Page({
|
||||
},
|
||||
active:0,
|
||||
myprice: "",
|
||||
healthPrice:'图文价格*0.5*6',
|
||||
config:{
|
||||
"max_work_num_day": 30,
|
||||
"min_inquiry_price": 0,
|
||||
@@ -43,8 +45,11 @@ Page({
|
||||
showOpenchuFang:false,
|
||||
showOpenTuWen:false,
|
||||
},
|
||||
onLoad(){
|
||||
|
||||
onLoad(options){
|
||||
console.log(options.multi_point_status);
|
||||
this.setData({
|
||||
multi_point_status:options.multi_point_status
|
||||
})
|
||||
},
|
||||
cancelOpenChuFang(){
|
||||
this.setData({
|
||||
@@ -71,10 +76,25 @@ Page({
|
||||
onShow(){
|
||||
let {active}=this.data;
|
||||
this.getDoctorconfig();
|
||||
this.getDoctorOpen();
|
||||
this.getSysconfig();
|
||||
if(active==4){
|
||||
this.getConfig()
|
||||
}
|
||||
},
|
||||
|
||||
getDoctorOpen(){
|
||||
let {inquiry_type,inquiry_mode}=this.data;
|
||||
api.getOpen({
|
||||
inquiry_type,
|
||||
inquiry_mode
|
||||
}).then(response => {
|
||||
this.setData({
|
||||
note: response.data,
|
||||
'info.is_open': response.data
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
getDoctorconfig(){
|
||||
let {inquiry_type,inquiry_mode}=this.data;
|
||||
//接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
@@ -86,9 +106,10 @@ Page({
|
||||
}).then(response => {
|
||||
console.log(response);
|
||||
this.setData({
|
||||
info: response.data.info,
|
||||
config: response.data.config,
|
||||
note: response.data.info.is_open
|
||||
'info.inquiry_price': response.data.inquiry_price,
|
||||
'info.work_num_day': response.data.work_num_day,
|
||||
// config: response.data.config,
|
||||
// note: response.data.info.is_open
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
@@ -106,6 +127,7 @@ Page({
|
||||
onChange({ detail }) {
|
||||
this.doChange(detail)
|
||||
},
|
||||
|
||||
getConfig(){
|
||||
let {inquiry_type,inquiry_mode}=this.data;
|
||||
api.getServiceConfig({
|
||||
@@ -132,7 +154,7 @@ Page({
|
||||
addServiceContent(){
|
||||
app.go('/user/pages/yishi/addServiceContent/index')
|
||||
},
|
||||
doChange(detail){
|
||||
async doChange(detail){
|
||||
console.log("onChange: ", detail);
|
||||
let is_open = 0;
|
||||
if(detail){
|
||||
@@ -141,7 +163,23 @@ Page({
|
||||
if(this.data.active==0){
|
||||
let check = this.checkPrice(inquiry_price);
|
||||
if(!check) return;
|
||||
}
|
||||
};
|
||||
if(this.data.active==2 && detail){
|
||||
let {data}=await api.getOpen({inquiry_type:1,inquiry_mode:1});
|
||||
if(data==0){
|
||||
this.setData({
|
||||
showOpenTuWen:true
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(this.data.multi_point_status!=1){
|
||||
this.setData({
|
||||
showOpenchuFang:true
|
||||
})
|
||||
return false
|
||||
}
|
||||
};
|
||||
|
||||
if(this.data.active==3 && detail){
|
||||
wx.showToast({
|
||||
title: '即将开通',
|
||||
@@ -250,6 +288,17 @@ Page({
|
||||
inquiry_type:1,
|
||||
inquiry_mode:1,
|
||||
})
|
||||
}else if(index==1){
|
||||
this.setData({
|
||||
inquiry_type:1,
|
||||
inquiry_mode:9,
|
||||
})
|
||||
}else if(index==2){
|
||||
this.setData({
|
||||
inquiry_type:1,
|
||||
inquiry_mode:8,
|
||||
})
|
||||
this.getHealthy()
|
||||
}else if(index==3){
|
||||
this.setData({
|
||||
inquiry_type:1,
|
||||
@@ -263,6 +312,8 @@ Page({
|
||||
this.getConfig();
|
||||
}
|
||||
this.getDoctorconfig();
|
||||
this.getDoctorOpen();
|
||||
this.getSysconfig();
|
||||
},
|
||||
putDoctorInquiryConfig(){
|
||||
//修改医生问诊配置
|
||||
@@ -284,6 +335,27 @@ Page({
|
||||
})
|
||||
|
||||
},
|
||||
getHealthy(){
|
||||
api.getHealthy().then(response => {
|
||||
this.setData({
|
||||
healthPrice:(response.data.inquiry_price*response.data.service_rate/100).toFixed(2)
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
getSysconfig(){
|
||||
let {inquiry_type,inquiry_mode}=this.data;
|
||||
api.getSysconfig({
|
||||
inquiry_type,
|
||||
inquiry_mode
|
||||
}).then(response => {
|
||||
this.setData({
|
||||
'config': response.data
|
||||
// config: response.data.config,
|
||||
// note: response.data.info.is_open == 1? this.data.open_note : this.data.close_note
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
|
||||
},
|
||||
myToast(message){
|
||||
Toast({
|
||||
context: this,
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="go">
|
||||
<van-button disabled="{{info.is_open!=1}}" bind:click="addServiceContent" color="#3CC7C0" custom-style="border-radius: 20rpx;font-size:30rpx;" type="primary" block>添加服务内容</van-button>
|
||||
<van-button bind:click="addServiceContent" color="#3CC7C0" custom-style="border-radius: 20rpx;font-size:30rpx;" type="primary" block>添加服务内容</van-button>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="健康包">
|
||||
@@ -114,8 +114,12 @@
|
||||
<view class="price_title">服务价格</view>
|
||||
<view class="price_steup_box pricebox" style="overflow: hidden;padding-bottom: 10rpx;">
|
||||
<van-cell size="large" custom-style="font-size:32rpx;" title="服务价格(元)" >
|
||||
<view class="cell_value">
|
||||
<input type="number"/>
|
||||
<view class="cell_value cell_value_heal">
|
||||
<input type="number" placeholder="请设置价格"
|
||||
value="{{healthPrice}}"
|
||||
disabled="{{true}}"
|
||||
class="healthPrice"
|
||||
placeholder-style="font-size:28rpx;color: rgba(0,0,0,0.45);" /><text class="unit" wx:if="{{healthPrice}}">元</text>
|
||||
</view>
|
||||
</van-cell>
|
||||
</view>
|
||||
|
||||
@@ -182,4 +182,15 @@ page{
|
||||
font-size: 28rpx;
|
||||
color: rgba(0,0,0,0.65);
|
||||
margin: 20rpx auto 0 auto;
|
||||
}
|
||||
.healthPrice{
|
||||
font-size: 28rpx;
|
||||
color: #E34D59;
|
||||
}
|
||||
.unit{
|
||||
color: #333;
|
||||
}
|
||||
.cell_value_heal{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
Reference in New Issue
Block a user