🧶 添加百度统计

This commit is contained in:
Hunlongyu
2020-10-22 14:22:59 +08:00
parent 79b02df628
commit 49589102d9
10 changed files with 32 additions and 32 deletions

View File

@@ -69,24 +69,17 @@ export default {
set (val) {
this.SET_DETAIL(val)
}
},
editSites: {
get () {
return this.$store.getters.getEditSites
},
set (val) {
this.SET_EDITSITES(val)
}
}
},
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_EDITSITES']),
...mapMutations(['SET_VIEW', 'SET_DETAIL']),
changeView (e) {
this.view = e
// ChangeView 的时候关闭Detail页面
this.detail = {
show: false
}
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'page', 'view', e])
}
}
}

View File

@@ -329,6 +329,9 @@ export default {
this.loading = false
}
})
const _hmt = window._hmt
const name = this.detail.info.name
_hmt.push(['_trackEvent', 'detail', 'view', name])
}
},
created () {

View File

@@ -177,6 +177,8 @@ export default {
api: this.siteInfo.api,
download: this.siteInfo.download
}
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'site', 'add', `${this.siteInfo.name}: ${this.siteInfo.api}`])
if (this.dialogType === 'edit') sites.remove(this.siteInfo.id)
sites.add(doc).then(res => {
this.siteInfo = {

View File

@@ -213,6 +213,8 @@ export default {
}
})
}
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'site', 'change', e.name])
},
classClick (e) {
this.show.classList = false
@@ -223,6 +225,8 @@ export default {
this.infiniteId += 1
}
})
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'class', 'change', e.name])
},
getClass () {
return new Promise((resolve, reject) => {
@@ -402,6 +406,15 @@ export default {
this.searchList = res.reverse()
})
},
searchEvent (wd) {
if (this.setting.searchAllSites) {
this.searchAllSitesEvent(this.sites, wd)
} else {
this.searchSingleSiteEvent(this.site, wd)
}
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'film', 'search', wd])
},
searchAllSitesEvent (sites, wd) {
this.searchTxt = wd
this.searchContents = []
@@ -439,13 +452,6 @@ export default {
})
}
},
searchEvent (wd) {
if (this.setting.searchAllSites) {
this.searchAllSitesEvent(this.sites, wd)
} else {
this.searchSingleSiteEvent(this.site, wd)
}
},
searchSingleSiteEvent (site, wd) {
var sites = []
sites.push(this.site)

View File

@@ -302,6 +302,8 @@ export default {
this.playUrl(this.video.iptv.url)
this.name = this.video.iptv.name
this.getIptvList()
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'IPTV', 'play', this.name])
} else {
const index = this.video.info.index | 0
let time = 0
@@ -353,6 +355,8 @@ export default {
}
zy.detail(this.video.key, this.video.info.id).then(res => {
this.name = res.name
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'film', 'play', res.name])
const dd = res.dl.dd
const type = Object.prototype.toString.call(dd)
let m3u8Txt = []

View File

@@ -141,10 +141,11 @@
<script>
import { mapMutations } from 'vuex'
import pkg from '../../package.json'
import { setting, sites, shortcut, star } from '../lib/dexie'
import { setting, sites, shortcut } from '../lib/dexie'
import { sites as defaultSites } from '../lib/dexie/initData'
import { shell, clipboard, remote } from 'electron'
import db from '../lib/dexie/dexie'
const _hmt = window._hmt
export default {
name: 'setting',
data () {
@@ -152,7 +153,6 @@ export default {
pkg: pkg,
sitesList: [],
shortcutList: [],
favoritesList: [],
show: {
site: false,
shortcut: false,
@@ -243,11 +243,6 @@ export default {
this.shortcutList = res
})
},
getFavorites () {
star.all().then(res => {
this.favoritesList = res
})
},
changeView (e) {
this.d.view = e
this.updateSettingEvent()
@@ -315,6 +310,7 @@ export default {
changeTheme (e) {
this.d.theme = e
this.updateSettingEvent()
_hmt.push(['_trackEvent', 'setting', 'theme', e])
},
changeShortcut (e) {
this.d.shortcut = e
@@ -382,7 +378,6 @@ export default {
this.getSites()
this.getSetting()
this.getShortcut()
this.getFavorites()
this.getLatestVersion()
this.createContextMenu()
}

View File

@@ -69,6 +69,8 @@ export default {
const id = this.share.info.ids || this.share.info.id
zy.detail(this.share.key, id).then(res => {
if (res) {
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'film', 'share', res.name])
this.pic = res.pic
var m3u8List = {}
const dd = res.dl.dd

View File

@@ -1,6 +0,0 @@
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'video', 'play', '红楼梦'])
// _hmt.push(['_trackEvent', 'video', 'play', '三国演义'])
// _hmt.push(['_trackEvent', 'page', 'open', 'Film'])
// _hmt.push(['_trackEvent', 'page', 'open', 'IPTV'])
console.log(_hmt)

View File

@@ -4,7 +4,6 @@ import store from './store'
import 'modern-normalize'
import Register from './components/register'
import './lib/element/index'
import './lib/site/analytics'
Register.registerComponents()
Vue.config.productionTip = false

View File

@@ -395,6 +395,8 @@ export default {
this.xg = new Hls(this.config)
this.mtEvent()
this.getUrls()
const _hmt = window._hmt
_hmt.push(['_trackEvent', 'page', 'view', 'mini'])
},
beforeDestroy () {
clearInterval(this.timer)