Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 2602f1e9
authored
Mar 16, 2024
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
联调
1 parent
6174990f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
520 additions
and
29 deletions
src/api/contentManager.js
src/views/contentManager/components/brandDialog/index.vue
src/views/contentManager/components/merchantDialog/index.vue
src/views/contentManager/components/preview/index.vue
src/views/contentManager/components/uploadPdf/index.vue
src/views/contentManager/contentAdd.vue
src/views/contentManager/contentManagerList.vue
src/api/contentManager.js
View file @
2602f1e
...
...
@@ -37,3 +37,31 @@ export function exportStatisticsList(data) {
data
.
method
=
`dj.api.customer.dynamic.record.page.export`
return
request
(
data
)
}
//新增内容
export
function
addContent
(
data
)
{
data
.
method
=
`
${
path
}
material.record.add`
return
request
(
data
)
}
//编辑内容
export
function
updateContent
(
data
)
{
data
.
method
=
`
${
path
}
material.record.update`
return
request
(
data
)
}
//获取会员权益/升级和积分商城 门店
export
function
getAllMerchantList
(
data
)
{
data
.
method
=
`dj.api.merchant.page`
return
request
(
data
,
"POST"
)
}
//获取精品升级/次新车转化/售后众筹 门店
export
function
getMerchantListByScene
(
data
)
{
data
.
method
=
`dj.api.scenemerchantref.listShop4sByRef.page`
return
request
(
data
)
}
//获取品牌列表
export
function
getBrandList
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.common.car.brand.list`
return
request
(
data
)
}
src/views/contentManager/components/brandDialog/index.vue
0 → 100644
View file @
2602f1e
<
template
>
<d2-dialog
:isVisible=
"dialogVisible"
class=
"accountDailog"
title=
"选择品牌"
width=
"720px"
@
confirmDialog=
"handleAddConfirm"
@
closeDialog=
"handleClose"
>
<div
class=
"tableBox"
>
<!--
<div
style=
"padding: 10px 50px"
>
<el-input
v-model=
"realSearchForm.label"
placeholder=
"搜索品牌名称"
maxlength=
"20"
clearable
size=
"small"
style=
"width: 300px; margin-right: 12px"
/>
<el-button
size=
"small"
type=
"primary"
@
click=
"searchList"
>
查询
</el-button>
</div>
-->
<d2-table
class=
"table"
ref=
"brandTable"
:table-params=
"tableParams"
:tableData=
"tableData"
:hasPage=
"false"
>
</d2-table>
</div>
</d2-dialog>
</
template
>
<
script
>
import
{
getAllMerchantList
,
getMerchantListByScene
,
getBrandList
}
from
"@api/contentManager"
import
{
deepClone
}
from
"@/common/util"
export
default
{
name
:
"SelectGoodsTypeDialog"
,
props
:
{
dialogVisible
:
{
type
:
Boolean
,
default
:
false
},
selectedRecord
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
return
{
realSearchForm
:
{
label
:
""
},
tableData
:
[],
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
mutiSelectUniqueKey
:
"id"
,
mutiSelectName
:
"brandIndex"
,
tableColumns
:
[
{
label
:
"品牌名称"
,
prop
:
"label"
}
]
}
}
},
mounted
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
getBrandList
({
label
:
"奥迪"
}).
then
((
res
)
=>
{
console
.
log
(
res
)
if
(
res
?.
length
)
{
this
.
sourceData
=
res
this
.
tableData
=
res
}
})
},
searchList
()
{
if
(
this
.
realSearchForm
.
label
)
{
this
.
tableData
=
this
.
sourceData
.
filter
((
item
)
=>
{
return
item
.
label
?.
indexOf
(
this
.
realSearchForm
.
label
)
>
-
1
})
}
else
{
this
.
tableData
=
deepClone
(
this
.
sourceData
)
}
},
changeEvent
(
e
)
{
console
.
log
(
e
)
},
handleAddConfirm
()
{
const
selectItemList
=
this
.
$refs
.
brandTable
?.
mutiSelectArr
?.[
this
.
tableParams
.
mutiSelectName
]
||
[]
if
(
selectItemList
.
length
)
{
this
.
$emit
(
"confirmDialogFn"
,
selectItemList
)
}
else
{
this
.
$message
.
error
(
"请勾选品牌"
)
}
},
handleClose
()
{
this
.
$emit
(
"closeDialogFn"
)
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.table
{
::v-deep
.el-table__body-wrapper
{
height
:
400px
;
overflow-y
:
auto
;
}
}
</
style
>
src/views/contentManager/components/merchantDialog/index.vue
View file @
2602f1e
<
template
>
<
baseD
ialog
:is
-show
.
sync
=
"dialogVisible"
<
d2-d
ialog
:is
Visible
=
"dialogVisible"
class=
"accountDailog"
:dialogConfig=
"
{ width: '720px' }"
@handleClick="handleAddConfirm"
title=
"选择门店"
width=
"720px"
@
confirmDialog=
"handleAddConfirm"
@
closeDialog=
"handleClose"
>
<div
class=
"tableBox"
>
<div
style=
"padding: 10px 50px"
>
...
...
@@ -28,7 +30,7 @@
>
</d2-table>
</div>
</
baseD
ialog>
</
d2-d
ialog>
</
template
>
<
script
>
...
...
@@ -94,12 +96,15 @@ export default {
const
selectItemList
=
this
.
$refs
.
merchantTable
?.
mutiSelectArr
?.[
this
.
tableParams
.
mutiSelectName
]
]
||
[]
if
(
selectItemList
.
length
)
{
this
.
$emit
(
"confirmDialogFn"
,
selectItemList
)
}
else
{
this
.
$message
(
"请勾选门店"
)
this
.
$message
.
error
(
"请勾选门店"
)
}
},
handleClose
()
{
this
.
$emit
(
"closeDialogFn"
)
}
}
}
...
...
src/views/contentManager/components/preview/index.vue
View file @
2602f1e
...
...
@@ -2,16 +2,28 @@
<div
class=
"activity-img-box"
>
<template
v-if=
"imageUrlArr && imageUrlArr.length > 0"
>
<div
v-for=
"(item, index) in imageUrlArr"
:key=
"index"
>
<div
v-if=
"picOptions.type == 'video'"
>
<video
controls
class=
"pic-box"
:style=
"
{ width: picOptions.width, height: picOptions.height }"
:src="item"
>
</video>
<div
class=
"pic-pane-close"
@
click=
"handleEnlarge(item, 'video')"
>
<img
:src=
"require('@/assets/view.png')"
alt=
""
/>
</div>
</div>
<div
class=
"pic-box"
:style=
"
{ width: picOptions.width, height: picOptions.height }"
v-else
>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<div
class=
"mask"
:style=
"
{ width: picOptions.width, height: picOptions.height }"
>
<div
class=
"pic-pane-close"
@
click=
"handleEnlarge(item)"
>
<div
class=
"pic-pane-close"
@
click=
"handleEnlarge(item
, 'img'
)"
>
<img
:src=
"require('@/assets/view.png')"
alt=
""
/>
</div>
<template
v-if=
"picOptions.isClose"
>
...
...
@@ -31,13 +43,15 @@
>
<div
class=
"upload-img"
>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
<div
class=
"avatar-uploader-desc-word"
>
上传
{{
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}}
</div>
<input
type=
"file"
ref=
"uploadImg"
class=
"upload-img"
style=
"opacity: 0"
accept=
".jpg, .jpeg, .png
"
:accept=
"picOptions.type == 'video' ? '.mp4' : '.jpg, .jpeg, .png,'
"
@
change=
"(e) => handleImgChange(e)"
/>
</div>
...
...
@@ -49,7 +63,7 @@
width=
"50%"
>
<img
:src=
"dialogSrc"
width=
"100%"
v-if=
"dialogType == 'img'"
/>
<
!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> --
>
<
video
width=
"100%"
autoplay
controls
:src=
"dialogSrc"
v-else
></video
>
</el-dialog>
</div>
</template>
...
...
@@ -91,7 +105,9 @@ export default {
handleImgChange
(
e
)
{
this
.
$notify
({
title
:
"提示"
,
message
:
"图片上传中,请稍后"
message
:
`
${
this
.
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}
上传中,请稍后
`
})
var file = e.srcElement.files[0]
var reader = new FileReader()
...
...
@@ -99,11 +115,19 @@ export default {
const limitSize = this.picOptions.limitSize || 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this
.
$message
.
error
(
"上传图片大小不能超过"
+
limitSize
+
"MB!"
)
this.$message.error(
`
上传
$
{
this
.
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}
大小不能超过
$
{
limitSize
}
MB!`
)
return
true
}
if
(
this
.
imageUrlArr
.
length
>
this
.
limit
)
{
this
.
$message
.
error
(
"最多上传9张图片"
)
this
.
$message
.
error
(
`最多上传
${
this
.
limit
}${
this
.
picOptions
.
type
==
"video"
?
"个视频"
:
"张图片"
}
`
)
return
}
this.$emit("beforeUpload")
...
...
@@ -113,7 +137,8 @@ export default {
const arrBase64 = imgFile.split(",")
const splitStr = file.name.split(".")
const fileUrl = splitStr[splitStr.length - 1] + "@" + arrBase64[1]
uploadImg
({
const _api = this.picOptions.type == "video" ? uploadVideo : uploadImg
_api({
file: fileUrl,
compress: this.picOptions.compress || 0
})
...
...
@@ -121,7 +146,9 @@ export default {
if (res) {
this.$notify({
title: "提示",
message
:
"图片上传成功"
,
message: `
$
{
this
.
picOptions
.
type
==
"video"
?
"视频"
:
"图片"
}
上传成功
`,
type: "success"
})
this.imageUrlArr.push(res)
...
...
@@ -132,9 +159,9 @@ export default {
})
}
e.target.value = ""
this
.
$refs
.
uploadImg
.
value
=
""
})
.finally((end) => {
this.$refs.uploadImg.value = ""
this.$emit("afterUpload", end)
})
}
...
...
src/views/contentManager/components/uploadPdf/index.vue
0 → 100644
View file @
2602f1e
<
template
>
<div
class=
"activity-img-box"
>
<div
class=
"upload-img"
>
<el-button
class=
"avatar-uploader-desc-word"
size=
"small"
icon=
"el-icon-puls"
key=
"btn-i"
:disabled=
"imageUrlArr && imageUrlArr.length >= limit"
>
上传文件
</el-button
>
<input
type=
"file"
ref=
"uploadImg"
class=
"upload-img"
style=
"opacity: 0"
v-if=
"imageUrlArr && imageUrlArr.length
< limit
"
accept=
".pdf"
@
change=
"(e) => handleImgChange(e)"
/>
</div>
<template
v-if=
"imageUrlArr && imageUrlArr.length > 0"
>
<div
class=
"file-wrap"
v-for=
"(item, index) in imageUrlArr"
:key=
"index"
>
<div
class=
"file-box"
>
<div
class=
"info"
v-if=
"item.imageName"
>
<img
class=
"logo"
:src=
"require('@/assets/pdf.png')"
alt=
""
/>
<span
class=
"name"
>
{{
item
.
imageName
}}
</span>
</div>
<div
class=
"process"
:style=
"
{
width: item.image ? '432px' : (compress * 432) / 100 + 'px'
}"
>
</div>
</div>
<img
v-if=
"item.image"
class=
"del-btn"
:src=
"require('@/assets/icon-delete.png')"
alt=
""
@
click=
"delFile(index)"
/>
</div>
</
template
>
<el-dialog
class=
"image-dialog"
:visible
.
sync=
"dialogVisibleImg"
:append-to-body=
"true"
width=
"50%"
>
<img
:src=
"dialogSrc"
width=
"100%"
v-if=
"dialogType == 'img'"
/>
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div>
</template>
<
script
>
import
{
uploadPDF
}
from
"@/api/sys.base"
export
default
{
props
:
{
picOptions
:
{
type
:
Object
,
default
:
()
=>
{
return
{
width
:
"104px"
,
height
:
"104px"
,
isClose
:
true
,
limitSize
:
10
}
}
},
imageUrlArr
:
{
type
:
Array
,
default
:
()
=>
[
{
name
:
"asdakf.pdf"
,
url
:
"sfdsfjskdf.pdf"
}
]
},
limit
:
{
type
:
String
,
default
:
"1"
},
index
:
{
type
:
Number
,
default
:
-
1
}
},
data
()
{
return
{
compress
:
0
,
dialogVisibleImg
:
false
}
},
methods
:
{
// 上传图片
handleImgChange
(
e
)
{
this
.
$notify
({
title
:
"提示"
,
message
:
`pdf上传中,请稍后`
})
var
file
=
e
.
srcElement
.
files
[
0
]
var
reader
=
new
FileReader
()
// 默认1MB
const
limitSize
=
this
.
picOptions
.
limitSize
||
10
const
isLt
=
file
.
size
/
1024
/
1024
<
limitSize
if
(
!
isLt
)
{
this
.
$message
.
error
(
`上传pdf大小不能超过
${
limitSize
}
MB!`
)
return
true
}
if
(
this
.
imageUrlArr
.
length
>
this
.
limit
)
{
this
.
$message
.
error
(
`最多上传
${
this
.
limit
}
个pdf文件`
)
return
}
this
.
$emit
(
"beforeUpload"
)
const
idx
=
this
.
imageUrlArr
.
length
this
.
$set
(
this
.
imageUrlArr
,
idx
,
{
imageName
:
file
.
name
,
image
:
""
})
console
.
log
(
this
.
imageUrlArr
,
"this.imageUrlArr"
)
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
(
e
)
=>
{
const
imgFile
=
e
.
target
.
result
const
arrBase64
=
imgFile
.
split
(
","
)
const
splitStr
=
file
.
name
.
split
(
"."
)
const
fileUrl
=
splitStr
[
splitStr
.
length
-
1
]
+
"@"
+
arrBase64
[
1
]
uploadPDF
({
file
:
fileUrl
,
onProcess
:
(
e
)
=>
{
// 上传进度
const
{
loaded
,
total
}
=
e
const
uploadPrecent
=
((
loaded
/
total
)
*
100
)
|
0
this
.
compress
=
uploadPrecent
}
})
.
then
((
res
)
=>
{
if
(
res
)
{
this
.
$notify
({
title
:
"提示"
,
message
:
`pdf上传成功`
,
type
:
"success"
})
this
.
$set
(
this
.
imageUrlArr
,
idx
,
{
imageName
:
file
.
name
,
image
:
res
})
console
.
log
(
this
.
imageUrlArr
,
"this.imageUrlArr"
)
this
.
$emit
(
"change"
,
{
arr
:
this
.
imageUrlArr
,
key
:
this
.
picOptions
.
key
,
index
:
this
.
index
})
}
e
.
target
.
value
=
""
})
.
finally
((
end
)
=>
{
this
.
$refs
.
uploadImg
.
value
=
""
this
.
$emit
(
"afterUpload"
,
end
)
})
}
},
// 预览图文
handleEnlarge
(
src
,
type
)
{
this
.
dialogVisibleImg
=
true
this
.
dialogSrc
=
src
this
.
dialogType
=
type
?
type
:
"img"
},
// 删除图片/视频
delFile
(
index
)
{
this
.
imageUrlArr
.
splice
(
index
,
1
)
this
.
$emit
(
"change"
,
{
arr
:
this
.
imageUrlArr
,
key
:
this
.
picOptions
.
key
,
id
:
1
,
index
:
this
.
index
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.file-wrap
{
display
:
flex
;
align-items
:
center
;
.file-box
{
width
:
432px
;
height
:
32px
;
border-radius
:
4px
;
position
:
relative
;
.info
{
height
:
inherit
;
display
:
flex
;
align-items
:
center
;
margin-left
:
8px
;
position
:
relative
;
z-index
:
1
;
.logo
{
margin-right
:
8px
;
}
.name
{
color
:
#1d1d1d
;
}
}
.process
{
position
:
absolute
;
height
:
32px
;
left
:
0
;
top
:
0
;
background
:
#f4f6f7
;
}
}
.del-btn
{
width
:
16px
;
height
:
16px
;
cursor
:
pointer
;
margin-left
:
10px
;
}
}
.activity-img-box
{
max-width
:
600px
;
.pic-box
{
position
:
relative
;
width
:
104px
;
height
:
104px
;
border-radius
:
4px
;
margin-right
:
8px
;
margin-bottom
:
5px
;
&:hover
.mask
{
opacity
:
1
;
}
.pic
{
position
:
absolute
;
object-fit
:
fill
;
}
.photo-activity
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
}
.mask
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
position
:
absolute
;
background
:
rgba
(
0
,
0
,
0
,
0.5
);
color
:
#ffffff
;
opacity
:
0
;
top
:
0
;
right
:
0
;
width
:
104px
;
height
:
104px
;
z-index
:
999
;
.pic-pane-close
{
width
:
16px
;
height
:
16px
;
cursor
:
pointer
;
margin-left
:
24px
;
&:first-child
{
margin-left
:
0
;
}
img
{
width
:
100%
;
display
:
block
;
}
}
}
}
.upload-img
{
position
:
relative
;
display
:
inline-block
;
input
{
position
:
absolute
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
z-index
:
1
;
}
}
.avatar-uploader-desc-word
{
font-weight
:
400
;
font-size
:
28
rpx
;
color
:
#666666
;
margin-bottom
:
8px
;
}
.image-dialog
{
::v-deep
{
.el-dialog__header
{
border-bottom
:
0px
;
padding
:
0px
;
}
}
}
}
</
style
>
src/views/contentManager/contentAdd.vue
View file @
2602f1e
This diff is collapsed.
Click to expand it.
src/views/contentManager/contentManagerList.vue
View file @
2602f1e
...
...
@@ -42,12 +42,14 @@
<div
slot=
"merchantSlot"
slot-scope=
"scope"
>
<div
v-if=
"scope.scope.showMerchant == 0"
>
全部门店
</div>
<el-popover
v-else
placement=
"top"
width=
"200"
trigger=
"hover"
>
<div
class=
"merchant-name"
v-for=
"(item, index) in scope.scope.assignInfos || []"
:key=
"index"
>
{{
item
.
assignName
}}
<div
class=
"merchant-wrap"
>
<div
class=
"merchant-name"
v-for=
"(item, index) in scope.scope.assignInfos || []"
:key=
"index"
>
{{
item
.
assignName
}}
</div>
</div>
<div
slot=
"reference"
>
<span
class=
"merchant-num"
>
{{
...
...
@@ -69,7 +71,7 @@
<el-button
type=
"text"
size=
"mini"
@
click=
"handleDetail(scope.scope)"
>
查看
</el-button>
<el-button
type=
"text"
size=
"mini"
@
click=
"handle
Detail
(scope.scope)"
>
<el-button
type=
"text"
size=
"mini"
@
click=
"handle
Add
(scope.scope)"
>
编辑
</el-button>
<el-button
...
...
@@ -252,7 +254,10 @@ export default {
{
label
:
"浏览次数"
,
prop
:
"browseCount"
,
width
:
"120px"
width
:
"120px"
,
formatter
:
(
cell
)
=>
{
return
cell
.
browseCount
||
0
}
},
{
label
:
"状态"
,
...
...
@@ -323,12 +328,16 @@ export default {
resolve
()
})
},
handleAdd
()
{
handleAdd
(
row
)
{
let
params
=
{
addOrEdit
:
row
?.
id
?
"edit"
:
"add"
}
if
(
row
?.
id
)
{
params
.
id
=
row
.
id
}
this
.
$router
.
push
({
name
:
"contentAdd"
,
params
:
{
addOrEdit
:
"add"
}
params
})
},
handleDetail
(
row
)
{
...
...
@@ -432,4 +441,8 @@ export default {
margin-right
:
6px
;
vertical-align
:
middle
;
}
.merchant-wrap
{
max-height
:
400px
;
overflow-y
:
auto
;
}
</
style
>
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