Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
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 c3fdb02e
authored
Sep 02, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
众筹
1 parent
6d982563
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
78 deletions
src/views/seckillActivity/crowdEditWechat.vue
src/views/seckillActivity/editCrowdFund.vue
src/views/seckillActivity/crowdEditWechat.vue
View file @
c3fdb02
...
@@ -55,83 +55,23 @@ export default {
...
@@ -55,83 +55,23 @@ export default {
name
:
'crowdEditWechat'
,
name
:
'crowdEditWechat'
,
data
()
{
data
()
{
return
{
return
{}
// 倒计时
countDownObj
:
{
typeTxt
:
'距离活动开始'
,
activityStatus
:
1
,
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
},
}
},
},
props
:
{
props
:
{
editForm
:
{
editForm
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
}
},
countDownObj
:
{
type
:
Object
,
default
:
()
=>
{
}
}
}
},
},
mounted
()
{
},
mounted
()
{
},
methods
:
{
methods
:
{}
findCountDownTime
()
{
let
startTime
=
new
Date
(
this
.
editForm
.
activityTime
[
0
])
let
endTime
=
new
Date
(
this
.
editForm
.
activityTime
[
1
])
let
currentTime
=
new
Date
()
// activityStatus 1:未开始,2进行中,3已结束
let
activityStatus
=
currentTime
<
startTime
?
1
:
endTime
<
currentTime
?
2
:
3
return
{
activityStatus
,
startTime
:
activityStatus
==
1
?
currentTime
:
activityStatus
==
2
?
currentTime
:
endTime
,
endTime
:
activityStatus
==
1
?
startTime
:
activityStatus
==
2
?
endTime
:
endTime
}
},
countDown
()
{
if
(
this
.
editForm
.
activityTime
&&
this
.
editForm
.
activityTime
.
length
)
{
let
{
activityStatus
,
startTime
,
endTime
}
=
this
.
findCountDownTime
()
let
lefttime
=
parseInt
((
endTime
.
getTime
()
-
startTime
.
getTime
())
/
1000
)
let
d
=
parseInt
(
lefttime
/
(
24
*
60
*
60
))
let
h
=
parseInt
((
lefttime
/
(
60
*
60
))
%
24
)
let
m
=
parseInt
((
lefttime
/
60
)
%
60
)
let
s
=
parseInt
(
lefttime
%
60
)
h
=
this
.
addZero
(
h
)
m
=
this
.
addZero
(
m
)
s
=
this
.
addZero
(
s
)
let
typeTxt
=
{
1
:
'距离活动开始'
,
2
:
'距离活动结束'
,
3
:
'活动倒计时'
}[
activityStatus
]
if
(
this
.
time
)
clearTimeout
(
this
.
time
)
this
.
time
=
setTimeout
(()
=>
{
if
(
d
>
0
)
d
=
this
.
addZero
(
d
)
this
.
countDownObj
=
{
typeTxt
:
typeTxt
,
d
:
d
,
h
:
h
,
m
:
m
,
s
:
s
}
this
.
countDown
()
},
1
*
1000
)
}
else
{
this
.
countDownObj
=
{
typeTxt
:
'距离活动开始'
,
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
}
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/seckillActivity/editCrowdFund.vue
View file @
c3fdb02
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
</div>
</div>
<div
:class=
"['form-show-block', arrowFlagObj.activityServices == 'close' ? 'form-close' : 'form-open']"
>
<div
:class=
"['form-show-block', arrowFlagObj.activityServices == 'close' ? 'form-close' : 'form-open']"
>
<div
v-for=
"(item, index) in editForm.activityServices"
:key=
"index"
:class=
"['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']"
>
<div
v-for=
"(item, index) in editForm.activityServices"
:key=
"index"
:class=
"['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class=
"p-t-20"
ref=
"service
editFormRef"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"serviceEditFormData"
:formRules=
"e
ditRule"
></glsx-combi-form>
<glsx-combi-form
class=
"p-t-20"
ref=
"service
EditFormRef"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"serviceEditFormData"
:formRules=
"serviceE
ditRule"
></glsx-combi-form>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('services', 'activityServices', index)"
>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('services', 'activityServices', index)"
>
<img
class=
"icon-add"
src=
"@/assets/icon-delete.png"
/>
<img
class=
"icon-add"
src=
"@/assets/icon-delete.png"
/>
</el-button>
</el-button>
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
</div>
</div>
<div
:class=
"['form-show-block', arrowFlagObj.activityCommoditys == 'close' ? 'form-close' : 'form-open']"
>
<div
:class=
"['form-show-block', arrowFlagObj.activityCommoditys == 'close' ? 'form-close' : 'form-open']"
>
<div
v-for=
"(item, index) in editForm.activityCommoditys"
:key=
"index"
:class=
"['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']"
>
<div
v-for=
"(item, index) in editForm.activityCommoditys"
:key=
"index"
:class=
"['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class=
"p-t-20"
ref=
"
serviceeditFormRef"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"commoditysEditFormData"
:formRules=
"e
ditRule"
></glsx-combi-form>
<glsx-combi-form
class=
"p-t-20"
ref=
"
commoditysEditFormRef"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"commoditysEditFormData"
:formRules=
"commoditysE
ditRule"
></glsx-combi-form>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('commoditys', 'activityCommoditys', index)"
>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('commoditys', 'activityCommoditys', index)"
>
<img
class=
"icon-add"
src=
"@/assets/icon-delete.png"
/>
<img
class=
"icon-add"
src=
"@/assets/icon-delete.png"
/>
</el-button>
</el-button>
...
@@ -214,7 +214,7 @@
...
@@ -214,7 +214,7 @@
</div>
</div>
<div
:class=
"['form-show-block', arrowFlagObj.activityExperienceDTOs == 'close' ? 'form-close' : 'form-open']"
>
<div
:class=
"['form-show-block', arrowFlagObj.activityExperienceDTOs == 'close' ? 'form-close' : 'form-open']"
>
<div
v-for=
"(item, index) in editForm.activityExperienceDTOs"
:key=
"index"
:class=
"['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']"
>
<div
v-for=
"(item, index) in editForm.activityExperienceDTOs"
:key=
"index"
:class=
"['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class=
"p-t-20"
ref=
"serviceeditFormRef"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"experiencesEditFormData"
:formRules=
"editRule"
>
<glsx-combi-form
class=
"p-t-20"
:formRef=
"editChildRef"
:isEdit=
"true"
:isBlock=
"true"
:formObj=
"item"
:formData=
"experiencesEditFormData"
:formRules=
"editRule"
>
<div
slot=
"activityExperienceImgs"
class=
"edit-tips m-t-8"
>
建议尺寸:图片大小不超过5m,最多可添加9张图片
</div>
<div
slot=
"activityExperienceImgs"
class=
"edit-tips m-t-8"
>
建议尺寸:图片大小不超过5m,最多可添加9张图片
</div>
</glsx-combi-form>
</glsx-combi-form>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('experiences', 'activityExperienceDTOs', index)"
>
<el-button
class=
"btn-basic btn-delete"
:size=
"size"
type=
"text"
@
click=
"handleDeleteItem('experiences', 'activityExperienceDTOs', index)"
>
...
@@ -233,8 +233,7 @@
...
@@ -233,8 +233,7 @@
</GLFooter>
</GLFooter>
<!-- 展示 -->
<!-- 展示 -->
<GLDialog
bigTitle=
"预览"
mode=
"big"
:visible
.
sync=
"wechatVisible"
@
onOk=
"handleWechat"
@
onCancel=
"handleWechat"
>
<GLDialog
bigTitle=
"预览"
mode=
"big"
:visible
.
sync=
"wechatVisible"
@
onOk=
"handleWechat"
@
onCancel=
"handleWechat"
>
<!-- <map-view ref="mapForm" :mapHeight="mapHeight"></map-view> -->
<crowdEditWechat
ref=
"crowdEditWechat"
:editForm=
"editForm"
:countDownObj=
"countDownObj"
></crowdEditWechat>
<crowdEditWechat
:editForm=
"editForm"
></crowdEditWechat>
</GLDialog>
</GLDialog>
<select-single-pro-dialog
v-if=
"isSingleSelectVisible"
:isSingleSelectVisible=
"isSingleSelectVisible"
:selectedProInfo=
"selectedProInfo"
@
handleSingleSelectConfirm=
"handleSingleSelectConfirm"
@
handleSingleSelectClose=
"handleSingleSelectClose(true)"
></select-single-pro-dialog>
<select-single-pro-dialog
v-if=
"isSingleSelectVisible"
:isSingleSelectVisible=
"isSingleSelectVisible"
:selectedProInfo=
"selectedProInfo"
@
handleSingleSelectConfirm=
"handleSingleSelectConfirm"
@
handleSingleSelectClose=
"handleSingleSelectClose(true)"
></select-single-pro-dialog>
</div>
</div>
...
@@ -285,6 +284,15 @@ export default {
...
@@ -285,6 +284,15 @@ export default {
numReg
:
/^
[
1-9
]\d
*$/
numReg
:
/^
[
1-9
]\d
*$/
},
},
/* eslint-enable */
/* eslint-enable */
// 倒计时
countDownObj
:
{
typeTxt
:
'距离活动开始'
,
activityStatus
:
1
,
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
},
isDisabled
:
false
,
isDisabled
:
false
,
// 预览
// 预览
wechatVisible
:
false
,
wechatVisible
:
false
,
...
@@ -541,6 +549,10 @@ export default {
...
@@ -541,6 +549,10 @@ export default {
title
:
''
,
title
:
''
,
content
:
''
content
:
''
},
},
serviceEditRule
:
{
title
:
[{
required
:
true
,
message
:
'请输入标题'
,
trigger
:
'change'
}],
content
:
[{
required
:
true
,
message
:
'请输入内容'
,
trigger
:
'change'
}]
},
// 服务说明
// 服务说明
serviceEditFormData
:
[
serviceEditFormData
:
[
{
{
...
@@ -563,6 +575,10 @@ export default {
...
@@ -563,6 +575,10 @@ export default {
question
:
''
,
question
:
''
,
answer
:
''
answer
:
''
},
},
commoditysEditRule
:
{
question
:
[{
required
:
true
,
message
:
'请输入问题'
,
trigger
:
'change'
}],
answer
:
[{
required
:
true
,
message
:
'请输入答案'
,
trigger
:
'change'
}]
},
// 商品答疑
// 商品答疑
commoditysEditFormData
:
[
commoditysEditFormData
:
[
{
{
...
@@ -919,6 +935,59 @@ export default {
...
@@ -919,6 +935,59 @@ export default {
return
i
<
10
?
`0
${
i
}
`
:
`
${
i
}
`
return
i
<
10
?
`0
${
i
}
`
:
`
${
i
}
`
},
},
findCountDownTime
()
{
let
startTime
=
new
Date
(
this
.
editForm
.
activityTime
[
0
])
let
endTime
=
new
Date
(
this
.
editForm
.
activityTime
[
1
])
let
currentTime
=
new
Date
()
// activityStatus 1:未开始,2进行中,3已结束
let
activityStatus
=
currentTime
<
startTime
?
1
:
endTime
<
currentTime
?
2
:
3
return
{
activityStatus
,
startTime
:
activityStatus
==
1
?
currentTime
:
activityStatus
==
2
?
currentTime
:
endTime
,
endTime
:
activityStatus
==
1
?
startTime
:
activityStatus
==
2
?
endTime
:
endTime
}
},
countDown
()
{
if
(
this
.
editForm
.
activityTime
&&
this
.
editForm
.
activityTime
.
length
)
{
let
{
activityStatus
,
startTime
,
endTime
}
=
this
.
findCountDownTime
()
let
lefttime
=
parseInt
((
endTime
.
getTime
()
-
startTime
.
getTime
())
/
1000
)
let
d
=
parseInt
(
lefttime
/
(
24
*
60
*
60
))
let
h
=
parseInt
((
lefttime
/
(
60
*
60
))
%
24
)
let
m
=
parseInt
((
lefttime
/
60
)
%
60
)
let
s
=
parseInt
(
lefttime
%
60
)
h
=
this
.
addZero
(
h
)
m
=
this
.
addZero
(
m
)
s
=
this
.
addZero
(
s
)
let
typeTxt
=
{
1
:
'距离活动开始'
,
2
:
'距离活动结束'
,
3
:
'活动倒计时'
}[
activityStatus
]
if
(
this
.
time
)
clearTimeout
(
this
.
time
)
this
.
time
=
setTimeout
(()
=>
{
if
(
d
>
0
)
d
=
this
.
addZero
(
d
)
this
.
countDownObj
=
{
typeTxt
:
typeTxt
,
d
:
d
,
h
:
h
,
m
:
m
,
s
:
s
}
this
.
countDown
()
},
1
*
1000
)
}
else
{
this
.
countDownObj
=
{
typeTxt
:
'距离活动开始'
,
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
}
}
},
handleTimeChange
(
value
,
targetItem
)
{
handleTimeChange
(
value
,
targetItem
)
{
!
value
&&
(
this
.
editForm
[
targetItem
.
name
]
=
[])
!
value
&&
(
this
.
editForm
[
targetItem
.
name
]
=
[])
},
},
...
@@ -1313,7 +1382,6 @@ export default {
...
@@ -1313,7 +1382,6 @@ export default {
}
}
// 玩家心得
// 玩家心得
if
(
this
.
editForm
.
activityExperienceDTOs
.
length
)
{
if
(
this
.
editForm
.
activityExperienceDTOs
.
length
)
{
// this.listAddIdx(this.editForm.activityExperienceDTOs)
this
.
editForm
.
activityExperienceDTOs
.
forEach
((
item
,
index
)
=>
{
this
.
editForm
.
activityExperienceDTOs
.
forEach
((
item
,
index
)
=>
{
item
.
idx
=
index
item
.
idx
=
index
item
.
activityExperienceImgs
=
item
.
activityExperienceImgs
.
map
(
item
=>
item
.
imageUrl
)
item
.
activityExperienceImgs
=
item
.
activityExperienceImgs
.
map
(
item
=>
item
.
imageUrl
)
...
@@ -1436,8 +1504,29 @@ export default {
...
@@ -1436,8 +1504,29 @@ export default {
})
})
},
},
// 去掉list空值
delListAllEmpty
(
listName
,
attrParamsList
)
{
if
(
!
this
.
editForm
[
listName
].
length
)
{
return
this
.
editForm
[
listName
]
}
var
list
=
[]
var
attrList
=
attrParamsList
||
Object
.
keys
(
this
.
editForm
[
listName
][
0
])
this
.
editForm
[
listName
].
forEach
(
item
=>
{
for
(
let
i
=
0
;
i
<
attrList
.
length
;
i
++
)
{
let
attrItem
=
attrList
[
i
]
if
(
item
[
attrItem
])
{
list
.
push
(
item
)
break
}
}
})
return
list
},
handleConfirm
()
{
handleConfirm
()
{
this
.
stopMusic
()
this
.
stopMusic
()
this
.
editForm
.
activityServices
=
this
.
delListAllEmpty
(
'activityServices'
,
[
'title'
,
'content'
])
this
.
editForm
.
activityCommoditys
=
this
.
delListAllEmpty
(
'activityCommoditys'
,
[
'question'
,
'answer'
])
this
.
validateRules
()
this
.
validateRules
()
var
flag
=
true
var
flag
=
true
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
if
(
this
.
nameToValSpecsList
&&
this
.
nameToValSpecsList
.
length
>
0
)
{
...
@@ -1463,6 +1552,7 @@ export default {
...
@@ -1463,6 +1552,7 @@ export default {
}
}
}
}
let
validList
=
[]
let
validList
=
[]
var
validFlag
=
true
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
valid
,
errorObj
)
=>
{
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
valid
,
errorObj
)
=>
{
validList
=
[
validList
=
[
{
valid
:
!
valid
,
errorObj
:
errorObj
},
{
valid
:
!
valid
,
errorObj
:
errorObj
},
...
@@ -1472,16 +1562,43 @@ export default {
...
@@ -1472,16 +1562,43 @@ export default {
validList
.
push
({
valid
:
!
configValid
,
errorObj
:
configErrorObj
})
validList
.
push
({
valid
:
!
configValid
,
errorObj
:
configErrorObj
})
if
(
this
.
checkValid
(
validList
))
{
if
(
this
.
checkValid
(
validList
))
{
if
(
this
.
$refs
.
customerEditFormRef
)
{
if
(
this
.
$refs
.
customerEditFormRef
)
{
this
.
$refs
.
customerEditFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
serviceValid
,
serviceErrorObj
)
=>
{
this
.
$refs
.
customerEditFormRef
.
$refs
[
this
.
editChildRef
].
validate
((
customerValid
,
customerErrorObj
)
=>
{
validList
.
splice
(
2
,
0
,
{
valid
:
!
serviceValid
,
errorObj
:
serviceErrorObj
})
validList
.
splice
(
2
,
0
,
{
valid
:
!
customerValid
,
errorObj
:
customerErrorObj
})
if
(
this
.
checkValid
(
validList
))
{
// if (this.checkValid(validList)) {
this
.
addOrUpdate
()
// this.addOrUpdate()
// }
if
(
!
this
.
checkValid
(
validList
))
{
validFlag
=
false
}
}
})
})
}
else
{
this
.
addOrUpdate
()
}
}
if
(
this
.
$refs
.
serviceEditFormRef
)
{
this
.
$refs
.
serviceEditFormRef
.
forEach
(
item
=>
{
item
.
$refs
[
this
.
editChildRef
].
validate
((
serviceValid
,
serviceErrorObj
)
=>
{
if
(
!
serviceValid
)
{
validFlag
=
false
this
.
whereToGo
(
'activityServices'
)
}
})
})
}
if
(
this
.
$refs
.
commoditysEditFormRef
)
{
this
.
$refs
.
commoditysEditFormRef
.
forEach
(
item
=>
{
item
.
$refs
[
this
.
editChildRef
].
validate
((
commoditysValid
,
commoditysErrorObj
)
=>
{
if
(
!
commoditysValid
)
{
validFlag
=
false
this
.
whereToGo
(
'activityCommoditys'
)
}
})
})
}
// else {
// this.addOrUpdate()
// }
}
else
{
validFlag
=
false
}
}
validFlag
&&
this
.
addOrUpdate
()
})
})
})
})
},
},
...
...
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