...
|
...
|
@@ -2,6 +2,15 @@ const _ = require('lodash'); |
|
|
|
|
|
const {YOLUCK_LIST_TYPE, YoLuckService} = require('../models/yoluck-service');
|
|
|
|
|
|
function _handelErrorMessage(e) {
|
|
|
if (e && e.statusCode === 503) {
|
|
|
e.title = '人数过多。。。';
|
|
|
e.message = '目前参与人数过多请点击刷新';
|
|
|
}
|
|
|
|
|
|
return e;
|
|
|
}
|
|
|
|
|
|
function index(req, res, next) {
|
|
|
let type = +req.query.type || YOLUCK_LIST_TYPE.running;
|
|
|
let uid = req.user.uid;
|
...
|
...
|
@@ -17,7 +26,7 @@ function index(req, res, next) { |
|
|
`/signin.html?refer=//m.yohobuy.com/activity/yoluck/index.html?type=${YOLUCK_LIST_TYPE.joined}`
|
|
|
);
|
|
|
} else {
|
|
|
return next(result.error);
|
|
|
return Promise.reject(result.error);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -30,8 +39,7 @@ function index(req, res, next) { |
|
|
width750: true,
|
|
|
wechatShare: true
|
|
|
});
|
|
|
|
|
|
}).catch(next);
|
|
|
}).catch(e => next(_handelErrorMessage(e)));
|
|
|
}
|
|
|
|
|
|
function nextPage(req, res, next) {
|
...
|
...
|
@@ -82,7 +90,7 @@ function detail(req, res, next) { |
|
|
wechatShare: true
|
|
|
});
|
|
|
|
|
|
}).catch(next);
|
|
|
}).catch(e => next(_handelErrorMessage(e)));
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|