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
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
40 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 => {
...
@@ -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
{
export
default
{
getActivityRecord
,
getActivityRecord
,
addActivityRecord
,
addActivityRecord
,
getActivityRecordDetail
,
getActivityRecordDetail
,
delActivityRecord
,
delActivityRecord
,
updateActivityRecord
,
updateActivityRecord
,
activityRecordSync
activityRecordSync
,
findActivity
}
}
src/styles/common.scss
View file @
43f1e5a
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
}
}
.dot2
{
.dot2
{
background-color
:
#
2cca74
;
background-color
:
#
5850FF
;
}
}
.dot3
{
.dot3
{
...
...
src/views/activityRecord/addRecord.vue
View file @
43f1e5a
...
@@ -4,30 +4,30 @@
...
@@ -4,30 +4,30 @@
<div
class=
"record-box"
>
<div
class=
"record-box"
>
<div
class=
"title"
>
活动记录
</div>
<div
class=
"title"
>
活动记录
</div>
<div
class=
"record-form"
>
<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-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>
</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-left"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-title"
>
活动名称:
</div>
<div
class=
"activity-title"
>
活动名称:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
activityName
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
activityName
||
activityDetail
.
activityName
}}
</div>
</div>
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动地址:
</div>
<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>
</div>
<div
class=
"activity-detail-right"
>
<div
class=
"activity-detail-right"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-detail-content activity-bottom"
>
<div
class=
"activity-title"
>
主办方:
</div>
<div
class=
"activity-title"
>
主办方:
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
merchantName
}}
</div>
<div
class=
"activity-content"
>
{{
recordForm
.
merchantName
||
activityDetail
.
sponsorName
}}
</div>
</div>
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动时间:
</div>
<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>
</div>
</div>
</div>
...
@@ -67,8 +67,8 @@
...
@@ -67,8 +67,8 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"活动图片:"
class=
"add-img"
>
<el-form-item
label=
"活动图片:"
class=
"add-img"
>
<div
class=
"activity-img-box"
>
<div
class=
"activity-img-box"
>
<
template
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length > 0"
>
<
template
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl"
:key=
"index"
>
<div
v-for=
"(item, index) in recordForm.imageUrl
Arr
"
:key=
"index"
>
<div
class=
"video-box"
>
<div
class=
"video-box"
>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<div
class=
"mask"
>
<div
class=
"mask"
>
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
template
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length < 9"
>
<
template
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length < 9"
>
<div
class=
"upload-img"
>
<div
class=
"upload-img"
>
<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>
...
@@ -113,12 +113,12 @@ export default {
...
@@ -113,12 +113,12 @@ export default {
recordForm
:
{
recordForm
:
{
crowdFundActivityId
:
''
,
crowdFundActivityId
:
''
,
activityEvent
:
''
,
activityEvent
:
''
,
imageUrl
:
[],
imageUrl
Arr
:
[],
videoUrl
:
''
,
videoUrl
:
''
,
videoImage
:
''
videoImage
:
''
},
},
recordRules
:
{
recordRules
:
{
activityName
:
[{
required
:
true
,
message
:
'请输入活动ID'
,
trigger
:
'blur'
}],
crowdFundActivityId
:
[{
required
:
true
,
message
:
'请输入活动ID'
,
trigger
:
'blur'
}],
activityEvent
:
[
activityEvent
:
[
{
required
:
true
,
message
:
'请输入活动介绍'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请输入活动介绍'
,
trigger
:
'blur'
},
{
max
:
500
,
message
:
'最多输入500个字符'
,
trigger
:
'blur'
}
{
max
:
500
,
message
:
'最多输入500个字符'
,
trigger
:
'blur'
}
...
@@ -127,7 +127,8 @@ export default {
...
@@ -127,7 +127,8 @@ export default {
dialogVisibleImg
:
false
,
dialogVisibleImg
:
false
,
dialogSrc
:
''
,
dialogSrc
:
''
,
dialogType
:
''
,
dialogType
:
''
,
routeInfo
:
{}
routeInfo
:
{},
activityDetail
:
{}
}
}
},
},
created
()
{
created
()
{
...
@@ -142,18 +143,25 @@ export default {
...
@@ -142,18 +143,25 @@ export default {
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
)
{
if
(
res
)
{
this
.
recordForm
=
res
this
.
recordForm
=
res
this
.
recordForm
.
imageUrl
=
this
.
recordForm
.
imageUrl
.
split
(
','
)
}
}
console
.
log
(
this
.
recordForm
,
'=='
)
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
)
{
handleImgChange
(
e
)
{
this
.
$notify
({
this
.
$notify
({
title
:
'提示'
,
title
:
'提示'
,
message
:
'图片上传中,请稍后'
message
:
'图片上传中,请稍后'
})
})
document
.
querySelector
(
'.upload-img'
).
value
=
''
var
file
=
e
.
srcElement
.
files
[
0
]
var
file
=
e
.
srcElement
.
files
[
0
]
var
reader
=
new
FileReader
()
var
reader
=
new
FileReader
()
// 默认1MB
// 默认1MB
...
@@ -163,10 +171,11 @@ export default {
...
@@ -163,10 +171,11 @@ export default {
this
.
$message
.
error
(
'上传图片大小不能超过'
+
limitSize
+
'MB!'
)
this
.
$message
.
error
(
'上传图片大小不能超过'
+
limitSize
+
'MB!'
)
return
true
return
true
}
}
if
(
this
.
recordForm
.
im
gUrl
.
length
>
9
)
{
if
(
this
.
recordForm
.
im
ageUrlArr
.
length
>
9
)
{
this
.
$message
.
error
(
'最多上传9张图片'
)
this
.
$message
.
error
(
'最多上传9张图片'
)
return
return
}
}
document
.
querySelector
(
'.upload-img'
).
value
=
''
reader
.
readAsDataURL
(
file
)
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
e
=>
{
reader
.
onload
=
e
=>
{
const
imgFile
=
e
.
target
.
result
const
imgFile
=
e
.
target
.
result
...
@@ -181,7 +190,7 @@ export default {
...
@@ -181,7 +190,7 @@ export default {
type
:
'success'
type
:
'success'
})
})
console
.
log
(
res
)
console
.
log
(
res
)
this
.
recordForm
.
im
gUrl
.
push
(
res
)
this
.
recordForm
.
im
ageUrlArr
.
push
(
res
)
}
}
})
})
}
}
...
@@ -288,7 +297,7 @@ export default {
...
@@ -288,7 +297,7 @@ export default {
this
.
recordForm
.
videoImage
=
''
this
.
recordForm
.
videoImage
=
''
break
break
case
'img'
:
case
'img'
:
this
.
recordForm
.
im
gUrl
.
splice
(
index
,
1
)
this
.
recordForm
.
im
ageUrlArr
.
splice
(
index
,
1
)
break
break
default
:
default
:
this
.
recordForm
.
videoUrl
=
''
this
.
recordForm
.
videoUrl
=
''
...
@@ -297,7 +306,7 @@ export default {
...
@@ -297,7 +306,7 @@ export default {
handleCancel
()
{
handleCancel
()
{
this
.
$router
.
go
(
-
1
)
this
.
$router
.
go
(
-
1
)
},
},
handleConfirm
()
{
async
handleConfirm
()
{
this
.
$refs
[
'recordForm'
].
validate
(
valid
=>
{
this
.
$refs
[
'recordForm'
].
validate
(
valid
=>
{
if
(
!
valid
)
{
if
(
!
valid
)
{
this
.
$message
.
error
(
'请填写必填属性'
)
this
.
$message
.
error
(
'请填写必填属性'
)
...
@@ -312,15 +321,46 @@ export default {
...
@@ -312,15 +321,46 @@ export default {
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
recordForm
))
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
recordForm
))
// 创建
// 创建
if
(
this
.
routeInfo
.
addOrEdit
==
1
)
{
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
=>
{
this
.
$apis
.
record
.
addActivityRecord
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
({
message
:
'创建成功'
,
type
:
'success'
})
this
.
$router
.
push
({
path
:
'/activityRecord/index'
})
}
})
})
}
else
{
}
else
{
// 编辑
// 编辑
params
.
id
=
this
.
routeInfo
.
id
params
.
id
=
this
.
routeInfo
.
id
this
.
$apis
.
record
.
updateActivityRecord
(
params
).
then
(
res
=>
{
this
.
$apis
.
record
.
updateActivityRecord
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
)
{
this
.
$message
({
message
:
'编辑成功'
,
type
:
'success'
})
this
.
$router
.
push
({
path
:
'/activityRecord/index'
})
}
})
})
}
}
}
}
...
@@ -439,10 +479,16 @@ export default {
...
@@ -439,10 +479,16 @@ export default {
margin
:
0
0
20px
154px
;
margin
:
0
0
20px
154px
;
background
:
#f9f9f9
;
background
:
#f9f9f9
;
padding
:
20px
0
;
padding
:
20px
0
;
max-width
:
600px
;
min-width
:
600px
;
//
&-left,
//
&-right
{
//
width
:
50%
;
//
}
&
-content
{
&
-content
{
display
:
flex
;
display
:
flex
;
.activity-title
{
.activity-title
{
width
:
120px
;
text-align
:
right
;
font-family
:
PingFangSC-Regular
;
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-weight
:
400
;
font-size
:
28
rpx
;
font-size
:
28
rpx
;
...
...
src/views/activityRecord/index.vue
View file @
43f1e5a
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
<span>
{{
scope
.
scope
.
beginTime
}}
至
{{
scope
.
scope
.
endTime
}}
</span>
<span>
{{
scope
.
scope
.
beginTime
}}
至
{{
scope
.
scope
.
endTime
}}
</span>
</div>
</div>
<!-- 省市 -->
<!-- 省市 -->
<div
slot=
"province"
slot-scope=
"scope"
>
<
!--
<
div
slot=
"province"
slot-scope=
"scope"
>
<span>
{{
scope
.
scope
.
province
}}
-
{{
scope
.
scope
.
city
}}
</span>
<span>
{{
scope
.
scope
.
province
}}
-
{{
scope
.
scope
.
city
}}
</span>
</div>
</div>
-->
<!-- 状态 -->
<!-- 状态 -->
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
<div
slot=
"status"
class=
"dot"
slot-scope=
"scope"
>
<div
:class=
"recordCss[scope.scope.status]"
></div>
<div
:class=
"recordCss[scope.scope.status]"
></div>
...
@@ -34,14 +34,14 @@
...
@@ -34,14 +34,14 @@
</template>
</template>
<
script
>
<
script
>
const
recordCss
=
{
const
recordCss
=
{
0
:
'draft'
,
1
:
'draft'
,
1
:
'dot6
'
,
2
:
'dot2
'
,
2
:
'dot3'
3
:
'dot3'
}
}
const
recordStatus
=
{
const
recordStatus
=
{
0
:
'未开始'
,
1
:
'未开始'
,
1
:
'进行中'
,
2
:
'进行中'
,
2
:
'已结束'
3
:
'已结束'
}
}
export
default
{
export
default
{
name
:
''
,
name
:
''
,
...
@@ -87,12 +87,12 @@ export default {
...
@@ -87,12 +87,12 @@ export default {
label
:
'活动时间'
,
label
:
'活动时间'
,
addHtml
:
'activityTime'
,
addHtml
:
'activityTime'
,
prop
:
'beginTime'
,
prop
:
'beginTime'
,
minWidth
:
'2
2
0'
minWidth
:
'2
8
0'
},
},
{
{
label
:
'省市'
,
label
:
'省市'
,
addHtml
:
'province'
,
//
addHtml: 'province',
prop
:
'province'
,
prop
:
'province
City
'
,
minWidth
:
'180'
minWidth
:
'180'
},
},
{
{
...
@@ -204,6 +204,7 @@ export default {
...
@@ -204,6 +204,7 @@ export default {
type
:
'success'
,
type
:
'success'
,
message
:
'删除成功!'
message
:
'删除成功!'
})
})
this
.
handleSearch
()
}
}
})
})
})
})
...
...
src/views/activityRecord/viewRecord.vue
View file @
43f1e5a
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-detail-content"
>
<div
class=
"activity-title"
>
活动地址:
</div>
<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>
</div>
<div
class=
"activity-detail-right"
>
<div
class=
"activity-detail-right"
>
...
@@ -57,8 +57,8 @@
...
@@ -57,8 +57,8 @@
</div>
</div>
<div
class=
"record-flex"
>
<div
class=
"record-flex"
>
<div
class=
"record-type"
>
活动图片:
</div>
<div
class=
"record-type"
>
活动图片:
</div>
<div
class=
"record-flex"
v-if=
"recordForm.imageUrl
&& recordForm.imageUrl
.length > 0"
>
<div
class=
"record-flex"
v-if=
"recordForm.imageUrl
Arr && recordForm.imageUrlArr
.length > 0"
>
<div
v-for=
"(item, index) in recordForm.imageUrl"
:key=
"index"
>
<div
v-for=
"(item, index) in recordForm.imageUrl
Arr
"
:key=
"index"
>
<div
class=
"video-box"
>
<div
class=
"video-box"
>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<img
class=
"photo-activity"
:src=
"item"
alt=
""
/>
<div
class=
"mask"
>
<div
class=
"mask"
>
...
@@ -89,7 +89,7 @@ export default {
...
@@ -89,7 +89,7 @@ export default {
recordForm
:
{
recordForm
:
{
name
:
''
,
name
:
''
,
desc
:
''
,
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'
videoUrl
:
'https://scrm.test.glsx.com.cn/group1/M00/03/5E/wKgD3mOcNtuAAF2VAAjFv3YDi0M222.mp4'
},
},
dialogVisibleImg
:
false
dialogVisibleImg
:
false
...
@@ -106,7 +106,7 @@ export default {
...
@@ -106,7 +106,7 @@ export default {
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
)
{
if
(
res
)
{
this
.
recordForm
=
res
this
.
recordForm
=
res
this
.
recordForm
.
imageUrl
=
this
.
recordForm
.
imageUrl
.
split
(
','
)
// this.recordForm.imageUrlArr = this.recordForm.imageUrlArr
.split(',')
}
}
console
.
log
(
this
.
recordForm
,
'=='
)
console
.
log
(
this
.
recordForm
,
'=='
)
})
})
...
@@ -124,8 +124,9 @@ export default {
...
@@ -124,8 +124,9 @@ export default {
activityRecordSync
()
{
activityRecordSync
()
{
let
params
=
{
let
params
=
{
id
:
this
.
routeInfo
.
id
,
id
:
this
.
routeInfo
.
id
,
crowdFundActivityId
:
this
.
r
outeInfo
.
crowdFundActivityId
crowdFundActivityId
:
this
.
r
ecordForm
.
crowdFundActivityId
}
}
console
.
log
(
params
)
this
.
$apis
.
record
.
activityRecordSync
(
params
).
then
(
res
=>
{
this
.
$apis
.
record
.
activityRecordSync
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
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