Commit c420265d by 李伟康

增加浏览埋点

1 parent 7b9c9a55
// pages/checkProduct/checkProduct.js // pages/checkProduct/checkProduct.js
// const navStyle = "background-color: transparent;"; // const navStyle = "background-color: transparent;";
import { IMG_URL } from "~/utils/constantData.js"; import {
IMG_URL
} from "~/utils/constantData.js";
const navStyle = "background-color: #fff"; const navStyle = "background-color: #fff";
import { senceData } from "~/pages/tab/index/constant/data"; import {
senceData
} from "~/pages/tab/index/constant/data";
import {
reportData
} from '~/api/index.js'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -17,7 +23,10 @@ Page({ ...@@ -17,7 +23,10 @@ Page({
}, },
// navbar高度设置 // navbar高度设置
navbarReady(e) { navbarReady(e) {
let { height, statusBarHeight } = e.detail; let {
height,
statusBarHeight
} = e.detail;
this.setData({ this.setData({
headerHeight: height / 2 + statusBarHeight, headerHeight: height / 2 + statusBarHeight,
// headerHeight: height / 2 + statusBarHeight, // headerHeight: height / 2 + statusBarHeight,
...@@ -41,9 +50,12 @@ Page({ ...@@ -41,9 +50,12 @@ Page({
onRoute(options) { onRoute(options) {
// console.log("options: ", options); // console.log("options: ", options);
//选中场景的index,和产品的index //选中场景的index,和产品的index
let {actNum,activeNavIdx} = options let {
actNum,
activeNavIdx
} = options
this.setData({ this.setData({
actNum, actNum,
activeNavIdx activeNavIdx
}) })
}, },
...@@ -51,6 +63,23 @@ Page({ ...@@ -51,6 +63,23 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options)
if (options.shareOpenId) {
const WXUSERINFO = wx.$storage.get('wx_user_info'),
USERINFO = wx.$storage.get('userInfo')
reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: USERINFO.phone || '',
merchantId: options.merchantId || '',
shareOpenId: options.shareOpenId || '',
sharePhone: options.sharePhone || '',
productCode: options.productCode || '',
productDesc: options.productDesc || ''
}, 1)
}
// actNum,activeNavIdx // actNum,activeNavIdx
}, },
...@@ -88,4 +117,4 @@ Page({ ...@@ -88,4 +117,4 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
}); });
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!