Authored by QC-L

添加我的拼团路由相关

... ... @@ -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
};
... ...
... ... @@ -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;
... ...
... ... @@ -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 = {
... ...
... ... @@ -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;
... ...
<div class="group-order">
我的拼团
</div>
... ...
import 'scss/activity/group/group-order.page.scss';
... ...
... ... @@ -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"
... ...