Commit 175837c5 by xinla

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

1 parent 5f37b2a9
......@@ -118,9 +118,9 @@ export default {
})
let mes = {
title: this.task.title,
desc: this.task.content
// link: '', // 消息链接
// imgUrl: this.task.materialUrl && this.task.materialUrl[0] ? this.task.materialUrl[0].materialUrl : ''
desc: this.task.content,
link: (this.task.materialList && this.task.materialList[0] && this.task.materialList[0].materialUrl) || ' ' // 消息链接
// imgUrl: this.task.materialList && this.task.materialList[0] && this.task.materialList[0].materialUrl
}
// mes.link || delete mes.link
// mes.imgUrl || delete mes.imgUrl
......
......@@ -3,7 +3,7 @@
<div class="task-wrapper">
<div class="header">
<span> 老客标签建群 </span>
<div> {{ task.createTime }} </div>
<div>{{ task.createTime }}</div>
</div>
<div class="guide" v-if="task.welcomeMsg">
......@@ -66,17 +66,17 @@ export default {
}
},
data () {
data() {
return {
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
showCopy: false, // 展示复制按钮
touchDelay: 750, // 触发显示按钮的长按时常
copyEvent: null,
touch: false,
touch: false
}
},
methods: {
goState (active) {
goState(active) {
if (!this.isAdmin) return
this.$router.push({
......@@ -84,41 +84,46 @@ export default {
query: {
taskId: this.task.taskId,
active: active === 1 ? 1 : 0,
taskType: 1,
taskType: 1
}
})
},
send () {
send() {
const userId = this.$store.state.userId
const taskId = this.task.taskId
wx.invoke("shareToExternalContact", {
title: '客户群活码',
desc: '',
wx.invoke(
'shareToExternalContact',
{
title: this.task.taskName,
desc: this.task.welcomeMsg,
link: this.groupCodeUrl,
imgUrl: ''
}, function(res) {
if (res.err_msg == "shareToExternalContact:ok") {
changeStatus(userId, taskId, 0).then((res) => {
this.$emit('refresh')
}).catch(() => {
this.$emit('refresh')
})
imgUrl: this.task.groupCodeInfo && this.task.groupCodeInfo.codeUrl
},
function(res) {
if (res.err_msg == 'shareToExternalContact:ok') {
changeStatus(userId, taskId, 0)
.then((res) => {
this.$emit('refresh')
})
.catch(() => {
this.$emit('refresh')
})
} else {
}
}
)
},
touchStart () {
    clearTimeout(this.copyEvent)
touchStart() {
clearTimeout(this.copyEvent)
    this.copyEvent = setTimeout(() => {
        this.touch = true
    }, this.touchDelay)
this.copyEvent = setTimeout(() => {
this.touch = true
}, this.touchDelay)
},
touchEnd () {
touchEnd() {
clearTimeout(this.copyEvent)
if (this.touch) this.showCopy = true
this.touch = false
......@@ -126,7 +131,7 @@ export default {
},
computed: {
todoMembers () {
todoMembers() {
if (!(this.task && this.task.scopeList && this.task.scopeList.length > 0)) return []
const members = []
......@@ -137,16 +142,16 @@ export default {
return members
},
showTodo () {
showTodo() {
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('、')
return names[0] + '、' + names[1] + '等' + this.todoMembers.length + '人'
},
doneMembers () {
doneMembers() {
if (!this.task || !this.task.scopeList || this.task.scopeList.length === 0) return []
const members = []
......@@ -157,33 +162,36 @@ export default {
return members
},
showDone () {
showDone() {
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('、')
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.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('、')
return names[0] + '、' + names[1] + '等' + this.task.scopeList.length + '人'
},
groupCodeUrl () {
groupCodeUrl() {
let groupCodeInfo = this.task.groupCodeInfo
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 {
this.clipboard.on('error', (e) => {
this.showCopy = false
})
},
}
}
</script>
<style lang="less" scoped>
.task-wrapper {
padding: 10px 8px;
.task-wrapper {
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;
justify-content: space-between;
align-items: center;
margin: 5px 0 12px;
span {
font-size: 18px;
font-weight: bold;
}
justify-content: space-around;
}
}
.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;
align-items: center;
justify-content: space-around;
}
}
.content {
padding: 10px;
background-color: #f2f2f2;
display: flex;
.content {
padding: 10px;
background-color: #f2f2f2;
.group {
padding: 0 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
.group {
padding: 0 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
.group-name {
color: #999999;
}
.group-name {
color: #999999;
}
}
}
.van-cell {
padding: 10px 6px;
}
.van-cell {
padding: 10px 6px;
}
.send-button {
padding: 10px 5px 5px;
display: flex;
flex-direction: row-reverse;
.send-button {
padding: 10px 5px 5px;
display: flex;
flex-direction: row-reverse;
.van-button {
padding: 0 12px;
margin-right: 12px;
border-radius: 4px;
font-size: 12px;
}
.van-button {
padding: 0 12px;
margin-right: 12px;
border-radius: 4px;
font-size: 12px;
}
}
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
.bottom-line {
background-color: #f2f2f2;
height: 15px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!