Skip to content

Commit f882439

Browse files
committed
feat(SPA): 增加app下载引导功能
1 parent 8b51625 commit f882439

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

resources/spa/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ VUE_APP_EASEMOB_APP_KEY=#
1313
VUE_APP_EASEMOB_API_URL=http://a1.easemob.com
1414
VUE_APP_EASEMOB_ISDEBUG=false
1515
VUE_APP_LBS_GAODE_KEY=
16+
VUE_APP_MOBLINK_ENABLE=false
17+
VUE_APP_MOBLINK_KEY=

resources/spa/src/main.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ if (!window.initUrl) {
5252
window.initUrl = window.location.href.replace(/(\/$)/, '')
5353
}
5454

55+
// 加载 moblink 用于引导打开 APP
56+
if (process.env.VUE_APP_MOBLINK_ENABLE) {
57+
window.addEventListener('load', () => {
58+
const key = process.env.VUE_APP_MOBLINK_KEY || ''
59+
const script = document.createElement('script')
60+
script.type = 'text/javascript'
61+
script.src = `//f.moblink.mob.com/3.0.1/moblink.js?appkey=${key}`
62+
script.onload = () => {
63+
MobLink({ path: location.href })
64+
}
65+
document.querySelector('body').appendChild(script)
66+
})
67+
}
68+
5569
/* eslint-disable no-new */
5670
new Vue({
5771
store,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#mobLink .mob-box .mob-download-tips {
2+
top: 0;
3+
bottom: initial;
4+
z-index: 100;
5+
background-color: rgba(0,0,0,.6) !important;
6+
}

resources/spa/src/style/tsplus.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
@import "./transition.less";
66
@import "./animate.less";
77
@import "./common.less";
8+
@import "./moblink.less";

0 commit comments

Comments
 (0)