Commit ad5f152b by ext.wangyuman1

客户朋友圈模块

1 parent 6dcf1d0d
......@@ -10,7 +10,7 @@
<div class="g-card" v-if="showModle">
<el-button type="primary" @click="welcomVisible = true">从模板库中选择</el-button>
</div>
<div class="g-card">
<div class="g-card" v-if="!detail">
<div
class="g-card-title"
v-if="iswelcom || (moduleType === 4 && otherType !== 3)"
......@@ -80,11 +80,12 @@
clearable
:autofocus="true"
@input="changeInfo"
v-if="!detail"
/>
</el-form-item>
</el-form>
</div>
<div class="g-card">
<div class="g-card" v-if="!detail">
<div class="g-card-title" v-if="otherType !== 3">
{{ titleTwo }}
<el-popover
......@@ -189,15 +190,17 @@
@setData="setData"
@getEdit="getEdit"
:dargAble="[2].includes(moduleType)"
:isDeatail="detail"
/>
</div>
<div
class="g-card mt20 g-pad20"
style="text-align: left"
v-if="
(talkList.length && moduleType === 2) ||
(otherType !== 3 && moduleType !== 2) ||
(otherType === 3 && moduleType !== 2)
((talkList.length && moduleType === 2) ||
(otherType !== 3 && moduleType !== 2) ||
(otherType === 3 && moduleType !== 2)) &&
!detail
"
>
<!-- 话术中心,有列表才显示 -->
......@@ -210,7 +213,7 @@
<el-button @click="getCancel" v-if="moduleType !== 4">取消</el-button>
<el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button>
</template>
<template v-else-if="otherType === 3 && moduleType !== 2 && !detail">
<template v-else-if="otherType === 3 && moduleType !== 2">
<el-button @click="goBack">取消</el-button>
<el-button type="primary" v-loading="talkLoading" @click="tackSubmit">确定</el-button>
</template>
......
<template>
<div>
<!-- 表格拖拽组件 -->
<el-table :data="tableData" ref="singleTable" highlight-current-row row-key="id" class="load_table">
<el-table
:data="tableData"
ref="singleTable"
highlight-current-row
row-key="id"
class="load_table"
>
<!-- <el-table-column type="index" width="50" label="序号" align="center"></el-table-column> -->
<el-table-column label="" width="50" align="left" v-if="dargAble">
<svg-icon icon="dragIcon" />
......@@ -12,13 +18,16 @@
<el-tooltip
:content="row.materialName"
placement="top"
:disabled="row.materialName ? row.materialName.length < 12 : true">
:disabled="row.materialName ? row.materialName.length < 12 : true"
>
<span class="title">{{ coverContent(row.materialName, 12) }}</span>
</el-tooltip>
<!-- 文本 -->
<div v-if="row.mediaType === '4'">
<el-tooltip placement="top" :disabled="row.content ? row.content.length < 50 : true">
<template #content><p style="white-space: pre-line" v-html="row.content"></p></template>
<template #content
><p style="white-space: pre-line" v-html="row.content"></p
></template>
<span class="twosplice">{{ coverContent(row.content, 50) }}</span>
</el-tooltip>
</div>
......@@ -28,11 +37,20 @@
</div>
<!-- 图文 -->
<div v-if="row.mediaType === '9'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
<el-image
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else>
<svg-icon class="icon-style" icon="imgText"></svg-icon>
</div>
<el-tooltip :content="row.content" placement="top" :disabled="row.content ? row.content.length < 50 : true">
<el-tooltip
:content="row.content"
placement="top"
:disabled="row.content ? row.content.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.content, 50) }}</span>
</el-tooltip>
</div>
......@@ -42,18 +60,31 @@
</div>
<!-- 文章 -->
<div v-if="row.mediaType === '12'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
<el-image
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else>
<svg-icon class="icon-style" icon="article"></svg-icon>
</div>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
<!-- 视频 -->
<div v-if="row.mediaType === '2'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
......@@ -61,16 +92,27 @@
<div v-if="row.mediaType === '3'" style="display: flex">
<!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> -->
<div class="icon-style" v-if="row.materialUrl">
<svg-icon class="icon-style" :icon="row.materialUrl ? filType(row.materialUrl) : ''"></svg-icon>
<svg-icon
class="icon-style"
:icon="row.materialUrl ? filType(row.materialUrl) : ''"
></svg-icon>
</div>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
<!-- 海报 -->
<div v-if="row.mediaType === '5'" style="display: flex">
<el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
......@@ -110,7 +152,7 @@
>编辑</el-button
> -->
<el-button text @click="edit(scope.row)" v-if="scope.row.moduleType != 1">编辑</el-button>
<el-button text @click="remove(scope.row.delId)">移除</el-button>
<el-button text @click="remove(scope.row.delId)" v-if="!isDeatail">移除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -130,6 +172,11 @@ export default {
type: Boolean,
default: false,
},
// 是否为详情页面
isDeatail: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -166,7 +213,7 @@ export default {
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
}),
})
)
},
preview(row) {
......@@ -245,7 +292,9 @@ export default {
},
//表格拖动排序
dragSort() {
const el = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper table > tbody')[0]
const el = this.$refs.singleTable.$el.querySelectorAll(
'.el-table__body-wrapper table > tbody'
)[0]
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost',
......
......@@ -62,8 +62,8 @@ let config = {
services: {
wecom: '/open',
// system: env.SYSTEM_API,
system: 'http://192.168.4.168:6180',
system: env.SYSTEM_API,
// system: 'http://192.168.4.168:6180',
common: '/common',
},
......
<template>
<div class="content">
<!-- 欢迎语 -->
<div class="item" v-if="templateInfo">
<!-- <div class="avatar222"><img src="../../assets/drainageCode/header.png" /></div> -->
<div class="msg">
<div class="word">
<p
style="line-height: 18px"
v-html="templateInfo?.replace(/\n|\r\n/g, '<br>').replace(/ /g, ' &nbsp')"
></p>
</div>
</div>
</div>
<div class="item" v-for="(data, key) in list" :key="key">
<!-- <div class="avatar222"><img src="../../assets/drainageCode/header.png" /></div> -->
<div class="msg" v-if="data.mediaType === '4'">
<div class="word">
<p style="white-space: pre-line">{{ data.content }}</p>
</div>
</div>
<div class="msg" v-if="data.mediaType === '0'">
<div class="image">
<img :src="data.materialUrl" />
</div>
</div>
<div class="msg" v-if="data.mediaType === '9'">
<div class="word-and-image">
<div>
{{ data.materialName }}
</div>
<div class="sub-content">
<div>
{{ data.content }}
</div>
<div>
<img :src="data.coverUrl" v-if="data.coverUrl && data.coverUrl != ''" />
<svg-icon class="icon-style" icon="imgText" v-else></svg-icon>
</div>
</div>
</div>
</div>
<!-- 文章 -->
<div class="msg" v-if="data.mediaType === '12'">
<div class="word-and-image">
<div>
{{ data.materialName }}
</div>
<div class="sub-content">
<div>
{{ data.digest }}
</div>
<div>
<img :src="data.coverUrl" v-if="data.coverUrl && data.coverUrl != ''" />
<svg-icon class="icon-style" icon="article" v-else></svg-icon>
</div>
</div>
</div>
</div>
<!-- 视频 -->
<div class="msg" v-if="data.mediaType === '2'">
<div class="word-and-image">
<div>
{{ data.materialName }}
</div>
<div class="sub-content">
<div>
{{ data.digest }}
</div>
<div>
<img :src="data.coverUrl" v-if="data.coverUrl && data.coverUrl != ''" />
<svg-icon class="icon-style" icon="pic" v-else></svg-icon>
</div>
</div>
</div>
</div>
<!-- 文件 -->
<div class="msg" v-if="data.mediaType === '3'">
<div class="word-and-image">
<div>
{{ data.materialName }}
</div>
<div class="sub-content">
<div>
{{ data.digest }}
</div>
<div>
<svg-icon
class="icon-style"
:icon="data.materialUrl ? filType(data.materialUrl) : ''"
v-if="data.materialUrl"
></svg-icon>
</div>
</div>
</div>
</div>
<!-- 海报 -->
<div class="msg" v-if="data.mediaType === '5'">
<div class="word-and-image">
<div>
{{ data.materialName }}
</div>
<div class="sub-content">
<div>
{{ data.digest }}
</div>
<div>
<img :src="data.materialUrl" v-if="data.materialUrl && data.materialUrl != ''" />
<svg-icon class="icon-style" icon="pic" v-else></svg-icon>
</div>
</div>
</div>
</div>
</div>
<div v-if="article">
<p v-html="article"></p>
</div>
</div>
</template>
<script>
export default {
name: 'preview-client',
components: {},
props: {
name: {
type: String,
default: '客户',
},
// 文章详情展示
article: {
type: String,
default: null,
},
// 内容
templateInfo: {
type: String,
default: null,
},
list: {
type: Array,
default: () => [],
},
},
watch: {},
data() {
return {}
},
computed: {},
created() {},
mounted() {},
methods: {
// 处理文件类型
filType(file) {
let filecontent = JSON.parse(JSON.stringify(file))
filecontent = filecontent.split('.')
let type = filecontent[filecontent.length - 1]
if (type === 'pdf') {
return 'pdf'
} else if (['doc', 'docx'].includes(type)) {
return 'word'
} else if (['ppt', 'pptx', 'pps', 'pptsx'].includes(type)) {
return 'ppt'
} else {
return ''
}
},
},
}
</script>
<style lang="scss" scoped>
.redBox {
min-height: 26px;
display: inline-block;
box-sizing: border-box;
word-break: break-all;
margin-left: 5px;
.red-box {
width: 165px;
height: 68px;
background-image: url('../../assets/image/newred.png');
background-size: 100%;
background-repeat: no-repeat;
padding-top: 20px;
border-radius: 4px;
.red-text {
font-size: 14px;
color: #fff;
margin-left: 56px;
width: 98px;
white-space: nowrap; // 强制一行
text-overflow: ellipsis; // 文字溢出显示省略号
overflow: hidden; // 溢出隐藏
}
}
}
.function {
width: 160px;
.function-item {
width: 160px;
min-height: 76px;
border-width: 1px;
border-style: solid;
border-color: rgba(242, 242, 242, 1);
border-radius: 5px;
display: flex;
padding: 10px;
padding-top: 6px;
cursor: pointer;
.card-style {
margin-right: 10px;
margin-top: 8px;
font-size: 32px;
}
.card-name {
font-size: 14px;
line-height: 26px;
width: 98px;
white-space: nowrap; // 强制一行
text-overflow: ellipsis; // 文字溢出显示省略号
overflow: hidden; // 溢出隐藏
}
.item-text {
font-size: 12px;
color: #aaaaaa;
line-height: 14px;
width: 98px;
}
}
}
.icon-style {
width: 40px;
height: 40px;
}
.content {
padding: 15px;
.item {
font-size: 12px;
font-weight: 400;
color: #666666;
display: flex;
margin-top: 20px;
&:first-child {
margin-top: 0;
}
.avatar222 {
// align-self: center;
margin-right: 5px;
}
.msg {
position: relative;
min-height: 26px;
background: #ffffff;
box-shadow: 0px 2px 6px 0px rgba(60, 136, 240, 0.1);
border: 1px solid #e1edfc;
display: inline-block;
border-radius: 4px;
box-sizing: border-box;
word-break: break-all;
margin-left: 5px;
&:before {
content: ' ';
display: block;
position: absolute;
left: -5px;
box-shadow: 0px 2px 6px 0px rgba(60, 136, 240, 0.1);
border-width: 5px;
border-left: 0;
width: 0;
border-style: solid;
border-color: transparent;
border-right-color: #fff;
top: 8px;
z-index: 888;
}
.word {
padding: 5px 12px;
}
.image {
padding: 12px;
img {
width: 94px;
height: 90px;
}
}
.word-and-image {
padding: 12px;
.sub-content {
margin-top: 10px;
display: flex;
justify-content: space-between;
font-size: 12px;
font-weight: 400;
color: #999999;
img {
height: 40px;
width: 40px;
}
}
}
.miniprogram {
padding: 12px;
.mini-header {
display: flex;
align-items: center;
img {
height: 18px;
width: 18px;
margin-right: 5px;
}
}
.mini-img {
margin: 10px 0;
width: 143px;
height: 120px;
}
.mini-footer {
display: flex;
align-items: center;
img {
height: 14px;
width: 14px;
margin-right: 5px;
}
}
}
}
}
}
</style>
......@@ -123,9 +123,21 @@
<el-button type="primary" plain @click="selectedFn2">选择标签</el-button>
</div>
</el-form-item>
<el-form-item label="朋友圈内容:" prop="name">
<el-input
v-model="form.content"
placeholder="未填写文本内容"
:disabled="true"
type="textarea"
:rows="4"
v-if="firendType === 1"
></el-input>
<div class="firend-box" v-if="[2, 3].includes(firendType)">
<FirendContent />
</div>
</el-form-item>
</div>
<!-- <FriendCircleContent ref="friendCircleContent" :data="form"></FriendCircleContent> -->
{{firendId}}
<AddMaterial
:moduleType="4"
@update="onBackStep"
......@@ -133,6 +145,7 @@
:otherType="3"
:showPhone="false"
:detail="firendId !== undefined"
v-if="!firendId || (firendId && firendType === 1)"
></AddMaterial>
<!-- <el-form-item label-width="0" style="margin-top: 20px; margin-bottom: 0">
......@@ -166,6 +179,7 @@
import { addMoments, numMoments, getDetail } from '@/api/circle'
import AddMaterial from '@/components/ContentCenter/AddMaterial'
import SelectMember from './components/SelectMember.vue'
import FirendContent from './components/FirendContent.vue'
import moment from 'moment'
export default {
......@@ -173,6 +187,7 @@ export default {
components: {
AddMaterial,
SelectMember,
FirendContent,
SelectTag: defineAsyncComponent(() => import('@/components/SelectTag')),
FriendCircleContent: defineAsyncComponent(() => import('@/components/FriendCircleContent')),
},
......@@ -220,11 +235,14 @@ export default {
],
},
firendId: undefined,
firendType: undefined,
}
},
mounted() {
this.firendId = this.$route.query.id
this.firendType = this.$route.query.type
this.firendId = 1
this.firendType = 1
if (this.firendId) {
// 详情页面
this.getDetail(this.firendId)
......@@ -387,81 +405,87 @@ export default {
return ''
}
},
dealType(data) {
this.form.otherContent = []
let arr = {}
let linkUrl =
window.document.location.origin + '/mobile/#/metrialDetail?materiaId=' + data.materialId
switch (data.realType) {
case 0:
arr = {
annexType: 'link',
annexUrl: data.picUrl,
other: data.picUrl,
}
this.form.otherContent.push(arr)
break
case 2:
arr = {
annexType: 'link',
annexUrl: linkUrl,
other: data.picUrl,
title: data.title,
}
this.form.otherContent.push(arr)
break
case 3:
arr = {
annexType: 'link',
annexUrl: linkUrl,
other: this.filPicType(data.fileUrl),
title: data.title,
}
this.form.otherContent.push(arr)
break
case 4:
arr = {
annexType: 'link',
annexUrl: linkUrl,
other: data.content,
title: data.title,
}
this.form.otherContent.push(arr)
break
case 5:
arr = {
annexType: 'link',
annexUrl: linkUrl,
other: data.fileUrl,
title: data.title,
}
this.form.otherContent.push(arr)
break
case 9:
arr = {
annexType: 'link',
annexUrl: data.linkUrl,
other: data.picUrl ? data.picUrl : window.lwConfig.DEFAULT_H5_TP,
title: data.title,
}
this.form.otherContent.push(arr)
break
case 12:
arr = {
annexType: 'link',
annexUrl: linkUrl,
other: data.picUrl ? data.picUrl : window.lwConfig.DEFAULT_H5_ART,
title: data.title,
}
this.form.otherContent.push(arr)
break
}
},
// dealType(data) {
// this.form.otherContent = []
// let arr = {}
// let linkUrl =
// window.document.location.origin + '/mobile/#/metrialDetail?materiaId=' + data.materialId
// switch (data.realType) {
// case 0:
// arr = {
// annexType: 'link',
// annexUrl: data.picUrl,
// other: data.picUrl,
// }
// this.form.otherContent.push(arr)
// break
// case 2:
// arr = {
// annexType: 'link',
// annexUrl: linkUrl,
// other: data.picUrl,
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// case 3:
// arr = {
// annexType: 'link',
// annexUrl: linkUrl,
// other: this.filPicType(data.fileUrl),
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// case 4:
// arr = {
// annexType: 'link',
// annexUrl: linkUrl,
// other: data.content,
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// case 5:
// arr = {
// annexType: 'link',
// annexUrl: linkUrl,
// other: data.fileUrl,
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// case 9:
// arr = {
// annexType: 'link',
// annexUrl: data.linkUrl,
// other: data.picUrl ? data.picUrl : window.lwConfig.DEFAULT_H5_TP,
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// case 12:
// arr = {
// annexType: 'link',
// annexUrl: linkUrl,
// other: data.picUrl ? data.picUrl : window.lwConfig.DEFAULT_H5_ART,
// title: data.title,
// }
// this.form.otherContent.push(arr)
// break
// }
// },
},
}
</script>
<style lang="scss" scoped>
.firend-box {
width: 360px;
min-height: 100px;
border: 1px solid #dfe4ed;
padding: 12px;
}
.tips {
color: #aaa;
font-size: 12px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!