diff --git a/app.js b/app.js index d692356..79152fd 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ App({ unique_key: "wechatxcx" }).then(res => { let data = JSON.parse(res.data); - data.isTest = data.isTest138? true : false; + data.isTest = data.isTest139? true : false; this.globalData.configJson = data }).then(() => { // 获取ui配置文件 diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index 2ce7d62..da9458e 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -336,6 +336,7 @@ Page({ }]; app.globalData.postProduct = product; app.globalData.retailId = this.data.retailId; + app.globalData.listName = null wx.navigateTo({ url: '/pages/order/postOrder/index', }) diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index 058a4f4..ad008c9 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -358,6 +358,7 @@ Page({ } else { app.globalData.postProduct = [] app.globalData.list = [] + app.globalData.listName = null if (this.data.skuFlag == 'order') { if (e.currentTarget.dataset.disable === 1) return; util.pagePoint({ diff --git a/pages/order/components/coupon/index.wxml b/pages/order/components/coupon/index.wxml index 1ae1794..0db1d8a 100644 --- a/pages/order/components/coupon/index.wxml +++ b/pages/order/components/coupon/index.wxml @@ -2,7 +2,14 @@ 优惠券 - -{{coupon.activity.money/100}} + + + -{{coupon.activity.money/100}} + + + {{coupon.activity.fold}}折 + + 请选择 diff --git a/pages/order/coupon/index.wxml b/pages/order/coupon/index.wxml index 1713323..3a169d0 100644 --- a/pages/order/coupon/index.wxml +++ b/pages/order/coupon/index.wxml @@ -2,7 +2,10 @@ - {{item.activity.money/100}} + {{item.activity.money/100}} + + {{item.activity.fold}} + {{item.activity.name}} {{item.end_time}}到期 diff --git a/pages/order/coupon/index.wxss b/pages/order/coupon/index.wxss index 9277006..a8cfad0 100644 --- a/pages/order/coupon/index.wxss +++ b/pages/order/coupon/index.wxss @@ -20,10 +20,22 @@ page { font-weight: 500; flex-shrink: 0; } +.coupon-item .money1 { + color: #D62828; + font-size: 47rpx; + width: 187rpx; + text-align: center; + font-weight: 500; + flex-shrink: 0; +} .coupon-item .money::before { content: '¥'; font-size: 30rpx; } +.coupon-item .money1::after { + content: '折'; + font-size: 30rpx; +} .coupon-info { flex: 1; margin-right: 20rpx; diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js index f48f637..0dfa8ad 100644 --- a/pages/order/postOrder/index.js +++ b/pages/order/postOrder/index.js @@ -22,7 +22,8 @@ Page({ allowance_price: 0, showAllowance: false, flag:null, - isCar:'single' + isCar:'single', + showYhq:null }, /** @@ -35,7 +36,8 @@ Page({ gp_id: app.globalData.gp_id || app.globalData.team_id, prizeId: wx.getStorageSync('prizeId'), flag:options.flag, - isCar:options.isCar + isCar:options.isCar, + showYhq:app.globalData.listName?false:true }) let price = 0, sku_id = []; app.globalData.postProduct.map(item => { @@ -57,6 +59,16 @@ Page({ } console.log(this.data.showPrice) }, + price() { + let allPrice + if (this.data.coupon) { + if (this.data.coupon.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 + } + } + }, changeAllowance: function () { this.setData({ showAllowance: !this.data.showAllowance diff --git a/pages/order/postOrder/index.wxml b/pages/order/postOrder/index.wxml index 7716a2e..f46ff39 100644 --- a/pages/order/postOrder/index.wxml +++ b/pages/order/postOrder/index.wxml @@ -47,11 +47,25 @@ - + - 合计:¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}} + + + + 合计:¥{{((showPrice + postFee - (coupon?coupon.activity.money:0))>0?(showPrice + postFee - (coupon?coupon.activity.money:0)):0)/100}} + + + 合计:¥{{((showPrice + postFee)* coupon.activity.fold/10)>0?((showPrice + postFee)* coupon.activity.fold/10)/100:0}} + + + + 合计:¥{{showPrice + postFee>0?(showPrice + postFee)/100:0}} + + 合计:¥{{postFee?(0+postFee)/100:0}} 下一步 diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 86b2b38..f5a0ada 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -44,6 +44,7 @@ Page({ bookingInfoTitle: "", showDate:false, showDate2:false, + showYhq:null }, /** @@ -64,9 +65,10 @@ Page({ is_authentication:app.globalData.product.sku.sku_model.is_authentication, is_real_name:app.globalData.product.sku.sku_model.is_real_name, date: app.globalData.product.date, - time: app.globalData.product.time + time: app.globalData.product.time, + showYhq:app.globalData.listName?false:true }) - console.log('-------',this.data.date,this.data.time); + console.log('-------',this.data.showYhq,this.data.time); // debugger console.log('-------',app.globalData.product.sku.sku_model.is_need_idcard); console.log('---是否实名----',app.globalData.product.sku.sku_model.is_authentication); @@ -87,7 +89,7 @@ Page({ } this.setData({ product: app.globalData.product, - singlePrice: app.globalData.product?app.globalData.product.date.price :(this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price) + singlePrice: app.globalData.product.date?app.globalData.product.date.price :(this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price) // singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price }) console.log(this.data.singlePrice); @@ -140,7 +142,17 @@ Page({ // this.setData({ // singlePrice:app.globalData.product.product.price // }) - 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 @@ -152,7 +164,17 @@ 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 = 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 @@ -261,7 +283,17 @@ Page({ }, totalPrice(price) { let allPrice - allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) + if (this.data.coupon) { + if (this.data.coupon.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 + } + } else { + allPrice = this.data.singlePrice * this.data.productNum + } + + // allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) if (allPrice >0) { this.setData({ price:allPrice/100, diff --git a/pages/order/scene/index.wxml b/pages/order/scene/index.wxml index 2cef298..fcb59e6 100644 --- a/pages/order/scene/index.wxml +++ b/pages/order/scene/index.wxml @@ -70,7 +70,7 @@ -