|
|
|
// pack-checkout/components/discount.js
|
|
|
|
import util from '../../utils/util'
|
|
|
|
import App from '../../utils/uri'
|
|
|
|
import App from '../../utils/api'
|
|
|
|
Component({
|
|
|
|
/**
|
|
|
|
* 组件的属性列表
|
|
...
|
...
|
@@ -60,12 +60,20 @@ Component({ |
|
|
|
checkoutObj:checkout
|
|
|
|
})
|
|
|
|
},
|
|
|
|
discountChecked(e){
|
|
|
|
console.log('discountChecked',e)
|
|
|
|
let index=util.attr(e,'index')
|
|
|
|
let checkout=this.data.checkout
|
|
|
|
checkout.discount[index].checked=!checkout.discount[index].checked
|
|
|
|
discountChecked(e) {
|
|
|
|
console.log('discountChecked', e)
|
|
|
|
let index = util.attr(e, 'index')
|
|
|
|
let checkout = this.data.checkout
|
|
|
|
checkout.discount[index].checked = !checkout.discount[index].checked
|
|
|
|
this.discountFormat(checkout)
|
|
|
|
App.Customer.ChangeDiscountCombination({
|
|
|
|
id:checkout.id,
|
|
|
|
rel_id:checkout.discount[index].rel_id,
|
|
|
|
owner:checkout.discount[index].owner,
|
|
|
|
status:checkout.discount[index].checked?1:0,
|
|
|
|
}).then(()=>{
|
|
|
|
this.triggerEvent('event',{act:'reflush'});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}) |
...
|
...
|
|