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
2a21b58a
Commit
2a21b58a
authored
Jul 16, 2020
by
秦海涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
79a03b04
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
651 additions
and
651 deletions
+651
-651
add.axml
client/pages/activity/add/add.axml
+4
-209
add.js
client/pages/activity/add/add.js
+102
-185
validate.js
client/pages/activity/add/validate.js
+7
-86
add.acss
client/pages/activity/addBackup/add.acss
+0
-0
add.axml
client/pages/activity/addBackup/add.axml
+226
-0
add.js
client/pages/activity/addBackup/add.js
+185
-102
add.json
client/pages/activity/addBackup/add.json
+0
-0
validate.js
client/pages/activity/addBackup/validate.js
+119
-0
add.axml
client/pages/activity/addTemp/add.axml
+0
-21
validate.js
client/pages/activity/addTemp/validate.js
+0
-40
list.axml
client/pages/activity/list/list.axml
+1
-1
list.js
client/pages/activity/list/list.js
+3
-0
list.acss
client/pages/activity/listBack/list.acss
+0
-0
list.axml
client/pages/activity/listBack/list.axml
+1
-1
list.js
client/pages/activity/listBack/list.js
+0
-3
list.json
client/pages/activity/listBack/list.json
+0
-0
index.js
client/router/index.js
+3
-3
No files found.
client/pages/activity/add/add.axml
View file @
2a21b58a
...
...
@@ -2,223 +2,18 @@
<view class="edit-breadcrumb">
<text class="edit-title edit-title_my" onTap="backList">我的活动</text>
<text class="edit-title edit-title-separate">/</text>
<text class="edit-title">{{activityId ? '编辑' : '新建'}} 「
店铺漂流记
」 活动</text>
<text class="edit-title">{{activityId ? '编辑' : '新建'}} 「
<%=appName%>
」 活动</text>
</view>
<view class="edit-content">
<form class="edit-content-form" inline="true" labelTextAlign="right" labelCol="{{labelCol}}">
<tb-label title="基础配置"/>
<form-item
class="edit-content-form-item"
label="活动时间"
validateState="{{formState.timeRange.status}}"
help="{{formState.timeRange.message}}"
asterisk="{{false}}">
<tb-range-picker
timeRange="{{timeRange}}"
originalStartTime="{{originalStartTime}}"
onChange="onTimeChange"
disableStartTime="{{isStart}}"
/>
</form-item>
<form-item
validateState="{{formState.title.status}}"
help="{{formState.title.message}}"
class="edit-content-form-item"
label="活动名称"
asterisk="{{false}}">
<tb-input
placeholder="请输入活动名称"
maxLength="12"
value="{{title}}"
dataName="title"
hasLimitHint="{{true}}"
onChange="onChange"
tips="活动名称仅在配置后台展示,用于区分活动,不在C端展示"
/>
</form-item>
<form-item
validateState="{{formState.subtitle.status}}"
help="{{formState.subtitle.message}}"
class="edit-content-form-item"
label="活动副标题"
asterisk="{{false}}">
<tb-input
placeholder="漂流寻宝赢取100元现金红包"
maxLength="16"
value="{{subtitle}}"
dataName="subtitle"
hasLimitHint="{{true}}"
onChange="onChange"
tips="活动副标题用于C端游戏首页展示,需与活动奖品相关,用于吸引用户参与"
/>
</form-item>
<tb-label title="奖品配置"/>
<form-item
class="edit-content-form-item"
label="奖品配置"
validateState="{{formState.prizeInfoList.status}}"
help="{{formState.prizeInfoList.message}}"
asterisk="{{false}}">
<rank-table
list="{{prizeInfoList}}"
onChange="onPrizeListChange"
limit="{{11}}"
maxRankLimit="{{100}}"
fixedRank="{{['1', '2', '3']}}"
imageLimit="{{[200, 200]}}"
/>
</form-item>
<tb-label title="任务配置"/>
<form-item
class="edit-content-form-item"
label="成为会员"
validateState="{{formState['taskMap.beMembership'].status}}"
help="{{formState['taskMap.beMembership'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.beMembership.checked}}" data-name="taskMap.beMembership.checked" onChange="onCheckChange"></checkbox>
<tb-config-input
textBefore="获得"
textAfter="体力值"
validateRange="{{[1, 99]}}"
value="{{taskMap.beMembership.value}}"
dataName="taskMap.beMembership.value"
onChange="onTaskInputChange",
placeholder="1-99"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="邀请好友"
validateState="{{formState['taskMap.inviteFriends'].status}}"
help="{{formState['taskMap.inviteFriends'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.inviteFriends.checked}}" data-name="taskMap.inviteFriends.checked" onChange="onCheckChange"></checkbox>
<task-config
unit="体力值"
type="inviteFriends"
taskData="{{taskMap.inviteFriends}}"
dataName="taskMap.inviteFriends"
onUpdate="onTaskChange"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="浏览指定页面"
validateState="{{formState['taskMap.jumpLink'].status}}"
help="{{formState['taskMap.jumpLink'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.jumpLink.checked}}" data-name="taskMap.jumpLink.checked" onChange="onCheckChange"></checkbox>
<task-config
unit="体力值"
type="jumpLink"
hasLink
taskData="{{taskMap.jumpLink}}"
dataName="taskMap.jumpLink"
onUpdate="onTaskChange"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="寻宝屋商品"
validateState="{{formState['taskMap.browseGoods'].status}}"
help="{{formState['taskMap.browseGoods'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.browseGoods.checked}}" disabled="{{true}}"></checkbox>
<items-config itemIds="{{taskMap.browseGoods.itemIds}}" dataName="taskMap.browseGoods.itemIds" onUpdate="onTaskChange"/>
</view>
</form-item>
<form-item
validateState="{{formState.logoImg.status}}"
help="{{formState.logoImg.message}}"
class="edit-content-form-item"
label="logo图片"
asterisk="{{false}}">
<view style="display:flex;">
<tb-image-upload url="{{logoImg}}" dataName="logoImg" onSuccess="onChangeByDataName" imageLimit="{{[200, 90]}}"/>
<question-tips>
<image style="width:200px;height:400px;border:1px solid #ccc;margin-right:10px" src="//yun.duiba.com.cn/20200410/image2020-6-7_18-16-3.png"></image>
</question-tips>
</view>
</form-item>
<tb-label title="邀请配置"/>
<form-item
validateState="{{formState.commandTitle.status}}"
help="{{formState.commandTitle.message}}"
class="edit-content-form-item"
label="邀请淘口令名称"
asterisk="{{false}}">
<tb-input
placeholder="请输入邀请者淘口令名称"
maxLength="20"
value="{{commandTitle}}"
dataName="commandTitle"
hasLimitHint="{{true}}"
onChange="onChange"
/>
</form-item>
<form-item
validateState="{{formState.beenInvitedText.status}}"
help="{{formState.beenInvitedText.message}}"
class="edit-content-form-item"
label="被邀请者文案"
asterisk="{{false}}">
<tb-input
placeholder="请输入被邀请者文案"
maxLength="30"
value="{{beenInvitedText}}"
dataName="beenInvitedText"
hasLimitHint="{{true}}"
onChange="onChange"
/>
</form-item>
<form-item
validateState="{{formState.commandImg.status}}"
help="{{formState.commandImg.message}}"
class="edit-content-form-item"
label="淘口令图片"
asterisk="{{false}}">
<tb-image-upload url="{{commandImg}}" dataName="commandImg" onSuccess="onChangeByDataName" imageLimit="{{[400, 300]}}"/>
</form-item>
<tb-label title="规则配置"/>
<form-item
validateState="{{formState.rule.status}}"
help="{{formState.rule.message}}"
class="edit-content-form-item"
label="活动规则"
asterisk="{{false}}">
<tb-rule value="{{rule}}" onChange="onRuleChange" generateRuleInfo="{{{title: subtitle, startTime, endTime, prizeInfoList}}}"/>
</form-item>
<% for(var i = 0; i < configList.length; ++i) {%>
<%-configList[i].template%><% } %>
<view class="submit-btn">
<button onTap="onSubmit" type="primary">确定</button>
<button
onTap="cancelEdit"
>取消</button>
<button>取消</button>
</view>
</form>
...
...
client/pages/activity/add/add.js
View file @
2a21b58a
This diff is collapsed.
Click to expand it.
client/pages/activity/add/validate.js
View file @
2a21b58a
import
{
TASK_RATE_TYPE
}
from
'../const'
import
flatten
from
'lodash/flatten'
import
{
rankTableValidator
}
from
"../../../utils/validate"
;
// 使用 async-validator 校验
// 文档地址: https://github.com/yiminghe/async-validator
export
const
descriptor
=
{
title
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
&&
value
.
length
<=
12
},
message
:
"请输入正确的活动名称"
},
subtitle
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
&&
value
.
length
<=
16
},
message
:
"请输入正确的活动副标题"
},
prizeInfoList
:
{
required
:
true
,
validator
:
rankTableValidator
},
timeRange
:
{
required
:
true
},
logoImg
:
{
required
:
true
,
message
:
'请配置图片'
},
commandTitle
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入淘口令名称'
},
beenInvitedText
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入被邀请者文案'
},
commandImg
:
{
required
:
true
,
message
:
'请输入淘口令图片'
},
rule
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入活动规则'
},
export
const
descriptor
=
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
taskMap
:
{
type
:
'object'
,
required
:
tru
e
,
required
:
fals
e
,
fields
:
{
beMembership
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
beMembership
.
checked
)
return
true
;
return
!!
val
.
value
},
message
:
'请输入成为会员任务的奖励'
},
inviteFriends
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
inviteFriends
.
checked
)
return
true
;
return
!!
(
val
.
title
&&
val
.
value
)
},
message
:
'请输入邀请任务'
},
jumpLink
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
jumpLink
.
checked
)
return
true
;
return
!!
(
val
.
title
&&
val
.
value
&&
val
.
link
);
},
message
:
'请输入浏览指定页面任务'
},
browseGoods
:
{
validator
:
(
rule
,
val
)
=>
{
return
!!
(
val
.
itemIds
);
},
message
:
'请输入寻宝屋商品任务'
}
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
}
}
}
;
}
...
...
client/pages/activity/add
Tem
p/add.acss
→
client/pages/activity/add
Backu
p/add.acss
View file @
2a21b58a
File moved
client/pages/activity/addBackup/add.axml
0 → 100644
View file @
2a21b58a
<view class="edit-container">
<view class="edit-breadcrumb">
<text class="edit-title edit-title_my" onTap="backList">我的活动</text>
<text class="edit-title edit-title-separate">/</text>
<text class="edit-title">{{activityId ? '编辑' : '新建'}} 「 店铺漂流记 」 活动</text>
</view>
<view class="edit-content">
<form class="edit-content-form" inline="true" labelTextAlign="right" labelCol="{{labelCol}}">
<tb-label title="基础配置"/>
<form-item
class="edit-content-form-item"
label="活动时间"
validateState="{{formState.timeRange.status}}"
help="{{formState.timeRange.message}}"
asterisk="{{false}}">
<tb-range-picker
timeRange="{{timeRange}}"
originalStartTime="{{originalStartTime}}"
onChange="onTimeChange"
disableStartTime="{{isStart}}"
/>
</form-item>
<form-item
validateState="{{formState.title.status}}"
help="{{formState.title.message}}"
class="edit-content-form-item"
label="活动名称"
asterisk="{{false}}">
<tb-input
placeholder="请输入活动名称"
maxLength="12"
value="{{title}}"
dataName="title"
hasLimitHint="{{true}}"
onChange="onChange"
tips="活动名称仅在配置后台展示,用于区分活动,不在C端展示"
/>
</form-item>
<form-item
validateState="{{formState.subtitle.status}}"
help="{{formState.subtitle.message}}"
class="edit-content-form-item"
label="活动副标题"
asterisk="{{false}}">
<tb-input
placeholder="漂流寻宝赢取100元现金红包"
maxLength="16"
value="{{subtitle}}"
dataName="subtitle"
hasLimitHint="{{true}}"
onChange="onChange"
tips="活动副标题用于C端游戏首页展示,需与活动奖品相关,用于吸引用户参与"
/>
</form-item>
<tb-label title="奖品配置"/>
<form-item
class="edit-content-form-item"
label="奖品配置"
validateState="{{formState.prizeInfoList.status}}"
help="{{formState.prizeInfoList.message}}"
asterisk="{{false}}">
<rank-table
list="{{prizeInfoList}}"
onChange="onPrizeListChange"
limit="{{11}}"
maxRankLimit="{{100}}"
fixedRank="{{['1', '2', '3']}}"
imageLimit="{{[200, 200]}}"
/>
</form-item>
<tb-label title="任务配置"/>
<form-item
class="edit-content-form-item"
label="成为会员"
validateState="{{formState['taskMap.beMembership'].status}}"
help="{{formState['taskMap.beMembership'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.beMembership.checked}}" data-name="taskMap.beMembership.checked" onChange="onCheckChange"></checkbox>
<tb-config-input
textBefore="获得"
textAfter="体力值"
validateRange="{{[1, 99]}}"
value="{{taskMap.beMembership.value}}"
dataName="taskMap.beMembership.value"
onChange="onTaskInputChange",
placeholder="1-99"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="邀请好友"
validateState="{{formState['taskMap.inviteFriends'].status}}"
help="{{formState['taskMap.inviteFriends'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.inviteFriends.checked}}" data-name="taskMap.inviteFriends.checked" onChange="onCheckChange"></checkbox>
<task-config
unit="体力值"
type="inviteFriends"
taskData="{{taskMap.inviteFriends}}"
dataName="taskMap.inviteFriends"
onUpdate="onTaskChange"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="浏览指定页面"
validateState="{{formState['taskMap.jumpLink'].status}}"
help="{{formState['taskMap.jumpLink'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.jumpLink.checked}}" data-name="taskMap.jumpLink.checked" onChange="onCheckChange"></checkbox>
<task-config
unit="体力值"
type="jumpLink"
hasLink
taskData="{{taskMap.jumpLink}}"
dataName="taskMap.jumpLink"
onUpdate="onTaskChange"
/>
</view>
</form-item>
<form-item
class="edit-content-form-item"
label="寻宝屋商品"
validateState="{{formState['taskMap.browseGoods'].status}}"
help="{{formState['taskMap.browseGoods'].message}}"
asterisk="{{false}}">
<view class="form-flex">
<checkbox class="form-check" checked="{{taskMap.browseGoods.checked}}" disabled="{{true}}"></checkbox>
<items-config itemIds="{{taskMap.browseGoods.itemIds}}" dataName="taskMap.browseGoods.itemIds" onUpdate="onTaskChange"/>
</view>
</form-item>
<form-item
validateState="{{formState.logoImg.status}}"
help="{{formState.logoImg.message}}"
class="edit-content-form-item"
label="logo图片"
asterisk="{{false}}">
<view style="display:flex;">
<tb-image-upload url="{{logoImg}}" dataName="logoImg" onSuccess="onChangeByDataName" imageLimit="{{[200, 90]}}"/>
<question-tips>
<image style="width:200px;height:400px;border:1px solid #ccc;margin-right:10px" src="//yun.duiba.com.cn/20200410/image2020-6-7_18-16-3.png"></image>
</question-tips>
</view>
</form-item>
<tb-label title="邀请配置"/>
<form-item
validateState="{{formState.commandTitle.status}}"
help="{{formState.commandTitle.message}}"
class="edit-content-form-item"
label="邀请淘口令名称"
asterisk="{{false}}">
<tb-input
placeholder="请输入邀请者淘口令名称"
maxLength="20"
value="{{commandTitle}}"
dataName="commandTitle"
hasLimitHint="{{true}}"
onChange="onChange"
/>
</form-item>
<form-item
validateState="{{formState.beenInvitedText.status}}"
help="{{formState.beenInvitedText.message}}"
class="edit-content-form-item"
label="被邀请者文案"
asterisk="{{false}}">
<tb-input
placeholder="请输入被邀请者文案"
maxLength="30"
value="{{beenInvitedText}}"
dataName="beenInvitedText"
hasLimitHint="{{true}}"
onChange="onChange"
/>
</form-item>
<form-item
validateState="{{formState.commandImg.status}}"
help="{{formState.commandImg.message}}"
class="edit-content-form-item"
label="淘口令图片"
asterisk="{{false}}">
<tb-image-upload url="{{commandImg}}" dataName="commandImg" onSuccess="onChangeByDataName" imageLimit="{{[400, 300]}}"/>
</form-item>
<tb-label title="规则配置"/>
<form-item
validateState="{{formState.rule.status}}"
help="{{formState.rule.message}}"
class="edit-content-form-item"
label="活动规则"
asterisk="{{false}}">
<tb-rule value="{{rule}}" onChange="onRuleChange" generateRuleInfo="{{{title: subtitle, startTime, endTime, prizeInfoList}}}"/>
</form-item>
<view class="submit-btn">
<button onTap="onSubmit" type="primary">确定</button>
<button onTap="cancelEdit">取消</button>
</view>
</form>
</view>
\ No newline at end of file
client/pages/activity/add
Tem
p/add.js
→
client/pages/activity/add
Backu
p/add.js
View file @
2a21b58a
This diff is collapsed.
Click to expand it.
client/pages/activity/add
Tem
p/add.json
→
client/pages/activity/add
Backu
p/add.json
View file @
2a21b58a
File moved
client/pages/activity/addBackup/validate.js
0 → 100644
View file @
2a21b58a
import
{
TASK_RATE_TYPE
}
from
'../const'
import
flatten
from
'lodash/flatten'
import
{
rankTableValidator
}
from
"../../../utils/validate"
;
// 使用 async-validator 校验
// 文档地址: https://github.com/yiminghe/async-validator
export
const
descriptor
=
{
title
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
&&
value
.
length
<=
12
},
message
:
"请输入正确的活动名称"
},
subtitle
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
&&
value
.
length
<=
16
},
message
:
"请输入正确的活动副标题"
},
prizeInfoList
:
{
required
:
true
,
validator
:
rankTableValidator
},
timeRange
:
{
required
:
true
},
logoImg
:
{
required
:
true
,
message
:
'请配置图片'
},
commandTitle
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入淘口令名称'
},
beenInvitedText
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入被邀请者文案'
},
commandImg
:
{
required
:
true
,
message
:
'请输入淘口令图片'
},
rule
:
{
required
:
true
,
validator
:
(
rule
,
value
)
=>
{
value
=
value
.
trim
();
return
!!
value
;
},
message
:
'请输入活动规则'
},
taskMap
:
{
type
:
'object'
,
required
:
true
,
fields
:
{
beMembership
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
beMembership
.
checked
)
return
true
;
return
!!
val
.
value
},
message
:
'请输入成为会员任务的奖励'
},
inviteFriends
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
inviteFriends
.
checked
)
return
true
;
return
!!
(
val
.
title
&&
val
.
value
)
},
message
:
'请输入邀请任务'
},
jumpLink
:
{
validator
:
(
rule
,
val
,
cb
,
source
)
=>
{
if
(
!
source
.
jumpLink
.
checked
)
return
true
;
return
!!
(
val
.
title
&&
val
.
value
&&
val
.
link
);
},
message
:
'请输入浏览指定页面任务'
},
browseGoods
:
{
validator
:
(
rule
,
val
)
=>
{
return
!!
(
val
.
itemIds
);
},
message
:
'请输入寻宝屋商品任务'
}
}
}
};
export
const
formatValidator
=
(
descriptor
,
validators
)
=>
{
validators
=
validators
||
{}
Object
.
keys
(
descriptor
).
forEach
(
key
=>
{
if
(
descriptor
[
key
].
fields
)
{
Object
.
keys
(
descriptor
[
key
].
fields
).
forEach
(
fieldKey
=>
{
validators
[
`
${
key
}
.
${
fieldKey
}
`
]
=
{
status
:
'success'
,
message
:
''
}
})
}
else
{
validators
[
key
]
=
{
status
:
'success'
,
message
:
''
}
}
});
return
validators
}
\ No newline at end of file
client/pages/activity/addTemp/add.axml
deleted
100644 → 0
View file @
79a03b04
<view class="edit-container">
<view class="edit-breadcrumb">
<text class="edit-title edit-title_my" onTap="backList">我的活动</text>
<text class="edit-title edit-title-separate">/</text>
<text class="edit-title">{{activityId ? '编辑' : '新建'}} 「 <%=appName%> 」 活动</text>
</view>
<view class="edit-content">
<form class="edit-content-form" inline="true" labelTextAlign="right" labelCol="{{labelCol}}">
<% for(var i = 0; i < configList.length; ++i) {%>
<%-configList[i].template%><% } %>
<view class="submit-btn">
<button onTap="onSubmit" type="primary">确定</button>
<button>取消</button>
</view>
</form>
</view>
\ No newline at end of file
client/pages/activity/addTemp/validate.js
deleted
100644 → 0
View file @
79a03b04
import
{
rankTableValidator
}
from
"../../../utils/validate"
;
// 使用 async-validator 校验
// 文档地址: https://github.com/yiminghe/async-validator
export
const
descriptor
=
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
taskMap
:
{
type
:
'object'
,
required
:
false
,
fields
:
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
}
}
}
export
const
formatValidator
=
(
descriptor
,
validators
)
=>
{
validators
=
validators
||
{}
Object
.
keys
(
descriptor
).
forEach
(
key
=>
{
if
(
descriptor
[
key
].
fields
)
{
Object
.
keys
(
descriptor
[
key
].
fields
).
forEach
(
fieldKey
=>
{
validators
[
`
${
key
}
.
${
fieldKey
}
`
]
=
{
status
:
'success'
,
message
:
''
}
})
}
else
{
validators
[
key
]
=
{
status
:
'success'
,
message
:
''
}
}
});
return
validators
}
\ No newline at end of file
client/pages/activity/list/list.axml
View file @
2a21b58a
...
...
@@ -2,4 +2,4 @@
<text class="db-title">活动管理</text>
<button type="primary" onTap="tapname">创建活动</button>
</view>
<
list-table/
>
<
%- listTable %
>
client/pages/activity/list/list.js
View file @
2a21b58a
...
...
@@ -3,6 +3,9 @@ const { function: fc } = cloud;
Component
({
props
:
{},
data
:
{
buttons
:
<%=
buttons
%>
},
methods
:
{
// 创建活动
tapname
()
{
...
...
client/pages/activity/list
Temp
/list.acss
→
client/pages/activity/list
Back
/list.acss
View file @
2a21b58a
File moved
client/pages/activity/list
Temp
/list.axml
→
client/pages/activity/list
Back
/list.axml
View file @
2a21b58a
...
...
@@ -2,4 +2,4 @@
<text class="db-title">活动管理</text>
<button type="primary" onTap="tapname">创建活动</button>
</view>
<
%- listTable %
>
<
list-table/
>
client/pages/activity/list
Temp
/list.js
→
client/pages/activity/list
Back
/list.js
View file @
2a21b58a
...
...
@@ -3,9 +3,6 @@ const { function: fc } = cloud;
Component
({
props
:
{},
data
:
{
buttons
:
<%=
buttons
%>
},
methods
:
{
// 创建活动
tapname
()
{
...
...
client/pages/activity/list
Temp
/list.json
→
client/pages/activity/list
Back
/list.json
View file @
2a21b58a
File moved
client/router/index.js
View file @
2a21b58a
...
...
@@ -12,11 +12,11 @@ export default {
},
{
path
:
"/list"
,
component
:
"list
Temp
"
,
component
:
"list"
,
},
{
path
:
"/add"
,
component
:
"add
Temp
"
,
component
:
"add"
,
},
{
path
:
'/data/:id'
,
...
...
@@ -24,7 +24,7 @@ export default {
},
{
path
:
"/edit/:id"
,
component
:
"add
Temp
"
,
component
:
"add"
,
},
],
}
...
...
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