This commit is contained in:
yanran200730
2022-07-28 17:45:03 +08:00
parent 11b4bf2683
commit f4f29ff5b2

View File

@@ -28,7 +28,7 @@
</template> </template>
<script> <script>
import {mapActions} from 'vuex' import {mapActions, mapState} from 'vuex'
import qs from "query-string" import qs from "query-string"
export default { export default {
@@ -37,13 +37,27 @@ export default {
computed: { computed: {
params() { params() {
return qs.parse(decodeURIComponent(location.search)) return qs.parse(decodeURIComponent(location.search))
}
}, },
mounted() { ...mapState(['wxwork'])
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact']) },
computed: {
defaultValue () {
if (!this.albumList.length) {
return [0]
}
return [this.albumList.map(v => v.value).indexOf(this.albumId)]
},
currWatermarkConfig () {
if (this.currIndex < 0 || !this.watermarkList.length) return []
return this.watermarkList[this.currIndex].itemList
},
}, },
methods: { methods: {
...mapActions(['injectJWeixin', 'wxInvoke']), ...mapActions(['injectJWeixin', 'wxInvoke', 'agentSign']),
copy() { copy() {
let oInput = document.createElement('input') let oInput = document.createElement('input')
oInput.value = this.params.linkUrl oInput.value = this.params.linkUrl
@@ -54,6 +68,9 @@ export default {
oInput.remove() oInput.remove()
}, },
share() { share() {
this.agentSign({
corpId: this.wxwork.config.corpId
}).then(() => {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => { this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareAppMessage', { this.wxInvoke(['shareAppMessage', {
title: this.params.title, title: this.params.title,
@@ -62,8 +79,12 @@ export default {
imgUrl: this.params.headPicture imgUrl: this.params.headPicture
}]) }])
}) })
})
}, },
shareWechat() { shareWechat() {
this.agentSign({
corpId: this.wxwork.config.corpId
}).then(() => {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => { this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareWechatMessage', { this.wxInvoke(['shareWechatMessage', {
title: this.params.title, title: this.params.title,
@@ -72,6 +93,7 @@ export default {
imgUrl: this.params.headPicture imgUrl: this.params.headPicture
}]) }])
}) })
})
}, },
confirm() { confirm() {
uni.navigateBack({ uni.navigateBack({