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
fb224db1
Commit
fb224db1
authored
Oct 08, 2020
by
李硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板错误内容修改
parent
760b0b33
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
36 deletions
+73
-36
rank-dialog.axml
client/components/dialog/rank-dialog/rank-dialog.axml
+9
-2
rank-dialog.js
client/components/dialog/rank-dialog/rank-dialog.js
+14
-10
awards.controller.js
server/duiba/controller/awards.controller.js
+42
-17
activitytop.service.js
server/duiba/service/activitytop.service.js
+3
-3
rankopenprize.service.js
server/duiba/service/rankopenprize.service.js
+5
-4
No files found.
client/components/dialog/rank-dialog/rank-dialog.axml
View file @
fb224db1
...
...
@@ -27,17 +27,24 @@
</form-item>
<form-item class="edit-content-formItem" label="发货状态" labelTextAlign="right">
<select onChange="onSelectShipStatus">
<option value="{{1}}">全部</option>
<option value="{{1}}">全部
实物
</option>
<option value="{{2}}">未发货</option>
<option value="{{3}}">已发货</option>
</select>
</form-item>
<form-item class="edit-content-formItem" label="奖品类型">
<select onChange="onSelectPrizeType">
<select
data-type="prizeType"
onChange="onSelectPrizeType">
<option value="{{1}}">优惠券</option>
<option value="{{3}}">实物</option>
</select>
</form-item>
<form-item class="edit-content-formItem" label="发奖来源">
<select data-type="prizeDataType" onChange="onSelectPrizeType">
<option value="{{1}}">排行榜</option>
<option value="{{2}}">抽奖</option>
<option value="{{3}}">大转盘</option>
</select>
</form-item>
</form>
<view a:if="{{isSearch}}" style="textAlign:right">
...
...
client/components/dialog/rank-dialog/rank-dialog.js
View file @
fb224db1
...
...
@@ -51,7 +51,7 @@ Component({
{
title
:
'发奖时间'
,
prop
:
'createTime'
},
{
title
:
'填地址时间'
,
prop
:
'receiveTime'
},
{
title
:
'用户昵称'
,
prop
:
'userNick'
},
{
title
:
'
奖池类型
'
,
prop
:
'prizeDataType'
},
{
title
:
'
发奖来源
'
,
prop
:
'prizeDataType'
},
{
title
:
'奖品类型'
,
prop
:
'type'
},
{
title
:
'奖品名'
,
prop
:
'prizeName'
},
{
title
:
'收货人'
,
prop
:
'receiveName'
},
...
...
@@ -76,6 +76,7 @@ Component({
shipStatus
:
""
,
timeRange
:
[],
prizeType
:
""
,
prizeDataType
:
""
,
showShip
:
false
,
winactivityId
:
""
,
pageNo
:
PageInfo
.
PAGE_NO
,
...
...
@@ -109,6 +110,7 @@ Component({
timeRange
:
[],
shipStatus
:
""
,
prizeType
:
""
,
prizeDataType
:
""
,
pageNo
:
PageInfo
.
PAGE_NO
,
pageSize
:
PageInfo
.
PAGE_SIZE
,
total
:
0
,
...
...
@@ -186,10 +188,10 @@ Component({
},
async
exportWinnerListBySearch
(
evt
)
{
const
{
activityId
,
title
}
=
this
.
props
.
selectedItem
;
let
{
prizeId
,
userId
,
startT
,
endT
,
shipStatus
,
pageNo
,
pageSize
,
prizeType
}
=
this
.
data
;
let
{
prizeId
,
userId
,
startT
,
endT
,
shipStatus
,
pageNo
,
pageSize
,
prizeType
,
prizeDataType
}
=
this
.
data
;
let
timeStart
=
this
.
timeExchange
(
startT
);
let
timeEnd
=
this
.
timeExchange
(
endT
);
if
(
prizeId
||
userId
||
(
timeStart
&&
timeEnd
)
||
shipStatus
||
prizeType
)
{
if
(
prizeId
||
userId
||
(
timeStart
&&
timeEnd
)
||
shipStatus
||
prizeType
||
prizeDataType
)
{
try
{
console
.
log
(
"导出名单数据接口"
);
const
{
success
,
data
,
message
}
=
await
exportAwardsInfoBySearch
({
...
...
@@ -201,7 +203,8 @@ Component({
timeStart
,
timeEnd
,
shipStatus
,
prizeType
prizeType
,
prizeDataType
});
if
(
success
)
{
if
(
!
data
)
{
...
...
@@ -258,12 +261,12 @@ Component({
// 《条件搜索》搜索
async
onChangeSearch
()
{
const
{
activityId
,
title
}
=
this
.
props
.
selectedItem
;
let
{
prizeId
,
userId
,
startT
,
endT
,
pageNo
,
pageSize
,
shipStatus
,
prizeType
}
=
this
.
data
;
let
{
prizeId
,
userId
,
startT
,
endT
,
pageNo
,
pageSize
,
shipStatus
,
prizeType
,
prizeDataType
}
=
this
.
data
;
let
timeStart
=
this
.
timeExchange
(
startT
);
let
timeEnd
=
this
.
timeExchange
(
endT
);
console
.
log
(
prizeId
,
userId
,
timeStart
,
timeEnd
,
pageNo
,
pageSize
,
shipStatus
,
prizeType
);
if
(
prizeId
||
userId
||
(
timeStart
&&
timeEnd
)
||
shipStatus
===
0
||
shipStatus
||
prizeType
>
0
)
{
let
rewardList
=
await
findWinnerInfoListBySearch
({
activityId
,
pageNo
,
pageSize
,
title
,
prizeId
,
userId
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
});
console
.
log
(
prizeId
,
userId
,
timeStart
,
timeEnd
,
pageNo
,
pageSize
,
shipStatus
,
prizeType
,
prizeDataType
);
if
(
prizeId
||
userId
||
(
timeStart
&&
timeEnd
)
||
shipStatus
===
0
||
shipStatus
||
prizeType
||
prizeDataType
)
{
let
rewardList
=
await
findWinnerInfoListBySearch
({
activityId
,
pageNo
,
pageSize
,
title
,
prizeId
,
userId
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
});
if
(
rewardList
.
data
.
list
.
length
==
0
)
{
this
.
setData
({
list
:
[],
...
...
@@ -326,14 +329,15 @@ Component({
},
// 《条件搜索》奖品类型筛选
onSelectPrizeType
(
e
)
{
let
{
type
}
=
e
.
target
.
dataset
;
console
.
log
(
'筛选奖品类型e>>>'
,
e
);
this
.
setData
({
prizeType
:
e
.
detail
.
value
,
[
type
]
:
e
.
detail
.
value
,
pageNo
:
PageInfo
.
PAGE_NO
,
pageSize
:
PageInfo
.
PAGE_SIZE
,
total
:
0
,
});
console
.
log
(
"type"
,
this
.
data
.
prizeType
);
console
.
log
(
"type"
,
this
.
data
[
type
]
);
},
// 《条件搜索》更换页码时调用接口
onChangePageNo
(
e
)
{
...
...
server/duiba/controller/awards.controller.js
View file @
fb224db1
...
...
@@ -60,7 +60,7 @@ const findWinnerInfoList = async (context) => {
// );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
address
d
etail
,
type0
=
item
.
type
;
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
address
D
etail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
))
:
'未填'
;
...
...
@@ -109,7 +109,7 @@ const exportAwardsList = async (context) => {
"中奖时间"
,
"地址填写时间"
,
"用户昵称"
,
"
奖品种类
"
,
"
发奖来源
"
,
"奖品类型"
,
"中奖名称"
,
"收货人"
,
...
...
@@ -136,7 +136,7 @@ const exportAwardsList = async (context) => {
v
.
prizeName
||
""
,
v
.
type
==
1
?
"/"
:
v
.
receiveName
||
""
,
v
.
type
==
1
?
"/"
:
v
.
phone
||
"未填"
,
v
.
type
==
1
?
"/"
:
(
v
.
province
?
v
.
province
+
v
.
city
+
v
.
area
+
v
.
address
d
etail
:
"未填"
),
v
.
type
==
1
?
"/"
:
(
v
.
province
?
v
.
province
+
v
.
city
+
v
.
area
+
v
.
address
D
etail
:
"未填"
),
v
.
type
==
1
?
"/"
:
shipMsg
[
v
.
shipStatus
],
v
.
type
==
1
?
"/"
:
v
.
shipCompany
||
"/"
,
v
.
type
==
1
?
"/"
:
v
.
shipNum
||
"/"
,
...
...
@@ -171,7 +171,7 @@ const exportAwardsList = async (context) => {
const
exportAwardsInfoBySearch
=
async
(
context
)
=>
{
/******VV */
let
{
cloud
}
=
context
;
let
{
activityId
,
title
,
prizeId
,
userId
:
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
}
=
context
.
data
;
let
{
activityId
,
title
,
prizeId
,
userId
:
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
}
=
context
.
data
;
if
(
!
activityId
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`缺少activityId`
);
}
...
...
@@ -179,7 +179,7 @@ const exportAwardsInfoBySearch = async (context) => {
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`缺少title`
);
}
console
.
log
(
"prizeId====="
,
prizeId
);
if
(
!
prizeId
&&
!
userNick
&&
!
timeStart
&&
!
timeEnd
&&
!
shipStatus
&&
!
prizeType
)
{
if
(
!
prizeId
&&
!
userNick
&&
!
timeStart
&&
!
timeEnd
&&
!
shipStatus
&&
!
prizeType
&&
!
prizeDataType
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`未填写筛选信息`
);
}
console
.
log
(
"activityId--1--"
,
activityId
,
"prizeId--1-"
,
prizeId
,
"userNick--1-"
,
userNick
,
"timeStart--1-"
,
timeStart
,
"timeEnd--1-"
,
timeEnd
);
...
...
@@ -187,7 +187,15 @@ const exportAwardsInfoBySearch = async (context) => {
/*******/
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
// 获取活动中奖列表
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
);
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
let
awardslist
=
[];
//导出中奖名单的pagesize和pageNo
let
pageSize0
=
500
;
...
...
@@ -198,15 +206,30 @@ const exportAwardsInfoBySearch = async (context) => {
pageNo
=
i
;
let
awardMore
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
pageSize0
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
pageNo
,
pageSize0
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
awardslist
=
awardslist
.
concat
(
awardMore
);
}
}
else
{
awardslist
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
total
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
pageNo
,
total
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
}
console
.
log
(
`awardslist:》》》
${
JSON
.
stringify
(
awardslist
)}
《《《`
);
...
...
@@ -218,7 +241,7 @@ const exportAwardsInfoBySearch = async (context) => {
"中奖时间"
,
"地址填写时间"
,
"用户昵称"
,
"
奖品种类
"
,
"
发奖来源
"
,
"奖品类型"
,
"中奖名称"
,
"收货人"
,
...
...
@@ -245,7 +268,7 @@ const exportAwardsInfoBySearch = async (context) => {
v
.
prizeName
||
""
,
v
.
type
==
1
?
"/"
:
v
.
receiveName
||
""
,
v
.
type
==
1
?
"/"
:
v
.
phone
||
"未填"
,
v
.
type
==
1
?
"/"
:
(
v
.
province
?
v
.
province
+
v
.
city
+
v
.
area
+
v
.
address
d
etail
:
"未填"
),
v
.
type
==
1
?
"/"
:
(
v
.
province
?
v
.
province
+
v
.
city
+
v
.
area
+
v
.
address
D
etail
:
"未填"
),
v
.
type
==
1
?
"/"
:
shipMsg
[
v
.
shipStatus
],
v
.
type
==
1
?
"/"
:
v
.
shipCompany
||
"/"
,
v
.
type
==
1
?
"/"
:
v
.
shipNum
||
"/"
,
...
...
@@ -280,7 +303,7 @@ const exportAwardsInfoBySearch = async (context) => {
//筛选中奖名单
const
findWinnerInfoListBySearch
=
async
(
context
)
=>
{
let
{
cloud
}
=
context
;
let
{
activityId
,
title
,
pageNo
,
pageSize
,
prizeId
,
userId
:
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
}
=
context
.
data
;
let
{
activityId
,
title
,
pageNo
,
pageSize
,
prizeId
,
userId
:
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
}
=
context
.
data
;
console
.
log
(
'data>>>>>'
,
context
.
data
)
if
(
!
activityId
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`缺少activityId`
);
...
...
@@ -289,13 +312,13 @@ const findWinnerInfoListBySearch = async (context) => {
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`缺少title`
);
}
console
.
log
(
"prizeId====="
,
prizeId
);
if
(
!
prizeId
&&
!
userNick
&&
!
timeStart
&&
!
timeEnd
&&
!
shipStatus
&&
!
prizeType
)
{
if
(
!
prizeId
&&
!
userNick
&&
!
timeStart
&&
!
timeEnd
&&
!
shipStatus
&&
!
prizeType
&&
!
prizeDataType
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`未填写筛选信息`
);
}
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
console
.
log
(
"activityId----"
,
activityId
,
"prizeId---"
,
prizeId
,
"userNick---"
,
userNick
,
"timeStart---"
,
timeStart
,
"timeEnd---"
,
timeEnd
,
shipStatus
);
// 获取活动中奖列表
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
);
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
console
.
log
(
"totle========="
,
total
);
let
awardslist
=
[];
if
(
total
>
10
)
{
...
...
@@ -309,7 +332,8 @@ const findWinnerInfoListBySearch = async (context) => {
timeStart
,
timeEnd
,
shipStatus
,
prizeType
prizeType
,
prizeDataType
);
// console.list()
awardslist
=
awardslist
.
concat
(
awardMore
);
...
...
@@ -323,13 +347,14 @@ const findWinnerInfoListBySearch = async (context) => {
timeStart
,
timeEnd
,
shipStatus
,
prizeType
prizeType
,
prizeDataType
);
console
.
log
(
'awardslist>>>>'
,
awardslist
)
}
console
.
log
(
`awardslist:》》》
${
JSON
.
stringify
(
awardslist
)}
《《《`
);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
address
d
etail
,
type0
=
item
.
type
;
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
address
D
etail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
))
:
'未填'
;
...
...
server/duiba/service/activitytop.service.js
View file @
fb224db1
...
...
@@ -58,7 +58,7 @@ class ActivityTopService {
let
result
=
await
this
.
activitySellerDao
.
find
({
openId
,
});
return
{
session
:(
result
.
length
&&
result
[
0
].
accessToken
)
||
this
.
context
.
accessToken
};
return
{
session
:
(
result
.
length
&&
result
[
0
].
accessToken
)
||
this
.
context
.
accessToken
};
}
//淘宝top接口获取商品列表
...
...
@@ -238,9 +238,9 @@ class ActivityTopService {
}
=
this
.
context
.
data
;
let
data
=
{
fields
:
GOODSINFO
,
page
_no
:
page
No
,
pageNo
,
q
:
title
,
page
_size
:
page
Size
,
pageSize
,
...
sellerConfig
,
};
console
.
log
(
data
,
"data"
);
...
...
server/duiba/service/rankopenprize.service.js
View file @
fb224db1
...
...
@@ -70,7 +70,8 @@ class RankopenprizeService {
)
:
''
;
let
t
=
type
?
{
type
:
+
type
}
:
''
;
let
arr
=
[
p
,
u
,
c
,
s
,
t
];
let
d
=
prizeDataType
?
{
prizeDataType
:
+
prizeDataType
}
:
''
;
let
arr
=
[
p
,
u
,
c
,
s
,
t
,
d
];
arr
=
arr
.
filter
((
i
)
=>
{
return
i
});
console
.
log
(
'arr--222---'
,
arr
);
return
await
this
.
rankopenprizeDao
.
find
(
...
...
@@ -100,9 +101,9 @@ class RankopenprizeService {
)
)
:
''
;
let
t
=
type
?
{
type
:
+
type
}
:
''
let
arr
=
[
p
,
u
,
c
,
s
,
t
]
;
arr
=
arr
.
filter
((
i
)
=>
{
return
i
})
;
let
t
=
type
?
{
type
:
+
type
}
:
''
;
let
d
=
prizeDataType
?
{
prizeDataType
:
+
prizeDataType
}
:
''
;
let
arr
=
[
p
,
u
,
c
,
s
,
t
,
d
]
;
console
.
log
(
'arr--111---'
,
arr
,
"s>>>"
,
s
);
return
await
this
.
rankopenprizeDao
.
count
({
activityId
,
...
...
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