Authored by 沈志敏

fix bug

... ... @@ -14,15 +14,14 @@ exports.index = (req, res, next) => {
}
var param = {
contentCode: req.query.code,
app_version: req.query.app_version
contentCode: req.query.code
};
if (uid) {
param.uid = uid;
}
model.floor(param, req.yoho.isApp).then(result => {
model.floor(param, req.yoho.isApp, req.query.app_version).then(result => {
res.render('coupon-floor', {
module: 'activity',
page: 'coupon-floor',
... ...
... ... @@ -205,7 +205,7 @@ const processFun = {
},
};
const _getContent = (data, params, isApp) => {
const _getContent = (data, params, isApp, appVersion) => {
let result = [],
build = [];
... ... @@ -221,7 +221,7 @@ const _getContent = (data, params, isApp) => {
const playUrl = helpers.urlFormat('/activity/coupon/floor');
if (isApp) {
const playUrlEncode = `${playUrl}?code=${params.contentCode}&app_version=${params.app_version}`.replace(/\//g, '\\\/');
const playUrlEncode = `${playUrl}?code=${params.contentCode}&app_version=${appVersion}`.replace(/\//g, '\\\/');
noLoginUrl = `${playUrl}?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:${playUrlEncode}","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}`;
} else {
... ... @@ -264,7 +264,7 @@ const _getContent = (data, params, isApp) => {
return result;
};
exports.floor = (params, isApp) => {
exports.floor = (params, isApp, appVersion) => {
return Promise.coroutine(function*() {
let result = {},
resource = yield api.get('', Object.assign(params, {
... ... @@ -272,7 +272,7 @@ exports.floor = (params, isApp) => {
}));
if (resource && resource.code === 200) {
result = _getContent(resource.data, params, isApp);
result = _getContent(resource.data, params, isApp, appVersion);
} else {
result.noData = true;
}
... ...