Authored by 周少峰

Merge branch 'release/newProduct'

Showing 34 changed files with 228 additions and 32 deletions
... ... @@ -220,7 +220,11 @@ class HelperSearch
return array();
}
$gender = isset(self::$params['gender']) ? self::$params['gender'] : Helpers::getGenderByCookie();
$gender = substr($gender,0,1);
if ($options['defaultCover'] && $gender === '1,2,3') {
$gender = 0;
} else {
$gender = substr($gender,0,1);
}
foreach($product as $key => $val){
if (!isset($val['goods_list']) || empty($val['goods_list'])) {
continue;
... ...
... ... @@ -6,6 +6,8 @@
{{> product/shop-header}}
<div class="list-left pull-left">
{{> product/shop-search}}
{{> product/left-content}}
{{> product/shop-sidebar}}
... ... @@ -49,19 +51,9 @@
{{> product/shop-single-list}}
</div>
{{/hotSingle}}
{{#allGoods}}
<div class="all-goods clearfix">
{{> index/floor-header}}
<div class="goods-wrap">
{{> product/goods-list}}
</div>
{{> product/shop-all-goods}}
<div class="loading">
<a href="{{href}}" target= "_blank">查看更多</a>
</div>
</div>
{{/allGoods}}
{{#trendInfo}}
<div class="trend-info clearfix">
{{> index/floor-header}}
... ...
... ... @@ -6,6 +6,8 @@
{{> product/shop-header}}
<div class="list-left pull-left">
{{> product/shop-search}}
{{> product/left-content}}
{{> product/shop-sidebar}}
... ... @@ -13,7 +15,12 @@
<div class="list-right pull-right">
{{> product/shop-entry}}
{{> product/standard-content}}
{{#if searchEmpty}}
{{> product/shop-search-empty}}
{{> product/shop-all-goods}}
{{^}}
{{> product/standard-content}}
{{/if}}
{{> product/latest-walk}}
</div>
... ...
{{#allGoods}}
<div class="all-goods clearfix">
{{> index/floor-header}}
<div class="goods-wrap">
{{> product/goods-list}}
</div>
{{#if href}}
<div class="loading">
<a href="{{href}}" target= "_blank">查看更多</a>
</div>
{{/if}}
</div>
{{/allGoods}}
... ...
<div class="search-empty">
<div class="empty-icon"></div>
<p class="res-tip">抱歉!未找到符合条件的商品</p>
<p>换个条件或关键词试试吧。</p>
</div>
\ No newline at end of file
... ...
<div class="shop-search">
<form action="/shoplist" method="get" id="shop-search-form">
<span>
<input type="hidden" name="shopId" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索" {{# shopQueryKey}}value="{{.}}"{{/ shopQueryKey}}>
</span>
<span class="iconfont shop-query-submit">&#xe611;</span>
</form>
</div>
... ...
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

13.8 KB | W: | H:

14.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

13.8 KB | W: | H:

14.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -216,7 +216,7 @@ function blurAction(opt) {
}
if (opt.inputName === 'mobile') {
regular = /^1[3|4|5|8|7][0-9]{9}$/;
regular = /^\d+$/; // /^1[3|4|5|8|7][0-9]{9}$/;
if (opt.len !== 11) {
msg = '手机号码必须是11位的,请确认';
... ...
... ... @@ -492,7 +492,7 @@ function validateForm() {
var nameReg = /^[\u4e00-\u9fa5]{2,5}$/;
var addressReg = /^[a-zA-Z0-9-#()()\u4e00-\u9fa5]+$/;
var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
var phoneReg = /^\d+$/; // /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
var telCodeReg = /^[0-9]{3,4}$/;
var telReg = /^[0-9]{8}$/;
var _right_html = '<i class="order-icon icon-right"></i>';
... ...
... ... @@ -444,9 +444,9 @@ exports.saveAddress = function() {
var nameReg = /^[\u4e00-\u9fa5]{2,5}$/;
var addressReg = /^[\s\S]{2,100}$/;
var phoneReg = /^1[35847]{1}[0-9]{9}$/;
var phoneReg = /^\d+$/;
var codeReg = /^[0-9]{6}$/;
var emailReg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var emailReg = /^[^@]+\@[^@]+$/; // /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var telCodeReg = /^[0-9]{3,5}$/;
var telReg = /^[0-9]{5,10}$/;
... ...
... ... @@ -916,7 +916,7 @@ function saveReceiptInfo() {
if (finalReceiptMobile === receiptMobileStar) {
finalReceiptMobile = receiptMobile;
} else {
verifymobile = /[1][34578][0-9]{9}/;
verifymobile = /^\d+$/; // /[1][34578][0-9]{9}/;
if (!verifymobile.test(finalReceiptMobile)) {
$('.invoice-phone .enpty-input').removeClass('hide');
if (finalReceiptMobile.length === 0) {
... ...
... ... @@ -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,
... ...
... ... @@ -110,6 +110,14 @@
background: #fff;
}
.new-festival-tag {
width: 72px;
text-align: center;
background-image: url(/product/newPro-icon.png);
color: #000;
padding: 0;
}
.thumbs {
width: 75px;
height: 510px;
... ...
... ... @@ -112,6 +112,14 @@
color: #4e4e4e;
border: 1px solid #4e4e4e;
}
.new-festival-tag {
width: 72px;
text-align: center;
background-image: url(/product/newPro-icon.png);
color: #000;
padding: 0;
}
}
}
... ...
... ... @@ -115,6 +115,34 @@
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%;
... ... @@ -184,7 +212,17 @@
}
.floor-header {
margin-top: 50px;
margin: 50px 0 40px;
.floor-title {
margin: 0 auto;
width: 298px;
height: 31px;
line-height: 31px;
border: 1px solid #000;
font-size: 16px;
text-align: center;
}
}
.new-arrivel,
... ... @@ -364,14 +402,15 @@
font-size: 14px;
li {
display: inline-block;
height: 28px;
line-height: 28px;
float: left;
margin: 6px 0 0 6px;
padding: 0 15px;
}
.on {
background: #000;
height: 28px;
line-height: 28px;
a {
color: #fff;
... ... @@ -408,6 +447,28 @@
}
}
.search-empty {
text-align: center;
padding-top: 40px;
.empty-icon {
height: 172px;
background: resolve('/product/search-bg.png') no-repeat center center;
}
> p {
color: #afafaf;
font-size: 14px;
}
.res-tip {
font-size: 18px;
color: #444;
margin: 20px 0;
font-weight: 500;
}
}
.trend-info {
width: 100%;
... ...
... ... @@ -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,
... ...
... ... @@ -61,6 +61,46 @@ 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']) && !empty($sknProList['data']['product_list'])) {
$coverList = array();
$proList = HelperSearch::getProductList($sknProList['data']['product_list'], array(
'imgSize' => array(250, 250),
'defaultCover' => true
));
foreach ($proList as $prod) {
$coverList[$prod['skn']] = $prod['thumb'];
}
foreach ($data['newArrivel']['list'] as &$v) {
if (isset($coverList[$v['productSkn']])) {
$v['img'] = $coverList[$v['productSkn']];
}
}
foreach ($data['hotSingle']['list'] as &$v) {
if (isset($coverList[$v['productSkn']])) {
$v['img'] = $coverList[$v['productSkn']];
}
}
}
//店铺介绍
$data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
... ... @@ -87,7 +127,11 @@ class ShopModel
}
// 组织模板数据
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
$result = HelperSearch::getList($res, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$data['pathNav'] = array_merge(
HelperSearch::$listNav,
array(
... ... @@ -169,7 +213,10 @@ class ShopModel
}
// 组织模板数据
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
$result = HelperSearch::getList($res, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$data['goods'] = $result['goods'];
$data['opts'] = $result['opts'];
... ... @@ -182,9 +229,33 @@ class ShopModel
array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
)
);
// $data['name'] = '全部商品 ALL';
// $sort = self::getSort($res['sort']);
// $data['goodsMenu']['menuList'] = $sort;
// 搜索无商品时显示全部商品
if (isset($searchCondition['condition']['query']) &&
!empty($searchCondition['condition']['query']) &&
empty($data['goods'])) {
$data['searchEmpty'] = true;
unset($searchCondition['condition']['query']);
$allProUrl = array('product' => SearchData::getProductUrl($searchCondition['condition']));
//批量调接口获取数据
$allRes = Yohobuy::getMulti($allProUrl);
$allResult = HelperSearch::getList($allRes, array_merge(
array('defaultCover' => true),
$searchCondition['options']
), $searchCondition['userInput']);
$sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId);
$param = array_merge($searchCondition['userInput'], array('navBar' => 1, 'shopId' => $shopId));
$data['allGoods']['name'] = '全部商品 ALL';
$data['allGoods']['list'] = $allResult['goods'];
$data['allGoods']['opts'] = $allResult['opts'];
$data['allGoods']['goodsMenu']['menuList'] = $sort;
$data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?' . http_build_query($param);
}
return $data;
... ... @@ -699,6 +770,7 @@ class ShopModel
public static function getResourceData($data, $shopId)
{
$result = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
foreach ($result as $key => &$val) {
$val['url'] = self::modifyUrl($val, $shopId);
... ... @@ -714,9 +786,11 @@ class ShopModel
if (!isset($val['data']) && is_array($val)) {
foreach ($val as $k1 => &$v1) {
$url = self::modifyUrl($v1, $shopId);
if (!empty($url)) {
$v1['url'] = $url;
if (is_array($v1)) {
$url = self::modifyUrl($v1, $shopId);
if (!empty($url)) {
$v1['url'] = $url;
}
}
}
}
... ...
... ... @@ -490,6 +490,8 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopIndexPage' => true,
'shopId' => $shopId,
'shopQueryKey' => $this->get('query', ''),
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
'trendInfo' => ShopModel::getArticle($shopId),
... ... @@ -530,6 +532,7 @@ class IndexController extends WebAction
'options' => array(
'controller' => 'Index',
'action' => 'index',
'misort' => $this->get('misort')
),
'uid' => $uid,
'navBar' => $this->get('navBar', 1),
... ... @@ -540,6 +543,8 @@ class IndexController extends WebAction
$data = array_merge(
array(
'shopIndexPage' => true,
'shopId' => $shopId,
'shopQueryKey' => $this->get('query', ''),
'pathNav' => false, // pathNav数据结构同其他页面
'coupon' => false, // 先不做
),
... ...
... ... @@ -14,8 +14,8 @@ define('EXHIBITION_TICKET', 51335912);//展览票skn
define('USE_INTER_FACE_SHUNT', false);//分流开关
define('API_URL', 'http://api-test3.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test3.yohops.com:9999/');
define('API_URL', 'http://api-test1.yohops.com:9999/');
define('SERVICE_URL', 'http://service-test1.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/');
... ...