Browse Source

购物车多个有门票禁用优惠券

master
jiazhipeng 2 years ago
parent
commit
ea84089b01
  1. 15
      pages/order/orderList/index.js
  2. 14
      pages/order/orderList/index.wxml

15
pages/order/orderList/index.js

@ -22,7 +22,10 @@ Page({
allowance_data: null, allowance_data: null,
allowance_price: 0, allowance_price: 0,
flag:null, flag:null,
linkmanList:[] linkmanList:[],
finalPrice: 0,
showCoupon: false,
}, },
/** /**
@ -35,6 +38,7 @@ Page({
kjId: app.globalData.kjId, kjId: app.globalData.kjId,
gp_id: app.globalData.gp_id || app.globalData.team_id, gp_id: app.globalData.gp_id || app.globalData.team_id,
flag:options.flag, flag:options.flag,
showCoupon: (app.globalData.list || []).length<=0,
// linkmanList: app.globalData.linkmanList // linkmanList: app.globalData.linkmanList
}) })
console.log('-------------',this.data.ticketList); console.log('-------------',this.data.ticketList);
@ -94,10 +98,12 @@ Page({
coupon: null coupon: null
}) })
} }
this.setData({ this.setData({
showPrice: app.globalData.kjId ? 0 : price showPrice: app.globalData.kjId ? 0 : price
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -111,12 +117,15 @@ Page({
} }
}) })
}, },
//获取最高优惠券 //获取最高优惠券
getNewCoupon(e){ getNewCoupon(e){
this.setData({ this.setData({
coupon:e.detail coupon:e.detail
}) })
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */

14
pages/order/orderList/index.wxml

@ -66,12 +66,20 @@
<view style="flex-shrink:0">订单备注:</view> <view style="flex-shrink:0">订单备注:</view>
<input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input> <input type="text" bindinput="inputRemark" data-index="{{index}}" placeholder="选填"></input>
</view> --> </view> -->
<coupon bind:getNewCoupon = 'getNewCoupon' id="coupon" wx:if="{{!kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon> <coupon bind:getNewCoupon = 'getNewCoupon' id="coupon" wx:if="{{showCoupon && !kjId && !gp_id}}" money="{{showPrice + postFee}}" sku="{{sku_id}}"></coupon>
<view class="fixed-bottom"> <view class="fixed-bottom">
<view class="fixed-price-box"> <view class="fixed-price-box">
<text>合计:</text>
<text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text> <view wx:if="{{coupon && coupon.activity.discount_type != 'pricebreak'}}">
<text>合计:</text><text
class="price">¥{{((showPrice + postFee)* coupon.activity.fold/10)>0?((showPrice + postFee)* coupon.activity.fold/10)/100:0}}</text>
</view>
<view wx:else>
<text>合计:</text>
<text class="price">¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}}</text>
</view>
</view> </view>
<view class="fixed-btn" bindtap="order">下一步</view> <view class="fixed-btn" bindtap="order">下一步</view>
</view> </view>
Loading…
Cancel
Save