Authored by xiaowei

Merge branch 'release/4.4-master' of http://git.dev.yoho.cn/web/yohobuy into release/4.4-master

Showing 35 changed files with 2501 additions and 455 deletions
  1 +<?php
  2 +
  3 +namespace LibModels\Web\Product;
  4 +
  5 +use Api\Yohobuy;
  6 +use Api\Sign;
  7 +/**
  8 + * 品牌店铺的接口
  9 + * @info http://git.dev.yoho.cn/yoho-documents/api-interfaces/blob/master/%E5%95%86%E5%93%81%E5%88%97%E8%A1%A8/brandShops.md
  10 + * @copyright yoho.inc
  11 + * @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn>
  12 + */
  13 +class ShopData
  14 +{
  15 + /**
  16 + * 获取店铺装修的所有资源接口
  17 + * @param type int $shopId 店铺id
  18 + * @return type []
  19 + */
  20 + public static function shopsDecoratorList($shopId)
  21 + {
  22 + $param = Yohobuy::param();
  23 + $param['method'] = 'app.shopsdecorator.getList';
  24 + $param['shop_id'] = intval($shopId);
  25 + $param['client_secret'] = Sign::getSign($param);
  26 +
  27 + return Yohobuy::get(Yohobuy::API_URL, $param);
  28 + }
  29 + /**
  30 + * 查询店铺介绍接口
  31 + * @param type int $shopId 店铺id
  32 + * @return type []
  33 + */
  34 + public static function getIntro($shopId, $uid = '')
  35 + {
  36 + $param = Yohobuy::param();
  37 + $param['method'] = 'app.shops.getIntro';
  38 + $param['shop_id'] = intval($shopId);
  39 + $param['uid'] = $uid;
  40 + $param['client_secret'] = Sign::getSign($param);
  41 +
  42 + return Yohobuy::get(Yohobuy::API_URL, $param);
  43 + }
  44 +
  45 + /**
  46 + * 查询店铺下面的所有品牌
  47 + * @param type int $shopId 店铺id
  48 + * @return type []
  49 + */
  50 + public static function getShopsBrands($shopId)
  51 + {
  52 + $param = Yohobuy::param();
  53 + $param['method'] = 'app.shops.getShopsBrands';
  54 + $param['shop_id'] = intval($shopId);
  55 + $param['client_secret'] = Sign::getSign($param);
  56 +
  57 + return Yohobuy::get(Yohobuy::API_URL, $param);
  58 + }
  59 +
  60 + /**
  61 + * 搜索店铺内商品 || 查询该店铺下全部商品
  62 + * @param type int $shopId 店铺id
  63 + * @return type []
  64 + */
  65 + public static function getSearch($shopId)
  66 + {
  67 + $param = Yohobuy::param();
  68 + $param['method'] = 'app.search.li';
  69 + $param['shop'] = intval($shopId);
  70 + $param['client_secret'] = Sign::getSign($param);
  71 +
  72 + return Yohobuy::get(Yohobuy::API_URL, $param);
  73 + }
  74 +
  75 + /**
  76 + * 查询该店铺下所有二级品类
  77 + * @param type int $shopId 店铺id
  78 + * @param type string $yhChannel 频道
  79 + * @param type string $gender 性别
  80 + * @return type []
  81 + */
  82 + public static function getSortInfo($shopId, $yhChannel = '', $gender = '')
  83 + {
  84 + $param = Yohobuy::param();
  85 + $param['method'] = 'app.shop.getSortInfo';
  86 + $param['shop_id'] = intval($shopId);
  87 + $param['yh_channel'] = $yhChannel;
  88 + $param['gender'] = $gender;
  89 + $param['client_secret'] = Sign::getSign($param);
  90 +
  91 + return Yohobuy::get(Yohobuy::API_URL, $param);
  92 + }
  93 +
  94 + /**
  95 + * 收藏|取消 店铺接口
  96 + * @param type int $shopId 店铺id
  97 + * @param type Boolean $isfavorite true:收藏,false:取消
  98 + * @param type string $type 收藏的类型,brand、product、shop
  99 + * @return type []
  100 + */
  101 + public static function setFavorite($shopId, $isfavorite, $uid, $type = 'shop')
  102 + {
  103 + $param = Yohobuy::param();
  104 + $param['method'] = $isfavorite ? 'app.favorite.add' : 'app.favorite.cancel';
  105 + $param['id'] = intval($shopId);
  106 + $param['fav_id'] = intval($shopId);
  107 + $param['uid'] = $uid;
  108 + $param['type'] = $type;
  109 + $param['client_secret'] = Sign::getSign($param);
  110 + return Yohobuy::get(Yohobuy::API_URL, $param);
  111 + }
  112 + /**
  113 + * 根据domain查找shop_id
  114 + * @param type string $domain 品牌域名
  115 + * @return type []
  116 + */
  117 + public static function byDomain($domain)
  118 + {
  119 + $param = Yohobuy::param();
  120 + $param['method'] = 'web.brand.byDomain';
  121 + $param['domain'] = $domain;
  122 + $param['client_secret'] = Sign::getSign($param);
  123 + return Yohobuy::get(Yohobuy::API_URL, $param);
  124 + }
  125 +}
@@ -177,8 +177,15 @@ class HelperSearch @@ -177,8 +177,15 @@ class HelperSearch
177 self::setSearchNav($data['product']['total']); 177 self::setSearchNav($data['product']['total']);
178 } 178 }
179 //品牌店铺信息 179 //品牌店铺信息
180 - if (isset($data['shop']) && !empty($data['shop']) && isset($data['shopSort'])) {  
181 - $result['shopEntry'] = self::shop($data['shop'], $data['shopSort']); 180 + if (isset($data['shopData']) && !empty($data['shopData'])) {
  181 + $result['shopEntry'] = array();
  182 + foreach ($data['shopData'] as $val) {
  183 + $shopSort = self::shop($val['shop'], $val['shopSort']);
  184 + if (empty($shopSort)) {
  185 + continue;
  186 + }
  187 + $result['shopEntry'][] = $shopSort;
  188 + }
182 } 189 }
183 //分页 190 //分页
184 if (isset($result['totalCount'])) { 191 if (isset($result['totalCount'])) {
@@ -307,6 +314,11 @@ class HelperSearch @@ -307,6 +314,11 @@ class HelperSearch
307 $isNew = false; 314 $isNew = false;
308 $isSale = false; 315 $isSale = false;
309 } 316 }
  317 +
  318 + if (isset($options['isNew']) && $options['isNew']) {
  319 + $isNew = true;
  320 + }
  321 +
310 //SALE、NEW标签不共存 322 //SALE、NEW标签不共存
311 if ($isNew) { 323 if ($isNew) {
312 $isSale = false; 324 $isSale = false;
@@ -323,7 +335,7 @@ class HelperSearch @@ -323,7 +335,7 @@ class HelperSearch
323 'name' => $val['product_name'], 335 'name' => $val['product_name'],
324 'salePrice' => $val['sales_price'], 336 'salePrice' => $val['sales_price'],
325 'brand' => array( 337 'brand' => array(
326 - 'url' => Helpers::url('', '', $val['brand_domain']), 338 + 'url' => Helpers::url('', '', isset($val['brand_domain']) ? $val['brand_domain'] : ''),
327 'name' => $val['brand_name'] 339 'name' => $val['brand_name']
328 ), 340 ),
329 'isFew' => $isFew, 341 'isFew' => $isFew,
@@ -1426,7 +1438,7 @@ class HelperSearch @@ -1426,7 +1438,7 @@ class HelperSearch
1426 public static function shop($shop, $shopSort) 1438 public static function shop($shop, $shopSort)
1427 { 1439 {
1428 $shopEntry = array(); 1440 $shopEntry = array();
1429 - if (self::$total == 0) { 1441 + if (self::$total == 0 || empty($shopSort)) {
1430 return $shopEntry; 1442 return $shopEntry;
1431 } 1443 }
1432 $url = Helpers::url('', '', $shop['brand_domain']); 1444 $url = Helpers::url('', '', $shop['brand_domain']);
@@ -1446,6 +1458,7 @@ class HelperSearch @@ -1446,6 +1458,7 @@ class HelperSearch
1446 $sort[] = $sortInfo; 1458 $sort[] = $sortInfo;
1447 } 1459 }
1448 } 1460 }
  1461 + $shop['brand_ico'] = strstr($shop['brand_ico'], '?', true);
1449 $shopEntry['home'] = $url; 1462 $shopEntry['home'] = $url;
1450 $shopEntry['logo'] = Images::getImageUrl($shop['brand_ico'], 80, 50, 1, 'brandLogo'); 1463 $shopEntry['logo'] = Images::getImageUrl($shop['brand_ico'], 80, 50, 1, 'brandLogo');
1451 $shopEntry['shopName'] = $shop['brand_name']; 1464 $shopEntry['shopName'] = $shop['brand_name'];
@@ -1050,4 +1050,23 @@ class Helpers @@ -1050,4 +1050,23 @@ class Helpers
1050 return true; 1050 return true;
1051 } 1051 }
1052 1052
  1053 + /**
  1054 + * 格式化产品url
  1055 + * @param type int $productId 产品id
  1056 + * @param type $productSkn 产品编号
  1057 + * @param type $productName 产品名称
  1058 + * @param type $cnAlphaBet
  1059 + * @return type url
  1060 + */
  1061 + public static function getProductUrl($productId, $productSkn, $productName = '', $cnAlphaBet = '')
  1062 + {
  1063 + $cnAlphaBet = empty($cnAlphaBet) ? $cnAlphaBet : md5($productName);
  1064 +
  1065 + return self::url(
  1066 + '/product/pro_' . $productId . '_' .
  1067 + $productSkn . '/' . $cnAlphaBet . '.html',
  1068 + null,
  1069 + 'item'
  1070 + );
  1071 + }
1053 } 1072 }
@@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
108 </div> 108 </div>
109 </td> 109 </td>
110 <td class="productPrice">¥{{productPrice}}</td> 110 <td class="productPrice">¥{{productPrice}}</td>
111 - <td>{{yohoIcon}}</td> 111 + <td>{{yohoIcon}}</td>
112 <td class="adjust-cart-num"> 112 <td class="adjust-cart-num">
113 {{#if isGift}} 113 {{#if isGift}}
114 <div>{{productNum}}</div> 114 <div>{{productNum}}</div>
@@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
163 <span class="vipPrice">(VIP)</span> 163 <span class="vipPrice">(VIP)</span>
164 {{/isVipPrice}} 164 {{/isVipPrice}}
165 </td> 165 </td>
166 - <td>{{yohoIcon}}</td> 166 + <td>{{yohoIcon}}</td>
167 <td class="adjust-cart-num"> 167 <td class="adjust-cart-num">
168 {{#if isGift}} 168 {{#if isGift}}
169 <div>{{productNum}}</div> 169 <div>{{productNum}}</div>
@@ -259,7 +259,7 @@ @@ -259,7 +259,7 @@
259 <del class="wapper-price" style="margin-right: 5px;"{{marketPrice}}</del> 259 <del class="wapper-price" style="margin-right: 5px;"{{marketPrice}}</del>
260 <span class="subjoin-price"{{subjoinPrice}}</span> 260 <span class="subjoin-price"{{subjoinPrice}}</span>
261 </td> 261 </td>
262 - <td style="width:7%;">{{yohoIcon}}</td> 262 + <td style="width:7%;">{{yohoIcon}}</td>
263 <td style="width:10%;">1</td> 263 <td style="width:10%;">1</td>
264 <td style="width:10%;">¥{{subjoinPrice}}</td> 264 <td style="width:10%;">¥{{subjoinPrice}}</td>
265 <td style="width:20%; border-right: none;"> 265 <td style="width:20%; border-right: none;">
@@ -318,7 +318,11 @@ @@ -318,7 +318,11 @@
318 {{/unless}} 318 {{/unless}}
319 <div class="right"> 319 <div class="right">
320 <p class="sum">商品总价(¥{{cartEnsure.productAmmount}})- 活动(¥{{cartEnsure.activeSale}})= 商品金额总计(¥{{cartEnsure.productAllA}})</p> 320 <p class="sum">商品总价(¥{{cartEnsure.productAmmount}})- 活动(¥{{cartEnsure.activeSale}})= 商品金额总计(¥{{cartEnsure.productAllA}})</p>
321 - <p>获赠YOHO币:{{cartEnsure.getYoho}}个 商品总价(不含运费):<strong>¥{{cartEnsure.productAllA}}</strong> 元</p> 321 + <p>
  322 + <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
  323 + 共返YOHO币:{{cartEnsure.getYoho}}个 商品总价(不含运费):
  324 + <strong>¥{{cartEnsure.productAllA}}</strong>
  325 + </p>
322 </div> 326 </div>
323 </div> 327 </div>
324 <div class="cartnew-submit" id="payDiv"> 328 <div class="cartnew-submit" id="payDiv">
1 -{{> layout/header}}  
2 -<div class="order-ensure-page yoho-page clearfix">  
3 -{{# orderEnsure}}  
4 - <div class="order-edit">  
5 - <div class="order-title">  
6 - <ul>  
7 - <li class="first">查看购物车</li>  
8 - <li class="active">填写订单</li>  
9 - <li class="end">付款,完成购买</li>  
10 - </ul>  
11 - </div>  
12 -  
13 - <div class="order-edit-main" id="order-edit-main" {{#isNewUser}}data-new="new"{{/isNewUser}} cartType="{{cartType}}">  
14 - <h2 class="title">请填写并核对以下信息  
15 - <a href="{{cartUrl}}" class="btn_backcart"></a>  
16 - </h2>  
17 - <div class="order-content">  
18 - <div class="order-selection address-list">  
19 - <h2>收货地址:<span>[修改]</span></h2>  
20 - <div class="address-list-inner">  
21 - <ul class="exist-address-list">  
22 - {{#each hasAddress}}  
23 - <li class="has-exist-address">  
24 - <input class="radio" type="radio" name="exist-address" id="{{id}}" {{#if checked}}checked{{/if}}/>  
25 - <label for="{{id}}">  
26 - <strong>{{user}}</strong>  
27 - <span>{{address}}</span>  
28 - <b class="default-address">设为默认地址</b>  
29 - <div class="order-modify-btn">  
30 - <span class="address-modify">[修改]</span>  
31 - <span class="address-del">[删除]</span>  
32 - </div>  
33 - </label>  
34 - </li>  
35 - {{/each}}  
36 -  
37 - <li class="use-new-address hide">  
38 - <input class="radio add-address" type="radio" name="address" id=""/>  
39 - <label for="">使用新地址</label>  
40 - </li>  
41 - </ul>  
42 -  
43 - <div class="address-manage hide" cart-type="{{cartType}}">  
44 - <ul>  
45 - <li>  
46 - <span class="address-legend"><i>*</i>收货人姓名:</span>  
47 - <input type="text" name="name" class="name text-input"/>  
48 - <span>请填写您的真实姓名,最多5个汉字</span>  
49 - </li>  
50 - <li>  
51 - <span class="address-legend"><i>*</i>省市:</span>  
52 - <select name="province" id="" class="text-input">  
53 - </select>  
54 - <select name="city" id="" class="text-input">  
55 - </select>  
56 - <select name="county" id="" class="text-input">  
57 - </select>  
58 - <input type="text" name="address" class="text-input"/>  
59 - <span>标'*'的为支持加急送的地区,请输入收货的详细地址</span>  
60 - </li>  
61 - <li>  
62 - <span class="address-legend"><i>*</i>手机号码:</span>  
63 - <input type="text" name="phone" class="text-input"/>  
64 - <span>填写正确手机号便于接收发货和收货通知</span>  
65 - </li>  
66 - <li>  
67 - <span class="address-legend">固定电话:</span>  
68 - <div class="address-tel-input">  
69 - <input type="text" name="tel-code" class="tel-lengend text-input"/>  
70 - <input type="text" name="tel" class="text-input"/>  
71 -  
72 - </div>  
73 - <span>如:010-12345678,固话和手机号至少填一项</span>  
74 - </li>  
75 - <li>  
76 - <span class="address-legend">电子邮件:</span>  
77 - <input type="text" name="mail" class="text-input"/>  
78 - <span>用来接收订单提醒邮件,便于您及时了解订单状态</span>  
79 - </li>  
80 - <li>  
81 - <span class="address-legend">邮编:</span>  
82 - <input type="text" name="code" class="text-input"/>  
83 - <span>请填写准确的邮编,以确保商品尽快送达</span>  
84 - </li>  
85 - </ul>  
86 - </div>  
87 - <span class="save-btn hide">保存并送到这个地址</span>  
88 - </div>  
89 - </div>  
90 -  
91 - <div class="order-selection pay-time">  
92 - <h2>支付及送货时间:<span class="switch-pay-modify">[修改]</span></h2>  
93 - <ul class="modity-pay-info">  
94 - <li>付款方式:<span>{{defaultPayWay}}</span></li>  
95 - {{#if isPreSell}}  
96 - <li class="prev-sell-item">发货时间:商品到货后立即发货</li>  
97 - {{/if}}  
98 - <li>送货时间:<span>{{defaultDelivery}}</span></li>  
99 - <li>送货前联系我:<span>否</span></li>  
100 - </ul>  
101 -  
102 - <div class="pay-time-modify hide">  
103 - <h3 class="pay-time-title">支付方式</h3>  
104 - <ul>  
105 - <li class="pay-dashed-hr pay-recommend">  
106 - <div class="pay-type-legend">  
107 - <input value="1" {{#if onlinePay.checked}} checked{{/if}} class="radio {{#if onlinePay.checked}}checked{{/if}}" name="pay-type" type="radio" id="" data-pay="{{onlinePay.paymentId}}"/>  
108 - <label for="">在线支付(推荐)</label>  
109 - </div>  
110 - <span class="pay-type-legend">查看支持在线支付的银行和平台</span>  
111 - <div class="support-type hide">  
112 - <h4>支持以下支付平台在线支付:</h4>  
113 - <ul>  
114 - {{#each supportLine}}  
115 - <li><img src="{{src}}" alt=""/></li>  
116 - {{/each}}  
117 - </ul>  
118 - <h4>支持以下银行在线支付:</h4>  
119 - <ul>  
120 - {{#each supportBank}}  
121 - <li><img src="{{src}}" alt=""/></li>  
122 - {{/each}}  
123 - </ul>  
124 - </div>  
125 - </li>  
126 -  
127 - <li>  
128 - {{#if supportDeliveryPay}}  
129 - <input value="2" {{#if deliveryPay.checked}}checked{{/if}} class="radio {{#if deliveryPay.checked}}checked{{/if}}" name="pay-type" type="radio" id="" data-pay="{{deliveryPay.paymentId}}"/>  
130 - {{/if}}  
131 - <label for="">货到付款</label>  
132 - <span class="pay-type-tips">  
133 - {{#if packages}}  
134 - 注:您订单中的商品暂不支持货到付款,请您选择在线支付。  
135 - {{^}}  
136 - 注:{{paymentInCashInfo}}  
137 - {{/if}}  
138 - </span>  
139 - </li>  
140 - </ul>  
141 -  
142 - <h3>送货时间</h3>  
143 - <ul>  
144 - {{#each delivery}}  
145 - <li>  
146 - <input {{#if checked}}checked{{/if}} value={{id}} class="radio" name="pay-time-radio" type="radio" id="{{id}}"/>  
147 - <label for="">{{desc}}</label>  
148 - </li>  
149 - {{/each}}  
150 -  
151 - <li class="pay-dashed-hr pay-type-tips">声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>  
152 -  
153 - <li>  
154 - <span>送货前是否联系:</span>  
155 - <input value="Y" class="radio" name="call-me" type="radio" id=""/>  
156 - <label for="">是</label>  
157 - <input value="N" checked class="radio" name="call-me" type="radio" id=""/>  
158 - <label for="">否</label>  
159 - </li>  
160 - </ul>  
161 -  
162 - <span class="pay-btn">确定</span>  
163 - </div>  
164 - </div>  
165 -  
166 - <div class="order-selection select-express">  
167 - <h2>选择快递:</h2>  
168 - {{#each carriageList}}  
169 - <div class="express-list">  
170 - <input {{# checked}}checked{{/ checked}} class="radio" type="radio" name="carriagegroup" id="common-{{id}}" value="{{id}}"/>  
171 - <label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>  
172 - </div>  
173 - {{/each}}  
174 - <div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。  
175 - </div>  
176 - <div class="express-list hide is-sup"><span class="sf">您所选择的区域暂不在顺风派送范围内,</span><a style="text-decoration: none;" target="_blank" href="{{sfUrl}}">点击查看详情</a></div>  
177 - <div class="express-list sf hide">如您购买的商品为航空禁运品顺丰会用陆运的方式给你派送,预计3-5天送达,请您见谅</div>  
178 - </div>  
179 - </div>  
180 - </div>  
181 - </div>  
182 - <!-- 订单提示-->  
183 -  
184 - {{#if packages}}  
185 - <div id="differentOrder" class="differentOrder">  
186 - <p class="warn">  
187 - 温馨提示:你购买的商品<span class="red">分属不同的仓库</span>,需要调拨,将被拆分为多个包裹送达  
188 - <span class="why">  
189 - </span>  
190 - </p>  
191 - <div id="differentBag" class="differentBag">  
192 - {{#each packages}}  
193 - <div class="bag">  
194 - <h3>  
195 - {{title}}  
196 - </h3>  
197 - <p class="pre">  
198 - </p>  
199 - <div class="bagDetil">  
200 - <ul>  
201 - {{#each goodlist}}  
202 - <li >  
203 - <a href={{link}}>  
204 - <img src={{src}}/>  
205 -  
206 - </a>  
207 - {{#if goodsType}}  
208 - <p class="{{classname}}" >{{goodsType}}</p>  
209 - {{/if}}  
210 - </li>  
211 - {{/each}}  
212 - </ul>  
213 - </div>  
214 - <p class="next">  
215 - </p>  
216 - {{#if fee}}  
217 - <p>运费:¥{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>  
218 - {{else}}  
219 - <p>运费:¥0.00元</p>  
220 - {{/if}}  
221 - </div>  
222 - {{/each}}  
223 -  
224 - </div>  
225 - </div>  
226 - {{/if}}  
227 - <div class="order-pay">  
228 - <div class="pay-wapper">  
229 - <table>  
230 - <thead>  
231 - <tr>  
232 - <th style="width:40%;">  
233 - 商品信息  
234 - </th>  
235 - <th style="width:10%;">单价(元)</th>  
236 - <th style="width:10%;">返YOHO币</th>  
237 - <th style="width:10%;">数量</th>  
238 - <th style="width:10%;">小计(元)</th>  
239 - <th style="width:20%;">商品金额(元)</th>  
240 - </tr>  
241 - </thead>  
242 - <tbody>  
243 - {{#each orderProducts}}  
244 - <tr>  
245 - <td>  
246 - <div class="pay-pro">  
247 - <a class="pay-pro-icon" href="{{link}}">  
248 - <img src="{{imgCover}}" />  
249 - {{#isPriceGift}}  
250 - <span class="incentive">加价购</span>  
251 - {{/isPriceGift}}  
252 - {{#isGift}}  
253 - <span class="gift">赠品</span>  
254 - {{/isGift}}  
255 - </a>  
256 - <p class="pay-pro-info">  
257 - <a href="{{link}}" target="_blank">{{productTitle}}</a>  
258 - <span>颜色:{{productColor}} 尺码:{{productSize}}</span>  
259 - </p>  
260 - </div>  
261 - </td>  
262 - <td>  
263 - {{productPrice}}  
264 - {{#isVipPrice}}  
265 - <span class="vipPrice">(VIP)</span>  
266 - {{/isVipPrice}}  
267 - </td>  
268 - <td>{{yohoIcon}}</td>  
269 - <td>{{productNum}}</td>  
270 - <td class="cart-sub-total {{#xForOne}}xforone{{/xForOne}}">  
271 - {{#if xForOne}}  
272 - <del>{{productSubtotal}}</del>  
273 - <span class="free"></span>  
274 - {{^}}  
275 - {{productSubtotal}}  
276 - {{/if}}  
277 - </td>  
278 - <td class="cart-sub-total-all">{{productSubtotal}}</td>  
279 - </tr>  
280 - {{/each}}  
281 - </tbody>  
282 - </table>  
283 - <!--YOHO-->  
284 - <div class="play-content clearfix">  
285 - <div class="play-left">  
286 - <dl class="play-piao-pan pan">  
287 - <dt>索要发票</dt>  
288 - <dd>  
289 - <div class="play-pan">  
290 - <ul>  
291 - <li><label>发票抬头 :</label><input type="text" class="textbox" id="piaodesc" /></li>  
292 - <li><label>发票类型 :</label> <select class="dropdown" id="piaotype">  
293 - <option value="0">请选择</option>  
294 - {{#each piaoTypes}}  
295 - <option value="{{id}}">{{name}}</option>  
296 - {{/each}}  
297 - </select> </li>  
298 - </ul>  
299 - </div>  
300 - </dd>  
301 - </dl>  
302 - <dl class="play-remark-pan pan">  
303 - <dt>添加备注信息</dt>  
304 - <dd>  
305 - <div class="play-pan">  
306 - <textarea class="textbox" id="notedesc"></textarea>  
307 - <p class="note">声明:备注中有关收货人信息、支付方式、配送方式、发票信息等购买要求一律以上面的选择为准,备注无效。</p>  
308 - <p>是否打印价格:  
309 - <input name="isPP" id="isPPY" type="radio" value="Y" checked="">  
310 - <label for="isPPY">是</label>  
311 - <input name="isPP" id="isPPN" type="radio" value="N">  
312 - <label for="isPPN">否</label>  
313 - (如:送朋友的商品可不打印价格哦!)  
314 - </p>  
315 - </div>  
316 - </dd>  
317 - </dl>  
318 - </div>  
319 - <div class="play-right">  
320 - {{#if totalYoho}}  
321 - <div class="back-coin">  
322 - <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个  
323 - </div>  
324 - {{/if}}  
325 - <ul class="play-total">  
326 - {{#each promotionFormulaList}}  
327 - <li class="{{#if isExpress}}total-express-w{{/if}}">  
328 - <label>{{promotion}}</label><em>{{promotionAmount}}</em>  
329 - </li>  
330 - {{/each}}  
331 - </ul>  
332 -  
333 - {{#if showCouponPay}}  
334 - <dl class="play-juan-pan pan">  
335 - <dt>使用优惠券支付</dt>  
336 - <dd>  
337 - <div class="play-pan">  
338 - <p class="strong">请选择您要使用的优惠券: </p>  
339 - <p class="strong orange">(OUTLET商品除免邮券外不可使用优惠券)</p>  
340 - <p class="strong orange">(订单中使用优惠券将不赠送商品返还的YOHO币)</p>  
341 - <div class="play-juan">  
342 - <ul>  
343 - <li>  
344 - <input checked name="juangroup" type="radio" value="">  
345 - <label>直接输入优惠码: </label>  
346 - <input type="text" class="textbox" id="juancode" />  
347 - </li>  
348 - </ul>  
349 - </div>  
350 -  
351 - <p class="errtip red"></p>  
352 - <div class="btn-group clearfix">  
353 - <input type="button" class="ok" value="确定" id="juansubmit"/>  
354 - <input type="button" class="cancel cancel-code" value="取消"/>  
355 - </div>  
356 - </div>  
357 - </dd>  
358 - </dl>  
359 - {{/if}}  
360 - <dl class="play-bi-pan pan">  
361 - <dt>使用YOHO币支付</dt>  
362 - <dd>  
363 - <div class="play-pan">  
364 - <div class="strong">  
365 - 使用YOHO币:  
366 - <input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" />  
367 - </div>  
368 - <p >  
369 - 您目前有YOHO币 <em class="strong">{{ownYohoCoin}}</em>  
370 - </p>  
371 - <p class="errbitip red"></p>  
372 - <div class="btn-group clearfix">  
373 - <input type="button" class="ok" value="确定" id="bisubmit"/>  
374 - <input type="button" class="cancel cancel-bi" value="取消"/>  
375 - </div>  
376 - </div>  
377 - </dd>  
378 - </dl>  
379 -  
380 - {{#if redEnvelopes}}  
381 - <div class="red-envelopes active">  
382 - <div class="use-envelopes">  
383 - <input checked value="0" data-all="{{redEnvelopes}}" data-use="{{useRedEnvelopes}}" type="checkbox" />使用现金红包支付:<span>-¥{{useRedEnvelopes}}</span>  
384 - </div>  
385 - <div class="has-envelopes">您的现金红包余额:<span></span></div>  
386 - </div>  
387 - {{/if}}  
388 - </div>  
389 - </div>  
390 - </div>  
391 -  
392 - <div class="to-play">  
393 - <p>您需要实际支付金额:<em>{{lastOrderAmount}}</em>元</p>  
394 - <div class="btn-group clearfix">  
395 - <input type="button" class="submit" value="去付款"/>  
396 - </div>  
397 - </div>  
398 - </div>  
399 -{{/ orderEnsure}}  
400 -<div class="loading"><span></span>请稍后...</div>  
401 -</div> 1 +{{> layout/header}}
  2 +<div class="order-ensure-page yoho-page clearfix">
  3 +{{# orderEnsure}}
  4 + <div class="order-edit">
  5 + <div class="order-title">
  6 + <ul>
  7 + <li class="first">查看购物车</li>
  8 + <li class="active">填写订单</li>
  9 + <li class="end">付款,完成购买</li>
  10 + </ul>
  11 + </div>
  12 +
  13 + <div class="order-edit-main" id="order-edit-main" {{#isNewUser}}data-new="new"{{/isNewUser}} cartType="{{cartType}}">
  14 + <h2 class="title">请填写并核对以下信息
  15 + <a href="{{cartUrl}}" class="btn_backcart"></a>
  16 + </h2>
  17 + <div class="order-content">
  18 + <div class="order-selection address-list">
  19 + <h2>收货地址:<span>[修改]</span></h2>
  20 + <div class="address-list-inner">
  21 + <ul class="exist-address-list">
  22 + {{#each hasAddress}}
  23 + <li class="has-exist-address">
  24 + <input class="radio" type="radio" name="exist-address" id="{{id}}" {{#if checked}}checked{{/if}}/>
  25 + <label for="{{id}}">
  26 + <strong>{{user}}</strong>
  27 + <span>{{address}}</span>
  28 + <b class="default-address">设为默认地址</b>
  29 + <div class="order-modify-btn">
  30 + <span class="address-modify">[修改]</span>
  31 + <span class="address-del">[删除]</span>
  32 + </div>
  33 + </label>
  34 + </li>
  35 + {{/each}}
  36 +
  37 + <li class="use-new-address hide">
  38 + <input class="radio add-address" type="radio" name="address" id=""/>
  39 + <label for="">使用新地址</label>
  40 + </li>
  41 + </ul>
  42 +
  43 + <div class="address-manage hide" cart-type="{{cartType}}">
  44 + <ul>
  45 + <li>
  46 + <span class="address-legend"><i>*</i>收货人姓名:</span>
  47 + <input type="text" name="name" class="name text-input"/>
  48 + <span>请填写您的真实姓名,最多5个汉字</span>
  49 + </li>
  50 + <li>
  51 + <span class="address-legend"><i>*</i>省市:</span>
  52 + <select name="province" id="" class="text-input">
  53 + </select>
  54 + <select name="city" id="" class="text-input">
  55 + </select>
  56 + <select name="county" id="" class="text-input">
  57 + </select>
  58 + <input type="text" name="address" class="text-input"/>
  59 + <span>标'*'的为支持加急送的地区,请输入收货的详细地址</span>
  60 + </li>
  61 + <li>
  62 + <span class="address-legend"><i>*</i>手机号码:</span>
  63 + <input type="text" name="phone" class="text-input"/>
  64 + <span>填写正确手机号便于接收发货和收货通知</span>
  65 + </li>
  66 + <li>
  67 + <span class="address-legend">固定电话:</span>
  68 + <div class="address-tel-input">
  69 + <input type="text" name="tel-code" class="tel-lengend text-input"/>
  70 + <input type="text" name="tel" class="text-input"/>
  71 +
  72 + </div>
  73 + <span>如:010-12345678,固话和手机号至少填一项</span>
  74 + </li>
  75 + <li>
  76 + <span class="address-legend">电子邮件:</span>
  77 + <input type="text" name="mail" class="text-input"/>
  78 + <span>用来接收订单提醒邮件,便于您及时了解订单状态</span>
  79 + </li>
  80 + <li>
  81 + <span class="address-legend">邮编:</span>
  82 + <input type="text" name="code" class="text-input"/>
  83 + <span>请填写准确的邮编,以确保商品尽快送达</span>
  84 + </li>
  85 + </ul>
  86 + </div>
  87 + <span class="save-btn hide">保存并送到这个地址</span>
  88 + </div>
  89 + </div>
  90 +
  91 + <div class="order-selection pay-time">
  92 + <h2>支付及送货时间:<span class="switch-pay-modify">[修改]</span></h2>
  93 + <ul class="modity-pay-info">
  94 + <li>付款方式:<span>{{defaultPayWay}}</span></li>
  95 + {{#if isPreSell}}
  96 + <li class="prev-sell-item">发货时间:商品到货后立即发货</li>
  97 + {{/if}}
  98 + <li>送货时间:<span>{{defaultDelivery}}</span></li>
  99 + <li>送货前联系我:<span>否</span></li>
  100 + </ul>
  101 +
  102 + <div class="pay-time-modify hide">
  103 + <h3 class="pay-time-title">支付方式</h3>
  104 + <ul>
  105 + <li class="pay-dashed-hr pay-recommend">
  106 + <div class="pay-type-legend">
  107 + <input value="1" {{#if onlinePay.checked}} checked{{/if}} class="radio {{#if onlinePay.checked}}checked{{/if}}" name="pay-type" type="radio" id="" data-pay="{{onlinePay.paymentId}}"/>
  108 + <label for="">在线支付(推荐)</label>
  109 + </div>
  110 + <span class="pay-type-legend">查看支持在线支付的银行和平台</span>
  111 + <div class="support-type hide">
  112 + <h4>支持以下支付平台在线支付:</h4>
  113 + <ul>
  114 + {{#each supportLine}}
  115 + <li><img src="{{src}}" alt=""/></li>
  116 + {{/each}}
  117 + </ul>
  118 + <h4>支持以下银行在线支付:</h4>
  119 + <ul>
  120 + {{#each supportBank}}
  121 + <li><img src="{{src}}" alt=""/></li>
  122 + {{/each}}
  123 + </ul>
  124 + </div>
  125 + </li>
  126 +
  127 + <li>
  128 + {{#if supportDeliveryPay}}
  129 + <input value="2" {{#if deliveryPay.checked}}checked{{/if}} class="radio {{#if deliveryPay.checked}}checked{{/if}}" name="pay-type" type="radio" id="" data-pay="{{deliveryPay.paymentId}}"/>
  130 + {{/if}}
  131 + <label for="">货到付款</label>
  132 + <span class="pay-type-tips">
  133 + {{#if packages}}
  134 + 注:您订单中的商品暂不支持货到付款,请您选择在线支付。
  135 + {{^}}
  136 + 注:{{paymentInCashInfo}}
  137 + {{/if}}
  138 + </span>
  139 + </li>
  140 + </ul>
  141 +
  142 + <h3>送货时间</h3>
  143 + <ul>
  144 + {{#each delivery}}
  145 + <li>
  146 + <input {{#if checked}}checked{{/if}} value={{id}} class="radio" name="pay-time-radio" type="radio" id="{{id}}"/>
  147 + <label for="">{{desc}}</label>
  148 + </li>
  149 + {{/each}}
  150 +
  151 + <li class="pay-dashed-hr pay-type-tips">声明:我们会努力按照您指定的时间配送,但因为天气、交通等各类因素影响,您的订单有可能会有延误现象,敬请谅解!</li>
  152 +
  153 + <li>
  154 + <span>送货前是否联系:</span>
  155 + <input value="Y" class="radio" name="call-me" type="radio" id=""/>
  156 + <label for="">是</label>
  157 + <input value="N" checked class="radio" name="call-me" type="radio" id=""/>
  158 + <label for="">否</label>
  159 + </li>
  160 + </ul>
  161 +
  162 + <span class="pay-btn">确定</span>
  163 + </div>
  164 + </div>
  165 +
  166 + <div class="order-selection select-express">
  167 + <h2>选择快递:</h2>
  168 + {{#each carriageList}}
  169 + <div class="express-list">
  170 + <input {{# checked}}checked{{/ checked}} class="radio" type="radio" name="carriagegroup" id="common-{{id}}" value="{{id}}"/>
  171 + <label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>
  172 + </div>
  173 + {{/each}}
  174 + <div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。
  175 + </div>
  176 + <div class="express-list hide is-sup"><span class="sf">您所选择的区域暂不在顺风派送范围内,</span><a style="text-decoration: none;" target="_blank" href="{{sfUrl}}">点击查看详情</a></div>
  177 + <div class="express-list sf hide">如您购买的商品为航空禁运品顺丰会用陆运的方式给你派送,预计3-5天送达,请您见谅</div>
  178 + </div>
  179 + </div>
  180 + </div>
  181 + </div>
  182 + <!-- 订单提示-->
  183 +
  184 + {{#if packages}}
  185 + <div id="differentOrder" class="differentOrder">
  186 + <p class="warn">
  187 + 温馨提示:你购买的商品<span class="red">分属不同的仓库</span>,需要调拨,将被拆分为多个包裹送达
  188 + <span class="why">
  189 + </span>
  190 + </p>
  191 + <div id="differentBag" class="differentBag">
  192 + {{#each packages}}
  193 + <div class="bag">
  194 + <h3>
  195 + {{title}}
  196 + </h3>
  197 + <p class="pre">
  198 + </p>
  199 + <div class="bagDetil">
  200 + <ul>
  201 + {{#each goodlist}}
  202 + <li >
  203 + <a href={{link}}>
  204 + <img src={{src}}/>
  205 +
  206 + </a>
  207 + {{#if goodsType}}
  208 + <p class="{{classname}}" >{{goodsType}}</p>
  209 + {{/if}}
  210 + </li>
  211 + {{/each}}
  212 + </ul>
  213 + </div>
  214 + <p class="next">
  215 + </p>
  216 + {{#if fee}}
  217 + <p>运费:¥{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>
  218 + {{else}}
  219 + <p>运费:¥0.00元</p>
  220 + {{/if}}
  221 + </div>
  222 + {{/each}}
  223 +
  224 + </div>
  225 + </div>
  226 + {{/if}}
  227 + <div class="order-pay">
  228 + <div class="pay-wapper">
  229 + <table>
  230 + <thead>
  231 + <tr>
  232 + <th style="width:40%;">
  233 + 商品信息
  234 + </th>
  235 + <th style="width:10%;">单价(元)</th>
  236 + <th style="width:10%;">返YOHO币</th>
  237 + <th style="width:10%;">数量</th>
  238 + <th style="width:10%;">小计(元)</th>
  239 + <th style="width:20%;">商品金额(元)</th>
  240 + </tr>
  241 + </thead>
  242 + <tbody>
  243 + {{#each orderProducts}}
  244 + <tr>
  245 + <td>
  246 + <div class="pay-pro">
  247 + <a class="pay-pro-icon" href="{{link}}">
  248 + <img src="{{imgCover}}" />
  249 + {{#isPriceGift}}
  250 + <span class="incentive">加价购</span>
  251 + {{/isPriceGift}}
  252 + {{#isGift}}
  253 + <span class="gift">赠品</span>
  254 + {{/isGift}}
  255 + </a>
  256 + <p class="pay-pro-info">
  257 + <a href="{{link}}" target="_blank">{{productTitle}}</a>
  258 + <span>颜色:{{productColor}} 尺码:{{productSize}}</span>
  259 + </p>
  260 + </div>
  261 + </td>
  262 + <td>
  263 + {{productPrice}}
  264 + {{#isVipPrice}}
  265 + <span class="vipPrice">(VIP)</span>
  266 + {{/isVipPrice}}
  267 + </td>
  268 + <td>{{yohoIcon}}个</td>
  269 + <td>{{productNum}}</td>
  270 + <td class="cart-sub-total {{#xForOne}}xforone{{/xForOne}}">
  271 + {{#if xForOne}}
  272 + <del>{{productSubtotal}}</del>
  273 + <span class="free"></span>
  274 + {{^}}
  275 + {{productSubtotal}}
  276 + {{/if}}
  277 + </td>
  278 + <td class="cart-sub-total-all">{{productSubtotal}}</td>
  279 + </tr>
  280 + {{/each}}
  281 + </tbody>
  282 + </table>
  283 + <!--YOHO-->
  284 + <div class="play-content clearfix">
  285 + <div class="play-left">
  286 + <dl class="play-piao-pan pan">
  287 + <dt>索要发票</dt>
  288 + <dd>
  289 + <div class="play-pan">
  290 + <ul>
  291 + <li><label>发票抬头 :</label><input type="text" class="textbox" id="piaodesc" /></li>
  292 + <li><label>发票类型 :</label> <select class="dropdown" id="piaotype">
  293 + <option value="0">请选择</option>
  294 + {{#each piaoTypes}}
  295 + <option value="{{id}}">{{name}}</option>
  296 + {{/each}}
  297 + </select> </li>
  298 + </ul>
  299 + </div>
  300 + </dd>
  301 + </dl>
  302 + <dl class="play-remark-pan pan">
  303 + <dt>添加备注信息</dt>
  304 + <dd>
  305 + <div class="play-pan">
  306 + <textarea class="textbox" id="notedesc"></textarea>
  307 + <p class="note">声明:备注中有关收货人信息、支付方式、配送方式、发票信息等购买要求一律以上面的选择为准,备注无效。</p>
  308 + <p>是否打印价格:
  309 + <input name="isPP" id="isPPY" type="radio" value="Y" checked="">
  310 + <label for="isPPY">是</label>
  311 + <input name="isPP" id="isPPN" type="radio" value="N">
  312 + <label for="isPPN">否</label>
  313 + (如:送朋友的商品可不打印价格哦!)
  314 + </p>
  315 + </div>
  316 + </dd>
  317 + </dl>
  318 + </div>
  319 + <div class="play-right">
  320 + <div class="back-coin">
  321 + <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个
  322 + </div>
  323 + <ul class="play-total">
  324 + {{#each promotionFormulaList}}
  325 + <li class="{{#if isExpress}}total-express-w{{/if}}">
  326 + <label>{{promotion}}</label><em>{{promotionAmount}}</em>
  327 + </li>
  328 + {{/each}}
  329 + </ul>
  330 +
  331 + {{#if showCouponPay}}
  332 + <dl class="play-juan-pan pan">
  333 + <dt>使用优惠券支付</dt>
  334 + <dd>
  335 + <div class="play-pan">
  336 + <p class="strong">请选择您要使用的优惠券: </p>
  337 + <p class="strong orange">(OUTLET商品除免邮券外不可使用优惠券)</p>
  338 + <p class="strong orange">(订单中使用优惠券将不赠送商品返还的YOHO币)</p>
  339 + <div class="play-juan">
  340 + <ul>
  341 + <li>
  342 + <input checked name="juangroup" type="radio" value="">
  343 + <label>直接输入优惠码: </label>
  344 + <input type="text" class="textbox" id="juancode" />
  345 + </li>
  346 + </ul>
  347 + </div>
  348 +
  349 + <p class="errtip red"></p>
  350 + <div class="btn-group clearfix">
  351 + <input type="button" class="ok" value="确定" id="juansubmit"/>
  352 + <input type="button" class="cancel cancel-code" value="取消"/>
  353 + </div>
  354 + </div>
  355 + </dd>
  356 + </dl>
  357 + {{/if}}
  358 + <dl class="play-bi-pan pan">
  359 + <dt>使用YOHO币支付</dt>
  360 + <dd>
  361 + <div class="play-pan">
  362 + <div class="strong">
  363 + 使用YOHO币:
  364 + <input type="text" class="textbox" id="biprice" data-bi="{{ownYohoCoin}}" value="0" />
  365 + </div>
  366 + <p >
  367 + 您目前有YOHO币 <em class="strong">{{ownYohoCoin}}</em>
  368 + </p>
  369 + <p class="errbitip red"></p>
  370 + <div class="btn-group clearfix">
  371 + <input type="button" class="ok" value="确定" id="bisubmit"/>
  372 + <input type="button" class="cancel cancel-bi" value="取消"/>
  373 + </div>
  374 + </div>
  375 + </dd>
  376 + </dl>
  377 +
  378 + {{#if redEnvelopes}}
  379 + <div class="red-envelopes active">
  380 + <div class="use-envelopes">
  381 + <input checked value="0" data-all="{{redEnvelopes}}" data-use="{{useRedEnvelopes}}" type="checkbox" />使用现金红包支付:<span>-¥{{useRedEnvelopes}}</span>
  382 + </div>
  383 + <div class="has-envelopes">您的现金红包余额:<span></span></div>
  384 + </div>
  385 + {{/if}}
  386 + </div>
  387 + </div>
  388 + </div>
  389 +
  390 + <div class="to-play">
  391 + <p>您需要实际支付金额:<em>{{lastOrderAmount}}</em>元</p>
  392 + <div class="btn-group clearfix">
  393 + <input type="button" class="submit" value="去付款"/>
  394 + </div>
  395 + </div>
  396 + </div>
  397 +{{/ orderEnsure}}
  398 +<div class="loading"><span></span>请稍后...</div>
  399 +</div>
402 {{> layout/footer}} 400 {{> layout/footer}}
@@ -227,11 +227,9 @@ @@ -227,11 +227,9 @@
227 </tbody> 227 </tbody>
228 </table> 228 </table>
229 <div class="order-balance"> 229 <div class="order-balance">
230 - {{#if totalYoho}}  
231 <p class="back-coin"> 230 <p class="back-coin">
232 <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个 231 <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>共返YOHO币:{{totalYoho}}个
233 </p> 232 </p>
234 - {{/if}}  
235 {{#each orderBalance}} 233 {{#each orderBalance}}
236 <p> 234 <p>
237 {{promotion}}: 235 {{promotion}}:
@@ -14,7 +14,10 @@ @@ -14,7 +14,10 @@
14 <li class="order-num">订单号</li> 14 <li class="order-num">订单号</li>
15 <li>实际支付金额</li> 15 <li>实际支付金额</li>
16 <li>支付方式</li> 16 <li>支付方式</li>
17 - <li>获得YOHO币</li> 17 + <li>
  18 + <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
  19 + 共返YOHO币
  20 + </li>
18 <li>获得VIP累计金额</li> 21 <li>获得VIP累计金额</li>
19 </ul> 22 </ul>
20 <ul class="table-row"> 23 <ul class="table-row">
@@ -24,7 +27,7 @@ @@ -24,7 +27,7 @@
24 <li class="pay font-red">{{pay}}</li> 27 <li class="pay font-red">{{pay}}</li>
25 <li class="pay-mode">{{payMode}}</li> 28 <li class="pay-mode">{{payMode}}</li>
26 <li class="yoho-coin"> 29 <li class="yoho-coin">
27 - <em class="font-red">{{currency}}</em> 30 + <em class="font-red">{{currency}}</em>
28 <a class="notice-link" href="{{yohoCoinUrl}}">YOHO币能做什么</a> 31 <a class="notice-link" href="{{yohoCoinUrl}}">YOHO币能做什么</a>
29 </li> 32 </li>
30 <li class="vip"> 33 <li class="vip">
  1 +{{> layout/header}}
  2 +<div class="shop-index-page product-list-page product-page yoho-page center-content home-page">
  3 + <div class="center-content clearfix">
  4 + {{> layout/path-nav}}
  5 +
  6 + {{> product/shop-header}}
  7 +
  8 + <div class="list-left pull-left">
  9 + {{> product/left-content}}
  10 +
  11 + {{> product/shop-sidebar}}
  12 + </div>
  13 + <div class="list-right pull-right">
  14 + {{#if coupon}}
  15 + <div class="coupon clearfix">
  16 + <div class="coupon-title">
  17 + </div>
  18 + </div>
  19 + {{/if}}
  20 + {{#if largeSlideImg}}
  21 + <div class="slider-wrap clearfix">
  22 + <div class="slider-left pull-left">
  23 + <div class="slide-wrapper">
  24 + <ul>
  25 + {{#largeSlideImg}}
  26 + <li>
  27 + <a href="{{url}}"><img src="{{img}}"></a>
  28 + </li>
  29 + {{/largeSlideImg}}
  30 + </ul>
  31 + </div>
  32 + </div>
  33 + <div class="slider-right pull-right">
  34 + {{#oneRowTwoColImages}}
  35 + <a class="slider-item" href="{{url}}"><img src="{{img}}"></a>
  36 + {{/oneRowTwoColImages}}
  37 + </div>
  38 + </div>
  39 + {{/if}}
  40 + {{#newArrivel}}
  41 + <div class="new-arrivel clearfix">
  42 + {{> index/floor-header}}
  43 + {{> product/shop-single-list}}
  44 + </div>
  45 + {{/newArrivel}}
  46 + {{#hotSingle}}
  47 + <div class="hot-single clearfix">
  48 + {{> index/floor-header}}
  49 + {{> product/shop-single-list}}
  50 + </div>
  51 + {{/hotSingle}}
  52 + {{#allGoods}}
  53 + <div class="all-goods clearfix">
  54 + {{> index/floor-header}}
  55 +
  56 + <div class="goods-wrap">
  57 + {{> product/goods-list}}
  58 + </div>
  59 +
  60 + <div class="loading">
  61 + <a href="{{href}}" target= "_blank">查看更多</a>
  62 + </div>
  63 + </div>
  64 + {{/allGoods}}
  65 + {{#trendInfo}}
  66 + <div class="trend-info clearfix">
  67 + {{> index/floor-header}}
  68 +
  69 + <ul class="trend-list">
  70 + {{#each trendList}}
  71 + <li>
  72 + <a href="{{href}}">
  73 + <img src="{{src}}" />
  74 + <div class="main-title">{{mainTitle}}</div>
  75 + <div class="sub-title">{{Subtitle}}</div>
  76 + </a>
  77 + </li>
  78 + {{/each}}
  79 + </ul>
  80 + </div>
  81 + {{/trendInfo}}
  82 + </div>
  83 + </div>
  84 +</div>
  85 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="shop-index-page product-list-page product-page yoho-page center-content">
  3 + <div class="center-content clearfix">
  4 + {{> layout/path-nav}}
  5 +
  6 + {{> product/shop-header}}
  7 +
  8 + <div class="list-left pull-left">
  9 + {{> product/left-content}}
  10 +
  11 + {{> product/shop-sidebar}}
  12 + </div>
  13 + <div class="list-right pull-right">
  14 + {{> product/shop-entry}}
  15 +
  16 + {{> product/standard-content}}
  17 +
  18 + {{> product/latest-walk}}
  19 + </div>
  20 + </div>
  21 +</div>
  22 +{{> layout/footer}}
@@ -15,7 +15,10 @@ @@ -15,7 +15,10 @@
15 <div class="li-1">订单号</div> 15 <div class="li-1">订单号</div>
16 <div class="li-2">实际支付金额</div> 16 <div class="li-2">实际支付金额</div>
17 <div class="li-3">支付方式</div> 17 <div class="li-3">支付方式</div>
18 - <div class="li-4">获得YOHO币</div> 18 + <div class="li-4">
  19 + <a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
  20 + 共返YOHO币
  21 + </div>
19 <div class="li-5">获得VIP累计金额</div> 22 <div class="li-5">获得VIP累计金额</div>
20 </div> 23 </div>
21 <div class="list"> 24 <div class="list">
@@ -29,7 +32,7 @@ @@ -29,7 +32,7 @@
29 </div> 32 </div>
30 <div class="li-3 pay-mode">货到付款</div> 33 <div class="li-3 pay-mode">货到付款</div>
31 <div class="li-4"> 34 <div class="li-4">
32 - <strong class="f-rz">{{yohoCoin}}</strong> 35 + <strong class="f-rz">{{yohoCoin}}</strong>
33 <a href="{{yohoCoinUrl}}" class="f-e" target="_blank">YOHO币能做什么</a> 36 <a href="{{yohoCoinUrl}}" class="f-e" target="_blank">YOHO币能做什么</a>
34 </div> 37 </div>
35 <div class="li-5"> 38 <div class="li-5">
@@ -304,5 +304,10 @@ @@ -304,5 +304,10 @@
304 seajs.use('js/coupon/coupon'); 304 seajs.use('js/coupon/coupon');
305 </script> 305 </script>
306 {{/if}} 306 {{/if}}
307 - 307 +{{!-- 店铺首页 --}}
  308 +{{#if shopIndexPage}}
  309 + <script>
  310 + seajs.use('js/product/shop-index');
  311 + </script>
  312 +{{/if}}
308 313
  1 +<div class="fixed-area">
  2 +{{# goodsMenu}}
  3 + <div class="all-goods-menu">
  4 + <span class="menu-tag">所有商品</span>
  5 + <ul class="menu-list">
  6 + {{#each menuList}}
  7 + <li class="{{#if curMenu}} on {{/if}}"><a class="pjax" href="{{href}}">{{name}}</a></li>
  8 + {{/each}}
  9 + </ul>
  10 + <a href="{{url}}" class="more">MORE</a>
  11 + </div>
  12 +{{/goodsMenu}}
  13 +
  14 +{{# opts}}
  15 + <div class="sort-pager">
  16 + {{# sortType}}
  17 + <a class="sort-type{{#if active}} active{{/if}} pjax" href="{{href}}">
  18 + {{name}}
  19 + {{#if hasSortOrient}}
  20 + {{#if active}}
  21 + {{#if desc}}
  22 + <span class="active-icon iconfont">&#xe603;</span>
  23 + {{^}}
  24 + <span class="active-icon iconfont">&#xe604;</span>
  25 + {{/if}}
  26 + {{^}}
  27 + <span class="iconfont">&#xe614;</span>
  28 + {{/if}}
  29 + {{^}}
  30 + <span class="iconfont">&#xe604;</span>
  31 + {{/if}}
  32 + </a>
  33 + {{/ sortType}}
  34 +
  35 + {{#if list}}
  36 + {{#if oldPage}}
  37 + <div class="pager-wrap">
  38 + <p class="page-orient">
  39 + {{#if preHref}}
  40 + <a class="pjax" href="{{preHref}}">
  41 + <span class="iconfont">&#xe615;</span>
  42 + </a>
  43 + {{^}}
  44 + <span class="dis-icon iconfont">&#xe615;</span>
  45 + {{/if}}
  46 +
  47 + <span>
  48 + <i>{{curPage}}</i>/{{pageCount}}
  49 + </span>
  50 +
  51 + {{#if nextHref}}
  52 + <a class="pjax" href="{{nextHref}}">
  53 + <span class="iconfont">&#xe601;</span>
  54 + </a>
  55 + {{^}}
  56 + <span class="dis-icon iconfont">&#xe601;</span>
  57 + {{/if}}
  58 + </p>
  59 + </div>
  60 + {{^}}
  61 + <div class="page-nav">
  62 + {{#if preHref}}
  63 + <a class="pjax" href="{{preHref}}">
  64 + <span class="page-prev"><i class="arrow-left"></i></span>
  65 + </a>
  66 + {{^}}
  67 + <span class="page-prev"><i class="arrow-left"></i></span>
  68 + {{/if}}
  69 +
  70 + {{#if nextHref}}
  71 + <a class="pjax" href="{{nextHref}}">
  72 + <span class="page-next">
  73 + 下一页
  74 + <i class="arrow-right"></i>
  75 + <i class="pages">{{curPage}}</i>/{{pageCount}}
  76 + </span>
  77 + </a>
  78 + {{^}}
  79 + <span class="page-next">
  80 + 下一页
  81 + <i class="arrow-right"></i>
  82 + <i class="pages">{{curPage}}</i>/{{pageCount}}
  83 + </span>
  84 + {{/if}}
  85 + </div>
  86 + {{/if}}
  87 + {{/if}}
  88 + </div>
  89 +{{/ opts}}
  90 +</div>
  91 +
  92 +<div class="goods-container clearfix">
  93 + {{# list}}
  94 + {{> product/good}}
  95 + {{/list}}
  96 + <div class="good-item-wrapper">
  97 + <div class="good-info-main"></div>
  98 + <div class="good-select-color"></div>
  99 + </div>
  100 +</div>
  1 +{{# shopTopBanner}}
  2 + <div class="shop-banner">
  3 + <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
  4 + {{#if isShowShopName}}
  5 + <div class="shop-name">
  6 + {{brandIntro.brandName}}
  7 + </div>
  8 + {{/if}}
  9 + <div class="opt-wrap">
  10 + <div class="shop-intro">
  11 + <i class="shop-intro-ico"></i>
  12 + 店铺介绍
  13 + </div>
  14 + <div class="shop-collect" data-id="{{brandIntro.shopId}}">
  15 + <i class="shop-collect-ico {{#if brandIntro.isFavorite}}on{{/if}}"></i>
  16 + <span class="shop-collect-text">
  17 + {{#if brandIntro.isFavorite}}
  18 + 已收藏
  19 + {{else}}
  20 + 收藏
  21 + {{/if}}
  22 + </span>
  23 + </div>
  24 + </div>
  25 + </div>
  26 + {{#brandIntro}}
  27 + <div class="pop-shop-intro">
  28 + <div class="shop-intro-bg"></div>
  29 + <div class="shop-intro-area">
  30 + <i class="close-btn"></i>
  31 + <div class="brand-cont">
  32 + <div class="intro-title">
  33 + <h2>{{brandName}}</h2>
  34 + <p>品牌介绍</p>
  35 + </div>
  36 + <div class="intro-cont">
  37 + {{{brandCont}}}
  38 + </div>
  39 + </div>
  40 + </div>
  41 + </div>
  42 + {{/brandIntro}}
  43 + <div class="mask"></div>
  44 +{{/ shopTopBanner}}
  45 +
  46 +{{#if navigationBar}}
  47 + <ul class="shop-nav clearfix">
  48 + {{#navigationBar}}
  49 + <li class="nav-item {{#if @first}}first{{/if}} {{#if current}}current{{/if}}">
  50 + <a href="{{url}}">
  51 + {{name}}
  52 + {{#if arrow}}
  53 + <span class="iconfont">&#xe63a;</span>
  54 + {{/if}}
  55 + </a>
  56 + </li>
  57 + {{/navigationBar}}
  58 + </ul>
  59 +{{/if}}
  1 +{{#brandBrowse}}
  2 + <div class="brand-collect left-modular">
  3 + <h2 class="title">{{title}}</h2>
  4 + <ul class="left-list">
  5 + {{#each list}}
  6 + <li class="{{#if cur}} on {{/if}}"><a href="{{url}}">{{brandName}}</a></li>
  7 + {{/each}}
  8 + </ul>
  9 + </div>
  10 +{{/brandBrowse}}
  11 +
  12 +{{#recommend}}
  13 + <div class="classic-recommend left-modular">
  14 + <h2 class="title">{{title}}</h2>
  15 + <ul class="left-list">
  16 + {{#each list}}
  17 + <li>
  18 + <a href="{{url}}">
  19 + <div class="classic-name">
  20 + {{#name}}
  21 + <p class="name">{{.}}</p>
  22 + {{/name}}
  23 + {{#enName}}
  24 + <p class="en-name">{{.}}</p>
  25 + {{/enName}}
  26 + </div>
  27 + <img src="{{img}}" />
  28 + </a>
  29 + </li>
  30 + {{/each}}
  31 + </ul>
  32 + </div>
  33 +{{/recommend}}
  34 +
  35 +{{#hotRecommend}}
  36 + <div class="sell-recommend left-modular">
  37 + <h2 class="title">{{title}}</h2>
  38 + <ul class="left-list">
  39 + {{#each list}}
  40 + <li>
  41 + <a target="_blank" href="{{url}}"><img src="{{img}}" alt="{{title}}" /></a>
  42 + </li>
  43 + {{/each}}
  44 + </ul>
  45 + </div>
  46 +{{/hotRecommend}}
  1 +<ul>
  2 + {{#each list}}
  3 + <li>
  4 + <a class="item item-{{@index}}" href="{{url}}" target= "_blank">
  5 + <img class="lazy" data-original="{{img}}"/>
  6 + <p class="title">
  7 + {{title}}
  8 + </p>
  9 + <p class="price">
  10 + {{price}}
  11 + </p>
  12 + {{#if index}}
  13 + <span class="hat">{{index}}</span>
  14 + {{/if}}
  15 + </a>
  16 + </li>
  17 + {{/each}}
  18 +</ul>

21.3 KB | W: | H:

23.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -11,3 +11,5 @@ require('./brand'); @@ -11,3 +11,5 @@ require('./brand');
11 require('./hotrank'); 11 require('./hotrank');
12 12
13 require('./item'); 13 require('./item');
  14 +
  15 +require('./shop-index');
  1 +/**
  2 + * 首页
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2016/4/26
  5 + */
  6 +
  7 +var $ = require('yoho.jquery'),
  8 + lazyLoad = require('yoho.lazyload'),
  9 + product = require('../product/product');
  10 +
  11 +var $shopIntro = $('.shop-intro'),
  12 + $shopCollect = $('.shop-collect'),
  13 + $sliderLeft = $('.slider-left'),
  14 + $allGoods = $('.all-goods'),
  15 + $fixedArea = $allGoods.find('.fixed-area'),
  16 + fixedAreaTop = $fixedArea.offset() ? $fixedArea.offset().top : 0;
  17 +
  18 +// Pjax
  19 +require('yoho.pjax');
  20 +
  21 +require('../common/slider');
  22 +require('../product/list');
  23 +
  24 +product.init(4);
  25 +
  26 +lazyLoad($('img.lazy'));
  27 +
  28 +if ($sliderLeft.length) {
  29 + $sliderLeft.slider();
  30 +}
  31 +
  32 +$shopIntro.on('click', function() {
  33 + $('.pop-shop-intro').show();
  34 + $('.mask').show();
  35 +});
  36 +
  37 +$('.close-btn, .mask').on('click', function() {
  38 + $('.pop-shop-intro').hide();
  39 + $('.mask').hide();
  40 +});
  41 +
  42 +
  43 +// 收藏店铺
  44 +function colloectAction() {
  45 + var $colloectIcon = $shopCollect.find('.shop-collect-ico'),
  46 + $colloectText = $shopCollect.find('.shop-collect-text'),
  47 + isFavorite = $colloectIcon.hasClass('on'),
  48 + needColloect = window.cookie('needColloect');
  49 +
  50 + $.ajax({
  51 + type: 'post',
  52 + url: '/shoplist/setFavorite',
  53 + data: {
  54 + isFavorite: isFavorite ? 0 : 1,
  55 + needColloect: needColloect,
  56 + shopId: $shopCollect.data('id')
  57 + },
  58 + success: function(res) {
  59 + if (res.code === 200) {
  60 + if (isFavorite) {
  61 + $colloectIcon.removeClass('on');
  62 + $colloectText.html('收藏');
  63 + } else {
  64 + $colloectIcon.addClass('on');
  65 + $colloectText.html('已收藏');
  66 + }
  67 +
  68 + if (needColloect) {
  69 + $colloectIcon.addClass('on');
  70 + $colloectText.html('已收藏');
  71 + }
  72 + } else if (res.code === 401) {
  73 + window.setCookie('needColloect', '1', {
  74 + path: '/',
  75 + domain: '.yohobuy.com',
  76 + expires: 90
  77 + });
  78 + location.href = res.url;
  79 + }
  80 + }
  81 + });
  82 +}
  83 +
  84 +$shopCollect.on('click', function() {
  85 + colloectAction();
  86 +});
  87 +
  88 +if (window.cookie('needColloect') * 1 === 1) {
  89 + colloectAction();
  90 + window.setCookie('needColloect', '', {
  91 + path: '/',
  92 + domain: '.yohobuy.com',
  93 + expires: 1
  94 + });
  95 +}
  96 +
  97 +// 全部商品使用 pjax 翻页
  98 +$allGoods.pjax('a.pjax', '.goods-wrap', {
  99 + timeout: 5000,
  100 + scrollTo: false // 默认滚动没有动画,禁止掉
  101 +}).on('pjax:end', function() {
  102 + product.init(4);
  103 + lazyLoad($('img.lazy'));
  104 +
  105 + $fixedArea = $allGoods.find('.fixed-area'); // 翻页后 fixed-area 区域有变化,需要更新选择器
  106 +
  107 + // 分页后移动到全部商品
  108 + $('html, body').animate({
  109 + scrollTop: $allGoods.offset().top - 30
  110 + });
  111 +}).on('click', '.menu-list li', function() {
  112 + var $this = $(this);
  113 +
  114 + $this.siblings().removeClass('on');
  115 + $this.addClass('on');
  116 +});
  117 +
  118 +$(window).on('scroll', function() {
  119 + var scrollTop = $(this).scrollTop();
  120 +
  121 + if (scrollTop > fixedAreaTop) {
  122 + $fixedArea.css({
  123 + position: 'fixed',
  124 + top: 0
  125 + });
  126 + } else {
  127 + $fixedArea.css({
  128 + position: 'static',
  129 + top: 0
  130 + });
  131 + }
  132 +});
@@ -77,24 +77,23 @@ $('.change').click(function() { @@ -77,24 +77,23 @@ $('.change').click(function() {
77 }); 77 });
78 78
79 //支付方式选择按钮 79 //支付方式选择按钮
80 -function getData(payment,orderCode){  
81 - $.ajax({  
82 - type:"get",  
83 - url:"/common/addpaymentinterval",  
84 - dataType:'json',  
85 - data:{  
86 - orderCode:orderCode,  
87 - payment:payment  
88 - }  
89 -  
90 - }); 80 +function getData(payment, orderCode) {
  81 + $.ajax({
  82 + type: 'get',
  83 + url: '/common/addpaymentinterval',
  84 + dataType: 'json',
  85 + data: {
  86 + orderCode: orderCode,
  87 + payment: payment
  88 + }
  89 + });
91 } 90 }
92 91
93 -$("#btnby").click(function(){  
94 - payment = $(".choose-type").attr("data-id");  
95 - orderCode = $('.order-num').text();  
96 - getData(payment,orderCode); 92 +$('#btnby').click(function() {
  93 + var payment = $('.choose-type').attr('data-id');
  94 +
  95 + orderCode = $('.order-num').text();
  96 + getData(payment, orderCode);
97 window.open($payUrl + '?order_code=' + orderCode + '&payment_type=' + $showValue); 97 window.open($payUrl + '?order_code=' + orderCode + '&payment_type=' + $showValue);
98 $lightBox.show(); 98 $lightBox.show();
99 -})  
100 - 99 +});
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 @import "hot-rank"; 10 @import "hot-rank";
11 @import "shop-entry"; 11 @import "shop-entry";
12 @import "detail"; 12 @import "detail";
  13 +@import "shop-index";
13 14
14 .product-page { 15 .product-page {
15 /*分页*/ 16 /*分页*/
  1 +.shop-index-page {
  2 + margin: 10px auto 30px;
  3 + width: 1150px;
  4 +
  5 + .shop-banner {
  6 + position: relative;
  7 +
  8 + .shop-name {
  9 + position: absolute;
  10 + left: 260px;
  11 + bottom: 20px;
  12 + font-size: 36px;
  13 + color: #fff;
  14 + }
  15 +
  16 + .banner-img {
  17 + width: 100%;
  18 + height: 150px;
  19 + }
  20 +
  21 + .opt-wrap {
  22 + position: absolute;
  23 + top: 65%;
  24 + right: 0;
  25 + padding: 0 10px;
  26 + }
  27 +
  28 + .shop-intro,
  29 + .shop-collect {
  30 + display: inline-block;
  31 + width: 110px;
  32 + height: 30px;
  33 + margin-right: 10px;
  34 + font-size: 16px;
  35 + line-height: 30px;
  36 + text-align: center;
  37 + color: #fff;
  38 + border: 1px solid #fff;
  39 + cursor: pointer;
  40 +
  41 + i {
  42 + background-repeat: no-repeat;
  43 + float: left;
  44 + position: relative;
  45 + left: 11px;
  46 + top: 5px;
  47 + }
  48 +
  49 + .shop-intro-ico {
  50 + width: 16px;
  51 + height: 20px;
  52 + background-image: resolve(/product/shop-instro.png);
  53 + margin-right: 12px;
  54 + }
  55 +
  56 + .shop-collect-ico {
  57 + width: 20px;
  58 + height: 19px;
  59 + background-image: resolve(/product/shop-collection.png);
  60 + top: 6px;
  61 + margin-right: 12px;
  62 +
  63 + &.on {
  64 + background-image: resolve(/product/shop-collection-on.png);
  65 + }
  66 + }
  67 + }
  68 + }
  69 +
  70 + .shop-nav {
  71 + box-sizing: border-box;
  72 + margin-bottom: 30px;
  73 + padding: 0 20px;
  74 + width: 100%;
  75 + height: 40px;
  76 + color: #fff;
  77 + background: #000;
  78 + font-size: 16px;
  79 +
  80 + a {
  81 + position: relative;
  82 + top: 8px;
  83 + display: inline-block;
  84 + line-height: 26px;
  85 + color: #fff;
  86 + }
  87 +
  88 + .nav-item {
  89 + position: relative;
  90 + float: left;
  91 + width: 160px;
  92 + text-align: center;
  93 +
  94 + &.first {
  95 + width: 100px;
  96 + text-align: left;
  97 + }
  98 + }
  99 +
  100 + .current {
  101 + a {
  102 + border-bottom: 2px solid #fff;
  103 + }
  104 + }
  105 + }
  106 +
  107 + .coupon {
  108 + margin-top: 20px;
  109 + width: 100%;
  110 + height: 80px;
  111 +
  112 + .coupon-title {
  113 + width: 162px;
  114 + height: 100%;
  115 + background: url(/product/coupon-title.png);
  116 + }
  117 + }
  118 +
  119 + .slider-wrap {
  120 + height: 360px;
  121 + }
  122 +
  123 + .slider-left {
  124 + float: left;
  125 + margin-right: 10px;
  126 + width: 660px;
  127 + height: 100%;
  128 + overflow: hidden;
  129 +
  130 + img {
  131 + width: 100%;
  132 + height: 100%;
  133 + }
  134 +
  135 + .slide-pagination,
  136 + .slide-switch {
  137 + display: none;
  138 + }
  139 + }
  140 +
  141 + .slider-right {
  142 + float: left;
  143 + width: 300px;
  144 + height: 100%;
  145 +
  146 + .slider-item {
  147 + display: block;
  148 + margin-bottom: 10px;
  149 + width: 100%;
  150 + height: 175px;
  151 + }
  152 + }
  153 +
  154 + .floor-header {
  155 + margin-top: 50px;
  156 + }
  157 +
  158 + .new-arrivel,
  159 + .hot-single {
  160 + width: 980px;
  161 +
  162 + .item {
  163 + float: left;
  164 + position: relative;
  165 + margin-right: 10px;
  166 + margin-bottom: 20px;
  167 + width: 235px;
  168 + height: 315px;
  169 + font-size: 14px;
  170 + text-align: center;
  171 + line-height: 1.5;
  172 + background: #f5f5f5;
  173 +
  174 + img {
  175 + width: 235px;
  176 + height: 250px;
  177 + }
  178 +
  179 + .title {
  180 + width: 220px;
  181 + padding: 0 5px;
  182 + text-overflow: ellipsis;
  183 + white-space: nowrap;
  184 + overflow: hidden;
  185 + }
  186 + }
  187 +
  188 + .hat {
  189 + position: absolute;
  190 + top: 0;
  191 + right: 0;
  192 + width: 50px;
  193 + height: 50px;
  194 + color: #ffc513;
  195 + text-align: center;
  196 + line-height: 57px;
  197 + background: url(/product/hat.png);
  198 + }
  199 + }
  200 +
  201 + .mask {
  202 + background-color: #000;
  203 + opacity: .5;
  204 + position: fixed;
  205 + top: 0;
  206 + left: 0;
  207 + right: 0;
  208 + bottom: 0;
  209 + z-index: 1001;
  210 + display: none;
  211 + cursor: pointer;
  212 + }
  213 +
  214 + .pop-shop-intro {
  215 + display: none;
  216 + }
  217 +
  218 + .shop-intro-bg {
  219 + width: 908px;
  220 + height: 604px;
  221 + background-color: #000;
  222 + opacity: .5;
  223 + position: fixed;
  224 + left: 50%;
  225 + top: 50%;
  226 + z-index: 1002;
  227 + margin: -302px 0 0 -454px;
  228 + }
  229 +
  230 + .shop-intro-area {
  231 + width: 898px;
  232 + height: 594px;
  233 + padding: 60px 10px 35px 40px;
  234 + background-color: #fff;
  235 + position: fixed;
  236 + left: 50%;
  237 + top: 50%;
  238 + margin: -297px 0 0 -449px;
  239 + z-index: 1003;
  240 + box-sizing: border-box;
  241 +
  242 + .close-btn {
  243 + width: 18px;
  244 + height: 18px;
  245 + background-image: resolve(/product/shop-instro-close.png);
  246 + position: absolute;
  247 + right: 20px;
  248 + top: 20px;
  249 + cursor: pointer;
  250 + }
  251 +
  252 + .brand-cont {
  253 + overflow: auto;
  254 + width: 100%;
  255 + height: 499px;
  256 + padding-right: 30px;
  257 + box-sizing: border-box;
  258 + }
  259 +
  260 + .intro-title {
  261 + float: left;
  262 +
  263 + h2 {
  264 + width: 100%;
  265 + float: left;
  266 + text-align: left;
  267 + font-size: 26px;
  268 + font-weight: bold;
  269 + color: #000;
  270 + font-style: italic;
  271 + }
  272 +
  273 + p {
  274 + font-family: "黑体";
  275 + font-size: 20px;
  276 + text-align: left;
  277 + padding: 10px 0;
  278 + float: left;
  279 + }
  280 + }
  281 +
  282 + .intro-cont {
  283 + width: 100%;
  284 + float: left;
  285 + margin-top: 55px;
  286 + font-size: 14px;
  287 + line-height: 20px;
  288 +
  289 + p {
  290 + text-indent: 2em;
  291 + }
  292 +
  293 + img {
  294 + width: 100%;
  295 + margin-top: 10px;
  296 + }
  297 + }
  298 + }
  299 +
  300 + .fixed-area {
  301 + background: #fff;
  302 + z-index: 1;
  303 + width: 970px;
  304 + }
  305 +
  306 + .all-goods-menu {
  307 + width: 100%;
  308 + height: 40px;
  309 + line-height: 40px;
  310 +
  311 + .menu-tag {
  312 + color: #d0021b;
  313 + font-size: 18px;
  314 + font-weight: bold;
  315 + text-align: left;
  316 + padding: 0 20px 0 10px;
  317 + border-right: 1px solid #000;
  318 + float: left;
  319 + }
  320 +
  321 + .menu-list {
  322 + width: 810px;
  323 + height: 40px;
  324 + overflow: hidden;
  325 + float: left;
  326 + font-size: 14px;
  327 +
  328 + li {
  329 + display: inline-block;
  330 + padding: 0 15px;
  331 + }
  332 +
  333 + .on {
  334 + background: #000;
  335 + height: 28px;
  336 + line-height: 28px;
  337 +
  338 + a {
  339 + color: #fff;
  340 + }
  341 + }
  342 + }
  343 +
  344 + .more {
  345 + font-size: 14px;
  346 + float: right;
  347 + }
  348 + }
  349 +
  350 + .sort-pager .sort-type:first-child .iconfont {
  351 + display: inline-block;
  352 + }
  353 +
  354 + .loading {
  355 + position: relative;
  356 + width: 100%;
  357 + text-align: center;
  358 +
  359 + a {
  360 + display: block;
  361 + height: 35px;
  362 + width: 120px;
  363 + margin: 0 auto 0;
  364 + background-color: #000;
  365 + color: #fff;
  366 + font-size: 14px;
  367 + line-height: 35px;
  368 + text-align: center;
  369 + }
  370 + }
  371 +
  372 + .trend-info {
  373 + width: 100%;
  374 +
  375 + .trend-list {
  376 + width: 100%;
  377 +
  378 + li {
  379 + float: left;
  380 + width: 316px;
  381 + margin-left: 10px;
  382 + text-align: center;
  383 +
  384 + &:first-child {
  385 + margin-left: 0;
  386 + }
  387 + }
  388 +
  389 + img {
  390 + width: 100%;
  391 + height: 181px;
  392 + }
  393 +
  394 + .main-title,
  395 + .sub-title {
  396 + box-sizing: border-box;
  397 + font-size: 16px;
  398 + margin-top: 15px;
  399 + padding: 0 10px;
  400 + width: 100%;
  401 + overflow: hidden;
  402 + text-overflow: ellipsis;
  403 + white-space: nowrap;
  404 + line-height: 24px;
  405 + }
  406 +
  407 + .sub-title {
  408 + margin-top: 0;
  409 + font-size: 14px;
  410 + }
  411 + }
  412 + }
  413 +
  414 + .goods-container {
  415 + .good-info {
  416 + width: 235px;
  417 + height: auto;
  418 + margin-bottom: 35px;
  419 + }
  420 +
  421 + .good-detail-text {
  422 + text-align: left;
  423 + }
  424 + }
  425 +
  426 + .left-modular {
  427 + width: 160px;
  428 + font-size: 14px;
  429 + margin-top: 20px;
  430 + float: left;
  431 +
  432 + .title {
  433 + width: 100%;
  434 + height: 25px;
  435 + line-height: 25px;
  436 + background: #000;
  437 + color: #fff;
  438 + font-family: "黑体";
  439 + padding-left: 14px;
  440 + box-sizing: border-box;
  441 + }
  442 +
  443 + .left-list {
  444 + width: 100%;
  445 + margin-top: 5px;
  446 +
  447 + li {
  448 + width: 100%;
  449 + height: 42px;
  450 + line-height: 42px;
  451 + background: #f5f5f5;
  452 + float: left;
  453 + box-sizing: border-box;
  454 + margin-top: 5px;
  455 + padding-left: 14px;
  456 +
  457 + a {
  458 + color: #000;
  459 + }
  460 +
  461 + &.on {
  462 + border: 1px solid #000;
  463 + }
  464 + }
  465 + }
  466 + }
  467 +
  468 + .classic-recommend {
  469 + .left-list li {
  470 + height: 50px;
  471 + line-height: 50px;
  472 + }
  473 +
  474 + .classic-name {
  475 + width: 96px;
  476 + display: inline-block;
  477 + line-height: 14px;
  478 + vertical-align: middle;
  479 +
  480 + .name {
  481 + font-size: 14px;
  482 + }
  483 +
  484 + .en-name {
  485 + font-size: 12px;
  486 + }
  487 + }
  488 +
  489 + img {
  490 + width: 40px;
  491 + max-height: 40px;
  492 + margin-right: 5px;
  493 + vertical-align: middle;
  494 + }
  495 + }
  496 +
  497 + .sell-recommend {
  498 + .left-list li {
  499 + padding-left: 0;
  500 + height: auto;
  501 + margin-bottom: 25px;
  502 + line-height: inherit;
  503 +
  504 + img {
  505 + width: 100%;
  506 + }
  507 + }
  508 + }
  509 +
  510 + ::-webkit-scrollbar {
  511 + width: 16px;
  512 + height: 16px;
  513 + }
  514 +
  515 + ::-webkit-scrollbar-track,
  516 + ::-webkit-scrollbar-thumb {
  517 + border-radius: 999px;
  518 + border: 5px solid transparent;
  519 + }
  520 +
  521 + ::-webkit-scrollbar-track {
  522 + box-shadow: 0 0 6px rgba(0, 0, 0, 0) inset;
  523 + }
  524 +
  525 + ::-webkit-scrollbar-thumb {
  526 + min-height: 20px;
  527 + background-clip: content-box;
  528 + box-shadow: 0 0 0 6px rgba(0, 0, 0, .3) inset;
  529 + }
  530 +
  531 + ::-webkit-scrollbar-corner {
  532 + background: transparent;
  533 + }
  534 +
  535 + .page-nav {
  536 + padding: 7px 0;
  537 + float: right;
  538 + font-size: 14px;
  539 +
  540 + .page-prev {
  541 + width: 33px;
  542 + height: 33px;
  543 + background: #ccc;
  544 + text-align: center;
  545 + float: left;
  546 + }
  547 +
  548 + .arrow-left {
  549 + width: 10px;
  550 + height: 10px;
  551 + display: inline-block;
  552 + position: relative;
  553 + top: -7px;
  554 + background: resolve(/product/arrow-left.png) no-repeat;
  555 + }
  556 +
  557 + a .page-prev,
  558 + a .page-next {
  559 + background: #000;
  560 + color: #fff;
  561 + }
  562 +
  563 + .page-next {
  564 + min-width: 110px;
  565 + height: 33px;
  566 + background: #a9a9a9;
  567 + float: left;
  568 + margin-left: 1px;
  569 + line-height: 33px;
  570 + padding-left: 10px;
  571 + box-sizing: border-box;
  572 + padding-right: 10px;
  573 + }
  574 +
  575 + .arrow-right {
  576 + width: 10px;
  577 + height: 10px;
  578 + display: inline-block;
  579 + vertical-align: middle;
  580 + background: resolve(/product/arrow-right.png) no-repeat;
  581 + }
  582 +
  583 + .pages {
  584 + margin-left: 10px;
  585 + }
  586 + }
  587 +}
@@ -152,23 +152,12 @@ class BrandsModel @@ -152,23 +152,12 @@ class BrandsModel
152 /** 152 /**
153 * 根据品牌域名处理相关品牌参数 153 * 根据品牌域名处理相关品牌参数
154 * @param $domain (品牌域名) 154 * @param $domain (品牌域名)
155 - * @param $type (根据type调取同一接口不同的数据)  
156 * @return array|bool 155 * @return array|bool
157 */ 156 */
158 - public static function getBrandByDomain($domain, $type) 157 + public static function getBrandByDomain($domain)
159 { 158 {
160 - //根据传来的type值,选择请求需要的数据  
161 - switch ($type) {  
162 - case 1:  
163 - $fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';  
164 - break;  
165 - case 2:  
166 - $fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_banner,brand_ico,brand_intro';  
167 - default:  
168 - break;  
169 - }  
170 //调用接口获得数据 159 //调用接口获得数据
171 - $brandInfo = BrandData::getBrandLogoByDomain($domain, $fields); 160 + $brandInfo = BrandData::getBrandLogoByDomain($domain);
172 $result = array(); 161 $result = array();
173 //组装品牌页顶部banner条需要的数据 162 //组装品牌页顶部banner条需要的数据
174 if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) { 163 if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
@@ -178,6 +167,10 @@ class BrandsModel @@ -178,6 +167,10 @@ class BrandsModel
178 $result['brandNameEn'] = isset($brandInfo['data']['brand_name_en']) ? $brandInfo['data']['brand_name_en'] : ''; 167 $result['brandNameEn'] = isset($brandInfo['data']['brand_name_en']) ? $brandInfo['data']['brand_name_en'] : '';
179 $result['brandNameCn'] = isset($brandInfo['data']['brand_name_cn']) ? $brandInfo['data']['brand_name_cn'] : ''; 168 $result['brandNameCn'] = isset($brandInfo['data']['brand_name_cn']) ? $brandInfo['data']['brand_name_cn'] : '';
180 $result['brandAbout'] = isset($brandInfo['data']['brand_intro']) ? $brandInfo['data']['brand_intro'] : ''; 169 $result['brandAbout'] = isset($brandInfo['data']['brand_intro']) ? $brandInfo['data']['brand_intro'] : '';
  170 + $result['shopTemplateType'] = isset($brandInfo['data']['shop_template_type']) ?
  171 + intval($brandInfo['data']['shop_template_type']) : '';
  172 + $result['type'] = isset($brandInfo['data']['type']) ? $brandInfo['data']['type'] : 0;
  173 + $result['shopId'] = isset($brandInfo['data']['shop_id']) ? $brandInfo['data']['shop_id'] : '';
181 } 174 }
182 else { 175 else {
183 return false; 176 return false;
@@ -45,6 +45,7 @@ class SearchModel @@ -45,6 +45,7 @@ class SearchModel
45 $data = array(); 45 $data = array();
46 /* 过滤请求参数 */ 46 /* 过滤请求参数 */
47 $condition = filter_input_array(INPUT_GET, array( 47 $condition = filter_input_array(INPUT_GET, array(
  48 + 'navBar' => FILTER_VALIDATE_INT,
48 'query' => FILTER_FLAG_NO_ENCODE_QUOTES , 49 'query' => FILTER_FLAG_NO_ENCODE_QUOTES ,
49 'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES , 50 'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES ,
50 'brand' => FILTER_SANITIZE_STRING, 51 'brand' => FILTER_SANITIZE_STRING,
@@ -235,10 +236,15 @@ class SearchModel @@ -235,10 +236,15 @@ class SearchModel
235 $data = Yohobuy::getMulti($urlList); 236 $data = Yohobuy::getMulti($urlList);
236 //获取品牌商品分类 237 //获取品牌商品分类
237 if (isset($data['shop']) && !empty($data['shop'])) { 238 if (isset($data['shop']) && !empty($data['shop'])) {
238 - $shopSortParam['brand'] = $data['shop']['id'];  
239 - $shopSort = SearchData::getClassesData($shopSortParam);  
240 - if (isset($shopSort['code']) && $shopSort['code'] == 200) {  
241 - $data['shopSort'] = $shopSort['data']['sort']; 239 + $data['shopData'] = array();
  240 + $shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']);
  241 + if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
  242 + foreach ($shopsByBrands['data'] as $val) {
  243 + $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
  244 + if (isset($shopSort['code']) && $shopSort['code'] == 200) {
  245 + $data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']);
  246 + }
  247 + }
242 } 248 }
243 } 249 }
244 // 组织模板数据 250 // 组织模板数据
  1 +<?php
  2 +namespace Product;
  3 +use Product\SearchModel;
  4 +use LibModels\Web\Product\SearchData;
  5 +use LibModels\Web\Product\ShopData;
  6 +use Api\Yohobuy;
  7 +use WebPlugin\HelperSearch;
  8 +use LibModels\Web\Guang\ListData as GuangListData;
  9 +use WebPlugin\Helpers;
  10 +/**
  11 + * 品牌店铺的模型
  12 + *
  13 + * @copyright yoho.inc
  14 + * @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn>
  15 + */
  16 +class ShopModel
  17 +{
  18 + private static $shopListUrl = '/shoplist';
  19 +
  20 + public static function getData($shopId, $parameters)
  21 + {
  22 + $data = array('shopTopBanner' => array(), 'hotSingle'=> array());
  23 + $parameters['shopId'] = $shopId;
  24 +
  25 + $shopList = ShopData::shopsDecoratorList($shopId);
  26 + if (isset($shopList['data']['list']) && $shopList['code'] === 200) {
  27 + foreach ($shopList['data']['list'] as $list) {
  28 + $fun = $list['resource_name'];
  29 + if (is_callable("self::$fun")) {
  30 + $list = self::$fun(self::getResourceData($list), $parameters);
  31 + switch ($fun) {
  32 + case 'newProducts':
  33 + $data['newArrivel']['name'] = '新品上架 NEW';
  34 + $data['newArrivel']['list'] = $list;
  35 + break;
  36 + case 'hotProducts':
  37 + $data['hotSingle']['name'] = '人气单品 HOT';
  38 + $data['hotSingle']['list'] = $list;
  39 + break;
  40 + case 'goodsTabBar':
  41 + if (isset($list['hot'])) {
  42 + $data['hotSingle']['navs'] = $list['hot'];
  43 + }
  44 + if ($list['new']) {
  45 + $data['newArrivel']['navs'] = $list['new'];
  46 + }
  47 + break;
  48 + case 'brandBrowse':
  49 + $data['brandBrowse'] = array('title' => '品牌集合', 'list'=> $list);
  50 + break;
  51 + case 'recommend':
  52 + $data['recommend'] = array(
  53 + 'title' => isset($list[0]['title']) ? $list[0]['title'] : '经典推荐',
  54 + 'list'=> $list
  55 + );
  56 + break;
  57 + case 'hotRecommend':
  58 + $data['hotRecommend'] = array(
  59 + 'title' => isset($list[0]['title']) ? $list[0]['title'] : '热销推荐',
  60 + 'list'=> $list
  61 + );
  62 + break;
  63 + default :
  64 + $data[$fun] = $list;
  65 + }
  66 + }
  67 + }
  68 + } else {
  69 + headers_sent() || header('Location: /error.html');
  70 + exit();
  71 + }
  72 +
  73 + //店铺介绍
  74 + $data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
  75 +
  76 + //搜索店铺全部商品
  77 + $searchCondition = SearchModel::searchCondition($parameters['condition'], $parameters['options']);
  78 +
  79 + // 组合搜索商品url
  80 + $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
  81 + // 组合搜索分类url
  82 + $sortCondition = array();
  83 + if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
  84 + $sortCondition['needSmallSort'] = 1;
  85 + }
  86 + $urlList['sort'] = SearchData::getClassesUrl($sortCondition);
  87 +
  88 + //批量调接口获取数据
  89 + $res = Yohobuy::getMulti($urlList);
  90 +
  91 + //新品上架
  92 + if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) {
  93 + $searchCondition['options']['isNew'] = true;
  94 + }
  95 +
  96 + // 组织模板数据
  97 + $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
  98 + $data['pathNav'] = array_merge(
  99 + HelperSearch::$listNav,
  100 + array(
  101 + array('href'=> '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
  102 + )
  103 + );
  104 +
  105 + $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId);
  106 + $searchCondition['userInput'] = empty($searchCondition['userInput']) ? array() : $searchCondition['userInput'];
  107 + $param = array_merge($searchCondition['userInput'], array('navBar' => 1));
  108 + $data['allGoods']['list'] = $result['goods'];
  109 + $data['allGoods']['name'] = '全部商品 ALL';
  110 + $data['allGoods']['opts'] = $result['opts'];
  111 + $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : '';
  112 + $data['allGoods']['goodsMenu']['menuList'] = $sort;
  113 + $data['allGoods']['href'] = self::$shopListUrl . '?'.http_build_query($param);
  114 +
  115 + return $data;
  116 + }
  117 +
  118 +
  119 + /**
  120 + * 店铺列表页
  121 + */
  122 + public static function getShopListData($shopId, $parameters)
  123 + {
  124 + $data = array('shopTopBanner' => array(), 'hotSingle'=> array());
  125 + $parameters['shopId'] = $shopId;
  126 +
  127 + $shopList = ShopData::shopsDecoratorList($shopId);
  128 +
  129 + if (isset($shopList['data']['list']) && $shopList['code'] === 200) {
  130 + foreach ($shopList['data']['list'] as $list) {
  131 + $fun = $list['resource_name'];
  132 + if (is_callable("self::$fun")) {
  133 + $list = self::$fun(self::getResourceData($list), $parameters);
  134 + switch ($fun) {
  135 + case 'newProducts':
  136 + case 'hotProducts':
  137 + break;
  138 + case 'goodsTabBar':
  139 + if (isset($list['hot'])) {
  140 + $data['hotSingle']['navs'] = $list['hot'];
  141 + } else if ($list['new']) {
  142 + $data['newArrivel']['navs'] = $list['new'];
  143 + }
  144 + break;
  145 + case 'brandBrowse':
  146 + $data['brandBrowse'] = array('title' => '品牌集合', 'list'=> $list);
  147 + break;
  148 + case 'recommend':
  149 + $data['recommend'] = array(
  150 + 'title' => isset($list[0]['title']) ? $list[0]['title'] : '经典推荐',
  151 + 'list'=> $list
  152 + );
  153 + break;
  154 + case 'hotRecommend':
  155 + $data['hotRecommend'] = array(
  156 + 'title' => isset($list[0]['title']) ? $list[0]['title'] : '热销推荐',
  157 + 'list'=> $list
  158 + );
  159 + break;
  160 + default :
  161 + $data[$fun] = $list;
  162 + }
  163 + }
  164 + }
  165 + }
  166 +
  167 + //店铺介绍
  168 + $data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
  169 +
  170 +
  171 + //搜索店铺全部商品
  172 + $searchCondition = SearchModel::searchCondition($parameters['condition'], $parameters['options']);
  173 +
  174 + // 组合搜索商品url
  175 + $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
  176 + // 组合搜索分类url
  177 + $sortCondition = array();
  178 + if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
  179 + $sortCondition['needSmallSort'] = 1;
  180 + }
  181 + $urlList['sort'] = SearchData::getClassesUrl($sortCondition);
  182 +
  183 + //批量调接口获取数据
  184 + $res = Yohobuy::getMulti($urlList);
  185 +
  186 + //新品上架
  187 + if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) {
  188 + $searchCondition['options']['isNew'] = true;
  189 + }
  190 +
  191 + // 组织模板数据
  192 + $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
  193 +
  194 + $data['pathNav'] = $result['pathNav'];
  195 +
  196 + $data['goods'] = $result['goods'];
  197 + $data['opts'] = $result['opts'];
  198 + $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : '';
  199 + $data['filters'] = $result['filters'];
  200 + $data['pathNav'] = $result['pathNav'];
  201 +// $data['name'] = '全部商品 ALL';
  202 +// $sort = self::getSort($res['sort']);
  203 +// $data['goodsMenu']['menuList'] = $sort;
  204 +
  205 + return $data;
  206 +
  207 + }
  208 +
  209 +
  210 + //异步获取全部商品goods数据
  211 + public static function getGoods($condition, $options)
  212 + {
  213 + //搜索店铺全部商品
  214 + $searchCondition = SearchModel::searchCondition($condition, $options);
  215 +
  216 + // 组合搜索商品url
  217 + $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
  218 + // 组合搜索分类url
  219 + $sortCondition = array();
  220 + if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
  221 + $sortCondition['needSmallSort'] = 1;
  222 + }
  223 + $urlList['sort'] = SearchData::getClassesUrl($sortCondition);
  224 +
  225 + //批量调接口获取数据
  226 + $res = Yohobuy::getMulti($urlList);
  227 +
  228 + // 组织模板数据
  229 + $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
  230 +
  231 + $sort = self::getSort($res['sort'], $options['misort'], $condition['shop']);
  232 + $data['goodsMenu']['menuList'] = $sort;
  233 + $data['list'] = $result['goods'];
  234 + $data['opts'] = $result['opts'];
  235 +
  236 + return $data;
  237 + }
  238 +
  239 +
  240 + /**
  241 + * 店铺Banner 资源位
  242 + * @param type $data []
  243 + */
  244 + public static function shopTopBanner($data)
  245 + {
  246 + $result = array(
  247 + 'banner' => '',
  248 + 'isShowShopName' => false,
  249 + 'bannerHeight' => 150
  250 + );
  251 +
  252 + if (isset($data['resource_data'][0]['shopSrc'])) {
  253 + $result['banner'] = self::imageView2($data['resource_data'][0]['shopSrc'], 1150, 150);
  254 + }
  255 +
  256 + if (isset($data['resource_data'][0]['detailSrc'])) {
  257 + $result['detailSrc'] = self::imageView2($data['resource_data'][0]['detailSrc'], 1150, 150);
  258 + }
  259 +
  260 + if (isset($data['resource_data'][0]['isShowShopName'])) {
  261 + $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y';
  262 + }
  263 + return $result;
  264 +
  265 + }
  266 + /**
  267 + * 导航栏 资源位
  268 + * @param type $data
  269 + * @return type []
  270 + */
  271 + public static function navigationBar($data, $parameters = array())
  272 + {
  273 + $shopNav = array(
  274 + array(
  275 + 'name' => '店铺首页',
  276 + 'url' => '/?navBar=0',
  277 + ),
  278 + array(
  279 + 'name' => '全部商品',
  280 + 'url' => self::$shopListUrl . '?navBar=1',
  281 + 'arrow' => true,
  282 + ),
  283 + array(
  284 + 'name' => '人气单品',
  285 + 'url' => self::$shopListUrl . '?navBar=2&order=s_n_desc',
  286 + ),
  287 + array(
  288 + 'name' => '新品上架',
  289 + 'url' => self::$shopListUrl . '?navBar=3&order=s_t_desc',
  290 + ),
  291 + );
  292 +
  293 + if(isset($data['resource_data']) && is_array($data['resource_data'])) {
  294 + $shopNav = array_merge($shopNav, array_filter($data['resource_data'], function($v) {
  295 + if (empty($v['url'])) {
  296 + return false;
  297 + }
  298 + return $v;
  299 + }));
  300 + }
  301 +
  302 + //选中状态
  303 + if (isset($parameters['navBar']) && count($shopNav) >= $parameters['navBar'] && $parameters['navBar'] >= 0) {
  304 + $shopNav[$parameters['navBar']]['current'] = true;
  305 + } else {
  306 + $shopNav[0]['current'] = true;
  307 + }
  308 +
  309 + return $shopNav;
  310 + }
  311 + /**
  312 + * 资源位小图
  313 + * @param type $data
  314 + */
  315 + public static function oneRowTwoColImages($data)
  316 + {
  317 + $oneData = array();
  318 + $twoData = array();
  319 +
  320 + foreach ($data['resource_data'] as $resource) {
  321 +
  322 + if (empty($resource['data'])) {
  323 + continue;
  324 + }
  325 +
  326 + foreach ($resource['data'] as $key => $val) {
  327 +
  328 + $temp = array(
  329 + 'img' => self::imageView2($val['src'], 300, 175),
  330 + 'url' => $val['url'],
  331 + );
  332 +
  333 + if ($key === 0) {
  334 + $oneData[] = $temp;
  335 + } else {
  336 + $twoData[] = $temp;
  337 + }
  338 + }
  339 + }
  340 +
  341 + return array_slice(array_merge($oneData, $twoData), 0, 2);
  342 + }
  343 +
  344 + /**
  345 + * 资源位大图
  346 + * @param type $data
  347 + * @return type []
  348 + */
  349 + public static function largeSlideImg($data)
  350 + {
  351 + $result = array();
  352 +
  353 + foreach ($data['resource_data'] as $resource) {
  354 +
  355 + if (empty($resource['data'])) {
  356 + continue;
  357 + }
  358 +
  359 + foreach ($resource['data'] as $val) {
  360 + $result[] = array(
  361 + 'img' => self::imageView2($val['src'], 660, 360),
  362 + 'url' => $val['url'],
  363 + );
  364 + }
  365 + }
  366 +
  367 + return $result;
  368 + }
  369 +
  370 + /**
  371 + * 经典推荐
  372 + * @param type $data
  373 + * @return type []
  374 + */
  375 + public static function recommend($data)
  376 + {
  377 + $result = array();
  378 +
  379 + foreach ($data['resource_data'] as $resource) {
  380 + $result[] = array(
  381 + 'enName'=> $resource['enName'],
  382 + 'name'=> $resource['name'],
  383 + 'img'=> self::imageView2($resource['src'], 50, 50),
  384 + 'title'=> $resource['title'],
  385 + 'url'=> $resource['url'],
  386 + );
  387 + }
  388 +
  389 + return $result;
  390 + }
  391 +
  392 + /**
  393 + * 热门推荐
  394 + * @param type $data
  395 + * @return type []
  396 + */
  397 + public static function hotRecommend($data)
  398 + {
  399 + $result = array();
  400 +
  401 + foreach ($data['resource_data'] as $resource) {
  402 + $result[] = array(
  403 + 'img'=> self::imageView2($resource['src'], 160, 240),
  404 + 'title'=> $resource['title'],
  405 + 'url'=> $resource['url'],
  406 + );
  407 + }
  408 +
  409 + return $result;
  410 + }
  411 +
  412 + /**
  413 + * 品牌一览
  414 + * @param type $data
  415 + * @return type []
  416 + */
  417 + public static function brandBrowse($data, $parameters = array())
  418 + {
  419 + $result = array();
  420 + $brand = isset($parameters['brand']) ? $parameters['brand'] : '';
  421 +
  422 + foreach ($data['resource_data'] as $resource) {
  423 + $result[] = array(
  424 + 'url' => Helpers::url(
  425 + self::$shopListUrl,
  426 + array(
  427 + 'brand' => $resource['id'],
  428 + 'navBar' => 1
  429 + ),
  430 + ''
  431 + ),
  432 + 'brandName' => $resource['brandName'],
  433 + 'cur' => ($brand === strval($resource['id']))
  434 + );
  435 + }
  436 +
  437 + return $result;
  438 + }
  439 + /**
  440 + * 商品标签栏
  441 + * @param type $data
  442 + * @return type []
  443 + */
  444 + public static function goodsTabBar($data)
  445 + {
  446 + $result = array();
  447 +
  448 + if (isset($data['resource_data'])) {
  449 + $result = $data['resource_data'];
  450 + }
  451 + return $result;
  452 + }
  453 +
  454 + /**
  455 + * 新品上架
  456 + * @param type $data
  457 + * @return type []
  458 + */
  459 + public static function newProducts($data)
  460 + {
  461 + $result = array();
  462 +
  463 + foreach ($data['resource_data'] as $resource) {
  464 + $result[] = array(
  465 + 'productId'=> $resource['productId'],
  466 + 'title'=> $resource['productName'],
  467 + 'productSkn'=> $resource['productSkn'],
  468 + 'price'=> '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
  469 + 'img'=> self::imageView2($resource['src'], 250, 340),
  470 + 'url'=> Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
  471 + );
  472 + }
  473 + return $result;
  474 + }
  475 +
  476 + /**
  477 + * 人气单品
  478 + * @param type $data
  479 + * @return type []
  480 + */
  481 + public static function hotProducts($data)
  482 + {
  483 + $result = array();
  484 +
  485 + foreach ($data['resource_data'] as $key => $resource) {
  486 + $result[] = array(
  487 + 'productId'=> $resource['productId'],
  488 + 'title'=> $resource['productName'],
  489 + 'productSkn'=> $resource['productSkn'],
  490 + 'price'=> '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
  491 + 'img'=> self::imageView2($resource['src'], 250, 340),
  492 + 'url'=> Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
  493 + 'index'=> $key + 1
  494 + );
  495 + }
  496 +
  497 + return $result;
  498 + }
  499 + /**
  500 + * 潮流资讯
  501 + * @param type string $tag 搜索内容
  502 + * @return array []
  503 + */
  504 + public static function getArticle($tag = '')
  505 + {
  506 + $result = array();
  507 +
  508 + $article = GuangListData::article('1,2,3', 0, 0, '', 0, $tag, '', 3);
  509 + if (empty($article['data']['list']['artList'])) {
  510 + return $result;
  511 + }
  512 +
  513 + foreach ($article['data']['list']['artList'] as $artList) {
  514 + $result['trendList'][] = array(
  515 + 'href' => $artList['url'],
  516 + 'src' => self::imageView2(substr($artList['src'], 0, strpos($artList['src'], '?')), 264, 173),
  517 + 'mainTitle' => $artList['title'],
  518 + 'Subtitle' => $artList['intro']
  519 + );
  520 + }
  521 +
  522 + if (count($result['trendList']) < 3) {
  523 + return array();
  524 + }
  525 +
  526 + $result['name'] = '潮流资讯 HOT ITEMS';
  527 +
  528 + return $result;
  529 + }
  530 +
  531 + /**
  532 + * 缩略图
  533 + * @param type $src 图片路径
  534 + * @param type $width 宽
  535 + * @param type $heigh 高
  536 + * @return type string src
  537 + */
  538 + public static function imageView2($src, $width, $heigh)
  539 + {
  540 + $src .= strstr($src, '?') ? '&' : '?';
  541 +
  542 + return "{$src}imageView2/1/w/{$width}/h/{$heigh}";
  543 + }
  544 +
  545 + /**
  546 + * 解析resource_data 参数
  547 + * @param type $data
  548 + * @return type []
  549 + */
  550 + public static function getResourceData($data)
  551 + {
  552 + $data['resource_data'] = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
  553 +
  554 + return $data;
  555 + }
  556 +
  557 + public static function shopsDecoratorList($shopId)
  558 + {
  559 + return ShopData::shopsDecoratorList($shopId);
  560 + }
  561 +
  562 + public static function getIntro($shopId, $uid)
  563 + {
  564 + $data = array('brandName' => '', 'brandCont' => '', 'domain'=> '', 'logo'=> '', 'is_favorite'=> false);
  565 +
  566 + $intro = ShopData::getIntro($shopId, $uid);
  567 +
  568 + if ($intro['code'] === 200 && isset($intro['data'])) {
  569 + $data = array(
  570 + 'brandName'=> $intro['data']['shop_name'],
  571 + 'brandCont'=> $intro['data']['shop_intro'],
  572 + 'domain'=> $intro['data']['shop_domain'],
  573 + 'logo'=> $intro['data']['shop_logo'],
  574 + 'isFavorite'=> ($intro['data']['is_favorite'] === 'Y'),
  575 + 'multBrandShopType'=> $intro['data']['mult_brand_shop_type']
  576 + );
  577 + }
  578 +
  579 + $data['shopId'] = $shopId;
  580 + return $data;
  581 + }
  582 +
  583 +
  584 + //获取二级品类(按库存排名取前15个二级品类)
  585 + public static function getSort($sort, $misort, $shopId)
  586 + {
  587 + $result = array();
  588 + $i=0;
  589 + if (empty($sort['sort'])) {
  590 + return $result;
  591 + }
  592 + foreach($sort['sort'] as $key=>$value) {
  593 + foreach($value['sub'] as $k=>$v) {
  594 + $result[$i]['href'] = '/?msort='.$value['sort_id'].'&misort='.$v['sort_id'].'&shopId='.$shopId;
  595 + $result[$i]['name'] = $v['sort_name'];
  596 + $result[$i]['count'] = $v['count'];
  597 + $result[$i]['orderBy'] = $v['order_by'];
  598 + $result[$i]['misort'] = $v['sort_id'];
  599 + $i++;
  600 + }
  601 + }
  602 + foreach($result as $key=>$value) {
  603 + $count[$key] = $value['count'];
  604 + $sortName[$key] = $value['name'];
  605 + }
  606 +
  607 + $arr=array();
  608 + array_multisort($count,SORT_DESC,$sortName,$result);
  609 + $result = array_slice($result,0,15);
  610 +
  611 + foreach($result as &$value) {
  612 + if($value['misort'] == $misort) {
  613 + $value['curMenu'] = true;
  614 + }
  615 + }
  616 +
  617 + return $result;
  618 + }
  619 +
  620 +
  621 + public static function getShopsBrands($shopId)
  622 + {
  623 + return ShopData::getShopsBrands($shopId);
  624 + }
  625 +
  626 + public static function getSearch($shopId)
  627 + {
  628 + return ShopData::getSearch($shopId);
  629 + }
  630 +
  631 + public static function getSortInfo($shopId, $yhChannel = '', $gender = '')
  632 + {
  633 + return ShopData::getSortInfo($shopId, $yhChannel, $gender);
  634 + }
  635 +
  636 + public static function setFavorite($shopId, $isfavorite, $uid, $type = 'shop')
  637 + {
  638 + return ShopData::setFavorite($shopId, $isfavorite, $uid, $type);
  639 + }
  640 +
  641 + public static function byDomain($domain)
  642 + {
  643 + $data = array('shop_id' => '', 'type' => '');
  644 +
  645 + $result = ShopData::byDomain($domain);
  646 +
  647 + if (isset($result['code']) && $result['code'] === 200 && !empty($result['data'])) {
  648 + $data = $result['data'];
  649 + }
  650 +
  651 + return ShopData::byDomain($domain);
  652 + }
  653 +}
@@ -7,10 +7,11 @@ use Product\HotrankModel; @@ -7,10 +7,11 @@ use Product\HotrankModel;
7 use Index\HomeModel; 7 use Index\HomeModel;
8 use WebPlugin\Helpers; 8 use WebPlugin\Helpers;
9 use LibModels\Web\Product\BrandData; 9 use LibModels\Web\Product\BrandData;
  10 +use Product\ShopModel;
10 11
11 class IndexController extends WebAction 12 class IndexController extends WebAction
12 { 13 {
13 - 14 + private $_information = array('code' => 400, 'message' => '操作失败,请稍后再试!');
14 /** 15 /**
15 * 品牌首页 16 * 品牌首页
16 */ 17 */
@@ -22,11 +23,27 @@ class IndexController extends WebAction @@ -22,11 +23,27 @@ class IndexController extends WebAction
22 $this->go(SITE_MAIN); 23 $this->go(SITE_MAIN);
23 } 24 }
24 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页 25 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
25 - $type = 1;  
26 - $result = BrandsModel::getBrandByDomain($domain, $type); 26 + $result = BrandsModel::getBrandByDomain($domain);
27 if (!$result) { 27 if (!$result) {
28 $this->go(SITE_MAIN); 28 $this->go(SITE_MAIN);
29 } 29 }
  30 +
  31 + $type = intval(isset($result['type']) ? $result['type'] : '');
  32 + switch ($type) {
  33 + case 1:
  34 + //无单品店有多品店:1--->搜索页
  35 + $this->go('http://search.yohobuy.com/?query=' . $domain);
  36 + exit(0);
  37 + break;
  38 + case 2:
  39 + //店铺页面
  40 + //$shopTemplateType 1基础模板,2经典模板,
  41 + if ($result['shopTemplateType'] === 2 && !empty($result['shopId'])) {
  42 + $this->shopHome($result['shopId']);
  43 + exit(0);
  44 + }
  45 + break;
  46 + }
30 47
31 //获取uid 48 //获取uid
32 $uid = $this->getUid(); 49 $uid = $this->getUid();
@@ -125,8 +142,7 @@ class IndexController extends WebAction @@ -125,8 +142,7 @@ class IndexController extends WebAction
125 142
126 143
127 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页 144 //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
128 - $type = 2;  
129 - $result = BrandsModel::getBrandByDomain($domain, $type); 145 + $result = BrandsModel::getBrandByDomain($domain);
130 if (!$result) { 146 if (!$result) {
131 $this->go(SITE_MAIN); 147 $this->go(SITE_MAIN);
132 } 148 }
@@ -260,4 +276,148 @@ class IndexController extends WebAction @@ -260,4 +276,148 @@ class IndexController extends WebAction
260 } 276 }
261 277
262 278
  279 + /**
  280 + * 品牌店铺首页
  281 + */
  282 + public function shopHome($shopId)
  283 + {
  284 + $domain = $this->param('named');
  285 + // 设置头部数据
  286 + $this->setWebNavHeader();
  287 + $misort = $this->get('misort');
  288 +
  289 + $pjax = $this->get('_pjax');
  290 + if ($pjax) {
  291 + $data = ShopModel::getGoods(
  292 + array(
  293 + 'shop' => $shopId
  294 + ),
  295 + array(
  296 + 'controller' => 'Index',
  297 + 'action' => 'index',
  298 + 'misort' => $misort
  299 + )
  300 + );
  301 + $data['shopIndexPage'] = true;
  302 + // 渲染模板
  303 + $this->_view->display('goods-list', $data);
  304 + exit();
  305 + }
  306 +
  307 + //获取uid
  308 + $uid = $this->getUid();
  309 +
  310 + $parameters = array(
  311 + 'condition' => array(
  312 + 'shop' => $shopId
  313 + ),
  314 + 'options' => array(
  315 + 'controller' => 'Index',
  316 + 'action' => 'index',
  317 + 'misort' => $misort
  318 + ),
  319 + 'uid' => $uid,
  320 + 'navBar' => $this->get('navBar', 0),
  321 + 'brand' => $this->get('brand', 0)
  322 + );
  323 +
  324 + $data = array_merge(
  325 + array(
  326 + 'shopIndexPage' => true,
  327 + 'pathNav' => false, // pathNav数据结构同其他页面
  328 + 'coupon' => false, // 先不做
  329 + 'trendInfo' => ShopModel::getArticle($domain),
  330 + ),
  331 + ShopModel::getData($shopId, $parameters)
  332 + );
  333 +
  334 + $this->_view->display('shop-index', $data);
  335 + }
  336 +
  337 + //店铺列表页
  338 + public function shopListAction()
  339 + {
  340 + //品牌域名,没有获取到品牌域名的跳转首页
  341 + $domain = $this->param('named');
  342 +
  343 + //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
  344 + $result = BrandsModel::getBrandByDomain($domain);
  345 +
  346 + if (isset($result['code']) && $result['code'] !== 200 || empty($result['shopId'])) {
  347 + $this->go(SITE_MAIN);
  348 + }
  349 +
  350 + $shopId = $result['shopId'];
  351 +
  352 + //获取uid
  353 + $uid = $this->getUid();
  354 +
  355 + // 设置头部数据
  356 + $this->setWebNavHeader();
  357 +
  358 + $parameters = array(
  359 + 'condition' => array(
  360 + 'shop' => $shopId
  361 + ),
  362 + 'options' => array(
  363 + 'controller' => 'Index',
  364 + 'action' => 'index',
  365 + ),
  366 + 'uid' => $uid,
  367 + 'navBar' => $this->get('navBar', 1),
  368 + 'brand' => $this->get('brand', 0)
  369 + );
  370 +
  371 + $data = array_merge(
  372 + array(
  373 + 'shopIndexPage' => true,
  374 + 'pathNav' => false, // pathNav数据结构同其他页面
  375 + 'coupon' => false, // 先不做
  376 + ),
  377 + ShopModel::getShopListData($shopId, $parameters)
  378 + );
  379 +
  380 + $this->_view->display('shop-list', $data);
  381 +
  382 + }
  383 +
  384 + /**
  385 + * 店铺收藏与取消
  386 + * @return type json
  387 + */
  388 + public function setFavoriteAction()
  389 + {
  390 + $result = $this->_information;
  391 + if (!$this->isAjax()) {
  392 + return;
  393 + }
  394 +
  395 + //获取uid
  396 + $uid = $this->getUid();
  397 +
  398 + do{
  399 + if (empty($uid)) {
  400 + $result = array(
  401 + 'code' => 401,
  402 + 'message' => '请先登录!',
  403 + 'url' => Helpers::url('/signin.html', array(), 'default')
  404 + );
  405 + break;
  406 + }
  407 + $shopId = $this->post('shopId');
  408 + $isFavorite = $this->post('isFavorite');
  409 + $needColloect = $this->post('needColloect', 0);
  410 +
  411 + if (empty($shopId)) {
  412 + break;
  413 + }
  414 +
  415 + //$needColloect 说明刚登录状态 是cookie传的值
  416 + $isFavorite = $needColloect * 1 === 1 ? true : $isFavorite;
  417 + $result = ShopModel::setFavorite($shopId, $isFavorite, $uid);
  418 +
  419 + } while (false);
  420 +
  421 + $this->echoJson($result);
  422 + }
263 } 423 }
@@ -49,6 +49,20 @@ routes.item.route.action = Index @@ -49,6 +49,20 @@ routes.item.route.action = Index
49 routes.item.map.1 = productId 49 routes.item.map.1 = productId
50 routes.item.map.2 = goodsId 50 routes.item.map.2 = goodsId
51 51
  52 +;店铺装修
  53 +routes.brandshopList.type = "rewrite"
  54 +routes.brandshopList.match = "/shoplist"
  55 +routes.brandshopList.route.module = Product
  56 +routes.brandshopList.route.controller = Index
  57 +routes.brandshopList.route.action = shopList
  58 +
  59 +;店铺装修-收藏与取消
  60 +routes.brandFavorite.type = "rewrite"
  61 +routes.brandFavorite.match = "/shoplist/setFavorite"
  62 +routes.brandFavorite.route.module = Product
  63 +routes.brandFavorite.route.controller = Index
  64 +routes.brandFavorite.route.action = setFavorite
  65 +
52 routes.itemshow.type = "regex" 66 routes.itemshow.type = "regex"
53 routes.itemshow.match = "#/product/show_([0-9]+)_([0-9]+).html#" 67 routes.itemshow.match = "#/product/show_([0-9]+)_([0-9]+).html#"
54 routes.itemshow.route.module = Product 68 routes.itemshow.route.module = Product