From fc1086d9f4f47f3fee1f3bf85e2d0a31c6b37733 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Sat, 25 Jan 2025 21:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=86=E5=B1=B1=E5=9B=9E=E4=BC=A0=E5=9F=8B?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- pages/info/postProductInfo/index.js | 12 ++++++++++-- pages/info/roadInfo/index.js | 12 +++++++++--- pages/info/sceneProductInfo/index.js | 7 +++++++ pages/info/showInfo/index.js | 9 ++++++--- pages/order/WineSceneOrder/index.js | 4 ++++ pages/order/postOrder/index.js | 6 ++++++ pages/order/road/index.js | 8 ++++++-- pages/order/roadOrder/index.js | 4 ++++ pages/order/scene/index.js | 4 ++++ pages/order/show/index.js | 4 +++- pages/order/showOrderNew/index.js | 4 ++++ project.private.config.json | 7 +++++++ 13 files changed, 71 insertions(+), 12 deletions(-) diff --git a/app.js b/app.js index 170af3f..e8b8d6a 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.isTest? true : false; + data.isTest = data.isTest157? true : false; this.globalData.configJson = data }).then(() => { // 获取ui配置文件 diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index 22e9eb8..5c2ee7f 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -35,13 +35,16 @@ Page({ iShop: false, supplierId: null, showQrCode: false, - wxqrcode: null + wxqrcode: null, + + ZTPoint:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + console.log(options) //删除临时存储的联系人 wx.removeStorageSync('linkMan') let rect = wx.getMenuButtonBoundingClientRect(), @@ -58,6 +61,11 @@ Page({ cartTop: res.top }) }).exec() + if (options.ZTPoint) { + this.setData({ + ZTPoint: options.ZTPoint + }) + } if (options.retailId) { this.setData({ @@ -349,7 +357,7 @@ Page({ app.globalData.couponInfo = null; // 购买 let product = [{ - product: this.data.info, + product: {...this.data.info,ZTPoint:this.data.ZTPoint}, sku: this.data.info.sku[this.data.skuIndex], productNum: this.data.producNum }]; diff --git a/pages/info/roadInfo/index.js b/pages/info/roadInfo/index.js index 18ed345..bda6477 100644 --- a/pages/info/roadInfo/index.js +++ b/pages/info/roadInfo/index.js @@ -22,7 +22,8 @@ Page({ shareImg: null, showShareFlag: false, showQrCode: false, - wxqrcode: null + wxqrcode: null, + ZTPoint:'' }, /** @@ -40,6 +41,8 @@ Page({ retailId: options.retailId }) } + if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})} + let api = commonApi._post; if (wx.getStorageSync("jstrip_token")) { api = commonApi.user_post; @@ -169,7 +172,8 @@ Page({ } else { app.globalData.couponInfo = null; app.globalData.product = { - product: this.data.info + product: {...this.data.info,ZTPoint:this.data.ZTPoint}, + } app.globalData.retailId = this.data.retailId; util.pagePoint({ @@ -182,7 +186,9 @@ Page({ wx.setStorageSync('login_from', 'product_order_login') wx.setStorageSync('order_from', 'product_order_submit') wx.navigateTo({ - url: '/pages/order/road/index?id=' + this.data.info.id + (this.data.retailSkuId ? ('&skuid=' + this.data.retailSkuId) : '') + url: '/pages/order/road/index?id=' + this.data.info.id + + (this.data.retailSkuId ? ('&skuid=' + this.data.retailSkuId) : '') + +'&ZTPoint='+this.data.ZTPoint, }) } }) diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index d7103c2..67be917 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -45,6 +45,8 @@ Page({ skuDoms: [], // sku 节点Dom activeIndex: 0, // sku 侧边栏 scrollHeight: 0, + ZTPoint:'', + }, /** @@ -61,6 +63,8 @@ Page({ retailId: options.retailId }) } + if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})} + this.setData({ id: options.id }) @@ -393,6 +397,9 @@ Page({ // product.productNum = this.data.productNum app.globalData.product.date = this.data.date app.globalData.product.time = this.data.time + app.globalData.product.product.ZTPoint = this.data.ZTPoint + + // app.globalData.product = { // ...sku, // ...product diff --git a/pages/info/showInfo/index.js b/pages/info/showInfo/index.js index baf18b8..7444ad9 100644 --- a/pages/info/showInfo/index.js +++ b/pages/info/showInfo/index.js @@ -40,7 +40,9 @@ Page({ showDetail: false, lat:120, lng:31, - distance: 0 + distance: 0, + ZTPoint:'' + }, /** @@ -69,6 +71,7 @@ Page({ retailId: options.retailId }) } + if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})} commonApi._post("product/get_product_detail", { id: options.id }).then(res => { @@ -304,7 +307,7 @@ Page({ // app.globalData.retailId = this.data.retailId; wx.navigateTo({ - url: '/pages/order/show/index?id='+this.data.id, + url: '/pages/order/show/index?id='+this.data.id+'&ZTPoint='+this.data.ZTPoint, }) }, order: function () { @@ -322,7 +325,7 @@ Page({ app.globalData.couponInfo = null; // 购买 let product = [{ - product: this.data.info, + product: {...this.data.info,ZTPoint:this.data.ZTPoint}, sku: this.data.info.sku[this.data.skuIndex], productNum: this.data.producNum }]; diff --git a/pages/order/WineSceneOrder/index.js b/pages/order/WineSceneOrder/index.js index 94defbc..c1c4722 100644 --- a/pages/order/WineSceneOrder/index.js +++ b/pages/order/WineSceneOrder/index.js @@ -80,6 +80,7 @@ Page({ this.showAllPrice() console.log(this.data); + console.log(this.data.product.product.ZTPoint) this.getNewCoupon() this.couponCom = this.selectAllComponents("#coupon")[0]; @@ -293,6 +294,9 @@ Page({ if (this.data.prizeId) { data.lottery_id = this.data.prizeId } + if (this.data.product.product.ZTPoint) { + data.partner_code = this.data.product.product.ZTPoint + } let service = 'order/create', postData = { data: JSON.stringify(data) } diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js index 1668344..06b2343 100644 --- a/pages/order/postOrder/index.js +++ b/pages/order/postOrder/index.js @@ -54,6 +54,7 @@ Page({ showPrice: app.globalData.kjId ? 0 : price, sku_id: sku_id.join(",") }) + console.log(this.data.product) if (!this.data.kjId && !this.data.gp_id) { this.couponCom = this.selectAllComponents("#coupon")[0]; } @@ -179,6 +180,11 @@ Page({ if (app.globalData.category_id) { data.category_id = app.globalData.category_id; } + + let ZTPointProduct = this.data.product.find(v=>v.product&&v.product.ZTPoint) + if (ZTPointProduct) { + data.partner_code = ZTPointProduct.product.ZTPoint + } console.log(app.globalData.list) if(!app.globalData.list || app.globalData.list.length == 0){ commonApi.user_post("order/create", { diff --git a/pages/order/road/index.js b/pages/order/road/index.js index 1446a15..96de141 100644 --- a/pages/order/road/index.js +++ b/pages/order/road/index.js @@ -19,7 +19,9 @@ Page({ nums:[], price:0, infoFlag:false, - productInfo:null + productInfo:null, + ZTPoint:'' + }, /** @@ -30,6 +32,8 @@ Page({ this.setData({ id:options.id }) + if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})} + // 获取产品下的规格 commonApi._post("product/get_product_detail",{ id:this.data.id @@ -223,7 +227,7 @@ Page({ return; }; app.globalData.product = { - product:this.data.productInfo, + product:{...this.data.productInfo,ZTPoint:this.data.ZTPoint}, sku:sku, selectDate:selectDate, price:this.data.price diff --git a/pages/order/roadOrder/index.js b/pages/order/roadOrder/index.js index 1c222ff..0090e4a 100644 --- a/pages/order/roadOrder/index.js +++ b/pages/order/roadOrder/index.js @@ -51,6 +51,7 @@ Page({ price:product.price, sku_ids:sku_ids.join(",") }) + console.log(this.data) // 获取默认联系人 this.getLinkmanList() }, @@ -263,6 +264,9 @@ Page({ if(app.globalData.category_id){ data.category_id = app.globalData.category_id; } + if (this.data.product.ZTPoint) { + data.partner_code = this.data.product.ZTPoint + } commonApi.user_post("order/create",{ data:JSON.stringify(data) }).then(res=>{ diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 56e5a75..1bdae09 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -477,9 +477,13 @@ Page({ if (this.data.prizeId) { data.lottery_id = this.data.prizeId } + if (this.data.product.product.ZTPoint) { + data.partner_code = this.data.product.product.ZTPoint + } let service = 'order/create', postData = { data: JSON.stringify(data) } + if (app.globalData.product.isGroup == 1) { service = "team_order/appoint" postData.member_num = this.data.productNum diff --git a/pages/order/show/index.js b/pages/order/show/index.js index 51c71e2..82f43d7 100644 --- a/pages/order/show/index.js +++ b/pages/order/show/index.js @@ -31,6 +31,7 @@ Page({ // 日历 showMoreDateFlag: false, + ZTPoint:'' }, /** @@ -42,6 +43,7 @@ Page({ this.setData({ productId: id }) + if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})} // let product = app.globalData.product // console.log(product) // this.setData({ @@ -266,7 +268,7 @@ Page({ // app.globalData.retailId = this.data.retailId; app.globalData.product = { - product: {...product, price: skuSelect.price}, + product: {...product, price: skuSelect.price,ZTPoint:this.data.ZTPoint}, sku: sku } diff --git a/pages/order/showOrderNew/index.js b/pages/order/showOrderNew/index.js index 393e269..2c2467d 100644 --- a/pages/order/showOrderNew/index.js +++ b/pages/order/showOrderNew/index.js @@ -52,6 +52,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + console.log(app.globalData.product) this.setData({ product: app.globalData.product, type: options.type, @@ -443,6 +444,9 @@ Page({ if (this.data.prizeId) { data.lottery_id = this.data.prizeId } + if (this.data.product.product.ZTPoint) { + data.partner_code = this.data.product.product.ZTPoint + } console.log(data) let service = 'order/create', postData = { data: JSON.stringify(data) diff --git a/project.private.config.json b/project.private.config.json index d302a3d..6f2c82b 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -6,6 +6,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "pages/info/postProductInfo/index", + "pathName": "pages/info/postProductInfo/index", + "query": "id=437254&ZTPoint=yjksSpecial", + "launchMode": "default", + "scene": null + }, { "name": "subPackages/indexGQ/index", "pathName": "subPackages/indexGQ/index",