Authored by zhangxiaoru

brand

... ... @@ -21,8 +21,9 @@ const brand = require('../models/brand');
const index = (req, res, next) => {
let channel = req.query.brand || 1;
let contentCode = 'd0149783b8dd2adaf083fd10556c39a9';
let appType = 1;
brand.getListData(contentCode, channel).then((result) => {
brand.getListData(contentCode, channel, appType).then((result) => {
res.display('index', {
module: 'brand',
page: 'index',
... ...
... ... @@ -42,6 +42,7 @@ const _processListData = (list) => {
}
);
});
console.log(listData)
return listData;
};
... ... @@ -96,9 +97,10 @@ const _getResources = (contentCode) => {
* @param channel
* @returns {*}
*/
const _getBreakingSort = (channel) => {
const _getBreakingSort = (channel, appType) => {
return api.get('', {
yo_channel: channel,
yh_channel: channel,
app_type: appType,
method: 'app.brand.newBrandList'
}).then((result) => {
if (result && result.code === 200) {
... ... @@ -114,8 +116,8 @@ const _getBreakingSort = (channel) => {
* 获取品牌一览相关数据
* @returns {*}
*/
const getListData = (contentCode, channel) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel)])
const getListData = (contentCode, channel, appType) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel, appType)])
.then((result) => {
return {
... ...