Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
h5-base
Commits
2c25c92c
Commit
2c25c92c
authored
Dec 26, 2018
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
神策
parent
933cee7d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
126 additions
and
46 deletions
+126
-46
author.vue
src/components/author.vue
+6
-0
bindMobile.vue
src/components/bindMobile.vue
+3
-0
index.vue
src/components/buy/index.vue
+8
-0
index.vue
src/components/index.vue
+37
-2
index.vue
src/components/map/index.vue
+13
-0
mine.vue
src/components/mine.vue
+6
-0
myGoodsList.vue
src/components/myGoodsList.vue
+6
-0
order.vue
src/components/order.vue
+6
-0
main.js
src/main.js
+12
-12
index.js
src/router/index.js
+29
-32
No files found.
src/components/author.vue
View file @
2c25c92c
...
@@ -30,6 +30,12 @@ export default {
...
@@ -30,6 +30,12 @@ export default {
},
},
methods
:
{
methods
:
{
onPageReload
:
function
()
{
onPageReload
:
function
()
{
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'授权'
,
moduleTitle
:
'授权'
,
buttonType
:
'重新授权'
,
buttonName
:
'重新授权'
});
window
.
location
.
reload
()
window
.
location
.
reload
()
}
}
}
}
...
...
src/components/bindMobile.vue
View file @
2c25c92c
...
@@ -122,6 +122,8 @@
...
@@ -122,6 +122,8 @@
}
}
this
.
time
=
30
;
this
.
time
=
30
;
this
.
timeO
();
this
.
timeO
();
this
.
$sa
.
track
(
'clickSendcode'
,{});
sendMobileCodeApi
(
json
).
then
(
res
=>
{
sendMobileCodeApi
(
json
).
then
(
res
=>
{
if
(
res
===
'操作成功'
){
if
(
res
===
'操作成功'
){
Toast
(
'验证码已发送'
);
Toast
(
'验证码已发送'
);
...
@@ -143,6 +145,7 @@
...
@@ -143,6 +145,7 @@
}
}
},
},
bindMobile
(){
bindMobile
(){
this
.
$sa
.
track
(
'clickSignUp'
,{});
if
(
this
.
flag
){
if
(
this
.
flag
){
this
.
flag
=
false
;
this
.
flag
=
false
;
if
(
this
.
msgCode
===
''
||!
this
.
msgCode
)
{
if
(
this
.
msgCode
===
''
||!
this
.
msgCode
)
{
...
...
src/components/buy/index.vue
View file @
2c25c92c
...
@@ -388,6 +388,14 @@
...
@@ -388,6 +388,14 @@
});
});
}
}
this
.
$sa
.
track
(
'viewCourseDetail'
,{
courseID
:
this
.
groupDetail
.
id
,
courseCate
:
this
.
groupDetail
.
course_type
===
1
?
'体验课'
:
'正式课'
,
lessonNumber
:
this
.
groupDetail
.
watch_num
,
courseTitle
:
this
.
groupDetail
.
name
,
coursePrice
:
this
.
groupDetail
.
original_price
/
100
,
discountPrice
:
this
.
groupDetail
.
current_price
/
100
});
if
(
this
.
groupDetail
.
goods_type
===
2
){
if
(
this
.
groupDetail
.
goods_type
===
2
){
if
(
localStorage
.
getItem
(
'cc_token'
)){
if
(
localStorage
.
getItem
(
'cc_token'
)){
getStatusWechatApi
({
goods_id
:
this
.
shopId
}).
then
(
res
=>
{
getStatusWechatApi
({
goods_id
:
this
.
shopId
}).
then
(
res
=>
{
...
...
src/components/index.vue
View file @
2c25c92c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
class=
"banner-block"
>
<div
class=
"banner-block"
>
<swiper
:options=
"swiperOption"
class=
"banner"
ref=
"mySwiper"
>
<swiper
:options=
"swiperOption"
class=
"banner"
ref=
"mySwiper"
>
<swiper-slide
v-for=
"(data,index) in bannerList"
:key=
"index"
>
<swiper-slide
v-for=
"(data,index) in bannerList"
:key=
"index"
>
<img
class=
"banner"
:src=
"data.url+'?imageslim'"
@
click=
"toBannerUrl(data
.link
)"
>
<img
class=
"banner"
:src=
"data.url+'?imageslim'"
@
click=
"toBannerUrl(data)"
>
</swiper-slide>
</swiper-slide>
</swiper>
</swiper>
</div>
</div>
...
@@ -116,16 +116,39 @@
...
@@ -116,16 +116,39 @@
},
},
methods
:{
methods
:{
toOld
(
e
){
toOld
(
e
){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'首页'
,
moduleTitle
:
'功能按钮'
,
buttonType
:
'板块按钮'
,
buttonName
:
'晚安电台'
});
// this.$sa.quick('trackHeatMap',e.srcElement)
// this.$sa.quick('trackHeatMap',e.srcElement)
window
.
location
.
href
=
'https://appanqlfkth3717.h5.xiaoeknow.com/content_page/eyJ0eXBlIjozLCJyZXNvdXJjZV90eXBlIjoiIiwicmVzb3VyY2VfaWQiOiIiLCJwcm9kdWN0X2lkIjoicF81YjE0YjdjMjdjNDZiX2Rvd0xicDc1IiwiYXBwX2lkIjoiYXBwYU5RTGZrdEgzNzE3In0?state=2f12ab00cbc58f98cdc8193c8151437f_Sc7T3q'
window
.
location
.
href
=
'https://appanqlfkth3717.h5.xiaoeknow.com/content_page/eyJ0eXBlIjozLCJyZXNvdXJjZV90eXBlIjoiIiwicmVzb3VyY2VfaWQiOiIiLCJwcm9kdWN0X2lkIjoicF81YjE0YjdjMjdjNDZiX2Rvd0xicDc1IiwiYXBwX2lkIjoiYXBwYU5RTGZrdEgzNzE3In0?state=2f12ab00cbc58f98cdc8193c8151437f_Sc7T3q'
},
},
toBannerUrl
(
data
){
toBannerUrl
(
data
){
window
.
location
.
href
=
data
this
.
$sa
.
track
(
'adClick'
,{
adTitle
:
data
.
title
,
adID
:
data
.
link
,
adPage
:
'首页'
});
window
.
location
.
href
=
data
.
link
},
},
toHear
(){
toHear
(){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'首页'
,
moduleTitle
:
'功能按钮'
,
buttonType
:
'板块按钮'
,
buttonName
:
'磨耳朵'
});
this
.
$router
.
push
({
name
:
'collection'
})
this
.
$router
.
push
({
name
:
'collection'
})
},
},
toNewUrl
(){
toNewUrl
(){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'首页'
,
moduleTitle
:
'课程'
,
buttonType
:
'没课banner'
,
buttonName
:
'没有更多课程'
});
window
.
location
.
href
=
this
.
newUrl
window
.
location
.
href
=
this
.
newUrl
},
},
initPage
(){
initPage
(){
...
@@ -160,6 +183,12 @@
...
@@ -160,6 +183,12 @@
})
})
},
},
toGoodsList
(){
toGoodsList
(){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'首页'
,
moduleTitle
:
'课程'
,
buttonType
:
'板块按钮'
,
buttonName
:
'我的课程'
});
this
.
$router
.
push
({
name
:
'myGoodsList'
})
this
.
$router
.
push
({
name
:
'myGoodsList'
})
},
},
dateParse
(
dateString
){
dateParse
(
dateString
){
...
@@ -188,6 +217,12 @@
...
@@ -188,6 +217,12 @@
}
}
},
},
toMap
(
data
)
{
toMap
(
data
)
{
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'首页'
,
moduleTitle
:
'课程'
,
buttonType
:
'课程'
,
buttonName
:
'进入课程'
});
if
(
this
.
dateCompare
(
new
Date
(),
this
.
dateParse
(
data
.
start_at
))
<
1
){
if
(
this
.
dateCompare
(
new
Date
(),
this
.
dateParse
(
data
.
start_at
))
<
1
){
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'map'
,
name
:
'map'
,
...
...
src/components/map/index.vue
View file @
2c25c92c
...
@@ -317,6 +317,19 @@
...
@@ -317,6 +317,19 @@
},
},
// 切换主题
// 切换主题
changeCateGory
(
data
,
flag
){
changeCateGory
(
data
,
flag
){
// 神策埋点
this
.
$sa
.
track
(
'selectCategory'
,{
themeID
:
data
.
category_id
,
themeName
:
data
.
category_name
,
courseID
:
''
,
courseCate
:
this
.
$route
.
query
.
course_type
==
0
?
'正式课'
:
'体验课'
,
lessonNumber
:
''
,
courseTitle
:
''
,
periodID
:
''
,
periodName
:
''
,
teacherID
:
''
,
teacherName
:
''
});
if
(
!
flag
){
if
(
!
flag
){
this
.
parent_category_id
=
data
.
category_id
;
this
.
parent_category_id
=
data
.
category_id
;
this
.
$router
.
push
({
name
:
'map'
,
query
:{
periods_id
:
this
.
periods_id
,
course_type
:
this
.
shopType
,
parent_category_id
:
this
.
parent_category_id
}});
this
.
$router
.
push
({
name
:
'map'
,
query
:{
periods_id
:
this
.
periods_id
,
course_type
:
this
.
shopType
,
parent_category_id
:
this
.
parent_category_id
}});
...
...
src/components/mine.vue
View file @
2c25c92c
...
@@ -46,6 +46,12 @@
...
@@ -46,6 +46,12 @@
})
})
},
},
clearBoth
(){
clearBoth
(){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'我的'
,
moduleTitle
:
'我的'
,
buttonType
:
'清楚缓存'
,
buttonName
:
'清楚缓存'
});
localStorage
.
clear
();
localStorage
.
clear
();
Toast
(
'清除成功'
)
Toast
(
'清除成功'
)
...
...
src/components/myGoodsList.vue
View file @
2c25c92c
...
@@ -59,6 +59,12 @@
...
@@ -59,6 +59,12 @@
}
}
},
},
toMap
(
data
){
toMap
(
data
){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'课程列表'
,
moduleTitle
:
'课程'
,
buttonType
:
'课程'
,
buttonName
:
'进入课程'
});
if
(
this
.
dateCompare
(
new
Date
(),
this
.
dateParse
(
data
.
start_at
))
<
1
)
{
if
(
this
.
dateCompare
(
new
Date
(),
this
.
dateParse
(
data
.
start_at
))
<
1
)
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'map'
,
name
:
'map'
,
...
...
src/components/order.vue
View file @
2c25c92c
...
@@ -80,6 +80,12 @@
...
@@ -80,6 +80,12 @@
})
})
},
},
shareOrder
(
data
){
shareOrder
(
data
){
this
.
$sa
.
track
(
'buttonClick'
,{
tabTitle
:
'订单'
,
moduleTitle
:
'订单'
,
buttonType
:
'分享'
,
buttonName
:
'团购分享'
});
this
.
showShare
=
true
;
this
.
showShare
=
true
;
let
shareData
=
JSON
.
parse
(
data
.
share_desc
);
let
shareData
=
JSON
.
parse
(
data
.
share_desc
);
let
that
=
this
;
let
that
=
this
;
...
...
src/main.js
View file @
2c25c92c
...
@@ -6,20 +6,20 @@ import router from './router'
...
@@ -6,20 +6,20 @@ import router from './router'
import
store
from
'./store'
import
store
from
'./store'
import
MintUI
from
'mint-ui'
import
MintUI
from
'mint-ui'
import
VueClipboard
from
'vue-clipboard2'
import
VueClipboard
from
'vue-clipboard2'
//
import sa from'sa-sdk-javascript';
import
sa
from
'sa-sdk-javascript'
;
import
'mint-ui/lib/style.css'
import
'mint-ui/lib/style.css'
Vue
.
config
.
productionTip
=
false
;
Vue
.
config
.
productionTip
=
false
;
//
Vue.prototype.$sa = sa;
Vue
.
prototype
.
$sa
=
sa
;
//
Vue.prototype.$sa.init({
Vue
.
prototype
.
$sa
.
init
({
//
server_url: 'http://47.107.250.38:8106/sa?project=default', // 替换成自己的神策地址
server_url
:
'http://47.107.250.38:8106/sa?project=default'
,
// 替换成自己的神策地址
//
heatmap: {
heatmap
:
{
//
//是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
//是否开启点击图,默认 default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭
//
clickmap:'default',
clickmap
:
'default'
,
//
show_log: true, // 打印console,自己配置,可以看到自己是否踩点成功,以及
show_log
:
true
,
// 打印console,自己配置,可以看到自己是否踩点成功,以及
//
//是否开启触达注意力图,默认 default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭
//是否开启触达注意力图,默认 default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭
//
scroll_notice_map:'default',
scroll_notice_map
:
'default'
,
//
}
}
//
});
});
Vue
.
use
(
MintUI
);
Vue
.
use
(
MintUI
);
Vue
.
use
(
VueClipboard
);
Vue
.
use
(
VueClipboard
);
/* eslint-disable no-new */
/* eslint-disable no-new */
...
...
src/router/index.js
View file @
2c25c92c
...
@@ -5,6 +5,27 @@ import Router from 'vue-router'
...
@@ -5,6 +5,27 @@ import Router from 'vue-router'
import
sa
from
'sa-sdk-javascript'
;
import
sa
from
'sa-sdk-javascript'
;
Vue
.
use
(
Router
);
Vue
.
use
(
Router
);
let
browser
=
{
versions
:
function
()
{
let
u
=
navigator
.
userAgent
,
app
=
navigator
.
appVersion
;
return
{
//移动终端浏览器版本信息
trident
:
u
.
indexOf
(
'Trident'
)
>
-
1
,
//IE内核
presto
:
u
.
indexOf
(
'Presto'
)
>
-
1
,
//opera内核
webKit
:
u
.
indexOf
(
'AppleWebKit'
)
>
-
1
,
//苹果、谷歌内核
gecko
:
u
.
indexOf
(
'Gecko'
)
>
-
1
&&
u
.
indexOf
(
'KHTML'
)
===
-
1
,
//火狐内核
mobile
:
!!
u
.
match
(
/AppleWebKit.*Mobile.*/
),
//是否为移动终端
ios
:
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
),
//ios终端
android
:
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
,
//android终端或uc浏览器
iPhone
:
u
.
indexOf
(
'iPhone'
)
>
-
1
,
//是否为iPhone或者QQHD浏览器
iPad
:
u
.
indexOf
(
'iPad'
)
>
-
1
,
//是否iPad
webApp
:
u
.
indexOf
(
'Safari'
)
==
-
1
//是否web应该程序,没有头部与底部
};
}(),
language
:
(
navigator
.
browserLanguage
||
navigator
.
language
).
toLowerCase
()
};
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
const
router
=
new
Router
({
const
router
=
new
Router
({
routes
:
[
routes
:
[
{
{
...
@@ -162,47 +183,23 @@ const router =new Router({
...
@@ -162,47 +183,23 @@ const router =new Router({
});
});
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// Vue.nextTick(() => {
// 神策路由埋点
// sa.quick("autoTrackSinglePage");
Vue
.
nextTick
(()
=>
{
// });
sa
.
quick
(
"autoTrackSinglePage"
);
let
ua
=
window
.
navigator
.
userAgent
.
toLowerCase
();
});
// 判断是否是微信环境 排除本地
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
||
ua
.
match
(
/_SQ_/i
)
==
'_sq_'
){
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
||
ua
.
match
(
/_SQ_/i
)
==
'_sq_'
){
if
(
to
.
name
==
'noWechat'
){
if
(
to
.
name
==
'noWechat'
){
next
({
name
:
'index'
});
next
({
name
:
'index'
});
}
}
}
else
{
}
else
{
if
(
to
.
name
!==
'noWechat'
)
{
if
(
to
.
name
!==
'noWechat'
&&
process
.
env
.
NODE_ENV
===
'production'
)
{
next
({
name
:
'noWechat'
});
next
({
name
:
'noWechat'
});
}
}
}
}
let
browser
=
{
// 移动端判断
versions
:
function
()
{
let
u
=
navigator
.
userAgent
,
app
=
navigator
.
appVersion
;
return
{
//移动终端浏览器版本信息
trident
:
u
.
indexOf
(
'Trident'
)
>
-
1
,
//IE内核
presto
:
u
.
indexOf
(
'Presto'
)
>
-
1
,
//opera内核
webKit
:
u
.
indexOf
(
'AppleWebKit'
)
>
-
1
,
//苹果、谷歌内核
gecko
:
u
.
indexOf
(
'Gecko'
)
>
-
1
&&
u
.
indexOf
(
'KHTML'
)
===
-
1
,
//火狐内核
mobile
:
!!
u
.
match
(
/AppleWebKit.*Mobile.*/
),
//是否为移动终端
ios
:
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
),
//ios终端
android
:
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
,
//android终端或uc浏览器
iPhone
:
u
.
indexOf
(
'iPhone'
)
>
-
1
,
//是否为iPhone或者QQHD浏览器
iPad
:
u
.
indexOf
(
'iPad'
)
>
-
1
,
//是否iPad
webApp
:
u
.
indexOf
(
'Safari'
)
==
-
1
//是否web应该程序,没有头部与底部
};
}(),
language
:
(
navigator
.
browserLanguage
||
navigator
.
language
).
toLowerCase
()
};
if
(
browser
.
versions
.
mobile
)
{
//判断是否是移动设备打开。browser代码在下面
let
ua
=
navigator
.
userAgent
.
toLowerCase
();
//获取判断用的对象
if
(
ua
.
match
(
/MicroMessenger/i
)
==
"micromessenger"
)
{
}
else
{
}
}
store
.
dispatch
(
'isMobile'
,
browser
.
versions
.
mobile
);
store
.
dispatch
(
'isMobile'
,
browser
.
versions
.
mobile
);
// 默认title
document
.
title
=
'唱唱启蒙英语'
;
document
.
title
=
'唱唱启蒙英语'
;
let
goOn
=
function
(){
let
goOn
=
function
(){
if
(
localStorage
.
getItem
(
'retUrl'
)
&&
localStorage
.
getItem
(
'retUrl'
)
!==
null
&&
localStorage
.
getItem
(
'retUrl'
)
!==
''
){
if
(
localStorage
.
getItem
(
'retUrl'
)
&&
localStorage
.
getItem
(
'retUrl'
)
!==
null
&&
localStorage
.
getItem
(
'retUrl'
)
!==
''
){
...
...
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