Commit 7476f480 by cwq0219

Merge branch 'v1.0.1' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v1.0.1

2 parents 802146b0 7d72605e
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.2.5", "glsx-components": "^1.2.6",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
......
...@@ -56,98 +56,99 @@ ...@@ -56,98 +56,99 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="选择客户" prop="selectType"> <el-form-item label="选择客户" prop="selectType">
<el-radio-group v-model="basicForm.selectType"> <el-radio-group v-model="basicForm.selectType" @change="radioChange">
<el-radio :label="1">全部客户</el-radio> <el-radio :label="1">全部客户</el-radio>
<el-radio :label="2">筛选客户</el-radio> <el-radio :label="2">筛选客户</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> <div class="filter-box" v-show="basicForm.selectType == 2">
<div class="filter-box" v-show="basicForm.selectType == 2"> <div class="filter-memeber">
<div class="filter-memeber"> <el-form :model="basicForm.condition" label-width="120px">
<el-form :model="basicForm.condition" label-width="120px"> <el-form-item label="性别">
<el-form-item label="性别"> <el-radio-group v-model="basicForm.condition.sex" @change="valueChange">
<el-radio-group v-model="basicForm.condition.sex" @change="valueChange"> <el-radio label>全部</el-radio>
<el-radio label>全部</el-radio> <el-radio :label="1">男性</el-radio>
<el-radio :label="1">男性</el-radio> <el-radio :label="2">女性</el-radio>
<el-radio :label="2">女性</el-radio> <el-radio :label="0">未知性别</el-radio>
<el-radio :label="0">未知性别</el-radio> </el-radio-group>
</el-radio-group> </el-form-item>
</el-form-item> <el-form-item label="所在群聊">
<el-form-item label="所在群聊"> <el-select
<el-select v-model="basicForm.condition.chat"
v-model="basicForm.condition.chatId" @change="valueChange"
@change="valueChange" @focus="groupFocus"
@focus="groupFocus" :size="size"
:size="size" value-key="id"
multiple multiple
collapse-tags collapse-tags
placeholder="请选择" placeholder="请选择"
> >
<el-option <el-option
v-for="item in groupList" v-for="item in groupList"
:key="item.id" :key="item.id"
:label="item.groupName" :label="item.groupName"
:value="item.id" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="添加客户时间"> <el-form-item label="添加客户时间">
<el-date-picker <el-date-picker
v-model="basicForm.condition.date" v-model="basicForm.condition.date"
@change="valueChange" @change="valueChange"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:size="size"
style="width: 320px;"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="标签筛选">
<el-button size="small" @click="openLabel">
<i class="el-icon-plus"></i>
标签筛选
</el-button>
<div
v-show="tagging.length != 0"
:key="key"
class="el-input-tag input-tag-wrapper"
>
<el-tag
v-for="(tag, idx) in tagging"
:key="idx"
:size="size" :size="size"
type="info" style="width: 320px;"
closable ></el-date-picker>
:disable-transitions="false" </el-form-item>
@close="removeTag(tag, idx)" <el-form-item label="标签筛选">
>{{ tag.name }}</el-tag> <el-button size="small" @click="openLabel">
</div> <i class="el-icon-plus"></i>
<div class="sale-select" v-show="basicForm.condition.labelList"> 标签筛选
<div :key="key" class="el-input-tag input-tag-wrapper"> </el-button>
<div
v-show="tagging.length != 0"
:key="key"
class="el-input-tag input-tag-wrapper"
>
<el-tag <el-tag
v-for="(tag, idx) in basicForm.condition.labelList" v-for="(tag, idx) in tagging"
:key="idx" :key="idx"
:size="size" :size="size"
type="info" type="info"
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="remove(tag)" @close="removeTag(tag, idx)"
>{{ tag.staffName }}</el-tag> >{{ tag.name }}</el-tag>
<el-input size="small" style="outline: none; border: none"></el-input> </div>
<div class="sale-select" v-show="basicForm.condition.labelList">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag
v-for="(tag, idx) in basicForm.condition.labelList"
:key="idx"
:size="size"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>{{ tag.staffName }}</el-tag>
<el-input size="small" style="outline: none; border: none"></el-input>
</div>
</div> </div>
</div> </el-form-item>
</el-form-item>--> </el-form>
</el-form> </div>
</div> </div>
<div class="filter-footer"> <div class="filter-footer">
<span>将消息发送给客户符合条件的客户</span> <!-- <span>将消息发送给客户符合条件的客户</span> -->
<div class="filter-number"> <div class="filter-number">
查看预计群发人数 查看预计群发人数
<span v-show="isUpdate" @click="viewMembers">查看</span> <span v-show="isUpdate" @click="viewMembers">查看</span>
<span v-show="!isUpdate">{{groupNumber}}</span> <span v-show="!isUpdate">{{groupNumber}}</span>
</div> </div>
</div> </div>
</div> </el-form-item>
</el-form> </el-form>
<!-- 编辑入群欢迎语 --> <!-- 编辑入群欢迎语 -->
<div class="title">编辑群发内容</div> <div class="title">编辑群发内容</div>
...@@ -333,6 +334,7 @@ export default { ...@@ -333,6 +334,7 @@ export default {
if (this.$refs.membersForm.innerTags.length != 0) { if (this.$refs.membersForm.innerTags.length != 0) {
this.basicForm.userList = this.$refs.membersForm.innerTags this.basicForm.userList = this.$refs.membersForm.innerTags
this.openMembers() this.openMembers()
this.isUpdate = true
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
...@@ -354,7 +356,7 @@ export default { ...@@ -354,7 +356,7 @@ export default {
if (valid) { if (valid) {
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(v => {
if (v) { if (v) {
if (this.basicForm.selectType == 2 && this.groupNumber == 0) { if (this.groupNumber == 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '选择客户数量为0,不可创建' message: '选择客户数量为0,不可创建'
...@@ -404,11 +406,15 @@ export default { ...@@ -404,11 +406,15 @@ export default {
this.addLoading = false this.addLoading = false
}) })
.catch(err => { .catch(err => {
console.log(err)
this.$message({ this.$message({
type: 'error', type: 'error',
message: err.message message: err.message
}) })
this.addLoading = false this.addLoading = false
if (err.code == '-1') {
this.handleCancel()
}
}) })
} }
}) })
...@@ -451,12 +457,18 @@ export default { ...@@ -451,12 +457,18 @@ export default {
} }
}, },
getSiftMembers() { getSiftMembers() {
console.log(this.basicForm.condition, this.tagging)
const chatFlag = this.basicForm.condition.chat && this.basicForm.condition.chat.length
const tagFlag = this.tagging && this.tagging.length
const params = { const params = {
selectType: this.basicForm.selectType, selectType: this.basicForm.selectType,
condition: { condition: {
sex: this.basicForm.condition.sex, sex: this.basicForm.condition.sex,
chatId: this.basicForm.condition.chatId.join(','), chatId: chatFlag ? this.basicForm.condition.chat.map(item => item.id).join(',') : '',
tagId: JSON.stringify(this.tagging) chatName: chatFlag ? this.basicForm.condition.chat.map(item => item.groupName).join(',') : '',
tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging)
} }
} }
if (this.basicForm.condition.date) { if (this.basicForm.condition.date) {
...@@ -481,11 +493,27 @@ export default { ...@@ -481,11 +493,27 @@ export default {
return return
} }
const params = this.getSiftMembers() const params = this.getSiftMembers()
this.$apis.customerTransform.customerCount(params).then(res => { this.$apis.customerTransform
this.groupNumber = res .customerCount(params)
this.isUpdate = false .then(res => {
}) // if (res) {
this.groupNumber = res
// }
this.isUpdate = false
console.log(res)
})
.catch(err => {
this.groupNumber = 0
})
},
// 选择客户change事件
radioChange(val) {
this.isUpdate = true
this.basicForm.condition = {
sex: ''
}
}, },
// 发送时间change事件
changeValue(v) { changeValue(v) {
const date = new Date(v).getTime() const date = new Date(v).getTime()
if (date < Date.now()) { if (date < Date.now()) {
...@@ -500,9 +528,10 @@ export default { ...@@ -500,9 +528,10 @@ export default {
} }
} }
}, },
// 点击所在群聊
groupFocus() { groupFocus() {
if (this.basicForm.condition && this.basicForm.condition.chatId) { if (this.basicForm.condition && this.basicForm.condition.chatId) {
this.basicForm.condition.chatId = [] this.basicForm.condition.chat = {}
this.groupList = [] this.groupList = []
this.isUpdate = true this.isUpdate = true
} }
...@@ -534,31 +563,35 @@ export default { ...@@ -534,31 +563,35 @@ export default {
.info-content { .info-content {
width: calc(100% - 360px); width: calc(100% - 360px);
.filter-box { .filter-box {
margin-left: 120px; // margin-left: 120px;
margin-bottom: 10px;
min-width: 656px; min-width: 656px;
background-color: #f7f7f7; background-color: #f7f7f7;
.filter-memeber { .filter-memeber {
padding: 20px 0; padding: 20px 0;
border-bottom: 1px solid #dcdfe6; // border-bottom: 1px solid #dcdfe6;
.el-form { .el-form {
padding: 0; padding: 0;
} }
} }
.filter-footer { }
display: flex;
padding: 14px 20px; .filter-footer {
justify-content: space-between; display: flex;
align-items: center; // padding: 14px 20px;
color: #999; justify-content: space-between;
font-size: 14px; align-items: center;
.filter-number { color: #999;
padding: 7px 14px; font-size: 14px;
background-color: #e6e9ff; .filter-number {
color: #333; display: inline-block;
span { line-height: 20px;
color: #5850ff; padding: 7px 14px;
cursor: pointer; background-color: #e6e9ff;
} color: #333;
span {
color: #5850ff;
cursor: pointer;
} }
} }
} }
......
<template>
<div class="ly-emotion" >
<slot></slot>
</div>
</template>
<script>
export default {
name: 'ly-emotion',
mounted () {
const name = this.$el.innerHTML
const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', 'NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极']
let index = list.indexOf(name)
let imgHTML = `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
this.$nextTick(() => {
this.$el.innerHTML = imgHTML
})
},
}
</script>
<style scoped>
.ly-emotion {
display: inline-block
}
.ly-static-emotion {
width: 24px;
height: 24px;
display: inline-block;
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="container"> <div class="container">
<div class="title">基础信息</div> <div class="title">基础信息</div>
<div class="content"> <div class="detail-content">
<div class="content-info"> <div class="content-info">
<div class="content-text"> <div class="content-text">
<div class="detail-item"> <div class="detail-item">
<div class="detail-label">创建者:</div> <div class="detail-label">创建者:</div>
<div class="detail-value">{{basicInfo.createdName ? basicInfo.createdName : '-'}}</div> <div class="detail-value">
<el-tag v-if="basicInfo.createdName" type="info">
<i class="el-icon-user-solid"></i>
{{ basicInfo.createdName }}
</el-tag>
<span v-else>-</span>
<!-- {{basicInfo.createdName ? basicInfo.createdName : '-'}} -->
</div>
</div>
<div class="detail-item">
<div class="detail-label">群发内容:</div>
<div
class="detail-value"
>[共{{basicInfo.attachmentList ? basicInfo.attachmentList.length : '0'}}条]</div>
<div class="detail-tips">详见右侧视图</div>
</div> </div>
<div class="detail-item" v-show="form == 'customer'"> <div class="detail-item" v-show="form == 'customer'">
<div class="detail-label">群发类型:</div> <div class="detail-label">群发类型:</div>
...@@ -18,23 +32,99 @@ ...@@ -18,23 +32,99 @@
</div> </div>
<div class="detail-item"> <div class="detail-item">
<div class="detail-label">发送时间:</div> <div class="detail-label">发送时间:</div>
<div class="detail-value">{{basicInfo.sendTime ? basicInfo.sendTime : '--'}}</div> <div class="detail-value">{{basicInfo.sendTime ? basicInfo.sendTime : '-'}}</div>
</div> </div>
<div class="detail-item"> <div class="detail-item" style="margin-bottom: 0;">
<div class="detail-label">群发对象:</div> <div class="detail-label">群发对象:</div>
<div class="detail-value"> <div class="detail-value">
<span v-for="(item, index) in basicInfo.userList" :key="item.id"> 在
<span v-for="(item, index) in basicInfo.userList" class="el-tag-item" :key="item.id">
<el-tag type="info" v-if="index < 5">
<i class="el-icon-user-solid"></i>
{{ item.staffName }}
</el-tag>
<el-tag type="info" v-if="basicInfo.userList.length > 5 && index == 5">
<el-popover placement="top" width="300" trigger="hover">
<span slot="reference">...({{basicInfo.userList.length}})</span>
<div class="entmicro-hover">
<el-tag
type="info"
v-for="(i, index) in basicInfo.userList"
:key="index"
:disable-transitions="false"
>{{i.staffName}}</el-tag>
</div>
</el-popover>
</el-tag>
</span>
里满足以下条件中的{{basicInfo.customerCount ? basicInfo.customerCount : 0}}个{{form == 'customer' ? '客户' : '群聊'}}
<!-- v-if="selectType == 2" <span v-for="(item, index) in basicInfo.userList" :key="item.id">
[{{item.staffName}}] [{{item.staffName}}]
<span v-show="basicInfo.userList.length -1 != index">、</span> <span v-show="basicInfo.userList.length -1 != index">、</span>
</span> </span>-->
</div> </div>
</div> </div>
<div class="detail-item"> <div class="detail-condition" v-if="form == 'customer' && basicInfo.selectType == 2">
<div class="detail-label">群发内容:</div> <div class="detail-condition-item">
<div <span class="name">性别</span>
class="detail-value" <span>{{SEX_TYPE[basicInfo.condition.sex]}}</span>
>[共{{basicInfo.attachmentList ? basicInfo.attachmentList.length : '0'}}条]</div> </div>
<div class="detail-tips">详见右侧视图</div> <div v-if="basicInfo.condition.startTime" class="detail-condition-item">
<span class="name">添加时间</span>
<span>{{basicInfo.condition.startTime ? basicInfo.condition.startTime.split(' ')[0] : '-'}} 至 {{basicInfo.condition.endTime ? basicInfo.condition.endTime.split(' ')[0] : '-'}}</span>
</div>
<div class="detail-condition-item" v-if="basicInfo.condition.chatName">
<span class="name">所在群聊</span>
<span
v-for="(item, index) in basicInfo.condition.chatName.split(',')"
class="el-tag-item"
:key="index"
>
<el-tag v-if="index < 3" type="info">{{ item }}</el-tag>
<el-tag
type="info"
v-if="basicInfo.condition.chatName.split(',').length > 3 && index == 3"
>
<el-popover placement="top" width="300" trigger="hover">
<span slot="reference">...({{basicInfo.condition.chatName.split(',').length}})</span>
<div class="entmicro-hover">
<el-tag
type="info"
v-for="(i, index) in basicInfo.condition.chatName.split(',')"
:key="index"
:disable-transitions="false"
>{{i}}</el-tag>
</div>
</el-popover>
</el-tag>
</span>
</div>
<div class="detail-condition-item" v-if="basicInfo.condition.tagName">
<span class="name">标签筛选</span>
<span
v-for="(itm, idx) in basicInfo.condition.tagName.split(',')"
class="el-tag-item"
:key="idx"
>
<el-tag v-if="idx < 3" type="info">{{ itm }}</el-tag>
<el-tag
type="info"
v-if="basicInfo.condition.tagName.split(',').length > 3 && idx == 3"
>
<el-popover placement="top" width="300" trigger="hover">
<span slot="reference">...({{basicInfo.condition.tagName.split(',').length}})</span>
<div class="entmicro-hover">
<el-tag
type="info"
v-for="(i, index) in basicInfo.condition.tagName.split(',')"
:key="index"
:disable-transitions="false"
>{{i}}</el-tag>
</div>
</el-popover>
</el-tag>
</span>
</div>
</div> </div>
</div> </div>
<div class="title">数据统计</div> <div class="title">数据统计</div>
...@@ -91,7 +181,14 @@ const STATUS = { ...@@ -91,7 +181,14 @@ const STATUS = {
'-1': '创建失败', '-1': '创建失败',
'0': '创建成功', '0': '创建成功',
'1': '发送成功', '1': '发送成功',
'2': '发送失败' '2': '发送失败',
'3': '待发送'
}
const SEX = {
null: '全部',
'1': '男',
'2': '女',
'0': '未知性别'
} }
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
...@@ -105,13 +202,17 @@ export default { ...@@ -105,13 +202,17 @@ export default {
data() { data() {
return { return {
STATUS_TYPE: STATUS, STATUS_TYPE: STATUS,
basicInfo: {}, SEX_TYPE: SEX,
basicInfo: {
condition: {}
},
statistic: {} statistic: {}
} }
}, },
mounted() { mounted() {
this.getCustomerDetail(this.id) this.getCustomerDetail(this.id)
this.getStatistic() this.getStatistic()
// console.log(this.basicInfo)
}, },
methods: { methods: {
getCustomerDetail(id) { getCustomerDetail(id) {
...@@ -152,7 +253,7 @@ export default { ...@@ -152,7 +253,7 @@ export default {
color: #333; color: #333;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
} }
.content { .detail-content {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
...@@ -162,20 +263,72 @@ export default { ...@@ -162,20 +263,72 @@ export default {
padding: 20px 24px 40px 0; padding: 20px 24px 40px 0;
.content-info { .content-info {
width: calc(100% - 360px); width: calc(100% - 360px);
.content-text { .content-text {
padding-left: 52px; padding-left: 52px;
height: 400px; height: 400px;
} }
.detail-item { .detail-item {
display: flex; display: flex;
align-items: center;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
line-height: 20px; line-height: 20px;
margin-bottom: 24px; margin-bottom: 24px;
.detail-label {
width: 70px;
}
.detail-tips { .detail-tips {
margin-left: 8px; margin-left: 8px;
color: #939393; color: #939393;
} }
.el-tag-item {
margin-right: 10px;
&:last-child {
margin-right: 0;
}
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.detail-condition {
display: flex;
width: calc(100% - 66px);
margin-left: 72px;
margin-top: 13px;
border-radius: 2px;
font-size: 14px;
color: #333333;
flex-wrap: wrap;
// div:nth-child(odd) {
// border-right: none;
// }
div:nth-child(2),
div:nth-child(4) {
border-left: none;
}
div:nth-child(3),
div:nth-child(4) {
border-top: none;
}
&-item {
width: calc(50% - 2px);
min-width: 327px;
height: 40px;
line-height: 40px;
background: #f7f7f7;
border: 1px solid #d8d8d8;
.name {
display: inline-block;
width: 68px;
padding-left: 10px;
color: #999999;
}
}
} }
.statistics-info { .statistics-info {
display: flex; display: flex;
...@@ -216,4 +369,11 @@ export default { ...@@ -216,4 +369,11 @@ export default {
} }
} }
} }
.el-tag {
margin-right: 6px;
cursor: pointer;
}
.el-popover .el-tag {
margin-bottom: 6px;
}
</style> </style>
<template>
<div>
<div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion>
</div>
</div>
</div>
</template>
<script>
import Emotion from './Emotion'
export default {
props: {
height: {
type: Number,
default: 200
}
},
data() {
return {
list: [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '挥手', '激动', '街舞', '左太极', '右太极']
]
}
},
methods: {
clickHandler(i) {
let emotion = `${i}`
this.$emit('emotion', emotion)
}
},
components: {
Emotion
}
}
</script>
<style scoped lang="scss">
.emotion-box {
z-index: 2004;
background-color: #fff;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.15);
width: 300px;
box-sizing: border-box;
padding: 5px;
overflow: hidden;
overflow-y: auto;
}
.emotion-box-line {
display: flex;
}
.emotion-item {
flex: 1;
text-align: center;
cursor: pointer;
/deep/ {
img {
width: 24px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="w-textarea" ref="wTextarea"> <div class="w-textarea" ref="wTextarea">
<div <div
contenteditable="true"
class="w-textarea_input" class="w-textarea_input"
ref="wTextareaContent" ref="wTextareaContent"
contenteditable="true"
:id="contentId" :id="contentId"
@click="inputClick($event)" @click="inputClick($event)"
@focus="isLocked = true" @focus="isLocked = true"
...@@ -121,11 +121,60 @@ export default { ...@@ -121,11 +121,60 @@ export default {
addTag(text) { addTag(text) {
// 创建模版标签 // 创建模版标签
let node = document.createElement(this.tag) let node = document.createElement(this.tag)
if (navigator.userAgent.indexOf('Firefox') > 0) {
node.setAttribute('contenteditable', 'false')
}
node.innerText = text node.innerText = text
// 添加id便于删除 // 添加id便于删除
node.id = this.getGuid() node.id = this.getGuid()
this.insertNode(node) this.insertNode(node)
}, },
addNode() {
let target = this.$refs.wTextareaContent
this.updateData(target.innerHTML)
},
promiseAdd(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
promiseAddNode(item, num) {
return new Promise((resolve, reject) => {
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML += item
document.querySelector('.w-textarea_input').focus()
resolve()
}, num * 100)
})
},
addContent(attContent) {
attContent.forEach(async (item, index) => {
await this.promiseAdd(item, index)
this.addTag('@昵称')
// await this.promiseAddNode(item, index)
// this.addNode()
// t2(item)
})
// for (let i = 0; i < attContent.length; i++) {
// if (attContent[i] || (i == 0 && !attContent[i])) {
// document.querySelector('.w-textarea_input').innerHTML += attContent[i]
// document.querySelector('.w-textarea_input').focus()
// document.querySelector('.w-textarea_input').click()
// this.$nextTick(()=>{
// this.addTag('@昵称')
// })
// }
// // 代码格式
// // (function(a) {})(b)
// }
},
addLink(text, url) { addLink(text, url) {
// 创建a标签 // 创建a标签
let node = document.createElement('a') let node = document.createElement('a')
...@@ -134,6 +183,12 @@ export default { ...@@ -134,6 +183,12 @@ export default {
node.target = 'blank' node.target = 'blank'
this.insertNode(node) this.insertNode(node)
}, },
addImg(url) {
// 创建a标签
let node = document.createElement('img')
node.src = url
this.insertNode(node)
},
insertNode(node) { insertNode(node) {
// 在内容中插入标签 // 在内容中插入标签
// 删掉选中的内容(如有) // 删掉选中的内容(如有)
...@@ -142,19 +197,267 @@ export default { ...@@ -142,19 +197,267 @@ export default {
this.savedRange.insertNode(node) this.savedRange.insertNode(node)
// 更新双向绑定数据 // 更新双向绑定数据
let target = this.$refs.wTextareaContent let target = this.$refs.wTextareaContent
// this.updateData(target.innerHTML)
if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) { if (navigator.userAgent.indexOf('Firefox') > 0 || navigator.userAgent.indexOf('QQBrowser') > 0) {
this.updateData(target.innerHTML + '&nbsp;') this.updateData(target.innerHTML + '&nbsp;')
} else { } else {
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
} }
this.currentText = target.innerText let htm = target.innerHTML
const list = [
'微笑',
'撇嘴',
'色',
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
placeCaretAtEnd(el) {
//传入光标要去的jq节点对象
el.focus()
if (typeof window.getSelection != 'undefined' && typeof document.createRange != 'undefined') {
var range = document.createRange()
range.selectNodeContents(el)
range.collapse(false)
var sel = window.getSelection()
sel.removeAllRanges()
sel.addRange(range)
} else if (typeof document.body.createTextRange != 'undefined') {
var textRange = document.body.createTextRange()
textRange.moveToElementText(el)
textRange.collapse(false)
textRange.select()
}
},
handleInput(target) { handleInput(target) {
// 即时更新数据 // 即时更新数据
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
this.currentText = target.innerText let htm = target.innerHTML
console.log(htm)
const list = [
'微笑',
'撇嘴',
'色',
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.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}]`
})
let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
handleDelete(e) { handleDelete(e) {
...@@ -170,6 +473,7 @@ export default { ...@@ -170,6 +473,7 @@ export default {
} }
}, },
inputClick(e) { inputClick(e) {
console.log(this.tag.toUpperCase(), e.target.nodeName, e)
// 监听点击事件 // 监听点击事件
this.isLocked = true this.isLocked = true
const TAG_NAME = e.target.nodeName const TAG_NAME = e.target.nodeName
...@@ -227,6 +531,10 @@ export default { ...@@ -227,6 +531,10 @@ export default {
cursor: default; cursor: default;
-webkit-user-modify: read-only !important; -webkit-user-modify: read-only !important;
} }
img {
width: 24px;
height: 24px;
}
.active { .active {
background: #dcdfe6; background: #dcdfe6;
} }
...@@ -242,13 +550,14 @@ $textColor: #666; ...@@ -242,13 +550,14 @@ $textColor: #666;
box-sizing: border-box; box-sizing: border-box;
// border-radius: 4px; // border-radius: 4px;
border: 1px solid $borderColor; border: 1px solid $borderColor;
overflow: hidden;
min-height: 200px; min-height: 200px;
// margin-bottom: 15px; // margin-bottom: 15px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
&_input { &_input {
width: 100%; width: 100%;
min-height: 200px; min-height: 100px;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
line-height: 1.5; line-height: 1.5;
......
...@@ -9,15 +9,7 @@ ...@@ -9,15 +9,7 @@
</div>--> </div>-->
<!-- <div id="toolbar-container" style="display: none;"></div> <!-- <div id="toolbar-container" style="display: none;"></div>
<div id="text-container" class="editor-container"></div>--> <div id="text-container" class="editor-container"></div>-->
<!-- <div <wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea>
id="editor"
ref="editor"
@input="changeInput"
class="text-editor"
contenteditable="true"
autofocus
></div>-->
<wTextarea ref="textContent" @updateText="updateText"></wTextarea>
<!-- <el-input <!-- <el-input
type="textarea" type="textarea"
:rows="9" :rows="9"
...@@ -31,7 +23,7 @@ ...@@ -31,7 +23,7 @@
<div v-for="(itm, index) in previewList" :key="itm.id"> <div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1"> <div class="welcome-file" v-if="itm.attType != 1">
<template v-if="itm.attType == 2"> <template v-if="itm.attType == 2">
<i v-show="index == (previewList.length -1) && loading" class="el-icon-loading"></i> <i v-show="index == previewList.length - 1 && loading" class="el-icon-loading"></i>
<img v-show="!loading" src="@/assets/guestCustom/icon-img.png" alt /> <img v-show="!loading" src="@/assets/guestCustom/icon-img.png" alt />
<span :title="itm.attContent">{{ itm.attContent }}</span> <span :title="itm.attContent">{{ itm.attContent }}</span>
</template> </template>
...@@ -47,14 +39,21 @@ ...@@ -47,14 +39,21 @@
<img src="@/assets/guestCustom/icon-applet.png" alt /> <img src="@/assets/guestCustom/icon-applet.png" alt />
<span :title="itm.attContent.title">{{ itm.attContent.title }}</span> <span :title="itm.attContent.title">{{ itm.attContent.title }}</span>
</template> </template>
<i class="el-icon-circle-close" style="cursor: pointer;" @click="close(index)"></i> <i class="el-icon-circle-close" @click="close(index)"></i>
</div> </div>
</div> </div>
<div class="btn-group"> <div class="btn-group">
<div class="add-btn" v-for="item in btnList" :key="item.id"> <div class="add-btn" v-for="item in btnList" :key="item.id">
<!-- <i class="el-icon-circle-plus-outline"></i> --> <!-- <i class="el-icon-circle-plus-outline"></i> -->
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" alt /> <img
<span>{{ item.name }}</span> :src="require(`@/assets/guestCustom/add-${item.type}.png`)"
alt
v-if="item.id == 1"
@click="selectEmotion"
/>
<img :src="require(`@/assets/guestCustom/add-${item.type}.png`)" v-else alt />
<span v-if="item.id == 1" @click.stop="selectEmotion">{{ item.name }}</span>
<span v-else>{{ item.name }}</span>
<input <input
v-if="item.type == 'img'" v-if="item.type == 'img'"
type="file" type="file"
...@@ -75,14 +74,21 @@ ...@@ -75,14 +74,21 @@
:accept="item.accept || 'video/*'" :accept="item.accept || 'video/*'"
@change="e => handleVideoChange(e, item)" @change="e => handleVideoChange(e, item)"
/> />
<el-link v-else style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link> <el-link
v-else-if="item.type == 'nickname' || item.type == 'acivity'"
style="opacity: 0"
@click="handleFun(item.funName)"
>{{ item.name }}</el-link>
</div> </div>
</div> </div>
</div> </div>
<div v-show="emotionStatus" class="emotion-panel">
<emotion class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion>
</div>
<div class="tips-text"> <div class="tips-text">
<img src="../../../assets/guestCustom/tips.png" class="tips-icon" alt /> <img src="@/assets/guestCustom/tips.png" class="tips-icon" alt />
<span v-if="form == 'customer'">每位客户每天可接收1条群发消息,超过接收上限的客户将无法再收到群发消息。</span> <span @click="selectEmotion">如在企业微信管理后台已为所选员工设置了欢迎语,则此处设置的将不生效。</span>
<span v-if="form == 'customerGroup'">每个客户群每天可接收1条群发消息,超过接收上限的客户群将无法再收到群发消息。</span>
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
...@@ -100,26 +106,29 @@ const ATT_TYPE = { ...@@ -100,26 +106,29 @@ const ATT_TYPE = {
} }
// import E from 'wangeditor' // import E from 'wangeditor'
import ActivityModel from './activityModel' import ActivityModel from './activityModel'
import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
import { debounce } from '@/utils/index' import { utils } from 'glsx-common'
export default { export default {
name: 'WelcomeWords', name: 'WelcomeWords',
components: { components: {
ActivityModel, ActivityModel,
Emotion,
wTextarea wTextarea
}, },
props: ['eventBus', 'form'], props: { eventBus: Object },
data() { data() {
return { return {
loading: false, loading: false,
emotionStatus: false,
btnList: [ btnList: [
// { {
// id: 1, id: 1,
// name: '表情', name: '表情',
// funcName: '', funcName: '',
// type: 'expression', type: 'expression',
// limitSize: 10 limitSize: 10
// }, },
{ {
id: 2, id: 2,
name: '图片', name: '图片',
...@@ -127,12 +136,12 @@ export default { ...@@ -127,12 +136,12 @@ export default {
type: 'img', type: 'img',
limitSize: 10 limitSize: 10
}, },
// { {
// id: 3, id: 3,
// name: '昵称', name: '昵称',
// type: 'nickname', type: 'nickname',
// funName: 'nickname' funName: 'nickname'
// }, },
{ {
id: 4, id: 4,
name: '活动', name: '活动',
...@@ -145,7 +154,8 @@ export default { ...@@ -145,7 +154,8 @@ export default {
sendType: '', sendType: '',
sendTime: '', sendTime: '',
sendDate: '', sendDate: '',
editor: {} editor: {},
textValue: ''
} }
}, },
mounted() { mounted() {
...@@ -166,10 +176,129 @@ export default { ...@@ -166,10 +176,129 @@ export default {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
methods: { methods: {
selectEmotion() {
this.emotionStatus = !this.emotionStatus
},
handleEmotion(i) {
this.emotionStatus = false
const list = [
'微笑',
'撇嘴',
'色',
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(i)
this.$refs.textContent.addImg(`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif`)
},
updateText(val) {
this.textInput(val)
},
// 上传图片 // 上传图片
handleImgChange(e, targetItem) { handleImgChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
console.log(file)
// 默认1MB // 默认1MB
const limitSize = targetItem.limitSize || 1 const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
...@@ -177,7 +306,6 @@ export default { ...@@ -177,7 +306,6 @@ export default {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!') this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true return true
} }
this.loading = true this.loading = true
reader.readAsDataURL(file) reader.readAsDataURL(file)
this.previewList.push({ this.previewList.push({
...@@ -188,8 +316,9 @@ export default { ...@@ -188,8 +316,9 @@ export default {
var image = new Image() var image = new Image()
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
console.log(file, targetItem)
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
let len = this.previewList.length - 1 let len = this.previewList.length - 1
...@@ -218,7 +347,7 @@ export default { ...@@ -218,7 +347,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
console.log(res) console.log(res)
...@@ -226,12 +355,10 @@ export default { ...@@ -226,12 +355,10 @@ export default {
attType: ATT_TYPE.VEDIO, attType: ATT_TYPE.VEDIO,
attContent: res attContent: res
}) })
document.querySelector('.upload-img').value = ''
} }
}) })
} }
}, },
// 添加昵称
handleFun(name) { handleFun(name) {
if (name == 'nickname') { if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
...@@ -246,27 +373,18 @@ export default { ...@@ -246,27 +373,18 @@ export default {
textInput(val) { textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (hasText) {
if (val) { this.$set(this.previewList, 0, {
this.$set(this.previewList, 0, { attContent: val,
attContent: val, attType: ATT_TYPE.TEXT
attType: ATT_TYPE.TEXT })
})
} else {
this.previewList.splice(0, 1)
}
} else { } else {
if (val) { this.previewList.unshift({
this.previewList.unshift({ attContent: val,
attContent: val, attType: ATT_TYPE.TEXT
attType: ATT_TYPE.TEXT })
})
} else {
this.previewList.splice(0, 1)
}
} }
}, },
selectActivity(val) { selectActivity(val) {
console.log(val)
let idx let idx
const hasActivity = this.previewList.some((item, index) => { const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) { if (item.attType == 7) {
...@@ -316,8 +434,142 @@ export default { ...@@ -316,8 +434,142 @@ export default {
} }
} }
}, },
updateText(val) { changeInput: utils.debounce(function() {
this.textInput(val) console.log(document.getElementById('editor').childNodes)
var allNodes = document.getElementById('editor').childNodes
var str = ''
allNodes.forEach(item => {
if (item.className == 'nickname') {
str += item.innerText
} else if (item.data) {
str += item.data
}
})
console.log(str)
this.textInput(str)
}, 300),
updateList(val) {
console.log(val)
this.previewList = val
this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
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">`
})
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
} }
} }
} }
...@@ -325,91 +577,98 @@ export default { ...@@ -325,91 +577,98 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.welcome-box { .welcome-box {
.content { }
display: inline-block; .emotion-panel {
vertical-align: text-top; position: relative;
min-width: 656px; height: 0px;
width: calc(100% - 15px); &-box {
margin-left: 12px; position: absolute;
.welcome-file { top: -320px;
display: flex; }
}
.content-bg {
background-color: #f7f7f7;
}
.content {
display: inline-block;
vertical-align: text-top;
width: calc(100% - 103px);
margin-left: 12px;
.welcome-file {
display: flex;
align-items: center;
color: #999;
line-height: 20px;
padding: 10px;
margin-bottom: 10px;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
span {
display: inline-block;
margin-right: 20px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px;
}
i {
font-size: 16px;
cursor: pointer;
}
.el-icon-loading {
font-size: 24px;
}
&:last-child {
margin-bottom: 0;
}
}
.btn-group {
padding: 6px 0 6px 20px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center; align-items: center;
color: #999; padding-right: 25px;
line-height: 20px; font-size: 16px;
padding: 10px; color: #666;
margin-bottom: 10px; cursor: pointer;
border-left: 1px solid #dcdfe6;
border-right: 1px solid #dcdfe6;
img {
width: 20px;
height: 20px;
margin-right: 5px;
}
span { span {
display: inline-block;
margin-right: 20px;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 14px; font-size: 14px;
margin-left: 5px;
cursor: pointer;
} }
i { input {
font-size: 16px; position: absolute;
} width: 100%;
.el-icon-loading { cursor: pointer;
font-size: 24px; font-size: 0;
} height: 40px;
&:last-child {
margin-bottom: 0;
} }
} img {
.btn-group { width: 16px;
padding: 6px 0 6px 20px; height: 16px;
border: 1px solid #dcdfe6;
border-top: 0;
.add-btn {
display: inline-flex;
position: relative;
align-items: center;
padding-right: 25px;
font-size: 16px;
color: #666;
cursor: pointer; cursor: pointer;
span {
font-size: 14px;
margin-left: 5px;
}
input {
position: absolute;
width: 100%;
cursor: pointer;
font-size: 0;
height: 40px;
}
img {
width: 16px;
height: 16px;
cursor: pointer;
}
.el-link {
position: absolute;
width: 100%;
}
} }
} .el-link {
.date-picker { position: absolute;
margin-top: 10px; width: 100%;
font-size: 14px; }
color: #999;
} }
} }
.date-picker {
margin-top: 10px;
font-size: 14px;
color: #999;
}
} }
.content-bg {
background-color: #f7f7f7;
}
.required { .required {
display: inline-block; display: inline-block;
line-height: 40px; line-height: 40px;
...@@ -483,7 +742,6 @@ export default { ...@@ -483,7 +742,6 @@ export default {
background-color: rgba(230, 233, 255, 0.49); background-color: rgba(230, 233, 255, 0.49);
border: 1px solid rgba(88, 80, 255, 0.49); border: 1px solid rgba(88, 80, 255, 0.49);
border-radius: 4px; border-radius: 4px;
line-height: 20px;
.tips-icon { .tips-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
......
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
this.handleSearch() this.handleSearch()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '已提醒!' message: '已提醒'
}) })
// this.$set(this.employeelist[index], 'isRemind', true) // this.$set(this.employeelist[index], 'isRemind', true)
}) })
......
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
this.getStaffList(this.activeIndex) this.getStaffList(this.activeIndex)
this.$message({ this.$message({
type: 'success', type: 'success',
message: '已提醒!' message: '已提醒'
}) })
// this.$set(this.employeelist[index], 'remindStatus', true) // this.$set(this.employeelist[index], 'remindStatus', true)
}) })
......
...@@ -14,12 +14,19 @@ ...@@ -14,12 +14,19 @@
</div> </div>
<div v-if="activeIndex == 1" class="container"> <div v-if="activeIndex == 1" class="container">
<div class="container-header"> <div class="container-header">
<el-button <!-- <el-button
type="primary" type="primary"
size="small" :size="size"
icon="el-icon-plus" icon="el-icon-plus"
@click="btnClick('create', 1)" @click="btnClick('create', 1)"
>新建群发</el-button> >新建群发</el-button>-->
<GLButton
type="primary"
:size="size"
icon="el-icon-plus"
fn="新建客户群发"
@click="btnClick('create', 1)"
>新建群发</GLButton>
<div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div> <div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
...@@ -39,24 +46,35 @@ ...@@ -39,24 +46,35 @@
</span> </span>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button <span v-if="scope.scope.status == -1" style="color: #EB4E4E;">创建失败</span>
type="text" <span v-else>
:disabled="scope.scope.unsendUserNum == 0 || (scope.scope.unsendUserNum != 0 && scope.scope.isRemind == 1)" <el-button
@click="btnClick('remind', 1, scope.scope)" type="text"
>提醒发送</el-button> :disabled="scope.scope.unsendUserNum == 0 || (scope.scope.unsendUserNum != 0 && scope.scope.isRemind == 1)"
<el-button type="text" @click="btnClick('detail', 1, scope.scope)">详情</el-button> @click="btnClick('remind', 1, scope.scope)"
>提醒发送</el-button>
<!-- <GLButton type="text" fn="客户群发详情" @click="btnClick('detail', 1, scope.scope)">详情</GLButton> -->
<el-button type="text" @click="btnClick('detail', 1, scope.scope)">详情</el-button>
</span>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<div v-if="activeIndex == 2" class="container"> <div v-if="activeIndex == 2" class="container">
<div class="container-header"> <div class="container-header">
<el-button <!-- <el-button
type="primary" type="primary"
size="small" :size="size"
icon="el-icon-plus" icon="el-icon-plus"
@click="btnClick('create', 2)" @click="btnClick('create', 2)"
>新建群发</el-button> >新建群发</el-button>-->
<GLButton
type="primary"
:size="size"
fn="新建客户群群发"
icon="el-icon-plus"
@click="btnClick('create', 2)"
>新建群发</GLButton>
<div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div> <div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
...@@ -76,12 +94,16 @@ ...@@ -76,12 +94,16 @@
</span> </span>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button <span v-if="scope.scope.status == -1" style="color: #EB4E4E;">创建失败</span>
type="text" <span v-else>
:disabled="scope.scope.unsendUserNum == 0 || (scope.scope.unsendUserNum != 0 && scope.scope.isRemind == 1)" <el-button
@click="btnClick('remind', 2, scope.scope)" type="text"
>提醒发送</el-button> :disabled="scope.scope.unsendUserNum == 0 || (scope.scope.unsendUserNum != 0 && scope.scope.isRemind == 1)"
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button> @click="btnClick('remind', 2, scope.scope)"
>提醒发送</el-button>
<!-- <GLButton type="text" fn="客户群群发详情" @click="btnClick('detail', 2, scope.scope)">详情</GLButton> -->
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</span>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
......
...@@ -18,13 +18,21 @@ ...@@ -18,13 +18,21 @@
</div> </div>
<div class="marketing-content">{{item.content}}</div> <div class="marketing-content">{{item.content}}</div>
<div class="marketing-btn"> <div class="marketing-btn">
<el-button <GLButton
style="width: 118px;"
display="disabled"
type="primary"
:size="size"
:fn="item.linkName"
@click="jumpPage(item.path)"
>{{item.linkName}}</GLButton>
<!-- <el-button
style="width: 118px;" style="width: 118px;"
:disabled="!$globalState.routers.find(i => i.compath == item.path)" :disabled="!$globalState.routers.find(i => i.compath == item.path)"
type="primary" type="primary"
size="small" size="small"
@click="jumpPage(item.path)" @click="jumpPage(item.path)"
>{{item.linkName}}</el-button> >{{item.linkName}}</el-button>-->
</div> </div>
</div> </div>
</div> </div>
...@@ -227,7 +235,7 @@ ...@@ -227,7 +235,7 @@
</div> </div>
<div class="border home-bottom"> <div class="border home-bottom">
<div class="title bottom-title"> <div class="title bottom-title">
<div class="bottom-text">微店数据</div> <div class="bottom-text">店铺数据</div>
<div class="bottom-time"> <div class="bottom-time">
<div class="bottom-btn"> <div class="bottom-btn">
<el-button <el-button
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!