Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-content
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dbb6d220
authored
Dec 20, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新代码3.3.0需求代码
1 parent
5d96909c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
309 additions
and
148 deletions
src/api/modules/common.js
src/api/modules/material.js
src/views/material/addMaterial.vue
src/views/material/index.vue
src/api/modules/common.js
View file @
dbb6d22
/*
import
{
http
,
http_common
,
http2
,
http_merchant
}
from
'@/main'
* @Author: yangming yangming@didihu.com.cn
const
defaultPath
=
'scrm.api.carlife.'
* @Date: 2022-11-23 14:46:30
* @LastEditors: yangming yangming@didihu.com.cn
const
getMerchantGoodsListApi
=
params
=>
{
* @LastEditTime: 2022-11-23 17:39:26
params
.
method
=
'scrm.api.shopmall.goods.page.curMerchant'
* @FilePath: \live\src\api\modules\common.js
return
http
({
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
url
:
'rop-scrm-shopmall/router'
,
*/
method
:
'GET'
,
import
{
http_common
}
from
'@/main'
data
:
params
,
sign
:
true
})
}
const
getGoodsListApi
=
params
=>
{
// scrm.api.shopmall.goods.getGoodsList
params
.
method
=
'scrm.api.shopmall.goods.getGoodsList'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
const
uploadImgApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
common.uploadImg`
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
const
uploadMusicApi
=
params
=>
{
params
.
method
=
'scrm.api.carlife.common.uploadMusic'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
const
uploadVideoApi
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
common.uploadVideo`
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
const
uploadFundingVideoApi
=
params
=>
{
params
.
method
=
'scrm.api.carlife.crowd.funding.uploadVideo'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
,
noSignAttr
:
[
'file'
]
})
}
const
getMerchantList
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
merchant.listWithPageByCurMerchant`
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
getSimpleMerchantList
=
params
=>
{
params
.
method
=
'scrm.api.carlife.merchant.listWithPageSimpleByCurMerchant'
return
http
({
url
:
'rop-scrm-carlife/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
getZoneListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.zoneInfo.listCurMerchantId'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
getClassifyListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.classify.list.curMerchant'
return
http
({
url
:
'rop-scrm-shopmall/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
pictureUpload
=
params
=>
{
const
pictureUpload
=
params
=>
{
params
.
method
=
'glsx.accounts.biz.common.pictureUpload'
params
.
method
=
'glsx.accounts.biz.common.pictureUpload'
return
http_common
({
return
http_common
({
...
@@ -17,6 +116,60 @@ const pictureUpload = params => {
...
@@ -17,6 +116,60 @@ const pictureUpload = params => {
noSignAttr
:
[
'file'
]
noSignAttr
:
[
'file'
]
})
})
}
}
export
default
{
pictureUpload
const
querylabeltree
=
params
=>
{
params
.
method
=
'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session
return
http2
({
url
:
'/rop-scrm-datahub/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 人群列表
const
getCrowdTreeListApi
=
params
=>
{
params
.
method
=
'scrm.api.datahub.user.queryCrowdTree'
return
http2
({
url
:
'/rop-scrm-datahub/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 跟进员工类型
const
getStaffFollowerListApi
=
params
=>
{
params
.
method
=
'entmicro.api.staff.listEntFollowerType'
return
http
({
url
:
'/rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 获取商户信息
const
getMerchantInfoApi
=
params
=>
{
params
.
method
=
'merchants.api.merchant.findMerchantBaseInfo'
return
http_merchant
({
url
:
'/rop-merchants/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
// 根据商户号最上级工厂商户号
const
getSuperMerchantApi
=
params
=>
{
params
.
method
=
'merchants.api.open.findSuperlativeMerchant'
return
http_merchant
({
url
:
'/rop-merchants/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
}
export
default
{
getMerchantGoodsListApi
,
getGoodsListApi
,
uploadImgApi
,
uploadMusicApi
,
uploadVideoApi
,
uploadFundingVideoApi
,
getMerchantList
,
getSimpleMerchantList
,
getZoneListApi
,
getClassifyListApi
,
pictureUpload
,
querylabeltree
,
getCrowdTreeListApi
,
getStaffFollowerListApi
,
getMerchantInfoApi
,
getSuperMerchantApi
}
src/api/modules/material.js
View file @
dbb6d22
...
@@ -169,7 +169,15 @@ const findAllDictData = params => {
...
@@ -169,7 +169,15 @@ const findAllDictData = params => {
sign
:
true
sign
:
true
})
})
}
}
const
getStoreList
=
params
=>
{
params
.
method
=
'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return
http
({
url
:
'rop-scrm-entmicro/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
export
default
{
getMaterialList
,
getMaterialList
,
deleteMaterialList
,
deleteMaterialList
,
...
@@ -185,5 +193,6 @@ export default {
...
@@ -185,5 +193,6 @@ export default {
dataOverview
,
dataOverview
,
sendDetailPage
,
sendDetailPage
,
findAllDictData
,
findAllDictData
,
getListEntBusinessType
getListEntBusinessType
,
getStoreList
}
}
src/views/material/addMaterial.vue
View file @
dbb6d22
...
@@ -6,7 +6,14 @@
...
@@ -6,7 +6,14 @@
<h4>
{{
title
}}
</h4>
<h4>
{{
title
}}
</h4>
<el-divider></el-divider>
<el-divider></el-divider>
<div
class=
"m-l-20"
>
<div
class=
"m-l-20"
>
<el-form-item
v-if=
"routeInfo.addOrEdit == 1"
label=
"选择素材组:"
prop=
"groupId"
>
<el-form-item
label=
"选择门店:"
prop=
"targetMerchantId"
>
<el-select
v-model=
"materialAddForm.targetMerchantId"
:disabled=
"notDisplayProperties"
ref=
"selectLabel"
clearable
filterable
:size=
"size"
placeholder=
"请选择门店"
>
<el-option
v-for=
"(item, i) in dataItems"
:key=
"i"
:label=
"item.msgMerchantName"
:value=
"item.msgMerchantId + ''"
></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if=
"!notDisplayProperties"
label=
"选择素材组:"
prop=
"groupId"
>
<el-select
v-model=
"materialAddForm.groupId"
placeholder=
"全部"
:size=
"size"
>
<el-select
v-model=
"materialAddForm.groupId"
placeholder=
"全部"
:size=
"size"
>
<el-option
v-for=
"item in groupCounter"
:key=
"item.id"
:label=
"item.materialGroupName"
<el-option
v-for=
"item in groupCounter"
:key=
"item.id"
:label=
"item.materialGroupName"
:value=
"item.id"
></el-option>
:value=
"item.id"
></el-option>
...
@@ -19,12 +26,13 @@
...
@@ -19,12 +26,13 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"素材名称:"
prop=
"materialName"
>
<el-form-item
label=
"素材名称:"
prop=
"materialName"
>
<el-input
v-model=
"materialAddForm.materialName"
:size=
"size"
placeholder=
"请输入素材名称"
<el-input
:disabled=
"notDisplayProperties"
v-model=
"materialAddForm.materialName"
:size=
"size"
placeholder=
"请输入素材名称"
maxlength=
"30"
></el-input>
maxlength=
"30"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"素材类型:"
prop=
"materialType"
>
<el-form-item
label=
"素材类型:"
prop=
"materialType"
>
<el-radio-group
v-model=
"materialAddForm.materialType"
@
change=
"radioChange"
<el-radio-group
v-model=
"materialAddForm.materialType"
@
change=
"radioChange"
:disabled=
"
routeInfo.addOrEdit == 2 && routeInfo.status != 1
"
>
:disabled=
"
notDisplayProperties
"
>
<el-radio
:label=
"1"
>
PDF文件
</el-radio>
<el-radio
:label=
"1"
>
PDF文件
</el-radio>
<!--
<el-radio
:label=
"2"
>
自定义链接
</el-radio>
-->
<!--
<el-radio
:label=
"2"
>
自定义链接
</el-radio>
-->
<el-radio
:label=
"3"
>
图文
</el-radio>
<el-radio
:label=
"3"
>
图文
</el-radio>
...
@@ -33,9 +41,9 @@
...
@@ -33,9 +41,9 @@
<div
v-show=
"materialAddForm.materialType == 1"
>
<div
v-show=
"materialAddForm.materialType == 1"
>
<div
class=
"pdf-show"
>
<div
class=
"pdf-show"
>
<input
type=
"file"
style=
"opacity: 0"
accept=
".pdf"
<input
type=
"file"
style=
"opacity: 0"
accept=
".pdf"
:disabled=
"
routeInfo.addOrEdit == 2 && routeInfo.status != 1
"
@
change=
"e => handlePdfChange(e)"
/>
:disabled=
"
notDisplayProperties
"
@
change=
"e => handlePdfChange(e)"
/>
<el-button
icon=
"el-icon-plus"
:size=
"size"
<el-button
icon=
"el-icon-plus"
:size=
"size"
:disabled=
"
routeInfo.addOrEdit == 2 && routeInfo.status != 1
"
>
选择文件
:disabled=
"
notDisplayProperties
"
>
选择文件
</el-button>
</el-button>
</div>
</div>
<!--
<div
v-if=
"pdfUrl"
>
{{
pdfUrl
}}
</div>
-->
<!--
<div
v-if=
"pdfUrl"
>
{{
pdfUrl
}}
</div>
-->
...
@@ -59,7 +67,8 @@
...
@@ -59,7 +67,8 @@
<textBox
@
change=
"writeChange"
ref=
"textBox"
@
forbid=
"forbidEdit"
></textBox>
<textBox
@
change=
"writeChange"
ref=
"textBox"
@
forbid=
"forbidEdit"
></textBox>
<el-form-item
label=
"图片:"
class=
"photoWrap"
>
<el-form-item
label=
"图片:"
class=
"photoWrap"
>
<div
class=
"img-div"
>
<div
class=
"img-div"
>
<div
class=
"put-img"
v-for=
"(item,index) in materialAddForm.urlArr"
:key=
"item"
v-show=
"materialAddForm.urlArr[index]"
>
<div
class=
"put-img"
v-for=
"(item,index) in materialAddForm.imageUrlList"
:key=
"item"
v-show=
"materialAddForm.imageUrlList[index]"
>
<img
:src=
"item"
alt=
""
/>
<img
:src=
"item"
alt=
""
/>
<div
class=
"mask"
v-if=
"item"
>
<div
class=
"mask"
v-if=
"item"
>
<h3>
<h3>
...
@@ -69,33 +78,44 @@
...
@@ -69,33 +78,44 @@
</div>
</div>
<img
slot=
"reference"
src=
"@/assets/material/view.png"
alt=
""
/>
<img
slot=
"reference"
src=
"@/assets/material/view.png"
alt=
""
/>
</el-popover>
</el-popover>
<img
class=
"del-img"
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('urlArr',item)"
/>
<img
v-if=
"!notDisplayProperties"
class=
"del-img"
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('imageUrlList',item)"
/>
</h3>
</h3>
</div>
</div>
</div>
</div>
<div
class=
"avatar-uploader-desc"
>
<div
class=
"avatar-uploader-desc"
>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
<input
type=
"file"
style=
"opacity: 0"
accept=
".jpg, .jpeg, .png"
@
change=
"e => handleImgChange(e,'urlArr')"
/>
<input
:class=
"
{disableUpload:notDisplayProperties}" :disabled="notDisplayProperties" type="file"
style="opacity: 0" accept=".jpg, .jpeg, .png"
@change="e => handleImgChange(e,'imageUrlList')"/>
</div>
</div>
<!--
<div
@
click=
"phoneVisible = !phoneVisible"
class=
"view-phone"
>
查看效果>
</div>
-->
<!--
<div
@
click=
"phoneVisible = !phoneVisible"
class=
"view-phone"
>
查看效果>
</div>
-->
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"视频:"
class=
"dis-in-block"
prop=
"mediaUrl"
>
<el-form-item
label=
"视频:"
class=
"photoWrap"
>
<div
class=
"activity-img muti-imgs img-w-h"
>
<div
class=
"img-div"
>
<div
class=
"add-border"
v-show=
"!materialAddForm.mediaUrl"
>
<div
class=
"put-img"
v-if=
"materialAddForm.mediaUrl"
>
<div
class=
"add-icon"
><i
class=
"el-icon-plus"
></i></div>
<div
class=
"add-text"
>
上传
</div>
</div>
<div
class=
"video-panel"
v-if=
"materialAddForm.mediaUrl"
>
<video
id=
"video"
width=
"100%"
height=
"100%"
preload
loop
muted
>
<video
id=
"video"
width=
"100%"
height=
"100%"
preload
loop
muted
>
<source
:src=
"materialAddForm.mediaUrl"
type=
"video/mp4"
/>
<source
:src=
"materialAddForm.mediaUrl"
type=
"video/mp4"
/>
</video>
</video>
<i
class=
"el-icon-video-play"
@
click=
"handleLook('video')"
></i>
<div
class=
"mask"
>
<i
class=
"el-icon-close"
@
click=
"materialAddForm.mediaUrl = ''"
></i>
<h3>
<img
slot=
"reference"
src=
"@/assets/material/view.png"
alt=
""
@
click=
"viewVideo"
/>
<img
v-if=
"!notDisplayProperties"
class=
"del-img"
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('mediaUrl')"
/>
</h3>
</div>
</div>
</div>
<input
v-if=
"!materialAddForm.mediaUrl"
type=
"file"
class=
"activity-Input img-w-h"
accept=
"video/*"
<div
class=
"avatar-uploader-desc"
>
@
change=
"e => handleVideoChange(e)"
style=
"opacity: 0"
/>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传视频
</div>
<input
:class=
"
{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0"
accept="video/*"
@change="e =>handleVideoChange(e,'mediaUrl')"/>
</div>
<!--
<div
@
click=
"phoneVisible = !phoneVisible"
class=
"view-phone"
>
查看效果>
</div>
-->
</div>
</div>
</el-form-item>
</el-form-item>
</div>
</div>
...
@@ -107,7 +127,7 @@
...
@@ -107,7 +127,7 @@
<h4>
追踪设置
</h4>
<h4>
追踪设置
</h4>
<el-divider></el-divider>
<el-divider></el-divider>
<div
form-item-container
class=
"m-l-20"
>
<div
form-item-container
class=
"m-l-20"
>
<el-form-item
prop=
"businessType"
>
<el-form-item
prop=
"businessType"
class=
"trackset"
>
<span
slot=
"label"
>
<span
slot=
"label"
>
<span
class=
"label-word"
>
<span
class=
"label-word"
>
业务类型
业务类型
...
@@ -119,55 +139,12 @@
...
@@ -119,55 +139,12 @@
</span>
</span>
</span>
</span>
<el-checkbox-group
v-model=
"materialAddForm.businessType"
>
<el-checkbox-group
v-model=
"materialAddForm.businessType"
>
<el-checkbox
v-for=
"value in businessTypes"
:key=
"value.businessName"
:label=
"value.id"
>
<el-checkbox
:disabled=
"notDisplayProperties"
v-for=
"value in businessTypes"
:key=
"value.businessName"
:label=
"value.id"
>
{{
value
.
businessName
}}
{{
value
.
businessName
}}
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
</el-form-item>
</el-form-item>
<!--
<el-form-item
prop=
"isNotifySender"
>
-->
<!--
<span
slot=
"label"
>
-->
<!--
<span
class=
"label-word"
>
-->
<!-- 动态通知-->
<!--
<el-popover
placement=
"top-start"
width=
"200"
trigger=
"hover"
--
>
<!-- content="有效浏览:指客户在页面的停留时间超过15秒并且有交互行为,非完全静止">-->
<!--
<img
slot=
"reference"
src=
"@/assets/question.png"
alt=
""
/>
-->
<!--
</el-popover>
-->
<!-- :-->
<!--
</span>
-->
<!--
</span>
-->
<!--
<el-checkbox
:value=
"materialAddForm.isNotifySender"
:checked=
"checked"
@
change=
"notifyChange"
>
-->
<!-- 客户打开素材链接时通知发送人-->
<!--
</el-checkbox>
-->
<!--
<span
class=
"track-tips track-info"
>
(客户不包括本商户的员工)
</span>
-->
<!--
</el-form-item>
-->
<!--
<el-form-item
prop=
"tagJson"
>
-->
<!--
<span
slot=
"label"
>
-->
<!--
<span
class=
"label-word"
>
-->
<!-- 行为标签-->
<!--
<el-popover
placement=
"top-start"
width=
"200"
trigger=
"hover"
--
>
<!-- content="标签失效后在客户信息中看不到此标签,但是在素材效果统计的记录仍然存在">-->
<!--
<img
slot=
"reference"
src=
"@/assets/question.png"
alt=
""
/>
-->
<!--
</el-popover>
-->
<!-- :-->
<!--
</span>
-->
<!--
</span>
-->
<!--
<span
class=
"track-behavior"
>
给浏览了素材的客户自动打上标签,并且标签在30天后自动失效
</span>
-->
<!--
<span
class=
"track-tips track-info"
>
(最多支持3个标签)
</span>
-->
<!-- <!– 选择标签展示 –>-->
<!--
<div
class=
"tag-show"
>
-->
<!--
<div
v-show=
"tagging.length != 0"
:key=
"key"
class=
"input-tag-wrapper"
>
-->
<!--
<span
v-for=
"(tag, idx) in tagging"
:key=
"idx"
>
-->
<!--
<el-tag
v-for=
"(tagItem, idx1) in tag.labelList"
:key=
"idx1"
:size=
"size"
type=
"info"
closable--
>
<!-- :disable-transitions="false" @close="removeTag(tag, idx1, idx)">
{{
tagItem
.
name
}}
</el-tag>
-->
<!--
</span>
-->
<!--
</div>
-->
<!--
<el-button
:size=
"size"
@
click=
"openLabel"
>
-->
<!--
<i
class=
"el-icon-plus"
></i>
-->
<!-- 选择标签-->
<!--
</el-button>
-->
<!--
</div>
-->
<!--
<div
class=
"space"
></div>
-->
<!--
</el-form-item>
-->
</div>
</div>
</div>
</div>
<div
class=
"share"
>
<div
class=
"share"
>
...
@@ -191,11 +168,13 @@
...
@@ -191,11 +168,13 @@
<div
class=
"share-desc"
v-show=
"descVisible"
>
<div
class=
"share-desc"
v-show=
"descVisible"
>
<div
class=
"share-desc-left m-l-20"
>
<div
class=
"share-desc-left m-l-20"
>
<el-form-item
label=
"分享标题:"
>
<el-form-item
label=
"分享标题:"
>
<el-input
v-model=
"materialAddForm.materialTitle"
:size=
"size"
maxlength=
"30"
show-word-limit
<el-input
:disabled=
"notDisplayProperties"
v-model=
"materialAddForm.materialTitle"
:size=
"size"
maxlength=
"30"
show-word-limit
placeholder=
"请输入自定义标题"
></el-input>
placeholder=
"请输入自定义标题"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"描述:"
>
<el-form-item
label=
"描述:"
>
<el-input
type=
"textarea"
v-model=
"materialAddForm.description"
:size=
"size"
maxlength=
"30"
<el-input
:disabled=
"notDisplayProperties"
type=
"textarea"
v-model=
"materialAddForm.description"
:size=
"size"
maxlength=
"30"
show-word-limit
placeholder=
"请输入自定义描述"
></el-input>
show-word-limit
placeholder=
"请输入自定义描述"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"封面:"
>
<el-form-item
label=
"封面:"
>
...
@@ -210,14 +189,16 @@
...
@@ -210,14 +189,16 @@
</div>
</div>
<img
slot=
"reference"
src=
"@/assets/material/view.png"
alt=
""
/>
<img
slot=
"reference"
src=
"@/assets/material/view.png"
alt=
""
/>
</el-popover>
</el-popover>
<img
class=
"del-img"
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('titleUrl')"
/>
<img
v-if=
"!notDisplayProperties"
class=
"del-img"
src=
"@/assets/material/dele.png"
alt=
""
@
click=
"deleteImg('titleUrl')"
/>
</h3>
</h3>
</div>
</div>
</div>
</div>
<div
class=
"avatar-uploader-desc"
>
<div
class=
"avatar-uploader-desc"
>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
<input
type=
"file"
style=
"opacity: 0"
accept=
".jpg, .jpeg, .png"
<input
:class=
"
{disableUpload:notDisplayProperties}" :disabled="notDisplayProperties" type="file"
style="opacity: 0" accept=".jpg, .jpeg, .png"
@change="e => handleImgChange(e,'titleUrl')"/>
@change="e => handleImgChange(e,'titleUrl')"/>
</div>
</div>
<!--
<div
@
click=
"phoneVisible = !phoneVisible"
class=
"view-phone"
>
查看效果>
</div>
-->
<!--
<div
@
click=
"phoneVisible = !phoneVisible"
class=
"view-phone"
>
查看效果>
</div>
-->
...
@@ -260,7 +241,7 @@ import SelectLabel from '@/views/material/components/selectLable'
...
@@ -260,7 +241,7 @@ import SelectLabel from '@/views/material/components/selectLable'
import
bigView
from
'@/components/big-view'
import
bigView
from
'@/components/big-view'
import
upload
from
'@/api/uploadApi'
import
upload
from
'@/api/uploadApi'
import
uploadMixin
from
'@/mixins/upload'
import
uploadMixin
from
'@/mixins/upload'
// import pdfReviewDia from './components/pdfReviewDia.vue'
export
default
{
export
default
{
name
:
'addMaterialForm'
,
name
:
'addMaterialForm'
,
mixins
:
[
uploadMixin
],
mixins
:
[
uploadMixin
],
...
@@ -277,10 +258,12 @@ export default {
...
@@ -277,10 +258,12 @@ export default {
1
:
'创建营销素材'
,
1
:
'创建营销素材'
,
2
:
'编辑营销素材'
2
:
'编辑营销素材'
},
},
loading
:
false
,
loading
:
false
,
dataItems
:
[],
notDisplayProperties
:
''
,
dialogVisibleImg
:
false
,
dialogVisibleImg
:
false
,
dialogSrc
:
''
,
dialogSrc
:
''
,
dialogType
:
''
,
dialogType
:
''
,
routeInfo
:
{},
routeInfo
:
{},
dialogVisible
:
false
,
dialogVisible
:
false
,
tagging
:
[],
tagging
:
[],
...
@@ -301,8 +284,9 @@ export default {
...
@@ -301,8 +284,9 @@ export default {
materialTitle
:
''
,
// 分享标题
materialTitle
:
''
,
// 分享标题
description
:
''
,
// 描述
description
:
''
,
// 描述
titleUrl
:
''
,
// 封面
titleUrl
:
''
,
// 封面
urlArr
:
[],
imageUrlList
:
[],
mediaUrl
:
''
mediaUrl
:
''
,
targetMerchantId
:
''
},
},
groupCounter
:
[],
groupCounter
:
[],
// 分享设置显示
// 分享设置显示
...
@@ -311,6 +295,7 @@ export default {
...
@@ -311,6 +295,7 @@ export default {
// phoneVisible: false,
// phoneVisible: false,
businessTypes
:
[],
businessTypes
:
[],
materialAddFormRules
:
{
materialAddFormRules
:
{
targetMerchantId
:
[{
required
:
true
,
message
:
'请选择门店'
,
trigger
:
'change'
}],
groupId
:
[{
required
:
true
,
message
:
'请选择素材组'
,
trigger
:
'change'
}],
groupId
:
[{
required
:
true
,
message
:
'请选择素材组'
,
trigger
:
'change'
}],
materialName
:
[
materialName
:
[
{
required
:
true
,
message
:
'请输入素材名称'
,
trigger
:
'change'
},
{
required
:
true
,
message
:
'请输入素材名称'
,
trigger
:
'change'
},
...
@@ -330,48 +315,49 @@ export default {
...
@@ -330,48 +315,49 @@ export default {
mounted
()
{
mounted
()
{
this
.
routeInfo
=
this
.
$route
.
query
this
.
routeInfo
=
this
.
$route
.
query
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getMaterialInfo
()
:
''
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getMaterialInfo
()
:
''
this
.
routeInfo
.
addOrEdit
!=
1
?
(
this
.
routeInfo
.
status
!=
1
?
this
.
forbidEdit
()
:
''
)
:
''
this
.
routeInfo
.
addOrEdit
==
3
?
this
.
forbidEdit
(
)
:
''
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
notDisplayProperties
=
this
.
routeInfo
.
addOrEdit
==
3
this
.
materialInsert
()
this
.
materialInsert
()
this
.
getMaterialList
()
this
.
getMaterialList
()
// this.findAllDictData('business_type')
// this.findAllDictData('business_type')
this
.
getListEntBusinessType
()
this
.
getListEntBusinessType
()
this
.
loadUpData
()
},
},
methods
:
{
methods
:
{
handleLook
(
type
)
{
async
loadUpData
()
{
this
.
dialogType
=
type
const
params
=
{
pageNum
:
1
,
pageSize
:
10000
}
await
this
.
$apis
.
material
.
getStoreList
(
params
).
then
(
res
=>
{
this
.
dataItems
=
res
||
[]
})
},
viewVideo
()
{
this
.
dialogVisibleImg
=
true
this
.
dialogVisibleImg
=
true
this
.
dialogSrc
=
t
ype
==
'img'
?
this
.
materialAddForm
.
coverUrl
:
t
his
.
materialAddForm
.
mediaUrl
this
.
dialogSrc
=
this
.
materialAddForm
.
mediaUrl
},
},
handleVideoChange
(
e
)
{
handleVideoChange
(
e
)
{
const
self
=
this
let
file
=
e
.
srcElement
.
files
[
0
]
let
file
=
e
.
target
.
files
[
0
]
let
reader
=
new
FileReader
()
const
isLt
=
file
.
size
/
1024
/
1024
<
20
// // 默认1MB
const
limitSize
=
20
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
if
(
!
isLt
)
{
this
.
$message
.
error
(
'上传视频大小不能超过'
+
20
+
'MB!'
)
this
.
$message
.
error
(
'上传视频大小不能超过'
+
limitSize
+
'MB!'
)
return
true
return
true
}
}
self
.
loading
=
true
reader
.
readAsDataURL
(
file
)
upload
.
init
().
then
(
res
=>
{
reader
.
onload
=
e
=>
{
if
(
res
.
status
==
0
)
{
const
imgFile
=
e
.
target
.
result
upload
const
base64
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
.
uploaded
(
file
)
this
.
$apis
.
common
.
uploadVideoApi
({
file
:
base64
}).
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
)
{
const
videoUrl
=
res
.
video
.
url
this
.
materialAddForm
.
mediaUrl
=
res
self
.
$set
(
self
.
materialAddForm
,
'mediaUrl'
,
videoUrl
)
}
self
.
loading
=
false
})
})
}
.
finally
(
end
=>
{
console
.
log
(
end
)
})
upload
.
uploadEvent
(
''
,
res
=>
{
console
.
log
(
res
,
'视频上传完成'
)
})
upload
.
uploadEvent
(
'media_progress'
,
res
=>
{
console
.
log
(
res
)
})
}
})
},
},
getParams
()
{
getParams
()
{
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
materialAddForm
))
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
materialAddForm
))
...
@@ -421,14 +407,16 @@ export default {
...
@@ -421,14 +407,16 @@ export default {
return
params
return
params
},
},
// 获取素材详情
// 获取素材详情
getMaterialInfo
()
{
async
getMaterialInfo
()
{
var
params
=
{}
let
params
=
{}
params
.
id
=
this
.
routeInfo
.
id
params
.
id
=
this
.
routeInfo
.
id
if
(
this
.
routeInfo
.
status
==
-
1
)
{
// if (this.routeInfo.status == -1) {
params
.
flag
=
0
// params.flag = 0
}
// }
this
.
$apis
.
material
.
materialDetail
(
params
).
then
(
res
=>
{
params
.
flag
=
0
await
this
.
$apis
.
material
.
materialDetail
(
params
).
then
(
res
=>
{
this
.
materialAddForm
=
res
this
.
materialAddForm
=
res
this
.
materialAddForm
.
targetMerchantId
=
res
.
merchantId
+
''
||
''
if
(
res
.
businessType
)
{
if
(
res
.
businessType
)
{
const
businessTypeArr
=
this
.
materialAddForm
.
businessType
.
split
(
','
)
const
businessTypeArr
=
this
.
materialAddForm
.
businessType
.
split
(
','
)
this
.
materialAddForm
.
businessType
=
businessTypeArr
.
map
(
item
=>
parseInt
(
item
))
this
.
materialAddForm
.
businessType
=
businessTypeArr
.
map
(
item
=>
parseInt
(
item
))
...
@@ -485,18 +473,6 @@ export default {
...
@@ -485,18 +473,6 @@ export default {
})
})
},
},
// 获取所有业务类型
// 获取所有业务类型
// findAllDictData(dictType) {
// var params = {
// dictType
// }
// this.$apis.material.findAllDictData(params).then(res => {
// if (res) {
// if (dictType == 'business_type') {
// this.businessTypes = res
// }
// }
// })
// },
getListEntBusinessType
()
{
getListEntBusinessType
()
{
var
params
=
{}
var
params
=
{}
// flag 0-跟进专员调用 1-素材调用
// flag 0-跟进专员调用 1-素材调用
...
@@ -529,7 +505,6 @@ export default {
...
@@ -529,7 +505,6 @@ 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('.')[1] + '@' + imgFile.split(',')[1]
const
base64
=
file
.
name
.
slice
(
-
3
)
+
'@'
+
imgFile
.
split
(
','
)[
1
]
const
base64
=
file
.
name
.
slice
(
-
3
)
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
...
@@ -561,14 +536,19 @@ export default {
...
@@ -561,14 +536,19 @@ export default {
const
base64
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
const
base64
=
file
.
name
.
split
(
'.'
)[
file
.
name
.
split
(
'.'
).
length
-
1
]
+
'@'
+
imgFile
.
split
(
','
)[
1
]
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
this
.
$apis
.
common
.
pictureUpload
({
file
:
base64
}).
then
(
res
=>
{
if
(
res
)
{
if
(
res
)
{
if
(
Array
.
isArray
(
this
.
materialAddForm
[
params
])
)
{
if
(
Array
.
isArray
(
this
.
materialAddForm
[
params
])
||
this
.
materialAddForm
[
params
]
==
null
)
{
if
(
this
.
materialAddForm
[
params
]
.
length
>
8
)
{
if
(
this
.
materialAddForm
[
params
]
&&
this
.
materialAddForm
[
params
].
length
>
8
)
{
this
.
$message
.
error
(
'图片最多可上传9张'
)
this
.
$message
.
error
(
'图片最多可上传9张'
)
return
return
}
else
{
}
else
{
this
.
materialAddForm
[
params
].
push
(
res
)
if
(
!
this
.
materialAddForm
[
params
])
{
this
.
materialAddForm
[
params
]
=
[]
this
.
materialAddForm
[
params
][
0
]
=
res
}
else
{
this
.
materialAddForm
[
params
].
push
(
res
)
}
}
}
}
else
{
}
else
{
this
.
materialAddForm
[
params
]
=
res
this
.
materialAddForm
[
params
]
=
res
}
}
}
}
...
@@ -613,6 +593,7 @@ export default {
...
@@ -613,6 +593,7 @@ export default {
},
},
// 提交
// 提交
handleSubmit
()
{
handleSubmit
()
{
console
.
log
(
typeof
this
.
materialAddForm
.
targetMerchantId
)
this
.
$refs
.
materialAddForm
.
validate
(
valid
=>
{
this
.
$refs
.
materialAddForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
var
params
=
this
.
getParams
()
var
params
=
this
.
getParams
()
...
@@ -625,6 +606,7 @@ export default {
...
@@ -625,6 +606,7 @@ export default {
}
}
// status 状态 0 启用 -1 禁用 1 存草稿
// status 状态 0 启用 -1 禁用 1 存草稿
params
.
status
=
0
params
.
status
=
0
params
.
createdType
=
1
let
material
let
material
if
(
params
.
id
)
{
if
(
params
.
id
)
{
material
=
'materialEdit'
material
=
'materialEdit'
...
@@ -707,10 +689,10 @@ export default {
...
@@ -707,10 +689,10 @@ export default {
this
.
isUpdate
=
true
this
.
isUpdate
=
true
},
},
// 删除上传图片
// 删除上传图片
deleteImg
(
params
,
content
)
{
deleteImg
(
params
,
content
)
{
if
(
Array
.
isArray
(
this
.
materialAddForm
[
params
])){
if
(
Array
.
isArray
(
this
.
materialAddForm
[
params
]))
{
this
.
materialAddForm
[
params
]
=
this
.
materialAddForm
[
params
].
filter
((
item
)
=>
item
!==
content
);
this
.
materialAddForm
[
params
]
=
this
.
materialAddForm
[
params
].
filter
((
item
)
=>
item
!==
content
);
}
else
{
}
else
{
this
.
materialAddForm
[
params
]
=
''
this
.
materialAddForm
[
params
]
=
''
}
}
},
},
...
@@ -728,6 +710,11 @@ export default {
...
@@ -728,6 +710,11 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.disableUpload
{
cursor
:
not-allowed
;
cursor
:
no-drop
;
}
/
deep
/
.el-form-item__label
{
/
deep
/
.el-form-item__label
{
width
:
154px
;
width
:
154px
;
}
}
...
@@ -784,6 +771,7 @@ export default {
...
@@ -784,6 +771,7 @@ export default {
.dis-in-block
{
.dis-in-block
{
margin-left
:
-154px
;
margin-left
:
-154px
;
.activity-img
{
.activity-img
{
width
:
104px
;
width
:
104px
;
height
:
104px
;
height
:
104px
;
...
@@ -872,15 +860,20 @@ export default {
...
@@ -872,15 +860,20 @@ export default {
}
}
}
}
.photoWrap
{
.photoWrap
{
margin-top
:
20px
;
margin-top
:
20px
;
margin-left
:
-154px
;
margin-left
:
-154px
;
}
}
.space
{
.space
{
margin-bottom
:
32px
;
margin-bottom
:
32px
;
}
}
.track
{
.track
{
.trackset
{
padding-bottom
:
20px
;
}
&
-tips
{
&
-tips
{
font-size
:
14px
;
font-size
:
14px
;
color
:
#999999
;
color
:
#999999
;
...
@@ -1194,6 +1187,7 @@ ul {
...
@@ -1194,6 +1187,7 @@ ul {
}
}
}
}
}
}
.video-dsialog
{
.video-dsialog
{
z-index
:
2001
;
z-index
:
2001
;
position
:
fixed
;
position
:
fixed
;
...
@@ -1203,6 +1197,7 @@ ul {
...
@@ -1203,6 +1197,7 @@ ul {
left
:
0
;
left
:
0
;
overflow
:
auto
;
overflow
:
auto
;
background
:
rgba
(
$
color
:
#000000
,
$
alpha
:
0.5
);
background
:
rgba
(
$
color
:
#000000
,
$
alpha
:
0.5
);
&-panel
{
&-panel
{
background
:
#000000
;
background
:
#000000
;
position
:
absolute
;
position
:
absolute
;
...
@@ -1214,10 +1209,12 @@ ul {
...
@@ -1214,10 +1209,12 @@ ul {
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
10px
20px
20px
;
padding
:
10px
20px
20px
;
overflow
:
hidden
;
overflow
:
hidden
;
.video-close
{
.video-close
{
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
height
:
40px
;
height
:
40px
;
i
{
i
{
cursor
:
pointer
;
cursor
:
pointer
;
font-size
:
25px
;
font-size
:
25px
;
...
...
src/views/material/index.vue
View file @
dbb6d22
...
@@ -247,14 +247,16 @@ export default {
...
@@ -247,14 +247,16 @@ export default {
{
{
// type: 'GLButton',
// type: 'GLButton',
type
:
'el-button'
,
type
:
'el-button'
,
name
:
'编辑'
,
name
:
row
=>
{
return
row
.
createdType
==
2
?
'查看'
:
'编辑'
},
attrs
:
{
attrs
:
{
type
:
'text'
,
type
:
'text'
,
fn
:
'编辑'
fn
:
'编辑'
},
},
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
addMaterial
(
2
,
row
)
click
:
row
=>
row
.
createdType
==
2
?
this
.
addMaterial
(
3
,
row
)
:
this
.
addMaterial
(
2
,
row
)
}
}
},
},
{
{
// type: 'GLButton',
// type: 'GLButton',
...
@@ -521,7 +523,7 @@ export default {
...
@@ -521,7 +523,7 @@ export default {
addMaterial
(
addOrEdit
,
scope
)
{
addMaterial
(
addOrEdit
,
scope
)
{
let
params
=
{
let
params
=
{
addOrEdit
:
addOrEdit
,
addOrEdit
:
addOrEdit
,
$title
:
encodeURI
(
addOrEdit
==
1
?
'创建营销素材'
:
'编辑
营销素材'
)
$title
:
encodeURI
(
addOrEdit
==
1
?
'创建营销素材'
:
addOrEdit
==
2
?
'编辑营销素材'
:
'查看
营销素材'
)
}
}
addOrEdit
!=
1
&&
(
params
.
id
=
scope
.
id
)
addOrEdit
!=
1
&&
(
params
.
id
=
scope
.
id
)
addOrEdit
!=
1
&&
(
params
.
status
=
scope
.
status
)
addOrEdit
!=
1
&&
(
params
.
status
=
scope
.
status
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment