Commit 078426784263a97072c710578e6e3437fa8cf31b

Authored by vking
1 parent 2a2df7ca

商家红包活动

// 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'});
})
},
}
})
... ...
... ... @@ -14,7 +14,8 @@
<view class="list">
<view class="quan" wx:for="{{checkoutObj.discount}}" wx:key="discount">
<quan quan="{{item}}">
<radio data-index="{{index}}" checked="{{item.checked}}" color="#F05522" bindtap="discountChecked"/>
<radio data-index="{{index}}" checked="{{item.checked}}" color="#F05522"
bindtap="discountChecked"/>
</quan>
</view>
... ...
... ... @@ -192,5 +192,6 @@ Page({
},
discountEvent(e){
console.log('discountEvent',e)
this.GetCheckout()
},
})
\ No newline at end of file
... ...
... ... @@ -483,4 +483,9 @@ export default {
'App.Customer.GetUserCard':{
openid:'openid',
},
//根据账单ID,改变用户自主选择的卡券类型
'App.Customer.ChangeDiscountCombination':{
openid:'openid',
silence: false,
},
}
\ No newline at end of file
... ...