[NEW] 微信分享功能

This commit is contained in:
li.kai
2020-07-07 11:56:46 +08:00
parent 3174db9656
commit 6151baf37d
2 changed files with 42 additions and 4 deletions

View File

@@ -1,10 +1,10 @@
const getComponent = filename => () => import(`@/views/ebiz/questions/${filename}.vue`)
const g = filename => () => import(`@/views/ebiz/questions/${filename}.vue`)
export default [
{
path: '/questions/list',
name: 'QuestionsList',
component: getComponent('QuestionsList'),
component: g('QuestionsList'),
meta: {
title: '电投问题件',
index: 1
@@ -13,7 +13,7 @@ export default [
{
path: '/questions/detail',
name: 'QuestionsDetail',
component: getComponent('QuestionsDetail'),
component: g('QuestionsDetail'),
meta: {
title: '问题处理',
index: 1
@@ -22,7 +22,7 @@ export default [
{
path: '/questions/result',
name: 'result',
component: getComponent('Result'),
component: g('Result'),
meta: {
title: '提交结果',
index: 1

View File

@@ -82,6 +82,7 @@
<script>
import { Uploader, Checkbox, Field, Radio, RadioGroup } from 'vant'
import ShortMessage from '@/components/ebiz/question/ShortMessage.vue'
import shareIcon from '@/assets/images/share@3x.png'
export default {
name: 'QuestionsDetail',
components: {
@@ -115,6 +116,40 @@ export default {
}
},
methods: {
async setTopRightBtn() {
console.log('000')
// eslint-disable-next-line
await EWebBridge.webCallAppInJs('webview_right_button', {
btns: [
{
img: shareIcon,
title: '按钮文案'
}
]
}).catch(err => {
console.log(err)
})
this.shareConfig()
},
shareConfig() {
console.log(11111)
window.appCallBack = async data => {
console.log(222)
if (data === 'right_button_click') {
console.log(3333)
// eslint-disable-next-line
await EWebBridge.webCallAppInJs('bridge',{
flag: 'share',
extra: {
title: '测测试试',
content: '测试测试',
img: '',
url: window.location.href
}
})
}
}
},
modeChange(mode) {
if (mode > 1) {
this.$dialog.alert({
@@ -132,6 +167,9 @@ export default {
this.showMessage = true
},
getMessage() {}
},
async created() {
await this.setTopRightBtn()
}
}
</script>