|
@@ -81,9 +81,10 @@ Page({ |
|
@@ -81,9 +81,10 @@ Page({ |
|
81
|
showModal() {
|
81
|
showModal() {
|
|
82
|
this.modal.showModal() //调用组件中打开模态框方法
|
82
|
this.modal.showModal() //调用组件中打开模态框方法
|
|
83
|
},
|
83
|
},
|
|
84
|
- confirmPayment() {
|
84
|
+ confirmPayment(gid) {
|
|
85
|
App.PayOnline.CombineTransactionsByNewRecharge({
|
85
|
App.PayOnline.CombineTransactionsByNewRecharge({
|
|
86
|
- combine_out_trade_no: this.data.opt.combine_out_trade_no
|
86
|
+ combine_out_trade_no: this.data.opt.combine_out_trade_no,
|
|
|
|
87
|
+ gid:gid?gid:'',
|
|
87
|
}).then(res => {
|
88
|
}).then(res => {
|
|
88
|
console.log(res.data);
|
89
|
console.log(res.data);
|
|
89
|
let that = this;
|
90
|
let that = this;
|
|
@@ -99,7 +100,6 @@ Page({ |
|
@@ -99,7 +100,6 @@ Page({ |
|
99
|
})
|
100
|
})
|
|
100
|
}
|
101
|
}
|
|
101
|
if (res.ret == '200') {
|
102
|
if (res.ret == '200') {
|
|
102
|
- console.log(res.ret);
|
|
|
|
103
|
wx.requestPayment({
|
103
|
wx.requestPayment({
|
|
104
|
timeStamp: res.data.timeStamp + '',
|
104
|
timeStamp: res.data.timeStamp + '',
|
|
105
|
nonceStr: res.data.nonceStr,
|
105
|
nonceStr: res.data.nonceStr,
|
|
@@ -223,24 +223,53 @@ Page({ |
|
@@ -223,24 +223,53 @@ Page({ |
|
223
|
}, 3500);
|
223
|
}, 3500);
|
|
224
|
return
|
224
|
return
|
|
225
|
}
|
225
|
}
|
|
226
|
- this.addInfo()
|
226
|
+ this.getInfo()
|
|
227
|
} else {
|
227
|
} else {
|
|
228
|
this.confirmPayment()
|
228
|
this.confirmPayment()
|
|
229
|
}
|
229
|
}
|
|
230
|
},
|
230
|
},
|
|
231
|
- addInfo() {
|
|
|
|
232
|
- let params = {
|
|
|
|
233
|
- sellerid: this.data.opt.sid,
|
|
|
|
234
|
- rname: this.data.name,
|
|
|
|
235
|
- sex: this.data.indexs * 1 + 1, //1男 2女 3公司
|
231
|
+ getInfo() {
|
|
|
|
232
|
+ let sex = this.data.indexs * 1 + 1; //1男 2女 3公司
|
|
|
|
233
|
+ App.GuestManage.GetIsMemberByPhone({
|
|
|
|
234
|
+ sid: this.data.opt.sid,
|
|
236
|
phone: this.data.phone,
|
235
|
phone: this.data.phone,
|
|
237
|
- c_day: this.data.calendarData
|
|
|
|
238
|
- }
|
|
|
|
239
|
- console.log({...params});
|
236
|
+ }).then(res => {
|
|
|
|
237
|
+ console.log('用户是否录入',res);
|
|
|
|
238
|
+ let params = {
|
|
|
|
239
|
+ sellerid: this.data.opt.sid,
|
|
|
|
240
|
+ rname: this.data.name,
|
|
|
|
241
|
+ sex,
|
|
|
|
242
|
+ phone: this.data.phone,
|
|
|
|
243
|
+ c_day: this.data.calendarData
|
|
|
|
244
|
+ }
|
|
|
|
245
|
+ console.log({...params});
|
|
|
|
246
|
+ if (res.data && res.data.id) {
|
|
|
|
247
|
+ if (this.data.phone == res.data.phone && this.data.name == res.data.rname && sex == res.data.sex && this.data.calendarData == res.data.c_day) {
|
|
|
|
248
|
+ console.log('信息都一样,直接支付');
|
|
|
|
249
|
+ this.confirmPayment(res.data.id)
|
|
|
|
250
|
+ } else {
|
|
|
|
251
|
+ params.id=res.data.id;
|
|
|
|
252
|
+ console.log('要修改信息');
|
|
|
|
253
|
+ this.editInfo(params)
|
|
|
|
254
|
+ }
|
|
|
|
255
|
+ } else {
|
|
|
|
256
|
+ console.log('没有客户信息,保存信息');
|
|
|
|
257
|
+ this.addInfo(params)
|
|
|
|
258
|
+ }
|
|
|
|
259
|
+ })
|
|
|
|
260
|
+ },
|
|
|
|
261
|
+ // 修改客户信息
|
|
|
|
262
|
+ editInfo(params) {
|
|
|
|
263
|
+ App.GuestManage.SetGuestInfo(params).then(res => {
|
|
|
|
264
|
+ if (res.data) {
|
|
|
|
265
|
+ this.confirmPayment(params.id)
|
|
|
|
266
|
+ }
|
|
|
|
267
|
+ })
|
|
|
|
268
|
+ },
|
|
|
|
269
|
+ // 新增客户信息
|
|
|
|
270
|
+ addInfo(params) {
|
|
240
|
App.GuestManage.InsGuest(params).then(res => {
|
271
|
App.GuestManage.InsGuest(params).then(res => {
|
|
241
|
- console.log(res);
|
|
|
|
242
|
- if (res.ret == '200') {
|
|
|
|
243
|
- this.confirmPayment()
|
272
|
+ if (res.ret == '200' && res.data && res.data.id) {
|
|
244
|
let obj = {
|
273
|
let obj = {
|
|
245
|
name: this.data.name,
|
274
|
name: this.data.name,
|
|
246
|
phone: this.data.phone,
|
275
|
phone: this.data.phone,
|
|
@@ -249,13 +278,14 @@ Page({ |
|
@@ -249,13 +278,14 @@ Page({ |
|
249
|
date: this.data.date,
|
278
|
date: this.data.date,
|
|
250
|
}
|
279
|
}
|
|
251
|
wx.setStorageSync('info', obj)
|
280
|
wx.setStorageSync('info', obj)
|
|
|
|
281
|
+ this.confirmPayment(res.data.id)
|
|
252
|
}
|
282
|
}
|
|
253
|
})
|
283
|
})
|
|
254
|
},
|
284
|
},
|
|
255
|
// 选择日期
|
285
|
// 选择日期
|
|
256
|
bind_ChangeDate(event) {
|
286
|
bind_ChangeDate(event) {
|
|
257
|
let date = event.detail.value
|
287
|
let date = event.detail.value
|
|
258
|
- var calendarData = new Date(date) * 1/1000;
|
288
|
+ var calendarData = new Date(date) * 1 / 1000;
|
|
259
|
this.setData({
|
289
|
this.setData({
|
|
260
|
date,
|
290
|
date,
|
|
261
|
calendarData
|
291
|
calendarData
|