Authored by zhangxiaoru

guang

... ... @@ -60,7 +60,7 @@ const editor = (req, res, next) => {
} else {
return next();
}
}).catch(next);
};
... ... @@ -178,7 +178,7 @@ const tag = (req, res, next) => {
};
responseData.pageHeader.navTitle = param.tag || '标签';
... ... @@ -192,49 +192,49 @@ const tag = (req, res, next) => {
* @param req
* @param res
*/
const listDynamicData = (req, res) => {
let ids = req.query.ids;
let udid = req.sessionID;
let other = {};
let query = req.query.query,
type = req.query.type;
if (req.user.uid) {
other.uid = req.user.uid;
}
if (query) {
other.query = query;
}
if (type) {
other.type = type;
}
indexModel.getDynamicDataByIds(ids, udid, other).then(ret => {
res.send(ret);
});
};
const listDynamicData = (req, res) => {
let ids = req.query.ids;
let udid = req.sessionID;
let other = {};
let query = req.query.query,
type = req.query.type;
if (req.user.uid) {
other.uid = req.user.uid;
}
if (query) {
other.query = query;
}
if (type) {
other.type = type;
}
indexModel.getDynamicDataByIds(ids, udid, other).then(ret => {
res.send(ret);
});
};
/**
* 详情页动态数据,如:评论数,回复数,是否点赞,是否收藏
* @param req
* @param res
*/
const detailDynamicData = (req, res) => {
let id = req.query.id,
uid = req.user.uid,
udid = req.sessionID;
indexModel.getDynamicDataById(id, uid, udid).then((ret) => {
res.status(200).send(ret);
}).catch(() => {
res.status(400);
});
};
const detailDynamicData = (req, res) => {
let id = req.query.id,
uid = req.user.uid,
udid = req.sessionID;
indexModel.getDynamicDataById(id, uid, udid).then((ret) => {
res.status(200).send(ret);
}).catch(() => {
res.status(400);
});
};
module.exports = {
editor,
... ...
... ... @@ -72,7 +72,7 @@ const getArticleList = (gender, sortId, uid, udid, page, tag, authorId, limit, u
return serviceAPI.get('guang/api/v2/article/getList', param, {
cache: useCache
}).then((result) => {
console.log(result)
console.log(result);
if (result && result.code === 200) {
return result;
} else {
... ... @@ -306,46 +306,46 @@ const getTagEditor = (param) => {
* @param other [Obejct] 包含uid,query,type等非必传参数
* @returns {Promise.<T>|*}
*/
const getDynamicDataByIds = (ids, udid, other) => {
let params = {
articleIds: ids,
udid: udid
};
if (other.uid) {
const getDynamicDataByIds = (ids, udid, other) => {
let params = {
articleIds: ids,
udid: udid
};
if (other.uid) {
_.assign(params, {
uid: other.uid
});
}
if (other.query) {
}
if (other.query) {
_.assign(params, {
query: other.query
});
}
if (other.type) {
}
if (other.type) {
_.assign(params, {
type: other.type
});
}
return serviceAPI.get('guang/api/*/article/getSimpleArticleList', params, {cache: true});
};
}
return serviceAPI.get('guang/api/*/article/getSimpleArticleList', params, {cache: true});
};
/**
* 获取制指定文章的动态信息
* @param ids
* @returns {Promise.<T>|*}
*/
const getDynamicDataById = (id, uid, udid) => {
return serviceAPI.get('/gateway/guang/api/*/article/getArticlePraiseAndFavor', {
id: id,
uid: uid,
udid: udid
});
};
const getDynamicDataById = (id, uid, udid) => {
return serviceAPI.get('/gateway/guang/api/*/article/getArticlePraiseAndFavor', {
id: id,
uid: uid,
udid: udid
});
};
module.exports = {
getAuthor,
... ...
... ... @@ -25,7 +25,7 @@ module.exports = {
// service: 'http://service-test1.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/',
// favApi: 'http://192.168.102.31:8092/brower',
// api: 'http://192.168.102.205:8080/gateway/',
// service: 'http://192.168.102.205:8080/gateway/',
... ...
... ... @@ -258,7 +258,7 @@ function loadMore($container, opt, url) {
delete opt.isTab;
},
error: function() {
//console.log('error')
// console.log('error')
tip.show('网络断开连接了~');
searching = false;
delete opt.isTab;
... ...
... ... @@ -197,12 +197,12 @@ $('img').on('load', function() {
if ($('.guang-detail-page').hasClass('guang-detail')) {
useIscroll = true;
} else if($('.guang-detail-page').hasClass('guang-ezine')) {
} else if ($('.guang-detail-page').hasClass('guang-ezine')) {
useIscroll = false;
}
$('.main-wrap').css({
position: 'static'
})
});
pageInIscroll = isIphone && useIscroll;
... ...