Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-activity-center
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 43f1e5ae
authored
Dec 24, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
92eb8de8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
41 deletions
src/api/modules/record.js
src/styles/common.scss
src/views/activityRecord/addRecord.vue
src/views/activityRecord/index.vue
src/views/activityRecord/viewRecord.vue
src/api/modules/record.js
View file @
43f1e5a
...
...
@@ -67,11 +67,23 @@ const activityRecordSync = params => {
})
}
// 获取众筹活动数据
const
findActivity
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.crowdfunding.activity.smart.card'
return
http
({
url
:
'/rop-scrm-shopmall/router'
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getActivityRecord
,
addActivityRecord
,
getActivityRecordDetail
,
delActivityRecord
,
updateActivityRecord
,
activityRecordSync
activityRecordSync
,
findActivity
}
src/styles/common.scss
View file @
43f1e5a
...
...
@@ -142,7 +142,7 @@
}
.dot2
{
background-color
:
#
2cca74
;
background-color
:
#
5850FF
;
}
.dot3
{
...
...
@@ -158,5 +158,5 @@
}
.dot6
{
background-color
:
#5850FF
;
}
}
}
\ No newline at end of file
src/views/activityRecord/addRecord.vue
View file @
43f1e5a
...
...
@@ -4,30 +4,30 @@
<div
class=
"record-box"
>
<div
class=
"title"
>
活动记录
</div>
<div
class=
"record-form"
>
<el-form-item
class=
"activity-name"
label=
"活动ID:"
prop=
"
activityName
"
>
<el-form-item
class=
"activity-name"
label=
"活动ID:"
prop=
"
crowdFundActivityId
"
>
<el-input
v-model=
"recordForm.crowdFundActivityId"
:disabled=
"routeInfo.addOrEdit == 2"
></el-input>
<el-button
size=
"small"
type=
"primary"
:disabled=
"routeInfo.addOrEdit == 2"
>
查询
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"findActivity"
:disabled=
"routeInfo.addOrEdit == 2"
>
查询
</el-button>
</el-form-item>
<!-- 活动详情 -->
<div
class=
"activity-detail"
>
<div
class=
"activity-detail"
v-show=
"recordForm.activityName || activityDetail.activityName"
>
<div
class=
"activity-detail-left"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-title"
>
活动名称:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
activityName
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
activityName
||
activityDetail
.
activityName
}}
</div>
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动地址:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
province
}}
-
{{
recordForm
.
city
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
province
City
||
activityDetail
.
activityAddressDetailName
||
'-'
}}
</div>
</div>
</div>
<div
class=
"activity-detail-right"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-title"
>
主办方:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
merchantName
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
merchantName
||
activityDetail
.
sponsorName
}}
</div>
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动时间:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
beginTime
}}
-
{{
recordForm
.
endTime
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
beginTime
||
activityDetail
.
startTime
}}
-
{{
recordForm
.
endTime
||
activityDetail
.
endTime
}}
</div>
</div>
</div>
</div>
...
...
@@ -67,8 +67,8 @@
</el-form-item>
<el-form-item
label=
"活动图片:"
class=
"add-img"
>
<div
class=
"activity-img-box"
>
<
template
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl"
:key=
"index"
>
<
template
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl
Arr
"
:key=
"index"
>
<div
class=
"video-box"
>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<div
class=
"mask"
>
...
...
@@ -82,7 +82,7 @@
</div>
</div>
</
template
>
<
template
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length < 9"
>
<
template
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length < 9"
>
<div
class=
"upload-img"
>
<i
class=
"el-icon-plus avatar-uploader-desc-icon"
></i>
<div
class=
"avatar-uploader-desc-word"
>
上传照片
</div>
...
...
@@ -113,12 +113,12 @@ export default {
recordForm
:
{
crowdFundActivityId
:
''
,
activityEvent
:
''
,
imageUrl
:
[],
imageUrl
Arr
:
[],
videoUrl
:
''
,
videoImage
:
''
},
recordRules
:
{
activityName
:
[{
required
:
true
,
message
:
'请输入活动ID'
,
trigger
:
'blur'
}],
crowdFundActivityId
:
[{
required
:
true
,
message
:
'请输入活动ID'
,
trigger
:
'blur'
}],
activityEvent
:
[
{
required
:
true
,
message
:
'请输入活动介绍'
,
trigger
:
'blur'
},
{
max
:
500
,
message
:
'最多输入500个字符'
,
trigger
:
'blur'
}
...
...
@@ -127,7 +127,8 @@ export default {
dialogVisibleImg
:
false
,
dialogSrc
:
''
,
dialogType
:
''
,
routeInfo
:
{}
routeInfo
:
{},
activityDetail
:
{}
}
},
created
()
{
...
...
@@ -142,18 +143,25 @@ export default {
console
.
log
(
res
)
if
(
res
)
{
this
.
recordForm
=
res
this
.
recordForm
.
imageUrl
=
this
.
recordForm
.
imageUrl
.
split
(
','
)
}
console
.
log
(
this
.
recordForm
,
'=='
)
})
},
// 获取众筹活动数据
findActivity
()
{
this
.
$apis
.
record
.
findActivity
({
activityId
:
this
.
recordForm
.
crowdFundActivityId
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
activityDetail
=
res
}
})
},
// 上传图片
handleImgChange
(
e
)
{
this
.
$notify
({
title
:
'提示'
,
message
:
'图片上传中,请稍后'
})
document
.
querySelector
(
'.upload-img'
).
value
=
''
var
file
=
e
.
srcElement
.
files
[
0
]
var
reader
=
new
FileReader
()
// 默认1MB
...
...
@@ -163,10 +171,11 @@ export default {
this
.
$message
.
error
(
'上传图片大小不能超过'
+
limitSize
+
'MB!'
)
return
true
}
if
(
this
.
recordForm
.
im
gUrl
.
length
>
9
)
{
if
(
this
.
recordForm
.
im
ageUrlArr
.
length
>
9
)
{
this
.
$message
.
error
(
'最多上传9张图片'
)
return
}
document
.
querySelector
(
'.upload-img'
).
value
=
''
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
...
...
@@ -181,7 +190,7 @@ export default {
type
:
'success'
})
console
.
log
(
res
)
this
.
recordForm
.
im
gUrl
.
push
(
res
)
this
.
recordForm
.
im
ageUrlArr
.
push
(
res
)
}
})
}
...
...
@@ -288,7 +297,7 @@ export default {
this
.
recordForm
.
videoImage
=
''
break
case
'img'
:
this
.
recordForm
.
im
gUrl
.
splice
(
index
,
1
)
this
.
recordForm
.
im
ageUrlArr
.
splice
(
index
,
1
)
break
default
:
this
.
recordForm
.
videoUrl
=
''
...
...
@@ -297,7 +306,7 @@ export default {
handleCancel
()
{
this
.
$router
.
go
(
-
1
)
},
handleConfirm
()
{
async
handleConfirm
()
{
this
.
$refs
[
'recordForm'
].
validate
(
valid
=>
{
if
(
!
valid
)
{
this
.
$message
.
error
(
'请填写必填属性'
)
...
...
@@ -312,15 +321,46 @@ export default {
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
recordForm
))
// 创建
if
(
this
.
routeInfo
.
addOrEdit
==
1
)
{
params
.
merchantNo
=
this
.
$globalState
.
session
.
merchantId
let
detailData
=
await
this
.
$apis
.
record
.
findActivity
({
activityId
:
this
.
recordForm
.
crowdFundActivityId
})
console
.
log
(
detailData
,
'==='
)
params
.
merchantNo
=
detailData
.
merchantId
params
.
merchantName
=
detailData
.
merchantName
params
.
activityName
=
detailData
.
activityName
params
.
beginTime
=
detailData
.
startTime
params
.
endTime
=
detailData
.
endTime
// params.beginTime = '2022-12-12 12:00:00'
// params.endTime = '2022-12-15 12:00:00'
params
.
address
=
detailData
.
activityAddressDetailName
params
.
participants
=
detailData
.
orderCount
params
.
status
=
detailData
.
activityStatus
params
.
sponsorName
=
detailData
.
sponsorName
console
.
log
(
params
)
this
.
$apis
.
record
.
addActivityRecord
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
({
message
:
'创建成功'
,
type
:
'success'
})
this
.
$router
.
push
({
path
:
'/activityRecord/index'
})
}
})
}
else
{
// 编辑
params
.
id
=
this
.
routeInfo
.
id
this
.
$apis
.
record
.
updateActivityRecord
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
({
message
:
'编辑成功'
,
type
:
'success'
})
this
.
$router
.
push
({
path
:
'/activityRecord/index'
})
}
})
}
}
...
...
@@ -439,10 +479,16 @@ export default {
margin
:
0
0
20px
154px
;
background
:
#f9f9f9
;
padding
:
20px
0
;
max-width
:
600px
;
min-width
:
600px
;
//
&-left,
//
&-right
{
//
width
:
50%
;
//
}
&
-content
{
display
:
flex
;
.activity-title
{
width
:
120px
;
text-align
:
right
;
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
28
rpx
;
...
...
src/views/activityRecord/index.vue
View file @
43f1e5a
...
...
@@ -14,9 +14,9 @@
<span>
{{
scope
.
scope
.
beginTime
}}
至
{{
scope
.
scope
.
endTime
}}
</span>
</div>
<!-- 省市 -->
<div
slot=
"province"
slot-scope=
"scope"
>
<
!--
<
div
slot=
"province"
slot-scope=
"scope"
>
<span>
{{
scope
.
scope
.
province
}}
-
{{
scope
.
scope
.
city
}}
</span>
</div>
</div>
-->
<!-- 状态 -->
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
<div
:class=
"recordCss[scope.scope.status]"
></div>
...
...
@@ -34,14 +34,14 @@
</template>
<
script
>
const
recordCss
=
{
0
:
'draft'
,
1
:
'dot6
'
,
2
:
'dot3'
1
:
'draft'
,
2
:
'dot2
'
,
3
:
'dot3'
}
const
recordStatus
=
{
0
:
'未开始'
,
1
:
'进行中'
,
2
:
'已结束'
1
:
'未开始'
,
2
:
'进行中'
,
3
:
'已结束'
}
export
default
{
name
:
''
,
...
...
@@ -87,12 +87,12 @@ export default {
label
:
'活动时间'
,
addHtml
:
'activityTime'
,
prop
:
'beginTime'
,
minWidth
:
'2
2
0'
minWidth
:
'2
8
0'
},
{
label
:
'省市'
,
addHtml
:
'province'
,
prop
:
'province'
,
//
addHtml: 'province',
prop
:
'province
City
'
,
minWidth
:
'180'
},
{
...
...
@@ -204,6 +204,7 @@ export default {
type
:
'success'
,
message
:
'删除成功!'
})
this
.
handleSearch
()
}
})
})
...
...
src/views/activityRecord/viewRecord.vue
View file @
43f1e5a
...
...
@@ -17,7 +17,7 @@
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动地址:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
province
}}
-
{{
recordForm
.
c
ity
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
province
C
ity
}}
</div>
</div>
</div>
<div
class=
"activity-detail-right"
>
...
...
@@ -57,8 +57,8 @@
</div>
<div
class=
"record-flex"
>
<div
class=
"record-type"
>
活动图片:
</div>
<div
class=
"record-flex"
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl"
:key=
"index"
>
<div
class=
"record-flex"
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl
Arr
"
:key=
"index"
>
<div
class=
"video-box"
>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<div
class=
"mask"
>
...
...
@@ -89,7 +89,7 @@ export default {
recordForm
:
{
name
:
''
,
desc
:
''
,
imageUrl
:
[
'https://scrm.test.glsx.com.cn/group1/M00/03/60/wKgD3mOfzE2AWDPFAABLPhZhrpM684.png'
,
'https://scrm.test.glsx.com.cn/group1/M00/03/60/wKgD3mOfzE2AWDPFAABLPhZhrpM684.png'
],
imageUrl
Arr
:
[
'https://scrm.test.glsx.com.cn/group1/M00/03/60/wKgD3mOfzE2AWDPFAABLPhZhrpM684.png'
,
'https://scrm.test.glsx.com.cn/group1/M00/03/60/wKgD3mOfzE2AWDPFAABLPhZhrpM684.png'
],
videoUrl
:
'https://scrm.test.glsx.com.cn/group1/M00/03/5E/wKgD3mOcNtuAAF2VAAjFv3YDi0M222.mp4'
},
dialogVisibleImg
:
false
...
...
@@ -106,7 +106,7 @@ export default {
console
.
log
(
res
)
if
(
res
)
{
this
.
recordForm
=
res
this
.
recordForm
.
imageUrl
=
this
.
recordForm
.
imageUrl
.
split
(
','
)
// this.recordForm.imageUrlArr = this.recordForm.imageUrlArr
.split(',')
}
console
.
log
(
this
.
recordForm
,
'=='
)
})
...
...
@@ -124,8 +124,9 @@ export default {
activityRecordSync
()
{
let
params
=
{
id
:
this
.
routeInfo
.
id
,
crowdFundActivityId
:
this
.
r
outeInfo
.
crowdFundActivityId
crowdFundActivityId
:
this
.
r
ecordForm
.
crowdFundActivityId
}
console
.
log
(
params
)
this
.
$apis
.
record
.
activityRecordSync
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
)
{
...
...
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