Browse Source

vr,期票选优惠券后展示

master
shaojing 2 years ago
parent
commit
8f9694afe5
  1. 2
      app.js
  2. 3
      pages/info/museumInfo/index.js
  3. 2
      pages/order/postOrder/index.js
  4. 44
      pages/order/scene/index.js

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx"
}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest139? true : false;
data.isTest = data.isTest140? true : false;
this.globalData.configJson = data
}).then(() => {
// 获取ui配置文件

3
pages/info/museumInfo/index.js

@ -516,8 +516,9 @@ Page({
},
goVr:function(){
app.globalData.weburl = this.data.info.vr_info_url
let url = this.data.info.vr_info_url
wx.navigateTo({
url: '/pages/pbService/web/index',
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url),
})
},

2
pages/order/postOrder/index.js

@ -62,7 +62,7 @@ Page({
price() {
let allPrice
if (this.data.coupon) {
if (this.data.coupon.discount_type == 'pricebreak') {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
return allPrice = this.data.showPrice + this.data.postFee - this.data.coupon.activity.money>0?this.data.showPrice + this.data.postFee - this.data.coupon.activity.money/100:0
} else {
return allPrice = (this.data.showPrice* this.data.coupon.activity.fold)/ 10 + this.data.postFee

44
pages/order/scene/index.js

@ -144,7 +144,8 @@ Page({
// })
let price
if (this.data.coupon) {
if (this.data.coupon.discount_type == 'pricebreak') {
console.log(app.globalData.couponInfo,this.data.coupon);
if (this.data.coupon.activity.discount_type == 'pricebreak') {
price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
} else {
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
@ -165,25 +166,26 @@ Page({
// console.log(this.data.singlePrice);
}
// let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
let price
if (this.data.coupon) {
if (this.data.coupon.discount_type == 'pricebreak') {
price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
} else {
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
}
} else {
price = this.data.singlePrice * this.data.productNum
}
if (price >0) {
this.setData({
price:price/100
})
}else {
this.setData({
price:0
})
}
// 多写了一遍
// let price
// if (this.data.coupon) {
// if (this.data.coupon.discount_type == 'pricebreak') {
// price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
// } else {
// price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
// }
// } else {
// price = this.data.singlePrice * this.data.productNum
// }
// if (price >0) {
// this.setData({
// price:price/100
// })
// }else {
// this.setData({
// price:0
// })
// }
},
cancel: function () {
this.setData({
@ -284,7 +286,7 @@ Page({
totalPrice(price) {
let allPrice
if (this.data.coupon) {
if (this.data.coupon.discount_type == 'pricebreak') {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
} else {
allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10

Loading…
Cancel
Save