|
1
|
// pack-checkout/components/discount.js
|
1
|
// pack-checkout/components/discount.js
|
|
2
|
import util from '../../utils/util'
|
2
|
import util from '../../utils/util'
|
|
3
|
-import App from '../../utils/uri'
|
3
|
+import App from '../../utils/api'
|
|
4
|
Component({
|
4
|
Component({
|
|
5
|
/**
|
5
|
/**
|
|
6
|
* 组件的属性列表
|
6
|
* 组件的属性列表
|
|
@@ -60,12 +60,20 @@ Component({ |
|
@@ -60,12 +60,20 @@ Component({ |
|
60
|
checkoutObj:checkout
|
60
|
checkoutObj:checkout
|
|
61
|
})
|
61
|
})
|
|
62
|
},
|
62
|
},
|
|
63
|
- discountChecked(e){
|
|
|
|
64
|
- console.log('discountChecked',e)
|
|
|
|
65
|
- let index=util.attr(e,'index')
|
|
|
|
66
|
- let checkout=this.data.checkout
|
|
|
|
67
|
- checkout.discount[index].checked=!checkout.discount[index].checked
|
63
|
+ discountChecked(e) {
|
|
|
|
64
|
+ console.log('discountChecked', e)
|
|
|
|
65
|
+ let index = util.attr(e, 'index')
|
|
|
|
66
|
+ let checkout = this.data.checkout
|
|
|
|
67
|
+ checkout.discount[index].checked = !checkout.discount[index].checked
|
|
68
|
this.discountFormat(checkout)
|
68
|
this.discountFormat(checkout)
|
|
|
|
69
|
+ App.Customer.ChangeDiscountCombination({
|
|
|
|
70
|
+ id:checkout.id,
|
|
|
|
71
|
+ rel_id:checkout.discount[index].rel_id,
|
|
|
|
72
|
+ owner:checkout.discount[index].owner,
|
|
|
|
73
|
+ status:checkout.discount[index].checked?1:0,
|
|
|
|
74
|
+ }).then(()=>{
|
|
|
|
75
|
+ this.triggerEvent('event',{act:'reflush'});
|
|
|
|
76
|
+ })
|
|
69
|
},
|
77
|
},
|
|
70
|
}
|
78
|
}
|
|
71
|
}) |
79
|
}) |