Authored by 郭成尧

Merge branch 'feature/brand' into develop

... ... @@ -6,11 +6,22 @@
*/
'use strict';
const mRoot = '../models';
const listModel = require(`${mRoot}/list`);
module.exports = {
/* 资讯首页 */
index: (req, res) => {
res.render('index', {
module: 'news',
page: 'index'
});
},
getNewsList: (req, res, next) => {
listModel.newsList().then(result => {
res.json(result);
}).catch(next);
}
};
... ...
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/27
* Time: 10:11
*/
'use strict';
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/27
* Time: 11:42
*/
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
module.exports = {
/* 资讯列表页数据获取 */
getNewsListData(params) {
return serviceAPI.get('/guang/api/v2/article/getList', {
sort_id: params.sortId,
gender: params.gender,
author_id: params.authorId,
tag: params.tag,
uid: params.uid,
udid: params.udid,
page: params.page,
limit: params.limit,
app_type: '1'
});
}
};
... ...
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/7/27
* Time: 10:11
*/
'use strict';
const logger = global.yoho.logger;
const api = global.yoho.API;
const newsListApi = require('./list-api');
const newsList = params => {
let finalResult = {};
return api.all([
newsListApi.getNewsListData(params)
]).then(result => {
if (result.code === 200) {
Object.assign(finalResult, result.data);
} else {
logger.error('getNewsListData api code no 200 or allList is null');
}
return finalResult;
});
};
module.exports = {
newsList
};
... ...
... ... @@ -11,6 +11,12 @@
const tip = require('common/tip');
/* 空方法 */
const nullFun = () =>{};
/* 提示信息 */
const tipInfo = '暂不支持,请在BLK应用中打开';
const yoho = {
/**
* 判断是否是 APP
... ... @@ -30,12 +36,12 @@ const yoho = {
*/
goTap(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.tab',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -47,12 +53,12 @@ const yoho = {
*/
goLogin(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.login',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -64,12 +70,12 @@ const yoho = {
*/
goLogout(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.loginout',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -81,12 +87,12 @@ const yoho = {
*/
goShopingKey(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.shoppingkey',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -98,12 +104,12 @@ const yoho = {
*/
goShopingCart(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.shopingCart',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -115,12 +121,12 @@ const yoho = {
*/
goAddress(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.address',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -132,12 +138,12 @@ const yoho = {
*/
goImageBrowser(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.imageBrowser',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -149,12 +155,12 @@ const yoho = {
*/
goNewPage(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.newPage',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -166,29 +172,29 @@ const yoho = {
*/
goPay(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.pay',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
/**
* 返回上一级页面
* @param args {}
* @param args {""}
* @param success
* @param fail
*/
goBack(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.back',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ... @@ -200,18 +206,18 @@ const yoho = {
*/
goShare(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'go.share',
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
/**
* 跳转到搜索页面
* @param args {}
* @param args {""}
* @param success
* @param fail
*/
... ... @@ -222,13 +228,13 @@ const yoho = {
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
/**
* 跳转到设置页面
* @param args {}
* @param args {""}
* @param success
* @param fail
*/
... ... @@ -239,7 +245,7 @@ const yoho = {
arguments: args
});
} else {
tip('暂不支持,请在BLK应用中打开');
tip(tipInfo);
}
},
... ...
<template>
<div v-if="shopInfo.isBlkShop" class="brand-top-box" v-bind:style="{ 'background-image': `url(${shopInfo.brandBg})` }">
<div class="brand-bottom">
<img v-if="shopInfo.showBrandLogo" v-lazy="brandIntro.brandLogo" alt="{{ shopInfo.brandName }}">
<img v-if="shopInfo.brandLogo" v-lazy="brandIntro.brandLogo" alt="{{ shopInfo.brandName }}">
<div v-else class="brand-title">{{ shopInfo.brandName }}</div>
<hr>
<div v-show="showMore" transition="brand-intro" v-bind:class="{ 'brand-short': !showMore }">{{ shopInfo.brandIntro }}</div>
... ...