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
c4468795
Commit
c4468795
authored
Jun 04, 2021
by
王波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'b-template-component' into feature/2021-05-31-benefitUpdate
parents
cd38e06b
bf7820dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
93 deletions
+74
-93
rank-dialog.axml
client/components/dialog/rank-dialog/rank-dialog.axml
+4
-34
rank-dialog.js
client/components/dialog/rank-dialog/rank-dialog.js
+33
-22
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
awards.controller.ts
server/duibats/src/controller/awards.controller.ts
+16
-29
No files found.
client/components/dialog/rank-dialog/rank-dialog.axml
View file @
c4468795
...
@@ -8,40 +8,10 @@
...
@@ -8,40 +8,10 @@
<view class="rank-dialog-wrap">
<view class="rank-dialog-wrap">
<!-- 添加筛选条件导出中奖名单 start -->
<!-- 添加筛选条件导出中奖名单 start -->
<form class="edit-content-form" data-name="form" inline="true" labelTextAlign="right" size="large">
<form class="edit-content-form" data-name="form" inline="true" labelTextAlign="right" size="large">
<form-item class="edit-content-formItem" label="奖品编号" labelTextAlign="right" asterisk="{{false}}">
<% for(var i = 0; i < configWinnersFilter.length; ++i) {%>
<input value="{{searchInfo.prizeId}}" onChange="handleInputChange" data-name='prizeId' hasLimitHint="true" name="奖品编号" />
<%-configWinnersFilter[i].template%>
</form-item>
<% } %>
<form-item class="edit-content-formItem" label="用户id" labelTextAlign="right" asterisk="{{false}}">
<input value="{{searchInfo.userNick}}" onChange="handleInputChange" data-name='userNick' hasLimitHint="true" name="用户id" />
</form-item>
<form-item class="edit-content-formItem" label="发奖时间" labelTextAlign="right" asterisk="{{false}}">
<range-picker style="width: 300px" onChange="handleTimeRangeChange" hasClear="true" value="{{searchInfo.timeRange}}" class="block" show-time="{{ format: 'HH:mm' }}" data-time="{{searchInfo.timeRange}}"/>
</form-item>
<form-item class="edit-content-formItem" label="发货状态" labelTextAlign="right">
<select value="{{searchInfo.shipStatus}}" onChange="handleInputChange" data-name='shipStatus'>
<option value="">全部</option>
<option value="1">未填写地址</option>
<option value="2">待发货</option>
<option value="3">已发货</option>
</select>
</form-item>
<form-item class="edit-content-formItem long-item" label="奖品类型">
<select value="{{searchInfo.prizeType}}" onChange="handleInputChange" data-name='prizeType'>
<option value="">全部</option>
<option value="1">优惠券</option>
<!-- <option value="2">积分</option> -->
<option value="3">实物</option>
<option value="5">谢谢参与</option>
</select>
</form-item>
<form-item class="edit-content-formItem long-item" label="发奖来源">
<select value="{{searchInfo.prizeDataType}}" onChange="handleInputChange" data-name='prizeDataType'>
<option value="">全部</option>
<% for(var i = 0; i < formatPrize.length; ++i) {%>
<%- `<option value="${formatPrize[i].prizeDataType}">${formatPrize[i].prizeSource}</option> `
%><% } %>
</select>
</form-item>
<view class="operator-btns" style="textAlign:right">
<view class="operator-btns" style="textAlign:right">
<button onTap="handleSearch" style="height:32px;" type="primary" size="medium">搜索</button>
<button onTap="handleSearch" style="height:32px;" type="primary" size="medium">搜索</button>
<button style="margin-left:20px;height:32px" type="primary" onTap="handleExport" size="medium">导出</button>
<button style="margin-left:20px;height:32px" type="primary" onTap="handleExport" size="medium">导出</button>
...
...
client/components/dialog/rank-dialog/rank-dialog.js
View file @
c4468795
...
@@ -6,14 +6,10 @@ Component({
...
@@ -6,14 +6,10 @@ Component({
data
:
{
data
:
{
// 搜索条件
// 搜索条件
searchInfo
:
{
searchInfo
:
{
prizeId
:
null
,
// 奖品编号
userNick
:
null
,
// 用户id
timeRange
:
[],
// 发奖时间
prizeType
:
null
,
prizeDataType
:
null
,
shipStatus
:
null
,
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
pageSize
:
10
,
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]}
:
${
winnersFilterData
[
i
]
==
'timeRange'
?
'[]'
:
null
}
,`
%><%
}
%>
},
},
list
:
[],
list
:
[],
total
:
0
,
total
:
0
,
...
@@ -41,8 +37,16 @@ Component({
...
@@ -41,8 +37,16 @@ Component({
// 搜索
// 搜索
async
handleSearch
()
{
async
handleSearch
()
{
// 未选择任何条件搜索
// 未选择任何条件搜索
const
{
prizeId
,
userNick
,
timeRange
,
prizeType
,
shipStatus
,
prizeDataType
}
=
this
.
data
.
searchInfo
;
const
{
if
(
!
prizeId
&&
!
userNick
&&
!
timeRange
.
length
&&
prizeType
==
null
&&
shipStatus
==
null
&&
prizeDataType
==
null
)
{
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]}
,`
%><%
}
%>
}
=
this
.
data
.
searchInfo
;
if
(
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]
==
'timeRange'
?
`!
${
winnersFilterData
[
i
]}
.length`
:
`!
${
winnersFilterData
[
i
]}
`
}
${
i
===
winnersFilterData
.
length
-
1
?
''
:
'&&'
}
`
%>
<%
}
%>
)
{
this
.
resetData
();
this
.
resetData
();
my
.
showToast
({
my
.
showToast
({
type
:
'fail'
,
type
:
'fail'
,
...
@@ -59,14 +63,10 @@ Component({
...
@@ -59,14 +63,10 @@ Component({
resetData
()
{
resetData
()
{
this
.
setData
({
this
.
setData
({
searchInfo
:
{
searchInfo
:
{
prizeId
:
null
,
// 奖品编号
userNick
:
null
,
// 用户id
timeRange
:
[],
// 发奖时间
prizeType
:
null
,
prizeDataType
:
null
,
shipStatus
:
null
,
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
pageSize
:
10
,
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]}
:
${
winnersFilterData
[
i
]
==
'timeRange'
?
'[]'
:
null
}
,`
%><%
}
%>
},
},
list
:
[],
list
:
[],
total
:
0
,
total
:
0
,
...
@@ -101,10 +101,11 @@ Component({
...
@@ -101,10 +101,11 @@ Component({
...
this
.
data
.
searchInfo
,
...
this
.
data
.
searchInfo
,
activityId
:
this
.
props
.
selectedItem
.
activityId
activityId
:
this
.
props
.
selectedItem
.
activityId
};
};
params
.
startTime
=
new
Date
(
params
.
timeRange
[
0
]).
getTime
();
<%-
winnersFilterData
.
includes
(
'timeRange'
)
?
`params.startTime = new Date(params.timeRange[0]).getTime();
params.endTime = new Date(params.timeRange[1]).getTime();
params.endTime = new Date(params.timeRange[1]).getTime();
delete params.timeRange;`
:
''
%>
delete
params
.
timeRange
;
console
.
log
(
'搜索参数'
,
params
);
console
.
log
(
'搜索参数'
,
params
);
try
{
try
{
...
@@ -138,8 +139,16 @@ Component({
...
@@ -138,8 +139,16 @@ Component({
async
handleExport
(
evt
)
{
async
handleExport
(
evt
)
{
console
.
log
(
this
.
props
);
console
.
log
(
this
.
props
);
// 未选择任何条件搜索
// 未选择任何条件搜索
const
{
prizeId
,
userNick
,
timeRange
,
prizeType
,
shipStatus
,
prizeDataType
}
=
this
.
data
.
searchInfo
;
const
{
if
(
!
prizeId
&&
!
userNick
&&
!
timeRange
.
length
&&
prizeType
==
null
&&
shipStatus
==
null
&&
prizeDataType
==
null
)
{
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]}
,`
%><%
}
%>
}
=
this
.
data
.
searchInfo
;
if
(
<%
for
(
var
i
=
0
;
i
<
winnersFilterData
.
length
;
++
i
)
{
%>
<%-
`
${
winnersFilterData
[
i
]
==
'timeRange'
?
`!
${
winnersFilterData
[
i
]}
.length`
:
`!
${
winnersFilterData
[
i
]}
`
}
${
i
===
winnersFilterData
.
length
-
1
?
''
:
'&&'
}
`
%>
<%
}
%>
)
{
this
.
resetData
();
this
.
resetData
();
my
.
showToast
({
my
.
showToast
({
type
:
'fail'
,
type
:
'fail'
,
...
@@ -149,8 +158,10 @@ Component({
...
@@ -149,8 +158,10 @@ Component({
}
}
const
{
activityId
,
title
}
=
this
.
props
.
selectedItem
;
const
{
activityId
,
title
}
=
this
.
props
.
selectedItem
;
let
params
=
{
...
this
.
data
.
searchInfo
,
activityId
,
title
};
let
params
=
{
...
this
.
data
.
searchInfo
,
activityId
,
title
};
params
.
startTime
=
new
Date
(
params
.
timeRange
[
0
]).
getTime
();
<%-
winnersFilterData
.
includes
(
'timeRange'
)
?
params
.
endTime
=
new
Date
(
params
.
timeRange
[
1
]).
getTime
();
`params.startTime = new Date(params.timeRange[0]).getTime();
params.endTime = new Date(params.timeRange[1]).getTime();`
:
''
%>
params
.
pageNo
=
1
;
params
.
pageNo
=
1
;
params
.
pageSize
=
500
;
params
.
pageSize
=
500
;
let
res
=
[];
let
res
=
[];
...
...
client/components/task/items-config/items-config.axml
View file @
c4468795
<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 @
c4468795
...
@@ -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 @
c4468795
...
@@ -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
...
...
server/duibats/src/controller/awards.controller.ts
View file @
c4468795
/** @format */
import
{
CODE_TYPES
,
EIGHT_HOURS
,
PRIZE_TYPE
,
SHIP_STATUS
}
from
'./../constants'
import
{
CODE_TYPES
,
EIGHT_HOURS
,
PRIZE_TYPE
,
SHIP_STATUS
}
from
'./../constants'
import
{
services
,
paramsCheck
}
from
'../decorator'
import
{
services
,
paramsCheck
}
from
'../decorator'
...
@@ -107,20 +105,9 @@ export default class BaseController {
...
@@ -107,20 +105,9 @@ export default class BaseController {
}
}
console
.
log
(
list
,
'导出报表'
)
console
.
log
(
list
,
'导出报表'
)
let
xlsxData
=
[
let
xlsxData
=
[
[
[
<%
for
(
var
i
=
0
;
i
<
winnersExportData
.
length
;
++
i
)
{
%>
'奖品编号'
,
<%-
`"
${
winnersExportData
[
i
]}
",`
'用户id'
,
%><%
}
%>
'中奖时间'
,
'地址填写时间'
,
'奖品类型'
,
'发奖来源'
,
'奖品名称'
,
'收货人'
,
'联系方式'
,
'收货地址'
,
'发货状态'
,
'物流公司'
,
'物流单号'
]
]
]
]
res
.
forEach
((
v
,
index
,
arr
)
=>
{
res
.
forEach
((
v
,
index
,
arr
)
=>
{
...
@@ -146,19 +133,19 @@ export default class BaseController {
...
@@ -146,19 +133,19 @@ export default class BaseController {
if
(
v
.
type
==
PRIZE_TYPE
.
THANK
)
prizeType
=
'谢谢参与'
if
(
v
.
type
==
PRIZE_TYPE
.
THANK
)
prizeType
=
'谢谢参与'
}
}
xlsxData
.
push
([
xlsxData
.
push
([
v
.
_id
,
<%-
`
${
winnersExportData
.
includes
(
'奖品编号'
)
?
'v._id,'
:
''
}
`
%>
v
.
userNick
,
<%-
`
${
winnersExportData
.
includes
(
'用户id'
)
?
'v.userNick,'
:
''
}
`
%>
v
.
createTime
?
formatTime
(
new
Date
(
v
.
createTime
+
EIGHT_HOURS
))
:
''
,
<%-
`
${
winnersExportData
.
includes
(
'中奖时间'
)
?
"v.createTime ? formatTime(new Date(v.createTime + EIGHT_HOURS)) : '',"
:
""
}
`
%>
v
.
type
==
3
?
(
v
.
receiveTime
?
formatTime
(
new
Date
(
v
.
receiveTime
+
EIGHT_HOURS
))
:
'暂未填写'
)
:
'/'
,
<%-
`
${
winnersExportData
.
includes
(
'地址填写时间'
)
?
"v.type == 3 ? (v.receiveTime ? formatTime(new Date(v.receiveTime + EIGHT_HOURS)) : '暂未填写') : '/',"
:
""
}
`
%>
prizeType
,
<%-
`
${
winnersExportData
.
includes
(
'奖品类型'
)
?
'prizeType,'
:
''
}
`
%>
prizeDataType
,
<%-
`
${
winnersExportData
.
includes
(
'发奖来源'
)
?
'prizeDataType,'
:
''
}
`
%>
v
.
type
==
2
?
`
${
v
.
credits
||
0
}
积分`
:
v
.
name
||
''
,
<%-
`
${
winnersExportData
.
includes
(
'奖品名称'
)
?
"v.type == 2 ? `${v.credits || 0}积分` : v.name || '',"
:
""
}
`
%>
v
.
type
==
3
?
v
.
receiveName
||
''
:
'/'
,
<%-
`
${
winnersExportData
.
includes
(
'收货人'
)
?
"v.type == 3 ? v.receiveName || '' : '/',"
:
""
}
`
%>
v
.
type
==
3
?
(
v
.
phone
?
v
.
phone
+
''
:
'暂未填写'
)
:
'/'
,
<%-
`
${
winnersExportData
.
includes
(
'联系方式'
)
?
"v.type == 3 ? (v.phone ? v.phone + '' : '暂未填写') : '/',"
:
""
}
`
%>
v
.
type
==
3
?
v
.
province
+
v
.
city
+
v
.
area
+
v
.
streetName
+
v
.
addressDetail
||
'暂未填写'
:
'/'
,
<%-
`
${
winnersExportData
.
includes
(
'收货地址'
)
?
"v.type == 3 ? v.province + v.city + v.area + v.streetName + v.addressDetail || '暂未填写' : '/',"
:
""
}
`
%>
shipTxt
,
<%-
`
${
winnersExportData
.
includes
(
'发货地址'
)
?
'shipTxt,'
:
''
}
`
%>
v
.
type
==
3
?
v
.
shipCompany
||
''
:
'/'
,
<%-
`
${
winnersExportData
.
includes
(
'物流公司'
)
?
"v.type == 3 ? v.shipCompany || '' : '/',"
:
""
}
`
%>
v
.
type
==
3
?
(
v
.
shipNum
?
v
.
shipNum
+
''
:
''
)
:
'/'
<%-
`
${
winnersExportData
.
includes
(
'物流单号'
)
?
"v.type == 3 ? (v.shipNum ? v.shipNum + '' : '') : '/'"
:
""
}
`
%>
])
])
})
})
let
buffer
=
xlsx
.
build
([
let
buffer
=
xlsx
.
build
([
...
...
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