mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-23 23:42:52 +08:00
添加埋点
This commit is contained in:
@@ -88,3 +88,21 @@ export function getTokenForUserModel(data = {}) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 新增分享记录
|
||||
export function saveShareRecord(data) {
|
||||
return request({
|
||||
url: getUrl('/agent/share/saveRecord', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取分享记录的key
|
||||
export function getShareKey(data) {
|
||||
return request({
|
||||
url: getUrl('/agent/share/getKey', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
</template>
|
||||
<script>
|
||||
import { Image } from 'vant'
|
||||
import { getShareKey, saveShareRecord } from '@/api/ebiz/manpower/manpower'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Image.name]: Image
|
||||
@@ -65,10 +67,14 @@ export default {
|
||||
img10: require('../image/10.png'),
|
||||
img11: require('../image/11.png'),
|
||||
img12: require('../image/12.png'),
|
||||
img13: require('../image/13.png')
|
||||
img13: require('../image/13.png'),
|
||||
redisKey: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.redisKey = this.$route.query.redisKey
|
||||
if (this.redisKey) this.saveShareRecord('1')
|
||||
else this.getShareKey()
|
||||
setTimeout(() => {
|
||||
// 右上角的显示
|
||||
this.$jump({
|
||||
@@ -87,17 +93,44 @@ export default {
|
||||
methods: {
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'right_button_click') {
|
||||
this.saveShareRecord('0')
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
title: '国富人寿保险股份有限公司',
|
||||
content: '公司介绍',
|
||||
url: '',
|
||||
img: ''
|
||||
url: `${location.origin}/#/manpower/increaseStaffTools/CompanyIntroduction?redisKey=${this.redisKey}`,
|
||||
img: this.$assetsUrl + 'images/logo.png'
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getShareKey() {
|
||||
let data = {
|
||||
linkType: '0001',
|
||||
url: `${location.origin}/#/manpower/increaseStaffTools/CompanyIntroduction`
|
||||
}
|
||||
getShareKey(data)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.result == 0) {
|
||||
this.redisKey = res.content
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
saveShareRecord(flag) {
|
||||
let data = {
|
||||
linkType: '0001',
|
||||
flag: flag,
|
||||
redisKey: this.redisKey
|
||||
}
|
||||
saveShareRecord(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getShareKey, saveShareRecord } from '@/api/ebiz/manpower/manpower'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// src: 'http://47.96.143.111/pdfjs/web/viewer.html?file=http://47.96.143.111:8000/app/images/jsSDK.pdf'
|
||||
pdfUrl: '',
|
||||
src: location.origin + '/pdfjs/web/viewer.html?file=',
|
||||
shareContent: ''
|
||||
shareContent: '',
|
||||
redisKey: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -32,6 +35,9 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
this.redisKey = this.$route.query.redisKey
|
||||
if (this.redisKey) this.saveShareRecord('1')
|
||||
else this.getShareKey()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
@@ -50,17 +56,44 @@ export default {
|
||||
// 原生点击右上角按钮事件
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'right_button_click') {
|
||||
this.saveShareRecord('0')
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
title: '国富人寿欢迎您!',
|
||||
content: this.shareContent,
|
||||
url: '',
|
||||
img: ''
|
||||
url: `${location.origin}/pdfjs/web/viewer.html?file=${this.pdfUrl}&redisKey=${this.redisKey}`,
|
||||
img: this.$assetsUrl + 'images/logo.png'
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getShareKey() {
|
||||
let data = {
|
||||
linkType: '0002',
|
||||
url: `${location.origin}/pdfjs/web/viewer.html?file=${this.pdfUrl}`
|
||||
}
|
||||
getShareKey(data)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
if (res.result == 0) {
|
||||
this.redisKey = res.content
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
saveShareRecord(flag) {
|
||||
let data = {
|
||||
linkType: '0002',
|
||||
flag: flag,
|
||||
redisKey: this.redisKey
|
||||
}
|
||||
saveShareRecord(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user