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
21052586
Commit
21052586
authored
May 27, 2022
by
crushh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 修复
parent
20c1e969
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
135 additions
and
69 deletions
+135
-69
index.vue
src/components/layout/index.vue
+0
-1
game.js
src/router/modules/game.js
+6
-20
base-config.vue
src/views/game/cmh/base-config.vue
+6
-2
form.vue
src/views/game/cmh/form.vue
+18
-18
index.vue
src/views/game/cmh/index.vue
+34
-0
info.vue
src/views/game/cmh/info.vue
+25
-3
prize-config.vue
src/views/game/cmh/prize-config.vue
+41
-24
links.vue
src/views/game/common/links.vue
+5
-1
No files found.
src/components/layout/index.vue
View file @
21052586
...
...
@@ -16,7 +16,6 @@ export default {
asideMenu
,
description
},
data
()
{
return
{
collapseFlag
:
false
,
...
...
src/router/modules/game.js
View file @
21052586
...
...
@@ -225,33 +225,23 @@ export default {
name
:
'拆盲盒列表'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/index.vue'
),
meta
:
{
path
:
'/game/cmh'
,
keepAlive
:
true
}
},
{
path
:
'cmh/statistics/:id'
,
name
:
'拆盲盒数据统计'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'statistics'
}
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
)
},
{
path
:
'cmh/statistics/activityDetail/:id'
,
name
:
'拆盲盒数据统计-活动明细'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'statistics'
}
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
)
},
{
path
:
'cmh/statistics/prizeDetail/:id'
,
name
:
'拆盲盒数据统计-奖品明细'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'statistics'
}
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
)
}
]
};
...
...
@@ -261,9 +251,7 @@ export const cmhDetail = [
name
:
'新建拆盲盒'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'add'
,
path
:
'/game/cmh'
,
hiddenLayout
:
true
type
:
'add'
}
},
{
...
...
@@ -271,8 +259,7 @@ export const cmhDetail = [
name
:
'编辑拆盲盒'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'edit'
,
hiddenLayout
:
true
type
:
'edit'
}
},
{
...
...
@@ -288,8 +275,7 @@ export const cmhDetail = [
name
:
'复制拆盲盒'
,
component
:
()
=>
import
(
/* webpackChunkName: "game" */
'../../views/game/cmh/form.vue'
),
meta
:
{
type
:
'copy'
,
hiddenLayout
:
true
type
:
'copy'
}
}
];
src/views/game/cmh/base-config.vue
View file @
21052586
...
...
@@ -94,7 +94,7 @@
</div>
<el-button
type=
"text"
@
click=
"selectLink.show = true"
>
选择链接
</el-button>
</el-form-item>
<linktools
:remove=
"[5, 35]"
:linkVisible
.
sync=
"selectLink.show"
:linkData=
"selectLink.linkData"
:can-save=
"true"
:showType=
"0"
@
linkSelect=
"onSaveLink"
/>
<linktools
:remove=
"[5, 35]"
:linkVisible
.
sync=
"selectLink.show"
:linkData=
"selectLink.linkData"
:can-save=
"true"
@
linkSelect=
"onSaveLink"
/>
</div>
</el-form-item>
</div>
...
...
@@ -296,7 +296,9 @@ export default {
this
.
prizeStyleJson
=
JSON
.
parse
(
item
.
materialValue
);
this
.
baseForm
[
'prizeStyleJson'
]
=
JSON
.
parse
(
item
.
materialValue
);
}
else
{
this
.
baseForm
[
item
.
materialKey
]
=
item
.
materialValue
;
if
(
!
this
.
baseForm
[
item
.
materialKey
])
{
this
.
baseForm
[
item
.
materialKey
]
=
item
.
materialValue
;
}
}
if
(
item
.
materialKey
==
'backMusicUrl'
)
{
if
(
echo
)
{
...
...
@@ -341,6 +343,7 @@ export default {
},
handleAdsChange
(
obj
)
{
this
.
baseForm
.
adsImageUrl
=
obj
.
imgUrl
;
this
.
$refs
.
baseForm
.
validateField
(
'adsImageUrl'
);
this
.
$emit
(
'change'
,
this
.
baseForm
);
},
replace
(
type
,
index
)
{
...
...
@@ -356,6 +359,7 @@ export default {
this
.
selectLink
.
linkData
=
linkData
;
this
.
baseForm
.
mpUrlView
=
JSON
.
stringify
(
linkData
);
this
.
baseForm
.
adsLinkUrl
=
linkData
.
url
;
this
.
$refs
.
baseForm
.
validateField
(
'link'
);
},
handleNameChange
(
val
)
{
this
.
$emit
(
'change'
,
this
.
baseForm
);
...
...
src/views/game/cmh/form.vue
View file @
21052586
...
...
@@ -39,9 +39,9 @@
<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"
:invalidCard=
"invalidCard"
v-
show
=
"isInfo"
/>
<info
:data=
"echoData"
:invalidCard=
"invalidCard"
v-
if
=
"isInfo"
/>
</div>
<links
:show
.
sync=
"linkShow"
:obj=
"linksObj"
gameTypeName=
"幸运盲盒"
:isNew=
"true"
:showFooter=
"true"
>
<links
:show
.
sync=
"linkShow"
:obj=
"linksObj"
gameTypeName=
"幸运盲盒"
:isNew=
"true"
:showFooter=
"true"
:showClose=
"false"
>
<el-button
@
click=
"editRenew"
>
重新编辑
</el-button>
<el-button
type=
"primary"
@
click=
"$router.push('/game/cmh')"
>
进入游戏列表
</el-button>
</links>
...
...
@@ -166,7 +166,7 @@ export default {
cardIdArr
.
push
(
item
.
prizeRelationId
);
}
if
(
this
.
gameStatus
==
1
)
{
item
.
isOld
=
1
;
item
.
isOld
=
1
;
// 进行中的奖品
}
});
if
(
cardIdArr
.
length
)
{
...
...
@@ -241,8 +241,14 @@ export default {
console
.
log
(
data
);
this
.
submitData
=
{
...
this
.
submitData
,
...
data
};
},
async
handleGamePrizeList
()
{
const
{
gamePrizeList
}
=
this
.
submitData
;
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
};
let
cardIdArr
=
[];
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
)
{
...
...
@@ -261,23 +267,17 @@ export default {
this
.
$message
.
error
(
'存在异常状态的卡券,请返回上一步修改卡券后再提交'
);
return
;
}
let
invalidCardName
=
[];
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
&&
item
.
prizeStock
>
result
[
item
.
prizeRelationId
].
stock
)
{
this
.
$message
.
error
(
`
${
item
.
prizeName
}
奖品数量高于关联库存,请修改奖品数量`
);
return
;
if
(
item
.
prizeType
==
2
&&
!
item
.
isOld
&&
item
.
prizeStock
>
result
[
item
.
prizeRelationId
].
stock
)
{
invalidCardName
.
push
(
item
.
prizeName
);
}
});
if
(
invalidCardName
.
length
)
{
this
.
$message
.
error
(
`
${
invalidCardName
.
join
(
','
)}
奖品数量高于关联库存,请修改奖品数量`
);
return
;
}
}
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
);
});
...
...
src/views/game/cmh/index.vue
View file @
21052586
...
...
@@ -211,6 +211,40 @@ export default {
created
()
{
this
.
getTableList
();
},
activated
()
{
console
.
log
(
'activated'
);
console
.
log
(
this
.
$route
.
meta
.
refresh
);
if
(
this
.
$route
.
meta
.
refresh
)
{
this
.
dateTime
=
[];
this
.
listParams
=
{
gameName
:
''
,
status
:
''
,
startTime
:
''
,
endTime
:
''
,
pageNum
:
1
,
pageSize
:
20
};
}
console
.
log
(
JSON
.
stringify
(
this
.
listParams
));
this
.
getTableList
();
},
beforeRouteEnter
(
to
,
from
,
next
)
{
// const {
// meta: { type, path, refresh }
// } = from;
// console.log(type, path, refresh);
// if (path !== '/cmh') {
// to.meta.refresh = true;
// } else {
// if (type === 'add' && refresh) {
// to.meta.refresh = true;
// } else {
// to.meta.refresh = false;
// }
// }
console
.
log
(
to
.
meta
.
refresh
);
next
();
},
methods
:
{
getLink
(
row
)
{
const
{
startDate
,
gameId
,
gameName
}
=
row
;
...
...
src/views/game/cmh/info.vue
View file @
21052586
...
...
@@ -185,7 +185,8 @@ export default {
return
{
toggleTag
:
false
,
form
:
{
gameRuleInfo
:
{
}
gameRuleInfo
:
{
}
,
memberWeightView
:
{
}
}
,
hasSearchData
:
''
,
isPlay
:
false
,
...
...
@@ -207,8 +208,29 @@ export default {
}
,
watch
:
{
data
(
val
)
{
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
val
));
if
(
this
.
form
.
playConditionFlag
==
1
)
{
// const
{
// gameRuleInfo, // 游戏规则信息
// gameRuleConditionList, // 游戏规则-参与门槛
// gamePrizeList, //游戏奖品信息
// gameExt,
// prizeNoticeStock,
// prizeNoticeFlag,
// adsFlag,
// bulletFlag,
// backMusicFlag,
// templateId,
// gameRule,
// startDate,
// endDate,
// gameName,
// memberWeightView,
// creatorId,
// gameId,
// status
//
}
=
val
;
this
.
form
=
{
...
val
}
;
console
.
log
(
this
.
form
);
if
(
this
.
form
.
gameRuleInfo
.
playConditionFlag
==
1
)
{
this
.
form
.
gameRuleConditionList
.
forEach
(
item
=>
{
item
.
conditionJson
=
JSON
.
parse
(
item
.
conditionJson
);
}
);
...
...
src/views/game/cmh/prize-config.vue
View file @
21052586
...
...
@@ -196,7 +196,6 @@ export default {
prizeName
:
'谢谢参与'
,
prizeImageUrl
:
''
,
prizeNumber
:
1
,
prizeStock
:
-
1
,
exchangeType
:
0
}
]
...
...
@@ -216,7 +215,8 @@ export default {
}
],
index
:
0
,
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
isEdit
:
this
.
$route
.
meta
.
type
===
'edit'
,
boolVal
:
true
};
},
props
:
{
...
...
@@ -262,6 +262,7 @@ export default {
console
.
log
(
this
.
prizeForm
);
},
invalidCard
(
val
)
{
console
.
log
(
'invalidCard====>'
);
this
.
prizeForm
.
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
)
{
item
.
status
=
val
[
item
.
prizeRelationId
].
invalid
;
...
...
@@ -355,6 +356,10 @@ export default {
},
handleTypeChange
(
val
,
index
)
{
console
.
log
(
val
,
index
);
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeName
?
delete
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeName
:
''
;
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeNumber
?
delete
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeNumber
:
''
;
this
.
prizeForm
.
gamePrizeList
[
index
].
optNum
?
delete
this
.
prizeForm
.
gamePrizeList
[
index
].
optNum
:
''
;
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeImageUrl
?
delete
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeImageUrl
:
''
;
if
(
val
==
0
)
{
this
.
calculateRate
();
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeImageUrl
=
''
;
...
...
@@ -364,6 +369,7 @@ export default {
}
else
if
(
val
==
1
)
{
this
.
prizeForm
.
gamePrizeList
[
index
].
prizeImageUrl
=
{
imgUrl
:
this
.
imgeType
[
3
],
code
:
this
.
imgeType
[
3
]
};
}
this
.
$refs
.
prizeForm
.
clearValidate
(
`gamePrizeList.
${
index
}
.prizeStock`
);
this
.
prizeForm
.
gamePrizeList
=
this
.
prizeForm
.
gamePrizeList
.
splice
(
0
);
},
handlePrizeNumChange
(
val
,
index
)
{
...
...
@@ -396,6 +402,13 @@ export default {
submit
()
{
let
invalid
=
false
;
let
arr
=
[];
this
.
$refs
.
prizeForm
.
validate
(
val
=>
{
this
.
boolVal
=
val
;
if
(
!
val
)
{
this
.
scrollToError
(
this
);
}
});
if
(
!
this
.
boolVal
)
return
;
this
.
prizeForm
.
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeType
==
2
&&
item
.
status
!=
0
&&
!
item
.
isOld
)
{
invalid
=
true
;
...
...
@@ -411,32 +424,36 @@ export default {
return
;
}
if
(
invalid
)
return
;
if
(
this
.
prizeForm
.
gamePrizeList
.
length
<
this
.
prizeMin
)
{
this
.
$message
.
error
(
`请配置至少
${
this
.
prizeMin
}
个奖项`
);
return
;
}
if
(
this
.
prizeForm
.
gamePrizeList
.
length
>
this
.
prizeMax
)
{
this
.
$message
.
error
(
`请配置最多
${
this
.
prizeMax
}
个奖项`
);
return
;
}
this
.
$refs
.
prizeForm
.
validate
((
val
,
obj
)
=>
{
if
(
val
)
{
let
data
=
{
...
this
.
prizeForm
};
data
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
data
.
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeImageUrl
)
{
item
.
prizeImageUrl
=
item
.
prizeImageUrl
.
imgUrl
||
''
;
}
if
(
item
.
prizeType
!=
0
)
{
if
(
this
.
isEdit
&&
item
.
isOld
)
{
let
num
=
item
.
prizeStock
-
item
.
prizeStockOriginal
;
item
.
optNum
=
num
;
}
else
{
item
.
optNum
=
item
.
prizeStock
;
}
}
else
{
item
.
optNum
=
-
1
;
}
});
this
.
$emit
(
'nextStep'
,
data
);
let
data
=
{
...
this
.
prizeForm
};
data
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
data
.
gamePrizeList
.
forEach
(
item
=>
{
if
(
item
.
prizeImageUrl
)
{
item
.
prizeImageUrl
=
item
.
prizeImageUrl
.
imgUrl
||
''
;
}
if
(
item
.
prizeType
==
0
)
{
item
.
prizeStock
=
-
1
;
}
if
(
item
.
prizeType
!=
0
)
{
if
(
this
.
isEdit
&&
item
.
isOld
)
{
let
num
=
item
.
prizeStock
-
item
.
prizeStockOriginal
;
item
.
optNum
=
num
;
}
else
{
item
.
optNum
=
item
.
prizeStock
;
}
}
else
{
this
.
scrollToError
(
this
)
;
item
.
optNum
=
-
1
;
}
console
.
log
(
obj
);
});
this
.
$emit
(
'nextStep'
,
data
);
}
}
};
...
...
src/views/game/common/links.vue
View file @
21052586
<
template
>
<el-dialog
title=
"游戏预览"
:visible
.
sync=
"show"
width=
"600px"
:before-close=
"close"
>
<el-dialog
title=
"游戏预览"
:visible
.
sync=
"show"
width=
"600px"
:before-close=
"close"
:show-close=
"showClose"
>
<div
class=
"link-tip"
>
<i
class=
"el-icon-info"
></i>
非会员进入游戏页面将提示进行认证注册成为会员,认证成功后自动返回游戏页面
...
...
@@ -61,6 +61,10 @@ export default {
isNew
:
{
type
:
Boolean
,
default
:
false
},
showClose
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
...
...
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