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