|
@@ -11,10 +11,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
@@ -11,10 +11,10 @@ module.exports = class extends global.yoho.BaseModel { |
11
|
/**
|
11
|
/**
|
12
|
* 首页数据
|
12
|
* 首页数据
|
13
|
*/
|
13
|
*/
|
14
|
- shareIndex(activityId, isApp, uid) {
|
14
|
+ shareIndex(activityId, isApp, uid, isStudent) {
|
15
|
|
15
|
|
16
|
- return api.all([this._CouponInfo(activityId, uid), this._redeatList(), this._banner(),
|
|
|
17
|
- this._checkStudent(uid)]).then(result => {
|
16
|
+ return api.all([this._CouponInfo(activityId, uid, isStudent), this._redeatList(),
|
|
|
17
|
+ this._banner()]).then(result => {
|
18
|
|
18
|
|
19
|
const indexData = {
|
19
|
const indexData = {
|
20
|
newsFlash: []
|
20
|
newsFlash: []
|
|
@@ -23,9 +23,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
@@ -23,9 +23,7 @@ module.exports = class extends global.yoho.BaseModel { |
23
|
const rebeatUrl = '//m.yohobuy.com/activity/share-buy/my-rebeat',
|
23
|
const rebeatUrl = '//m.yohobuy.com/activity/share-buy/my-rebeat',
|
24
|
strategyUrl = 'http://activity.yoho.cn/feature/115.html?share_id=2023&title=分享购攻略';
|
24
|
strategyUrl = 'http://activity.yoho.cn/feature/115.html?share_id=2023&title=分享购攻略';
|
25
|
|
25
|
|
26
|
- if (result[3]) {
|
|
|
27
|
- indexData.isStudent = parseInt(result[3].isStudent, 10) === 1 ? true : false;
|
|
|
28
|
- }
|
26
|
+ indexData.isStudent = isStudent;
|
29
|
|
27
|
|
30
|
if (result[0] && result[0].data && result[0].data.userCouponBoList) {
|
28
|
if (result[0] && result[0].data && result[0].data.userCouponBoList) {
|
31
|
_.forEach(result[0].data.userCouponBoList, function(val) {
|
29
|
_.forEach(result[0].data.userCouponBoList, function(val) {
|
|
@@ -104,11 +102,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
@@ -104,11 +102,12 @@ module.exports = class extends global.yoho.BaseModel { |
104
|
/**
|
102
|
/**
|
105
|
* 首页获取优惠券信息
|
103
|
* 首页获取优惠券信息
|
106
|
*/
|
104
|
*/
|
107
|
- _CouponInfo(activityId, uid) {
|
105
|
+ _CouponInfo(activityId, uid, isStudent) {
|
108
|
return api.get('', {
|
106
|
return api.get('', {
|
109
|
method: 'app.activity.getActivityCouponInfo',
|
107
|
method: 'app.activity.getActivityCouponInfo',
|
110
|
activity_id: activityId,
|
108
|
activity_id: activityId,
|
111
|
- uid: uid
|
109
|
+ uid: uid,
|
|
|
110
|
+ isStudent: isStudent
|
112
|
}, {
|
111
|
}, {
|
113
|
code: 200
|
112
|
code: 200
|
114
|
}).then((result) => {
|
113
|
}).then((result) => {
|
|
@@ -195,19 +194,19 @@ module.exports = class extends global.yoho.BaseModel { |
|
@@ -195,19 +194,19 @@ module.exports = class extends global.yoho.BaseModel { |
195
|
/**
|
194
|
/**
|
196
|
* 判断是不是学生
|
195
|
* 判断是不是学生
|
197
|
*/
|
196
|
*/
|
198
|
- _checkStudent(uid) {
|
197
|
+ checkStudent(uid) {
|
199
|
return api.get('', {
|
198
|
return api.get('', {
|
200
|
method: 'app.student.checkIsStudent',
|
199
|
method: 'app.student.checkIsStudent',
|
201
|
uid: uid
|
200
|
uid: uid
|
202
|
}).then(result => {
|
201
|
}).then(result => {
|
203
|
|
202
|
|
204
|
- let resu = {};
|
203
|
+ let isStudent;
|
205
|
|
204
|
|
206
|
if (result && result.data && result.code === 200) {
|
205
|
if (result && result.data && result.code === 200) {
|
207
|
- resu = result.data;
|
206
|
+ isStudent = parseInt(result.data.isStudent, 10) === 1 ? true : false;
|
208
|
}
|
207
|
}
|
209
|
|
208
|
|
210
|
- return resu;
|
209
|
+ return isStudent;
|
211
|
|
210
|
|
212
|
});
|
211
|
});
|
213
|
}
|
212
|
}
|