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
9d665f75
Commit
9d665f75
authored
Jun 02, 2021
by
管新明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'b-template-component' into b_template_component_bugfixed_20200531
parents
c3728d74
dd9ec4a9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
items-config.axml
client/components/task/items-config/items-config.axml
+2
-2
add.js
client/pages/activity/add/add.js
+18
-5
validate.js
client/utils/validate.js
+1
-1
No files found.
client/components/task/items-config/items-config.axml
View file @
9d665f75
<view class="items-config">
<view class="items-config">
<text
style="font-size: 12px">{{itemIds ? `已选择${(itemIds + '').split(',').length}个商品` : ''
}} </text>
<text
a:if="{{itemIds}}" style="font-size: 12px; margin-right: 10px">{{`已选择${(itemIds + '').split(',').length}个商品`
}} </text>
<button type="primary" text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button>
<button type="primary"
style="height:auto;"
text size="small" onTap="onOpenDialog">{{itemIds ? '更换商品' : '选择商品'}}</button>
<items-dialog
<items-dialog
onUpdateBabyChoose="onUpdateBabyChoose"
onUpdateBabyChoose="onUpdateBabyChoose"
browseItemIds="{{itemIds + ''}}"
browseItemIds="{{itemIds + ''}}"
...
...
client/pages/activity/add/add.js
View file @
9d665f75
...
@@ -21,11 +21,12 @@ var validator = new schema(descriptor)
...
@@ -21,11 +21,12 @@ var validator = new schema(descriptor)
const
tasks
=
{
const
tasks
=
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
key
!==
'label'
?
`
${
configList
[
i
].
key
}
:{
<%-
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
key
!==
'label'
?
`
${
configList
[
i
].
key
}
:{
value:"",
value:
${
configList
[
i
].
value
||
'""'
}
,
taskRateType:"",
taskRateType:
${
configList
[
i
].
taskRateType
?
`TASK_RATE_TYPE["
${
configList
[
i
].
taskRateType
}
"]`
:
'""'
}
,
times:"",
times:
${
configList
[
i
].
times
||
'""'
}
,
title:"",
title:"
${
configList
[
i
].
taskConfigMode
===
'fixed'
?
configList
[
i
].
name
:
''
}
",
link:""
link:"",
itemIds:""
},`
:
''
%><%
}
%>
},`
:
''
%><%
}
%>
}
}
...
@@ -220,6 +221,18 @@ Component({
...
@@ -220,6 +221,18 @@ Component({
}
}
return
prizeInfoListCopy
return
prizeInfoListCopy
},
},
// 任务配置选择商品回调
onItemIdsChange
(
ids
,
dataName
)
{
this
.
setData
({
tasks
:
{
...
this
.
data
.
tasks
,
[
dataName
]:
{
...
this
.
data
.
tasks
[
dataName
],
itemIds
:
ids
}
},
});
},
backList
()
{
backList
()
{
this
.
$page
.
$router
.
go
(
-
1
)
this
.
$page
.
$router
.
go
(
-
1
)
}
}
...
...
client/utils/validate.js
View file @
9d665f75
...
@@ -28,7 +28,7 @@ export const isNumber = val => {
...
@@ -28,7 +28,7 @@ export const isNumber = val => {
* @returns { boolean }
* @returns { boolean }
*/
*/
export
const
validateRangeNumber
=
(
number
,
[
min
,
max
]
=
[],
fixed
=
0
)
=>
{
export
const
validateRangeNumber
=
(
number
,
[
min
,
max
]
=
[],
fixed
=
0
)
=>
{
let
pattern
=
new
RegExp
(
`^[0-9]+(\\.[0-9]{1,
${
fixed
}
})?$`
)
;
let
pattern
=
/`^
[
0-9
]
+
(\\
.
[
0-9
]
{1,${fixed}}
)?
$`/
;
// 判断空字符
// 判断空字符
if
(
typeof
number
===
'string'
&&
!
number
.
trim
())
return
false
if
(
typeof
number
===
'string'
&&
!
number
.
trim
())
return
false
...
...
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