Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
42a9715f
authored
Apr 08, 2023
by
dhb52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复WxReply、WxMaterialSelect组件bug
parent
cf68b1e9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
31 deletions
+36
-31
src/views/mp/components/wx-material-select/main.vue
+19
-14
src/views/mp/components/wx-reply/main.vue
+17
-17
No files found.
src/views/mp/components/wx-material-select/main.vue
View file @
42a9715f
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
① 移除 avue 组件,使用 ElementUI 原生组件
① 移除 avue 组件,使用 ElementUI 原生组件
-->
-->
<
template
>
<
template
>
<!-- 类型:图片 -->
<div
class=
"pb-30px"
>
<!-- 类型:image -->
<div
v-if=
"objData.type === 'image'"
>
<div
v-if=
"objData.type === 'image'"
>
<div
class=
"waterfall"
v-loading=
"loading"
>
<div
class=
"waterfall"
v-loading=
"loading"
>
<div
class=
"waterfall-item"
v-for=
"item in list"
:key=
"item.mediaId"
>
<div
class=
"waterfall-item"
v-for=
"item in list"
:key=
"item.mediaId"
>
...
@@ -13,8 +14,7 @@
...
@@ -13,8 +14,7 @@
<p
class=
"item-name"
>
{{
item
.
name
}}
</p>
<p
class=
"item-name"
>
{{
item
.
name
}}
</p>
<el-row
class=
"ope-row"
>
<el-row
class=
"ope-row"
>
<el-button
type=
"success"
@
click=
"selectMaterialFun(item)"
<el-button
type=
"success"
@
click=
"selectMaterialFun(item)"
>
选择
>
选择
<Icon
icon=
"ep:circle-check"
/>
<i
class=
"el-icon-circle-check el-icon--right"
></i>
</el-button>
</el-button>
</el-row>
</el-row>
</div>
</div>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
@
pagination=
"getMaterialPageFun"
@
pagination=
"getMaterialPageFun"
/>
/>
</div>
</div>
<!-- 类型:语音
-->
<!-- 类型:voice
-->
<div
v-else-if=
"objData.type === 'voice'"
>
<div
v-else-if=
"objData.type === 'voice'"
>
<!-- 列表 -->
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<el-table-column
label=
"文件名"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"文件名"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"语音"
align=
"center"
>
<el-table-column
label=
"语音"
align=
"center"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<wx-voice-p
layer
:url=
"scope.row.url"
/>
<WxVoiceP
layer
:url=
"scope.row.url"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"上传时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<el-table-column
label=
"上传时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
...
@@ -51,8 +51,8 @@
...
@@ -51,8 +51,8 @@
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
>
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
type=
"text"
icon=
"el-icon-circle-plus
"
@
click=
"selectMaterialFun(scope.row)"
<el-button
type=
"text
"
@
click=
"selectMaterialFun(scope.row)"
>
选择
>
选择
<Icon
icon=
"ep:plus"
/>
</el-button>
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -66,6 +66,7 @@
...
@@ -66,6 +66,7 @@
@
pagination=
"getPage"
@
pagination=
"getPage"
/>
/>
</div>
</div>
<!-- 类型:video -->
<div
v-else-if=
"objData.type === 'video'"
>
<div
v-else-if=
"objData.type === 'video'"
>
<!-- 列表 -->
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table
v-loading=
"loading"
:data=
"list"
>
...
@@ -75,7 +76,7 @@
...
@@ -75,7 +76,7 @@
<el-table-column
label=
"介绍"
align=
"center"
prop=
"introduction"
/>
<el-table-column
label=
"介绍"
align=
"center"
prop=
"introduction"
/>
<el-table-column
label=
"视频"
align=
"center"
>
<el-table-column
label=
"视频"
align=
"center"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<wx-video-p
layer
:url=
"scope.row.url"
/>
<WxVideoP
layer
:url=
"scope.row.url"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"上传时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<el-table-column
label=
"上传时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
...
@@ -90,8 +91,8 @@
...
@@ -90,8 +91,8 @@
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
>
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
type=
"text"
icon=
"el-icon-circle-plus
"
@
click=
"selectMaterialFun(scope.row)"
<el-button
type=
"text
"
@
click=
"selectMaterialFun(scope.row)"
>
选择
>
选择
<Icon
icon=
"akar-icons:circle-plus"
/>
</el-button>
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -105,14 +106,15 @@
...
@@ -105,14 +106,15 @@
@
pagination=
"getMaterialPageFun"
@
pagination=
"getMaterialPageFun"
/>
/>
</div>
</div>
<!-- 类型:news -->
<div
v-else-if=
"objData.type === 'news'"
>
<div
v-else-if=
"objData.type === 'news'"
>
<div
class=
"waterfall"
v-loading=
"loading"
>
<div
class=
"waterfall"
v-loading=
"loading"
>
<div
class=
"waterfall-item"
v-for=
"item in list"
:key=
"item.mediaId"
>
<div
class=
"waterfall-item"
v-for=
"item in list"
:key=
"item.mediaId"
>
<div
v-if=
"item.content && item.content.newsItem"
>
<div
v-if=
"item.content && item.content.newsItem"
>
<wx-n
ews
:articles=
"item.content.newsItem"
/>
<WxN
ews
:articles=
"item.content.newsItem"
/>
<el-row
class=
"ope-row"
>
<el-row
class=
"ope-row"
>
<el-button
type=
"success"
@
click=
"selectMaterialFun(item)"
>
<el-button
type=
"success"
@
click=
"selectMaterialFun(item)"
>
选择
<i
class=
"el-icon-circle-check el-icon--right"
></i
>
选择
<Icon
icon=
"ep:circle-check"
/
>
</el-button>
</el-button>
</el-row>
</el-row>
</div>
</div>
...
@@ -127,6 +129,7 @@
...
@@ -127,6 +129,7 @@
@
pagination=
"getMaterialPageFun"
@
pagination=
"getMaterialPageFun"
/>
/>
</div>
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
name=
"WxMaterialSelect"
>
<
script
lang=
"ts"
name=
"WxMaterialSelect"
>
...
@@ -173,7 +176,7 @@ export default defineComponent({
...
@@ -173,7 +176,7 @@ export default defineComponent({
const
newsTypeRef
=
ref
(
props
.
newsType
)
const
newsTypeRef
=
ref
(
props
.
newsType
)
const
selectMaterialFun
=
(
item
)
=>
{
const
selectMaterialFun
=
(
item
)
=>
{
ctx
.
emit
(
'select
M
aterial'
,
item
)
ctx
.
emit
(
'select
-m
aterial'
,
item
)
}
}
/** 搜索按钮操作 */
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
const
handleQuery
=
()
=>
{
...
@@ -203,9 +206,10 @@ export default defineComponent({
...
@@ -203,9 +206,10 @@ export default defineComponent({
total
.
value
=
data
.
total
total
.
value
=
data
.
total
loading
.
value
=
false
loading
.
value
=
false
}
}
const
getFreePublishPageFun
=
async
()
=>
{
const
getFreePublishPageFun
=
async
()
=>
{
let
data
=
await
getFreePublishPage
(
queryParams
)
let
data
=
await
getFreePublishPage
(
queryParams
)
data
.
list
.
for
e
ach
((
item
)
=>
{
data
.
list
.
for
E
ach
((
item
)
=>
{
const
newsItem
=
item
.
content
.
newsItem
const
newsItem
=
item
.
content
.
newsItem
newsItem
.
forEach
((
article
)
=>
{
newsItem
.
forEach
((
article
)
=>
{
article
.
picUrl
=
article
.
thumbUrl
article
.
picUrl
=
article
.
thumbUrl
...
@@ -232,6 +236,7 @@ export default defineComponent({
...
@@ -232,6 +236,7 @@ export default defineComponent({
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getPage
()
getPage
()
})
})
return
{
return
{
handleQuery
,
handleQuery
,
dateFormatter
,
dateFormatter
,
...
...
src/views/mp/components/wx-reply/main.vue
View file @
42a9715f
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<div
class=
"select-item"
v-if=
"objDataRef.url"
>
<div
class=
"select-item"
v-if=
"objDataRef.url"
>
<img
class=
"material-img"
:src=
"objDataRef.url"
/>
<img
class=
"material-img"
:src=
"objDataRef.url"
/>
<p
class=
"item-name"
v-if=
"objDataRef.name"
>
{{ objDataRef.name }}
</p>
<p
class=
"item-name"
v-if=
"objDataRef.name"
>
{{ objDataRef.name }}
</p>
<el-row
class=
"ope-row"
>
<el-row
class=
"ope-row"
justify=
"center"
>
<el-button
type=
"danger"
circle
@
click=
"deleteObj"
>
<el-button
type=
"danger"
circle
@
click=
"deleteObj"
>
<icon
icon=
"ep:delete"
/>
<icon
icon=
"ep:delete"
/>
</el-button>
</el-button>
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
<icon
icon=
"ep:circle-check"
/>
<icon
icon=
"ep:circle-check"
/>
</el-button>
</el-button>
<el-dialog
title=
"选择图片"
v-model=
"dialogImageVisible"
width=
"90%"
append-to-body
>
<el-dialog
title=
"选择图片"
v-model=
"dialogImageVisible"
width=
"90%"
append-to-body
>
<
wx-material-select
:obj-data=
"objDataRef"
@
selectM
aterial=
"selectMaterial"
/>
<
WxMaterialSelect
:obj-data=
"objDataRef"
@
select-m
aterial=
"selectMaterial"
/>
</el-dialog>
</el-dialog>
</el-col>
</el-col>
<!-- 文件上传 -->
<!-- 文件上传 -->
...
@@ -91,20 +91,20 @@
...
@@ -91,20 +91,20 @@
<div
class=
"select-item2"
v-if=
"objDataRef.url"
>
<div
class=
"select-item2"
v-if=
"objDataRef.url"
>
<p
class=
"item-name"
>
{{ objDataRef.name }}
</p>
<p
class=
"item-name"
>
{{ objDataRef.name }}
</p>
<div
class=
"item-infos"
>
<div
class=
"item-infos"
>
<
wx-voice-p
layer
:url=
"objDataRef.url"
/>
<
WxVoiceP
layer
:url=
"objDataRef.url"
/>
</div>
</div>
<el-row
class=
"ope-row"
>
<el-row
class=
"ope-row"
justify=
"center"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
circle
@
click=
"deleteObj"
/
>
<el-button
type=
"danger"
circle
@
click=
"deleteObj"
><Icon
icon=
"ep:delete"
/></el-button
>
</el-row>
</el-row>
</div>
</div>
<el-row
v-else
style=
"text-align: center"
>
<el-row
v-else
style=
"text-align: center"
>
<!-- 选择素材 -->
<!-- 选择素材 -->
<el-col
:span=
"12"
class=
"col-select"
>
<el-col
:span=
"12"
class=
"col-select"
>
<el-button
type=
"success"
@
click=
"openMaterial"
>
<el-button
type=
"success"
@
click=
"openMaterial"
>
素材库选择
<
i
class=
"el-icon-circle-check el-icon--right"
></i
>
素材库选择
<
Icon
icon=
"ep:circle-check"
/
>
</el-button>
</el-button>
<el-dialog
title=
"选择语音"
v-model=
"dialogVoiceVisible"
width=
"90%"
append-to-body
>
<el-dialog
title=
"选择语音"
v-model=
"dialogVoiceVisible"
width=
"90%"
append-to-body
>
<WxMaterialSelect
:objData=
"objData"
@
select
M
aterial=
"selectMaterial"
/>
<WxMaterialSelect
:objData=
"objData"
@
select
-m
aterial=
"selectMaterial"
/>
</el-dialog>
</el-dialog>
</el-col>
</el-col>
<!-- 文件上传 -->
<!-- 文件上传 -->
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
@
input=
"inputContent"
@
input=
"inputContent"
/>
/>
<div
style=
"text-align: center"
>
<div
style=
"text-align: center"
>
<
wx-video-p
layer
v-if=
"objDataRef.url"
:url=
"objDataRef.url"
/>
<
WxVideoP
layer
v-if=
"objDataRef.url"
:url=
"objDataRef.url"
/>
</div>
</div>
<el-col>
<el-col>
<el-row
style=
"text-align: center"
align=
"middle"
>
<el-row
style=
"text-align: center"
align=
"middle"
>
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
<icon
icon=
"ep:circle-check"
/>
<icon
icon=
"ep:circle-check"
/>
</el-button>
</el-button>
<el-dialog
title=
"选择视频"
v-model=
"dialogVideoVisible"
width=
"90%"
append-to-body
>
<el-dialog
title=
"选择视频"
v-model=
"dialogVideoVisible"
width=
"90%"
append-to-body
>
<
wx-material-select
:objData=
"objDataRef"
@
selectM
aterial=
"selectMaterial"
/>
<
WxMaterialSelect
:objData=
"objDataRef"
@
select-m
aterial=
"selectMaterial"
/>
</el-dialog>
</el-dialog>
</el-col>
</el-col>
<!-- 文件上传 -->
<!-- 文件上传 -->
...
@@ -196,8 +196,8 @@
...
@@ -196,8 +196,8 @@
</el-row>
</el-row>
</
template
>
</
template
>
<el-row>
<el-row>
<div
class=
"select-item"
v-if=
"objDataRef.articles
.size
> 0"
>
<div
class=
"select-item"
v-if=
"objDataRef.articles
?.length
> 0"
>
<
wx-n
ews
:articles=
"objDataRef.articles"
/>
<
WxN
ews
:articles=
"objDataRef.articles"
/>
<el-col
class=
"ope-row"
>
<el-col
class=
"ope-row"
>
<el-button
type=
"danger"
circle
@
click=
"deleteObj"
>
<el-button
type=
"danger"
circle
@
click=
"deleteObj"
>
<icon
icon=
"ep:delete"
/>
<icon
icon=
"ep:delete"
/>
...
@@ -216,9 +216,9 @@
...
@@ -216,9 +216,9 @@
</el-row>
</el-row>
</el-col>
</el-col>
<el-dialog
title=
"选择图文"
v-model=
"dialogNewsVisible"
width=
"90%"
append-to-body
>
<el-dialog
title=
"选择图文"
v-model=
"dialogNewsVisible"
width=
"90%"
append-to-body
>
<
wx-material-s
elect
<
WxMaterialS
elect
:objData=
"objDataRef"
:objData=
"objDataRef"
@
select
M
aterial=
"selectMaterial"
@
select
-m
aterial=
"selectMaterial"
:newsType=
"newsType"
:newsType=
"newsType"
/>
/>
</el-dialog>
</el-dialog>
...
@@ -268,9 +268,9 @@
...
@@ -268,9 +268,9 @@
</el-col>
</el-col>
</el-row>
</el-row>
<el-dialog
title=
"选择图片"
v-model=
"dialogThumbVisible"
width=
"80%"
append-to-body
>
<el-dialog
title=
"选择图片"
v-model=
"dialogThumbVisible"
width=
"80%"
append-to-body
>
<
wx-material-s
elect
<
WxMaterialS
elect
:objData=
"{ type: 'image', accountId: objDataRef.accountId }"
:objData=
"{ type: 'image', accountId: objDataRef.accountId }"
@
select
M
aterial=
"selectMaterial"
@
select
-m
aterial=
"selectMaterial"
/>
/>
</el-dialog>
</el-dialog>
</el-col>
</el-col>
...
@@ -482,7 +482,7 @@ export default defineComponent({
...
@@ -482,7 +482,7 @@ export default defineComponent({
// 创建 tempObjItem 对象,并设置对应的值
// 创建 tempObjItem 对象,并设置对应的值
let
tempObjItem
=
{
let
tempObjItem
=
{
type
:
''
,
type
:
''
,
articles
:
''
,
articles
:
[]
,
thumbMediaId
:
''
,
thumbMediaId
:
''
,
thumbMediaUrl
:
''
,
thumbMediaUrl
:
''
,
introduction
:
''
,
introduction
:
''
,
...
@@ -560,7 +560,7 @@ export default defineComponent({
...
@@ -560,7 +560,7 @@ export default defineComponent({
}
}
const
deleteObj
=
()
=>
{
const
deleteObj
=
()
=>
{
if
(
objDataRef
.
type
===
'news'
)
{
if
(
objDataRef
.
type
===
'news'
)
{
objDataRef
.
articles
=
''
objDataRef
.
articles
=
[]
}
else
if
(
objDataRef
.
type
===
'image'
)
{
}
else
if
(
objDataRef
.
type
===
'image'
)
{
objDataRef
.
mediaId
=
null
objDataRef
.
mediaId
=
null
objDataRef
.
url
=
null
objDataRef
.
url
=
null
...
...
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