Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
457a6f09
Commit
457a6f09
authored
Dec 18, 2021
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 微信图文升级
parent
8785da84
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
25 deletions
+116
-25
imgtextpublic.vue
src/components/libs/imgTextTemp/imgtextpublic.vue
+11
-0
index.vue
src/components/libs/imgTextTemp/index.vue
+93
-23
syncImgtext.vue
src/components/libs/imgTextTemp/syncImgtext.vue
+1
-1
wechat.js
src/router/modules/wechat.js
+8
-0
wechatApi.js
src/service/api/wechatApi.js
+2
-0
editor.vue
src/views/wechat/editor.vue
+1
-1
No files found.
src/components/libs/imgTextTemp/imgtextpublic.vue
0 → 100644
View file @
457a6f09
<
template
>
<img-text
is-publish
></img-text>
</
template
>
<
script
>
import
ImgText
from
'./index.vue'
;
export
default
{
name
:
'imgtextpublic'
,
components
:
{
ImgText
}
};
</
script
>
src/components/libs/imgTextTemp/index.vue
View file @
457a6f09
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
图文消息(共
{{
total
}}
条)
图文消息(共
{{
total
}}
条)
<el-input
v-model=
"listParams.searchName"
clearable
class=
"w200 ml10"
placeholder=
"请输入标题/作者"
@
change=
"loadImgTextList"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i></el-input>
<el-input
v-model=
"listParams.searchName"
clearable
class=
"w200 ml10"
placeholder=
"请输入标题/作者"
@
change=
"loadImgTextList"
><i
slot=
"prefix"
class=
"el-input__icon el-icon-search"
></i></el-input>
<el-checkbox
class=
"vertical-middle ml0"
v-if=
"$store.state.marketing.isShowSelf && showSelf"
v-model=
"listParams.showSelfFlag"
:true-label=
"1"
:false-label=
"0"
label=
"仅看本人"
border
@
change=
"loadImgTextList"
/>
<el-checkbox
class=
"vertical-middle ml0"
v-if=
"$store.state.marketing.isShowSelf && showSelf"
v-model=
"listParams.showSelfFlag"
:true-label=
"1"
:false-label=
"0"
label=
"仅看本人"
border
@
change=
"loadImgTextList"
/>
<el-checkbox
class=
"vertical-middle ml0"
v-model=
"listParams.wxscType"
:true-label=
"3"
:false-label=
"4"
label=
"仅看历史图文"
border
@
change=
"loadImgTextList"
/>
<el-checkbox
class=
"vertical-middle ml0"
v-model=
"listParams.wxscType"
v-if=
"!isPublish && !isGroupSend"
:true-label=
"3"
:false-label=
"4"
label=
"仅看历史图文"
border
@
change=
"loadImgTextList"
/>
</div>
</div>
<div>
<div>
<el-button
type=
"primary"
@
click=
"add"
>
新建图文
</el-button>
<el-button
type=
"primary"
v-if=
"!isPublish"
@
click=
"add"
>
新建图文
</el-button>
<el-button
v-if=
"auto"
@
click=
"check"
>
检查同步
</el-button>
<el-button
v-if=
"auto"
@
click=
"check"
>
检查同步
</el-button>
</div>
</div>
</div>
</div>
...
@@ -19,14 +19,20 @@
...
@@ -19,14 +19,20 @@
<div
class=
"label-hidden"
><el-radio
:label=
"scope.row"
></el-radio></div>
<div
class=
"label-hidden"
><el-radio
:label=
"scope.row"
></el-radio></div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"图文信息"
align=
"left"
>
<el-table-column
label=
"图文信息"
align=
"left"
min-width=
"200px"
>
<div
class=
"media-info"
slot-scope=
"scope"
>
<div
class=
"media-info"
slot-scope=
"scope"
>
<img
width=
"100"
height=
"100"
:src=
"scope.row.itemList.length ? scope.row.itemList[0].qcloudImageUrl || '' : ''"
alt=
""
/>
<img
width=
"100"
height=
"100"
:src=
"scope.row.itemList.length ? scope.row.itemList[0].qcloudImageUrl || '' : ''"
alt=
""
/>
<div
class=
"media-title"
>
<div
class=
"media-title"
>
<p>
<p>
标题:
<a
class=
"blue"
:href=
"scope.row.itemList.length ? scope.row.itemList[0].mediaUrl || '' : ''"
target=
"_blank"
>
{{ scope.row.itemList.length ? scope.row.itemList[0].titleName || '' : '' }}
</a>
标题:
<a
class=
"blue"
:href=
"scope.row.itemList.length ? scope.row.itemList[0].mediaUrl || '' : ''"
target=
"_blank"
>
{{ scope.row.itemList.length ? scope.row.itemList[0].titleName || '' : '' }}
</a>
</p>
</p>
<p>
图文m_id:{{ scope.row.draftMediaId }}
</p>
<p>
图文m_id:
<el-tooltip
v-if=
"scope.row.draftMediaId"
placement=
"top"
:content=
"scope.row.draftMediaId"
>
<span
class=
"media-id"
>
{{ scope.row.draftMediaId }}
</span>
</el-tooltip>
<span
v-else
>
--
</span>
</p>
</div>
</div>
</div>
</div>
</el-table-column>
</el-table-column>
...
@@ -38,29 +44,45 @@
...
@@ -38,29 +44,45 @@
<el-table-column
label=
"修改时间"
prop=
"updateTimeStr"
align=
"left"
>
<el-table-column
label=
"修改时间"
prop=
"updateTimeStr"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<p
class=
"cell-time"
>
<p
class=
"cell-time"
>
{{
formatDateTimeByType
(
scope
.
row
.
updateTime
,
'yyyy-MM-dd-HH-mm'
,
true
).
y
}}
<br
/><span>
{{
formatDateTimeByType
(
scope
.
row
.
updateTime
,
'yyyy-MM-dd-HH-mm'
,
true
).
h
}}
</span>
<template
v-if=
"scope.row.updateTime"
>
{{
formatDateTimeByType
(
scope
.
row
.
updateTime
,
'yyyy-MM-dd-HH-mm'
,
true
).
y
}}
<br
/><span>
{{
formatDateTimeByType
(
scope
.
row
.
updateTime
,
'yyyy-MM-dd-HH-mm'
,
true
).
h
}}
</span>
</
template
>
<
template
v-else
>
--
</
template
>
</p>
</p>
</template>
</template>
</el-table-column>
</el-table-column>
<el-table-column
min-width=
"100"
align=
"left"
prop=
"creatorName"
label=
"创建人"
v-if=
"$store.state.marketing.openFlag"
></el-table-column>
<el-table-column
min-width=
"100"
align=
"left"
prop=
"creatorName"
label=
"创建人"
:formatter=
"(row, col, val) => val || '--'"
v-if=
"$store.state.marketing.openFlag"
></el-table-column>
<el-table-column
label=
"操作"
align=
"left"
v-if=
"auto"
>
<el-table-column
label=
"发布说明"
prop=
"publishStatus"
:formatter=
"formatPublishStatus"
show-overflow-tooltip
></el-table-column>
<el-table-column
label=
"操作"
align=
"left"
v-if=
"auto"
min-width=
"120px"
>
<!-- 发布中不能进行编辑、删除、使用等任何操作 -->
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
v-if=
"scope.row.canEdit !== false"
@
click=
"editData(scope.row)"
>
编辑
</el-button>
<template
v-if=
"scope.row.publishStatus != 1"
>
<dm-delete
v-if=
"scope.row.canEdit !== false"
@
confirm=
"delData(scope.row)"
tips=
"确认删除该图文?"
>
<!-- 老图文才有转为草稿 -->
<el-button
type=
"text"
>
删除
</el-button>
<!-- 转为草稿就是编辑 -->
</dm-delete>
<template
v-if=
"scope.row.oldImageTextFlag && !isPublish"
>
<el-button
type=
"text"
v-if=
"scope.row.canEdit !== false"
@
click=
"$router.push('/wechat/record/add/' + scope.row.imageTextId)"
>
使用
</el-button>
<el-button
type=
"text"
v-if=
"scope.row.canEdit !== false"
@
click=
"editData(scope.row)"
>
转为草稿`
</el-button>
</
template
>
<
template
v-if=
"!scope.row.oldImageTextFlag && !isPublish"
>
<el-button
type=
"text"
v-if=
"scope.row.canEdit !== false"
@
click=
"editData(scope.row)"
>
编辑
</el-button>
<el-button
type=
"text"
v-if=
"scope.row.canEdit !== false"
@
click=
"$router.push('/wechat/record/add/' + scope.row.imageTextId)"
>
使用
</el-button>
<el-button
:loading=
"scope.row.loading"
:disabled=
"scope.row.loading"
@
click=
"onPublic(scope.row)"
type=
"text"
>
发布
</el-button>
</
template
>
<dm-delete
v-if=
"scope.row.canEdit !== false"
@
confirm=
"delData(scope.row)"
tips=
"确认删除该图文?"
>
<el-button
type=
"text"
>
删除
</el-button>
</dm-delete>
</template>
<
template
v-else
>
--
</
template
>
</template>
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-radio-group>
</el-radio-group>
<dm-pagination
v-show=
"textImgList.length"
background
class=
"dm-pagination"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listParams.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"listParams.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
<dm-pagination
v-show=
"textImgList.length"
background
class=
"dm-pagination"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"listParams.currentPage"
:page-sizes=
"[20, 40, 60, 80]"
:page-size=
"listParams.pageSize"
layout=
"total, sizes, prev, pager, next"
:total=
"total"
></dm-pagination>
<sync-imgtext
:wxsc-type=
"
w
xscType"
:show
.
sync=
"syncImgTextShow"
></sync-imgtext>
<sync-imgtext
:wxsc-type=
"
getW
xscType"
:show
.
sync=
"syncImgTextShow"
></sync-imgtext>
</section>
</section>
</template>
</template>
<
script
>
<
script
>
import
{
loadImgTextList
,
deleteImageText
}
from
'@/service/api/wechatApi.js'
;
import
{
loadImgTextList
,
deleteImageText
,
wechatDraftPublish
}
from
'@/service/api/wechatApi.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
import
{
formatDateTimeByType
}
from
'@/utils/index.js'
;
import
syncImgtext
from
'./syncImgtext'
;
import
syncImgtext
from
'./syncImgtext'
;
export
default
{
export
default
{
...
@@ -91,20 +113,25 @@ export default {
...
@@ -91,20 +113,25 @@ export default {
isGroupSend
:
{
isGroupSend
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
isPublish
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
created
()
{
created
()
{
this
.
$store
.
commit
(
if
(
!
this
.
isPublish
)
{
'mutations_layoutTips'
,
this
.
$store
.
commit
(
`<div class="layout--tips">
'mutations_layoutTips'
,
<i class="el-icon-info"></i>因为在微信公众后台发布的图文会从草稿箱转移到发表记录,若在微信公众后台有发布操作,建议在达摩侧的草稿箱检查同步
`<div class="layout--tips">
</div>`
<i class="el-icon-info"></i>因为在微信公众后台发布的图文会从草稿箱转移到发表记录,若在微信公众后台有发布操作,建议在达摩侧的草稿箱检查同步
);
</div>`
);
}
this
.
loadImgTextList
();
this
.
loadImgTextList
();
},
},
data
()
{
data
()
{
return
{
return
{
wxscType
:
'4'
,
textImgList
:
[],
textImgList
:
[],
listParams
:
{
listParams
:
{
currentPage
:
1
,
currentPage
:
1
,
...
@@ -123,6 +150,11 @@ export default {
...
@@ -123,6 +150,11 @@ export default {
components
:
{
components
:
{
syncImgtext
syncImgtext
},
},
computed
:
{
getWxscType
()
{
return
this
.
isPublish
?
5
:
4
;
}
},
watch
:
{
watch
:
{
activeId
(
val
)
{
activeId
(
val
)
{
this
.
textImgList
.
map
(
v
=>
{
this
.
textImgList
.
map
(
v
=>
{
...
@@ -133,6 +165,33 @@ export default {
...
@@ -133,6 +165,33 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
formatPublishStatus
(
row
,
col
,
val
)
{
// 0:成功, 1:发布中,2:原创失败, 3: 常规失败, 4:平台审核不通过, 5:成功后用户删除所有文章, 6: 成功后系统封禁所有文章 100:老图文 , 101:草稿
const
status
=
new
Map
();
status
.
set
(
0
,
'成功'
);
status
.
set
(
1
,
'发布中'
);
status
.
set
(
2
,
'原创失败'
);
status
.
set
(
3
,
'常规失败'
);
status
.
set
(
4
,
'平台审核不通过'
);
status
.
set
(
5
,
'成功后用户删除所有文章'
);
status
.
set
(
6
,
'成功后系统封禁所有文章'
);
status
.
set
(
100
,
'老图文'
);
status
.
set
(
101
,
'草稿'
);
return
status
.
get
(
typeof
val
==
'string'
?
Number
(
val
)
:
val
)
||
'--'
;
},
onPublic
(
row
)
{
this
.
$confirm
(
'确认发布此图文?'
,
'发布图文'
,
{
type
:
'warning'
}).
then
(()
=>
{
this
.
$set
(
row
,
'loading'
,
true
);
wechatDraftPublish
({
imageTextId
:
row
.
imageTextId
})
.
then
(
res
=>
{
this
.
$message
.
success
(
'发布成功!'
);
this
.
loadImgTextList
();
})
.
finally
(()
=>
this
.
$set
(
row
,
'loading'
,
'false'
));
});
},
async
loadImgTextList
()
{
async
loadImgTextList
()
{
if
(
this
.
loading
)
{
if
(
this
.
loading
)
{
return
;
return
;
...
@@ -143,6 +202,9 @@ export default {
...
@@ -143,6 +202,9 @@ export default {
if
(
this
.
isGroupSend
)
{
if
(
this
.
isGroupSend
)
{
params
.
isGroupSend
=
1
;
params
.
isGroupSend
=
1
;
}
}
if
(
this
.
isPublish
)
{
params
.
wxscType
=
5
;
}
let
res
=
await
loadImgTextList
(
params
);
let
res
=
await
loadImgTextList
(
params
);
if
(
res
.
errorCode
===
0
)
{
if
(
res
.
errorCode
===
0
)
{
// 从页面上过滤itemList为[]的错误数据,原因:微信导入错误
// 从页面上过滤itemList为[]的错误数据,原因:微信导入错误
...
@@ -176,10 +238,10 @@ export default {
...
@@ -176,10 +238,10 @@ export default {
this
.
$emit
(
'get-data'
,
{
imageTextId
:
row
.
imageTextId
,
imageTextWechatId
:
row
.
imageTextWechatId
});
this
.
$emit
(
'get-data'
,
{
imageTextId
:
row
.
imageTextId
,
imageTextWechatId
:
row
.
imageTextWechatId
});
},
},
add
()
{
add
()
{
this
.
$router
.
push
(
`/wechat/editor?type=
${
this
.
w
xscType
}
`
);
this
.
$router
.
push
(
`/wechat/editor?type=
${
this
.
getW
xscType
}
`
);
},
},
editData
(
row
)
{
editData
(
row
)
{
this
.
$router
.
push
(
'/wechat/editor/'
+
row
.
imageTextId
);
this
.
$router
.
push
(
'/wechat/editor/'
+
row
.
imageTextId
+
'?type='
+
this
.
getWxscType
);
},
},
delData
(
row
)
{
delData
(
row
)
{
deleteImageText
({
imageTextId
:
row
.
imageTextId
})
deleteImageText
({
imageTextId
:
row
.
imageTextId
})
...
@@ -216,6 +278,14 @@ export default {
...
@@ -216,6 +278,14 @@ export default {
flex-direction
:
column
;
flex-direction
:
column
;
justify-content
:
space-around
;
justify-content
:
space-around
;
padding-left
:
15px
;
padding-left
:
15px
;
.media-id
{
display
:
inline-block
;
vertical-align
:
top
;
width
:
160px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
}
}
}
.dm-imgtext_head
{
.dm-imgtext_head
{
...
...
src/components/libs/imgTextTemp/syncImgtext.vue
View file @
457a6f09
...
@@ -58,7 +58,7 @@ export default {
...
@@ -58,7 +58,7 @@ export default {
},
},
async
getSyncInfo
()
{
async
getSyncInfo
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
let
res
=
await
getSyncInfo
();
let
res
=
await
getSyncInfo
(
{
wxscType
:
this
.
wxscType
}
);
this
.
count
=
res
.
result
.
wechatCount
;
this
.
count
=
res
.
result
.
wechatCount
;
this
.
loadStatus
=
res
.
result
.
status
;
this
.
loadStatus
=
res
.
result
.
status
;
this
.
loading
=
false
;
this
.
loading
=
false
;
...
...
src/router/modules/wechat.js
View file @
457a6f09
...
@@ -94,6 +94,14 @@ export default {
...
@@ -94,6 +94,14 @@ export default {
}
}
},
},
{
{
path
:
'imgtextpublic'
,
name
:
'图文发布列表'
,
component
:
()
=>
import
(
/* webpackChunkName: "wechat" */
'../../components/libs/imgTextTemp/imgtextpublic.vue'
),
meta
:
{
path
:
'/wechat/temp/imgtextpublic'
}
},
{
path
:
'img'
,
path
:
'img'
,
name
:
'图片'
,
name
:
'图片'
,
component
:
()
=>
import
(
/* webpackChunkName: "wechat" */
'../../components/libs/imgTemp/index.vue'
),
component
:
()
=>
import
(
/* webpackChunkName: "wechat" */
'../../components/libs/imgTemp/index.vue'
),
...
...
src/service/api/wechatApi.js
View file @
457a6f09
...
@@ -33,6 +33,8 @@ export const getSyncInfo = params => requests(PREFIX + 'get-sync-info', params);
...
@@ -33,6 +33,8 @@ export const getSyncInfo = params => requests(PREFIX + 'get-sync-info', params);
//素材库--图文--同步微信侧 图文素材数据
//素材库--图文--同步微信侧 图文素材数据
export
const
syncWechatImageText
=
params
=>
requests
(
PREFIX
+
'sync-wechatImage-text'
,
params
);
export
const
syncWechatImageText
=
params
=>
requests
(
PREFIX
+
'sync-wechatImage-text'
,
params
);
export
const
wechatDraftPublish
=
params
=>
requests
(
PREFIX
+
'wechat-draft-publish'
,
params
);
//素材库--图片--图片分页列表
//素材库--图片--图片分页列表
export
const
loadImgList
=
params
=>
requests
(
PREFIX
+
'page-marketing-wechat-image'
,
params
);
export
const
loadImgList
=
params
=>
requests
(
PREFIX
+
'page-marketing-wechat-image'
,
params
);
...
...
src/views/wechat/editor.vue
View file @
457a6f09
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
"
"
><i
class=
"el-icon-picture"
></i><span>
图片
</span></span
><i
class=
"el-icon-picture"
></i><span>
图片
</span></span
>
>
<
span
@
click=
"preVideo"
><i
class=
"iconfont icon-shipin"
></i><span>
视频
</span></span
>
<
!--
<span
@
click=
"preVideo"
><i
class=
"iconfont icon-shipin"
></i><span>
视频
</span></span>
--
>
<!--
<span
@
click=
"cardShow = true"
><i
class=
"iconfont icon-qiaquan"
></i><span>
卡券
</span></span>
-->
<!--
<span
@
click=
"cardShow = true"
><i
class=
"iconfont icon-qiaquan"
></i><span>
卡券
</span></span>
-->
</div>
</div>
<vue-ueditor-wrap
ref=
"ueditor"
v-model=
"activeImgText.content"
:destroy=
"false"
:config=
"config"
@
ready=
"ready"
:myInit=
"myInit"
></vue-ueditor-wrap>
<vue-ueditor-wrap
ref=
"ueditor"
v-model=
"activeImgText.content"
:destroy=
"false"
:config=
"config"
@
ready=
"ready"
:myInit=
"myInit"
></vue-ueditor-wrap>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment