Authored by ccbikai

Merge branch 'feature/home' of git.yoho.cn:fe/yohoblk-wap into feature/home

... ... @@ -37,9 +37,21 @@ module.exports = {
/* 获取商品列表 */
getBrandShopGoods: (req, res) => {
let params = req.query;
brandModel.getBrandShopGoodsData(params).then(result => {
brandModel.getBrandShopGoodsData({
sort: req.body.sort,
page: req.body.page,
channel: req.body.filter.channel || 'men',
gender: req.body.filter.gender || '1,2,3',
brand: req.body.filter.brand,
shopId: req.body.filter.shopId,
order: req.body.filter.order || 's_t_desc',
limit: req.body.filter.limit || '60',
color: req.body.filter.color,
price: req.body.filter.price,
size: req.body.filter.size,
pd: req.body.filter.pd,
tagsFilter: req.body.filter.tagsFilter
}).then(result => {
res.json(result);
});
},
... ... @@ -99,5 +111,14 @@ module.exports = {
.then(result => {
res.json(result);
});
},
// 品类资源位
cateResource: (req, res) => {
res.render('brand/cate-resource', {
module: 'channel',
page: 'cate-resource'
});
}
};
... ...
... ... @@ -4,7 +4,6 @@
* @date: 2016/05/09
*/
'use strict';
const brand = require('./brand');
/**
* 频道选择页
... ... @@ -18,4 +17,4 @@ const component = {
}
};
module.exports = Object.assign(component, brand);
module.exports = component;
... ...
... ... @@ -65,7 +65,20 @@ module.exports = {
*/
getBrandShopGoodsOriginData(params) {
return api.get('', {
method: ''
method: 'app.search.brand',
yh_channel: params.channel ? yhChannel[params.channel].channel : '1',
brand: params.brand,
shop_id: params.shopId,
order: params.order,
limit: params.limit,
page: params.page,
gender: params.gender,
color: params.color,
price: params.price,
size: params.size,
p_d: params.pd,
sort: params.sort,
tags_filter: params.tagsFilter
});
},
... ... @@ -82,7 +95,7 @@ module.exports = {
type: params.type
};
if (isFav) {
if (params.isFav) {
Object.assign(finalParams, {
method: 'app.favorite.add'
});
... ... @@ -114,5 +127,16 @@ module.exports = {
method: 'app.sort.get'
})
);
},
/**
* 从接口获取品类资源位数据
* @returns {*}
*/
getCateResource(params) {
return api.get('', Object.assign(params, {
method: 'app.sort.get'
})
);
}
};
... ...
... ... @@ -230,9 +230,23 @@ const getCateListData = params => {
});
};
/**
* 获取品类资源位数据
* @param params
* @returns {*|Promise.<TResult>}
*/
const getCateResource = params => {
let finalResult = {};
return brandApi.getCateResource(params).then(result => {
return finalResult;
});
};
module.exports = {
getBrandData,
getBrandShopGoodsData,
getBrandListData,
getCateListData
getCateListData,
getCateResource
};
... ...
... ... @@ -17,15 +17,16 @@ router.get('/', channel.index); // 首页
router.get('/resources', channel.resources); // 资源位接口
router.get('/brand', brand.index); // 店铺首页
router.get('/get-brand-intro', brand.getBrandIntro); // 店铺介绍
router.get('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍
router.post('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍
router.get('/brand-list', brand.brandList); // 品牌列表页
router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据
router.get('/brand-share', brand.brandShare); // 获取品牌列表数据
router.get('/cate-resource', brand.cateResource); // 品类资源位页面
router.get('/collect-shop', brand.collectShop); // 收藏品牌店铺
router.get('/cate', brand.cate); // 全部分类
router.get('/get-cate-list', brand.getCateList); // 全部分类数据列表
router.get('/sidebar', channel.sidebar); // 资源位接口
module.exports = router;
... ...
<div id="cate-resource">
<cate-res></cate-res>
</div>
\ No newline at end of file
... ...
... ... @@ -28,15 +28,13 @@ const refund = {
res.json(result);
}).catch(next);
},
logistics(req, res) {
res.render('logistics', {
module: 'home',
page: 'logistics'
});
},
companylist(req, res, next) {
logistics(req, res, next) {
refundModel.getExpressCompany().then(result => {
res.json(result);
res.render('logistics', {
module: 'home',
page: 'logistics',
company_list: result ? JSON.stringify(result.data) : ""
});
}).catch(next);
},
saveLogistics(req, res) {
... ...
... ... @@ -35,13 +35,13 @@ const _getInfoNumData = (uid) => {
method: 'app.address.gethidden' // 用户地址的数据
})]).then(data => {
let res = {
wait_pay_num: 0,
wait_cargo_num: 0,
send_cargo_num: 0,
refund_exchange_num: 0,
product_favorite_total: 0,
brand_favorite_total: 0,
yoho_coin_num: 0
wait_pay_num: '',
wait_cargo_num: '',
send_cargo_num: '',
refund_exchange_num: '',
product_favorite_total: '',
brand_favorite_total: '',
yoho_coin_num: ''
};
if (data[0].data) {
... ...
... ... @@ -42,7 +42,6 @@ router.get('/refund', refund.refund); // 退换货
router.get('/refund/order', refund.order); // 查询订单数据
router.post('/refund/submit', refund.submit); // 提交信息
router.get('/refund/logistics', refund.logistics); // 退换货 - 商品寄回信息
router.get('/refund/companylist', refund.companylist); // 退换货 - 物流公司列表信息
router.post('/save-logistics', refund.saveLogistics); // 退换货 - 添加寄回物流信息
// 换货
... ...
... ... @@ -14,28 +14,28 @@
</a>
<div class="order-type clearfix">
<a class="type-item" href="/home/orders?type=2">
<span>&#xe634;</span>
<span class="icon icon-wait-pay"></span>
<br>待付款
{{#if wait_pay_num}}
<span class="num">{{wait_pay_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/orders?type=3">
<span>&#xe63b;</span>
<span class="icon icon-wait-cargo"></span>
<br>待发货
{{#if wait_cargo_num}}
<span class="num">{{wait_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/orders?type=4">
<span>&#xe633;</span>
<span class="icon icon-send-cargo"></span>
<br>待收货
{{#if send_cargo_num}}
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/orders?type=5">
<span>&#xe633;</span>
<span class="icon icon-refund-exchange"></span>
<br>退换货
{{#if refund_exchange_num}}
<span class="num">{{refund_exchange_num}}</span>
... ...
<div class="logistics-page" id="logistics">
<components :is="currentView" :company_id="company_id" :company_name="company_name" keep-alive></components>
</div>
\ No newline at end of file
<components :is="currentView" :company_id="company_id" :company_name="company_name" company_list={{company_list}} keep-alive></components>
</div>
... ...
... ... @@ -21,9 +21,20 @@ exports.index = (req, res) => {
res.render('search', view);
};
/* 筛选的二级页面 */
exports.subFilter = (req, res) => {
const view = {
module: 'product',
page: 'filter-sub'
};
res.render('filter-sub', view);
};
/* 获取 筛选配置 */
exports.fetchFilters = (req, res, next) => {
const params = {
uid: 14741796, // mock data
page: req.body.page || 1,
order: req.body.order || 1,
yh_channel: req.body.yh_channel || 'all',
... ... @@ -41,10 +52,15 @@ exports.fetchFilters = (req, res, next) => {
.then(result => {
let filterConfig = {};
prettyFilter(result.data.filter);
filterConfig = camelCase(result.data.filter);
if (result.code === 200) {
prettyFilter(result.data.filter);
filterConfig = camelCase(result.data.filter);
}
res.json(filterConfig);
res.json({
code: result.code,
data: filterConfig
});
})
.catch(next);
};
... ... @@ -52,6 +68,7 @@ exports.fetchFilters = (req, res, next) => {
/* 查询 产品列表 */
exports.fetchProducts = (req, res, next) => {
const params = {
uid: 14741796, // mock data
page: req.body.page || 1,
order: req.body.order || 1,
yh_channel: req.body.yh_channel || 'all',
... ... @@ -67,9 +84,10 @@ exports.fetchProducts = (req, res, next) => {
code: 200
})
.then(result => {
result.data.productList = processProductList(result.data.productList);
result = camelCase(result);
if (result.code === 200) {
result.data.productList = processProductList(result.data.productList);
result = camelCase(result);
}
res.json(result);
})
.catch(next);
... ...
... ... @@ -16,6 +16,7 @@ const search = require(`${cRoot}/search`);
router.get('/search', search.index);
router.post('/search', search.fetchProducts);
router.get('/filter', search.subFilter);
router.get('/filters.json', search.fetchFilters);
// 商品详情controller
... ...
{{! 筛选的 二级菜单}}
<div id="filter-sub">
<filter-sub :data="data" :val="val" type="color"><filter-sub>
</div>
\ No newline at end of file
... ...
... ... @@ -14,7 +14,7 @@
"debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js",
"lint-js": "eslint -c .eslintrc --cache --fix .",
"lint-css": "stylelint --config .stylelintrc public/scss/**/*.css",
"lint-vue": "stylelint --extract --config .stylelintrc public/vue/**/*.vue; eslint -c .eslintrc --cache --fix public/vue/**/*.vue",
"lint-vue": "stylelint --extract --config .stylelintrc public/vue/**/*.vue || eslint -c .eslintrc --cache --fix public/vue/**/*.vue",
"precommit": "node lint.js"
},
"license": "MIT",
... ...
No preview for this file type
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Fri Jul 22 18:41:59 2016
By admin
</metadata>
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
panose-1="2 0 6 3 0 0 0 0 0 0"
ascent="896"
descent="-128"
x-height="792"
bbox="-0.0999985 -221.6 1457 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E617"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
<glyph glyph-name=".notdef" horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
<glyph glyph-name=".null" horiz-adv-x="0"
/>
<glyph glyph-name="nonmarkingreturn" horiz-adv-x="341"
/>
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="uniE600" unicode="&#xe600;"
d="M911 725h-242v123q0 21 -13.5 34.5t-34.5 13.5h-246q-20 0 -33.5 -13.5t-13.5 -34.5v-123h-246q-21 0 -34.5 -13.5t-13.5 -34t13.5 -34t34.5 -13.5h829q21 0 34.5 13.5t13.5 34t-13.5 34t-34.5 13.5zM423 725v72h147v-72h-147zM765 579q-21 0 -34.5 -14t-13.5 -34v-560
h-441v560q0 20 -13.5 34t-34 14t-34 -14t-13.5 -34v-611q0 -21 13.5 -34.5t34.5 -13.5h536q20 0 33.5 13.5t13.5 34.5v611q3 20 -11.5 34t-35.5 14zM447 67v389q0 20 -13.5 33.5t-34 13.5t-34 -13.5t-13.5 -33.5v-389q0 -21 13.5 -34.5t34 -13.5t34 13.5t13.5 34.5zM645 67
v389q0 20 -13.5 33.5t-34.5 13.5q-20 0 -35.5 -13.5t-15.5 -33.5v-389q0 -21 13.5 -34.5t34.5 -13.5t36 13.5t15 34.5z" />
<glyph glyph-name="uniE601" unicode="&#xe601;"
d="M512 812q43 0 82.5 -17t68 -45.5t45.5 -68t17 -82.5v-43h171v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-512q-53 0 -90.5 37.5t-37.5 90.5v640h171v43q0 43 17 82.5t45.5 68t68 45.5t82.5 17zM811 -84v555h-598v-555q0 -18 12.5 -30.5t30.5 -12.5h512q18 0 30.5 12.5
t12.5 30.5zM512 727q-53 0 -90.5 -37.5t-37.5 -90.5v-43h256v43q0 53 -37.5 90.5t-90.5 37.5z" />
<glyph glyph-name="uniE602" unicode="&#xe602;"
d="M516 256l409 404q2 1 6 6t7 8t8 7t9 5.5t8.5 2t8.5 -2.5l38 -21q7 -7 7.5 -17.5t-6.5 -17.5l-476 -471q-7 -8 -17.5 -8t-17.5 7zM86 669zM531 158q-8 -7 -18.5 -7t-17.5 8l-475 471q-7 7 -7 17.5t7 17.5l38 21q4 3 8.5 2.5t8.5 -2t9 -5.5t8 -7t7 -8t6 -6l415 -407z
M945 669z" />
<glyph glyph-name="uniE603" unicode="&#xe603;"
d="M998.5 724.5q-12.5 11.5 -29.5 11t-29 -12.5l-552 -588l-302 297q-12 12 -29.5 12t-29.5 -12.5t-12 -29.5t13 -29l332 -327v-1q2 -1 9 -5q1 -1 2.5 -2t2.5 -1q7 -3 15 -3t16 3q1 1 3 2l1 1q7 5 9 6l1 1l581 619q12 13 11.5 30t-13 28.5z" />
<glyph glyph-name="uniE604" unicode="&#xe604;"
d="M887 653q-19 24 -31 33l-4 4l-4 4q-53 51 -126 51q-103 0 -211 -106q-107 106 -210 106q-74 0 -126 -51l-5 -4l-3 -4q-12 -9 -31 -33q-74 -93 -60 -191q7 -48 33.5 -98.5t61.5 -92t80 -82.5t84 -70t77.5 -54.5t57.5 -36.5t28 -15l13 -7l14 7q8 4 27 15t58 36.5t78 54.5
t84 70t80 82.5t61.5 92t33.5 98.5q14 98 -60 191zM893 470q-7 -52 -43.5 -109t-81.5 -101t-100 -86.5t-91.5 -66t-65.5 -38.5q-28 15 -64.5 38.5t-92 66t-100 86.5t-81 101t-43.5 109q-13 92 75 176q4 5 11.5 12.5t32 20t52.5 12.5q87 0 189 -111l21 -23l22 23
q102 111 189 111q27 0 52 -12.5t32.5 -20t11.5 -12.5q88 -84 75 -176z" />
<glyph glyph-name="uniE605" unicode="&#xe605;"
d="M512 415l360 360l45 -45l-360 -360l360 -359l-45 -45l-360 359l-360 -359l-45 45l360 359l-360 360l45 45z" />
<glyph glyph-name="uniE606" unicode="&#xe606;"
d="M245 384l-9 9l472 472l80 -80l-400 -401l400 -401l-80 -80l-472 472z" />
<glyph glyph-name="uniE607" unicode="&#xe607;"
d="M785 384l13 13l-488 487l-84 -84l416 -416l-416 -416l84 -84l488 487z" />
<glyph glyph-name="uniE608" unicode="&#xe608;"
d="M682 74q-108 -89 -249 -89q-107 0 -197.5 53t-143.5 143.5t-53 197.5t53 197.5t143.5 143.5t197.5 53t197.5 -53t143.5 -143.5t53 -197.5q0 -141 -89 -249l286 -286l-56 -56zM433.5 64q130.5 0 222.5 92t92 222.5t-92 223t-222.5 92.5t-223 -92.5t-92.5 -223t92.5 -222.5
t223 -92z" />
<glyph glyph-name="uniE609" unicode="&#xe609;"
d="M513 17q-15 0 -121 93t-168 161q-37 40 -64 95.5t-27 99.5q0 97 61.5 166.5t149.5 69.5q49 0 93 -34.5t76 -86.5q31 52 75 86.5t93 34.5q88 0 150 -69.5t62 -166.5q0 -47 -27 -104t-65 -92q-20 -18 -61.5 -57t-74 -68.5t-67 -61t-57 -49t-28.5 -17.5z" />
<glyph glyph-name="uniE60A" unicode="&#xe60a;" horiz-adv-x="1463"
d="M798 -160q0 -46 25 -58t61 16l537 420q36 28 36 68t-36 68l-537 424q-36 29 -61 16.5t-25 -57.5v-238q-138 0 -252.5 -24.5t-192 -63t-137.5 -94t-94.5 -109.5t-57.5 -117t-31.5 -109.5t-11 -94t-1.5 -63.5t2 -25q47 62 87 104t90 78t103.5 57.5t127 36.5t161.5 21t207 6
v-262z" />
<glyph glyph-name="uniE60B" unicode="&#xe60b;"
d="M150.5 805q23.5 0 40 -16.5t16.5 -40t-16.5 -40.5t-40 -17t-40.5 17t-17 40.5t17 40t40.5 16.5zM150 600q49 0 87.5 28.5t53.5 74.5h731v91h-731q-15 45 -53.5 73.5t-87.5 28.5q-61 0 -104.5 -43.5t-43.5 -104.5t43.5 -104.5t104.5 -43.5zM723 327q-23 0 -40 16.5
t-17 40.5t17 40.5t40.5 16.5t40 -16.5t16.5 -40.5t-16.5 -40.5t-40.5 -16.5zM864 430q-15 45 -53.5 73.5t-87 28.5t-87.5 -28.5t-53 -73.5h-583v-92h583q14 -45 53 -73.5t87.5 -28.5t87 28.5t53.5 73.5h160v92h-160zM150.5 -37q-23.5 0 -40.5 16.5t-17 40t17 40.5t40.5 17
t40 -17t16.5 -40.5t-16.5 -40t-40 -16.5zM150 168q-61 0 -104.5 -43.5t-43.5 -104.5t43.5 -104.5t104.5 -43.5q49 0 87.5 28.5t53.5 73.5h731v91h-731q-15 46 -53.5 74.5t-87.5 28.5z" />
<glyph glyph-name="uniE60C" unicode="&#xe60c;" horiz-adv-x="1122"
d="M793 798q92 0 150.5 -65t58.5 -161q0 -82 -54 -145l-398 -413l-399 413q-53 63 -53 145q0 96 58 161t150 65q43 0 90 -22t79 -52t53.5 -58.5t21.5 -42.5q0 14 21 42.5t53.5 58.5t79 52t89.5 22zM793 896q-63 0 -127 -30t-116 -78q-53 48 -117 78t-127 30
q-131 0 -218.5 -92.5t-87.5 -231.5q0 -118 76 -208l3 -3l2 -2l398 -413l71 -73l70 73l398 413l3 2l2 3q76 90 76 208q0 139 -87.5 231.5t-218.5 92.5z" />
<glyph glyph-name="uniE60D" unicode="&#xe60d;" horiz-adv-x="1122"
d="M793 896q-63 0 -127 -30t-116 -78q-53 48 -117 78t-127 30q-131 0 -218.5 -92.5t-87.5 -231.5q0 -118 76 -208l3 -3l2 -2l398 -413l71 -73l70 73l398 413l3 2l2 3q76 90 76 208q0 139 -87.5 231.5t-218.5 92.5z" />
<glyph glyph-name="uniE60E" unicode="&#xe60e;" horiz-adv-x="1321"
d="M1297 366l-597 530v-328q-448 -11 -616 -283q-87 -142 -84 -319q1 -32 2 -32q65 82 120.5 129.5t135.5 82t183 47.5t259 15v-328z" />
<glyph glyph-name="uniE617" unicode="&#xe617;"
d="M24 94l22 -22q9 -10 22 -10t23 10l424 430l420 -426q9 -9 21.5 -9t21.5 9l22 22q9 9 9 22t-9 23l-458 464q-5 5 -12 7q-9 7 -20.5 6t-20.5 -9l-465 -472q-9 -9 -9 -22t9 -23z" />
</font>
</defs></svg>
<font id="iconfont" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="896" descent="-128" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="0" d="" />
<glyph unicode="&#x78;" glyph-name="x" horiz-adv-x="1001" d="M281 543q-27-1-53-1h-83q-18 0-36.5-6t-32.5-18.5-23-32-9-45.5v-76h912v41q0 16-0.5 30t-0.5 18q0 13-5 29t-17 29.5-31.5 22.5-49.5 9h-133v-97h-438v97zM955 310v-52q0-23 0.5-52t0.5-58-10.5-47.5-26-30-33-16-31.5-4.5q-14-1-29.5-0.5t-29.5 0.5h-32l-45 128h-439l-44-128h-63q-20 0-45 1-25 0-41 9.5t-25.5 23-13.5 29.5-4 30v167h911zM163 247q-12 0-21-8.5t-9-21.5 9-21.5 21-8.5q13 0 22 8.5t9 21.5-9 21.5-22 8.5zM316 123q-8-26-14-48-5-19-10.5-37t-7.5-25-3-15 1-14.5 9.5-10.5 21.5-4h365q23 0 34 12t2 38q-5 13-9.5 30.5t-9.5 34.5q-5 19-11 39h-368zM336 498v228q0 11 2.5 23t10 21.5 20.5 15.5 34 6h188q31 0 51.5-14.5t20.5-52.5v-227h-327z" />
<glyph unicode="&#xe600;" glyph-name="delete" d="M911 725h-242v123q0 21-13.5 34.5t-34.5 13.5h-246q-20 0-33.5-13.5t-13.5-34.5v-123h-246q-21 0-34.5-13.5t-13.5-34 13.5-34 34.5-13.5h829q21 0 34.5 13.5t13.5 34-13.5 34-34.5 13.5zM423 725v72h147v-72h-147zM765 579q-21 0-34.5-14t-13.5-34v-560h-441v560q0 20-13.5 34t-34 14-34-14-13.5-34v-611q0-21 13.5-34.5t34.5-13.5h536q20 0 33.5 13.5t13.5 34.5v611q3 20-11.5 34t-35.5 14zM447 67v389q0 20-13.5 33.5t-34 13.5-34-13.5-13.5-33.5v-389q0-21 13.5-34.5t34-13.5 34 13.5 13.5 34.5zM645 67v389q0 20-13.5 33.5t-34.5 13.5q-20 0-35.5-13.5t-15.5-33.5v-389q0-21 13.5-34.5t34.5-13.5 36 13.5 15 34.5z" />
<glyph unicode="&#xe601;" glyph-name="bag" d="M512 812q43 0 82.5-17t68-45.5 45.5-68 17-82.5v-43h171v-640q0-53-37.5-90.5t-90.5-37.5h-512q-53 0-90.5 37.5t-37.5 90.5v640h171v43q0 43 17 82.5t45.5 68 68 45.5 82.5 17zM811-84v555h-598v-555q0-18 12.5-30.5t30.5-12.5h512q18 0 30.5 12.5t12.5 30.5zM512 727q-53 0-90.5-37.5t-37.5-90.5v-43h256v43q0 53-37.5 90.5t-90.5 37.5z" />
<glyph unicode="&#xe602;" glyph-name="down" d="M516 256l409 404q2 1 6 6t7 8 8 7 9 5.5 8.5 2 8.5-2.5l38-21q7-7 7.5-17.5t-6.5-17.5l-476-471q-7-8-17.5-8t-17.5 7zM531 158q-8-7-18.5-7t-17.5 8l-475 471q-7 7-7 17.5t7 17.5l38 21q4 3 8.5 2.5t8.5-2 9-5.5 8-7 7-8 6-6l415-407z" />
<glyph unicode="&#xe603;" glyph-name="check" d="M998.5 724.5q-12.5 11.5-29.5 11t-29-12.5l-552-588-302 297q-12 12-29.5 12t-29.5-12.5-12-29.5 13-29l332-327v-1q2-1 9-5 1-1 2.5-2t2.5-1q7-3 15-3t16 3q1 1 3 2l1 1q7 5 9 6l1 1 581 619q12 13 11.5 30t-13 28.5z" />
<glyph unicode="&#xe604;" glyph-name="love" d="M887 653q-19 24-31 33l-8 8q-53 51-126 51-103 0-211-106-107 106-210 106-74 0-126-51l-5-4-3-4q-12-9-31-33-74-93-60-191 7-48 33.5-98.5t61.5-92 80-82.5 84-70 77.5-54.5 57.5-36.5 28-15l13-7 14 7q8 4 27 15t58 36.5 78 54.5 84 70 80 82.5 61.5 92 33.5 98.5q14 98-60 191zM893 470q-7-52-43.5-109t-81.5-101-100-86.5-91.5-66-65.5-38.5q-28 15-64.5 38.5t-92 66-100 86.5-81 101-43.5 109q-13 92 75 176 4 5 11.5 12.5t32 20 52.5 12.5q87 0 189-111l21-23 22 23q102 111 189 111 27 0 52-12.5t32.5-20 11.5-12.5q88-84 75-176z" />
<glyph unicode="&#xe605;" glyph-name="close" d="M512 415l360 360 45-45-360-360 360-359-45-45-360 359-360-359-45 45 360 359-360 360 45 45z" />
<glyph unicode="&#xe606;" glyph-name="left" d="M245 384l-9 9 472 472 80-80-400-401 400-401-80-80-472 472z" />
<glyph unicode="&#xe607;" glyph-name="right" d="M785 384l13 13-488 487-84-84 416-416-416-416 84-84 488 487z" />
<glyph unicode="&#xe608;" glyph-name="search" d="M682 74q-108-89-249-89-107 0-197.5 53t-143.5 143.5-53 197.5 53 197.5 143.5 143.5 197.5 53 197.5-53 143.5-143.5 53-197.5q0-141-89-249l286-286-56-56zM433.5 64q130.5 0 222.5 92t92 222.5-92 223-222.5 92.5-223-92.5-92.5-223 92.5-222.5 223-92z" />
<glyph unicode="&#xe609;" glyph-name="love-solid" d="M513 17q-15 0-121 93t-168 161q-37 40-64 95.5t-27 99.5q0 97 61.5 166.5t149.5 69.5q49 0 93-34.5t76-86.5q31 52 75 86.5t93 34.5q88 0 150-69.5t62-166.5q0-47-27-104t-65-92q-20-18-61.5-57t-74-68.5-67-61-57-49-28.5-17.5z" />
<glyph unicode="&#xe60a;" glyph-name="yoho-share" horiz-adv-x="1463" d="M798-160q0-46 25-58t61 16l537 420q36 28 36 68t-36 68l-537 424q-36 29-61 16.5t-25-57.5v-238q-138 0-252.5-24.5t-192-63-137.5-94-94.5-109.5-57.5-117-31.5-109.5-11-94-1.5-63.5 2-25q47 62 87 104t90 78 103.5 57.5 127 36.5 161.5 21 207 6v-262z" />
<glyph unicode="&#xe60b;" glyph-name="filter" d="M150.5 805q23.5 0 40-16.5t16.5-40-16.5-40.5-40-17-40.5 17-17 40.5 17 40 40.5 16.5zM150 600q49 0 87.5 28.5t53.5 74.5h731v91h-731q-15 45-53.5 73.5t-87.5 28.5q-61 0-104.5-43.5t-43.5-104.5 43.5-104.5 104.5-43.5zM723 327q-23 0-40 16.5t-17 40.5 17 40.5 40.5 16.5 40-16.5 16.5-40.5-16.5-40.5-40.5-16.5zM864 430q-15 45-53.5 73.5t-87 28.5-87.5-28.5-53-73.5h-583v-92h583q14-45 53-73.5t87.5-28.5 87 28.5 53.5 73.5h160v92h-160zM150.5-37q-23.5 0-40.5 16.5t-17 40 17 40.5 40.5 17 40-17 16.5-40.5-16.5-40-40-16.5zM150 168q-61 0-104.5-43.5t-43.5-104.5 43.5-104.5 104.5-43.5q49 0 87.5 28.5t53.5 73.5h731v91h-731q-15 46-53.5 74.5t-87.5 28.5z" />
<glyph unicode="&#xe60c;" glyph-name="focus" horiz-adv-x="1122" d="M793 798q92 0 150.5-65t58.5-161q0-82-54-145l-398-413-399 413q-53 63-53 145 0 96 58 161t150 65q43 0 90-22t79-52 53.5-58.5 21.5-42.5q0 14 21 42.5t53.5 58.5 79 52 89.5 22zM793 896q-63 0-127-30t-116-78q-53 48-117 78t-127 30q-131 0-218.5-92.5t-87.5-231.5q0-118 76-208l5-5 398-413 71-73 70 73 398 413 3 2 2 3q76 90 76 208 0 139-87.5 231.5t-218.5 92.5z" />
<glyph unicode="&#xe60d;" glyph-name="focused" horiz-adv-x="1122" d="M793 896q-63 0-127-30t-116-78q-53 48-117 78t-127 30q-131 0-218.5-92.5t-87.5-231.5q0-118 76-208l5-5 398-413 71-73 70 73 398 413 3 2 2 3q76 90 76 208 0 139-87.5 231.5t-218.5 92.5z" />
<glyph unicode="&#xe60e;" glyph-name="share" horiz-adv-x="1321" d="M1297 366l-597 530v-328q-448-11-616-283-87-142-84-319 1-32 2-32 65 82 120.5 129.5t135.5 82 183 47.5 259 15v-328z" />
<glyph unicode="&#xe617;" glyph-name="up" d="M24 94l22-22q9-10 22-10t23 10l424 430 420-426q9-9 21.5-9t21.5 9l22 22q9 9 9 22t-9 23l-458 464q-5 5-12 7-9 7-20.5 6t-20.5-9l-465-472q-9-9-9-22t9-23z" />
<glyph unicode="&#xe900;" glyph-name="notdef" horiz-adv-x="374" d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
<glyph unicode="&#xe901;" glyph-name="wait-cargo" horiz-adv-x="1067" d="M992.619 896h-910.891l-81.088-460.587-0.64-563.413h1062.784v556.011l-70.165 467.989zM919.211 810.667l51.52-341.333h-292.629l-7.531-33.28c-13.76-61.013-71.403-105.301-137.024-105.301-65.429 0-123.029 44.117-136.96 104.917l-7.595 33.131h-295.829l60.181 341.867h765.867zM85.333-42.667v426.133h238.613c33.685-81.685 116.864-138.048 209.6-138.048 93.035 0 176.277 56.576 209.792 138.581h234.112v-426.667h-892.117z" />
<glyph unicode="&#xe902;" glyph-name="wait-pay" horiz-adv-x="1003" d="M794.122 666.122v229.878h-794.122v-1024h1003.102v794.122h-208.98zM83.592 812.408h626.939v-146.286h-626.939v146.286zM83.592 582.531h835.918v-626.939h-835.918v626.939zM167.184 457.143h668.735v-83.592h-668.735v83.592zM752.327 122.776h83.592v-83.592h-83.592v83.592z" />
<glyph unicode="&#xe903;" glyph-name="send-cargo" horiz-adv-x="1045" d="M1043.101 896h-1024v-397.061h83.592v-626.939h856.816v626.939h83.592v397.061zM186.284 498.939h689.633v-543.347h-689.633v543.347zM102.693 812.408h856.816v-229.878h-856.816v229.878zM374.366 373.551h313.469v-83.592h-313.469v83.592z" />
<glyph unicode="&#xe904;" glyph-name="refund-exchange" horiz-adv-x="1208" d="M1062.994 173.281c87.388 186.573 52.531 411.873-100.25 564.675-156.303 156.303-392.52 192.041-587.735 88.924l38.236-72.438c163.287 86.2 360.837 56.3 491.581-74.404 127.713-127.754 156.938-316.068 83.988-472.044l-141.947 66.437 96.154-265.298 265.298 96.154-145.326 67.994zM314.798 84.234c-127.734 127.734-156.959 316.047-84.009 472.023l141.967-66.437-96.174 265.298-265.298-96.154 145.306-67.994c-87.388-186.573-52.511-411.873 100.291-564.654 96.768-96.788 224.133-147.354 353.505-147.333 79.544 0 159.867 19.128 234.209 58.388l-38.236 72.438c-163.287-86.18-360.817-56.32-491.561 74.424z" />
</font></defs></svg>
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
const Vue = require('yoho-vue');
const lazyload = require('yoho-vue-lazyload');
const cateRes = require('channel/cate-resource-box.vue');
require('common/vue-filter');
Vue.use(lazyload);
new Vue({
el: '#cate-resource',
components: {
'cate-res': cateRes
}
});
... ...
... ... @@ -4,6 +4,6 @@ const brandCate = require('channel/brand-cate.vue');
new Vue({
el: '#brand-cate',
components: {
brandCate
'brand-cate': brandCate
}
});
... ...
const Vue = require('yoho-vue');
const infiniteScroll = require('yoho-vue-infinite-scroll');
const Logistics = require('home/refund/logistics.vue');
const LogisticsCompany = require('home/refund/logistics-company.vue');
Vue.use(infiniteScroll);
new Vue({
el: '#logistics',
data: {
... ...
const Vue = require('yoho-vue');
const filterSub = require('product/filter/filter-sub.vue');
// TODO: 该mock数据 应该有 上级页面传过来
const page = {
type: 'brand', // 二级筛选的 类型
data: [ // 二级筛选的 数据
{ id: 1, name: '红色' },
{ id: 2, name: '红色' },
{ id: 3, name: '红色' }
],
val: 3 // 二级筛选 的值
};
new Vue({
el: '#filter-sub',
data: function() {
return {
type: page.type,
data: page.data,
val: page.val
};
},
components: {
filterSub
}
});
... ...
... ... @@ -10,7 +10,6 @@
*/
const tip = require('common/tip');
const native = window.yohoInterface;
window.yohoWapInterface = {
headerRightTopBtn: function() {}
... ... @@ -35,7 +34,7 @@ const yoho = {
*/
goTap(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.tab',
arguments: args
});
... ... @@ -52,7 +51,7 @@ const yoho = {
*/
goLogin(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.login',
arguments: args
});
... ... @@ -69,7 +68,7 @@ const yoho = {
*/
goShopingCart(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.shopingCart',
arguments: args
});
... ... @@ -86,7 +85,7 @@ const yoho = {
*/
goAddress(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.address',
arguments: args
});
... ... @@ -103,7 +102,7 @@ const yoho = {
*/
goImageBrowser(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.imageBrowser',
arguments: args
});
... ... @@ -120,7 +119,7 @@ const yoho = {
*/
goNewPage(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.newPage',
arguments: args
});
... ... @@ -137,7 +136,7 @@ const yoho = {
*/
goPay(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.pay',
arguments: args
});
... ... @@ -154,7 +153,7 @@ const yoho = {
*/
goBack(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.back',
arguments: args
});
... ... @@ -171,7 +170,7 @@ const yoho = {
*/
goShare(args, success, fail) {
if (this.isApp) {
native.triggerEvent(success || function() {}, fail || function() {}, {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.share',
arguments: args
});
... ...
... ... @@ -84,3 +84,19 @@
.icon-share:before {
content: "\e60e";
}
.icon-wait-cargo:before {
content: "\e901";
}
.icon-wait-pay:before {
content: "\e902";
}
.icon-send-cargo:before {
content: "\e903";
}
.icon-refund-exchange:before {
content: "\e904";
}
... ...
... ... @@ -81,6 +81,10 @@
text-align: center;
border-top: 1px solid #e0e0e0;
.icon {
font-size: 45px;
}
.type-item {
position: relative;
float: left;
... ... @@ -95,8 +99,8 @@
.num {
position: absolute;
top: -24px;
right: 36px;
top: -35px;
right: 20px;
width: 72px;
height: 72px;
font-size: 34px;
... ...
... ... @@ -108,7 +108,7 @@
margin-left: 30px;
.company-item {
h2 {
.tag {
height: 50px;
line-height: 50px;
font-size: 34px;
... ...
... ... @@ -31,8 +31,8 @@
filterConfig: global.filterConfig,
// query
url: '/product/list',
sort: 3,
url: '/get-brand-shop-goods',
sort: '',
filter: {},
page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完
totalPage: 3,
... ... @@ -58,11 +58,10 @@
let data = {};
$.ajax({
method: 'post',
url: '/product/list',
url: this.url,
data: data
}).done(result => {
this.$set('productList', this.productList.concat(result.data.productList));
this.productList = result.data.productList;
}).fail(() => {
tip('网络错误');
});
... ... @@ -83,8 +82,8 @@
sort: this.sort,
filter: this.filter,
page: this.page
}).done(res => {
self.$set('productList', self.productList.concat(res.data.productList));
}).done(result => {
this.productList = result.data.productList;
}).fail(error => {
self.page--;
console.log(error);
... ...
... ... @@ -30,7 +30,8 @@
font-size: 36px;
font-family: helvetica, Arial, "黑体";
ul, li {
ul,
li {
margin: 0;
padding: 0;
list-style: none;
... ...
... ... @@ -58,7 +58,7 @@
const $ = require('yoho-jquery');
const bus = require('common/vue-bus');
const tip = require('common/tip');
const indexList = require('channel/index-list.vue');
const indexList = require('component/tool/index-list.vue');
module.exports = {
props: ['channel'],
... ...
... ... @@ -57,6 +57,8 @@
const shareBottom = require('channel/share-bottom.vue');
module.exports = {
/* TODO 数据需要从接口获取 */
data() {
return {
brandName: 'COLORMAD',
... ...
<template>
<tab v-bind:page="page"></tab>
<resources v-bind:content-code.sync="contentCode"></resources>
<cate-resources></cate-resources>
</template>
<script>
const contentCode = require('content-code');
const qs = require('yoho-qs');
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
const cateResources = require('channel/cate-resources.vue');
module.exports = {
data() {
return {
page: 'brand',
contentCode: contentCode.brand[qs.brand || 'men'],
channel: qs.channel
};
},
components: {
tab,
resources,
cateResources
}
};
</script>
\ No newline at end of file
... ...
<template>
<div class='cate-resource'>
<ul>
<li class='width50' style='
background:url(http://img11.static.yhbimg.com/brandLogo/2015/08/04/18/01a6f1a7600ab044d1577dd6c357298fb3.png?imageMogr2/thumbnail/150x150/extent/150x150/background/d2hpdGU=/position/center/quality/80);background-size:100% 100%;background-repeat:no-repeat;'>
<div>上衣</div>
</li>
<li class='width50' style='
background:url(http://img11.static.yhbimg.com/brandLogo/2015/08/04/18/01a6f1a7600ab044d1577dd6c357298fb3.png?imageMogr2/thumbnail/150x150/extent/150x150/background/d2hpdGU=/position/center/quality/80);background-size:100% 100%;background-repeat:no-repeat;'>
<div>上衣</div>
</li>
<li class='width100' style='
background:url(http://img10.static.yhbimg.com/yhb-img01/2016/07/22/15/014c3887f1320bf024a8bbc01fef5d2a1a.png?imageView2/2/w/750/h/365);background-size:100% 100%;background-repeat:no-repeat;'>
<div>全部分类</div>
</li>
</ul>
</div>
</template>
<style>
.cate-resource {
width: 100%;
ul,
li {
margin: 0;
padding: 0;
}
li {
float: left;
text-align: center;
color: #fff;
font-size: 60px;
cursor: pointer;
img {
width: 100%;
}
div {
margin-top: 50px;
}
}
.width25,
.width50,
.width100 {
width: 25%;
height: 200px;
overflow: hidden;
img {
height: 200px;
}
}
.width50 {
width: 50%;
}
.width100 {
width: 100%;
height: 360px;
img {
height: 360px;
}
div {
margin-top: 120px;
}
}
}
</style>
<script>
</script>
\ No newline at end of file
... ...
... ... @@ -5,35 +5,41 @@
</div>
<div class="company-data">
<div class="company-item" v-for="item in showData">
<h2>{{ $key }}</h2>
<a class="tag" :name="$key">{{ $key }}</a>
<span v-for="val in item" track-by="id" @click="select(val.id, val.company_name)">{{val.company_name}}</span>
</div>
</div>
<index-list style="margin-top:70px"></index-list>
</div>
</template>
<script>
const $ = require('yoho-jquery');
const indexList = require('component/tool/index-list.vue');
module.exports = {
props: ['company_list'],
data() {
this.company_list = JSON.parse(this.company_list);
return {
inputname: '',
data: {},
showData: {}
showData: this.company_list
};
},
components: {
indexList
},
methods: {
search: function() {
var inputname = this.inputname;
if (!inputname) {
this.showData = this.data;
this.showData = this.company_list;
return;
}
var filter = {};
for (var k in this.data) {
this.data[k].forEach(function(d){
for (var k in this.company_list) {
this.company_list[k].forEach(function(d){
if (d.company_name.indexOf(inputname) > -1) {
if (!filter[k]) filter[k] = [];
filter[k].push(d);
... ... @@ -51,27 +57,8 @@
// 重置列表
this.inputname = '';
this.showData = this.data;
this.showData = this.company_list;
}
},
activate: function(done) {
let _this = this;
$.ajax({
url: '/home/refund/companylist'
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code === 200) {
_this.data = res.data;
_this.showData = res.data;
}
done();
}).fail(function() {
tip('网络错误');
done();
});
}
};
</script>
\ No newline at end of file
</script>
... ...
... ... @@ -2,7 +2,6 @@
<div>
<brand-filter v-if="type === 'brand'" :data="data" :val.sync="val"></brand-filter>
<normal-filter v-else :data="data" :val.sync="val">
<slot></slot>
</normal-filter>
</div>
</template>
... ... @@ -19,7 +18,7 @@ module.exports = {
watch: {
val: function(newV, oldV) {
console.log(`type: ${this.type}, value: ${newV}`);
}
}
}
};
</script>
... ...
<template>
<div class="filter-detail">
<div class="item" v-for="item in data" :class="{active: item.id === value}" @click="toggleCheck(item.id)">
<div class="item" v-for="item in data" :class="{active: item.id === val}" @click="toggleCheck(item.id)">
<div class="item-inner">
{{item.name}}
</div>
... ... @@ -10,12 +10,11 @@
</template>
<script>
module.exports = {
props: ['data', 'type', 'value'],
props: ['data', 'type', 'val'],
computed: {},
methods: {
toggleCheck: function(val) {
this.value = val;
this.$parent.select(val);
this.val = val;
}
}
};
... ...
... ... @@ -3,7 +3,7 @@
<ul class="cardlist card-large clearfix">
<li class="card" v-for="item in data">
<div class="card-pic">
<a href="">
<a href="/product/{{item.id}}">
<img v-lazy="item.goodsList[0].imagesUrl | resize 372 499" alt="{{item.productName}}">
</a>
</div>
... ... @@ -28,7 +28,7 @@ module.exports = {
/* 开启滚动加载 */
disableFetch: Boolean,
//数据
// 数据
data: Array
},
methods: {
... ...
<template>
<div>
<!--<filter-sub :data="brand" :value="3" type="brand"></filter-sub>-->
<Sort :config="sortConfig" :val="sort">
</Sort>
<List :data="productList"></List>
... ... @@ -19,7 +18,6 @@
const list = require('product/list.vue');
const drawer = require('product/drawer.vue');
const filter = require('product/filter.vue');
const filterSub = require('product/filter/filter-detail.vue');
Vue.use(lazyload);
Vue.use(infinitScroll);
... ... @@ -51,7 +49,6 @@
list,
sort,
filter,
filterSub,
drawer
},
methods: {
... ... @@ -76,9 +73,11 @@
page: nextPage
})
.done(res => {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
if (res.code === 200) {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
}
})
.fail(error => {
tip('网络出错~');
... ...