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" unique_key: "wechatxcx"
}).then(res => { }).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest139? true : false; data.isTest = data.isTest140? true : false;
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {
// 获取ui配置文件 // 获取ui配置文件

3
pages/info/museumInfo/index.js

@ -516,8 +516,9 @@ Page({
}, },
goVr:function(){ goVr:function(){
app.globalData.weburl = this.data.info.vr_info_url app.globalData.weburl = this.data.info.vr_info_url
let url = this.data.info.vr_info_url
wx.navigateTo({ 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() { price() {
let allPrice let allPrice
if (this.data.coupon) { 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 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 { } else {
return allPrice = (this.data.showPrice* this.data.coupon.activity.fold)/ 10 + this.data.postFee 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 let price
if (this.data.coupon) { 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 price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
} else { } else {
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
@ -165,25 +166,26 @@ Page({
// console.log(this.data.singlePrice); // console.log(this.data.singlePrice);
} }
// let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) // let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
let price // 多写了一遍
if (this.data.coupon) { // let price
if (this.data.coupon.discount_type == 'pricebreak') { // if (this.data.coupon) {
price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money // if (this.data.coupon.discount_type == 'pricebreak') {
} else { // price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 // } else {
} // price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
} else { // }
price = this.data.singlePrice * this.data.productNum // } else {
} // price = this.data.singlePrice * this.data.productNum
if (price >0) { // }
this.setData({ // if (price >0) {
price:price/100 // this.setData({
}) // price:price/100
}else { // })
this.setData({ // }else {
price:0 // this.setData({
}) // price:0
} // })
// }
}, },
cancel: function () { cancel: function () {
this.setData({ this.setData({
@ -284,7 +286,7 @@ Page({
totalPrice(price) { totalPrice(price) {
let allPrice let allPrice
if (this.data.coupon) { 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 allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
} else { } else {
allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10

Loading…
Cancel
Save