Authored by yyq

商品基础信息

... ... @@ -6,8 +6,116 @@
'use strict';
const index = (req, res) => {
console.log(req.params);
res.display('item', {});
let data = {
goodInfo: {
name: 'Spring 2016NEWT-Shirt 2016迷彩蝴蝶夹克',
brandName: 'Supreme',
intro: '2016最新发布',
img: 'http://placehold.it/{width}x{height}',
sellPrice: 3199,
marketPrice: 4009,
colors: [
{
name: '黑色',
title: '黑色',
focus: true,
thumbs: [
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}'
],
sizes: [
{
name: 'S',
title: 'S',
sku: '12313',
num: 10
},
{
name: 'M',
title: 'M',
sku: '12314',
num: 14
},
{
name: 'L',
title: 'L',
sku: '12315',
num: 0
},
{
name: 'XL',
title: 'XL',
sku: '12316',
num: 0
}
],
rgb: '#000'
},
{
name: '黄色',
title: '黄色',
thumbs: [
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}'
],
rgb: '#efdc0e',
sizes: [
{
name: 'S',
title: 'S',
sku: '12313',
num: 0
},
{
name: 'M',
title: 'M',
sku: '12314',
num: 14
},
{
name: 'L',
title: 'L',
sku: '12315',
num: 0
},
{
name: 'XL',
title: 'XL',
sku: '12316',
num: 23
}
]
},
{
name: '蓝色',
title: '蓝色',
thumbs: [
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}'
],
rgb: '#2ea8e6'
},
{
name: '绿色',
title: '绿色',
thumbs: [
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}',
'http://placehold.it/{width}x{height}'
],
rgb: '#85b2ef'
}
]
}
};
res.display('item', data);
};
module.exports = {
... ...
<div class="product-item-page yoho-page">
<div class="center-content">
{{> path-nav}}
<div class="product-main clearfix">
<div class="thumbs left clearfix">
<div class="thumb-list">
<img class="thumb" data-original="http://placehold.it/75x100" src="http://placehold.it/75x100" style="display: block;">
<img class="thumb" data-original="http://placehold.it/75x100" src="http://placehold.it/75x100" style="display: block;">
<img class="thumb" data-original="http://placehold.it/75x100" src="http://placehold.it/75x100" style="display: block;">
{{# goodInfo}}
<div class="product-main clearfix">
<div class="thumbs left clearfix">
<div class="thumb-list">
{{# colors}}
<div class="thumb-wrap{{#unless focus}} hide{{/unless}}">
{{#if focus}}
{{# thumbs}}
<img class="thumb" src="{{image . 75 100}}" data-shower="{{image . 482 643}}">
{{/ thumbs}}
{{^}}
{{# thumbs}}
<img class="thumb" data-original="{{image . 75 100}}" data-shower="{{image . 482 643}}">
{{/ thumbs}}
{{/if}}
</div>
{{/ colors}}
</div>
<div class="thumb-show right">
<img id="main-thumb" src="{{image img 482 643}}" style="display: block;">
</div>
</div>
<div class="thumb-show right">
<img id="main-thumb" src="http://placehold.it/482x643" style="display: block;">
<div class="infos left clearfix">
<p class="brand-name">{{brandName}}</p>
<p class="name">{{name}}</p>
<p class="intro">{{intro}}</p>
<p class="sell-price">¥{{round sellPrice 2}}</p>
{{#if marketPrice}}
<p class="market-price">¥{{round marketPrice 2}}</p>
{{/if}}
<div class="trade-wrapper">
<div class="option-content">
<p class="choose-color">
<label class="title">Color:</label>
<span class="color">蓝色</span>
</p>
<div class="color-list">
{{# colors}}
{{> round-color}}
{{/ colors}}
</div>
<p class="choose-size">
<label class="title">Size:</label>
<span class="size">M</span>
</p>
<div class="sizes">
{{# colors}}
<ul class="size-list {{#unless focus}}hide{{/unless}} clearfix">
{{# sizes}}
<li {{#unless num}}class="disable"{{/unless}} data-title="{{title}}" data-sku="{{sku}}" data-num="{{num}}">{{name}}</li>
{{/ sizes}}
</ul>
{{/ colors}}
</div>
</div>
<p class="btns">
{{# fashionTopGoods}}
{{#if buyNow}}
<span class="btn">立即购买</span>
{{/if}}
{{#if openSoon}}
<span class="btn">即将开售</span>
{{/if}}
{{^}}
<span class="btn">加入购物袋</span>
{{/ fashionTopGoods}}
<span class="btn disable">已售罄</span>
<span class="btn white">收藏商品</span>
</p>
</div>
</div>
</div>
<div class="infos left clearfix">
<p class="brand-name">Supreme</p>
<p class="name">Spring 2016NEWT-Shirt 2016迷彩蝴蝶夹克</p>
<p class="batch-name">2016最新发布</p>
{{> round-color}}
</div>
</div>
{{/ goodInfo}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -16,7 +16,7 @@ module.exports = {
siteUrl: 'http://www.yohoblk.com',
domains: {
api: 'http://devapi.yoho.cn:58078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://devservice.yoho.cn:28077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
service: 'http://devservice.yoho.cn:58077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
search: 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: false,
... ...
<label class="round-color{{#if cur}} cur{{/if}}" title="{{title}}" data-color="{{color}}" data-color="{{total}}" style="background: #f00{{rgb}}">
<label class="round-color{{#if cur}} cur{{/if}}" title="{{title}}" data-color="{{color}}" data-color="{{total}}" style="background: {{rgb}}">
<span class="iconfont icon-cover">&#xe61b;</span>
<span class="iconfont icon-round">&#xe620;</span>
</label>
\ No newline at end of file
... ...