Authored by 周少峰

test data, shop-entry

... ... @@ -33,7 +33,8 @@ const getProductList = (params) => {
*/
const getSortList = (params) => {
let finalParams = {
method: 'app.sort.get'
//method: 'web.regular.groupsort'
method: 'app.search.li'
};
Object.assign(finalParams, params);
... ...
/*
* @Author: Targaryen
* @Date: 2016-05-30 16:20:03
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-08 19:56:39
/**
* search
* @Author: sefon 2016-7-12 16:31:56
*/
'use strict';
// const utils = '../../../utils';
const utils = '../../../utils';
const api = global.yoho.API;
const searchApi = require('./search-api');
const headerModel = require('../../../doraemon/models/header');
const productProcess = require(`${utils}/product-process`);
const publicHandler = require('./public-handler');
// const _ = require('lodash');
//
// const log = global.yoho.logger;
/**
* 获取奥莱首页数据
* 获取搜索数据
* @param {[type]} origin [description]
* @return {[type]} [description]
*/
... ... @@ -29,11 +29,27 @@ exports.getSearchData = (params) => {
let finalResult = {
headerData: Object.assign(result[0].headerData, {
header: true
})
}),
search: {}
};
// 处理搜索结果数据
// 获取商品数据和顶部筛选条件
if (result[1].code === 200) {
finalResult.search.leftContent = publicHandler.handleSaleSortData(result[1].data.filter.group_sort, params);
finalResult.search.pathNav = publicHandler.handlePathNavData(result[1].data.filter.group_sort, params);
}
// 获取左侧类目数据
if (result[2].code === 200) {
Object.assign(finalResult.search, {
filters: publicHandler.handleSaleFilterData(result[2].data.filter, params),
opts: publicHandler.handleSaleOptsData(params, result[2].data.total),
totalCount: result[2].data.total,
footPager: publicHandler.handlePagerData(result[2].data.total, params),
goods: productProcess.processProductList(result[2].data.product_list)
});
}
return finalResult;
});
};
... ...
<div class="product-page yoho-page">
{{# saleList}}
{{> sale/sale-banner}}
{{# search}}
<div class="center-content clearfix">
{{# pathNav}}
{{> common/path-nav}}
{{/ pathNav}}
{{# saleTitle}}
<div class="header-title">
{{name}}
<p class="line-through"></p>
<p class="count-wrap">
<span class="count">{{count}}个结果</span>
</p>
</div>
{{/ saleTitle}}
<div class="list-left pull-left">
{{> product/left-content}}
</div>
<div class="list-right pull-right">
{{# sortIntro}}
<div class="sort-intro clearfix">
<div class="texts pull-left">
<p class="name">{{name}}</p>
<p class="en-name">{{enName}}</p>
<p class="desc">{{{description}}}</p>
<div class="key-entry">
{{#each keyEntry}}
<a href="{{url}}">{{name}}</a>
{{/each}}
</div>
</div>
<img class="pull-right img" src="{{img}}">
</div>
{{/ sortIntro}}
{{> list/shop-entry}}
{{> product/standard-content}}
</div>
</div>
{{/ saleList}}
{{/search}}
</div>
... ...
<div class="shop-entry-area">
{{# shopEntry}}
<div class="shop-entry clearfix">
<a class="pull-left" href="{{home}}">
<img class="logo" src="{{logo}}">
</a>
<div class="name pull-left">
<a class="shop-name" href="{{home}}">{{shopName}}</a>
<p class="sorts">
{{#each sort}}
<a href="{{href}}">{{name}}</a>
{{#unless @last}}
/
{{/unless}}
{{/each}}
</p>
</div>
<a class="entry-btn pull-right" href="{{home}}">
进入品牌店铺
<span class="iconfont">&#xe601;</span>
</a>
</div>
{{/ shopEntry}}
</div>
\ No newline at end of file
... ...
... ... @@ -14,7 +14,8 @@ module.exports = {
port: 6002,
siteUrl: 'http://www.yohobuy.com',
domains: {
api: 'http://devapi.yoho.cn:58078/',
//api: 'http://devapi.yoho.cn:58078/',
api: 'http://testapi.yoho.cn:28078/',
service: 'http://devservice.yoho.cn:58077/',
search: 'http://192.168.102.216:8080/yohosearch/'
},
... ...
... ... @@ -3,3 +3,24 @@
* @author: sefon 2016-7-12 15:28:22
*/
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var product = require('./index/product');
require('../plugins/filter');
require('../plugins/sort-pager');
product.init(4);
lazyLoad($('img.lazy'), {
failure_limit: 20
});
... ...