Commit 39c403a1 by 高淑倩

默认付费会员

parent fd1187ee
......@@ -23,6 +23,9 @@ wxService.page({
wxAddress: false,
currentCoupon: '',
orderPrice: null, // 订单金额
orderInitPrice: 0,
plusMemberPrice: 0, // plus 默认价
plusMemberName:''
},
/**
......@@ -88,11 +91,13 @@ wxService.page({
this.setPayPrice()
},
setPayPrice() {
const { currentCoupon, orderPrice } = this.data
let orderCoupon = parseFloat(currentCoupon)
const { currentCoupon, orderInitPrice, isSelect, plusMemberPrice } = this.data
let newCurrentCoupon = currentCoupon? currentCoupon : 0
let orderCoupon = parseFloat(newCurrentCoupon) // 优惠券价格
let plusPrice = isSelect ? plusMemberPrice : 0 // plus
this.setData({
orderPrice: Math.round(orderPrice - orderCoupon)
// orderPrice: Math.round(orderInitPrice - orderCoupon)
orderPrice: orderInitPrice - orderCoupon - plusPrice
})
},
formSubmit(e) {
......@@ -235,8 +240,31 @@ wxService.page({
trolleySku2Buy
}
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({
wx.hideLoading()
this.setData({
currentOrderList: data,
orderPrice: data.amount
orderInitPrice: data.amount
},()=>{
// 实付款
this.setPayPrice()
})
}
}
......
......@@ -117,7 +117,7 @@
<text class="price-label">plus会员价</text>
<text class="member-price">-¥20</text>
</view>
<text class="plus-member-price">¥289</text>
<text class="plus-member-price">¥{{plusMemberPrice}}</text>
</view>
</view>
<view class="coupon">
......@@ -131,10 +131,10 @@
</view>
<view class="coupon" wx:if="{{isSelect}}">
<view>
<text class="price-label">VIP会员年费</text>
<text class="price-label">{{plusMemberName}}</text>
<text class="vip-desc"> (不可使用任何优惠或积分)</text>
<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" />
</view>
</view>
......
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 13,
"current": -1,
"list": [
{
"id": -1,
......@@ -148,14 +148,7 @@
"scene": null
},
{
"id": 17,
"name": "确认订单",
"pathName": "pages/confirmOrder/confirmOrder",
"query": "trolleySku2Buy=[{\"count\":1,\"skuId\":621372628724224000}]",
"scene": null
},
{
"id": -1,
"id": 18,
"name": "购物车",
"pathName": "pages/cart/cart",
"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