Commit 05c82f36 by unknown

关键词拉群消息发送修改

1 parent e8591dbd
......@@ -30,8 +30,16 @@ export default {
this.agentId = query.agentId
// this.$toast('agentId:' + this.agentId)
this.$router.onReady(() => {
const noAuth = this.$router.app.$route.meta ? this.$router.app.$route.meta.noAuth : false
if (!code && !noAuth) {
this.$toast('未获得授权')
}
})
if (!code) {
this.$toast('未获得授权')
// this.$toast('未获得授权')
return
}
let { data } = await getUserInfo(code, this.agentId)
......@@ -80,10 +88,11 @@ export default {
], //必填
success: (res) => {
// 回调
// this.$toast('agentId成功:')
this.$toast('agentId成功:')
this.$store.state.agentConfigStatus = true
},
fail: (res) => {
console.log('agent config 失败: ', res)
this.$toast('agentId失败:' + JSON.stringify(res))
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
......
......@@ -21,7 +21,7 @@
</div>
<div class="content">
<div>
<div v-if="task.groupCodeInfo && task.groupCodeInfo.codeUrl">
<van-image width="50" :src="task.groupCodeInfo.codeUrl"></van-image>
</div>
......@@ -46,15 +46,13 @@ import ClipboardJS from 'clipboard'
export default {
name: 'KeywordPanel',
props: {
task: {
type: Object,
required: true
},
},
data () {
data() {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
......@@ -62,17 +60,16 @@ export default {
touch: false,
}
},
methods: {
send () {
send() {
wx.invoke("sendChatMessage", {
msgtype: 'news',
news: {
link: this.groupCodeUrl,
title: '客户群活码',
desc: '',
imgUrl: '',
}
desc: '客户群活码',
imgUrl: this.imgUrl,
},
}, function(res) {
if (res.err_msg == "sendChatMessage:ok") {
} else {
......@@ -80,38 +77,37 @@ export default {
}
)
},
touchStart () {
touchStart() {
    clearTimeout(this.copyEvent)
    this.copyEvent = setTimeout(() => {
        this.touch = true
    }, this.touchDelay)
},
touchEnd () {
touchEnd() {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
}
},
computed: {
keywords () {
keywords() {
if (!this.task || !this.task.keywordList) return []
const keywords = this.task.keywordList.map((k) => k.keyword)
return keywords
},
groupCodeUrl () {
groupCodeUrl() {
if (window.location.hash[0] === '#') {
return window.location.origin + window.location.pathname + '#/groupCode?id=' + this.task.groupCodeInfo.uuid
return window.location.origin + window.location.pathname + '#/groupCode?id=' + this.task.groupCodeInfo.id
}
return window.location.origin + window.location.pathname + 'groupCode?id=' + this.task.groupCodeInfo.uuid
return window.location.origin + window.location.pathname + 'groupCode?id=' + this.task.groupCodeInfo.id
},
imgUrl() {
if (this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl) return this.task.groupCodeInfo.codeUrl
return ''
}
},
mounted() {
this.clipboard = new ClipboardJS('.copy-btn_' + this.task.taskId)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!