|
...
|
...
|
@@ -81,9 +81,10 @@ Page({ |
|
|
|
showModal() {
|
|
|
|
this.modal.showModal() //调用组件中打开模态框方法
|
|
|
|
},
|
|
|
|
confirmPayment() {
|
|
|
|
confirmPayment(gid) {
|
|
|
|
App.PayOnline.CombineTransactionsByNewRecharge({
|
|
|
|
combine_out_trade_no: this.data.opt.combine_out_trade_no
|
|
|
|
combine_out_trade_no: this.data.opt.combine_out_trade_no,
|
|
|
|
gid:gid?gid:'',
|
|
|
|
}).then(res => {
|
|
|
|
console.log(res.data);
|
|
|
|
let that = this;
|
|
...
|
...
|
@@ -99,7 +100,6 @@ Page({ |
|
|
|
})
|
|
|
|
}
|
|
|
|
if (res.ret == '200') {
|
|
|
|
console.log(res.ret);
|
|
|
|
wx.requestPayment({
|
|
|
|
timeStamp: res.data.timeStamp + '',
|
|
|
|
nonceStr: res.data.nonceStr,
|
|
...
|
...
|
@@ -223,24 +223,53 @@ Page({ |
|
|
|
}, 3500);
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.addInfo()
|
|
|
|
this.getInfo()
|
|
|
|
} else {
|
|
|
|
this.confirmPayment()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
addInfo() {
|
|
|
|
let params = {
|
|
|
|
sellerid: this.data.opt.sid,
|
|
|
|
rname: this.data.name,
|
|
|
|
sex: this.data.indexs * 1 + 1, //1男 2女 3公司
|
|
|
|
getInfo() {
|
|
|
|
let sex = this.data.indexs * 1 + 1; //1男 2女 3公司
|
|
|
|
App.GuestManage.GetIsMemberByPhone({
|
|
|
|
sid: this.data.opt.sid,
|
|
|
|
phone: this.data.phone,
|
|
|
|
c_day: this.data.calendarData
|
|
|
|
}
|
|
|
|
console.log({...params});
|
|
|
|
}).then(res => {
|
|
|
|
console.log('用户是否录入',res);
|
|
|
|
let params = {
|
|
|
|
sellerid: this.data.opt.sid,
|
|
|
|
rname: this.data.name,
|
|
|
|
sex,
|
|
|
|
phone: this.data.phone,
|
|
|
|
c_day: this.data.calendarData
|
|
|
|
}
|
|
|
|
console.log({...params});
|
|
|
|
if (res.data && res.data.id) {
|
|
|
|
if (this.data.phone == res.data.phone && this.data.name == res.data.rname && sex == res.data.sex && this.data.calendarData == res.data.c_day) {
|
|
|
|
console.log('信息都一样,直接支付');
|
|
|
|
this.confirmPayment(res.data.id)
|
|
|
|
} else {
|
|
|
|
params.id=res.data.id;
|
|
|
|
console.log('要修改信息');
|
|
|
|
this.editInfo(params)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
console.log('没有客户信息,保存信息');
|
|
|
|
this.addInfo(params)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 修改客户信息
|
|
|
|
editInfo(params) {
|
|
|
|
App.GuestManage.SetGuestInfo(params).then(res => {
|
|
|
|
if (res.data) {
|
|
|
|
this.confirmPayment(params.id)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 新增客户信息
|
|
|
|
addInfo(params) {
|
|
|
|
App.GuestManage.InsGuest(params).then(res => {
|
|
|
|
console.log(res);
|
|
|
|
if (res.ret == '200') {
|
|
|
|
this.confirmPayment()
|
|
|
|
if (res.ret == '200' && res.data && res.data.id) {
|
|
|
|
let obj = {
|
|
|
|
name: this.data.name,
|
|
|
|
phone: this.data.phone,
|
|
...
|
...
|
@@ -249,13 +278,14 @@ Page({ |
|
|
|
date: this.data.date,
|
|
|
|
}
|
|
|
|
wx.setStorageSync('info', obj)
|
|
|
|
this.confirmPayment(res.data.id)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 选择日期
|
|
|
|
bind_ChangeDate(event) {
|
|
|
|
let date = event.detail.value
|
|
|
|
var calendarData = new Date(date) * 1/1000;
|
|
|
|
var calendarData = new Date(date) * 1 / 1000;
|
|
|
|
this.setData({
|
|
|
|
date,
|
|
|
|
calendarData
|
...
|
...
|
|