|
|
|
@ -20,6 +20,7 @@ Page({ |
|
|
|
amount: 0, |
|
|
|
orderList: null, |
|
|
|
params: { |
|
|
|
settleType: '1', |
|
|
|
ids: [], |
|
|
|
payRemark: '' |
|
|
|
}, |
|
|
|
@ -39,10 +40,15 @@ Page({ |
|
|
|
this.data.params.ids = [] |
|
|
|
if (result.data && result.data.records.length) { |
|
|
|
for (let index = 0; index < result.data.records.length; index++) { |
|
|
|
amount = math.plus(amount, result.data.records[index].settlePrice) |
|
|
|
this.data.params.ids.push(result.data.records[index].id) |
|
|
|
const element = result.data.records[index] |
|
|
|
amount = math.plus(amount, element.settlePrice) |
|
|
|
this.data.params.ids.push(element.id) |
|
|
|
if(index == 0 && Number(element.settleType) == 2 && !util.isEmpty(element.bankCardNo)){ |
|
|
|
this.data.params.settleType = '2' |
|
|
|
this.data.params.bankCardNo = element.bankCardNo |
|
|
|
} |
|
|
|
} |
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom, orderList: result.data.records, amount }) |
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom, orderList: result.data.records, amount, params: this.data.params }) |
|
|
|
} else { |
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom }) |
|
|
|
} |
|
|
|
@ -50,8 +56,19 @@ Page({ |
|
|
|
wx.hideLoading() |
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom }) |
|
|
|
util.showToast(err) |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
onTypeChange: function({detail}){ |
|
|
|
this.setData({ ['params.settleType']: detail }) |
|
|
|
}, |
|
|
|
onTypeClick(e) { |
|
|
|
if(Number(e.currentTarget.dataset.name == 2) && util.isEmpty(this.data.params.bankCardNo)){ |
|
|
|
util.showToast('暂无客户银行卡信息,无法进行银行卡转账') |
|
|
|
return |
|
|
|
} |
|
|
|
this.setData({ ['params.settleType']: e.currentTarget.dataset.name }) |
|
|
|
}, |
|
|
|
lookItem: function(e){ |
|
|
|
var item = this.data.orderList[e.currentTarget.dataset.index] |
|
|
|
item.checked = !item.checked |
|
|
|
@ -79,6 +96,7 @@ Page({ |
|
|
|
Dialog.confirm({ title: '温馨提示', message: '确定要付款吗?' }).then(() => { |
|
|
|
wx.showLoading({ title: '正在获取', mask: true }) |
|
|
|
this.data.requesting = true |
|
|
|
this.data.params.settleType = Number(this.data.params.settleType) |
|
|
|
paymentOrder(this.data.params).then(result => { |
|
|
|
wx.hideLoading() |
|
|
|
util.showBackToast('订单已经付款') |
|
|
|
|