Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
30d2fa05
Commit
30d2fa05
authored
Jan 18, 2024
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行为收集加参数
parent
06ef6380
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
24 deletions
+44
-24
src/App.vue
+44
-24
No files found.
src/App.vue
View file @
30d2fa05
...
...
@@ -8,13 +8,18 @@ import { themeColor, checkShowConditionIds, getStoreInfo, setStoreInfo } from "@
import
{
query_isEntry
}
from
"@/utils/mayi_fenxiao"
;
export
default
{
data
()
{
return
{
extConfig
:
{},
}
},
async
created
()
{
wx
.
setStorageSync
(
"firstView"
,
1
);
console
.
log
(
new
Date
().
getTime
(),
'load-----app-created'
)
// NODE_ENV
let
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
()
:
{};
console
.
log
(
extConfig
,
"-----------
extConfig"
);
if
(
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
this
.
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
()
:
{};
console
.
log
(
this
.
extConfig
,
"-----------this.
extConfig"
);
if
(
JSON
.
stringify
(
this
.
extConfig
)
==
"{}"
)
{
let
shopItem
=
{
// development: { mixid: "IR8rkL", "shopid": 3813}, //道可测试1
// development: { mixid: "iLntd3", "shopid": 3814}, //道可测试2
...
...
@@ -36,19 +41,26 @@ export default {
// production: { "mixid":"5BkDRR", "shopid": 1316 }, // lost in echo订货
// production: { "mixid":"CYNZ", "shopid": 1609 }, // 晨语女装
xhyx_uat
:
{
"mixid"
:
"xhyxshop"
,
"shopid"
:
1
},
xhyx_beta
:
{
"mixid"
:
"xhyxshop"
,
"shopid"
:
1
},
xhyx_prod
:
{
"mixid"
:
"xhyxshop"
,
"shopid"
:
1
},
xhyx_beta
:
{
"mixid"
:
"xhyxshop"
,
"shopid"
:
1
,
"groupId"
:
1
},
xhyx_prod
:
{
"mixid"
:
"xhyxshop"
,
"shopid"
:
1
,
"groupId"
:
1
},
wly_prod
:
{
"mixid"
:
"WLYSWT"
,
"shopid"
:
2
},
ylkj_uat
:
{
"mixid"
:
"YLKJ"
,
"shopid"
:
8
}
}
extConfig
=
shopItem
[
process
.
env
.
NODE_ENV
];
wx
.
setStorageSync
(
"
extConfig"
,
JSON
.
stringify
(
extConfig
));
this
.
extConfig
=
shopItem
[
process
.
env
.
NODE_ENV
];
wx
.
setStorageSync
(
"
this.extConfig"
,
JSON
.
stringify
(
this
.
extConfig
));
}
// 行为收集初始化
this
.
$mpBehavior
.
init
(
"mayi-moblie-shop-mp"
,
this
.
extConfig
.
shopid
,
{
mode
:
process
.
env
.
NODE_ENV
,
gid
:
this
.
extConfig
.
groupId
,
mixid
:
this
.
extConfig
.
mixid
,
host
:
process
.
env
.
MANALYTICS_HOST
+
'?'
,
})
console
.
log
(
"1444444444"
,
extConfig
);
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
this
.
$store
.
commit
(
'setExtConfigInfo'
,
extConfig
)
console
.
log
(
"1444444444"
,
this
.
extConfig
);
this
.
$store
.
commit
(
"setExtConfig"
,
this
.
extConfig
.
mixid
);
this
.
$store
.
commit
(
'setExtConfigInfo'
,
this
.
extConfig
)
// 调用API从本地缓存中获取数据
/*
* 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
...
...
@@ -72,12 +84,10 @@ export default {
mpvue
.
setStorageSync
(
"logs"
,
logs
);
}
// 初始
await
this
.
getShopInfo
(
extConfig
);
await
this
.
getShopInfo
(
this
.
extConfig
);
// 页面配置信息
// this.getThemePage(extConfig);
// this.getThemePage(
this.
extConfig);
let
mpApp
=
getApp
();
console
.
log
(
mpApp
,
"this.mpApp"
);
mpApp
.
getShopInfo
=
this
.
getShopInfo
...
...
@@ -116,6 +126,24 @@ export default {
}
console
.
log
(
'app-mounted-结束'
)
},
onLaunch
(
option
)
{
console
.
log
(
'app-onLaunch-option'
,
option
,
option
.
scene
);
this
.
$mpBehavior
.
trackEvent
(
'miniponlaunch'
,
{
utm_matching_type
:
JSON
.
stringify
({
type
:
'wxminip'
,
launchOptions
:
option
,
})
})
},
onShow
(
option
)
{
console
.
log
(
'app-onShow-option'
,
option
);
this
.
$mpBehavior
.
trackEvent
(
'miniponshow'
,
{
utm_matching_type
:
JSON
.
stringify
({
type
:
'wxminip'
,
launchOptions
:
option
,
})
})
},
methods
:
{
async
setVisible
(
pageList
,
cb
)
{
// 首页显示条件
...
...
@@ -226,15 +254,7 @@ export default {
async
getShopInfo
({
mixid
})
{
await
shop
.
getShopInfo
({
shopMixId
:
mixid
}).
then
((
res
)
=>
{
console
.
log
(
"--app---getShopInfo"
)
console
.
log
(
process
.
env
.
MANALYTICS_HOST
,
'-process.env.MANALYTICS_HOST'
)
if
(
res
.
data
.
code
==
200
)
{
// 收集用户数据
this
.
$mpBehavior
.
init
(
"mayi-moblie-shop-mp"
,
res
.
data
.
data
.
id
,
{
mode
:
process
.
env
.
NODE_ENV
,
gid
:
res
.
data
.
data
.
groupId
,
mixid
:
mixid
,
host
:
process
.
env
.
MANALYTICS_HOST
+
'?'
,
})
let
mpApp
=
getApp
();
// 商城基本数据
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment