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
6d2312b6
Commit
6d2312b6
authored
May 26, 2022
by
crushh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 察看
parent
21f34e5b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
100 additions
and
50 deletions
+100
-50
reset.scss
src/assets/style/base/reset.scss
+20
-0
game.js
src/router/modules/game.js
+1
-1
base-config.vue
src/views/game/cmh/base-config.vue
+3
-2
form.vue
src/views/game/cmh/form.vue
+59
-19
gameTemplate.vue
src/views/game/cmh/gameTemplate.vue
+1
-1
info.vue
src/views/game/cmh/info.vue
+0
-0
prize-config.vue
src/views/game/cmh/prize-config.vue
+6
-2
rule-config.vue
src/views/game/cmh/rule-config.vue
+10
-25
No files found.
src/assets/style/base/reset.scss
View file @
6d2312b6
...
...
@@ -678,4 +678,23 @@ img::after {
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.subTitle
{
width
:
100%
;
height
:
40px
;
display
:
flex
;
box-sizing
:
border-box
;
align-items
:
center
;
margin-bottom
:
5px
;
.line
{
width
:
2px
;
height
:
14px
;
background
:
#2f54eb
;
margin-right
:
8px
;
}
.text
{
font-size
:
14px
;
color
:
#303133
;
width
:
100%
;
}
}
\ No newline at end of file
src/router/modules/game.js
View file @
6d2312b6
...
...
@@ -278,7 +278,7 @@ export const cmhDetail = [
{
path
:
'/game/cmh/info/:id'
,
name
:
'查看拆盲盒'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/
info
.vue'
),
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/
form
.vue'
),
meta
:
{
type
:
'info'
}
...
...
src/views/game/cmh/base-config.vue
View file @
6d2312b6
...
...
@@ -168,7 +168,6 @@ export default {
show
:
false
,
linkData
:
{}
},
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
,
isAdd
:
this
.
$route
.
meta
.
type
===
'add'
,
isCopy
:
this
.
$route
.
meta
.
type
===
'copy'
};
...
...
@@ -206,7 +205,6 @@ export default {
templateArr
(
val
)
{
this
.
templateData
=
val
;
const
data
=
val
[
0
];
if
(
this
.
isAdd
)
{
this
.
baseForm
.
templateId
=
data
.
templateId
;
this
.
handleTemplateArr
(
data
.
gameTemplateMaterialList
);
...
...
@@ -226,6 +224,9 @@ export default {
}
});
this
.
selectLink
.
linkData
=
this
.
baseForm
.
mpUrlView
?
JSON
.
parse
(
this
.
baseForm
.
mpUrlView
)
:
{};
if
(
this
.
isCopy
)
{
this
.
baseForm
.
gameTime
=
[];
}
this
.
$emit
(
'change'
,
this
.
baseForm
);
}
},
...
...
src/views/game/cmh/form.vue
View file @
6d2312b6
...
...
@@ -26,7 +26,7 @@
<img
:src=
"computedImg"
/>
</div>
</div>
<div
class=
"rightForm"
>
<div
class=
"rightForm"
v-show=
"!isInfo"
>
<dm-steps
:active=
"active"
simple
>
<dm-step
title=
"1.基础配置"
></dm-step>
<dm-step
title=
"2.奖项配置"
></dm-step>
...
...
@@ -38,6 +38,7 @@
<ruleConfig
:gameStatus=
"gameStatus"
:gameTime=
"gameTime"
:shareCard=
"shareCard"
:shareReport=
"shareReport"
:echoData=
"ruleForm"
v-show=
"active == 2"
@
nextStep=
"data => submit(3, data)"
@
prevStep=
"step => (active = step)"
:btnLoading=
"btnLoading"
/>
</div>
</div>
<info
:data=
"echoData"
v-show=
"isInfo"
/>
</div>
<links
:show
.
sync=
"linkShow"
:obj=
"linksObj"
gameTypeName=
"幸运盲盒"
:isNew=
"true"
:showFooter=
"true"
>
<el-button
@
click=
"editRenew"
>
重新编辑
</el-button>
...
...
@@ -54,7 +55,7 @@ import prizeConfig from './prize-config.vue';
import
ruleConfig
from
'./rule-config.vue'
;
import
{
getGameTemplateByType
,
initActivity
,
getGameDetail
,
cardView
}
from
'@/service/api/gameApi.js'
;
import
gameTemplate
from
'./gameTemplate'
;
import
info
from
'./info.vue'
;
import
links
from
'../common/links'
;
export
default
{
data
()
{
...
...
@@ -78,13 +79,15 @@ export default {
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
,
isAdd
:
this
.
$route
.
meta
.
type
===
'add'
,
isCopy
:
this
.
$route
.
meta
.
type
===
'copy'
,
isInfo
:
this
.
$route
.
meta
.
type
===
'info'
,
baseForm
:
{},
prizeForm
:
{},
ruleForm
:
{},
gameId
:
''
,
gameStatus
:
0
,
invalidCard
:
{},
gameTime
:
[]
gameTime
:
[],
echoData
:
{}
};
},
computed
:
{
...
...
@@ -106,12 +109,12 @@ export default {
gameTemplate
,
prizeConfig
,
ruleConfig
,
links
links
,
info
},
mounted
()
{
this
.
getGameTemplateByType
();
},
watch
:
{
templateId
(
val
)
{
const
data
=
this
.
templateData
.
filter
(
item
=>
item
.
templateId
==
val
)[
0
];
...
...
@@ -125,7 +128,8 @@ export default {
getGameDetail
(
id
)
{
getGameDetail
({
gameId
:
id
}).
then
(
async
res
=>
{
const
{
result
}
=
res
;
const
{
this
.
echoData
=
JSON
.
parse
(
JSON
.
stringify
(
result
));
let
{
gameRuleInfo
,
// 游戏规则信息
gameRuleConditionList
,
// 游戏规则-参与门槛
gamePrizeList
,
//游戏奖品信息
...
...
@@ -168,9 +172,21 @@ export default {
const
{
result
}
=
await
cardView
({
ids
:
cardIdArr
.
join
(
','
)
});
this
.
invalidCard
=
result
;
// 1删除 2失效
}
this
.
ruleForm
=
{
ruleId
,
filterJson
,
gameRuleConditionList
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
,
memberWeightView
,
creatorId
,
filterJsonView
};
this
.
prizeForm
=
{
winChance
,
prizeNoticeStock
,
gamePrizeList
,
prizeNoticeFlag
};
if
(
this
.
isCopy
)
{
let
invalidCard
=
[];
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
&&
this
.
invalidCard
[
item
.
prizeRelationId
].
invalid
!=
0
)
{
invalidCard
.
push
(
item
.
prizeRelationId
);
}
});
if
(
invalidCard
.
length
)
{
gamePrizeList
=
gamePrizeList
.
filter
(
item
=>
item
.
prizeType
!=
2
||
!
invalidCard
.
includes
(
item
.
prizeRelationId
));
this
.
$message
.
info
(
'已过滤被删除奖项'
);
}
}
this
.
baseForm
=
{
adsFlag
,
backMusicFlag
,
bulletFlag
,
templateId
,
gameTime
:
[
startDate
,
endDate
],
gameName
,
gameRule
,
gameExt
};
this
.
prizeForm
=
{
winChance
,
prizeNoticeStock
,
gamePrizeList
,
prizeNoticeFlag
};
this
.
ruleForm
=
{
ruleId
,
filterJson
,
gameRuleConditionList
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
,
memberWeightView
,
creatorId
,
filterJsonView
};
});
},
handleBaseConfigChange
(
data
)
{
...
...
@@ -224,17 +240,8 @@ export default {
console
.
log
(
data
);
this
.
submitData
=
{
...
this
.
submitData
,
...
data
};
},
async
submit
(
step
,
data
)
{
this
.
submitData
=
{
...
this
.
submitData
,
...
data
};
console
.
log
(
this
.
submitData
);
this
.
submitData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
submitData
));
const
{
ruleId
,
winChance
,
filterJson
,
filterJsonView
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
gameRuleConditionList
,
gameName
,
gamePrizeList
,
prizeNoticeStock
,
prizeNoticeFlag
,
adsFlag
,
bulletFlag
,
backMusicFlag
,
templateId
,
gameRule
,
gameTime
,
gameExt
}
=
this
.
submitData
;
const
gameRuleInfo
=
{
ruleId
,
winChance
,
filterJson
,
filterJsonView
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
:
gameName
};
gameRuleConditionList
.
forEach
(
item
=>
{
delete
item
.
index
;
item
.
conditionJson
=
JSON
.
stringify
(
item
.
conditionJson
);
});
async
handleGamePrizeList
()
{
const
{
gamePrizeList
}
=
this
.
submitData
;
let
cardIdArr
=
[];
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
)
{
...
...
@@ -260,6 +267,38 @@ export default {
}
});
}
this
.
submitData
=
Object
.
assign
({
gamePrizeList
},
this
.
submitData
);
},
submit
(
step
,
data
)
{
this
.
submitData
=
{
...
this
.
submitData
,
...
data
};
console
.
log
(
this
.
submitData
);
this
.
submitData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
submitData
));
this
.
handleGamePrizeList
();
const
{
ruleId
,
winChance
,
filterJson
,
filterJsonView
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
gameRuleConditionList
,
gameName
,
gamePrizeList
,
prizeNoticeStock
,
prizeNoticeFlag
,
adsFlag
,
bulletFlag
,
backMusicFlag
,
templateId
,
gameRule
,
gameTime
,
gameExt
}
=
this
.
submitData
;
const
gameRuleInfo
=
{
ruleId
,
winChance
,
filterJson
,
filterJsonView
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
:
gameName
};
gameRuleConditionList
.
forEach
(
item
=>
{
item
.
conditionJson
=
JSON
.
stringify
(
item
.
conditionJson
);
});
if
(
this
.
isCopy
)
{
Object
.
values
(
gameExt
).
forEach
(
item
=>
{
delete
item
.
gameExtId
;
delete
item
.
gameId
;
});
gamePrizeList
.
forEach
(
item
=>
{
delete
item
.
prizeId
;
delete
item
.
gameId
;
});
gameRuleConditionList
.
forEach
(
item
=>
{
if
(
this
.
isCopy
)
{
delete
item
.
conditionId
;
delete
item
.
gameId
;
}
});
delete
gameRuleInfo
.
ruleId
;
delete
gameRuleInfo
.
gameId
;
}
this
.
$confirm
(
'确认发布游戏?'
,
{
type
:
'warning'
}).
then
(()
=>
{
...
...
@@ -304,6 +343,7 @@ export default {
},
editRenew
()
{
window
.
location
.
href
=
window
.
location
.
origin
+
`/marketing/#/game/cmh/edit/
${
this
.
gameId
}
`
;
window
.
location
.
reload
();
// this.$router.push(`/game/cmh/edit/${this.gameId}`);
}
}
...
...
src/views/game/cmh/gameTemplate.vue
View file @
6d2312b6
...
...
@@ -44,7 +44,7 @@
</div>
</div>
<img
class=
"ad-image"
:src=
"adImg"
mode=
"widthFix"
v-i
d
=
"adImg"
/>
<img
class=
"ad-image"
:src=
"adImg"
mode=
"widthFix"
v-i
f
=
"adImg"
/>
<!--
<div
class=
"share-box"
@
click=
"clickShareBtn"
>
<div
class=
"icon"
>
<div
class=
"iconfont icon-yaoqing"
></div>
...
...
src/views/game/cmh/info.vue
View file @
6d2312b6
This diff is collapsed.
Click to expand it.
src/views/game/cmh/prize-config.vue
View file @
6d2312b6
...
...
@@ -129,7 +129,7 @@
</el-table>
<el-button
@
click=
"addPrize"
class=
"mb10"
size=
"small"
style=
"border-style: dashed;"
v-show=
"this.prizeForm.gamePrizeList.length < prizeMax"
>
<i
class=
"iconfont icon-Plus"
/>
添加奖项({{ this.prizeForm.gamePrizeList.length }}/{{ prizeMax }})
</el-button>
<el-form-item
label=
"库存提醒"
prop=
"winChance"
>
<el-form-item
label=
"库存提醒"
>
<el-switch
v-model=
"prizeForm.prizeNoticeFlag"
:active-value=
"1"
:inactive-value=
"0"
/>
</el-form-item>
<el-form-item
label=
"库存低于"
v-show=
"prizeForm.prizeNoticeFlag == 1"
>
...
...
@@ -251,7 +251,11 @@ export default {
if
(
item
.
prizeImageUrl
)
{
item
.
prizeImageUrl
=
{
imgUrl
:
item
.
prizeImageUrl
,
code
:
item
.
prizeImageUrl
};
}
item
.
prizeStockOriginal
=
item
.
prizeStock
;
if
(
this
.
isEdit
)
{
item
.
prizeStockOriginal
=
item
.
prizeStock
;
}
else
{
item
.
prizeStock
=
''
;
}
});
this
.
calculateRate
();
this
.
prizeForm
.
gamePrizeList
=
this
.
prizeForm
.
gamePrizeList
.
splice
(
0
);
...
...
src/views/game/cmh/rule-config.vue
View file @
6d2312b6
...
...
@@ -224,6 +224,7 @@ export default {
subscribeMsg
:
{
validator
:
subscribeMsgVal
}
},
isAdd
:
this
.
$route
.
meta
.
type
===
'add'
,
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
,
gameDays
:
0
};
},
...
...
@@ -267,13 +268,15 @@ export default {
}
});
}
if
(
memberType
==
1
)
{
this
.
selectedGroupIds
=
filterJson
;
}
else
{
this
.
ruleForm
.
hasSearchData
=
filterJson
;
if
(
this
.
isEdit
)
{
if
(
memberType
==
1
)
{
this
.
selectedGroupIds
=
filterJson
;
}
else
{
this
.
ruleForm
.
hasSearchData
=
filterJson
;
}
this
.
ruleForm
.
memberType
=
memberType
;
}
this
.
ruleForm
=
Object
.
assign
(
this
.
ruleForm
,
{
ruleId
,
memberDesc
,
memberType
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
,
memberWeightView
,
creatorId
,
filterJsonView
});
this
.
ruleForm
=
Object
.
assign
(
this
.
ruleForm
,
{
ruleId
,
memberDesc
,
playConditionFlag
,
playTimes
,
shareFlag
,
shareImageUrl
,
shareRuleDesc
,
memberWeightView
,
creatorId
,
filterJsonView
});
console
.
log
(
this
.
ruleForm
);
},
gameTime
(
val
)
{
...
...
@@ -430,25 +433,7 @@ export default {
padding
:
16px
20px
;
box-sizing
:
border-box
;
}
.subTitle
{
width
:
100%
;
height
:
40px
;
display
:
flex
;
box-sizing
:
border-box
;
align-items
:
center
;
margin-bottom
:
5px
;
.line
{
width
:
2px
;
height
:
14px
;
background
:
#2f54eb
;
margin-right
:
8px
;
}
.text
{
font-size
:
14px
;
color
:
#303133
;
width
:
100%
;
}
}
.downloadBtn
{
display
:
flex
;
margin-top
:
8px
;
...
...
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