2.23 更新
This commit is contained in:
@@ -12,6 +12,8 @@ Page({
|
||||
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
||||
title: '服务设置', //导航栏 中间的标题
|
||||
},
|
||||
inquiry_type:1,
|
||||
inquiry_mode:6,
|
||||
show:false,
|
||||
content_message:'',
|
||||
process_message:'',
|
||||
@@ -55,6 +57,17 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
goBack(){
|
||||
let {cycle,rounds,content_message,process_message,config_service_id}=this.data;
|
||||
if((cycle || rounds || content_message || process_message || rounds==0) && !config_service_id){
|
||||
this.setData({
|
||||
showSave:true
|
||||
})
|
||||
}else{
|
||||
wx.navigateBack()
|
||||
}
|
||||
|
||||
},
|
||||
onClickHide(){
|
||||
this.setData({
|
||||
show:false
|
||||
@@ -93,6 +106,30 @@ Page({
|
||||
rounds:this.data.customRounds
|
||||
})
|
||||
},
|
||||
openPreview(){
|
||||
let {process_message,content_message,}=this.data;
|
||||
if(content_message.length<10){
|
||||
wx.showToast({
|
||||
title: '服务内容不少于10个字符',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(process_message.length<10){
|
||||
wx.showToast({
|
||||
title: '服务流程不少于10个字符',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
};
|
||||
wx.setStorageSync('config_message', {
|
||||
content_message,
|
||||
process_message,
|
||||
})
|
||||
this.setData({
|
||||
showPreview:true
|
||||
})
|
||||
},
|
||||
changeCustomIpt(event){
|
||||
let {value}= event.detail;
|
||||
console.log(value);
|
||||
@@ -166,32 +203,44 @@ Page({
|
||||
})
|
||||
|
||||
},
|
||||
// getConfig(){
|
||||
// let {inquiry_type,inquiry_mode}=this.data;
|
||||
// api.getServiceConfig({
|
||||
// inquiry_type,
|
||||
// inquiry_mode
|
||||
// }).then(response => {
|
||||
// let result=response.data;
|
||||
// if(result){
|
||||
// this.setData({
|
||||
// 'config_setting.service_content':result.service_content,
|
||||
// 'config_setting.service_process':result.service_process,
|
||||
// 'config_setting.service_period':result.service_period,
|
||||
// 'config_setting.service_rounds':result.service_rounds,
|
||||
// 'config_setting.config_service_id':result.config_service_id
|
||||
// })
|
||||
// }
|
||||
// }).catch(errors => {console.error(errors);})
|
||||
// },
|
||||
saveconfirmDialog(){
|
||||
|
||||
let {cycle,rounds,content_message,process_message,config_service_id}=this.data;
|
||||
let {cycle,rounds,content_message,process_message}=this.data;
|
||||
wx.setStorageSync('service_setting',{
|
||||
cycle,
|
||||
rounds,
|
||||
content_message,
|
||||
process_message,
|
||||
|
||||
process_message
|
||||
})
|
||||
|
||||
this.setData({
|
||||
showSave:false
|
||||
})
|
||||
if(config_service_id){
|
||||
this.putConfig();
|
||||
}else{
|
||||
this.postConfig();
|
||||
}
|
||||
});
|
||||
wx.navigateBack();
|
||||
|
||||
|
||||
},
|
||||
draftcancelDialog(){
|
||||
this.setData({
|
||||
showDraft:false
|
||||
})
|
||||
this.getConfig();
|
||||
//this.getConfig();
|
||||
},
|
||||
draftconfirmDialog(){
|
||||
const service_setting=wx.getStorageSync('service_setting');
|
||||
@@ -212,15 +261,23 @@ Page({
|
||||
this.setData({
|
||||
showPreview:false
|
||||
})
|
||||
let doctor_id=wx.getStorageSync('client_user_id_2')
|
||||
app.go("/user/pages/yishi/expertDetail/expertDetail?doctor_id="+doctor_id)
|
||||
},
|
||||
onChangeText(event){
|
||||
let {id}=event.currentTarget.dataset;
|
||||
console.log(id);
|
||||
this.setData({
|
||||
[id]:event.detail
|
||||
})
|
||||
},
|
||||
save(){
|
||||
let {cycle,rounds,content_message,process_message}=this.data;
|
||||
if(cycle || rounds || content_message || process_message){
|
||||
this.setData({
|
||||
showSave:true
|
||||
})
|
||||
|
||||
}
|
||||
let {config_service_id}=this.data;
|
||||
if(config_service_id){
|
||||
this.putConfig();
|
||||
}else{
|
||||
this.postConfig();
|
||||
}
|
||||
},
|
||||
validate(){
|
||||
let {process_message,content_message,cycle,rounds}=this.data;
|
||||
@@ -245,7 +302,7 @@ Page({
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!rounds){
|
||||
if(!rounds && rounds!=0){
|
||||
wx.showToast({
|
||||
title: '请设置服务回合数',
|
||||
icon:'none'
|
||||
@@ -263,12 +320,13 @@ Page({
|
||||
service_period:cycle,
|
||||
service_rounds:rounds=='不限次'?0:rounds
|
||||
}).then(response => {
|
||||
if(response.data==200){
|
||||
if(response.code==200){
|
||||
wx.showToast({
|
||||
title: 'title',
|
||||
icon:'新增成功'
|
||||
title: '新增成功',
|
||||
icon:'none'
|
||||
})
|
||||
wx.navigateBack()
|
||||
wx.navigateBack();
|
||||
wx.setStorageSync('service_setting','')
|
||||
}
|
||||
}).catch(errors => {console.error(errors);})
|
||||
}
|
||||
@@ -283,19 +341,20 @@ Page({
|
||||
service_period:cycle,
|
||||
service_rounds:rounds=='不限次'?0:rounds
|
||||
},config_service_id).then(response => {
|
||||
if(response.data==200){
|
||||
console.log(response)
|
||||
if(response.code==200){
|
||||
wx.showToast({
|
||||
title: 'title',
|
||||
icon:'修改成功'
|
||||
title: '修改成功',
|
||||
icon:'none'
|
||||
})
|
||||
wx.navigateBack()
|
||||
wx.navigateBack();
|
||||
|
||||
}
|
||||
}).catch(errors => {console.error(errors);})
|
||||
}
|
||||
|
||||
},
|
||||
getConfig(){
|
||||
let {inquiry_type,inquiry_mode}=this.data;
|
||||
api.getServiceConfig({
|
||||
inquiry_type:1,
|
||||
inquiry_mode:6
|
||||
@@ -316,6 +375,7 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
const service_setting=wx.getStorageSync('service_setting');
|
||||
console.log(service_setting)
|
||||
let arr=[];
|
||||
for (let i =2; i < 31; i++) {
|
||||
arr.push(i)
|
||||
@@ -327,12 +387,13 @@ Page({
|
||||
this.setData({
|
||||
config_service_id:options.config_service_id
|
||||
})
|
||||
}
|
||||
if(service_setting){
|
||||
this.setData({
|
||||
showDraft:true
|
||||
})
|
||||
|
||||
this.getConfig();
|
||||
}else{
|
||||
if(service_setting){
|
||||
this.setData({
|
||||
showDraft:true
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "../../../../commpents/te_navbar/index",
|
||||
"t-navbar": "tdesign-miniprogram/navbar/navbar",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-picker": "@vant/weapp/picker/index",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<!--Pages/service_setting/index.wxml-->
|
||||
<view class="page">
|
||||
<te-nav-bar navbar-data='{{navbarData}}'></te-nav-bar>
|
||||
<view class="block" >
|
||||
<t-navbar class="block" title="服务设置" left-arrow bind:go-back="goBack" delta="0"/>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="brandbox">
|
||||
<view class="brand">
|
||||
@@ -8,14 +10,19 @@
|
||||
<view class="name">服务内容</view>
|
||||
<view class="moban" bindtap="openDialog" data-id="1">使用模板 ></view>
|
||||
</view>
|
||||
<van-field value="{{ content_message }}" label="" type="textarea" placeholder="请填写自定义的服务内容,内容简洁明了。(10-500)" autosize="{{autosize}}" maxlength="500" show-word-limit border="{{ false }}" />
|
||||
<van-field value="{{ content_message }}" label="" type="textarea" placeholder="请填写自定义的服务内容,内容简洁明了。(10-500)" autosize="{{autosize}}" maxlength="500" bind:change="onChangeText"
|
||||
data-id="content_message"
|
||||
show-word-limit border="{{ false }}" />
|
||||
</view>
|
||||
<view class="brand">
|
||||
<view class="titlebox">
|
||||
<view class="name">服务流程</view>
|
||||
<view class="moban" bindtap="openDialog" data-id="2">使用模板 ></view>
|
||||
</view>
|
||||
<van-field value="{{ process_message }}" label="" type="textarea" placeholder="请填写自定义的服务流程,内容简洁明了。(10-500)" autosize="{{autosize}}" maxlength="500" show-word-limit border="{{ false }}" />
|
||||
<van-field value="{{ process_message }}" label="" type="textarea" placeholder="请填写自定义的服务流程,内容简洁明了。(10-500)" autosize="{{autosize}}"
|
||||
bind:change="onChangeText"
|
||||
data-id="process_message"
|
||||
maxlength="500" show-word-limit border="{{ false }}" />
|
||||
</view>
|
||||
<view class="cell" bindtap="openCycle">
|
||||
<view class="name">服务周期</view>
|
||||
@@ -28,14 +35,14 @@
|
||||
<view class="cell" bindtap="openRound">
|
||||
<view class="name">服务回合数</view>
|
||||
<view class="right">
|
||||
<view class="msg" wx:if="{{rounds}}">{{rounds}}</view>
|
||||
<view class="msg" wx:if="{{rounds || rounds===0}}">{{rounds}}</view>
|
||||
<view class="msg" wx:else>去设置</view>
|
||||
<van-icon name="arrow" class="icon" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="eyebox">
|
||||
<image src="{{static_host}}/applet/doctor/static/images/yishi/eye.png" mode="" class="eye" />
|
||||
<view class="text">预览效果</view>
|
||||
<view class="eyebox" bind:tap="openPreview">
|
||||
<image src="{{static_host}}/applet/doctor/static/images/yishi/eye_set.png" mode="" class="eye" />
|
||||
<view class="text" >预览效果</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnbox">
|
||||
|
||||
Reference in New Issue
Block a user