Commit a3054f0e by 前端

Merge branch '3.3.1' into 'master'

合并3.3.1

See merge request !16
2 parents 3fbf0001 3970b8da
...@@ -63,7 +63,8 @@ const actions = { ...@@ -63,7 +63,8 @@ const actions = {
ssoApi ssoApi
.login({ .login({
code, code,
corpId corpId,
getUserInfoFlag: false
}) })
.then(({ code, data, message }) => { .then(({ code, data, message }) => {
let route = state.lastPath == 'coupon' ? '' : state.lastPath || '' let route = state.lastPath == 'coupon' ? '' : state.lastPath || ''
...@@ -114,7 +115,7 @@ const actions = { ...@@ -114,7 +115,7 @@ const actions = {
util.showLoading() util.showLoading()
let appid = getParams('corpId') //从链接获取 let appid = getParams('corpId') //从链接获取
let dj_scrm = util.getLocalStorage('dj_scrm_corpId') let dj_scrm = util.getLocalStorage('dj_scrm_corpId')
if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'ww7ee69c648ae1b7e6' if (!appid) appid = (dj_scrm && dj_scrm.corpId) || 'wwc33bc9a3c72d45f3'
util.setLocalStorage('dj_scrm_corpId', { corpId: appid }) util.setLocalStorage('dj_scrm_corpId', { corpId: appid })
// 'ww657a2d4ae89a4424' // 'ww657a2d4ae89a4424'
const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize' const wxUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize'
......
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
<template> <template>
<div <div class="sop-container" v-if="flag">
class="sop-container"
v-if="flag"
>
<div class="sop-box"> <div class="sop-box">
<div class="sop-title flex"> <div class="sop-title flex">
{{ { {{
'1': '企业微信群发', {
'3': '发送客户朋友圈' '1': '企业微信群发',
}[editForm.pushChannelType] }} '3': '发送客户朋友圈'
<div }[editForm.pushChannelType]
class="sop-title-tips text-center" }}
v-if="editForm.taskStatus == 2" <div class="sop-title-tips text-center" v-if="editForm.taskStatus == 2">已发送</div>
>
已发送
</div>
</div> </div>
<!-- 朋友圈模板 --> <!-- 朋友圈模板 -->
<div <div class="sop-content" v-if="editForm.additionalType == '4' || editForm.additionalType == '5'">
class="sop-content" <div class="text" v-if="editForm.additionalType == '4'">{{ editForm.wwMomentContent.text || '' }}</div>
v-if="editForm.additionalType == '4'" <div v-else v-html="decodeURIComponent(richText)"></div>
>
<div class="text">{{ editForm.wwMomentContent.text || ''}}</div>
<template v-if="editForm.wwMomentContent && editForm.wwMomentContent.contentType != 0"> <template v-if="editForm.wwMomentContent && editForm.wwMomentContent.contentType != 0">
<div <div ref="wechatMutiImg" v-if="[1, 2].includes(editForm.wwMomentContent.contentType)" class="wechat-muti-img">
ref="wechatMutiImg"
v-if="[1,2].includes(editForm.wwMomentContent.contentType)"
class="wechat-muti-img"
>
<template v-if="editForm.wwMomentContent"> <template v-if="editForm.wwMomentContent">
<img <img ref="mutiImgItem" class="muti-img-item" v-for="(item, index) in editForm.wwMomentContent.imgUrls" :key="index" :src="item" />
ref="mutiImgItem"
class="muti-img-item"
v-for="(item, index) in editForm.wwMomentContent.imgUrls"
:key="index"
:src="item"
/>
</template> </template>
</div> </div>
<div <div v-else class="wechat-muti-video">
v-else <video :src="editForm.wwMomentContent.videoContent.videoUrl" controls></video>
class="wechat-muti-video"
>
<video
:src="editForm.wwMomentContent.videoContent.videoUrl"
controls
></video>
</div> </div>
</template> </template>
</div> </div>
<!-- 短链(素材,活动,优惠券) --> <!-- 短链(1-素材,2-活动,3-优惠券,6-组合)-->
<div <div class="sop-content" v-else>
class="sop-content" <div v-html="decodeURIComponent(richText)"></div>
v-else <template v-if="editForm.wwMomentContent && editForm.wwMomentContent.urlContent">
>
<div>{{ editForm.eventContent }}</div>
<template v-if="editForm.urlContent">
<div class="flex sop-url"> <div class="flex sop-url">
<img <img class="url-img" :src="editForm.wwMomentContent.urlContent.imgUrl || defaultImgUrl" />
class="url-img" <p class="url-txt txt-ellipsis">{{ editForm.wwMomentContent.urlContent.title }}</p>
:src="editForm.urlContent && editForm.urlContent.imgUrl"
/>
<p class="url-txt txt-ellipsis">{{editForm.urlContent && editForm.urlContent.title }}</p>
</div> </div>
</template> </template>
</div> </div>
<!-- <div class="sop-content" v-else>
<div v-html="decodeURIComponent(editForm.eventContent)"></div>
<template v-if="editForm.urlContent">
<div class="flex sop-url">
<img class="url-img" :src="editForm.urlContent && editForm.urlContent.imgUrl" />
<p class="url-txt txt-ellipsis">{{ editForm.urlContent && editForm.urlContent.title }}</p>
</div>
</template>
</div> -->
<!-- 用户 --> <!-- 用户 -->
<div <div class="sop-avatar" @click="showCustomerList = !showCustomerList">
class="sop-avatar" <div class="flex">
@click="showCustomerList = !showCustomerList" 可见用户:
>
<div class="flex">可见用户:
<span class="text-hide">{{ editForm.customers[0].customerName }}</span> <span class="text-hide">{{ editForm.customers[0].customerName }}</span>
{{ editForm.customerCount > 1 ? '等' + editForm.customerCount : editForm.customerCount }}名用户 {{ editForm.customerCount > 1 ? '等' + editForm.customerCount : editForm.customerCount }}名用户
</div> </div>
<div <div class="arrow flex" v-if="!showCustomerList">
class="arrow flex" <img class="avatar-img" v-for="(item, index) in editForm.customers.slice(0, 3)" :key="index" :src="item.avatar" />
v-if="!showCustomerList"
>
<img
class="avatar-img"
v-for="(item, index) in editForm.customers.slice(0, 3)"
:key="index"
:src="item.avatar"
/>
<div class="sprite-icon icon-arrow"></div> <div class="sprite-icon icon-arrow"></div>
</div> </div>
</div> </div>
<div <div class="sop-customer-box" v-if="showCustomerList">
class="sop-customer-box" <template v-for="(i, index) in editForm.customers">
v-if="showCustomerList" <div class="sop-customer flex" :key="index">
> <img :src="i.avatar" />
<template v-for="(i,index) in editForm.customers"> <div class="name text-hide">{{ i.customerName }}</div>
<div
class="sop-customer flex"
:key="index"
>
<img :src="i.avatar">
<div class="name text-hide">{{i.customerName}}</div>
<span>@微信</span> <span>@微信</span>
</div> </div>
</template> </template>
</div> </div>
</div> </div>
<div class="wei-tip" v-if="editForm.pushChannelType == 1">请前往企微微信-群发助手中进行群发</div>
<template v-if="editForm.pushChannelType == 3 && editForm.taskStatus == 1"> <template v-if="editForm.pushChannelType == 3 && editForm.taskStatus == 1">
<div <div class="btn x-center text-center" @click="send">发送</div>
class="btn x-center text-center"
@click="send"
>发送</div>
</template> </template>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
import { wxConfig, sopApi } from '@/api' import { wxConfig, sopApi } from '@/api'
import emoji from '@/utils/emo'
export default { export default {
name: '', name: '',
data () { data () {
return { return {
flag: false, flag: false,
textss: '😜你好呀\n\ndasdasdasdasddasdasdasdasddasdasdasdasddasdasdasdasddasdasdasdasd😜发送到😜😜😜[微笑][大哭]赶紧的选择大格局欧弟就过去\n',
showCustomerList: false, showCustomerList: false,
defaultImgUrl: 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg',
defaultTitle:'',
richText: '',
editForm: { editForm: {
sopId: '', sopId: '',
eventId: '', eventId: '',
...@@ -200,15 +166,19 @@ export default { ...@@ -200,15 +166,19 @@ export default {
methods: { methods: {
getSopDetail (taskId) { getSopDetail (taskId) {
// const { merchantId, uuid, sapCode, userName } = this.getLocalStorage('dj_scrm_userInfo')
this.showLoading() this.showLoading()
sopApi.getSopDetail(taskId).then(res => { sopApi.getSopDetail(taskId).then(res => {
console.log(res) console.log(res)
this.hideLoading() this.hideLoading()
if (!res) return
this.flag = true this.flag = true
if (!res) return
// this.defaultTitle = `「${userName}」邀请您查看「${res.userName}」`
this.richText = this.getRichText(res.eventContent)
this.editForm = res this.editForm = res
console.log( this.editForm)
/// 朋友圈模板,单/多图 /// 朋友圈模板,单/多图
if (res.additionalType === '4' && [1, 2].includes(res.wwMomentContent.contentType)) this.setMutiHeight() if (res.additionalType == '4' && [1, 2].includes(res.wwMomentContent.contentType)) this.setMutiHeight()
}) })
}, },
setMutiHeight () { setMutiHeight () {
...@@ -247,6 +217,20 @@ export default { ...@@ -247,6 +217,20 @@ export default {
this.hideLoading() this.hideLoading()
}) })
}, },
getRichText(text){
text = text.replaceAll('\n','<br/>')
return text.replace(/\[[\u4E00-\u9FA56]{1,4}]/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: 16px;height: 16px;vertical-align: top;" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
},
send () { send () {
this.showLoading() this.showLoading()
let { taskId } = this.getQuery() let { taskId } = this.getQuery()
...@@ -271,7 +255,7 @@ export default { ...@@ -271,7 +255,7 @@ export default {
let par = {} let par = {}
if (key == 'link') par = { if (key == 'link') par = {
title: e[key].title, title: e[key].title,
imgUrl: '', imgUrl: e[key].imgUrl || this.defaultImgUrl,
url: e[key].url url: e[key].url
} }
else par = { else par = {
...@@ -292,7 +276,7 @@ export default { ...@@ -292,7 +276,7 @@ export default {
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
.sop-container { .sop-container {
padding-bottom: 60px; padding-bottom: 60px;
.flex { .flex {
...@@ -307,7 +291,7 @@ export default { ...@@ -307,7 +291,7 @@ export default {
} }
.sop-box { .sop-box {
padding: 0 10px; padding: 0 10px;
margin: 16px; margin: 16px 16px 10px;
box-shadow: 0px 2px 4px 0px rgba(206, 209, 222, 0.12), 0px 2px 8px 0px rgba(206, 209, 222, 0.4); box-shadow: 0px 2px 4px 0px rgba(206, 209, 222, 0.12), 0px 2px 8px 0px rgba(206, 209, 222, 0.4);
border-radius: 4px; border-radius: 4px;
background-color: #fff; background-color: #fff;
...@@ -330,6 +314,7 @@ export default { ...@@ -330,6 +314,7 @@ export default {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
padding: 16px 0; padding: 16px 0;
word-break: break-all;
.text { .text {
word-break: break-all; word-break: break-all;
} }
...@@ -430,5 +415,10 @@ export default { ...@@ -430,5 +415,10 @@ export default {
font-size: 14px; font-size: 14px;
color: #ffffff; color: #ffffff;
} }
.wei-tip {
font-size: 12px;
color: #999999;
margin-left: 16px;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!