mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-24 02:03:05 +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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { Image } from 'vant'
|
import { Image } from 'vant'
|
||||||
|
import { getShareKey, saveShareRecord } from '@/api/ebiz/manpower/manpower'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
[Image.name]: Image
|
[Image.name]: Image
|
||||||
@@ -65,10 +67,14 @@ export default {
|
|||||||
img10: require('../image/10.png'),
|
img10: require('../image/10.png'),
|
||||||
img11: require('../image/11.png'),
|
img11: require('../image/11.png'),
|
||||||
img12: require('../image/12.png'),
|
img12: require('../image/12.png'),
|
||||||
img13: require('../image/13.png')
|
img13: require('../image/13.png'),
|
||||||
|
redisKey: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.redisKey = this.$route.query.redisKey
|
||||||
|
if (this.redisKey) this.saveShareRecord('1')
|
||||||
|
else this.getShareKey()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 右上角的显示
|
// 右上角的显示
|
||||||
this.$jump({
|
this.$jump({
|
||||||
@@ -87,17 +93,44 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
appCallBack(data) {
|
appCallBack(data) {
|
||||||
if (data.trigger == 'right_button_click') {
|
if (data.trigger == 'right_button_click') {
|
||||||
|
this.saveShareRecord('0')
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
EWebBridge.webCallAppInJs('bridge', {
|
EWebBridge.webCallAppInJs('bridge', {
|
||||||
flag: 'share',
|
flag: 'share',
|
||||||
extra: {
|
extra: {
|
||||||
title: '国富人寿保险股份有限公司',
|
title: '国富人寿保险股份有限公司',
|
||||||
content: '公司介绍',
|
content: '公司介绍',
|
||||||
url: '',
|
url: `${location.origin}/#/manpower/increaseStaffTools/CompanyIntroduction?redisKey=${this.redisKey}`,
|
||||||
img: ''
|
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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getShareKey, saveShareRecord } from '@/api/ebiz/manpower/manpower'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// src: 'http://47.96.143.111/pdfjs/web/viewer.html?file=http://47.96.143.111:8000/app/images/jsSDK.pdf'
|
// src: 'http://47.96.143.111/pdfjs/web/viewer.html?file=http://47.96.143.111:8000/app/images/jsSDK.pdf'
|
||||||
pdfUrl: '',
|
pdfUrl: '',
|
||||||
src: location.origin + '/pdfjs/web/viewer.html?file=',
|
src: location.origin + '/pdfjs/web/viewer.html?file=',
|
||||||
shareContent: ''
|
shareContent: '',
|
||||||
|
redisKey: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -32,6 +35,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
|
this.redisKey = this.$route.query.redisKey
|
||||||
|
if (this.redisKey) this.saveShareRecord('1')
|
||||||
|
else this.getShareKey()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
@@ -50,17 +56,44 @@ export default {
|
|||||||
// 原生点击右上角按钮事件
|
// 原生点击右上角按钮事件
|
||||||
appCallBack(data) {
|
appCallBack(data) {
|
||||||
if (data.trigger == 'right_button_click') {
|
if (data.trigger == 'right_button_click') {
|
||||||
|
this.saveShareRecord('0')
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
EWebBridge.webCallAppInJs('bridge', {
|
EWebBridge.webCallAppInJs('bridge', {
|
||||||
flag: 'share',
|
flag: 'share',
|
||||||
extra: {
|
extra: {
|
||||||
title: '国富人寿欢迎您!',
|
title: '国富人寿欢迎您!',
|
||||||
content: this.shareContent,
|
content: this.shareContent,
|
||||||
url: '',
|
url: `${location.origin}/pdfjs/web/viewer.html?file=${this.pdfUrl}&redisKey=${this.redisKey}`,
|
||||||
img: ''
|
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