Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
8e7495e7
Commit
8e7495e7
authored
Jul 14, 2021
by
管新明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'b-template-component' into b_template_component_bugfixed_20210714
parents
61694672
9ef2bccb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
8 deletions
+42
-8
prize-dialog.axml
client/components/dialog/prize-dialog/prize-dialog.axml
+12
-2
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+15
-0
package.json
server/duibats/package.json
+1
-1
save.controller.ts
server/duibats/src/controller/save.controller.ts
+14
-5
No files found.
client/components/dialog/prize-dialog/prize-dialog.axml
View file @
8e7495e7
...
@@ -28,7 +28,17 @@
...
@@ -28,7 +28,17 @@
<!-- <option a:if="{{typeChecked.includes(5)}}" value="{{5}}">降级奖品</option> -->
<!-- <option a:if="{{typeChecked.includes(5)}}" value="{{5}}">降级奖品</option> -->
</select>
</select>
</form-item>
</form-item>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type)}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="选择奖品" required>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type)}}" style="width:100%" size="large" class="probability-prize-content-formItem" label="权益类型" required>
<radio-group disabled="{{isEdit}}" value="{{prizeInitData.benefitType}}" onChange="onBenefitTypeTypeChange">
<radio value="{{1}}">普通权益</radio>
<radio value="{{2}}">会员权益</radio>
</radio-group>
</form-item>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type) && prizeInitData.benefitType == MEMBER_EQUITY}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="权益隐藏id" required>
<input class="probability-prize-content-input" data-name="ename" onChange="onChangePrizeValue" value="{{prizeInitData.ename}}" hasLimitHint="true" name="会员权益id" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.ename : prizeInitData.ename}}" placeholder="请输入权益隐藏id"/>
</form-item>
<form-item a:if="{{[EQUITY_TYPE].includes(prizeInitData.type) && prizeInitData.benefitType == SIMPLE_EQUITY}}" validateState="{{choosePrizeTips.status}}" style="width:100%" size="large" help="{{choosePrizeTips.content}}" class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize" label="选择奖品" required>
<view class="probability-prize-content-formitem-choosePrize-wrap">
<view class="probability-prize-content-formitem-choosePrize-wrap">
<input a:if="{{prizeInitData.ename}}" class="probability-prize-content-input" style="margin-right:10px" onChange="changeInput" maxLength="10" value="{{prizeInitData.name}}" hasLimitHint="true" name="活动名称" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.name : prizeInitData.name}}" placeholder="请选择奖品"/>
<input a:if="{{prizeInitData.ename}}" class="probability-prize-content-input" style="margin-right:10px" onChange="changeInput" maxLength="10" value="{{prizeInitData.name}}" hasLimitHint="true" name="活动名称" defaultValue="{{prizeDialogEdit ? prizeDialogData.record.name : prizeInitData.name}}" placeholder="请选择奖品"/>
<view a:if="{{!isEdit}}" class="probability-prize-content-formitem-goequity" onTap="navigateToPlugin" type="primary">{{prizeInitData.ename ? '重新选择' : '选择奖品'}}</view>
<view a:if="{{!isEdit}}" class="probability-prize-content-formitem-goequity" onTap="navigateToPlugin" type="primary">{{prizeInitData.ename ? '重新选择' : '选择奖品'}}</view>
...
@@ -36,7 +46,7 @@
...
@@ -36,7 +46,7 @@
</form-item>
</form-item>
<form-item
<form-item
style="width:100%"
style="width:100%"
a:if="{{[OBJECT_TYPE, CREDITS_TYPE].includes(prizeInitData.type)}}"
a:if="{{[OBJECT_TYPE, CREDITS_TYPE].includes(prizeInitData.type)
|| prizeInitData.benefitType==MEMBER_EQUITY
}}"
size="large"
size="large"
class="probability-prize-content-formItem"
class="probability-prize-content-formItem"
label="奖品名称"
label="奖品名称"
...
...
client/components/dialog/prize-dialog/prize-dialog.js
View file @
8e7495e7
...
@@ -29,6 +29,7 @@ const INIT_DATA = {
...
@@ -29,6 +29,7 @@ const INIT_DATA = {
rank
:
""
,
rank
:
""
,
amount
:
""
,
amount
:
""
,
itemId
:
""
,
itemId
:
""
,
benefitType
:
1
,
};
};
Component
({
Component
({
...
@@ -40,6 +41,8 @@ Component({
...
@@ -40,6 +41,8 @@ Component({
CREDITS_TYPE
,
CREDITS_TYPE
,
OBJECT_TYPE
,
OBJECT_TYPE
,
LOWER_TYPE
,
LOWER_TYPE
,
SIMPLE_EQUITY
:
1
,
MEMBER_EQUITY
:
2
,
showDialogMask
:
true
,
showDialogMask
:
true
,
canSavePrize
:
true
,
canSavePrize
:
true
,
dialogTop
:
""
,
dialogTop
:
""
,
...
@@ -98,6 +101,7 @@ Component({
...
@@ -98,6 +101,7 @@ Component({
switchStock
:
STOCK_NO_LIMIT
,
switchStock
:
STOCK_NO_LIMIT
,
isBackUp
:
false
,
isBackUp
:
false
,
useStock
:
0
,
useStock
:
0
,
benefitType
:
1
,
rank
:
""
,
rank
:
""
,
amount
:
""
,
amount
:
""
,
itemId
:
""
,
itemId
:
""
,
...
@@ -247,6 +251,15 @@ Component({
...
@@ -247,6 +251,15 @@ Component({
},
},
});
});
},
},
onBenefitTypeTypeChange
(
e
)
{
let
value
=
e
.
detail
.
value
;
this
.
setData
({
prizeInitData
:
{
...
this
.
data
.
prizeInitData
,
benefitType
:
value
},
});
},
navigateToPlugin
()
{
navigateToPlugin
()
{
clearTimeout
(
this
.
$page
.
data
.
backPageTimeOut
);
clearTimeout
(
this
.
$page
.
data
.
backPageTimeOut
);
my
.
navigateTo
({
my
.
navigateTo
({
...
@@ -388,6 +401,7 @@ Component({
...
@@ -388,6 +401,7 @@ Component({
switchStock
,
switchStock
,
isBackUp
,
isBackUp
,
endTime
,
endTime
,
benefitType
,
rank
,
rank
,
itemId
,
itemId
,
amount
,
amount
,
...
@@ -582,6 +596,7 @@ Component({
...
@@ -582,6 +596,7 @@ Component({
prizeDataType
:
+
prizeDataType
,
prizeDataType
:
+
prizeDataType
,
itemId
,
itemId
,
amount
,
amount
,
benefitType
,
...
rest
,
...
rest
,
};
};
// 自定义新增字段
// 自定义新增字段
...
...
server/duibats/package.json
View file @
8e7495e7
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"dayjs"
:
"^1.8.28"
,
"dayjs"
:
"^1.8.28"
,
"node-xlsx"
:
"^0.15.0"
,
"node-xlsx"
:
"^0.15.0"
,
"source-map-support"
:
"^0.5.19"
,
"source-map-support"
:
"^0.5.19"
,
"taobao-mini-sdk"
:
"0.2.
4
"
"taobao-mini-sdk"
:
"0.2.
5
"
},
},
"scripts"
:
{
"scripts"
:
{
"start"
:
"tsc"
,
"start"
:
"tsc"
,
...
...
server/duibats/src/controller/save.controller.ts
View file @
8e7495e7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
CODE_TYPES
,
_48_HOURS
}
from
'./../constants'
import
{
CODE_TYPES
,
_48_HOURS
}
from
'./../constants'
import
{
services
,
paramsCheck
,
paramsValidate
}
from
'../decorator'
import
{
services
,
paramsCheck
,
paramsValidate
}
from
'../decorator'
import
{
resultsModel
}
from
'../sdk'
import
{
resultsModel
,
TBAPIS
}
from
'../sdk'
import
{
ActivityconfigService
}
from
'../service'
import
{
ActivityconfigService
}
from
'../service'
import
{
saveParams
}
from
'../utils/saveValidate'
import
{
saveParams
}
from
'../utils/saveValidate'
...
@@ -92,11 +92,20 @@ export default class ActivitSaveController {
...
@@ -92,11 +92,20 @@ export default class ActivitSaveController {
}
}
if
(
result
||
result
===
0
)
{
if
(
result
||
result
===
0
)
{
<%
if
(
miniConfig
.
needMiniapp
&&
miniConfig
.
MiniappIdList
.
length
>
0
)
{
%>
try
{
<%
for
(
var
i
=
0
;
i
<
miniConfig
.
MiniappIdList
.
length
;
++
i
)
{
%>
<%-
`await TBAPIS.configMiniApp(context, {appId:
${
+
miniConfig
.
MiniappIdList
[
i
]}
,version:'0.0.1'})`
%>
<%
}
%>
}
catch
(
error
)
{
console
.
log
(
error
)
}
<%
}
%>
return
resultsModel
.
success
(
true
)
return
resultsModel
.
success
(
true
)
}
else
{
}
else
{
console
.
log
(
result
,
'保存活动失败'
)
console
.
log
(
result
,
'保存活动失败'
)
return
resultsModel
.
error
(
CODE_TYPES
.
SYSTEM_ERROR
,
'保存活动失败'
)
return
resultsModel
.
error
(
CODE_TYPES
.
SYSTEM_ERROR
,
'保存活动失败'
)
}
}
}
}
}
}
}
}
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