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,41 +84,46 @@ export default { ...@@ -84,41 +84,46 @@ 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') {
this.$emit('refresh') changeStatus(userId, taskId, 0)
}).catch(() => { .then((res) => {
this.$emit('refresh') this.$emit('refresh')
}) })
.catch(() => {
this.$emit('refresh')
})
} else { } else {
} }
} }
) )
}, },
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,87 +205,86 @@ export default { ...@@ -197,87 +205,86 @@ 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 {
display: flex;
justify-content: space-between;
align-items: center;
margin: 5px 0 12px;
span {
font-size: 18px;
font-weight: bold;
}
}
.header { .guide {
padding: 15px;
background-color: #f2f2f2;
font-size: 16px;
line-height: 20px;
color: #999999;
margin-bottom: 15px;
min-height: 30px;
position: relative;
.copy-wrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.4);
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
margin: 5px 0 12px; justify-content: space-around;
span {
font-size: 18px;
font-weight: bold;
}
} }
}
.guide { .content {
padding: 15px; padding: 10px;
background-color: #f2f2f2; background-color: #f2f2f2;
font-size: 16px; display: flex;
line-height: 20px;
color: #999999;
margin-bottom: 15px;
min-height: 30px;
position: relative;
.copy-wrapper {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: space-around;
}
}
.content { .group {
padding: 10px; padding: 0 10px;
background-color: #f2f2f2;
display: flex; display: flex;
flex-direction: column;
justify-content: space-between;
.group { .group-name {
padding: 0 10px; color: #999999;
display: flex;
flex-direction: column;
justify-content: space-between;
.group-name {
color: #999999;
}
} }
} }
}
.van-cell { .van-cell {
padding: 10px 6px; padding: 10px 6px;
} }
.send-button { .send-button {
padding: 10px 5px 5px; padding: 10px 5px 5px;
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
.van-button { .van-button {
padding: 0 12px; padding: 0 12px;
margin-right: 12px; margin-right: 12px;
border-radius: 4px; border-radius: 4px;
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!