...
|
...
|
@@ -11,10 +11,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 首页数据
|
|
|
*/
|
|
|
shareIndex(activityId, isApp, uid) {
|
|
|
shareIndex(activityId, isApp, uid, isStudent) {
|
|
|
|
|
|
return api.all([this._CouponInfo(activityId, uid), this._redeatList(), this._banner(),
|
|
|
this._checkStudent(uid)]).then(result => {
|
|
|
return api.all([this._CouponInfo(activityId, uid, isStudent), this._redeatList(),
|
|
|
this._banner()]).then(result => {
|
|
|
|
|
|
const indexData = {
|
|
|
newsFlash: []
|
...
|
...
|
@@ -23,9 +23,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
const rebeatUrl = '//m.yohobuy.com/activity/share-buy/my-rebeat',
|
|
|
strategyUrl = 'http://activity.yoho.cn/feature/115.html?share_id=2023&title=分享购攻略';
|
|
|
|
|
|
if (result[3]) {
|
|
|
indexData.isStudent = parseInt(result[3].isStudent, 10) === 1 ? true : false;
|
|
|
}
|
|
|
indexData.isStudent = isStudent;
|
|
|
|
|
|
if (result[0] && result[0].data && result[0].data.userCouponBoList) {
|
|
|
_.forEach(result[0].data.userCouponBoList, function(val) {
|
...
|
...
|
@@ -104,11 +102,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 首页获取优惠券信息
|
|
|
*/
|
|
|
_CouponInfo(activityId, uid) {
|
|
|
_CouponInfo(activityId, uid, isStudent) {
|
|
|
return api.get('', {
|
|
|
method: 'app.activity.getActivityCouponInfo',
|
|
|
activity_id: activityId,
|
|
|
uid: uid
|
|
|
uid: uid,
|
|
|
isStudent: isStudent
|
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
...
|
...
|
@@ -195,19 +194,19 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
/**
|
|
|
* 判断是不是学生
|
|
|
*/
|
|
|
_checkStudent(uid) {
|
|
|
checkStudent(uid) {
|
|
|
return api.get('', {
|
|
|
method: 'app.student.checkIsStudent',
|
|
|
uid: uid
|
|
|
}).then(result => {
|
|
|
|
|
|
let resu = {};
|
|
|
let isStudent;
|
|
|
|
|
|
if (result && result.data && result.code === 200) {
|
|
|
resu = result.data;
|
|
|
isStudent = parseInt(result.data.isStudent, 10) === 1 ? true : false;
|
|
|
}
|
|
|
|
|
|
return resu;
|
|
|
return isStudent;
|
|
|
|
|
|
});
|
|
|
}
|
...
|
...
|
|