...
|
...
|
@@ -184,14 +184,13 @@ class GroupService extends global.yoho.BaseModel { |
|
|
|
|
|
result.activityIdDetail = await this.api.getCollageProductInfo(params);
|
|
|
result.activityGroupDetailList = await this.api.fetchActivityGroups(params);
|
|
|
for (let item of result.activityGroupDetailList) {
|
|
|
item.formatLeftTime = this.formatDate(item.leftTime);
|
|
|
}
|
|
|
result.introUrl = '/product/detail/intro/' + params.productSkn;
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
getJoinList(params) {
|
|
|
return this.api.fetchActivityGroups(params);
|
|
|
}
|
|
|
|
|
|
async order({
|
|
|
type,
|
|
|
page,
|
...
|
...
|
@@ -212,6 +211,26 @@ class GroupService extends global.yoho.BaseModel { |
|
|
throw new Error('Group order fail to load resources.');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
add0(m) {
|
|
|
return m < 10 ? '0' + m : m;
|
|
|
}
|
|
|
|
|
|
formatDate(shijianchuo) {
|
|
|
// 秒数
|
|
|
let second = Math.floor(shijianchuo);
|
|
|
|
|
|
// 小时位
|
|
|
let hr = Math.floor(second / 3600);
|
|
|
|
|
|
// 分钟位
|
|
|
let min = Math.floor((second - hr * 3600) / 60);
|
|
|
|
|
|
// 秒位
|
|
|
let sec = (second - hr * 3600 - min * 60);
|
|
|
|
|
|
return this.add0(hr) + ':' + this.add0(min) + ':' + this.add0(sec);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
|