|
@@ -287,22 +287,22 @@ Page({ |
|
@@ -287,22 +287,22 @@ Page({ |
|
287
|
if(coupon && util.getType(coupon)=='object'){
|
287
|
if(coupon && util.getType(coupon)=='object'){
|
|
288
|
coupon.stringifyUse=JSON.stringify(coupon.use)
|
288
|
coupon.stringifyUse=JSON.stringify(coupon.use)
|
|
289
|
if(marketing.is_coupon=='1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash=='1')){
|
289
|
if(marketing.is_coupon=='1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash=='1')){
|
|
290
|
- let cash=coupon.use.cash;
|
290
|
+ let cash=coupon.use.cash*1;
|
|
291
|
let price=coupon.price*1;
|
291
|
let price=coupon.price*1;
|
|
292
|
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
|
292
|
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
|
|
293
|
- coupon.discount=((price/cash)*10).toFixed(2);
|
293
|
+ coupon.discount=cash!=0?((price/cash)*10).toFixed(2):'';
|
|
294
|
}
|
294
|
}
|
|
295
|
coupon_dataList.push(coupon);
|
295
|
coupon_dataList.push(coupon);
|
|
296
|
- }
|
296
|
+ }
|
|
297
|
if(coupon && util.getType(coupon)=='array'){
|
297
|
if(coupon && util.getType(coupon)=='array'){
|
|
298
|
if(coupon.length>0){
|
298
|
if(coupon.length>0){
|
|
299
|
coupon.forEach(item=>{
|
299
|
coupon.forEach(item=>{
|
|
300
|
item.stringifyUse=JSON.stringify(item.use)
|
300
|
item.stringifyUse=JSON.stringify(item.use)
|
|
301
|
if((!item.use.is_cash || item.use.is_cash=='1')){
|
301
|
if((!item.use.is_cash || item.use.is_cash=='1')){
|
|
302
|
- let cash=item.use.cash;
|
302
|
+ let cash=item.use.cash*1;
|
|
303
|
let price=item.price*1;
|
303
|
let price=item.price*1;
|
|
304
|
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
|
304
|
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
|
|
305
|
- item.discount=((price/cash)*10).toFixed(2);
|
305
|
+ item.discount=cash!=0?((price/cash)*10).toFixed(2):'';
|
|
306
|
}
|
306
|
}
|
|
307
|
})
|
307
|
})
|
|
308
|
}
|
308
|
}
|