Commit 6444893d by 胡悦

修改群发

1 parent 7d72605e
......@@ -29,7 +29,8 @@ const insert = params => {
url: URL,
method: 'POST',
data: params,
sign: true
sign: true,
returnAll: true
})
}
......
......@@ -356,13 +356,6 @@ export default {
if (valid) {
this.$refs.groupForm.validate(v => {
if (v) {
if (this.groupNumber == 0) {
this.$message({
type: 'error',
message: '选择客户数量为0,不可创建'
})
return
}
const params = this.getSiftMembers()
params.type = 1
// params.attachmentList = this.basicForm.attachmentList
......@@ -370,6 +363,120 @@ export default {
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
const list = [
'微笑',
'撇嘴',
'色',
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = item.attContent.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
console.log(cutImg)
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]`
})
item.attContent = replaceImg
item.attContent = item.attContent.replace('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
......@@ -392,29 +499,34 @@ export default {
if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
}
console.log(params)
this.addLoading = true
this.$apis.customerTransform
.insert(params)
.then(res => {
if (res) {
console.log(res)
if (res.code == '-1') {
this.$message({
type: 'error',
message: res.message
})
this.handleCancel()
} else if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.handleCancel()
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
})
.catch(err => {
console.log(err)
this.$message({
type: 'error',
message: err.message
})
this.addLoading = false
if (err.code == '-1') {
this.handleCancel()
}
})
}
})
......
......@@ -5,7 +5,7 @@
<div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt />
<template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div>
<div class="preview-text text" v-html="item.attContent"></div>
</template>
<template v-else-if="item.attType == 7">
<div class="preview-activity">
......@@ -45,13 +45,135 @@
<script>
export default {
name: 'Preview',
props: { eventBus: Object, list: Array },
props: { eventBus: Object },
data() {
return {
previewList: [],
currentTime: ''
}
},
watch: {
previewList(val) {
console.log(val)
if (val[0].attType == 1) {
const attContent = val[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA5]{1,3}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = [
'微笑',
'撇嘴',
'色',
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
})
console.log(htm)
val[0].attContent = htm
}
}
},
created() {
this.eventBus.$on('update', val => {
this.previewList = val
......
......@@ -458,6 +458,7 @@ export default {
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText
console.log(this.currentText, 11111111)
this.$emit('updateText', this.currentText)
},
handleDelete(e) {
......
......@@ -292,6 +292,7 @@ export default {
this.$refs.textContent.addImg(`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif`)
},
updateText(val) {
console.log(val)
this.textInput(val)
},
// 上传图片
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!