Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 79efbaa1
authored
Oct 28, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分享添加埋点
1 parent
337d73df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
2 deletions
app.js
pages/checkProduct/checkProduct.js
pages/scene/scene.js
utils/data.js
app.js
View file @
79efbaa
...
@@ -83,6 +83,10 @@ App({
...
@@ -83,6 +83,10 @@ App({
break
break
}
}
}
}
}
else
if
(
wx
.
$trackData
.
isShare
)
{
util
.
setStorageSync
(
'scene'
,
wx
.
$trackData
)
const
systemInfo
=
JSON
.
parse
(
wx
.
getStorageSync
(
'aicard_system_info'
))
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
}
else
if
(
!
wx
.
$trackData
.
detailShare
&&
wx
.
$trackData
.
cardId
)
{
}
else
if
(
!
wx
.
$trackData
.
detailShare
&&
wx
.
$trackData
.
cardId
)
{
// 名片分享在这里设置埋点
// 名片分享在这里设置埋点
util
.
setStorageSync
(
'scene'
,
wx
.
$trackData
)
util
.
setStorageSync
(
'scene'
,
wx
.
$trackData
)
...
...
pages/checkProduct/checkProduct.js
View file @
79efbaa
...
@@ -7,6 +7,7 @@ import { senceData } from "~/pages/scene/constant/data.js";
...
@@ -7,6 +7,7 @@ import { senceData } from "~/pages/scene/constant/data.js";
import
Draw
from
"~/utils/Draw_new.js"
;
import
Draw
from
"~/utils/Draw_new.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
{
createQrCodeApi
,
sceneByIdApi
}
from
"~/api/checkProduct.js"
;
import
utils
from
"~/utils/util.js"
;
import
utils
from
"~/utils/util.js"
;
import
{
trackData
,
productTrack
}
from
'../../utils/data'
let
IMG_URL
=
wx
.
$imgUrl
let
IMG_URL
=
wx
.
$imgUrl
Page
({
Page
({
...
@@ -408,6 +409,7 @@ Page({
...
@@ -408,6 +409,7 @@ Page({
* 生命周期函数--监听页面加载 (扫码,分享链接)
* 生命周期函数--监听页面加载 (扫码,分享链接)
*/
*/
async onLoad(options) {
async onLoad(options) {
console.log(wx.getEnterOptionsSync())
await this.getData()
await this.getData()
console.log("分享options12255565: ", options);
console.log("分享options12255565: ", options);
// actNum,activeNavIdx isShare
// actNum,activeNavIdx isShare
...
@@ -426,11 +428,22 @@ Page({
...
@@ -426,11 +428,22 @@ Page({
let {senceData} = this.data
let {senceData} = this.data
// 扫码进来
// 扫码进来
let { actNum, activeNavIdx, isShare } = options;
let { actNum, activeNavIdx, isShare } = options;
// const { query: {cardId, merchant} } = wx.getEnterOptionsSync()
const { query, query: {cardId, merchant} } = wx.getEnterOptionsSync()
console.log('actNum, activeNavIdx, isShare: ', actNum, activeNavIdx, isShare);
console.log('actNum, activeNavIdx, isShare: ', actNum, activeNavIdx, isShare);
if (isShare) {
if (isShare) {
this.setData({
this.setData({
isShow: false,
isShow: false,
});
});
if (cardId) {
wx.$trackData = query
getApp()
.login()
.then(({ data }) => {
const trackName = productTrack[actNum][activeNavIdx]
wx.$Track.sendTrack(trackData[trackName]);
});
}
} else {
} else {
wx.showLoading({
wx.showLoading({
title: "加载图片中",
title: "加载图片中",
...
@@ -575,11 +588,13 @@ Page({
...
@@ -575,11 +588,13 @@ Page({
onShareAppMessage() {
onShareAppMessage() {
let {senceData,actNum,activeNavIdx,isShare} = this.data
let {senceData,actNum,activeNavIdx,isShare} = this.data
let product = senceData[actNum]?.productList[activeNavIdx].proName
let product = senceData[actNum]?.productList[activeNavIdx].proName
let merchant = utils.getStorageSync("scene").merchant || utils.getStorageSync("scene").merchantId
const cardId = utils.getStorageSync('scene').cardId
console.log('product: ', product);
console.log('product: ', product);
return {
return {
// title: `
给你分享一个活动
$
{
product
}
,戳我参与
~
`,
// title: `
给你分享一个活动
$
{
product
}
,戳我参与
~
`,
title: `
给你分享一个活动,戳我参与
~
`,
title: `
给你分享一个活动,戳我参与
~
`,
path:`
/
pages
/
checkProduct
/
checkProduct
?
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
isShare
=
$
{
isShare
}
`
path:`
/
pages
/
checkProduct
/
checkProduct
?
actNum
=
$
{
actNum
}
&
activeNavIdx
=
$
{
activeNavIdx
}
&
isShare
=
$
{
isShare
}
&
cardId
=
$
{
cardId
}
&
merchant
=
$
{
merchant
}
`
}
}
},
},
/**
/**
...
...
pages/scene/scene.js
View file @
79efbaa
...
@@ -147,6 +147,7 @@ Page({
...
@@ -147,6 +147,7 @@ Page({
// if(scenestatus == 1){
// if(scenestatus == 1){
// }
// }
// 场景切换默认埋点第一个产品
const
trackName
=
this
.
data
.
trackList
[
num
][
0
]
const
trackName
=
this
.
data
.
trackList
[
num
][
0
]
wx
.
$Track
.
sendTrack
(
trackData
[
trackName
]);
wx
.
$Track
.
sendTrack
(
trackData
[
trackName
]);
this
.
setData
({
this
.
setData
({
...
...
utils/data.js
View file @
79efbaa
...
@@ -114,4 +114,12 @@ const trackData = {
...
@@ -114,4 +114,12 @@ const trackData = {
};
};
export
{
trackData
};
const
productTrack
=
[
[
'EQUITYCARD'
],
[
'SOLARFILM'
],
[
'PAINTPROTECT'
,
'CHANGEFILM'
],
[
'CARBEAUTY'
,
'SEATVENTILATE'
,
'ARNAVIGATION'
,
'LIGHT'
,
'NAVIGATIONARROUND'
],
[
'LOSSPGASE'
]
]
export
{
trackData
,
productTrack
};
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment