Commit 25b357371ebf6c3194f0a16ddc7d098110b70cb7

Authored by pengye
1 parent f3163a68

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

@@ -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 }
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 <text>{{item.aname}}</text> 76 <text>{{item.aname}}</text>
77 <view class="price" wx:if="{{item.price}}"><view class="icons">¥</view>{{item.price}}</view> 77 <view class="price" wx:if="{{item.price}}"><view class="icons">¥</view>{{item.price}}</view>
78 <!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 --> 78 <!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->
79 - <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash)}}" class="discount">{{item.discount}}折</text> 79 + <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discount">{{item.discount}}折</text>
80 </view> 80 </view>
81 <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom" > 81 <view wx:if="{{item.exp_date.is_week=='1' || item.exp_date.is_week===true}}" class="bottom" >
82 {{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}} 82 {{item.exp_date.week_show?item.exp_date.week_show+'可用':''}}{{item.desc?','+item.desc+'。':'。'}}
@@ -472,6 +472,7 @@ @@ -472,6 +472,7 @@
472 padding: 16rpx 16rpx 16rpx 24rpx; 472 padding: 16rpx 16rpx 16rpx 24rpx;
473 display: flex; 473 display: flex;
474 justify-content: space-between; 474 justify-content: space-between;
  475 + margin-bottom: 20rpx;
475 } 476 }
476 477
477 .rubric1 { 478 .rubric1 {