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
766db2dd
Commit
766db2dd
authored
Dec 02, 2020
by
zhaofei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
f9cb8e87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
26 deletions
+38
-26
task-dialog.axml
client/components/dialog/task-dialog/task-dialog.axml
+19
-8
task-dialog.js
client/components/dialog/task-dialog/task-dialog.js
+14
-14
add.js
client/pages/activity/add/add.js
+5
-4
No files found.
client/components/dialog/task-dialog/task-dialog.axml
View file @
766db2dd
<dialog-wrap visible="{{visible}}" onClose="onCloseDialog" width="460">
<dialog-wrap visible="{{visible}}" onClose="onCloseDialog" width="460">
<view class="task-dialog-wrap">
<view class="task-dialog-wrap">
<form style="width: 100%" data-name="form" inline="{{true}}">
<form style="width: 100%" data-name="form" inline="{{true}}">
<!--<form-item label="任务标题"><input style="width: 250px" onChange="onChange" data-name="title" defaultValue="{{title}}" maxLength="{{10}}" maxlength="{{10}}" hasLimitHint="{{true}}" name="title" placeholder="请输入任务标题"/></form-item> -->
<form-item label="任务标题">
<!--<form-item label="任务类型" style="width:100%;"><radio-group size="small" value="{{taskRateType}}" onChange="onTaskRateTypeChange"><radio size="small" value="{{1}}">永久一次</radio><radio size="small" value="{{2}}">每天限次</radio><radio size="small" value="{{3}}">不限次</radio></radio-group></form-item><form-item style="width:100%;" a:if="{{taskRateType === 2}}"><view class="task-day-limit"><view>每天最多完成</view><view style="margin: 0 6px;"><select value="{{times}}" onChange="onTimesChange" dataSource="{{dataSource}}"/></view>
<input style="width: 250px" onChange="onChange" data-name="title" defaultValue="{{title}}" maxLength="{{10}}" maxlength="{{10}}" hasLimitHint="{{true}}" name="title" placeholder="请输入任务标题"/></form-item>
次任务</view></form-item> -->
<form-item label="任务类型" style="width:100%;">
<radio-group size="small" value="{{taskRateType}}" onChange="onTaskRateTypeChange">
<radio size="small" value="{{1}}">永久一次</radio>
<radio size="small" value="{{2}}">每天限次</radio>
<radio size="small" value="{{3}}">不限次</radio></radio-group></form-item>
<form-item style="width:100%;" a:if="{{taskRateType === 2}}">
<view class="task-day-limit">
<view>每天最多完成</view>
<view style="margin: 0 6px;">
<select value="{{times}}" onChange="onTimesChange" dataSource="{{dataSource}}"/></view>
次任务
</view></form-item>
<form-item label="跳转链接" a:if="{{hasLink}}">
<form-item label="跳转链接" a:if="{{hasLink}}">
<input style="width: 250px" onChange="onChange" data-name="link" defaultValue="{{link}}" name="link" placeholder="请输入跳转链接"/>
<input style="width: 250px" onChange="onChange" data-name="link" defaultValue="{{link}}" name="link" placeholder="请输入跳转链接"/>
</form-item>
</form-item>
...
@@ -11,16 +22,16 @@
...
@@ -11,16 +22,16 @@
<items-config itemIds="{{itemIds}}" onUpdate="onItemIdsChange"/>
<items-config itemIds="{{itemIds}}" onUpdate="onItemIdsChange"/>
</form-item>
</form-item>
<form-item label="任务类型" style="width:100%;">
<form-item label="任务类型" style="width:100%;">
<
!-- <
radio-group size="small" value="{{taskRateType}}" onChange="onTaskRateTypeChange">
<radio-group size="small" value="{{taskRateType}}" onChange="onTaskRateTypeChange">
<radio size="small" value="{{1}}">永久一次</radio>
<radio size="small" value="{{1}}">永久一次</radio>
<radio size="small" value="{{2}}">每天限次</radio>
<radio size="small" value="{{2}}">每天限次</radio>
<radio size="small" value="{{3}}">不限次</radio>
<radio size="small" value="{{3}}">不限次</radio>
</radio-group>
-->
</radio-group>
<
view class="item-txt">{{frequency}}</view
>
<
!--<view class="item-txt">{{frequency}}</view> --
>
</form-item>
</form-item>
<form-item label="任务奖励">
<form-item label="任务奖励">
<
!--<input onChange="onChange" data-name="value" defaultValue="{{value}}" name="value" addonTextAfter="{{unit}}" placeholder="1-999" maxLength="{{3}}"/> --
>
<
input onChange="onChange" data-name="value" defaultValue="{{value}}" name="value" addonTextAfter="{{unit}}" placeholder="1-999" maxLength="{{3}}"/
>
<
view class="item-txt">{{value}}{{unit}}</view
>
<
!--<view class="item-txt">{{value}}{{unit}}</view> --
>
</form-item>
</form-item>
</form>
</form>
<view class="task-content-btn">
<view class="task-content-btn">
...
...
client/components/dialog/task-dialog/task-dialog.js
View file @
766db2dd
...
@@ -83,13 +83,13 @@ Component({
...
@@ -83,13 +83,13 @@ Component({
},
},
onSaveTask
()
{
onSaveTask
()
{
const
{
title
,
link
,
value
,
taskRateType
,
times
,
itemIds
}
=
this
.
data
;
const
{
title
,
link
,
value
,
taskRateType
,
times
,
itemIds
}
=
this
.
data
;
//
if(!title.trim()) {
if
(
!
title
.
trim
())
{
//
my.showToast({
my
.
showToast
({
//
type: 'fail',
type
:
'fail'
,
//
content: '请输入任务标题'
content
:
'请输入任务标题'
//
})
})
//
return;
return
;
//
}
}
if
(
this
.
props
.
hasLink
&&
!
urlCheck
(
link
,
passUrlList
).
status
)
{
if
(
this
.
props
.
hasLink
&&
!
urlCheck
(
link
,
passUrlList
).
status
)
{
my
.
showToast
({
my
.
showToast
({
...
@@ -107,13 +107,13 @@ Component({
...
@@ -107,13 +107,13 @@ Component({
return
;
return
;
}
}
//
if(!value || !validateRangeNumber(value, [1, 999])) {
if
(
!
value
||
!
validateRangeNumber
(
value
,
[
1
,
999
]))
{
//
my.showToast({
my
.
showToast
({
//
type: 'fail',
type
:
'fail'
,
//
content: '请输入正确的任务奖励'
content
:
'请输入正确的任务奖励'
//
})
})
//
return;
return
;
//
}
}
let
taskData
=
{
...
this
.
props
.
taskData
,
title
,
link
,
value
,
taskRateType
,
times
,
itemIds
,
type
:
this
.
props
.
type
};
let
taskData
=
{
...
this
.
props
.
taskData
,
title
,
link
,
value
,
taskRateType
,
times
,
itemIds
,
type
:
this
.
props
.
type
};
...
...
client/pages/activity/add/add.js
View file @
766db2dd
...
@@ -30,10 +30,11 @@ Component({
...
@@ -30,10 +30,11 @@ Component({
tasks
:
{
tasks
:
{
<%
for
(
var
i
=
0
;
i
<
activityConfigList
.
length
;
++
i
)
{
%>
<%
for
(
var
i
=
0
;
i
<
activityConfigList
.
length
;
++
i
)
{
%>
<%-
taskKeys
.
includes
(
activityConfigList
[
i
].
key
)
&&
activityConfigList
[
i
].
key
!==
'label'
?
`
${
activityConfigList
[
i
].
key
}
:{
<%-
taskKeys
.
includes
(
activityConfigList
[
i
].
key
)
&&
activityConfigList
[
i
].
key
!==
'label'
?
`
${
activityConfigList
[
i
].
key
}
:{
value:
${
activityConfigList
[
i
].
value
?
activityConfigList
[
i
].
value
:
0
}
,
value:"",
taskRateType:TASK_RATE_TYPE.
${
activityConfigList
[
i
].
taskRateType
}
,
taskRateType:"",
times:
${
activityConfigList
[
i
].
times
?
activityConfigList
[
i
].
times
:
1
}
,
times:"",
title:
${
activityConfigList
[
i
].
title
?
`'
${
activityConfigList
[
i
].
title
}
'`
:
'""'
}
,
title:"",
link:""
},`
:
''
%><%
}
%>
},`
:
''
%><%
}
%>
},
},
<%
for
(
var
i
=
0
;
i
<
boxDatas
.
length
;
++
i
)
{
%>
<%
for
(
var
i
=
0
;
i
<
boxDatas
.
length
;
++
i
)
{
%>
...
...
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