Authored by yyq

Merge branch 'hotfix/shopCoupon' into gray

@@ -183,8 +183,8 @@ exports.isFavoriteBrand = (req, res, next) => { @@ -183,8 +183,8 @@ exports.isFavoriteBrand = (req, res, next) => {
183 return next(); 183 return next();
184 } 184 }
185 185
186 - if (!req.body.brandId || !uid) {  
187 - return res.json({code: 400, message: '用户未登录或缺少参数'}); 186 + if (!req.body.brandId) {
  187 + return res.json({code: 400, message: '缺少参数'});
188 } 188 }
189 189
190 req.ctx(searchApi).isFavoriteBrand(uid, brandId).then(result => { 190 req.ctx(searchApi).isFavoriteBrand(uid, brandId).then(result => {
@@ -207,8 +207,8 @@ exports.shopCouponSync = (req, res, next) => { @@ -207,8 +207,8 @@ exports.shopCouponSync = (req, res, next) => {
207 return next(); 207 return next();
208 } 208 }
209 209
210 - if (!id || !uid) {  
211 - return res.json({code: 400, message: '用户未登录或缺少参数'}); 210 + if (!id) {
  211 + return res.json({code: 400, message: '缺少参数'});
212 } 212 }
213 213
214 req.ctx(list).getUserCoupunStatus(id, uid, 'shop').then(result => { 214 req.ctx(list).getUserCoupunStatus(id, uid, 'shop').then(result => {
@@ -137,18 +137,18 @@ function syncCouponStatus() { @@ -137,18 +137,18 @@ function syncCouponStatus() {
137 for (i = 0; i < info.length; i++) { 137 for (i = 0; i < info.length; i++) {
138 asyncObj[info[i].coupon_id] = info[i]; 138 asyncObj[info[i].coupon_id] = info[i];
139 } 139 }
140 - }  
141 -  
142 - for (i in couponObj) {  
143 - if (couponObj.hasOwnProperty(i)) {  
144 - coup = asyncObj[i];  
145 140
146 - if (coup && (coup.status === 1 || coup.status === 3)) {  
147 - couponObj[i].status = coup.status;  
148 - coup.status === 3 ? setPicked(couponObj[i]) : false;  
149 - } else {  
150 - couponObj[i].status = 2; // 券不存在设置领取状态为已抢光  
151 - couponObj[i].dom.text('已抢光'); 141 + for (i in couponObj) {
  142 + if (couponObj.hasOwnProperty(i)) {
  143 + coup = asyncObj[i];
  144 +
  145 + if (coup && (coup.status === 1 || coup.status === 3)) {
  146 + couponObj[i].status = coup.status;
  147 + coup.status === 3 ? setPicked(couponObj[i]) : false;
  148 + } else {
  149 + couponObj[i].status = 2; // 券不存在设置领取状态为已抢光
  150 + couponObj[i].dom.text('已抢光');
  151 + }
152 } 152 }
153 } 153 }
154 } 154 }