...
|
...
|
@@ -10,13 +10,16 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 首页数据
|
|
|
*/
|
|
|
shareIndex(activityId) {
|
|
|
shareIndex(activityId, isApp) {
|
|
|
|
|
|
return api.all([this._CouponInfo(activityId), this._redeatList()]).then(result => {
|
|
|
const indexData = {
|
|
|
newsFlash: []
|
|
|
};
|
|
|
|
|
|
const rebeatUrl = '//m.yohobuy.com/activity/share-buy/my-rebeat',
|
|
|
strategyUrl = 'http://activity.yoho.cn/feature/115.html?share_id=2023&title=分享购攻略';
|
|
|
|
|
|
if (result[0] && result[0].data && result[0].data.userCouponBoList) {
|
|
|
_.forEach(result[0].data.userCouponBoList, function(val) {
|
|
|
|
...
|
...
|
@@ -34,12 +37,20 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
val.detailDes = val.shareCoupon;
|
|
|
}
|
|
|
|
|
|
|
|
|
val.detailUrl = helpers.urlFormat('/activity/share-buy/detail', {
|
|
|
counum: val.couponValue,
|
|
|
couponType: val.shareCouponType,
|
|
|
detailDes: val.detailDes,
|
|
|
couponId: val.couponId
|
|
|
});
|
|
|
|
|
|
if (isApp) {
|
|
|
val.detailUrl = val.detailUrl +
|
|
|
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http://m.yohobuy.com/activity/share-buy/detail","params":{"counum":"' +
|
|
|
val.couponValue + '","couponType":"' + val.shareCouponType + '","detailDes":"' +
|
|
|
val.detailDes + '","couponId":"' + val.couponId + '"}}}';
|
|
|
}
|
|
|
});
|
|
|
|
|
|
indexData.userCouponBoList = result[0].data.userCouponBoList;
|
...
|
...
|
@@ -53,6 +64,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
});
|
|
|
}
|
|
|
|
|
|
indexData.rebeatUrl = isApp ? rebeatUrl +
|
|
|
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + rebeatUrl + '"}}' : rebeatUrl;
|
|
|
|
|
|
indexData.strategyUrl = isApp ? strategyUrl +
|
|
|
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + strategyUrl + '"}}' : strategyUrl;
|
|
|
|
|
|
return indexData;
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -92,7 +109,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 优惠详情页数据
|
|
|
*/
|
|
|
shareDetail(uid, param) {
|
|
|
shareDetail(uid, param, isApp) {
|
|
|
return api.get('', {
|
|
|
method: 'app.activity.getActivityCouponCode',
|
|
|
uid: uid,
|
...
|
...
|
@@ -110,6 +127,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
title: '优惠活动商品'
|
|
|
}, 'list');
|
|
|
|
|
|
result.data = _.assign(result.data, {
|
|
|
isApp: isApp ? true : false
|
|
|
});
|
|
|
|
|
|
result.data.finish = parseInt(result.data.expiredTime, 10) > 0 ? false : true;
|
|
|
|
|
|
return result.data;
|
|
|
} else {
|
|
|
return {};
|
...
|
...
|
@@ -121,13 +144,15 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 我的返利页数据
|
|
|
*/
|
|
|
myRebeat(uid) {
|
|
|
myRebeat(uid, isApp) {
|
|
|
return api.get('', {
|
|
|
method: 'app.yohocoinrebeat.detail',
|
|
|
uid: uid
|
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
|
|
let currencyUrl = 'http://m.yohobuy.com/home/helpDetail?code=20151230-102233&caption=有货币介绍&name=有货币介绍';
|
|
|
let shareUrl = 'http://m.yohobuy.com/activity/share-buy';
|
|
|
|
|
|
if (result && result.code === 200 && result.data) {
|
|
|
let dateTime;
|
...
|
...
|
@@ -142,6 +167,14 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
'.' + dateTime.getDate();
|
|
|
});
|
|
|
|
|
|
result.data.currencyUrl = isApp ? currencyUrl +
|
|
|
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
|
|
|
currencyUrl + '"}}' : currencyUrl;
|
|
|
|
|
|
result.data.shareUrl = isApp ? shareUrl +
|
|
|
'?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
|
|
|
shareUrl + '"}}' : shareUrl;
|
|
|
|
|
|
return result.data;
|
|
|
} else {
|
|
|
return {};
|
...
|
...
|
|