Authored by yyq

Merge branch 'feature/shopImg' into feature/newPro-icon

Showing 33 changed files with 259 additions and 103 deletions
... ... @@ -107,7 +107,7 @@
</p>
</div>
</td>
<td class="productPrice">{{productPrice}}</td>
<td class="productPrice">¥{{productPrice}}</td>
<td>{{yohoIcon}}个</td>
<td class="adjust-cart-num">
{{#if isGift}}
... ... @@ -123,7 +123,7 @@
{{/if}}
{{/if}}
</td>
<td class="sub-total">{{productSubtotal}}</td>
<td class="sub-total">¥{{productSubtotal}}</td>
<td class="cart-operation">
<span class="cart-del-btn"><span>删除</span></span>
</td>
... ... @@ -158,7 +158,7 @@
</p>
</div>
</td>
<td><span class="productPrice">{{productPrice}}</span>
<td><span class="productPrice">¥{{productPrice}}</span>
{{#isVipPrice}}
<span class="vipPrice">(VIP)</span>
{{/isVipPrice}}
... ... @@ -184,10 +184,10 @@
</td>
<td class="sub-total">
{{#if xForOne}}
<del>{{productSubtotal}}</del>
<del>¥{{productSubtotal}}</del>
<span class="free"></span>
{{^}}
{{productSubtotal}}
¥{{productSubtotal}}
{{/if}}
</td>
<td class="cart-operation">
... ... @@ -265,7 +265,7 @@
</td>
<td style="width:7%;">{{yohoIcon}}个</td>
<td style="width:10%;">1</td>
<td style="width:10%;">{{subjoinPrice}}</td>
<td style="width:10%;">¥{{subjoinPrice}}</td>
<td style="width:20%; border-right: none;">
{{#isPriceGift}}
<a href="javascript:void(0);" data-id="{{id}}" class="cart-add-btn order"><span></span></a>
... ... @@ -321,11 +321,11 @@
</div>
{{/unless}}
<div class="right">
<p class="sum">商品总价({{cartEnsure.productAmmount}})- 活动(¥{{cartEnsure.activeSale}})= 商品金额总计(¥{{cartEnsure.productAllA}})</p>
<p class="sum">商品总价(¥{{cartEnsure.productAmmount}})- 活动(¥{{cartEnsure.activeSale}})= 商品金额总计(¥{{cartEnsure.productAllA}})</p>
<p>
<a href="/help/?category_id=87" class="yoho-coin" target="_blank"></a>
共返YOHO币:{{cartEnsure.getYoho}}个 商品总价(不含运费):
<strong>{{cartEnsure.productAllA}}</strong>
<strong>¥{{cartEnsure.productAllA}}</strong>
</p>
</div>
</div>
... ...
... ... @@ -169,7 +169,7 @@
{{#each carriageList}}
<div class="express-list">
<input {{# checked}}checked{{/ checked}} class="radio" type="radio" name="carriagegroup" id="common-{{id}}" value="{{id}}"/>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 ¥{{value}} {{desc}}</label>
</div>
{{/each}}
<div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。
... ... @@ -212,9 +212,9 @@
<p class="next">
</p>
{{#if fee}}
<p class="express-fee">运费:{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>
<p class="express-fee">运费:¥{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>
{{else}}
<p class="express-fee">运费:0.00元</p>
<p class="express-fee">运费:¥0.00元</p>
{{/if}}
</div>
{{/each}}
... ... @@ -387,7 +387,7 @@
{{#if redEnvelopes}}
<div class="red-envelopes active">
<div class="use-envelopes">
<input checked value="0" data-all="{{redEnvelopes}}" data-use="{{useRedEnvelopes}}" type="checkbox" />使用现金红包支付:<span>-{{useRedEnvelopes}}</span>
<input checked value="0" data-all="{{redEnvelopes}}" data-use="{{useRedEnvelopes}}" type="checkbox" />使用现金红包支付:<span>-¥{{useRedEnvelopes}}</span>
</div>
<div class="has-envelopes">您的现金红包余额:<span></span></div>
</div>
... ...
... ... @@ -11,7 +11,7 @@
<p class="na-good-name">{{name}}</p>
</a>
<span class="na-price{{#if salePrice}} has-sale{{/if}}">{{marketPrice}}</span>
<span class="na-price{{#if salePrice}} has-sale{{/if}}">¥{{marketPrice}}</span>
{{#if salePrice}}
<span class="na-price">{{salePrice}}</span>
... ...
... ... @@ -71,7 +71,7 @@
<a href="{{href}}">
<img class="thumb" src="{{thumb}}">
<p class="name">{{name}}</p>
<span class="price">{{price}}</span>
<span class="price">¥{{price}}</span>
</a>
</li>
{{/ newArrival}}
... ... @@ -103,7 +103,7 @@
<a href="{{href}}" data-id='{{productId}}' target="_blank">
<img class="thumb" src="{{thumb}}">
<p class="name">{{name}}</p>
<span class="price">{{price}}</span>
<span class="price">¥{{price}}</span>
</a>
</li>
{{/ recommend}}
... ...
... ... @@ -18,11 +18,12 @@
{{#if operation.goPay}}
<a class="go-pay oo-btn" href="{{operation.goPay}}">立即付款</a>
{{/if}}
{{#if virtualGoods}}
{{#unless virtualGoods}}
<!--虚拟商品-->
{{else if changeable}}
<span class="edit-order oo-btn">修改订单</span>
{{/if}}
{{#if changeable}}
<span class="edit-order oo-btn">修改订单</span>
{{/if}}
{{/unless}}
{{#if operation.cancelOrder}}
<span class="cancel-order oo-btn">取消订单</span>
{{/if}}
... ... @@ -197,9 +198,9 @@
<p class="next">
</p>
{{#if fee}}
<p>运费:{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>
<p>运费:¥{{fee}}元(原价{{orign}}元,优惠{{count}}元)</p>
{{else}}
<p>运费:0.00元</p>
<p>运费:¥0.00元</p>
{{/if}}
</div>
{{/each}}
... ...
... ... @@ -211,7 +211,7 @@
{{/ goods}}
<tr>
<td colspan="5">
<p class="re-tips">订单金额:{{amount}} (¥{{cash}} 现金 - {{yohoCoin}} YOHO币 - {{coupon}} 优惠券)</p>
<p class="re-tips">订单金额:¥{{amount}} (¥{{cash}} 现金 - ¥{{yohoCoin}} YOHO币 - ¥{{coupon}} 优惠券)</p>
</td>
</tr>
</table>
... ...
... ... @@ -30,7 +30,7 @@
<div class="vip-level">
<span class="level">年度累计金额:</span>
<div class="year-amount">
<div class="amount">{{yearCost}}</div>
<div class="amount">¥{{yearCost}}</div>
<span class="ps">VIP金额累计需要订单成功签收且无退换货</span>
{{#if platinum}}
<div class="plalevel"></div>
... ... @@ -48,7 +48,7 @@
</div>
<div class="change-img{{level}}"></div>
<div class="balance">
<p>还差<span class="balan">{{balan}}</span>元就可以升级为{{vipLevel}}!</p>
<p>还差¥<span class="balan">{{balan}}</span>元就可以升级为{{vipLevel}}!</p>
<a href="{{morePreferences}}">更多优惠</a>
</div>
{{/if}}
... ... @@ -57,7 +57,7 @@
<div class="history">
<div class="level">历史消费总额:
<span class="hisamout">{{totalCost}}</span>
<span class="hisamout">¥{{totalCost}}</span>
</div>
</div>
... ...
... ... @@ -68,7 +68,7 @@
<a href="{{href}}">
<img class="thumb" src="{{thumb}}">
<p class="name">{{name}}</p>
<span class="price">{{price}}</span>
<span class="price">¥{{price}}</span>
</a>
</li>
{{/ newArrival}}
... ...
... ... @@ -11,7 +11,7 @@
<p class="na-good-name">{{name}}</p>
</a>
<span class="na-price{{#if salePrice}} has-sale{{/if}}">{{marketPrice}}</span>
<span class="na-price{{#if salePrice}} has-sale{{/if}}">¥{{marketPrice}}</span>
{{#if salePrice}}
<span class="na-price">{{salePrice}}</span>
... ...
... ... @@ -191,7 +191,7 @@
{{/ goods}}
<tr>
<td colspan="5">
<p class="re-tips">订单金额:{{amount}} (¥{{cash}} 现金 - {{yohoCoin}} YOHO币 - {{coupon}} 优惠券)</p>
<p class="re-tips">订单金额:¥{{amount}} (¥{{cash}} 现金 - ¥{{yohoCoin}} YOHO币 - ¥{{coupon}} 优惠券)</p>
</td>
</tr>
</table>
... ...
... ... @@ -68,7 +68,7 @@
<a href="{{href}}">
<img class="thumb" src="{{thumb}}">
<p class="name">{{name}}</p>
<span class="price">{{price}}</span>
<span class="price">¥{{price}}</span>
</a>
</li>
{{/ newArrival}}
... ...
... ... @@ -170,7 +170,7 @@
{{#each carriagelist}}
<div class="express-list">
<input class="radio" type="radio" name="carriagegroup" id="common-{id}" value="{{value}}"/>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 ¥{{value}} {{desc}}</label>
</div>
{{/each}}
<div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。</div>
... ... @@ -252,11 +252,11 @@
</div>
<div class="play-right">
<ul class="play-total">
<li><label>发票抬头:</label>+¥<em>0.00</em></li>
<li><label>活动:</label>-¥<em>0.00</em></li>
<li class="red"><label>运费:</label>+¥<em>0.00</em></li>
<li><label>优惠券支付<a href="javascript:void(0);" to="play-juan-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>使用YOHO币<a href="javascript:void(0);" to="play-bi-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>发票抬头:</label>+¥<em>0.00</em></li>
<li><label>活动:</label>-¥<em>0.00</em></li>
<li class="red"><label>运费:</label>+¥<em>0.00</em></li>
<li><label>优惠券支付<a href="javascript:void(0);" to="play-juan-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>使用YOHO币<a href="javascript:void(0);" to="play-bi-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
</ul>
<dl class="play-juan-pan pan">
<dt>使用优惠卷支付</dt>
... ...
... ... @@ -170,7 +170,7 @@
{{#each carriagelist}}
<div class="express-list">
<input class="radio" type="radio" name="carriagegroup" id="common-{id}" value="{{value}}"/>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 {{value}} {{desc}}</label>
<label for="common-express">{{name}}:&nbsp;&nbsp;运费 ¥{{value}} {{desc}}</label>
</div>
{{/each}}
<div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。</div>
... ... @@ -252,11 +252,11 @@
</div>
<div class="play-right">
<ul class="play-total">
<li><label>发票抬头:</label>+¥<em>0.00</em></li>
<li><label>活动:</label>-¥<em>0.00</em></li>
<li class="red"><label>运费:</label>+¥<em>0.00</em></li>
<li><label>优惠券支付<a href="javascript:void(0);" to="play-juan-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>使用YOHO币<a href="javascript:void(0);" to="play-bi-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>发票抬头:</label>+¥<em>0.00</em></li>
<li><label>活动:</label>-¥<em>0.00</em></li>
<li class="red"><label>运费:</label>+¥<em>0.00</em></li>
<li><label>优惠券支付<a href="javascript:void(0);" to="play-juan-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
<li><label>使用YOHO币<a href="javascript:void(0);" to="play-bi-pan">[修改]</a>:</label>-¥<em>0.00</em></li>
</ul>
<dl class="play-juan-pan pan">
<dt>使用优惠卷支付</dt>
... ...
... ... @@ -84,12 +84,12 @@
<a class="brand-name" href="{{brandUrl}}">{{brandName}}</a>
<p class="market-price {{#if salePrice}}with-sale{{/unless}}">
<span class="title">市场价:</span>
<span class="price">{{marketPrice}}</span>
<span class="price">¥{{marketPrice}}</span>
</p>
{{#if salePrice}}
<p class="sale-price">
<span class="title">促销价:</span>
<span class="price">{{salePrice}}</span>
<span class="price">¥{{salePrice}}</span>
</p>
{{/if}}
... ...
... ... @@ -6,6 +6,16 @@
{{> product/shop-header}}
<div class="list-left pull-left">
<div class="shop-search">
<form action="//search.yohobuy.com" method="get" id="shop-search-form">
<span>
<input type="hidden" name="shop" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
</span>
<span class="iconfont shop-query-submit">&#xe611;</span>
</form>
</div>
{{> product/left-content}}
{{> product/shop-sidebar}}
... ... @@ -24,7 +34,7 @@
<ul>
{{#largeSlideImg}}
<li>
<a href="{{url}}"><img src="{{img}}"></a>
<a target="_blank" href="{{url}}"><img src="{{img}}"></a>
</li>
{{/largeSlideImg}}
</ul>
... ... @@ -32,7 +42,7 @@
</div>
<div class="slider-right pull-right">
{{#oneRowTwoColImages}}
<a class="slider-item" href="{{url}}"><img src="{{img}}"></a>
<a class="slider-item" target="_blank" href="{{url}}"><img src="{{img}}"></a>
{{/oneRowTwoColImages}}
</div>
</div>
... ...
... ... @@ -33,10 +33,10 @@
</div>
<div class="price">
\{{#if marketPrice}}
<del>\{{marketPrice}}</del>
<del>¥\{{marketPrice}}</del>
\{{/if}}
\{{price}}</div>
¥\{{price}}</div>
<div class="op">
<a href="javascript:void(0);" data-id="\{{id}}" class="btn_view_s"></a>
</div>
... ...
... ... @@ -63,10 +63,10 @@
<p class="na-good-name">\{{name}}</p>
</a>
<span class="na-price\{{#if salePrice}} has-sale\{{/if}}">\{{marketPrice}}</span>
<span class="na-price\{{#if salePrice}} has-sale\{{/if}}">¥\{{marketPrice}}</span>
\{{#if salePrice}}
<span class="na-price">\{{salePrice}}</span>
<span class="na-price">¥\{{salePrice}}</span>
\{{/if}}
</li>
\{{/ naGoods}}
... ...
... ... @@ -174,7 +174,7 @@
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
<span class="price">¥\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
... ... @@ -189,7 +189,7 @@
<li class="activity-item">
<span class="activity-name">活动</span>
<h3 class="activity-content">
\{\{#if fit_outlet_promotion \}\}购outlet商品,满1999再享9
\{\{#if fit_outlet_promotion \}\}购outlet商品,满¥1999再享9
\{\{/if\}\}
\{\{#if has_other_promotion\}\}
<span class="mycart_i_down" title="更多" ></span>
... ... @@ -203,7 +203,7 @@
\{\{#if fit_free_shipping \}\}
<li class="activity-item">
<span class="activity-name">免运费</span>
<h3 class="activity-content">全场满 \{\{fit_free_shipping\}\}免运费</h3>
<h3 class="activity-content">全场满 ¥\{\{fit_free_shipping\}\}免运费</h3>
</li>
\{\{/if\}\}
</ul>
... ...
{{# shopTopBanner}}
<div class="shop-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})">
<div class="banner-mark"></div>
</div>
{{#if isShowShopName}}
<div class="shop-name">
{{brandIntro.brandName}}
... ... @@ -46,12 +48,9 @@
{{#if navigationBar}}
<ul class="shop-nav clearfix">
{{#navigationBar}}
<li class="nav-item {{#if @first}}first{{/if}} {{#if current}}current{{/if}}">
<li class="nav-item {{#if @first}}first{{/if}}{{#if current}}current{{/if}}">
<a href="{{url}}">
{{name}}
{{#if arrow}}
<span class="iconfont">&#xe63a;</span>
{{/if}}
</a>
</li>
{{/navigationBar}}
... ...

13.8 KB | W: | H:

14.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -10,6 +10,8 @@ var $ = require('yoho.jquery'),
var $shopIntro = $('.shop-intro'),
$shopCollect = $('.shop-collect'),
$shopSearch = $('#shop-search-form'),
$queryKey = $('#shop-query-key'),
$sliderLeft = $('.slider-left'),
$allGoods = $('.all-goods'),
$fixedArea = $allGoods.find('.fixed-area'),
... ... @@ -94,6 +96,12 @@ if (window.cookie('needColloect') * 1 === 1 && window.getUid()) {
});
}
$('.shop-query-submit').click(function() {
if ($queryKey.val()) {
$shopSearch.submit();
}
});
// 全部商品使用 pjax 翻页
$allGoods.pjax('a.pjax', '.goods-wrap', {
timeout: 5000,
... ...
{
"name": "web-yohobuy",
"version": "4.8.13",
"version": "4.8.15",
"description": "web yohobuy static",
"keywords": [],
"homepage": "",
... ...
... ... @@ -18,6 +18,12 @@
height: 150px;
}
.banner-mark {
width: 100%;
height: 100%;
background: resolve('/product/banner-mark.png');
}
.opt-wrap {
position: absolute;
top: 65%;
... ... @@ -104,6 +110,39 @@
}
}
.sort-child-list a {
height: 28px;
line-height: 28px;
}
.shop-search {
width: 100%;
border: 1px solid #3a3a3a;
margin-bottom: 10px;
overflow: hidden;
position: relative;
.shop-query-key {
width: 120px;
height: 34px;
border: none;
font-size: 13px;
padding: 0 34px 0 6px;
}
.shop-query-submit {
width: 34px;
height: 34px;
line-height: 38px;
font-size: 22px;
text-align: center;
position: absolute;
top: 0;
right: 0;
cursor: pointer;
}
}
.coupon {
margin-top: 20px;
width: 100%;
... ... @@ -187,7 +226,6 @@
margin-bottom: 20px;
width: 235px;
height: 315px;
font-size: 14px;
text-align: center;
line-height: 1.5;
background: #f5f5f5;
... ... @@ -201,10 +239,16 @@
.title {
width: 220px;
padding: 0 5px;
font-size: 12px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.price {
font-size: 15px;
line-height: 32px;
}
}
.hat {
... ... @@ -377,6 +421,7 @@
position: relative;
width: 100%;
text-align: center;
margin-bottom: 20px;
a {
display: block;
... ... @@ -394,6 +439,10 @@
.trend-info {
width: 100%;
.floor-header {
margin-top: 60px;
}
.trend-list {
width: 100%;
... ... @@ -401,6 +450,7 @@
float: left;
width: 316px;
margin-left: 10px;
margin-bottom: 20px;
text-align: center;
&:first-child {
... ... @@ -417,7 +467,7 @@
.sub-title {
box-sizing: border-box;
font-size: 16px;
margin-top: 15px;
font-weight: bold;
padding: 0 10px;
width: 100%;
overflow: hidden;
... ... @@ -426,8 +476,12 @@
line-height: 24px;
}
.main-title {
padding-top: 20px;
}
.sub-title {
margin-top: 0;
padding-bottom: 20px;
font-size: 14px;
}
}
... ... @@ -500,14 +554,15 @@
display: inline-block;
line-height: 14px;
vertical-align: middle;
font-weight: bold;
.name {
font-size: 14px;
font-weight: bold;
}
.en-name {
font-size: 12px;
margin-top: 4px;
}
}
... ...
... ... @@ -49,6 +49,7 @@ class SearchModel
'query' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'brand' => FILTER_SANITIZE_STRING,
'shop' => FILTER_DEFAULT,
'sort' => FILTER_VALIDATE_INT,
'category' => FILTER_VALIDATE_INT,
'channel' => FILTER_VALIDATE_INT,
... ... @@ -73,7 +74,8 @@ class SearchModel
'series' => FILTER_VALIDATE_INT,
'folder_id' => FILTER_VALIDATE_INT,
'page' => FILTER_VALIDATE_INT,
'ageLevel' => FILTER_VALIDATE_INT), false);
'ageLevel' => FILTER_VALIDATE_INT,
'filter_poolId' => FILTER_VALIDATE_INT), false);
//接收高级选项
foreach ($_GET as $key =>$val) {
if (strpos($key, 'parameter_') !== false) {
... ...
<?php
namespace Product;
use LibModels\Wap\Guang\OptData;
use Product\SearchModel;
use LibModels\Web\Product\SearchData;
use LibModels\Web\Product\ShopData;
... ... @@ -29,7 +30,7 @@ class ShopModel
foreach ($shopList['data']['list'] as $list) {
$fun = $list['resource_name'];
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
$list = self::$fun(self::getResourceData($list, $shopId), $parameters);
switch ($fun) {
case 'signboard':
//过滤不合法的数据
... ... @@ -60,6 +61,41 @@ class ShopModel
exit();
}
$sknList = array();
if (isset($data['newArrivel']['list'])) {
foreach ($data['newArrivel']['list'] as $prod) {
$sknList[] = $prod['productSkn'];
}
}
if (isset($data['hotSingle']['list'])) {
foreach ($data['hotSingle']['list'] as $prod) {
$sknList[] = $prod['productSkn'];
}
}
$sknProList = SearchData::searchAll(array('query' => join(',', array_unique($sknList))));
if (isset($sknProList['data']['product_list'])) {
$coverList = array();
foreach ($sknProList['data']['product_list'] as $prod) {
$coverList[$prod['product_skn']] = HelperSearch::getProductPic(array(0 => $prod));
}
foreach ($data['newArrivel']['list'] as $k => $v) {
if (isset($coverList[$v['product_skn']])) {
$data['newArrivel']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg'];
}
}
foreach ($data['hotSingle']['list'] as $k => $v) {
if (isset($coverList[$v['product_skn']])) {
$data['hotSingle']['list'][$k]['img'] = $coverList[$v['product_skn']][0]['coverImg'];
}
}
}
//店铺介绍
$data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
... ... @@ -122,7 +158,7 @@ class ShopModel
foreach ($shopList['data']['list'] as $list) {
$fun = $list['resource_name'];
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
$list = self::$fun(self::getResourceData($list, $shopId), $parameters);
switch ($fun) {
case 'newProducts':
case 'hotProducts':
... ... @@ -374,7 +410,7 @@ class ShopModel
foreach ($resource['data'] as $val) {
$result[] = array(
'img' => self::imageView2($val['src'], 660, 360),
'url' => Helpers::getUrlSafe($val['url']),
'url' => Helpers::getUrlSafe($val['url']),
);
}
}
... ... @@ -397,9 +433,9 @@ class ShopModel
Helpers::substrEllipsis($resource['enName'], 5) : Helpers::substrEllipsis($resource['enName'], 10),
'name' => Helpers::isChinese($resource['name']) ?
Helpers::substrEllipsis($resource['name'], 5) : Helpers::substrEllipsis($resource['name'], 6),
'img'=> self::imageView2($resource['src'], 50, 50),
'title'=> $resource['title'],
'url'=> Helpers::getUrlSafe($resource['url']),
'img' => self::imageView2($resource['src'], 50, 50),
'title' => $resource['title'],
'url' => Helpers::getUrlSafe($resource['url']),
);
}
if (empty($result)) {
... ... @@ -423,9 +459,9 @@ class ShopModel
foreach ($data['resource_data'] as $resource) {
$result[] = array(
'img'=> self::imageView2($resource['src'], 160, 240),
'title'=> $resource['title'],
'url'=> Helpers::getUrlSafe($resource['url']),
'img' => self::imageView2($resource['src'], 160, 240),
'title' => $resource['title'],
'url' => Helpers::getUrlSafe($resource['url']),
);
}
if (empty($result)) {
... ... @@ -453,8 +489,8 @@ class ShopModel
foreach ($resource['data'] as $val) {
$result[] = array(
'img'=> self::imageView2($val['src'], 160, 240),
'url'=> Helpers::getUrlSafe($val['url']),
'img' => self::imageView2($val['src'], 160, 240),
'url' => Helpers::getUrlSafe($val['url']),
);
}
}
... ... @@ -518,7 +554,7 @@ class ShopModel
if (isset($data['resource_data']['hot'])) {
foreach ($data['resource_data']['hot'] as $val) {
if (empty($val['url'])) {
if (empty($val['url']) || empty($val['position'])) {
continue;
}
$result['hot'][] = array(
... ... @@ -530,7 +566,7 @@ class ShopModel
if (isset($data['resource_data']['new'])) {
foreach ($data['resource_data']['new'] as $val) {
if (empty($val['url'])) {
if (empty($val['url']) || empty($val['position'])) {
continue;
}
$result['new'][] = array(
... ... @@ -550,7 +586,7 @@ class ShopModel
* @param type $data
* @return type []
*/
public static function newProducts($data)
public static function newProducts($data, $opts)
{
$result = array();
... ... @@ -559,8 +595,8 @@ class ShopModel
'productId' => $resource['productId'],
'title' => $resource['productName'],
'productSkn' => $resource['productSkn'],
'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
'img' => self::imageView2($resource['src'], 250, 340),
'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
'img' => self::imageView2($resource['src'], 250, 250),
'url' => Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
);
}
... ... @@ -572,7 +608,7 @@ class ShopModel
* @param type $data
* @return type []
*/
public static function hotProducts($data)
public static function hotProducts($data, $opts)
{
$result = array();
... ... @@ -581,8 +617,8 @@ class ShopModel
'productId' => $resource['productId'],
'title' => $resource['productName'],
'productSkn' => $resource['productSkn'],
'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
'img' => self::imageView2($resource['src'], 250, 340),
'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
'img' => self::imageView2($resource['src'], 250, 250),
'url' => Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
'index' => $key + 1
);
... ... @@ -605,7 +641,7 @@ class ShopModel
foreach ($shopList['data']['list'] as $list) {
$fun = $list['resource_name'];
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
$list = self::$fun(self::getResourceData($list, $shopId), $parameters);
switch ($fun) {
case 'shopTopBanner_base':
case 'signboard':
... ... @@ -681,15 +717,50 @@ class ShopModel
return Helpers::getUrlSafe("{$src}imageView2/1/w/{$width}/h/{$heigh}");
}
private static function modifyUrl($val, $shopId)
{
if (isset($val['linkType']) && $val['linkType'] == 1) {
return Helpers::url('/product/index/shoplist', array('filter_poolId' => $val['categoryId'], 'shopId' => $shopId), '');
} else {
return $val['url'];
}
}
/**
* 解析resource_data 参数
* @param type $data
* @return type []
*/
public static function getResourceData($data)
public static function getResourceData($data, $shopId)
{
$data['resource_data'] = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
$result = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
foreach ($result as $key => &$val) {
$val['url'] = self::modifyUrl($val, $shopId);
if (isset($val['data']) && is_array($val['data'])) {
foreach ($val['data'] as $k => &$v) {
$url = self::modifyUrl($v, $shopId);
if (!empty($url)) {
$v['url'] = $url;
}
}
}
if (!isset($val['data']) && is_array($val)) {
foreach ($val as $k1 => &$v1) {
if (is_array($v1)) {
$url = self::modifyUrl($v1, $shopId);
if (!empty($url)) {
$v1['url'] = $url;
}
}
}
}
}
$data['resource_data'] = $result;
return $data;
}
... ...
... ... @@ -489,6 +489,7 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopId' => $shopId,
'shopIndexPage' => true,
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
... ... @@ -504,7 +505,9 @@ class IndexController extends WebAction
public function shopListAction()
{
$shopId = $this->get('shopId', 0);
if (empty($shopId)) {
$poolId = $this->get('filter_poolId', 0);
if (empty($shopId) && empty($poolId)) {
$this->go(SITE_MAIN);
}
... ... @@ -514,10 +517,17 @@ class IndexController extends WebAction
// 设置头部数据
$this->setWebNavHeader();
// condition
$condition = array();
if (!empty($poolId)) {
$condition['filter_poolId'] = $poolId;
} else {
$condition['shop'] = $shopId;
}
$parameters = array(
'condition' => array(
'shop' => $shopId
),
'condition' => $condition,
'options' => array(
'controller' => 'Index',
'action' => 'index',
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "4.8.13"
application.version = "4.8.15"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "4.8.13"
application.version = "4.8.15"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "4.8.13"
application.version = "4.8.15"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -50,7 +50,7 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets/web"
; 应用的版本号
application.version = "4.8.13"
application.version = "4.8.15"
; 网站SEO信息
application.seo.title = "YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证"
... ...
... ... @@ -14,18 +14,18 @@ define('EXHIBITION_TICKET', 51335912);//展览票skn
define('USE_INTER_FACE_SHUNT', false);//分流开关
#test环境
define('API_URL', 'http://api-test3.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');
define('API_OLD', 'http://test2.open.yohobuy.com/');
//define('API_URL', 'http://testapi.yoho.cn:28078/');
//define('SERVICE_URL', 'http://testservice.yoho.cn:28077/');
//define('YOHOBUY_URL', 'http://www.yohobuy.com/');
//define('SERVICE_NOTIFY', 'http://testservice.yoho.cn:28077/');
//define('API_OLD', 'http://test2.open.yohobuy.com/');
#dev环境
// define('API_URL', 'http://devapi.yoho.cn:58078/');
// define('SERVICE_URL', 'http://devservice.yoho.cn:58077/');
// define('YOHOBUY_URL', 'http://www.yohobuy.com/');
// define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/');
// define('API_OLD', 'http://devservice.yoho.cn:58077/');
define('API_URL', 'http://dev-api.yohops.com:9999/');
define('SERVICE_URL', 'http://dev-service.yohops.com:9999/');
define('YOHOBUY_URL', 'http://www.yohobuy.com/');
define('SERVICE_NOTIFY', 'http://test2.open.yohobuy.com/');
define('API_OLD', 'http://devservice.yoho.cn:58077/');
$application = new Application(APPLICATION_PATH . '/configs/application.developer.ini');
$application->bootstrap()->run();
\ No newline at end of file
... ...