Commit 05c82f36 by unknown

关键词拉群消息发送修改

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