Commit 175837c5 by xinla

修改移动端sop和老客拉群问题

1 parent 5f37b2a9
...@@ -118,9 +118,9 @@ export default { ...@@ -118,9 +118,9 @@ export default {
}) })
let mes = { let mes = {
title: this.task.title, title: this.task.title,
desc: this.task.content desc: this.task.content,
// link: '', // 消息链接 link: (this.task.materialList && this.task.materialList[0] && this.task.materialList[0].materialUrl) || ' ' // 消息链接
// imgUrl: this.task.materialUrl && this.task.materialUrl[0] ? this.task.materialUrl[0].materialUrl : '' // imgUrl: this.task.materialList && this.task.materialList[0] && this.task.materialList[0].materialUrl
} }
// mes.link || delete mes.link // mes.link || delete mes.link
// mes.imgUrl || delete mes.imgUrl // mes.imgUrl || delete mes.imgUrl
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="task-wrapper"> <div class="task-wrapper">
<div class="header"> <div class="header">
<span> 老客标签建群 </span> <span> 老客标签建群 </span>
<div> {{ task.createTime }} </div> <div>{{ task.createTime }}</div>
</div> </div>
<div class="guide" v-if="task.welcomeMsg"> <div class="guide" v-if="task.welcomeMsg">
...@@ -66,17 +66,17 @@ export default { ...@@ -66,17 +66,17 @@ export default {
} }
}, },
data () { data() {
return { return {
showCopy: false, // 展示复制按钮 showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常 touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null, copyEvent: null,
touch: false, touch: false
} }
}, },
methods: { methods: {
goState (active) { goState(active) {
if (!this.isAdmin) return if (!this.isAdmin) return
this.$router.push({ this.$router.push({
...@@ -84,24 +84,29 @@ export default { ...@@ -84,24 +84,29 @@ export default {
query: { query: {
taskId: this.task.taskId, taskId: this.task.taskId,
active: active === 1 ? 1 : 0, active: active === 1 ? 1 : 0,
taskType: 1, taskType: 1
} }
}) })
}, },
send () { send() {
const userId = this.$store.state.userId const userId = this.$store.state.userId
const taskId = this.task.taskId const taskId = this.task.taskId
wx.invoke("shareToExternalContact", { wx.invoke(
title: '客户群活码', 'shareToExternalContact',
desc: '', {
title: this.task.taskName,
desc: this.task.welcomeMsg,
link: this.groupCodeUrl, link: this.groupCodeUrl,
imgUrl: '' imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl
}, function(res) { },
if (res.err_msg == "shareToExternalContact:ok") { function(res) {
changeStatus(userId, taskId, 0).then((res) => { if (res.err_msg == 'shareToExternalContact:ok') {
changeStatus(userId, taskId, 0)
.then((res) => {
this.$emit('refresh') this.$emit('refresh')
}).catch(() => { })
.catch(() => {
this.$emit('refresh') this.$emit('refresh')
}) })
} else { } else {
...@@ -110,15 +115,15 @@ export default { ...@@ -110,15 +115,15 @@ 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
...@@ -126,7 +131,7 @@ export default { ...@@ -126,7 +131,7 @@ export default {
}, },
computed: { computed: {
todoMembers () { todoMembers() {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return [] if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return []
const members = [] const members = []
...@@ -137,16 +142,16 @@ export default { ...@@ -137,16 +142,16 @@ export default {
return members return members
}, },
showTodo () { showTodo() {
if (this.todoMembers.length === 0) return '无' if (this.todoMembers.length === 0) return '无'
const names = this.todoMembers.map(m => m.name) const names = this.todoMembers.map((m) => m.name)
if (this.todoMembers.length <= 2) return names.join('、') if (this.todoMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.todoMembers.length + '人' return names[0] + '、' + names[1] + '等' + this.todoMembers.length + '人'
}, },
doneMembers () { doneMembers() {
if (!this.task || !this.task.scopeList || this.task.scopeList.length === 0) return [] if (!this.task || !this.task.scopeList || this.task.scopeList.length === 0) return []
const members = [] const members = []
...@@ -157,33 +162,36 @@ export default { ...@@ -157,33 +162,36 @@ export default {
return members return members
}, },
showDone () { showDone() {
if (this.doneMembers.length === 0) return '无' if (this.doneMembers.length === 0) return '无'
const names = this.doneMembers.map(m => m.name) const names = this.doneMembers.map((m) => m.name)
if (this.doneMembers.length <= 2) return names.join('、') if (this.doneMembers.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人' return names[0] + '、' + names[1] + '等' + this.doneMembers.length + '人'
}, },
showMembers () { showMembers() {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return '无' if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return '无'
if (this.task.scopeList.length === 0) return '无' if (this.task.scopeList.length === 0) return '无'
const names = this.task.scopeList.map(m => m.name) const names = this.task.scopeList.map((m) => m.name)
if (this.task.scopeList.length <= 2) return names.join('、') if (this.task.scopeList.length <= 2) return names.join('、')
return names[0] + '、' + names[1] + '等' + this.task.scopeList.length + '人' return names[0] + '、' + names[1] + '等' + this.task.scopeList.length + '人'
}, },
groupCodeUrl () { groupCodeUrl() {
let groupCodeInfo = this.task.groupCodeInfo
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=' + (groupCodeInfo && groupCodeInfo.id)
)
} }
return window.location.origin + window.location.pathname + 'groupCode?id=' + this.task.groupCodeInfo.uuid return window.location.origin + window.location.pathname + 'groupCode?id=' + (groupCodeInfo && groupCodeInfo.id)
} }
}, },
...@@ -197,13 +205,12 @@ export default { ...@@ -197,13 +205,12 @@ export default {
this.clipboard.on('error', (e) => { this.clipboard.on('error', (e) => {
this.showCopy = false this.showCopy = false
}) })
}, }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.task-wrapper { .task-wrapper {
padding: 10px 8px; padding: 10px 8px;
.header { .header {
...@@ -274,10 +281,10 @@ export default { ...@@ -274,10 +281,10 @@ export default {
font-size: 12px; font-size: 12px;
} }
} }
} }
.bottom-line { .bottom-line {
background-color: #f2f2f2; background-color: #f2f2f2;
height: 15px; height: 15px;
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!