Authored by baoss

fix confilicts

... ... @@ -78,9 +78,54 @@ function progress(req, res, next) {
}).catch(next);
}
function goodsDetail(req, res, next) {
req.ctx(GroupService).goodsDetail()
.then(result => {
return res.render('group/goodsDetail', {
title: '商品详情',
page: 'group-goodsDetail',
localCss: true,
nodownload: true,
width750: true,
wechatShare: true,
result
});
}).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,
<<
<< << < HEAD
groupListIndex,
groupList,
progress
progress ===
=== =
progress,
goodsDetail,
order >>>
>>> > feature / group - buy
};
... ...
... ... @@ -3,6 +3,12 @@ class GroupApi extends global.yoho.BaseModel {
super(ctx);
}
/**
* 资源位获取
* @param param
* @returns {Promise|Promise<T>}
* @private
*/
_getResourceCode(param) {
return this.get({
url: 'operations/api/v5/resource/get',
... ... @@ -73,6 +79,61 @@ class GroupApi extends global.yoho.BaseModel {
}));
}
/**
* 拼团详情
* @param groupNo
* @returns {Promise|Promise<T>}
*/
groupDetail({groupNo} = {}) {
return this.get({
url: '',
data: {
method: 'app.activity.groupDetail',
groupNo: groupNo
},
param: {code: 200}
}).then((result) => {
result = result.data;
return result;
});
}
/**
* 活动拼团商品推荐
* @param activityId
* @returns {Promise|Promise<T>}
*/
activityRecomend({activityId} = {}) {
return this.get({
url: '',
data: {
method: 'app.collage.productList.detail',
activityId: activityId
},
param: {code: 200}
}).then((result) => {
result = result.data;
return result;
});
}
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;
... ...
... ... @@ -18,6 +18,7 @@ class GroupService extends global.yoho.BaseModel {
throw new Error('Group index fail to load resources.');
}
}
async tabData() {
const result = await this.api._getPromoteCount();
let tabsData = {};
... ... @@ -30,6 +31,7 @@ class GroupService extends global.yoho.BaseModel {
}
return tabsData;
}
async filterGroupList(params) {
const initParams = {
page: 1,
... ... @@ -92,6 +94,30 @@ class GroupService extends global.yoho.BaseModel {
throw new Error('Group list fail to load resources.');
}
}
async goodsDetail() {
// 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,6 +369,8 @@ router.post('/yoluck/detail/mylist.html', yoluck.getActivityCodeList);
router.get('/group', group.index); // 拼团首页
router.get('/group/list', group.groupListIndex); // 拼团列表页
router.get('/group/goods-list', group.groupList); // 拼团列表
router.get('/group/progress', auth, group.progress); // 拼团详情页
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>
... ...
<div class="group-progress">
拼团详情
<div class="card">
<div class="inner-card">
<img
src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="card-pre-img">
</div>
<a class="tip" href="http://m.yohobuy.com/activity/group">支付开团-支付参团-凑齐人数发货-凑不齐退款 玩法介绍》</a>
</div>
<div class="divide"></div>
<div class="banner"></div>
<div class="divide zero-margin"></div>
<div class="recommend">
<p class="rec-title">看看其他拼团商品</p>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
<div class="product-item">
<img src="http://img13.static.yhbimg.com/goodsimg/2015/08/13/03/0294746e1d4e614c28dc8736dfca66d173.jpg?imageMogr2/thumbnail/200x284/background/d2hpdGU=/position/center/quality/80" alt="" class="prd-item-img">
</div>
</div>
</div>
... ...
import 'scss/activity/group/group-order.page.scss';
... ...
.group {
.bottom {
position: fixed;
right: 0;
bottom: 0;
.group-progress {
padding-top: 168px;
.card {
position: relative;
width: 680px;
height: 690px;
margin: 0 auto;
background: #fff;
box-shadow: 0 10px 32px -4px rgba(205, 205, 205, 0.5);
}
.inner-card {
position: absolute;
left: 44px;
top: -140px;
width: 600px;
height: 282px;
background: #fff;
box-shadow: 0 10px 20px -4px rgba(0, 0, 0, 0.17);
}
.inner-card .card-pre-img {
position: absolute;
top: 0;
left: 0;
text-align: center;
height: 90px;
line-height: 90px;
font-size: 28px;
width: 200px;
height: 282px;
}
.tip {
position: absolute;
right: 0;
bottom: 40px;
left: 28px;
font-size: 24px;
color: #b0b0b0;
letter-spacing: -0.68px;
}
.divide {
height: 16px;
margin-top: 38px;
background: #f0f0f0;
&.zero-margin {
margin: 0;
}
}
.banner {
width: 750px;
height: 140px;
background-image: url("https://cdn.yoho.cn/miniapp/group/banner1.jpeg");
background-size: 750px 140px;
}
.rec-title {
padding: 20px 0 40px 0;
font-size: 32px;
color: #444;
border-top: 1px solid #e0e0e0;
letter-spacing: -0.44px;
font-weight: bold;
text-align: center;
}
.product-item {
position: relative;
height: 260px;
width: 680px;
margin: 0 auto 40px auto;
.prd-item-img {
position: absolute;
top: 0;
left: 0;
height: 260px;
width: 200px;
}
}
}
... ...