Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
QC-L
2019-02-12 14:36:12 +0800
Commit
f5e8d7285cd90016feed4f2b6c965560268c14c4
1 parent
5cca9a9b
添加我的拼团路由相关
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
4 deletions
apps/activity/controllers/group.js
apps/activity/models/group-api.js
apps/activity/models/group-service.js
apps/activity/router.js
apps/activity/views/action/group/order.hbs
public/js/activity/group-order.page.js
public/scss/activity/group/group-order.page.scss
yarn.lock
apps/activity/controllers/group.js
View file @
f5e8d72
...
...
@@ -46,9 +46,32 @@ function goodsDetail(req, res, next) {
});
}).
catch
(
next
);
}
function
order
(
req
,
res
,
next
)
{
const
uid
=
req
.
user
.
uid
.
toString
();
const
param
=
{
page
:
1
,
limit
:
50
,
type
:
2
,
uid
};
req
.
ctx
(
GroupService
).
order
(
param
)
.
then
(
result
=>
{
return
res
.
render
(
'group/order'
,
{
title
:
'我的拼团'
,
page
:
'group-order'
,
localCss
:
true
,
nodownload
:
true
,
width750
:
true
,
wechatShare
:
true
,
result
});
}).
catch
(
next
);
}
module
.
exports
=
{
index
,
progress
,
goodsDetail
goodsDetail
,
order
};
...
...
apps/activity/models/group-api.js
View file @
f5e8d72
...
...
@@ -64,6 +64,21 @@ class GroupApi extends global.yoho.BaseModel {
});
}
getOrderList
(
param
)
{
return
this
.
get
({
url
:
''
,
data
:
{
method
:
'app.SpaceOrders.getGroupOrders'
,
business_line
:
'miniappGroup'
,
...
param
},
}).
then
(
result
=>
{
result
=
result
.
data
;
return
result
;
}).
catch
(
error
=>
{
console
.
log
(
error
);
});
}
}
module
.
exports
=
GroupApi
;
...
...
apps/activity/models/group-service.js
View file @
f5e8d72
...
...
@@ -22,6 +22,21 @@ class GroupService extends global.yoho.BaseModel {
// const goodsDetail = await this.api._getGoodsInfo({})
return
{};
}
async
order
({
type
,
page
,
limit
})
{
try
{
const
result
=
await
this
.
api
.
getOrderList
({
limit
,
page
,
type
});
console
.
log
(
result
);
return
result
;
}
catch
(
error
)
{
throw
new
Error
(
'Group order fail to load resources.'
);
}
}
}
module
.
exports
=
{
...
...
apps/activity/router.js
View file @
f5e8d72
...
...
@@ -369,5 +369,6 @@ router.post('/yoluck/detail/mylist.html', yoluck.getActivityCodeList);
router
.
get
(
'/group'
,
group
.
index
);
// 拼团首页
router
.
get
(
'/group/progress'
,
auth
,
group
.
progress
);
// 拼团状态详情页
router
.
get
(
'/group/goodsDetail/:id'
,
group
.
goodsDetail
);
router
.
get
(
'/group/order'
,
auth
,
group
.
order
);
// 我的拼团
module
.
exports
=
router
;
...
...
apps/activity/views/action/group/order.hbs
0 → 100644
View file @
f5e8d72
<div
class=
"group-order"
>
我的拼团
</div>
...
...
public/js/activity/group-order.page.js
0 → 100644
View file @
f5e8d72
import
'scss/activity/group/group-order.page.scss'
;
...
...
public/scss/activity/group/group-order.page.scss
0 → 100644
View file @
f5e8d72
yarn.lock
View file @
f5e8d72
...
...
@@ -11056,9 +11056,10 @@ yo-cli@=2.1.9:
webpack-merge "^4.1.1"
yargs "^10.0.3"
yoho-activity-sdk@1.1.2:
version "1.1.2"
resolved "http://npm.yohops.com/yoho-activity-sdk/-/yoho-activity-sdk-1.1.2.tgz#47870af1221ad1bfb8cbb9cbc8dd4d70c5eb28bf"
yoho-activity-sdk@1.1.3:
version "1.1.3"
resolved "http://npm.yohops.com/yoho-activity-sdk/-/yoho-activity-sdk-1.1.3.tgz#14a8a952e1fd68cc7c167f1e6336d67262d55ba6"
integrity sha512-XbE6K/Ioid0Uguyf+2zdmFPgVALB9Ozsei1JLpp7MZhZNlVALQ0sER/L5sOQdZqIrtBmTiplur7u2pgaXl374g==
yoho-cookie@^1.2.0:
version "1.2.0"
...
...
Please
register
or
login
to post a comment