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
1ca029eb
Commit
1ca029eb
authored
Nov 12, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
13f57aa0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
8 deletions
+76
-8
layout.acss
client/components/basic/layout/layout.acss
+1
-1
prize-dialog.axml
client/components/dialog/prize-dialog/prize-dialog.axml
+22
-2
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+48
-2
prize-dialog.json
client/components/dialog/prize-dialog/prize-dialog.json
+2
-1
probability-prize-table.axml
...rize/probability-prize-table/probability-prize-table.axml
+1
-1
probability-prize-table.js
.../prize/probability-prize-table/probability-prize-table.js
+2
-1
No files found.
client/components/basic/layout/layout.acss
View file @
1ca029eb
.db-layout {
padding: 25px
75
px;
padding: 25px
20
px;
display: flex;
}
.db-content {
...
...
client/components/dialog/prize-dialog/prize-dialog.axml
View file @
1ca029eb
...
...
@@ -47,7 +47,7 @@
</form-item>
<form-item
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && type
=== 'probability
'}}"
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && type
!== 'rank
'}}"
style="width:100%"
size="large"
class="probability-prize-content-formItem"
...
...
@@ -60,7 +60,7 @@
</form-item>
<form-item
style="width:100%"
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && prizeInitData.switchStock==1 && type
=== 'probability
'}}"
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && prizeInitData.switchStock==1 && type
!== 'rank
'}}"
size="large"
class="probability-prize-content-formItem"
label="奖品库存"
...
...
@@ -171,11 +171,31 @@
defaultValue="{{prizeInitData.probability}}"
placeholder="当前概率不能超过100"/>%
</form-item>
<form-item
a:if="{{prizeInitData.type == OBJECT_TYPE}}"
style="width:100%" size="large"
class="probability-prize-content-formItem probability-prize-content-formItem-choosePrize"
label="商品查看链接">
<view class="probability-prize-content-formitem-choosePrize-wrap">
<view
class="probability-prize-content-formitem-goequity"
onTap="onOpenDialog"
type="primary">{{prizeInitData.itemId ? '更换商品' : '可选择商品'}}
</view>
</view>
</form-item>
</form>
</view>
<view class="probability-prize-content-btn">
<button class="probability-prize-content-btn_confirm" onTap="updatePrize" type="primary">确定</button>
<button onTap="onCloseDialog">取消</button>
</view>
<items-dialog
a:if="{{goodsVisible}}"
onUpdateBabyChoose="onUpdateBabyChoose"
browseItemIds="{{itemIds}}"
showBaby="{{goodsVisible}}"
onClose="onCloseGoodsDialog" />
</view>
</dialog-wrap>
\ No newline at end of file
client/components/dialog/prize-dialog/prize-dialog.js
View file @
1ca029eb
...
...
@@ -26,11 +26,15 @@ const INIT_DATA = {
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
""
,
amount
:
""
,
itemId
:
""
,
};
Component
({
mixins
:
[],
data
:
{
goodsVisible
:
false
,
itemIds
:
''
,
EQUITY_TYPE
,
CREDITS_TYPE
,
OBJECT_TYPE
,
...
...
@@ -92,6 +96,8 @@ Component({
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
""
,
amount
:
""
,
itemId
:
""
,
},
},
props
:
{
...
...
@@ -143,6 +149,7 @@ Component({
startTime
,
endTime
,
stock
,
amount
}
=
data
[
0
];
if
(
success
)
{
//切换不同优惠券内容置空
...
...
@@ -155,6 +162,7 @@ Component({
startTime
,
endTime
,
stock
:
stock
,
amount
},
});
}
else
{
...
...
@@ -169,6 +177,7 @@ Component({
stock
:
""
,
useStock
:
0
,
switchStock
:
2
,
amount
:
0
},
});
}
...
...
@@ -345,6 +354,8 @@ Component({
switchStock
,
endTime
,
rank
,
itemId
,
amount
,
...
rest
}
=
this
.
data
.
prizeInitData
;
const
{
imageTips
}
=
this
.
data
;
...
...
@@ -423,7 +434,7 @@ Component({
}
// 库存奖品的库存值判断
let
usePass
=
switchStock
==
1
?
+
stock
>
(
useStock
||
0
)
:
true
;
let
stockPass
=
switchStock
==
1
?
validateRangeNumber
(
credits
,
[
0
,
99999
])
:
true
;
let
stockPass
=
switchStock
==
1
?
validateRangeNumber
(
stock
,
[
0
,
99999
])
:
true
;
if
(
!
stockPass
||
!
usePass
)
{
this
.
showItemTips
(
"prizeNumberTips"
,
...
...
@@ -533,13 +544,15 @@ Component({
rank
,
switchStock
,
prizeDataType
,
itemId
,
amount
,
...
rest
,
};
// 自定义新增字段
if
(
conditionKeys
&&
conditionKeys
.
length
)
{
const
conditions
=
{}
conditionKeys
.
forEach
(
item
=>
{
conditions
[
item
.
key
]
=
conditions
[
item
.
value
]
conditions
[
item
.
key
]
=
item
.
value
});
prizeData
=
{
...
prizeData
,
...
...
@@ -573,5 +586,38 @@ Component({
onCloseDialog
()
{
this
.
props
.
onClose
&&
this
.
props
.
onClose
();
},
onOpenDialog
()
{
this
.
setData
({
goodsVisible
:
true
,
itemIds
:
this
.
data
.
prizeInitData
.
itemId
?
this
.
data
.
prizeInitData
.
itemId
+
''
:
null
});
},
onCloseGoodsDialog
()
{
this
.
setData
({
goodsVisible
:
false
});
},
// 选择商品查看id
onUpdateBabyChoose
(
ids
)
{
if
(
!
ids
)
{
this
.
setData
({
itemIds
:
''
,
prizeInitData
:
{
...
this
.
data
.
prizeInitData
,
itemId
:
''
,
},
})
return
}
const
chooseId
=
ids
.
split
(
","
).
map
((
i
)
=>
+
i
);
this
.
setData
({
itemIds
:
ids
,
prizeInitData
:
{
...
this
.
data
.
prizeInitData
,
itemId
:
chooseId
[
0
],
},
})
},
},
});
client/components/dialog/prize-dialog/prize-dialog.json
View file @
1ca029eb
...
...
@@ -7,6 +7,7 @@
}
},
"usingComponents"
:
{
"dialog-wrap"
:
"../../basic/dialiog-wrap/dialiog-wrap"
"dialog-wrap"
:
"../../basic/dialiog-wrap/dialiog-wrap"
,
"items-dialog"
:
"/components/dialog/items-dialog/items-dialog"
}
}
\ No newline at end of file
client/components/prize/probability-prize-table/probability-prize-table.axml
View file @
1ca029eb
...
...
@@ -42,7 +42,7 @@
conditionKeys="{{conditionKeys}}"
prizeDialogData="{{prizeDialogData}}"
onClose="onCloseDialog"
type="
probablity
"
type="
{{type}}
"
imageLimit="{{imageLimit}}"
prizeDataType="{{prizeDataType}}"
onUpdate="onPrizeUpdate"
...
...
client/components/prize/probability-prize-table/probability-prize-table.js
View file @
1ca029eb
...
...
@@ -12,7 +12,8 @@ Component({
dataName
:
''
,
conditionKeys
:
[],
imageLimit
:
[
250
,
250
],
prizeDataType
:
null
prizeDataType
:
null
,
type
:
''
},
didMount
()
{
},
didUpdate
()
{
},
...
...
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