Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
4b3bb30c
Commit
4b3bb30c
authored
Jun 23, 2022
by
crushh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/游戏营销' into master
parents
ea035487
b19ac04e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
308 additions
and
96 deletions
+308
-96
base-config.vue
src/views/game/cmh/base-config.vue
+45
-22
form.vue
src/views/game/cmh/form.vue
+23
-11
gameTemplate.vue
src/views/game/cmh/gameTemplate.vue
+240
-63
No files found.
src/views/game/cmh/base-config.vue
View file @
4b3bb30c
...
...
@@ -9,7 +9,7 @@
<dm-sub-title
type=
"line"
>
展示信息配置
</dm-sub-title>
<div
class=
"mt20"
style=
"margin-bottom: 32px"
>
<el-form-item
label=
"游戏模板"
prop=
"templateId"
>
<el-radio-group
@
change=
"handleTemplateChange"
v-model=
"baseForm.templateId"
:disabled=
"isDisabled"
>
<el-radio-group
@
change=
"handleTemplateChange"
v-model=
"baseForm.templateId"
:disabled=
"isDisabled"
class=
"radioGroup"
>
<el-radio
v-for=
"item in templateData"
:label=
"item.templateId"
:key=
"item.templateId"
>
{{
item
.
templateName
}}
</el-radio>
</el-radio-group>
</el-form-item>
...
...
@@ -171,7 +171,8 @@ export default {
linkData
:
{}
},
isAdd
:
this
.
$route
.
meta
.
type
===
'add'
,
isCopy
:
this
.
$route
.
meta
.
type
===
'copy'
isCopy
:
this
.
$route
.
meta
.
type
===
'copy'
,
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
};
},
props
:
{
...
...
@@ -211,9 +212,9 @@ export default {
},
watch
:
{
templateArr
(
val
)
{
this
.
templateData
=
val
;
if
(
this
.
isAdd
)
{
const
data
=
val
[
0
];
if
(
this
.
isAdd
||
this
.
isCopy
)
{
this
.
templateData
=
val
.
filter
(
item
=>
item
.
statusFlag
==
1
);
const
data
=
this
.
templateData
[
0
];
this
.
baseForm
.
templateId
=
data
.
templateId
;
this
.
handleTemplateArr
(
data
.
gameTemplateMaterialList
);
this
.
$emit
(
'change'
,
this
.
baseForm
);
...
...
@@ -221,25 +222,43 @@ export default {
},
echoData
(
val
)
{
let
{
gameExt
}
=
val
;
let
initTemp
=
false
;
this
.
baseForm
=
Object
.
assign
(
this
.
baseForm
,
val
);
if
(
this
.
baseForm
.
adsFlag
)
{
this
.
adsImageUrl
=
{
imgUrl
:
gameExt
.
adsImageUrl
&&
gameExt
.
adsImageUrl
.
materialValue
,
code
:
gameExt
.
adsImageUrl
&&
gameExt
.
adsImageUrl
.
materialValue
};
}
const
currentTemp
=
this
.
templateData
.
filter
(
item
=>
item
.
templateId
==
this
.
baseForm
.
templateId
)[
0
];
let
currentTemp
=
this
.
templateArr
.
filter
(
item
=>
item
.
templateId
==
this
.
baseForm
.
templateId
)[
0
];
if
(
this
.
isEdit
)
{
this
.
templateData
=
this
.
templateArr
.
filter
(
item
=>
item
.
statusFlag
==
1
||
item
.
templateId
==
this
.
baseForm
.
templateId
);
}
if
(
this
.
isCopy
&&
currentTemp
.
statusFlag
==
0
)
{
currentTemp
=
this
.
templateArr
.
filter
(
item
=>
item
.
statusFlag
==
1
)[
0
];
this
.
baseForm
.
templateId
=
currentTemp
.
templateId
;
initTemp
=
true
;
this
.
$message
.
info
(
'原游戏模板已失效,已重置默认模板'
);
}
let
obj
=
{};
// let arr = ['backMusic
Url'];
let
arr
=
[
'noticeImageUrl'
,
'shareCard'
,
'shareReport'
,
'prizeStyleJson'
,
'backImage
Url'
];
let
keys
=
Object
.
keys
(
gameExt
);
console
.
log
(
keys
);
currentTemp
.
gameTemplateMaterialList
.
forEach
(
item
=>
{
if
(
item
.
materialKey
==
'backMusicUrl'
)
{
this
.
backMusicOptions
.
push
(
item
);
}
else
if
(
!
keys
.
includes
(
item
.
materialKey
))
{
obj
[
item
.
materialKey
]
=
item
;
}
// if (!arr.includes(item.materialKey) && !keys.includes(item.materialKey)) {
// obj[item.materialKey] = item;
// }
});
if
(
initTemp
)
{
let
currentTempObj
=
{};
currentTemp
.
gameTemplateMaterialList
.
forEach
(
item
=>
{
currentTempObj
[
item
.
materialKey
]
=
item
;
});
keys
.
forEach
(
key
=>
{
if
(
arr
.
includes
(
key
))
{
gameExt
[
key
]
=
currentTempObj
[
key
];
}
});
}
obj
=
Object
.
assign
(
obj
,
gameExt
);
// 详情的素材库与模板接口的默认有值的素材库取交集
this
.
handleTemplateArr
(
Object
.
values
(
obj
),
'echo'
);
this
.
selectLink
.
linkData
=
this
.
baseForm
.
mpUrlView
?
JSON
.
parse
(
this
.
baseForm
.
mpUrlView
)
:
{};
...
...
@@ -251,18 +270,19 @@ export default {
},
methods
:
{
handleDateChange
(
val
,
type
)
{
console
.
log
(
val
,
type
);
this
.
$emit
(
'change'
,
this
.
baseForm
);
if
(
type
==
'adsFlag'
)
{
this
.
$nextTick
(
_
=>
{
const
adsImg
=
document
.
getElementsByClassName
(
'adsImg'
);
adsImg
[
0
].
scrollIntoView
({
// 滚动到指定节点
// 值有start,center,end,nearest,当前显示在视图区域中间
block
:
'center'
,
// 值有auto、instant,smooth,缓动动画(当前是慢速的)
behavior
:
'smooth'
});
const
formContent
=
document
.
getElementById
(
'formContent'
);
formContent
.
scrollTop
=
formContent
.
scrollHeight
+
500
;
// adsImg[0].scrollIntoView({
// // 滚动到指定节点
// // 值有start,center,end,nearest,当前显示在视图区域中间
// block: 'center',
// // 值有auto、instant,smooth,缓动动画(当前是慢速的)
// behavior: 'smooth'
// });
});
}
else
if
(
type
==
'gameTime'
&&
this
.
baseForm
.
gameTime
&&
this
.
baseForm
.
gameTime
.
length
)
{
this
.
baseForm
.
gameTime
[
1
]
=
this
.
baseForm
.
gameTime
[
1
]
+
86399000
;
...
...
@@ -352,7 +372,6 @@ export default {
}
}
});
console
.
log
(
this
.
baseForm
);
},
handleListen
()
{
this
.
isPlay
=
!
this
.
isPlay
;
...
...
@@ -428,7 +447,6 @@ export default {
this
.
gameExt
.
forEach
(
item
=>
{
gameExt
[
item
.
materialKey
]
=
item
;
});
console
.
log
(
gameExt
);
Object
.
keys
(
data
).
forEach
(
key
=>
{
if
(
gameExt
[
key
])
{
gameExt
[
key
].
materialValue
=
data
[
key
];
...
...
@@ -555,4 +573,9 @@ img {
.footer
{
width
:
calc
(
100%
-
520px
)
!important
;
}
.radioGroup
{
.el-radio
+
.el-radio
{
margin-left
:
0
;
}
}
</
style
>
src/views/game/cmh/form.vue
View file @
4b3bb30c
...
...
@@ -18,11 +18,15 @@
{{
el
}}
</el-menu-item>
</el-menu>
<div
class=
"iphone"
>
<span
class=
"gameTitle"
>
{{
gameName
}}
</span>
<img
src=
"../../../assets/img/Navbar.png"
class=
"braImg"
alt=
""
/>
<gameTemplate
:ruleData=
"ruleData"
:templateId=
"templateId"
:basicData=
"previewData"
v-show=
"menuActive == 0"
/>
<img
:src=
"computedImg"
v-show=
"menuActive != 0"
style=
"min-height:724px;margin-top: 70px;"
/>
<div
style=
"margin: 0 20px 0 13px;"
>
<div
class=
"nav"
>
<span
class=
"gameTitle"
>
{{
gameName
}}
</span>
<img
src=
"../../../assets/img/Navbar.png"
class=
"braImg"
alt=
""
/>
</div>
<div
class=
"iphone"
>
<gameTemplate
:ruleData=
"ruleData"
:templateId=
"templateId"
:basicData=
"previewData"
v-show=
"menuActive == 0"
/>
<img
:src=
"computedImg"
v-show=
"menuActive != 0"
style=
"min-height:724px; "
/>
</div>
</div>
</div>
<div
class=
"rightForm"
v-show=
"!isInfo"
>
...
...
@@ -31,7 +35,7 @@
<dm-step
title=
"2.奖项配置"
></dm-step>
<dm-step
title=
"3.规则配置"
></dm-step>
</dm-steps>
<div
class=
"formContent"
>
<div
class=
"formContent"
id=
"formContent"
>
<baseConfig
ref=
"baseConfig"
:gameStatus=
"gameStatus"
:templateArr=
"templateData"
:echoData=
"baseForm"
v-show=
"active == 0"
@
change=
"handleBaseConfigChange"
@
nextStep=
"nextStep"
/>
<prizeConfig
ref=
"prizeConfig"
:gameStatus=
"gameStatus"
:invalidCard=
"invalidCard"
:prizeMax=
"prizeMax"
:echoData=
"prizeForm"
:prizeMin=
"prizeMin"
v-show=
"active == 1"
@
nextStep=
"nextStep"
@
prevStep=
"step => active--"
/>
<ruleConfig
ref=
"ruleConfig"
:gameStatus=
"gameStatus"
:templateId=
"templateId"
:gameTime=
"gameTime"
:shareImgData=
"shareImgData"
:echoData=
"ruleForm"
v-show=
"active == 2"
@
nextStep=
"nextStep"
@
prevStep=
"step => active--"
@
submit=
"submitForm"
:btnLoading=
"btnLoading"
@
change=
"handleRuleConfigChange"
/>
...
...
@@ -105,6 +109,9 @@ export default {
},
computed
:
{
computedImg
()
{
if
(
!
[
'1'
,
'2'
,
'3'
,
'5'
].
includes
(
this
.
templateId
))
{
return
''
;
}
const
bcImg
=
{
1
:
require
(
`@/assets/img/template
${
this
.
templateId
}
/mould_rule_page.png`
),
2
:
require
(
`@/assets/img/template
${
this
.
templateId
}
/mould_prize_page.png`
),
...
...
@@ -132,7 +139,6 @@ export default {
watch
:
{
templateId
(
val
)
{
const
data
=
this
.
templateData
.
filter
(
item
=>
item
.
templateId
==
val
)[
0
];
console
.
log
(
data
);
const
{
prizeMax
,
prizeMin
}
=
data
;
this
.
prizeMax
=
prizeMax
;
this
.
prizeMin
=
prizeMin
;
...
...
@@ -259,7 +265,7 @@ export default {
this
.
templateData
=
res
.
result
;
if
(
this
.
isAdd
)
{
this
.
$route
.
meta
.
refresh
=
false
;
const
{
templateId
}
=
res
.
result
[
0
];
const
{
templateId
}
=
this
.
templateData
.
filter
(
item
=>
item
.
statusFlag
==
1
)
[
0
];
this
.
templateId
=
templateId
;
this
.
loading
=
false
;
}
else
{
...
...
@@ -487,13 +493,19 @@ export default {
}
}
}
.nav
{
height
:
83px
;
img
{
width
:
375px
;
border-radius
:
8px
8px
0px
0px
;
}
}
.iphone
{
width
:
375px
;
border-radius
:
8px
8px
0px
0px
;
margin
:
0
20px
0
13px
;
position
:
relative
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
height
:
100%
;
img
{
width
:
375px
;
}
...
...
@@ -504,7 +516,7 @@ export default {
color
:
#000000
;
font-weight
:
600
;
z-index
:
101
;
top
:
56
px
;
top
:
82
px
;
width
:
100%
;
height
:
20px
;
display
:
flex
;
...
...
src/views/game/cmh/gameTemplate.vue
View file @
4b3bb30c
This diff is collapsed.
Click to expand it.
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