TaskDetails.vue
5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<template>
<div>
<div class='taskDetails' v-for='(item, index) in taskDetails' :key='index'>
<div class='leftContent'>
<p>{{ item.missonTypeName }}</p>
<p>{{ item.missionName }}</p>
<p>{{ item.missonDesc }}</p>
<template
v-if='
item.platformMerchantMissionMaterialResponseList &&
item.platformMerchantMissionMaterialResponseList.length
'
>
<div
v-for='(
sub, idx
) in item.platformMerchantMissionMaterialResponseList'
:key='idx'
>
<template v-if="sub.materialType == '1'">
<p v-html='tramWord(sub.materialContent)'></p>
</template>
<template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent' />
</template>
<template v-if="sub.materialType == '3'">
<video
class='displayImg'
controls='controls'
:src='sub.materialContent'
/>
</template>
<template v-if="sub.materialType == '4'">
<p class='content'>{{ sub.materialContent }}</p>
</template>
</div>
</template>
<div class='taskAward'>
<div class='showInfoForm'>
<span v-if='item.autoReminderFlag'
>自动提醒:{{
item.autoReminderFlag && item.autoReminderFlag == 1
? '无提醒'
: '自动提醒'
}}</span
>
<span v-if='item.autoReminderFlag && item.autoReminderFlag != 1'
>提醒时间:{{ item.autoReminderTime }}</span
><span v-if='item.autoReminderFlag && item.autoReminderFlag != 1'
>企微机器人:{{ item.enterMicroRobotName }}</span
><span v-if='item.autoReminderFlag && item.autoReminderFlag != 1'
>目标群聊:{{ item.groupChatName }}</span
>
<span v-if='item.rewardTypeName'
>奖励模式:{{ item.rewardTypeName }}</span
>
<span v-if='item.rewardCountName'
>奖励次数:{{ item.rewardCountName }}</span
>
<span v-if="item.rewardCountName == '重复累计'">
重复次数:{{
item.repeatCount == '-1' ? '无限制' : item.repeatCount
}}
</span>
<span v-if='item.sharingMethod'
>分享模式:{{
item.sharingMethod == '1'
? '微信群发'
: item.sharingMethod == '2'
? '分享好友'
: item.sharingMethod == '3'
? '分享朋友圈'
: ''
}}</span
>
<span v-if='item.triggerValue'
>触发值:{{ item.triggerValue }}</span
>
<span v-if='item.rewardScore'
>奖励积分值:{{ item.rewardScore }}</span
>
<span v-if='item.scorePercentage'
>奖励积分值:{{ item.scorePercentage }}%</span
>
<span v-if='item.minTriggerValue'
>最低指标:{{ item.minTriggerValue }}</span
>
<span v-if='item.textType'
>页面风格:{{
item.textType == '1'
? '软文模式'
: item.textType == '2'
? '营销模式'
: ''
}}</span
>
<span v-if="item.textType == '1'">
文章素材:
<div v-html='tramWord(item.textContent)'></div>
</span>
</div>
</div>
</div>
<div
v-if="item.missonType != '1'"
class='copyLine'
id='copy'
v-on:click='copy(item.id)'
>
复制任务提醒链接
</div>
</div>
</div>
</template>
<script>
import { taskManagementApi } from '@/api/taskManagement'
import emoji from '@/utils/emo'
export default {
name: 'TaskDetails',
props: {
taskDetails: {
type: Array,
default: []
}
},
data() {
return {}
},
methods: {
tramWord(val) {
let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src='https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png'>`
}
)
return htm
},
async copy(id) {
await taskManagementApi
.getStaffMissionLink({ missionId: id })
.then((res) => {
if (res.code == '0' && res.data) {
var input = document.createElement('input')
input.value = res.data
document.body.appendChild(input)
input.select()
document.execCommand('copy')
this.$message.success('复制成功!')
document.body.removeChild(input)
} else {
this.$message.error('复制失败!')
}
})
}
}
}
</script>
<style scoped>
.taskDetails {
display: flex;
justify-content: space-between;
align-items: center;
border: 1px solid #eee;
padding: 20px;
margin-bottom: 20px;
}
.leftContent {
width: 70%;
}
.content {
height: auto;
word-wrap: break-word;
word-break: break-all;
}
.taskAward {
display: flex;
justify-content: space-between;
}
.showInfoForm {
margin-top: 10px;
width: 700px;
}
.showInfoForm > span {
display: inline-block;
padding-bottom: 8px;
width: 50%;
}
.copyLine {
color: #409eff;
cursor: pointer;
}
.displayImg {
width: 500px;
height: 300px;
}
</style>