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>
<script>
import {mapActions} from 'vuex'
import {mapActions, mapState} from 'vuex'
import qs from "query-string"
export default {
@@ -37,13 +37,27 @@ export default {
computed: {
params() {
return qs.parse(decodeURIComponent(location.search))
}
},
mounted() {
this.injectJWeixin(['sendChatMessage', 'selectEnterpriseContact'])
...mapState(['wxwork'])
},
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: {
...mapActions(['injectJWeixin', 'wxInvoke']),
...mapActions(['injectJWeixin', 'wxInvoke', 'agentSign']),
copy() {
let oInput = document.createElement('input')
oInput.value = this.params.linkUrl
@@ -54,6 +68,9 @@ export default {
oInput.remove()
},
share() {
this.agentSign({
corpId: this.wxwork.config.corpId
}).then(() => {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareAppMessage', {
title: this.params.title,
@@ -62,8 +79,12 @@ export default {
imgUrl: this.params.headPicture
}])
})
})
},
shareWechat() {
this.agentSign({
corpId: this.wxwork.config.corpId
}).then(() => {
this.injectJWeixin(['shareAppMessage', 'shareWechatMessage']).then(() => {
this.wxInvoke(['shareWechatMessage', {
title: this.params.title,
@@ -72,6 +93,7 @@ export default {
imgUrl: this.params.headPicture
}])
})
})
},
confirm() {
uni.navigateBack({