Commit 25b357371ebf6c3194f0a16ddc7d098110b70cb7

Authored by pengye
1 parent f3163a68

券金额为0 不显示折扣以及样式修改

... ... @@ -287,22 +287,22 @@ Page({
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;
let cash=coupon.use.cash*1;
let price=coupon.price*1;
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
coupon.discount=((price/cash)*10).toFixed(2);
coupon.discount=cash!=0?((price/cash)*10).toFixed(2):'';
}
coupon_dataList.push(coupon);
}
}
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;
let cash=item.use.cash*1;
let price=item.price*1;
console.log('cash',cash+'---'+'price',price+'---'+'discount',((price/cash)*10).toFixed(2));
item.discount=((price/cash)*10).toFixed(2);
item.discount=cash!=0?((price/cash)*10).toFixed(2):'';
}
})
}
... ...
... ... @@ -76,7 +76,7 @@
<text>{{item.aname}}</text>
<view class="price" wx:if="{{item.price}}"><view class="icons">¥</view>{{item.price}}</view>
<!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash)}}" class="discount">{{item.discount}}折</text>
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discount">{{item.discount}}折</text>
</view>
<view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom" >
{{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}
... ...
... ... @@ -472,6 +472,7 @@
padding: 16rpx 16rpx 16rpx 24rpx;
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
}
.rubric1 {
... ...