Commit 39c403a1 by 高淑倩

默认付费会员

parent fd1187ee
...@@ -23,6 +23,9 @@ wxService.page({ ...@@ -23,6 +23,9 @@ wxService.page({
wxAddress: false, wxAddress: false,
currentCoupon: '', currentCoupon: '',
orderPrice: null, // 订单金额 orderPrice: null, // 订单金额
orderInitPrice: 0,
plusMemberPrice: 0, // plus 默认价
plusMemberName:''
}, },
/** /**
...@@ -88,11 +91,13 @@ wxService.page({ ...@@ -88,11 +91,13 @@ wxService.page({
this.setPayPrice() this.setPayPrice()
}, },
setPayPrice() { setPayPrice() {
const { currentCoupon, orderPrice } = this.data const { currentCoupon, orderInitPrice, isSelect, plusMemberPrice } = this.data
let orderCoupon = parseFloat(currentCoupon) let newCurrentCoupon = currentCoupon? currentCoupon : 0
let orderCoupon = parseFloat(newCurrentCoupon) // 优惠券价格
let plusPrice = isSelect ? plusMemberPrice : 0 // plus
this.setData({ this.setData({
orderPrice: Math.round(orderPrice - orderCoupon) // orderPrice: Math.round(orderInitPrice - orderCoupon)
orderPrice: orderInitPrice - orderCoupon - plusPrice
}) })
}, },
formSubmit(e) { formSubmit(e) {
...@@ -235,8 +240,31 @@ wxService.page({ ...@@ -235,8 +240,31 @@ wxService.page({
trolleySku2Buy trolleySku2Buy
} }
this.calPreferentialPrice(params) // 重新计算优惠价 this.calPreferentialPrice(params) // 重新计算优惠价
// 获取默认付费会员设置
this.getPremiumDefault()
})
}) })
},
// /premium/getDefault
getPremiumDefault() {
wx.showLoading({
title: '加载中'
})
wxService.get(`/sale/premium/getDefault`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
plusMemberPrice: data.price,
plusMemberName: data.name
},()=>{
// 实付款
this.setPayPrice()
})
}
}
}) })
}, },
// 默认地址 // 默认地址
...@@ -255,7 +283,10 @@ wxService.page({ ...@@ -255,7 +283,10 @@ wxService.page({
wx.hideLoading() wx.hideLoading()
this.setData({ this.setData({
currentOrderList: data, currentOrderList: data,
orderPrice: data.amount orderInitPrice: data.amount
},()=>{
// 实付款
this.setPayPrice()
}) })
} }
} }
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<text class="price-label">plus会员价</text> <text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text> <text class="member-price">-¥20</text>
</view> </view>
<text class="plus-member-price">¥289</text> <text class="plus-member-price">¥{{plusMemberPrice}}</text>
</view> </view>
</view> </view>
<view class="coupon"> <view class="coupon">
...@@ -131,10 +131,10 @@ ...@@ -131,10 +131,10 @@
</view> </view>
<view class="coupon" wx:if="{{isSelect}}"> <view class="coupon" wx:if="{{isSelect}}">
<view> <view>
<text class="price-label">VIP会员年费</text> <text class="price-label">{{plusMemberName}}</text>
<text class="vip-desc"> (不可使用任何优惠或积分)</text> <text class="vip-desc"> (不可使用任何优惠或积分)</text>
<view class="select-coupon"> <view class="select-coupon">
<text class="coupon-price">+¥100</text> <text class="coupon-price">+¥{{plusMemberPrice}}</text>
<image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" /> <image class="arrow-right" src="/assets/imgs/7_1_0/arrow-right.png" />
</view> </view>
</view> </view>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 13, "current": -1,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -148,14 +148,7 @@ ...@@ -148,14 +148,7 @@
"scene": null "scene": null
}, },
{ {
"id": 17, "id": 18,
"name": "确认订单",
"pathName": "pages/confirmOrder/confirmOrder",
"query": "trolleySku2Buy=[{\"count\":1,\"skuId\":621372628724224000}]",
"scene": null
},
{
"id": -1,
"name": "购物车", "name": "购物车",
"pathName": "pages/cart/cart", "pathName": "pages/cart/cart",
"query": "", "query": "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment