From d76959ea723dd401c3c1a78cee9036a86cd700c1 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Wed, 2 Jul 2025 21:01:30 +0800 Subject: [PATCH] 1 --- pages/info/sceneProductInfo/index.js | 19 ++++++++++--- pages/order/components/wxqrCode/index.js | 2 +- pages/order/scene/index.js | 18 ++++++++++-- subPackages/gwcOrder/index.js | 27 +++++++++++++++--- subPackages/gwcOrder/index.wxss | 35 +++++++++++++++++++++++- utils/https.js | 4 +-- 6 files changed, 91 insertions(+), 14 deletions(-) diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index ad3822d..8519d1a 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -49,6 +49,8 @@ Page({ activeIndex: 0, // sku 侧边栏 scrollHeight: 0, ZTPoint:'', + + sku_id: null, }, @@ -243,12 +245,22 @@ Page({ }, // 获取日期 changeDate: function (e) { - console.log(e); + // 2025-7-2 合并票日期变更 需要获取sku并重新赋值 + console.log("日期变更",e); + let sku_id = e.detail.sku_id; this.setData({ date: e.detail, - showPrice:e.detail.price + showPrice:e.detail.price, + sku_id: sku_id, }) console.log(this.data.date); + + // 获取sku信息 + commonApi._post("product/get_sku_detail_id", { + sku_id: sku_id + }).then(res => { + app.globalData.product.sku = res.data + }) }, // 获取分时 changeTime: function (e) { @@ -366,7 +378,7 @@ Page({ console.log(this.data.skuList) commonApi.user_post("/product/checkStock", { - sku_id: this.data.skuList[this.data.skuIndex].id, + sku_id: this.data.sku_id || this.data.skuList[this.data.skuIndex].id, }).then(res => { if (res && res.code != 1) { wx.showModal({ @@ -993,7 +1005,6 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - console.log(11111); commonApi.user_post('cart/get_list', {}).then(res => { this.setData({ cartCount: res.data.length //1 diff --git a/pages/order/components/wxqrCode/index.js b/pages/order/components/wxqrCode/index.js index 7cfee1b..26a3bc0 100644 --- a/pages/order/components/wxqrCode/index.js +++ b/pages/order/components/wxqrCode/index.js @@ -24,7 +24,7 @@ Component({ }, pageLifetimes: { show: function() { - console.log(123123); + console.log("wxqCode component show"); } }, diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 04c5c89..bee3cc0 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -60,7 +60,7 @@ Page({ prizeId: wx.getStorageSync('prizeId'), flag:options.flag, date:null, - ticket_type:app.globalData.product.sku.ticket_type || 1, + ticket_type:app.globalData.product.sku.ticket_type || 1, isCar:options.isCar, is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard, is_authentication:app.globalData.product.sku.sku_model.is_authentication, @@ -342,6 +342,7 @@ Page({ }, changeDate: function (e) { console.log('打印',e); + let sku_id = e.detail.sku_id; this.setData({ showDate:true }) @@ -365,10 +366,23 @@ Page({ app.globalData.product.changeFlag = true this.setData({ date: e.detail, - singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price, showDate2:true }) // this.changePrice() + + // 获取sku信息 + commonApi._post("product/get_sku_detail_id", { + sku_id: sku_id + }).then(res => { + this.data.product.sku = res.data + app.globalData.product.sku = res.data + this.setData({ + singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price, + product: this.data.product + }) + + }) + }, changeTime: function (e) { this.setData({ diff --git a/subPackages/gwcOrder/index.js b/subPackages/gwcOrder/index.js index 0e67cba..485496a 100644 --- a/subPackages/gwcOrder/index.js +++ b/subPackages/gwcOrder/index.js @@ -270,7 +270,8 @@ Page({ allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 } } else { - allPrice = this.data.singlePrice * this.data.productNum + // allPrice = this.data.singlePrice * this.data.productNum + allPrice = price * this.data.productNum } // allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0) @@ -289,9 +290,10 @@ Page({ }, changeDate: function (e) { console.log('打印',e); + let sku_id = e.detail.sku_id; // debugger // this.showAllPrice() - this.totalPrice(e.detail.price) + if (e.detail.price != this.data.singlePrice && this.data.coupon) { wx.showToast({ title: '订单价格发生变化,请重新选择优惠券', @@ -299,7 +301,7 @@ Page({ }) this.setData({ coupon: null, - singlePrice:e.detail.price + // singlePrice:e.detail.price }) if (!this.data.kjId && !this.data.gp_id && this.data.product.isGroup != 1 && this.data.type!='museum') { this.couponCom.setNullCoupon() @@ -308,8 +310,25 @@ Page({ } this.setData({ date: e.detail, - singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price }) + + // 获取sku信息 + commonApi._post("product/get_sku_detail_id", { + sku_id: sku_id + }).then(res => { + this.data.product.sku = res.data + app.globalData.product.sku = res.data + this.setData({ + singlePrice: this.data.gp_id ? this.data.product.sku.event_price : e.detail.price, + product: this.data.product + }) + console.log('获取skuId',app.globalData.list,app.globalData.index) + // this.totalPrice(e.detail.price) + this.totalPrice(this.data.singlePrice) + }) + + + // this.changePrice() }, changeTime: function (e) { diff --git a/subPackages/gwcOrder/index.wxss b/subPackages/gwcOrder/index.wxss index 945fd9b..04cb740 100644 --- a/subPackages/gwcOrder/index.wxss +++ b/subPackages/gwcOrder/index.wxss @@ -340,4 +340,37 @@ page { /* margin-bottom: 45%; */ overflow-y: auto; margin: auto; -} \ No newline at end of file +} + +.input-box { + background: white; + margin: 20rpx; + font-size: 28rpx; + padding: 0 25rpx; + border-radius: 10rpx; + } + .input-item { + display: flex; + align-items: center; + height: 106rpx; + justify-content: space-between; + border-bottom: 1rpx solid #EEE; + } + .input-label { + width: 140rpx; + } + .input-item .weui-input { + flex: 1; + } + .btn { + margin: 0 20rpx; + margin-top: 100rpx; + width: 700rpx; + margin-bottom: 30rpx; + line-height: 72rpx; + border-radius: 35rpx; + text-align: center; + color: white; + font-size: 36rpx; + background: #D62828; + } \ No newline at end of file diff --git a/utils/https.js b/utils/https.js index 67031b4..1a81b17 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" // import userApi from "../utils/https/user.js"; -// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -let baseUrl = "https://api.cloud.sz-trip.com/api/"; +const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +// let baseUrl = "https://api.cloud.sz-trip.com/api/"; const env = wx.getAccountInfoSync().miniProgram.envVersion if (env == 'develop1') { baseUrl = "https://test.api.cloud.sz-trip.com/api/"