4.12
This commit is contained in:
@@ -79,7 +79,7 @@ Page({
|
||||
delService(event){
|
||||
let {items}=this.data;
|
||||
let {id} =event.currentTarget.dataset;
|
||||
items.splice(1,id);
|
||||
items.splice(id,1)
|
||||
this.setData({
|
||||
items
|
||||
})
|
||||
@@ -88,9 +88,9 @@ Page({
|
||||
this.data.isAdd?this.addService():this.editService();
|
||||
},
|
||||
addServiceArr(){
|
||||
let {items}=this.data;
|
||||
|
||||
this.setData({
|
||||
items:items.concat({
|
||||
items:this.data.items.concat({
|
||||
service_period:'' ,
|
||||
service_price:''
|
||||
})
|
||||
@@ -109,7 +109,6 @@ Page({
|
||||
this.setData({
|
||||
monthly_frequency,
|
||||
service_rounds,
|
||||
items,
|
||||
isAdd:false
|
||||
})
|
||||
}else{
|
||||
@@ -171,14 +170,14 @@ Page({
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if(!items[i].service_period){
|
||||
wx.showToast({
|
||||
title: '请选择第'+(i+1)+'的服务周期',
|
||||
title: '请选择第'+(i+1)+'个的服务周期',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!items[i].service_price){
|
||||
wx.showToast({
|
||||
title: '请设置第'+(i+1)+'的服务价格',
|
||||
title: '请设置第'+(i+1)+'个的服务价格',
|
||||
icon:'none'
|
||||
})
|
||||
return false
|
||||
@@ -198,15 +197,18 @@ Page({
|
||||
})
|
||||
},
|
||||
getFollowDetail(){
|
||||
api.getFollowDetail().then(response=>{
|
||||
let type=wx.getStorageSync('usertype');
|
||||
let id=wx.getStorageSync('client_user_id_'+type);
|
||||
api.getFollowDetail(id).then(response=>{
|
||||
if(response.code==200){
|
||||
if(response.data){
|
||||
let res=response.data.map((item)=>{
|
||||
return {service_period:item.service_period,service_price:item.service_price}
|
||||
})
|
||||
this.setData({
|
||||
items:res
|
||||
items:res?res:[]
|
||||
})
|
||||
console.log(this.data.items)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -233,7 +235,12 @@ getFollowDetail(){
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
iden_auth_status:options.iden_auth_status,
|
||||
idcard_status:options.idcard_status,
|
||||
is_bind_bank:options.is_bind_bank
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -248,7 +255,10 @@ getFollowDetail(){
|
||||
*/
|
||||
onShow() {
|
||||
this.getService();
|
||||
this.getFollowDetail();
|
||||
let {idcard_status,iden_auth_status,is_bind_bank}=this.data;
|
||||
if(idcard_status==1 && iden_auth_status==1 && is_bind_bank==1){
|
||||
this.getFollowDetail();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="page">
|
||||
<view class="checked_box">
|
||||
<view class="checked_box">
|
||||
<view class="price_steup_box">
|
||||
<view class="price_steup_box_top">
|
||||
<view class="price_steup_box_top_title">服务次数/月</view>
|
||||
|
||||
Reference in New Issue
Block a user