|
...
|
...
|
@@ -32,9 +32,12 @@ Component({ |
|
|
|
})
|
|
|
|
},
|
|
|
|
hide(){
|
|
|
|
this.setData({
|
|
|
|
display:false,
|
|
|
|
})
|
|
|
|
this.triggerEvent('event',{act:'reflush'});
|
|
|
|
setTimeout(()=>{
|
|
|
|
this.setData({
|
|
|
|
display:false,
|
|
|
|
})
|
|
|
|
},300)
|
|
|
|
},
|
|
|
|
discountFormat(checkout){
|
|
|
|
if(!checkout) return;
|
|
...
|
...
|
@@ -42,7 +45,7 @@ Component({ |
|
|
|
let disObj={}
|
|
|
|
let subsidy_price=0;
|
|
|
|
checkout.discount.forEach(q=>{
|
|
|
|
checkout.disabled=false
|
|
|
|
q.disabled=false
|
|
|
|
if(q.checked){
|
|
|
|
num++;
|
|
|
|
disObj[q.owner+'-'+q.receive_condition]=true
|
|
...
|
...
|
@@ -51,7 +54,7 @@ Component({ |
|
|
|
})
|
|
|
|
checkout.discount.forEach(q=>{
|
|
|
|
if(!q.checked && disObj[q.owner+'-'+q.receive_condition]){
|
|
|
|
checkout.disabled=true
|
|
|
|
q.disabled=true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
checkout.subsidy_price=subsidy_price
|
|
...
|
...
|
@@ -59,11 +62,13 @@ Component({ |
|
|
|
checkedNum:num,
|
|
|
|
checkoutObj:checkout
|
|
|
|
})
|
|
|
|
console.log('discountFormat',checkout)
|
|
|
|
},
|
|
|
|
discountChecked(e) {
|
|
|
|
console.log('discountChecked', e)
|
|
|
|
let index = util.attr(e, 'index')
|
|
|
|
let checkout = this.data.checkout
|
|
|
|
if(checkout.discount[index].disabled) return false;
|
|
|
|
checkout.discount[index].checked = !checkout.discount[index].checked
|
|
|
|
this.discountFormat(checkout)
|
|
|
|
App.Customer.ChangeDiscountCombination({
|
|
...
|
...
|
@@ -72,7 +77,7 @@ Component({ |
|
|
|
owner:checkout.discount[index].owner,
|
|
|
|
status:checkout.discount[index].checked?1:0,
|
|
|
|
}).then(()=>{
|
|
|
|
this.triggerEvent('event',{act:'reflush'});
|
|
|
|
//this.triggerEvent('event',{act:'reflush'});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
...
|
...
|
|