mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-25 01:22:53 +08:00
feature: 开门红方案
1. 分享图片使用图片url 2. 拦截原生按钮, 关闭图片时不返回上级
This commit is contained in:
@@ -44,8 +44,38 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getSchemePics()
|
||||
this.interceptAppBtn()
|
||||
},
|
||||
methods: {
|
||||
interceptAppBtn() {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
intercept: '1'
|
||||
})
|
||||
}, 100)
|
||||
window.appCallBack = this.appCallBack
|
||||
},
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'left_button_click') {
|
||||
if (!this.isPrevShow) {
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
title: '开门红专区',
|
||||
forbidSwipeBack: 1,
|
||||
url: location.origin + `/#/goodStart/prefecture`
|
||||
},
|
||||
routerInfo: {
|
||||
path: `/goodStart/prefecture`,
|
||||
type: '1'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isPrevShow = false
|
||||
}
|
||||
}
|
||||
},
|
||||
onPageChange(page) {
|
||||
this.currentPage = page
|
||||
},
|
||||
@@ -63,16 +93,13 @@ export default {
|
||||
this.images = [this.$assetsUrl + pic.picUrl]
|
||||
},
|
||||
shareImg() {
|
||||
this.toDataURL(this.images[0], function(base64) {
|
||||
const img = base64
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
shareType: '1',
|
||||
img
|
||||
}
|
||||
})
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
shareType: '1',
|
||||
img: this.images[0]
|
||||
}
|
||||
})
|
||||
},
|
||||
toDataURL(url, callback) {
|
||||
|
||||
@@ -33,8 +33,25 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.changeNavigator()
|
||||
this.interceptAppBtn()
|
||||
},
|
||||
methods: {
|
||||
interceptAppBtn() {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
intercept: '1'
|
||||
})
|
||||
}, 100)
|
||||
window.appCallBack = this.appCallBack
|
||||
},
|
||||
appCallBack(data) {
|
||||
if (data.trigger == 'left_button_click') {
|
||||
this.$jump({
|
||||
flag: 'home'
|
||||
})
|
||||
}
|
||||
},
|
||||
changeNavigator() {
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
|
||||
Reference in New Issue
Block a user