Browse Source

昆山回传埋点

master
jiazhipeng 1 year ago
parent
commit
fc1086d9f4
  1. 2
      app.js
  2. 12
      pages/info/postProductInfo/index.js
  3. 12
      pages/info/roadInfo/index.js
  4. 7
      pages/info/sceneProductInfo/index.js
  5. 9
      pages/info/showInfo/index.js
  6. 4
      pages/order/WineSceneOrder/index.js
  7. 6
      pages/order/postOrder/index.js
  8. 8
      pages/order/road/index.js
  9. 4
      pages/order/roadOrder/index.js
  10. 4
      pages/order/scene/index.js
  11. 4
      pages/order/show/index.js
  12. 4
      pages/order/showOrderNew/index.js
  13. 7
      project.private.config.json

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.isTest? true : false; data.isTest = data.isTest157? true : false;
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {
// 获取ui配置文件 // 获取ui配置文件

12
pages/info/postProductInfo/index.js

@ -35,13 +35,16 @@ Page({
iShop: false, iShop: false,
supplierId: null, supplierId: null,
showQrCode: false, showQrCode: false,
wxqrcode: null wxqrcode: null,
ZTPoint:''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
//删除临时存储的联系人 //删除临时存储的联系人
wx.removeStorageSync('linkMan') wx.removeStorageSync('linkMan')
let rect = wx.getMenuButtonBoundingClientRect(), let rect = wx.getMenuButtonBoundingClientRect(),
@ -58,6 +61,11 @@ Page({
cartTop: res.top cartTop: res.top
}) })
}).exec() }).exec()
if (options.ZTPoint) {
this.setData({
ZTPoint: options.ZTPoint
})
}
if (options.retailId) { if (options.retailId) {
this.setData({ this.setData({
@ -349,7 +357,7 @@ Page({
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
// 购买 // 购买
let product = [{ let product = [{
product: this.data.info, product: {...this.data.info,ZTPoint:this.data.ZTPoint},
sku: this.data.info.sku[this.data.skuIndex], sku: this.data.info.sku[this.data.skuIndex],
productNum: this.data.producNum productNum: this.data.producNum
}]; }];

12
pages/info/roadInfo/index.js

@ -22,7 +22,8 @@ Page({
shareImg: null, shareImg: null,
showShareFlag: false, showShareFlag: false,
showQrCode: false, showQrCode: false,
wxqrcode: null wxqrcode: null,
ZTPoint:''
}, },
/** /**
@ -40,6 +41,8 @@ Page({
retailId: options.retailId retailId: options.retailId
}) })
} }
if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})}
let api = commonApi._post; let api = commonApi._post;
if (wx.getStorageSync("jstrip_token")) { if (wx.getStorageSync("jstrip_token")) {
api = commonApi.user_post; api = commonApi.user_post;
@ -169,7 +172,8 @@ Page({
} else { } else {
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
app.globalData.product = { app.globalData.product = {
product: this.data.info product: {...this.data.info,ZTPoint:this.data.ZTPoint},
} }
app.globalData.retailId = this.data.retailId; app.globalData.retailId = this.data.retailId;
util.pagePoint({ util.pagePoint({
@ -182,7 +186,9 @@ Page({
wx.setStorageSync('login_from', 'product_order_login') wx.setStorageSync('login_from', 'product_order_login')
wx.setStorageSync('order_from', 'product_order_submit') wx.setStorageSync('order_from', 'product_order_submit')
wx.navigateTo({ 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,
}) })
} }
}) })

7
pages/info/sceneProductInfo/index.js

@ -45,6 +45,8 @@ Page({
skuDoms: [], // sku 节点Dom skuDoms: [], // sku 节点Dom
activeIndex: 0, // sku 侧边栏 activeIndex: 0, // sku 侧边栏
scrollHeight: 0, scrollHeight: 0,
ZTPoint:'',
}, },
/** /**
@ -61,6 +63,8 @@ Page({
retailId: options.retailId retailId: options.retailId
}) })
} }
if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})}
this.setData({ this.setData({
id: options.id id: options.id
}) })
@ -393,6 +397,9 @@ Page({
// product.productNum = this.data.productNum // product.productNum = this.data.productNum
app.globalData.product.date = this.data.date app.globalData.product.date = this.data.date
app.globalData.product.time = this.data.time app.globalData.product.time = this.data.time
app.globalData.product.product.ZTPoint = this.data.ZTPoint
// app.globalData.product = { // app.globalData.product = {
// ...sku, // ...sku,
// ...product // ...product

9
pages/info/showInfo/index.js

@ -40,7 +40,9 @@ Page({
showDetail: false, showDetail: false,
lat:120, lat:120,
lng:31, lng:31,
distance: 0 distance: 0,
ZTPoint:''
}, },
/** /**
@ -69,6 +71,7 @@ Page({
retailId: options.retailId retailId: options.retailId
}) })
} }
if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})}
commonApi._post("product/get_product_detail", { commonApi._post("product/get_product_detail", {
id: options.id id: options.id
}).then(res => { }).then(res => {
@ -304,7 +307,7 @@ Page({
// app.globalData.retailId = this.data.retailId; // app.globalData.retailId = this.data.retailId;
wx.navigateTo({ 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 () { order: function () {
@ -322,7 +325,7 @@ Page({
app.globalData.couponInfo = null; app.globalData.couponInfo = null;
// 购买 // 购买
let product = [{ let product = [{
product: this.data.info, product: {...this.data.info,ZTPoint:this.data.ZTPoint},
sku: this.data.info.sku[this.data.skuIndex], sku: this.data.info.sku[this.data.skuIndex],
productNum: this.data.producNum productNum: this.data.producNum
}]; }];

4
pages/order/WineSceneOrder/index.js

@ -80,6 +80,7 @@ Page({
this.showAllPrice() this.showAllPrice()
console.log(this.data); console.log(this.data);
console.log(this.data.product.product.ZTPoint)
this.getNewCoupon() this.getNewCoupon()
this.couponCom = this.selectAllComponents("#coupon")[0]; this.couponCom = this.selectAllComponents("#coupon")[0];
@ -293,6 +294,9 @@ Page({
if (this.data.prizeId) { if (this.data.prizeId) {
data.lottery_id = 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 = { let service = 'order/create', postData = {
data: JSON.stringify(data) data: JSON.stringify(data)
} }

6
pages/order/postOrder/index.js

@ -54,6 +54,7 @@ Page({
showPrice: app.globalData.kjId ? 0 : price, showPrice: app.globalData.kjId ? 0 : price,
sku_id: sku_id.join(",") sku_id: sku_id.join(",")
}) })
console.log(this.data.product)
if (!this.data.kjId && !this.data.gp_id) { if (!this.data.kjId && !this.data.gp_id) {
this.couponCom = this.selectAllComponents("#coupon")[0]; this.couponCom = this.selectAllComponents("#coupon")[0];
} }
@ -179,6 +180,11 @@ Page({
if (app.globalData.category_id) { if (app.globalData.category_id) {
data.category_id = 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) console.log(app.globalData.list)
if(!app.globalData.list || app.globalData.list.length == 0){ if(!app.globalData.list || app.globalData.list.length == 0){
commonApi.user_post("order/create", { commonApi.user_post("order/create", {

8
pages/order/road/index.js

@ -19,7 +19,9 @@ Page({
nums:[], nums:[],
price:0, price:0,
infoFlag:false, infoFlag:false,
productInfo:null productInfo:null,
ZTPoint:''
}, },
/** /**
@ -30,6 +32,8 @@ Page({
this.setData({ this.setData({
id:options.id id:options.id
}) })
if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})}
// 获取产品下的规格 // 获取产品下的规格
commonApi._post("product/get_product_detail",{ commonApi._post("product/get_product_detail",{
id:this.data.id id:this.data.id
@ -223,7 +227,7 @@ Page({
return; return;
}; };
app.globalData.product = { app.globalData.product = {
product:this.data.productInfo, product:{...this.data.productInfo,ZTPoint:this.data.ZTPoint},
sku:sku, sku:sku,
selectDate:selectDate, selectDate:selectDate,
price:this.data.price price:this.data.price

4
pages/order/roadOrder/index.js

@ -51,6 +51,7 @@ Page({
price:product.price, price:product.price,
sku_ids:sku_ids.join(",") sku_ids:sku_ids.join(",")
}) })
console.log(this.data)
// 获取默认联系人 // 获取默认联系人
this.getLinkmanList() this.getLinkmanList()
}, },
@ -263,6 +264,9 @@ Page({
if(app.globalData.category_id){ if(app.globalData.category_id){
data.category_id = 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",{ commonApi.user_post("order/create",{
data:JSON.stringify(data) data:JSON.stringify(data)
}).then(res=>{ }).then(res=>{

4
pages/order/scene/index.js

@ -477,9 +477,13 @@ Page({
if (this.data.prizeId) { if (this.data.prizeId) {
data.lottery_id = 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 = { let service = 'order/create', postData = {
data: JSON.stringify(data) data: JSON.stringify(data)
} }
if (app.globalData.product.isGroup == 1) { if (app.globalData.product.isGroup == 1) {
service = "team_order/appoint" service = "team_order/appoint"
postData.member_num = this.data.productNum postData.member_num = this.data.productNum

4
pages/order/show/index.js

@ -31,6 +31,7 @@ Page({
// 日历 // 日历
showMoreDateFlag: false, showMoreDateFlag: false,
ZTPoint:''
}, },
/** /**
@ -42,6 +43,7 @@ Page({
this.setData({ this.setData({
productId: id productId: id
}) })
if (options.ZTPoint) {this.setData({ZTPoint: options.ZTPoint})}
// let product = app.globalData.product // let product = app.globalData.product
// console.log(product) // console.log(product)
// this.setData({ // this.setData({
@ -266,7 +268,7 @@ Page({
// app.globalData.retailId = this.data.retailId; // app.globalData.retailId = this.data.retailId;
app.globalData.product = { app.globalData.product = {
product: {...product, price: skuSelect.price}, product: {...product, price: skuSelect.price,ZTPoint:this.data.ZTPoint},
sku: sku sku: sku
} }

4
pages/order/showOrderNew/index.js

@ -52,6 +52,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(app.globalData.product)
this.setData({ this.setData({
product: app.globalData.product, product: app.globalData.product,
type: options.type, type: options.type,
@ -443,6 +444,9 @@ Page({
if (this.data.prizeId) { if (this.data.prizeId) {
data.lottery_id = 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) console.log(data)
let service = 'order/create', postData = { let service = 'order/create', postData = {
data: JSON.stringify(data) data: JSON.stringify(data)

7
project.private.config.json

@ -6,6 +6,13 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/info/postProductInfo/index",
"pathName": "pages/info/postProductInfo/index",
"query": "id=437254&ZTPoint=yjksSpecial",
"launchMode": "default",
"scene": null
},
{ {
"name": "subPackages/indexGQ/index", "name": "subPackages/indexGQ/index",
"pathName": "subPackages/indexGQ/index", "pathName": "subPackages/indexGQ/index",

Loading…
Cancel
Save