Commit a7a21e9e by xuyl

emoji展示

1 parent 5fe78b53
......@@ -8,7 +8,7 @@
<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>{{sub.materialContent}}</p>
<p v-html='tramWord(sub.materialContent)'></p>
</template>
<template v-if="sub.materialType == '2'">
<img class='displayImg' :src='sub.materialContent'>
......@@ -42,7 +42,7 @@
<script>
import { taskManagementApi } from '@/api/taskManagement'
import emoji from '@/utils/emo'
export default {
name: 'TaskDetails',
props: {
......@@ -55,6 +55,20 @@ export default {
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) {
......@@ -115,8 +129,4 @@ export default {
width: 500px;
height: 300px;
}
.displayContent{
display: inline-block;
width: 800px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!