...
|
...
|
@@ -7,8 +7,8 @@ |
|
|
const utils = '../../../utils';
|
|
|
const contentCodeConfig = require('../../../config/content-code');
|
|
|
const _ = require('lodash');
|
|
|
const api = global.yoho.ServiceAPI;
|
|
|
const API = global.yoho.API;
|
|
|
// const api = global.yoho.ServiceAPI;
|
|
|
// const API = global.yoho.API;
|
|
|
const logger = global.yoho.logger;
|
|
|
const resourcesProcess = require(`${utils}/resources-process`);
|
|
|
|
...
|
...
|
@@ -134,7 +134,11 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
|
|
|
params.new_device = true;
|
|
|
|
|
|
return api.get('operations/api/v5/resource/home', params, {
|
|
|
return this.get({
|
|
|
url: 'operations/api/v5/resource/home',
|
|
|
data: params,
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then(result => {
|
|
|
if (result && result.code === 200 && result.data && result.data.list) {
|
...
|
...
|
@@ -159,7 +163,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
_getLeftNav(choosed) {
|
|
|
choosed = choosed || 'all';
|
|
|
|
|
|
return api.get('operations/api/v6/category/getCategory', {}, {
|
|
|
return this.get({
|
|
|
url: 'operations/api/v6/category/getCategory',
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then(result => {
|
|
|
// console.log(result)
|
...
|
...
|
@@ -188,9 +195,12 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
delete params.gender;
|
|
|
}
|
|
|
|
|
|
return API.get('', _.assign({
|
|
|
method: 'app.search.getTerms'
|
|
|
}, params), {
|
|
|
return this.get({
|
|
|
data: _.assign({
|
|
|
method: 'app.search.getTerms'
|
|
|
}, params),
|
|
|
api: global.yoho.API
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -207,7 +217,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* @return {[type]}
|
|
|
*/
|
|
|
_getChannelList() {
|
|
|
return api.get('operations/api/v5/entrance/getEntrance', {}, {
|
|
|
return this.get({
|
|
|
url: 'operations/api/v5/entrance/getEntrance',
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then((result) => {
|
|
|
if (result && result.code === 200) {
|
...
|
...
|
@@ -253,8 +266,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* @return {[type]}
|
|
|
*/
|
|
|
_getChannelBg() {
|
|
|
return api.get('operations/api/v5/resource/get', {
|
|
|
content_code: contentCode.index
|
|
|
return this.get({
|
|
|
url: 'operations/api/v5/resource/get',
|
|
|
data: {content_code: contentCode.index},
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
}).then(result => {
|
...
|
...
|
@@ -308,8 +323,10 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
gender = gender || 'boys';
|
|
|
|
|
|
if (gender === 'boys' || gender === 'girls') {
|
|
|
return api.get('operations/api/v5/resource/get', {
|
|
|
content_code: bottomBannerCode[gender] // eslint-disable-line
|
|
|
return this.get({
|
|
|
url: 'operations/api/v5/resource/get',
|
|
|
data: {content_code: bottomBannerCode[gender]}, // eslint-disable-line
|
|
|
api: global.yoho.ServiceAPI
|
|
|
}, {
|
|
|
cache: true
|
|
|
});
|
...
|
...
|
@@ -325,10 +342,13 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
* 获取店铺推荐收藏和人数
|
|
|
*/
|
|
|
shopRecom(params) {
|
|
|
return API.get('', {
|
|
|
method: 'app.shops.floorNewInfo',
|
|
|
shop_ids: params.shopIds,
|
|
|
uid: params.uid,
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.shops.floorNewInfo',
|
|
|
shop_ids: params.shopIds,
|
|
|
uid: params.uid,
|
|
|
},
|
|
|
api: global.yoho.API
|
|
|
});
|
|
|
}
|
|
|
}; |
...
|
...
|
|