|
...
|
...
|
@@ -324,9 +324,9 @@ Page({ |
|
|
|
}
|
|
|
|
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
|
|
|
|
if (coupon && util.getType(coupon) == 'object') {
|
|
|
|
coupon.stringifyUse = JSON.stringify(coupon.use)
|
|
|
|
if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
|
|
|
|
let cash = coupon.use.cash * 1;
|
|
|
|
coupon.stringifyUse = JSON.stringify(coupon.use)
|
|
|
|
if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
|
|
|
|
let cash = coupon.use.cash * 1;
|
|
|
|
let price = coupon.price * 1;
|
|
|
|
console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
|
|
|
|
coupon.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
|
|
...
|
...
|
@@ -336,10 +336,10 @@ Page({ |
|
|
|
if (coupon && util.getType(coupon) == 'array') {
|
|
|
|
if (coupon.length > 0) {
|
|
|
|
coupon.forEach(item => {
|
|
|
|
item.stringifyUse = JSON.stringify(item.use)
|
|
|
|
if ((!item.use.is_cash || item.use.is_cash == '1')) {
|
|
|
|
let cash = item.use.cash * 1;
|
|
|
|
let price = item.price * 1;
|
|
|
|
item.stringifyUse = item.use?JSON.stringify(item.use):'';
|
|
|
|
if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
|
|
|
|
let cash = item.use.cash * 1;
|
|
|
|
let price = item.price * 1;
|
|
|
|
console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
|
|
|
|
item.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
|
|
|
|
}
|
...
|
...
|
|