Authored by 梁志锋

4.6.0

Showing 31 changed files with 238 additions and 52 deletions
@@ -43,8 +43,10 @@ class OrderData @@ -43,8 +43,10 @@ class OrderData
43 $param['uid'] = $uid; 43 $param['uid'] = $uid;
44 $param['gender'] = $gender; 44 $param['gender'] = $gender;
45 $param['yh_channel'] = $channel; 45 $param['yh_channel'] = $channel;
46 - $param['reasonId'] = $reasonId;  
47 - $param['reasons'] = $reason; 46 + if ($reasonId) {
  47 + $param['reasonId'] = $reasonId;
  48 + $param['reasons'] = $reason;
  49 + }
48 $param['method'] = 'app.SpaceOrders.close'; 50 $param['method'] = 'app.SpaceOrders.close';
49 $param['client_secret'] = Sign::getSign($param); 51 $param['client_secret'] = Sign::getSign($param);
50 //调用接口获得数据 52 //调用接口获得数据
@@ -199,4 +201,20 @@ class OrderData @@ -199,4 +201,20 @@ class OrderData
199 return Yohobuy::get(Yohobuy::API_URL, $param); 201 return Yohobuy::get(Yohobuy::API_URL, $param);
200 } 202 }
201 203
  204 + /** 再次购买
  205 + * @param type $uid
  206 + * @param type $orderCode
  207 + * @return type
  208 + */
  209 + public static function reAddData($uid, $orderCode)
  210 + {
  211 + $param = Yohobuy::param();
  212 + $param['method'] = 'app.Shopping.readd';
  213 + $param['uid'] = $uid;
  214 + $param['order_code'] = $orderCode;
  215 + $param['client_secret'] = Sign::getSign($param);
  216 +
  217 + return Yohobuy::get(Yohobuy::API_URL, $param);
  218 + }
  219 +
202 } 220 }
@@ -36,7 +36,7 @@ class SearchData @@ -36,7 +36,7 @@ class SearchData
36 // return 'http://101.200.31.165/yohosearch/search.json'; 36 // return 'http://101.200.31.165/yohosearch/search.json';
37 return 'http://192.168.10.64:8080/yohosearch/search.json'; 37 return 'http://192.168.10.64:8080/yohosearch/search.json';
38 case 'testing': 38 case 'testing':
39 - return 'http://testing.yohoops.org/yohosearch/search.json'; 39 +// return 'http://testing.yohoops.org/yohosearch/search.json';
40 case 'developer': 40 case 'developer':
41 default: 41 default:
42 return 'http://searchyohoops.yohobuy.com/yohosearch/search.json'; 42 return 'http://searchyohoops.yohobuy.com/yohosearch/search.json';
@@ -215,7 +215,6 @@ class FloorProcess @@ -215,7 +215,6 @@ class FloorProcess
215 foreach ($data['list'] as &$one) { 215 foreach ($data['list'] as &$one) {
216 if (isset($one['url'])) { 216 if (isset($one['url'])) {
217 $one['url'] = Helpers::getFilterUrl($one['url']); 217 $one['url'] = Helpers::getFilterUrl($one['url']);
218 -// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];  
219 } 218 }
220 $one['img'] = Helpers::getImageUrl($one['src'], 158, 174); 219 $one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
221 unset($one['src']); 220 unset($one['src']);
@@ -226,7 +225,7 @@ class FloorProcess @@ -226,7 +225,7 @@ class FloorProcess
226 'src' => 'http://cdn.yoho.cn/myohobuy/assets/img/more-brand.png', 225 'src' => 'http://cdn.yoho.cn/myohobuy/assets/img/more-brand.png',
227 'url' => '/brands?channel=' . $type, 226 'url' => '/brands?channel=' . $type,
228 ); 227 );
229 - if (isset($data['image'])) { 228 + if (!empty($data['image'])) {
230 $data['moreImg'] = array( 229 $data['moreImg'] = array(
231 'alt' => $data['image']['alt'], 230 'alt' => $data['image']['alt'],
232 'src' => Helpers::getImageUrl($data['image']['src'], 320, 172), 231 'src' => Helpers::getImageUrl($data['image']['src'], 320, 172),
@@ -81,6 +81,7 @@ $couponList.on('touchstart', '.employ-main', function() { @@ -81,6 +81,7 @@ $couponList.on('touchstart', '.employ-main', function() {
81 $('body').on('touchend', '.not-use', function() { 81 $('body').on('touchend', '.not-use', function() {
82 orderInfo('couponCode', null); 82 orderInfo('couponCode', null);
83 orderInfo('couponName', null); 83 orderInfo('couponName', null);
  84 + location.href = '/cart/index/orderEnsure';
84 }); 85 });
85 86
86 87
@@ -102,6 +102,19 @@ function searchInput() { @@ -102,6 +102,19 @@ function searchInput() {
102 searchResult(); 102 searchResult();
103 } 103 }
104 104
  105 +function isLocalStorageSupported() {
  106 + var testKey = 'test',
  107 + storage = Window.prototype.localStorage;
  108 +
  109 + try {
  110 + storage.setItem(testKey, 'testValue');
  111 + storage.removeItem(testKey);
  112 + return true;
  113 + } catch (error) {
  114 + return false;
  115 + }
  116 +}
  117 +
105 //绑定提交前的存local操作 118 //绑定提交前的存local操作
106 function bindWirteLocal($brandList, list) { 119 function bindWirteLocal($brandList, list) {
107 $brandList.on('click', 'p , li', function(e) { 120 $brandList.on('click', 'p , li', function(e) {
@@ -137,8 +150,9 @@ function bindWirteLocal($brandList, list) { @@ -137,8 +150,9 @@ function bindWirteLocal($brandList, list) {
137 } 150 }
138 151
139 if (localStorage) { 152 if (localStorage) {
140 -  
141 - historys = localStorage.getItem('historys-brand'); 153 + if (isLocalStorageSupported) {
  154 + historys = localStorage.getItem('historys-brand');
  155 + }
142 156
143 historys = historys ? historys : ''; 157 historys = historys ? historys : '';
144 158
@@ -232,7 +246,6 @@ function searchResult() { @@ -232,7 +246,6 @@ function searchResult() {
232 246
233 loading.showLoadingMask(); 247 loading.showLoadingMask();
234 248
235 -  
236 lazyLoad($('img.lazy')); 249 lazyLoad($('img.lazy'));
237 $('.yoho-header').css({ 250 $('.yoho-header').css({
238 'z-index': 2, 251 'z-index': 2,
@@ -463,7 +476,9 @@ if ($('.brand-search-page').length > 0) { @@ -463,7 +476,9 @@ if ($('.brand-search-page').length > 0) {
463 476
464 477
465 if (localStorage) { 478 if (localStorage) {
466 - historys = localStorage.getItem('historys-brand'); 479 + if (isLocalStorageSupported) {
  480 + historys = localStorage.getItem('historys-brand');
  481 + }
467 482
468 if (historys && historys.length > 0) { 483 if (historys && historys.length > 0) {
469 historys = historys.split(ranToken); 484 historys = historys.split(ranToken);
@@ -70,7 +70,9 @@ function initInfosEvt($container) { @@ -70,7 +70,9 @@ function initInfosEvt($container) {
70 if (typeof $container === 'undefined') { 70 if (typeof $container === 'undefined') {
71 return; 71 return;
72 } 72 }
73 - 73 + if (typeof $container[0] === 'undefined') {
  74 + return;
  75 + }
74 cHammer = new Hammer($container[0]); 76 cHammer = new Hammer($container[0]);
75 77
76 //点赞或者收藏事件 78 //点赞或者收藏事件
@@ -53,9 +53,9 @@ setTimeout(function() { @@ -53,9 +53,9 @@ setTimeout(function() {
53 info.initInfosEvt($infosContainer); 53 info.initInfosEvt($infosContainer);
54 54
55 //文字介绍收起与展开 55 //文字介绍收起与展开
56 -moreHammer = new Hammer(document.getElementById('more-intro')); 56 +moreHammer = new Hammer(document.getElementById('more-intro-click-range'));
57 moreHammer.on('tap', function(e) { 57 moreHammer.on('tap', function(e) {
58 - var $this = $(e.target).closest('#more-intro'); 58 + var $this = $(e.target).closest('#more-intro-click-range');
59 59
60 $this.toggleClass('spread'); 60 $this.toggleClass('spread');
61 61
@@ -60,6 +60,19 @@ $('#search').on('touchend', function() { @@ -60,6 +60,19 @@ $('#search').on('touchend', function() {
60 return false; 60 return false;
61 }); 61 });
62 62
  63 +function isLocalStorageSupported() {
  64 + var testKey = 'test',
  65 + storage = Window.prototype.localStorage;
  66 +
  67 + try {
  68 + storage.setItem(testKey, 'testValue');
  69 + storage.removeItem(testKey);
  70 + return true;
  71 + } catch (error) {
  72 + return false;
  73 + }
  74 +}
  75 +
63 //初始化历史搜索的内容 76 //初始化历史搜索的内容
64 (function() { 77 (function() {
65 var html = '', 78 var html = '',
@@ -89,4 +102,8 @@ $('#search').on('touchend', function() { @@ -89,4 +102,8 @@ $('#search').on('touchend', function() {
89 } 102 }
90 }()); 103 }());
91 104
92 -writeSearch.bindWirteLocal($form); 105 +if (isLocalStorageSupported) {
  106 + writeSearch.bindWirteLocal($form);
  107 +}
  108 +
  109 +
@@ -110,6 +110,21 @@ optHammer.on('tap', function(e) { @@ -110,6 +110,21 @@ optHammer.on('tap', function(e) {
110 }); 110 });
111 } else if ($cur.hasClass('btn-cancel')) { 111 } else if ($cur.hasClass('btn-cancel')) {
112 $reaMask.css('visibility', 'visible'); 112 $reaMask.css('visibility', 'visible');
  113 + } else if ($cur.hasClass('btn-rebuy')) {
  114 + $.ajax({
  115 + type: 'GET',
  116 + url: '/home/readd',
  117 + data: {
  118 + orderCode: orderId
  119 + },
  120 + success: function(res) {
  121 + tip.show(res.message);
  122 + location.href = '/cart/index/index';
  123 + },
  124 + error: function(res) {
  125 + tip.show(res.message);
  126 + }
  127 + });
113 } 128 }
114 }); 129 });
115 130
@@ -223,6 +223,21 @@ orderHammer.on('tap', function(e) { @@ -223,6 +223,21 @@ orderHammer.on('tap', function(e) {
223 //Location to order detail 223 //Location to order detail
224 url = $order.data('href'); 224 url = $order.data('href');
225 location.href = url; 225 location.href = url;
  226 + } else if ($cur.closest('.rebuy').length > 0) {
  227 + $.ajax({
  228 + type: 'GET',
  229 + url: '/home/readd',
  230 + data: {
  231 + orderCode: id
  232 + },
  233 + success: function(res) {
  234 + tip.show(res.message);
  235 + location.href = '/cart/index/index';
  236 + },
  237 + error: function(res) {
  238 + tip.show(res.message);
  239 + }
  240 + });
226 } 241 }
227 }); 242 });
228 243
@@ -41,6 +41,7 @@ var navtabEle = document.getElementById('nav-tab'), @@ -41,6 +41,7 @@ var navtabEle = document.getElementById('nav-tab'),
41 $('#feedback-content .consult-content').removeClass('hide'); 41 $('#feedback-content .consult-content').removeClass('hide');
42 } 42 }
43 43
  44 + $('.goods-consults .consult-item:lt(2)').removeClass('hide');
44 })(); 45 })();
45 46
46 if (navtabHammer) { 47 if (navtabHammer) {
@@ -91,7 +92,7 @@ if ($('.goods-consults-page').length > 0) { @@ -91,7 +92,7 @@ if ($('.goods-consults-page').length > 0) {
91 if (readmoreHammer) { 92 if (readmoreHammer) {
92 readmoreHammer.on('tap', function() { 93 readmoreHammer.on('tap', function() {
93 $('.readmore').hide(); 94 $('.readmore').hide();
94 - 95 + $('.goods-consults').find('.consult-item').removeClass('hide');
95 return false; 96 return false;
96 }); 97 });
97 } 98 }
@@ -32,7 +32,7 @@ var $input = $('#search-input input'), @@ -32,7 +32,7 @@ var $input = $('#search-input input'),
32 $icon = $('.search-icon'), 32 $icon = $('.search-icon'),
33 $clear = $('#search-input .clear-input'); 33 $clear = $('#search-input .clear-input');
34 34
35 -var shopId,sort,brand; 35 +var shopId,sort,brand,outlets;
36 36
37 //默认筛选条件 37 //默认筛选条件
38 var defaultOpt = require('./query-param'); 38 var defaultOpt = require('./query-param');
@@ -105,6 +105,7 @@ function getQueryString(name) { @@ -105,6 +105,7 @@ function getQueryString(name) {
105 105
106 shopId = getQueryString('shop_id'); 106 shopId = getQueryString('shop_id');
107 sort = getQueryString('sort'); 107 sort = getQueryString('sort');
  108 +outlets = getQueryString('outlets');
108 109
109 /** 110 /**
110 * 筛选注册的回调,筛选子项点击后逻辑 111 * 筛选注册的回调,筛选子项点击后逻辑
@@ -178,6 +179,11 @@ function search(opt) { @@ -178,6 +179,11 @@ function search(opt) {
178 discount: opt.id 179 discount: opt.id
179 }; 180 };
180 break; 181 break;
  182 + case 'outlets':
  183 + ext = {
  184 + outlets: opt.id
  185 + };
  186 + break;
181 } 187 }
182 188
183 $.extend(defaultOpt, ext); //扩展筛选项 189 $.extend(defaultOpt, ext); //扩展筛选项
@@ -221,6 +227,10 @@ function search(opt) { @@ -221,6 +227,10 @@ function search(opt) {
221 params.brand = brand; 227 params.brand = brand;
222 } 228 }
223 229
  230 + if (outlets) {
  231 + params.outlets = outlets;
  232 + }
  233 +
224 $.extend(setting, defaultOpt, params); 234 $.extend(setting, defaultOpt, params);
225 235
226 searching = true; 236 searching = true;
@@ -189,6 +189,11 @@ @@ -189,6 +189,11 @@
189 border-top: none; 189 border-top: none;
190 line-height: 40px; 190 line-height: 40px;
191 height: auto; 191 height: auto;
  192 +
  193 + a {
  194 + width: 100%;
  195 + text-align: right;
  196 + }
192 } 197 }
193 198
194 .mg-text { 199 .mg-text {
@@ -263,4 +263,8 @@ @@ -263,4 +263,8 @@
263 } 263 }
264 } 264 }
265 } 265 }
  266 +
  267 + .btn-rebuy {
  268 + margin-left: 10px;
  269 + }
266 } 270 }
@@ -159,6 +159,9 @@ @@ -159,6 +159,9 @@
159 font-size: 24px; 159 font-size: 24px;
160 line-height: 24px; 160 line-height: 24px;
161 } 161 }
  162 + }
  163 + .rebuy {
  164 + margin-left: 20px;
162 } 165 }
163 } 166 }
164 } 167 }
@@ -96,20 +96,22 @@ @@ -96,20 +96,22 @@
96 <a href="{{#if isLimit}}javascript:void(0);{{else}}/cart/index/selectCoupon{{/if}}"> 96 <a href="{{#if isLimit}}javascript:void(0);{{else}}/cart/index/selectCoupon{{/if}}">
97 <span class="title">优惠券</span> 97 <span class="title">优惠券</span>
98 {{# coupon}} 98 {{# coupon}}
99 - <span class="coupon-count">  
100 - {{count}}张可用  
101 - </span>  
102 - {{#if couponName}}  
103 - <span class="used coupon-use" data-name="{{couponName}}">  
104 - {{couponName}}  
105 - <i class="iconfont">&#xe614;</i>  
106 - </span>  
107 - {{^}}  
108 - <span class="not-used coupon-use">  
109 - {{#if isLimit}}该商品不可使用优惠券{{else}}未使用{{/if}}  
110 - <i class="iconfont">&#xe614;</i>  
111 - </span>  
112 - {{/if}} 99 + {{#if isCoupon}}
  100 + <span class="coupon-count">
  101 + {{count}}张可用
  102 + </span>
  103 + {{/if}}
  104 + {{#if couponName}}
  105 + <span class="used coupon-use" data-name="{{couponName}}">
  106 + {{couponName}}
  107 + <i class="iconfont">&#xe614;</i>
  108 + </span>
  109 + {{^}}
  110 + <span class="not-used coupon-use">
  111 + {{#if isLimit}}该商品不可使用优惠券{{else}}未使用{{/if}}
  112 + <i class="iconfont">&#xe614;</i>
  113 + </span>
  114 + {{/if}}
113 {{/coupon}} 115 {{/coupon}}
114 </a> 116 </a>
115 </li> 117 </li>
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 </a> 20 </a>
21 \{{/ notAvailable}} 21 \{{/ notAvailable}}
22 \{{/coupons}} 22 \{{/coupons}}
23 -<a class="not-use" href="/cart/index/orderEnsure">不使用任何优惠券</a> 23 +<a class="not-use" href="javascript:void(0);">不使用任何优惠券</a>
24 </script> 24 </script>
25 <script id="tmpl-coupon-not-avaliable" type="text/tmpl"> 25 <script id="tmpl-coupon-not-avaliable" type="text/tmpl">
26 \{{# notAvailableCoupons}} 26 \{{# notAvailableCoupons}}
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="brand-page brand-search-page yoho-page"> 2 <div class="brand-page brand-search-page yoho-page">
3 <div class="newbrand-search"> 3 <div class="newbrand-search">
4 <form class="search-box clearfix"> 4 <form class="search-box clearfix">
5 - <input type="text" class="search-input" id="keyword" placeholder="查找品牌" autofocus> 5 + <input type="text" class="search-input" id="keyword" placeholder="查找品牌">
6 <i class="search-icon iconfont">&#xe60f;</i> 6 <i class="search-icon iconfont">&#xe60f;</i>
7 <div class="search-action"> 7 <div class="search-action">
8 <span class="iconfont clear-text">&#xe623;</span> 8 <span class="iconfont clear-text">&#xe623;</span>
@@ -11,15 +11,17 @@ @@ -11,15 +11,17 @@
11 &#xe605; 11 &#xe605;
12 </a> 12 </a>
13 </p> 13 </p>
14 - <p id="intro" class="intro">  
15 - {{intro}}  
16 - </p>  
17 - {{#if intro}}  
18 - <span id="more-intro" class="more-intro">  
19 - <span id="intro-more-txt">more</span>  
20 - <i class="icon iconfont">&#xe609;</i>  
21 - </span>  
22 - {{/if}} 14 + <div id="more-intro-click-range" class="clearfix">
  15 + <p id="intro" class="intro">
  16 + {{intro}}
  17 + </p>
  18 + {{#if intro}}
  19 + <span id="more-intro" class="more-intro">
  20 + <span id="intro-more-txt">more</span>
  21 + <i class="icon iconfont">&#xe609;</i>
  22 + </span>
  23 + {{/if}}
  24 + </div>
23 </div> 25 </div>
24 </div> 26 </div>
25 {{# newArrival}} 27 {{# newArrival}}
@@ -75,6 +75,7 @@ @@ -75,6 +75,7 @@
75 {{#unless unreceived}} 75 {{#unless unreceived}}
76 {{#unless unpaid}} 76 {{#unless unpaid}}
77 <span class="btn btn-del">删除订单</span> 77 <span class="btn btn-del">删除订单</span>
  78 + <span class="btn btn-rebuy">再次购买</span>
78 {{/unless}} 79 {{/unless}}
79 {{/unless}} 80 {{/unless}}
80 81
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 {{# consults}} 8 {{# consults}}
9 <div class="goods-consults customer-consults" id="goods-consults"> 9 <div class="goods-consults customer-consults" id="goods-consults">
10 {{#list}} 10 {{#list}}
11 - <div class="consult-item" data-id="{{id}}"> 11 + <div class="consult-item hide" data-id="{{id}}">
12 <div class="question"> 12 <div class="question">
13 <span class="iconfont">&#xe644;</span> 13 <span class="iconfont">&#xe644;</span>
14 <p> 14 <p>
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 {{#unless unreceived}} 20 {{#unless unreceived}}
21 <div class="order-opt"> 21 <div class="order-opt">
22 <span class="btn del">删除订单</span> 22 <span class="btn del">删除订单</span>
  23 + <span class="btn rebuy">再次购买</span>
23 </div> 24 </div>
24 {{/unless}} 25 {{/unless}}
25 {{/unless}} 26 {{/unless}}
1 <ul id="nav-tab" class="nav-tab clearfix"> 1 <ul id="nav-tab" class="nav-tab clearfix">
2 <li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li> 2 <li class="comment-nav tap-hightlight">商品评价(<span class="comments-num">{{commentsNum}}</span>)</li>
  3 + {{#if commonConsults}}
  4 + <li class="consult-nav tap-hightlight">常见问题</li>
  5 + {{^}}
3 <li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li> 6 <li class="consult-nav tap-hightlight">购买咨询(<span class="consults-num">{{consultsNum}}</span>)</li>
  7 + {{/if}}
4 </ul> 8 </ul>
5 <div id="feedback-content" > 9 <div id="feedback-content" >
6 <div class="comment-content content "> 10 <div class="comment-content content ">
@@ -68,4 +68,8 @@ @@ -68,4 +68,8 @@
68 68
69 {{#if limit}} 69 {{#if limit}}
70 <input class="query-param" type="hidden" data-attr="limit" value="{{limit}}"> 70 <input class="query-param" type="hidden" data-attr="limit" value="{{limit}}">
  71 +{{/if}}
  72 +
  73 +{{#if outlets}}
  74 + <input class="query-param" type="hidden" data-attr="outlets" value="{{outlets}}">
71 {{/if}} 75 {{/if}}
@@ -829,6 +829,40 @@ class HomeController extends AbstractAction @@ -829,6 +829,40 @@ class HomeController extends AbstractAction
829 //渲染模板 829 //渲染模板
830 $this->_view->display('order-content', $order); 830 $this->_view->display('order-content', $order);
831 } 831 }
  832 +
  833 + /**
  834 + * 我的订单——再次购买
  835 + */
  836 + public function reAddAction()
  837 + {
  838 + $result = array('code' => 401, 'message' => '商品加入购物车失败', 'data' => '');
  839 +
  840 + do {
  841 + /* 判断是不是AJAX请求 */
  842 + if (!$this->isAjax()) {
  843 + break;
  844 + }
  845 + //获取相关参数
  846 + $uid = $this->getUid(true);
  847 + $orderCode = $this->get('orderCode', '');
  848 + if (!$uid || !$orderCode) {
  849 + $result = array('code' => 400, 'message' => '缺失参数', 'data' => '');
  850 + break;
  851 + }
  852 + $reAddData = OrderData::reAddData($uid, $orderCode);
  853 + if(!isset($reAddData['code']) || $reAddData['code'] != 200){
  854 + break;
  855 + }
  856 + $result = array('code' => 200, 'message' => '商品已重新加入购物车', 'data' => $reAddData['data']);
  857 +
  858 + if (!isset($result['code'])) {
  859 + break;
  860 + }
  861 + }
  862 + while (false);
  863 +
  864 + $this->echoJson($result);
  865 + }
832 866
833 /* 867 /*
834 * 我的订单-取消订单 868 * 我的订单-取消订单
@@ -1063,6 +1097,8 @@ class HomeController extends AbstractAction @@ -1063,6 +1097,8 @@ class HomeController extends AbstractAction
1063 1097
1064 /* 判断订单信息是否存在 */ 1098 /* 判断订单信息是否存在 */
1065 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession); 1099 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession);
  1100 +// $readd = OrderData::reAddData($this->_uid, 1611143210);
  1101 +// print_r($readd);
1066 if (empty($orderDetail)) { 1102 if (empty($orderDetail)) {
1067 $this->error(); 1103 $this->error();
1068 } 1104 }
@@ -30,7 +30,6 @@ class SearchController extends AbstractAction @@ -30,7 +30,6 @@ class SearchController extends AbstractAction
30 /** 30 /**
31 * 搜索列表页 31 * 搜索列表页
32 * 32 *
33 - * tar mark  
34 */ 33 */
35 public function listAction() 34 public function listAction()
36 { 35 {
@@ -51,6 +50,7 @@ class SearchController extends AbstractAction @@ -51,6 +50,7 @@ class SearchController extends AbstractAction
51 'price' => FILTER_DEFAULT, 50 'price' => FILTER_DEFAULT,
52 'discount' => FILTER_DEFAULT, 51 'discount' => FILTER_DEFAULT,
53 'gender' => FILTER_DEFAULT, 52 'gender' => FILTER_DEFAULT,
  53 + 'outlets' => FILTER_DEFAULT,
54 'p_d' => FILTER_DEFAULT,), false); 54 'p_d' => FILTER_DEFAULT,), false);
55 if (isset($condition['shop_id'])) { 55 if (isset($condition['shop_id'])) {
56 $condition['shopId'] = $condition['shop_id']; 56 $condition['shopId'] = $condition['shop_id'];
@@ -197,7 +197,7 @@ class SearchController extends AbstractAction @@ -197,7 +197,7 @@ class SearchController extends AbstractAction
197 $listData = array(); 197 $listData = array();
198 } 198 }
199 199
200 - if(isset($condition['title'])){ 200 + if (isset($condition['title'])) {
201 $this->setTitle($condition['title']); 201 $this->setTitle($condition['title']);
202 $this->setNavHeader($condition['title'], true, SITE_MAIN); 202 $this->setNavHeader($condition['title'], true, SITE_MAIN);
203 } 203 }
@@ -235,9 +235,10 @@ class SearchController extends AbstractAction @@ -235,9 +235,10 @@ class SearchController extends AbstractAction
235 'discount' => FILTER_DEFAULT, 235 'discount' => FILTER_DEFAULT,
236 'gender' => FILTER_DEFAULT, 236 'gender' => FILTER_DEFAULT,
237 'p_d' => FILTER_DEFAULT, 237 'p_d' => FILTER_DEFAULT,
  238 + 'outlets' => FILTER_DEFAULT,
238 'page' => FILTER_VALIDATE_INT,), false); 239 'page' => FILTER_VALIDATE_INT,), false);
239 240
240 - if(!empty($condition['shop_id'])){ 241 + if (!empty($condition['shop_id'])) {
241 $condition['shop'] = $condition['shop_id']; 242 $condition['shop'] = $condition['shop_id'];
242 } 243 }
243 // 转义分类 244 // 转义分类
@@ -287,6 +288,11 @@ class SearchController extends AbstractAction @@ -287,6 +288,11 @@ class SearchController extends AbstractAction
287 $condition['query'] = rawurldecode($condition['query']); 288 $condition['query'] = rawurldecode($condition['query']);
288 } 289 }
289 290
  291 + // 转义奥莱
  292 + if (isset($condition['outlets'])) {
  293 + $condition['outlets'] = rawurldecode($condition['outlets']);
  294 + }
  295 +
290 // 转换排序方式 296 // 转换排序方式
291 $type = $this->get('type', ''); 297 $type = $this->get('type', '');
292 $order = $this->get('order', 0); 298 $order = $this->get('order', 0);
@@ -322,6 +328,13 @@ class SearchController extends AbstractAction @@ -322,6 +328,13 @@ class SearchController extends AbstractAction
322 $data = Product\SearchModel::getSearchData($condition, $showTag, $tagNew, $tagSale); 328 $data = Product\SearchModel::getSearchData($condition, $showTag, $tagNew, $tagSale);
323 } while (false); 329 } while (false);
324 330
  331 + //奥莱商品过滤新品标签
  332 + if (isset($condition['outlets']) && $condition['outlets'] === '1') {
  333 + foreach ($data['new'] as $outletskey => $outletsval) {
  334 + unset($data['new'][$outletskey]['tags']);
  335 + }
  336 + }
  337 +
325 if (empty($data['new'])) { 338 if (empty($data['new'])) {
326 echo ' '; 339 echo ' ';
327 } else { 340 } else {
@@ -594,11 +594,17 @@ class CartModel @@ -594,11 +594,17 @@ class CartModel
594 // 优惠券数据 594 // 优惠券数据
595 $coupons = array( 595 $coupons = array(
596 'couponName' => '', 596 'couponName' => '',
  597 + 'isCoupon' => false,
597 'count' => self::getValidCouponCount($uid) 598 'count' => self::getValidCouponCount($uid)
598 ); 599 );
599 if (isset($orderCompute['coupon_amount']) && (!empty($orderCompute['coupon_amount']) || ($orderCompute['coupon_amount'] === 0 && $orderCompute['shipping_cost'] === 0))) { 600 if (isset($orderCompute['coupon_amount']) && (!empty($orderCompute['coupon_amount']) || ($orderCompute['coupon_amount'] === 0 && $orderCompute['shipping_cost'] === 0))) {
600 $coupons['couponName'] = $orderInfo['couponName']; 601 $coupons['couponName'] = $orderInfo['couponName'];
601 } 602 }
  603 + //选中已使用的优惠劵,则剩余多少张优惠劵,不提示
  604 + if (empty($coupons['couponName']) || $coupons['count'] === 0) {
  605 + $coupons['isCoupon'] = true;
  606 + }
  607 +
602 $result['coupon'] = $coupons; 608 $result['coupon'] = $coupons;
603 } 609 }
604 while (false); 610 while (false);
@@ -126,7 +126,7 @@ class DetailModel @@ -126,7 +126,7 @@ class DetailModel
126 126
127 // 商品咨询 127 // 商品咨询
128 $result['feedbacks']['consultsNum'] = 0; 128 $result['feedbacks']['consultsNum'] = 0;
129 - if (!empty($baseInfo['consultBoWrapper'])) { 129 + if (!empty($baseInfo['consultBoWrapper']) && $baseInfo['consultBoWrapper']['consultTotal'] !== 0) {
130 $result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal']; 130 $result['feedbacks']['consultsNum'] = $baseInfo['consultBoWrapper']['consultTotal'];
131 $result['feedbacks']['consults'] = array(); 131 $result['feedbacks']['consults'] = array();
132 $build = array(); 132 $build = array();
@@ -139,7 +139,12 @@ class DetailModel @@ -139,7 +139,12 @@ class DetailModel
139 $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum'])); 139 $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
140 } // 暂无咨询 140 } // 暂无咨询
141 else { 141 else {
142 - $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId)); 142 + // tar modified 201606141155 常見問題恢復
  143 + $result['feedbacks']['consults'] = array_slice(self::getCommonConsults()['commonConsults'], 0, 2);
  144 + $result['feedbacks']['consultsNum'] = 2; // 数字无意义,兼容原来的前端模板代码使用,不能为 0
  145 + $result['feedbacks']['commonConsults'] = true; // 用来标记是否是常见问题的
  146 + $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
  147 +// $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
143 } 148 }
144 149
145 // 商品评价 150 // 商品评价
@@ -306,7 +311,7 @@ class DetailModel @@ -306,7 +311,7 @@ class DetailModel
306 'numInCart' => 0, 311 'numInCart' => 0,
307 'goodsInstore' => $baseInfo['storage'], // 库存量 312 'goodsInstore' => $baseInfo['storage'], // 库存量
308 ); 313 );
309 - $soldOut = ($baseInfo['storage'] == 0) || ($baseInfo['status'] == 0 || $totalStorageNum === 0); 314 + $soldOut = ($baseInfo['status'] == 0 || $totalStorageNum === 0);
310 $notForSale = $baseInfo['attribute'] == 2; 315 $notForSale = $baseInfo['attribute'] == 2;
311 316
312 // 显示加入购物车链接 317 // 显示加入购物车链接
@@ -189,8 +189,15 @@ class IndexController extends AbstractAction @@ -189,8 +189,15 @@ class IndexController extends AbstractAction
189 // 构建资讯文章内容 189 // 构建资讯文章内容
190 if (!empty($article['data']['list']['artList'])) { 190 if (!empty($article['data']['list']['artList'])) {
191 $build = array(); 191 $build = array();
192 - foreach ($article['data']['list']['artList'] as $article) {  
193 - $build[] = Helpers::formatArticle($article, true, $isApp, false, $uid); 192 +// foreach ($article['data']['list']['artList'] as $article) {
  193 +// $build[] = Helpers::formatArticle($article, true, $isApp, $showAuthor, $uid);
  194 +// }
  195 + //逛作者列表页跳转链接修改
  196 + foreach ($article['data']['list']['artList'] as $articlekey =>$article) {
  197 + $build[$articlekey ] = Helpers::formatArticle($article, true, $isApp, false, $uid);
  198 + if($this->isApp()){
  199 + $build[$articlekey]['url'] = Helpers::url('/author/index', array('id' => $id, 'app_version' => $this->get('app_version', '')), 'guang');
  200 + }
194 } 201 }
195 $data['guang']['infos'] = $build; 202 $data['guang']['infos'] = $build;
196 } 203 }
@@ -180,13 +180,13 @@ class RecomController extends AbstractAction @@ -180,13 +180,13 @@ class RecomController extends AbstractAction
180 $templateId = $this->get('template_id', 0); 180 $templateId = $this->get('template_id', 0);
181 181
182 /* 创意生活只有一页数据 */ 182 /* 创意生活只有一页数据 */
183 - $page = $this->get('page', 1);  
184 - if (intval($page) > 1 || empty($templateId)) { 183 + $page = intval($this->get('page', 1));
  184 + if (empty($page) || empty($templateId)) {
185 break; 185 break;
186 } 186 }
187 187
188 /* 取可能喜欢的数据 */ 188 /* 取可能喜欢的数据 */
189 - $recom = RecomData::newPreference($templateId); 189 + $recom = RecomData::newPreference($templateId, '', $page);
190 190
191 /* 构建人气单品数据 */ 191 /* 构建人气单品数据 */
192 if (empty($recom) || empty($recom['data']['product_list'])) { 192 if (empty($recom) || empty($recom['data']['product_list'])) {