Authored by 周少峰

Merge branch 'release/4.8' of http://git.yoho.cn/fe/yohobuypc into release/4.8

@@ -22,21 +22,21 @@ class Yohobuy @@ -22,21 +22,21 @@ class Yohobuy
22 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 22 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
23 23
24 //java API 24 //java API
25 - // const API_URL = 'http://api.yoho.yohoops.org/';//  
26 - // const API_URL2 = 'http://api.yoho.yohoops.org/';//  
27 - // const SERVICE_URL = 'http://service.yoho.yohoops.org/';  
28 - // const YOHOBUY_URL = 'http://www.yohobuy.com/';  
29 - // const API_OLD = 'http://api2.open.yohobuy.com/';  
30 - // 支付回调地址  
31 - // const SERVICE_NOTIFY = 'http://service.yoho.cn/';  
32 - 25 + // const API_URL = 'http://api.yoho.yohoops.org/';//
  26 + // const API_URL2 = 'http://api.yoho.yohoops.org/';//
  27 + // const SERVICE_URL = 'http://service.yoho.yohoops.org/';
  28 + // const YOHOBUY_URL = 'http://www.yohobuy.com/';
  29 + // const API_OLD = 'http://api2.open.yohobuy.com/';
  30 + // 支付回调地址
  31 + // const SERVICE_NOTIFY = 'http://service.yoho.cn/';
  32 +
33 // 测试环境 */ 33 // 测试环境 */
34 - const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'  
35 - const SERVICE_URL = 'http://testservice.yoho.cn:28077/';  
36 - const YOHOBUY_URL = 'http://www.yohobuy.com/';  
37 - const API_OLD = 'http://test2.open.yohobuy.com/';  
38 -// 支付回调地址  
39 - const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/'; 34 + const API_URL = 'http://testapi.yoho.cn:28078/'; // http://testapi.yoho.cn:28078/ http://devapi.yoho.cn:58078/
  35 + const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; // http://testservice.yoho.cn:28077/ http://devservice.yoho.cn:58077/
  36 + const YOHOBUY_URL = 'http://www.yohobuy.com/';
  37 + const API_OLD = 'http://test2.open.yohobuy.com/';
  38 +// 支付回调地址
  39 + const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/';
40 40
41 /* 预览环境 */ 41 /* 预览环境 */
42 // const API_URL = 'http://preapi.yoho.cn/'; 42 // const API_URL = 'http://preapi.yoho.cn/';
@@ -44,13 +44,13 @@ class Yohobuy @@ -44,13 +44,13 @@ class Yohobuy
44 // const SERVICE_URL = 'http://preservice.yoho.cn/'; 44 // const SERVICE_URL = 'http://preservice.yoho.cn/';
45 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 45 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
46 // const API_OLD = 'http://api2.open.yohobuy.com/'; 46 // const API_OLD = 'http://api2.open.yohobuy.com/';
47 - 47 +
48 /** 48 /**
49 * 登录老接口Api配置 49 * 登录老接口Api配置
50 */ 50 */
51 const API_LOGIN_URL = 'http://api.open.yohobuy.com'; 51 const API_LOGIN_URL = 'http://api.open.yohobuy.com';
52 const API_LOGIN_URL_TEST = 'http://test.open.yohobuy.com'; 52 const API_LOGIN_URL_TEST = 'http://test.open.yohobuy.com';
53 - 53 +
54 /** 54 /**
55 * 私钥列表 55 * 私钥列表
56 * 56 *
@@ -63,7 +63,7 @@ class Yohobuy @@ -63,7 +63,7 @@ class Yohobuy
63 'web' => '0ed29744ed318fd28d2c07985d3ba633', 63 'web' => '0ed29744ed318fd28d2c07985d3ba633',
64 'h5' => 'fd4ad5fcfa0de589ef238c0e7331b585', 64 'h5' => 'fd4ad5fcfa0de589ef238c0e7331b585',
65 ); 65 );
66 - 66 +
67 67
68 68
69 /** 69 /**
@@ -77,7 +77,7 @@ class Yohobuy @@ -77,7 +77,7 @@ class Yohobuy
77 else { 77 else {
78 return 'web'; 78 return 'web';
79 } 79 }
80 - 80 +
81 // // 苹果设备 81 // // 苹果设备
82 // if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) { 82 // if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
83 // return 'iphone'; 83 // return 'iphone';
@@ -187,7 +187,7 @@ class Yohobuy @@ -187,7 +187,7 @@ class Yohobuy
187 curl_setopt($ch, CURLOPT_HEADER, 0); 187 curl_setopt($ch, CURLOPT_HEADER, 0);
188 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 188 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
189 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 189 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
190 - if ($useGzip) { 190 + if ($useGzip) {
191 curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); 191 curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
192 } 192 }
193 if (!empty($userAgent)) { 193 if (!empty($userAgent)) {
@@ -230,7 +230,7 @@ class Yohobuy @@ -230,7 +230,7 @@ class Yohobuy
230 public static function post($url, $data = array(), $returnJson = false, $timeout = 10, $header = array(), $cookie = array()) 230 public static function post($url, $data = array(), $returnJson = false, $timeout = 10, $header = array(), $cookie = array())
231 { 231 {
232 $ch = curl_init($url); 232 $ch = curl_init($url);
233 - 233 +
234 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 234 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
235 if (!empty($header)) { 235 if (!empty($header)) {
236 curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 236 curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
@@ -352,7 +352,7 @@ class Yohobuy @@ -352,7 +352,7 @@ class Yohobuy
352 continue; 352 continue;
353 } 353 }
354 $result[$name] = $response['data']; 354 $result[$name] = $response['data'];
355 - } 355 + }
356 else { 356 else {
357 $result[$name] = $response; 357 $result[$name] = $response;
358 } 358 }
@@ -496,7 +496,7 @@ class Yohobuy @@ -496,7 +496,7 @@ class Yohobuy
496 496
497 return $result; 497 return $result;
498 } 498 }
499 - 499 +
500 /** 500 /**
501 * 获取用户User-Agent 501 * 获取用户User-Agent
502 * @return bool 502 * @return bool
@@ -508,7 +508,7 @@ class Yohobuy @@ -508,7 +508,7 @@ class Yohobuy
508 } 508 }
509 return $_SERVER['HTTP_USER_AGENT']; 509 return $_SERVER['HTTP_USER_AGENT'];
510 } 510 }
511 - 511 +
512 /** 512 /**
513 * 判断是否手机 513 * 判断是否手机
514 * @return bool 514 * @return bool
@@ -214,4 +214,20 @@ class OrderData @@ -214,4 +214,20 @@ class OrderData
214 214
215 return Yohobuy::get(Yohobuy::API_URL, $param); 215 return Yohobuy::get(Yohobuy::API_URL, $param);
216 } 216 }
  217 +
  218 + /** 再次购买
  219 + * @param type $uid
  220 + * @param type $orderCode
  221 + * @return type
  222 + */
  223 + public static function reAddData($uid, $orderCode)
  224 + {
  225 + $param = Yohobuy::param();
  226 + $param['method'] = 'app.Shopping.readd';
  227 + $param['uid'] = $uid;
  228 + $param['order_code'] = $orderCode;
  229 + $param['client_secret'] = Sign::getSign($param);
  230 +
  231 + return Yohobuy::get(Yohobuy::API_URL, $param);
  232 + }
217 } 233 }
@@ -28,7 +28,7 @@ class UserData @@ -28,7 +28,7 @@ class UserData
28 28
29 /** 29 /**
30 * 根据email获取用户信息 30 * 根据email获取用户信息
31 - * 31 + *
32 * @param string $email 32 * @param string $email
33 * @return array 33 * @return array
34 */ 34 */
@@ -149,7 +149,7 @@ class UserData @@ -149,7 +149,7 @@ class UserData
149 * 修改用户习惯信息 149 * 修改用户习惯信息
150 * @param array $params 需要修改的参数集合 150 * @param array $params 需要修改的参数集合
151 * uid:用户ID 151 * uid:用户ID
152 - * shopping:购物习惯 字符串 1 152 + * shopping:购物习惯 字符串 1
153 * dress:着装习惯 字符串 1,2 153 * dress:着装习惯 字符串 1,2
154 */ 154 */
155 public static function editUserHabitsInfo($params) 155 public static function editUserHabitsInfo($params)
@@ -217,13 +217,23 @@ class UserData @@ -217,13 +217,23 @@ class UserData
217 * 个人中心页面优选新品数据 217 * 个人中心页面优选新品数据
218 * 218 *
219 * @param int $channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活 219 * @param int $channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
  220 + * @param $uid 用户ID
  221 + * @param $udid 设备ID
  222 + * @param $rec_pos 位置码
  223 + * @param $limit 数量限制
220 * @return array 接口返回的数据 224 * @return array 接口返回的数据
221 */ 225 */
222 - public static function preference($channel) 226 + public static function newPreference($channel, $uid, $udid, $rec_pos, $limit)
223 { 227 {
224 $param = Yohobuy::param(); 228 $param = Yohobuy::param();
225 - $param['method'] = 'app.home.preference'; 229 + $param['method'] = 'app.home.newPreference';
226 $param['yh_channel'] = $channel; 230 $param['yh_channel'] = $channel;
  231 + if ($uid != 0 && $uid != null) {
  232 + $param['uid'] = $uid;
  233 + }
  234 + $param['udid'] = $udid;
  235 + $param['rec_pos'] = $rec_pos;
  236 + $param['limit'] = $limit;
227 $param['client_secret'] = Sign::getSign($param); 237 $param['client_secret'] = Sign::getSign($param);
228 238
229 return Yohobuy::get(Yohobuy::API_URL, $param); 239 return Yohobuy::get(Yohobuy::API_URL, $param);
@@ -453,7 +463,7 @@ class UserData @@ -453,7 +463,7 @@ class UserData
453 463
454 /** 464 /**
455 * 获取省市区县的列表数据 465 * 获取省市区县的列表数据
456 - * 466 + *
457 * @param int $id ID 467 * @param int $id ID
458 * @return array 468 * @return array
459 */ 469 */
@@ -492,8 +502,7 @@ class UserData @@ -492,8 +502,7 @@ class UserData
492 if (!empty($id)) { // 修改 502 if (!empty($id)) { // 修改
493 $param['id'] = $id; 503 $param['id'] = $id;
494 $param['method'] = 'app.address.update'; 504 $param['method'] = 'app.address.update';
495 - }  
496 - else { // 添加 505 + } else { // 添加
497 $param['method'] = 'app.address.add'; 506 $param['method'] = 'app.address.add';
498 } 507 }
499 508
@@ -40,12 +40,3 @@ location ^~ /passport/autosign/wechat/ { @@ -40,12 +40,3 @@ location ^~ /passport/autosign/wechat/ {
40 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 40 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
41 proxy_set_header Accept-Encoding "gzip"; 41 proxy_set_header Accept-Encoding "gzip";
42 } 42 }
43 -  
44 - location ^~ /product/sale/ {  
45 - proxy_redirect off;  
46 - proxy_pass http://yohobuy-node;  
47 - proxy_set_header Host $host;  
48 - proxy_set_header X-Real-IP $remote_addr;  
49 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
50 - proxy_set_header Accept-Encoding "gzip";  
51 - }  
  1 +location ^~ /passport/autosign/wechat/ {
  2 + proxy_redirect off;
  3 + proxy_pass http://yohobuy-node;
  4 + proxy_set_header Host $host;
  5 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  6 + proxy_set_header Accept-Encoding "gzip";
  7 + }
  8 +
  9 + location ^~ /passport/login/wechat/ {
  10 + proxy_redirect off;
  11 + proxy_pass http://yohobuy-node;
  12 + proxy_set_header Host $host;
  13 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  14 + proxy_set_header Accept-Encoding "gzip";
  15 + }
  16 +
  17 + location = /product/index/getNodeContent {
  18 + proxy_redirect off;
  19 + proxy_pass http://yohobuy-node;
  20 + proxy_set_header Host $host;
  21 + proxy_set_header X-Real-IP $remote_addr;
  22 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  23 + proxy_set_header Accept-Encoding "gzip";
  24 + }
  25 +
  26 + location ^~ /product/sale/ {
  27 + proxy_redirect off;
  28 + proxy_pass http://yohobuy-node;
  29 + proxy_set_header Host $host;
  30 + proxy_set_header X-Real-IP $remote_addr;
  31 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32 + proxy_set_header Accept-Encoding "gzip";
  33 + }
  34 +
  35 + location ^~ /product/outlets/ {
  36 + proxy_redirect off;
  37 + proxy_pass http://yohobuy-node;
  38 + proxy_set_header Host $host;
  39 + proxy_set_header X-Real-IP $remote_addr;
  40 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  41 + proxy_set_header Accept-Encoding "gzip";
  42 + }
  43 +
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="default-me-page me-page yoho-page clearfix"> 2 <div class="default-me-page me-page yoho-page clearfix">
3 {{# me}} 3 {{# me}}
4 - {{> home/path}} 4 + {{> home/path}}
5 5
6 - {{> home/navigation}} 6 + {{> home/navigation}}
7 7
8 - <div class="me-main">  
9 - {{# content}}  
10 - {{#if messages}}  
11 - <p class="message-tip">  
12 - 消息提示:  
13 - {{# messages}}  
14 - <a href="{{href}}">{{name}}</a>  
15 - <b>({{count}})</b>  
16 - {{/ messages}} 8 + <div class="me-main">
  9 + {{# content}}
  10 + {{#if messages}}
  11 + <p class="message-tip">
  12 + 消息提示:
  13 + {{# messages}}
  14 + <a href="{{href}}">{{name}}</a>
  15 + <b>({{count}})</b>
  16 + {{/ messages}}
17 17
18 - <span id="close-message" class="close iconfont">&#xe602;</span>  
19 - </p>  
20 - {{/if}} 18 + <span id="close-message" class="close iconfont">&#xe602;</span>
  19 + </p>
  20 + {{/if}}
21 21
22 - {{# latestOrders}}  
23 - <div class="latest-orders block">  
24 - <h2 class="title">  
25 - <a class="more-orders more" href="{{more}}">  
26 - 更多订单  
27 - </a>  
28 - </h2>  
29 - {{> home/order-block}}  
30 - </div>  
31 - {{/ latestOrders}} 22 + {{# latestOrders}}
  23 + <div class="latest-orders block">
  24 + <h2 class="title">
  25 + <a class="more-orders more" href="{{more}}">
  26 + 更多订单
  27 + </a>
  28 + </h2>
  29 + {{> home/order-block}}
  30 + </div>
  31 + {{/ latestOrders}}
32 32
33 - {{# favBrand}}  
34 - <div class="brands block">  
35 - <h2 class="title">  
36 - <a class="more-orders more" href="{{more}}">  
37 - 更多品牌  
38 - </a>  
39 - </h2>  
40 - <ul class="clearfix">  
41 - {{# brands}}  
42 - <li>  
43 - <a href="{{href}}">  
44 - <img class="brand-logo" src="{{logo}}">  
45 - <span class="brand-name">{{name}}</span>  
46 - </a>  
47 - </li>  
48 - {{/ brands}}  
49 - </ul>  
50 - </div>  
51 - {{/ favBrand}} 33 + {{# favBrand}}
  34 + <div class="brands block">
  35 + <h2 class="title">
  36 + <a class="more-orders more" href="{{more}}">
  37 + 更多品牌
  38 + </a>
  39 + </h2>
  40 + <ul class="clearfix">
  41 + {{# brands}}
  42 + <li>
  43 + <a href="{{href}}">
  44 + <img class="brand-logo" src="{{logo}}">
  45 + <span class="brand-name">{{name}}</span>
  46 + </a>
  47 + </li>
  48 + {{/ brands}}
  49 + </ul>
  50 + </div>
  51 + {{/ favBrand}}
52 52
53 - {{#if newArrival}}  
54 - <div class="new-arrival block">  
55 - <h2 class="title">  
56 - <p class="na-pager-wrap"> 53 + {{#if newArrival}}
  54 + <div class="new-arrival block">
  55 + <h2 class="title">
  56 + <p class="na-pager-wrap">
57 <span class="na-pager pre no-visible"> 57 <span class="na-pager pre no-visible">
58 <i class="iconfont">&#xe622;</i> 58 <i class="iconfont">&#xe622;</i>
59 </span> 59 </span>
60 <span class="na-pager next"> 60 <span class="na-pager next">
61 <i class="iconfont">&#xe621;</i> 61 <i class="iconfont">&#xe621;</i>
62 </span> 62 </span>
63 - </p>  
64 - </h2>  
65 - <ul class="clearfix">  
66 - {{# newArrival}}  
67 - <li>  
68 - <a href="{{href}}">  
69 - <img class="thumb" src="{{thumb}}">  
70 - <p class="name">{{name}}</p>  
71 - <span class="price">¥{{price}}</span>  
72 - </a>  
73 - </li>  
74 - {{/ newArrival}}  
75 - </ul>  
76 - </div>  
77 - {{/if}} 63 + </p>
  64 + </h2>
  65 + <ul class="clearfix">
  66 + {{# newArrival}}
  67 + <li>
  68 + <a href="{{href}}">
  69 + <img class="thumb" src="{{thumb}}">
  70 + <p class="name">{{name}}</p>
  71 + <span class="price">¥{{price}}</span>
  72 + </a>
  73 + </li>
  74 + {{/ newArrival}}
  75 + </ul>
  76 + </div>
  77 + {{/if}}
78 78
79 - {{{banner}}}  
80 - {{/ content}}  
81 79
82 - {{> home/help-us}}  
83 - </div> 80 + {{/ content}}
  81 +
  82 +
  83 + </div>
  84 + <!--recommend-for-you-->
  85 + {{#if recommend}}
  86 + <div class="recommend block">
  87 + <h2 class="title">
  88 + <p class="na-pager-wrap">
  89 + <span class="rc-pager pre no-visible">
  90 + <i class="iconfont">&#xe622;</i>
  91 + </span>
  92 + <span class="rc-pager next">
  93 + <i class="iconfont">&#xe621;</i>
  94 + </span>
  95 + </p>
  96 + </h2>
  97 + <ul class="clearfix">
  98 + {{# recommend}}
  99 + <li>
  100 + <a href="{{href}}">
  101 + <img class="thumb" src="{{thumb}}">
  102 + <p class="name">{{name}}</p>
  103 + <span class="price">¥{{price}}</span>
  104 + </a>
  105 + </li>
  106 + {{/ recommend}}
  107 + </ul>
  108 + </div>
  109 + {{/if}}
  110 + <!--recommend-for-you-->
  111 + <div class="ho-btm">
  112 + {{{banner}}}
  113 + {{> home/help-us}}
  114 + </div>
84 {{/ me}} 115 {{/ me}}
85 </div> 116 </div>
86 {{> layout/footer}} 117 {{> layout/footer}}
@@ -112,16 +112,20 @@ @@ -112,16 +112,20 @@
112 {{#if cancelOrder}} 112 {{#if cancelOrder}}
113 <span class="op-item cancel-order">取消订单</span> 113 <span class="op-item cancel-order">取消订单</span>
114 {{^}} 114 {{^}}
115 - {{#if confirmReceived}}  
116 - <span class="op-item confirm-received">确认收货</span> 115 + {{#if reBuy}}
  116 + <span class="rebuy">再次购买</span>
117 {{^}} 117 {{^}}
118 - <a class="op-item{{#if payNow}} pay-now{{/if}}" href="{{href}}" target="_blank">  
119 - {{#if payNow}}  
120 - 立即付款  
121 - {{^}}  
122 - {{name}}  
123 - {{/if}}  
124 - </a> 118 + {{#if confirmReceived}}
  119 + <span class="op-item confirm-received">确认收货</span>
  120 + {{^}}
  121 + <a class="op-item{{#if payNow}} pay-now{{/if}}" href="{{href}}" target="_blank">
  122 + {{#if payNow}}
  123 + 立即付款
  124 + {{^}}
  125 + {{name}}
  126 + {{/if}}
  127 + </a>
  128 + {{/if}}
125 {{/if}} 129 {{/if}}
126 {{/if}} 130 {{/if}}
127 {{/if}} 131 {{/if}}
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.

48.3 KB | W: | H:

48.3 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

8.64 KB | W: | H:

8.64 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -131,6 +131,19 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() { @@ -131,6 +131,19 @@ $cartnewSum.one('click', 'input[type="checkbox"]', function() {
131 choiceOut(dataJSON); 131 choiceOut(dataJSON);
132 }); 132 });
133 133
  134 +// 滚动到第一个选中的商品
  135 +function scrollToFirst() {
  136 + var $selected = $('.pay-wapper tbody tr').find('.cart-item-check:checked');
  137 + var top = 0;
  138 +
  139 + if ($selected.length > 0) {
  140 + $selected = $selected.eq(0);
  141 + }
  142 +
  143 + top = $selected.offset().top - 50;
  144 + $('html,body').scrollTop(top);
  145 + return false;
  146 +}
134 function isCheck(obj, className) { 147 function isCheck(obj, className) {
135 selectArray = []; 148 selectArray = [];
136 dataJSON = {}; 149 dataJSON = {};
@@ -191,8 +204,8 @@ function getTogetherProduct($obj, url, page) { @@ -191,8 +204,8 @@ function getTogetherProduct($obj, url, page) {
191 }); 204 });
192 } 205 }
193 206
194 -// 最近浏览  
195 -getTogetherProduct($histroy, '/cart/index/getHistroyProduct'); 207 +// 为你优选
  208 +getTogetherProduct($histroy, '/cart/index/getRecommendProduct');
196 209
197 // 凑单商品 210 // 凑单商品
198 getTogetherProduct($together, '/cart/index/getTogetherProduct'); 211 getTogetherProduct($together, '/cart/index/getTogetherProduct');
@@ -205,7 +218,7 @@ $together.on('click', '.pagenext, .pageprev', function() { @@ -205,7 +218,7 @@ $together.on('click', '.pagenext, .pageprev', function() {
205 218
206 }); 219 });
207 220
208 -//凑单商品,历史商品商品折叠 221 +//凑单商品,为你优选商品商品折叠
209 $shopCart.on('click', '.icon-minus, .icon-add', function() { 222 $shopCart.on('click', '.icon-minus, .icon-add', function() {
210 if ($(this).hasClass('icon-minus')) { 223 if ($(this).hasClass('icon-minus')) {
211 $(this).parents('.title').next('.main').hide(); 224 $(this).parents('.title').next('.main').hide();
@@ -226,7 +239,7 @@ $histroy.on('click', '.pagenext, .pageprev', function() { @@ -226,7 +239,7 @@ $histroy.on('click', '.pagenext, .pageprev', function() {
226 } else { 239 } else {
227 --pageNum > 0 || (pageNum = 1); 240 --pageNum > 0 || (pageNum = 1);
228 } 241 }
229 - getTogetherProduct($histroy, '/cart/index/getHistroyProduct', { 242 + getTogetherProduct($histroy, '/cart/index/getRecommendProduct', {
230 page: pageNum 243 page: pageNum
231 }); 244 });
232 245
@@ -271,15 +284,16 @@ function productInfo(data) { @@ -271,15 +284,16 @@ function productInfo(data) {
271 $('.detail-bigpic:not(.none) .bigpic:gt(0)').hide(); 284 $('.detail-bigpic:not(.none) .bigpic:gt(0)').hide();
272 285
273 $('.showSizeBox:not(.none)').find('span').each(function() { 286 $('.showSizeBox:not(.none)').find('span').each(function() {
274 - if ($(this).hasClass('null-atcivec')) {  
275 - $('.addcart').addClass('none');  
276 - $('.btn_sellout').removeClass('none');  
277 - } else {  
278 - $('.addcart').removeClass('none');  
279 - $('.btn_sellout').addClass('none');  
280 - return false;  
281 - }  
282 - }); 287 + if ($(this).hasClass('null-atcivec')) {
  288 + $('.addcart').addClass('none');
  289 + $('.btn_sellout').removeClass('none');
  290 + } else {
  291 + $('.addcart').removeClass('none');
  292 + $('.btn_sellout').addClass('none');
  293 + return false;
  294 + }
  295 + });
  296 +
283 }); 297 });
284 } 298 }
285 299
@@ -304,7 +318,7 @@ $payWapper.on('click', '.cart-add-btn', function() { @@ -304,7 +318,7 @@ $payWapper.on('click', '.cart-add-btn', function() {
304 }); 318 });
305 }); 319 });
306 320
307 -//凑单商品,历史商品商品记录 321 +//凑单商品,为你优选商品商品记录
308 $('.clearfix').on('click', '.btn_view_s', function() { 322 $('.clearfix').on('click', '.btn_view_s', function() {
309 productId = $(this).data('id'); 323 productId = $(this).data('id');
310 promotionId = $(this).parents('table').data('promotion'); 324 promotionId = $(this).parents('table').data('promotion');
@@ -880,4 +894,6 @@ $payWapper.on('selectstart', function() { @@ -880,4 +894,6 @@ $payWapper.on('selectstart', function() {
880 }); 894 });
881 $goodsDetail.on('selectstart', function() { 895 $goodsDetail.on('selectstart', function() {
882 return false; 896 return false;
883 -});  
  897 +});
  898 +
  899 +scrollToFirst();
@@ -13,55 +13,92 @@ $('#close-message').click(function() { @@ -13,55 +13,92 @@ $('#close-message').click(function() {
13 $('.message-tip').slideUp(200); 13 $('.message-tip').slideUp(200);
14 }); 14 });
15 15
  16 +/**
  17 + *
  18 + * @param self 点击的控件
  19 + * @param $ul 列表父
  20 + * @param page 总共页数
  21 + * @param itemWith 子元素宽
  22 + * @param curPage 当前页码
  23 + * @param num 一页商品数量
  24 + */
  25 +function pageChange(self, $ul, page, itemWith, curPage, num) {
  26 + var $this = self,
  27 + left;
  28 +
  29 + if ($this.hasClass('next')) {
  30 +
  31 + //第2页显示前翻按钮
  32 + if (curPage === 2) {
  33 + $this.siblings().removeClass('no-visible');
  34 + }
  35 +
  36 + //最后一页隐藏后翻按钮
  37 + if (curPage === page) {
  38 + $this.addClass('no-visible');
  39 + }
  40 + } else {
  41 +
  42 + //倒数第2页显示后翻按钮
  43 + if (curPage === page - 1) {
  44 + $this.siblings().removeClass('no-visible');
  45 + }
  46 +
  47 + //第1页隐藏前翻按钮
  48 + if (curPage === 1) {
  49 + $this.addClass('no-visible');
  50 + }
  51 + }
  52 +
  53 + left = -num * (curPage - 1) * itemWith;
  54 +
  55 + $ul.animate({
  56 + marginLeft: left
  57 + }, 400);
  58 +}
  59 +
16 //新品上架 60 //新品上架
17 (function() { 61 (function() {
18 var $naPager = $('.na-pager'), 62 var $naPager = $('.na-pager'),
  63 + $rcPager = $('.rc-pager'),
19 $naUl = $('.new-arrival ul'), 64 $naUl = $('.new-arrival ul'),
  65 + $rcUl = $('.recommend ul'),
20 naPage = Math.ceil($naUl.children('li').length / 5), 66 naPage = Math.ceil($naUl.children('li').length / 5),
  67 + rcPage = Math.ceil($rcUl.children('li').length / 6),
21 naItemWith = $naUl.children('li:last-child').outerWidth(), 68 naItemWith = $naUl.children('li:last-child').outerWidth(),
22 - naCurPage = 1; 69 + rcItemWith = $rcUl.children('li:last-child').outerWidth(),
  70 + naCurPage = 1,
  71 + rcCurPage = 1;
23 72
24 $naUl.width($naUl.width() * naPage); 73 $naUl.width($naUl.width() * naPage);
  74 + $rcUl.width($rcUl.width() * rcPage);
25 75
26 //最新上架翻页 76 //最新上架翻页
27 $naPager.click(function() { 77 $naPager.click(function() {
28 - var $this = $(this),  
29 - left;  
30 -  
31 - if ($this.hasClass('next')) {  
32 -  
33 - //后翻  
34 - ++naCurPage;  
35 -  
36 - //第2页显示前翻按钮  
37 - if (naCurPage === 2) {  
38 - $this.siblings().removeClass('no-visible');  
39 - } 78 + var $this = $(this);
40 79
41 - //最后一页隐藏后翻按钮  
42 - if (naCurPage === naPage) {  
43 - $this.addClass('no-visible'); 80 + if (naPage > 1) {
  81 + if ($this.hasClass('next')) {
  82 + ++naCurPage;
  83 + } else {
  84 + --naCurPage;
44 } 85 }
45 - } else { 86 + pageChange($this, $naUl, naPage, naItemWith, naCurPage, 5);
  87 + }
  88 + });
46 89
47 - //前翻  
48 - --naCurPage; 90 + //为你推荐翻页
  91 + $rcPager.click(function() {
  92 + var $this = $(this);
49 93
50 - //倒数第2页显示后翻按钮  
51 - if (naCurPage === naPage - 1) {  
52 - $this.siblings().removeClass('no-visible'); 94 + if (rcPage > 1) {
  95 + if ($this.hasClass('next')) {
  96 + ++rcCurPage;
  97 + } else {
  98 + --rcCurPage;
53 } 99 }
54 100
55 - //第1页隐藏前翻按钮  
56 - if (naCurPage === 1) {  
57 - $this.addClass('no-visible');  
58 - } 101 + pageChange($this, $rcUl, rcPage, rcItemWith, rcCurPage, 6);
59 } 102 }
60 -  
61 - left = -5 * (naCurPage - 1) * naItemWith;  
62 -  
63 - $naUl.animate({  
64 - marginLeft: left  
65 - }, 400);  
66 }); 103 });
67 }()); 104 }());
@@ -180,8 +180,24 @@ $('.me-orders, .order-detail').on('click', '.cancel-order', function(e) { @@ -180,8 +180,24 @@ $('.me-orders, .order-detail').on('click', '.cancel-order', function(e) {
180 active = editOrder($(this).closest('.order, .order-detail').data('id')) 180 active = editOrder($(this).closest('.order, .order-detail').data('id'))
181 active.show(); 181 active.show();
182 newAddress(0); 182 newAddress(0);
  183 +}).on('click', '.rebuy', function() {
  184 + var id = $(this).closest('.order, .order-detail').data('id');
  185 + buyAgain(id);
183 }); 186 });
184 - 187 +//再次购买
  188 +function buyAgain(id){
  189 + $.ajax({
  190 + type: 'post',
  191 + url: '/home/orders/reAdd',
  192 + data: {orderCode: id}
  193 + }).then(function(d) {
  194 + if (d.code === 200) {
  195 + location.href = '/shopping/cart';
  196 + } else {
  197 + new dialog.Alert(d.message).show();
  198 + }
  199 + })
  200 +}
185 // 地址操作 201 // 地址操作
186 function newAddress(id) { 202 function newAddress(id) {
187 var code, codeId; 203 var code, codeId;
@@ -403,7 +419,7 @@ function saveAddress(id) { @@ -403,7 +419,7 @@ function saveAddress(id) {
403 419
404 $.ajax({ 420 $.ajax({
405 type: 'post', 421 type: 'post',
406 - url: '/home/orders/modifyAddress', 422 + url: '/home/orders/modifyAddress',
407 data: postData 423 data: postData
408 }).then(function(d) { 424 }).then(function(d) {
409 if (d.code === 200) { 425 if (d.code === 200) {
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 } 81 }
82 } 82 }
83 83
84 - .new-arrival { 84 + .new-arrival,.recommend {
85 overflow: hidden; 85 overflow: hidden;
86 86
87 .na-pager-wrap { 87 .na-pager-wrap {
@@ -144,6 +144,25 @@ @@ -144,6 +144,25 @@
144 } 144 }
145 } 145 }
146 146
  147 + .recommend {
  148 + margin-bottom: 10px;
  149 +
  150 + ul {
  151 + width: 990px;
  152 + }
  153 +
  154 + li {
  155 + width: 106px;
  156 + }
  157 + }
  158 +
  159 +
  160 +
  161 + .ho-btm{
  162 + float: right;
  163 + width: 800px;
  164 + }
  165 +
147 .banner { 166 .banner {
148 display: block; 167 display: block;
149 width: 800px; 168 width: 800px;
@@ -161,4 +180,8 @@ @@ -161,4 +180,8 @@
161 .new-arrival .title { 180 .new-arrival .title {
162 background-image: resolve(/home/new-arrival.png); 181 background-image: resolve(/home/new-arrival.png);
163 } 182 }
  183 +
  184 + .recommend .title {
  185 + background-image: resolve(/home/recommend.png);
  186 + }
164 } 187 }
@@ -139,6 +139,7 @@ @@ -139,6 +139,7 @@
139 .me-main { 139 .me-main {
140 float: left; 140 float: left;
141 width: 800px; 141 width: 800px;
  142 + min-height: 945px;
142 } 143 }
143 144
144 .me-pager { 145 .me-pager {
@@ -257,6 +257,16 @@ @@ -257,6 +257,16 @@
257 border-radius: 4px; 257 border-radius: 4px;
258 width: 68px; 258 width: 68px;
259 } 259 }
  260 + .operation .rebuy{
  261 + display: inline-block;
  262 + box-sizing: border-box;
  263 + width: 68px;
  264 + height: 18px;
  265 + line-height: 18px;
  266 + border-radius: 5px;
  267 + text-align: center;
  268 + border: 1px solid #000;
  269 + }
260 } 270 }
261 } 271 }
262 272
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace Home; 3 namespace Home;
4 4
5 use Home\UserModel; 5 use Home\UserModel;
  6 +use LibModels\Web\Home\UserData;
6 use LibModels\Web\Product\BrandData; 7 use LibModels\Web\Product\BrandData;
7 use WebPlugin\Helpers; 8 use WebPlugin\Helpers;
8 use WebPlugin\HelperHome; 9 use WebPlugin\HelperHome;
@@ -75,6 +76,25 @@ class IndexModel @@ -75,6 +76,25 @@ class IndexModel
75 } 76 }
76 77
77 /** 78 /**
  79 + * @param $channel
  80 + * @param $uid
  81 + * @param $udid
  82 + * @param $recPos
  83 + * @param $limit
  84 + * @return array
  85 + */
  86 + public static function preferenceData($channel, $uid, $udid, $recPos, $limit)
  87 + {
  88 + $response = UserData::newPreference($channel, $uid, $udid, $recPos, $limit);
  89 +
  90 + if ($response['code'] === 200) {
  91 + return HelperHome::formatNew($response['data']['product_list']);
  92 + } else {
  93 + return array();
  94 + }
  95 + }
  96 +
  97 + /**
78 * 底部banner 98 * 底部banner
79 * @param string $code 99 * @param string $code
80 * @return mixed 100 * @return mixed
@@ -82,7 +102,7 @@ class IndexModel @@ -82,7 +102,7 @@ class IndexModel
82 public static function getFooterBanner($code = '20110609-152143') 102 public static function getFooterBanner($code = '20110609-152143')
83 { 103 {
84 104
85 - $banner = BrandData::getByNodeContent($code); 105 + $banner = BrandData::getByNodeContent($code);
86 if (isset($banner['code']) && !empty($banner['data'])) { 106 if (isset($banner['code']) && !empty($banner['data'])) {
87 return $banner['data']; 107 return $banner['data'];
88 } 108 }
@@ -578,6 +578,10 @@ class OrderModel @@ -578,6 +578,10 @@ class OrderModel
578 $exchangeUrl = Helpers::url('/home/returns/exchangeRequest', array('orderCode' => $orderCode)); 578 $exchangeUrl = Helpers::url('/home/returns/exchangeRequest', array('orderCode' => $orderCode));
579 //申请退货 579 //申请退货
580 $refundUrl = Helpers::url('/home/returns/refundrequest', array('orderCode' => $orderCode)); 580 $refundUrl = Helpers::url('/home/returns/refundrequest', array('orderCode' => $orderCode));
  581 + //再次购买
  582 + if ( $isCancel == 'Y') {
  583 + $operation[] = array( 'name' => '再次购买', 'reBuy' => true);
  584 + }
581 //立即付款 585 //立即付款
582 if ($payStatus == 'N' && $paymentType != 2 && $isCancel == 'N') { 586 if ($payStatus == 'N' && $paymentType != 2 && $isCancel == 'N') {
583 $operation[] = array('payNow' => true, 'href' => $payUrl); 587 $operation[] = array('payNow' => true, 'href' => $payUrl);
@@ -16,7 +16,7 @@ use Configs\ChannelConfig; @@ -16,7 +16,7 @@ use Configs\ChannelConfig;
16 16
17 /** 17 /**
18 * 购物车相关的模板数据模型 18 * 购物车相关的模板数据模型
19 - * 19 + *
20 * @name CartModel 20 * @name CartModel
21 * @package Shopping 21 * @package Shopping
22 * @copyright yoho.inc 22 * @copyright yoho.inc
@@ -30,7 +30,7 @@ class CartModel @@ -30,7 +30,7 @@ class CartModel
30 30
31 /** 31 /**
32 * 获取我的购物车数据 32 * 获取我的购物车数据
33 - * 33 + *
34 * @param int $uid 当前登录用户ID 34 * @param int $uid 当前登录用户ID
35 * @param string $shoppingKey 购物车在浏览器的唯一识别码 35 * @param string $shoppingKey 购物车在浏览器的唯一识别码
36 * @param mixed $cartDelList 删除的商品列表 36 * @param mixed $cartDelList 删除的商品列表
@@ -39,7 +39,7 @@ class CartModel @@ -39,7 +39,7 @@ class CartModel
39 public static function myCartData($uid, $shoppingKey, $cartDelList) 39 public static function myCartData($uid, $shoppingKey, $cartDelList)
40 { 40 {
41 $result = array(); 41 $result = array();
42 - 42 +
43 // 存放分析用的数据 43 // 存放分析用的数据
44 $analysisData = array('ipinyou' => ''); 44 $analysisData = array('ipinyou' => '');
45 45
@@ -59,7 +59,7 @@ class CartModel @@ -59,7 +59,7 @@ class CartModel
59 $result['isEmpty'] = true; 59 $result['isEmpty'] = true;
60 $result['guangUrl'] = Helpers::url('', null, 'list'); 60 $result['guangUrl'] = Helpers::url('', null, 'list');
61 $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time())); 61 $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time()));
62 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'shoppingKey:'.$shoppingKey); 62 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
63 break; 63 break;
64 } 64 }
65 65
@@ -107,16 +107,14 @@ class CartModel @@ -107,16 +107,14 @@ class CartModel
107 $result['productAllA'] = Helpers::transPrice($advanceCartData['shopping_cart_data']['last_order_amount']); 107 $result['productAllA'] = Helpers::transPrice($advanceCartData['shopping_cart_data']['last_order_amount']);
108 // 获赠YOHO币个数 108 // 获赠YOHO币个数
109 $result['getYoho'] = $advanceCartData['shopping_cart_data']['gain_yoho_coin']; 109 $result['getYoho'] = $advanceCartData['shopping_cart_data']['gain_yoho_coin'];
110 - }  
111 - // 普通的 110 + } // 普通的
112 elseif ($ordinaryCount !== 0 && $advanceCount === 0) { 111 elseif ($ordinaryCount !== 0 && $advanceCount === 0) {
113 //$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount']); 112 //$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount']);
114 $result['productAmmount'] = self::genProductAmount($ordinaryCartData['shopping_cart_data']['promotion_formula_list'], $ordinaryCartData['shopping_cart_data']['order_amount']); 113 $result['productAmmount'] = self::genProductAmount($ordinaryCartData['shopping_cart_data']['promotion_formula_list'], $ordinaryCartData['shopping_cart_data']['order_amount']);
115 $result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount']); 114 $result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount']);
116 $result['productAllA'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['last_order_amount']); 115 $result['productAllA'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['last_order_amount']);
117 $result['getYoho'] = $ordinaryCartData['shopping_cart_data']['gain_yoho_coin']; 116 $result['getYoho'] = $ordinaryCartData['shopping_cart_data']['gain_yoho_coin'];
118 - }  
119 - // 所有的 117 + } // 所有的
120 else { 118 else {
121 $result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount'] + $advanceCartData['shopping_cart_data']['order_amount']); 119 $result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount'] + $advanceCartData['shopping_cart_data']['order_amount']);
122 $result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount'] + $advanceCartData['shopping_cart_data']['discount_amount']); 120 $result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount'] + $advanceCartData['shopping_cart_data']['discount_amount']);
@@ -185,8 +183,7 @@ class CartModel @@ -185,8 +183,7 @@ class CartModel
185 // 普通的 183 // 普通的
186 if (!empty($ordinaryCartData['promotion_info'])) { 184 if (!empty($ordinaryCartData['promotion_info'])) {
187 $result['salesPromotion'] = self::buildPromotionData($ordinaryCartData['promotion_info']); 185 $result['salesPromotion'] = self::buildPromotionData($ordinaryCartData['promotion_info']);
188 - }  
189 - // 预售的 186 + } // 预售的
190 elseif (!empty($advanceCartData['promotion_info'])) { 187 elseif (!empty($advanceCartData['promotion_info'])) {
191 //$result['salesPromotion'] = array_merge($result['salesPromotion'], self::buildPromotionData($advanceCartData['promotion_info'])); 188 //$result['salesPromotion'] = array_merge($result['salesPromotion'], self::buildPromotionData($advanceCartData['promotion_info']));
192 $result['salesPromotion'] = self::buildPromotionData($advanceCartData['promotion_info']); 189 $result['salesPromotion'] = self::buildPromotionData($advanceCartData['promotion_info']);
@@ -196,9 +193,9 @@ class CartModel @@ -196,9 +193,9 @@ class CartModel
196 $advanceCartData = array(); 193 $advanceCartData = array();
197 $ordinaryCartData = array(); 194 $ordinaryCartData = array();
198 $cartData = array(); 195 $cartData = array();
199 - 196 +
200 } while (false); 197 } while (false);
201 - 198 +
202 // 增加第三方分析用的数据 199 // 增加第三方分析用的数据
203 $result['ids'] = empty($analysisData['ids']) ? '' : implode(',', $analysisData['ids']); 200 $result['ids'] = empty($analysisData['ids']) ? '' : implode(',', $analysisData['ids']);
204 $result['ipinyou'] = empty($analysisData['ipinyou']) ? '' : $analysisData['ipinyou']; 201 $result['ipinyou'] = empty($analysisData['ipinyou']) ? '' : $analysisData['ipinyou'];
@@ -227,8 +224,8 @@ class CartModel @@ -227,8 +224,8 @@ class CartModel
227 $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); 224 $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
228 if ($addCart && isset($addCart['code'])) { 225 if ($addCart && isset($addCart['code'])) {
229 $result = $addCart; 226 $result = $addCart;
230 - }else{  
231 - UdpLog::info('【购物车】校验参数传递auth','productSku:'.$productSku.'buyNumber:'.$buyNumber.'goodsType:'.$goodsType,'isEdit:'.$isEdit.'promotionId:'.$promotionId.'uid:'.$uid.'shoppingKey:'.$shoppingKey); 227 + } else {
  228 + UdpLog::info('【购物车】校验参数传递auth', 'productSku:' . $productSku . 'buyNumber:' . $buyNumber . 'goodsType:' . $goodsType, 'isEdit:' . $isEdit . 'promotionId:' . $promotionId . 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
232 } 229 }
233 230
234 return $result; 231 return $result;
@@ -249,7 +246,7 @@ class CartModel @@ -249,7 +246,7 @@ class CartModel
249 246
250 do { 247 do {
251 if (empty($skuList)) { 248 if (empty($skuList)) {
252 - UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); 249 + UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
253 break; 250 break;
254 } 251 }
255 252
@@ -257,8 +254,8 @@ class CartModel @@ -257,8 +254,8 @@ class CartModel
257 if ($select && isset($select['code'])) { 254 if ($select && isset($select['code'])) {
258 $result['code'] = $select['code']; 255 $result['code'] = $select['code'];
259 $result['message'] = $select['message']; 256 $result['message'] = $select['message'];
260 - }else{  
261 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); 257 + } else {
  258 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
262 } 259 }
263 } while (false); 260 } while (false);
264 261
@@ -281,7 +278,7 @@ class CartModel @@ -281,7 +278,7 @@ class CartModel
281 278
282 do { 279 do {
283 if (empty($skuList)) { 280 if (empty($skuList)) {
284 - UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); 281 + UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
285 break; 282 break;
286 } 283 }
287 284
@@ -292,8 +289,8 @@ class CartModel @@ -292,8 +289,8 @@ class CartModel
292 if (isset($remove['data']['goods_count'])) { 289 if (isset($remove['data']['goods_count'])) {
293 $result['total_goods_num'] = $remove['data']['goods_count']; 290 $result['total_goods_num'] = $remove['data']['goods_count'];
294 } 291 }
295 - }else{  
296 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); 292 + } else {
  293 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
297 } 294 }
298 } while (false); 295 } while (false);
299 296
@@ -321,7 +318,7 @@ class CartModel @@ -321,7 +318,7 @@ class CartModel
321 } 318 }
322 319
323 if (empty($skuList)) { 320 if (empty($skuList)) {
324 - UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); 321 + UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
325 break; 322 break;
326 } 323 }
327 324
@@ -329,8 +326,8 @@ class CartModel @@ -329,8 +326,8 @@ class CartModel
329 if ($add && isset($add['code'])) { 326 if ($add && isset($add['code'])) {
330 $result['code'] = $add['code']; 327 $result['code'] = $add['code'];
331 $result['message'] = $add['message']; 328 $result['message'] = $add['message'];
332 - }else{  
333 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'hasPromotion:'.$hasPromotion); 329 + } else {
  330 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'hasPromotion:' . $hasPromotion);
334 } 331 }
335 } while (false); 332 } while (false);
336 333
@@ -353,7 +350,7 @@ class CartModel @@ -353,7 +350,7 @@ class CartModel
353 350
354 do { 351 do {
355 if (empty($sku)) { 352 if (empty($sku)) {
356 - UdpLog::info('【购物车】校验参数传递auth','sku:'.$sku); 353 + UdpLog::info('【购物车】校验参数传递auth', 'sku:' . $sku);
357 break; 354 break;
358 } 355 }
359 356
@@ -361,8 +358,8 @@ class CartModel @@ -361,8 +358,8 @@ class CartModel
361 if ($modify && isset($modify['code'])) { 358 if ($modify && isset($modify['code'])) {
362 $result['code'] = $modify['code']; 359 $result['code'] = $modify['code'];
363 $result['message'] = $modify['message']; 360 $result['message'] = $modify['message'];
364 - }else{  
365 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'sku:'.$sku,'increaseNum:'.$increaseNum.'decreaseNum:'.$decreaseNum.'shoppingKey:'.$shoppingKey); 361 + } else {
  362 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'sku:' . $sku, 'increaseNum:' . $increaseNum . 'decreaseNum:' . $decreaseNum . 'shoppingKey:' . $shoppingKey);
366 } 363 }
367 } while (false); 364 } while (false);
368 365
@@ -371,7 +368,7 @@ class CartModel @@ -371,7 +368,7 @@ class CartModel
371 368
372 /** 369 /**
373 * 获取凑单商品 370 * 获取凑单商品
374 - * 371 + *
375 * @param int $page 分页页码 372 * @param int $page 分页页码
376 * @return array 373 * @return array
377 */ 374 */
@@ -420,8 +417,115 @@ class CartModel @@ -420,8 +417,115 @@ class CartModel
420 } 417 }
421 418
422 /** 419 /**
  420 + * 获取为你优选商品 待处理
  421 + *
  422 + * @param $channel 频道
  423 + * @param $uid 用户id
  424 + * @param $udid 设备id
  425 + * @param int $page 分页页码
  426 + * @return array
  427 + * @internal param $rec_pos
  428 + * @internal param $limit
  429 + */
  430 + public static function getRecommendProduct($channel, $uid, $udid, $page)
  431 + {
  432 + $result = array('code' => 200, 'message' => '', 'data' => array('header' => '为你优选', 'hasPrev' => false, 'hasNext' => false, 'item' => array()));
  433 +
  434 + do {
  435 + if (!is_numeric($page)) {
  436 + break;
  437 + }
  438 +
  439 + $channelNum = 1;
  440 + switch ($channel) {
  441 + case 'boys':
  442 + $channelNum = 1;
  443 + break;
  444 + case 'girls':
  445 + $channelNum = 2;
  446 + break;
  447 + case 'kids':
  448 + $channelNum = 3;
  449 + break;
  450 + case 'lifestyle':
  451 + $channelNum = 4;
  452 + break;
  453 + default:
  454 + break;
  455 + }
  456 +
  457 + $together = UserData::newPreference($channelNum, $uid, $udid, '100003', 30);
  458 + if (empty($together['data']['product_list'])) {
  459 + break;
  460 + }
  461 +
  462 + $result['data']['hasNext'] = true;
  463 + $result['data']['hasPrev'] = true;
  464 +
  465 + $build = array();
  466 + $begin = 0;
  467 + $end = 0;
  468 + switch ($page) {
  469 + case 1:
  470 + $begin = 0;
  471 + $end = 5;
  472 + break;
  473 + case 2:
  474 + $begin = 6;
  475 + $end = 11;
  476 + break;
  477 + case 3:
  478 + $begin = 12;
  479 + $end = 17;
  480 + break;
  481 + case 4:
  482 + $begin = 18;
  483 + $end = 23;
  484 + break;
  485 + case 5:
  486 + $begin = 18;
  487 + $end = 23;
  488 + break;
  489 + case 6:
  490 + $begin = 24;
  491 + $end = 30;
  492 + break;
  493 + default:
  494 + $begin = 0;
  495 + $end = 5;
  496 + break;
  497 + }
  498 + foreach ($together['data']['product_list'] as $key => $value) {
  499 + if ($key >= $begin && $key <= $end) {
  500 + $build = array();
  501 + $build['id'] = $value['product_id'];
  502 + $build['skn'] = $value['product_skn'];
  503 + $build['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_list'][0]['product_skc'], $value['cn_alphabet']);;
  504 + $build['title'] = $value['product_name'];
  505 + $build['img'] = Helpers::getImageUrl($value['default_images'], 100, 100);
  506 + $build['alt'] = $value['product_name'];
  507 + $build['price'] = $value['price']['sales_price'];
  508 + if ($value['price']['sales_price'] !== $value['price']['market_price']) {
  509 + $build['marketPrice'] = $value['price']['market_price'];
  510 + }
  511 +
  512 + $result['data']['item'][] = $build;
  513 + }
  514 + }
  515 +
  516 + // 当数据量不足6个时,判定为没有下一页
  517 + if ($page == 1 && !isset($result['data']['item'][5])) {
  518 + $result['data']['hasPrev'] = false;
  519 + $result['data']['hasNext'] = false;
  520 + }
  521 + } while (false);
  522 +
  523 + return $result;
  524 + }
  525 +
  526 + /**
423 * 获取最近浏览商品 527 * 获取最近浏览商品
424 - * 528 + *
425 * @param int $page 分页页码 529 * @param int $page 分页页码
426 * @return array 530 * @return array
427 */ 531 */
@@ -436,7 +540,7 @@ class CartModel @@ -436,7 +540,7 @@ class CartModel
436 540
437 $browse = CartData::browseRecord($uid, $udid, $page, 6); 541 $browse = CartData::browseRecord($uid, $udid, $page, 6);
438 if (empty($browse['data']['product_list'])) { 542 if (empty($browse['data']['product_list'])) {
439 - UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'udid'.$udid.'page'.$page); 543 + UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'udid' . $udid . 'page' . $page);
440 break; 544 break;
441 } 545 }
442 546
@@ -476,7 +580,7 @@ class CartModel @@ -476,7 +580,7 @@ class CartModel
476 580
477 /** 581 /**
478 * 基于本地浏览器Cookie的指定浏览记录 582 * 基于本地浏览器Cookie的指定浏览记录
479 - * 583 + *
480 * @param int $page 页码 584 * @param int $page 页码
481 * @param int $limit 限制数 585 * @param int $limit 限制数
482 * @return array 586 * @return array
@@ -595,8 +699,7 @@ class CartModel @@ -595,8 +699,7 @@ class CartModel
595 if ($value['payment_type'] == 1 && $value['is_support'] === 'Y') { 699 if ($value['payment_type'] == 1 && $value['is_support'] === 'Y') {
596 $result['onlinePay']['checked'] = $isDefault ? true : false; 700 $result['onlinePay']['checked'] = $isDefault ? true : false;
597 $result['onlinePay']['paymentId'] = $value['payment_id']; 701 $result['onlinePay']['paymentId'] = $value['payment_id'];
598 - }  
599 - // 货到付款 702 + } // 货到付款
600 elseif ($value['payment_type'] == 2 && $value['is_support'] === 'Y') { 703 elseif ($value['payment_type'] == 2 && $value['is_support'] === 'Y') {
601 $result['deliveryPay']['checked'] = $isDefault ? true : false; 704 $result['deliveryPay']['checked'] = $isDefault ? true : false;
602 $result['deliveryPay']['paymentId'] = $value['payment_id']; 705 $result['deliveryPay']['paymentId'] = $value['payment_id'];
@@ -609,9 +712,9 @@ class CartModel @@ -609,9 +712,9 @@ class CartModel
609 } 712 }
610 } 713 }
611 // tar add 1605061351 货到付款提示信息处理 714 // tar add 1605061351 货到付款提示信息处理
612 - if(isset($pay['data']['payment_way'])){ 715 + if (isset($pay['data']['payment_way'])) {
613 foreach ($pay['data']['payment_way'] as $item) { 716 foreach ($pay['data']['payment_way'] as $item) {
614 - if($item['payment_type'] === 2){ 717 + if ($item['payment_type'] === 2) {
615 $result['paymentInCashInfo'] = $item['is_support_message']; 718 $result['paymentInCashInfo'] = $item['is_support_message'];
616 } 719 }
617 } 720 }
@@ -780,8 +883,7 @@ class CartModel @@ -780,8 +883,7 @@ class CartModel
780 883
781 //JIT拆单需求 package 884 //JIT拆单需求 package
782 $result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']); 885 $result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
783 - }  
784 - while (false); 886 + } while (false);
785 887
786 return $result; 888 return $result;
787 } 889 }
@@ -799,17 +901,17 @@ class CartModel @@ -799,17 +901,17 @@ class CartModel
799 if ($isMulti) { 901 if ($isMulti) {
800 $packageList = $cartInfo['package_list']; 902 $packageList = $cartInfo['package_list'];
801 foreach ($packageList as $pk => $pv) { 903 foreach ($packageList as $pk => $pv) {
802 - $pIndex = $pk+1;  
803 - $packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹'.$pIndex.':总仓发货' : '包裹'.$pIndex.':异地调拨'; //仓库 904 + $pIndex = $pk + 1;
  905 + $packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹' . $pIndex . ':总仓发货' : '包裹' . $pIndex . ':异地调拨'; //仓库
804 $goodList = $pv['goods_list']; 906 $goodList = $pv['goods_list'];
805 foreach ($goodList as $glk => $glv) { 907 foreach ($goodList as $glk => $glv) {
806 $packages[$pk]['goodlist'][$glk]['src'] = Images::getImageUrl($glv['goods_images'], 90, 90); 908 $packages[$pk]['goodlist'][$glk]['src'] = Images::getImageUrl($glv['goods_images'], 90, 90);
807 - $tagInfo= isset(ChannelConfig::$orderTagArr[$glv['goods_type']])?ChannelConfig::$orderTagArr[$glv['goods_type']]:'';  
808 - $packages[$pk]['goodlist'][$glk]['goodsType'] =!empty($tagInfo['name'])?$tagInfo['name']:false;  
809 - $packages[$pk]['goodlist'][$glk]['classname'] =!empty($tagInfo['classname'])?$tagInfo['classname']:false; 909 + $tagInfo = isset(ChannelConfig::$orderTagArr[$glv['goods_type']]) ? ChannelConfig::$orderTagArr[$glv['goods_type']] : '';
  910 + $packages[$pk]['goodlist'][$glk]['goodsType'] = !empty($tagInfo['name']) ? $tagInfo['name'] : false;
  911 + $packages[$pk]['goodlist'][$glk]['classname'] = !empty($tagInfo['classname']) ? $tagInfo['classname'] : false;
810 $packages[$pk]['goodlist'][$glk]['link'] = 'javascript:void(0)'; 912 $packages[$pk]['goodlist'][$glk]['link'] = 'javascript:void(0)';
811 } 913 }
812 - $packages[$pk]['fee'] = ($pv['shopping_cost']=='0.00')?false:$pv['shopping_cost']; 914 + $packages[$pk]['fee'] = ($pv['shopping_cost'] == '0.00') ? false : $pv['shopping_cost'];
813 $packages[$pk]['orign'] = $pv['shopping_orig_cost']; 915 $packages[$pk]['orign'] = $pv['shopping_orig_cost'];
814 $packages[$pk]['count'] = $pv['shopping_cut_cost']; 916 $packages[$pk]['count'] = $pv['shopping_cut_cost'];
815 } 917 }
@@ -830,7 +932,7 @@ class CartModel @@ -830,7 +932,7 @@ class CartModel
830 * @param int $redEnvelopes 红包 932 * @param int $redEnvelopes 红包
831 * @return array 接口返回的数据 933 * @return array 接口返回的数据
832 */ 934 */
833 - public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes) 935 + public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes)
834 { 936 {
835 $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE, 'data' => array()); 937 $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE, 'data' => array());
836 938
@@ -838,7 +940,7 @@ class CartModel @@ -838,7 +940,7 @@ class CartModel
838 if (!empty($yohoCoin)) { 940 if (!empty($yohoCoin)) {
839 $yohoCoin = intval($yohoCoin) / 100; 941 $yohoCoin = intval($yohoCoin) / 100;
840 } 942 }
841 - $compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes); 943 + $compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes);
842 if ($compute && isset($compute['code'])) { 944 if ($compute && isset($compute['code'])) {
843 /* 商品价格明细 */ 945 /* 商品价格明细 */
844 if (!empty($compute['data']['promotion_formula_list'])) { 946 if (!empty($compute['data']['promotion_formula_list'])) {
@@ -906,19 +1008,19 @@ class CartModel @@ -906,19 +1008,19 @@ class CartModel
906 1008
907 do { 1009 do {
908 if (empty($addressId)) { 1010 if (empty($addressId)) {
909 - UdpLog::info('【结算信息】配送地址参数校验','addressId为空'); 1011 + UdpLog::info('【结算信息】配送地址参数校验', 'addressId为空');
910 $result['code'] = 401; 1012 $result['code'] = 401;
911 $result['message'] = '配送地址不能为空'; 1013 $result['message'] = '配送地址不能为空';
912 break; 1014 break;
913 } 1015 }
914 if (empty($deliveryTimeId)) { 1016 if (empty($deliveryTimeId)) {
915 - UdpLog::info('【结算信息】配送时间参数校验','deliveryTime为空'); 1017 + UdpLog::info('【结算信息】配送时间参数校验', 'deliveryTime为空');
916 $result['code'] = 402; 1018 $result['code'] = 402;
917 $result['message'] = '请选择配送时间'; 1019 $result['message'] = '请选择配送时间';
918 break; 1020 break;
919 } 1021 }
920 if (empty($deliveryWayId)) { 1022 if (empty($deliveryWayId)) {
921 - UdpLog::info('【结算信息】配送方式参数校验','deliveryWay为空'); 1023 + UdpLog::info('【结算信息】配送方式参数校验', 'deliveryWay为空');
922 $result['code'] = 403; 1024 $result['code'] = 403;
923 $result['message'] = '请选择配送方式'; 1025 $result['message'] = '请选择配送方式';
924 break; 1026 break;
@@ -952,7 +1054,7 @@ class CartModel @@ -952,7 +1054,7 @@ class CartModel
952 1054
953 /** 1055 /**
954 * 用户的收货地址列表 1056 * 用户的收货地址列表
955 - * 1057 + *
956 * @param int $uid 用户ID 1058 * @param int $uid 用户ID
957 * @return array 1059 * @return array
958 */ 1060 */
@@ -1003,7 +1105,7 @@ class CartModel @@ -1003,7 +1105,7 @@ class CartModel
1003 1105
1004 /** 1106 /**
1005 * 设置默认的收货地址 1107 * 设置默认的收货地址
1006 - * 1108 + *
1007 * @param int $uid 用户ID 1109 * @param int $uid 用户ID
1008 * @param int $addressId 地址ID 1110 * @param int $addressId 地址ID
1009 * @return array 1111 * @return array
@@ -1021,7 +1123,7 @@ class CartModel @@ -1021,7 +1123,7 @@ class CartModel
1021 1123
1022 /** 1124 /**
1023 * 删除收货地址 1125 * 删除收货地址
1024 - * 1126 + *
1025 * @param int $uid 用户ID 1127 * @param int $uid 用户ID
1026 * @param int $addressId 地址ID 1128 * @param int $addressId 地址ID
1027 * @return array 1129 * @return array
@@ -1134,8 +1236,7 @@ class CartModel @@ -1134,8 +1236,7 @@ class CartModel
1134 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. 1236 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
1135 if (empty($result)) { 1237 if (empty($result)) {
1136 $result = Cache::get($key, 'slave'); 1238 $result = Cache::get($key, 'slave');
1137 - }  
1138 - // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 1239 + } // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
1139 else { 1240 else {
1140 Cache::set($key, $result, 3600); // 缓存1小时 1241 Cache::set($key, $result, 3600); // 缓存1小时
1141 } 1242 }
@@ -1146,7 +1247,7 @@ class CartModel @@ -1146,7 +1247,7 @@ class CartModel
1146 1247
1147 /** 1248 /**
1148 * 获取用户的优惠券列表 1249 * 获取用户的优惠券列表
1149 - * 1250 + *
1150 * @param int $uid 用户ID 1251 * @param int $uid 用户ID
1151 * @param int $valid 控制是否返回已失效的券, 为true时不返回, false时返回 1252 * @param int $valid 控制是否返回已失效的券, 为true时不返回, false时返回
1152 * @return array 1253 * @return array
@@ -1163,7 +1264,7 @@ class CartModel @@ -1163,7 +1264,7 @@ class CartModel
1163 /* 调用接口, 获取优惠券 */ 1264 /* 调用接口, 获取优惠券 */
1164 $couponList = CartData::getListCoupon($uid); 1265 $couponList = CartData::getListCoupon($uid);
1165 $build = array(); 1266 $build = array();
1166 - 1267 +
1167 //不可用优惠券 1268 //不可用优惠券
1168 if (isset($couponList['data']['unusable_coupons'])) { 1269 if (isset($couponList['data']['unusable_coupons'])) {
1169 foreach ($couponList['data']['unusable_coupons'] as $value) { 1270 foreach ($couponList['data']['unusable_coupons'] as $value) {
@@ -1192,7 +1293,7 @@ class CartModel @@ -1192,7 +1293,7 @@ class CartModel
1192 1293
1193 /** 1294 /**
1194 * 检查用户是否收藏这一批商品 1295 * 检查用户是否收藏这一批商品
1195 - * 1296 + *
1196 * @param int $uid 用户ID 1297 * @param int $uid 用户ID
1197 * @param array $skuList 商品SKU列表 1298 * @param array $skuList 商品SKU列表
1198 * @return array 1299 * @return array
@@ -1222,7 +1323,7 @@ class CartModel @@ -1222,7 +1323,7 @@ class CartModel
1222 1323
1223 /** 1324 /**
1224 * 获取购物车总数 1325 * 获取购物车总数
1225 - * 1326 + *
1226 * @param int $uid 用户ID 1327 * @param int $uid 用户ID
1227 * @param string $shoppingKey 客户端购物标识 1328 * @param string $shoppingKey 客户端购物标识
1228 * @return array 1329 * @return array
@@ -1234,7 +1335,7 @@ class CartModel @@ -1234,7 +1335,7 @@ class CartModel
1234 1335
1235 /** 1336 /**
1236 * 追加商品 1337 * 追加商品
1237 - * 1338 + *
1238 * @param array $source 1339 * @param array $source
1239 * @param array $data 1340 * @param array $data
1240 * @param int $index 1341 * @param int $index
@@ -1252,7 +1353,7 @@ class CartModel @@ -1252,7 +1353,7 @@ class CartModel
1252 1353
1253 /** 1354 /**
1254 * 获取商品总价 1355 * 获取商品总价
1255 - * 1356 + *
1256 * @param array $promotionList 短语信息 1357 * @param array $promotionList 短语信息
1257 * @param int $default 默认值 1358 * @param int $default 默认值
1258 * @return float 1359 * @return float
@@ -1278,7 +1379,7 @@ class CartModel @@ -1278,7 +1379,7 @@ class CartModel
1278 1379
1279 /** 1380 /**
1280 * 构建促销短语数据 1381 * 构建促销短语数据
1281 - * 1382 + *
1282 * @param array $promotionInfo 促销信息 1383 * @param array $promotionInfo 促销信息
1283 * @return array 1384 * @return array
1284 */ 1385 */
@@ -176,6 +176,25 @@ class IndexController extends WebAction @@ -176,6 +176,25 @@ class IndexController extends WebAction
176 } 176 }
177 177
178 /** 178 /**
  179 + * 为你优选商品异步请求
  180 + */
  181 + public function getRecommendProductAction()
  182 + {
  183 + $result = array('code' => 200, 'data' => array(), 'message' => '为你优选');
  184 +
  185 + if ($this->isAjax()) {
  186 + $channel = Helpers::getChannelNameByCookie();
  187 + $uid = $this->getUid(false);
  188 + $udid = $uid . $this->getUdid();
  189 + $page = $this->get('page', 1);
  190 +
  191 + $result = CartModel::getRecommendProduct($channel, $uid, $udid, $page);
  192 + }
  193 +
  194 + $this->echoJson($result);
  195 + }
  196 +
  197 + /**
179 * 最近浏览的商品异步请求 198 * 最近浏览的商品异步请求
180 */ 199 */
181 public function getHistroyProductAction() 200 public function getHistroyProductAction()
@@ -183,7 +202,8 @@ class IndexController extends WebAction @@ -183,7 +202,8 @@ class IndexController extends WebAction
183 $result = array('code' => 200, 'data' => array(), 'message' => '浏览记录'); 202 $result = array('code' => 200, 'data' => array(), 'message' => '浏览记录');
184 203
185 // 按照产品把明扬的指示,去掉最近浏览记录 204 // 按照产品把明扬的指示,去掉最近浏览记录
186 - $this->echoJson($result); exit(); 205 + $this->echoJson($result);
  206 + exit();
187 207
188 do { 208 do {
189 if (!$this->isAjax()) { 209 if (!$this->isAjax()) {
@@ -204,8 +224,7 @@ class IndexController extends WebAction @@ -204,8 +224,7 @@ class IndexController extends WebAction
204 } 224 }
205 $sknList = explode(',', rawurldecode($sknList)); 225 $sknList = explode(',', rawurldecode($sknList));
206 $result = CartModel::getNamedBrowseProduct($page, 6, $sknList); 226 $result = CartModel::getNamedBrowseProduct($page, 6, $sknList);
207 - }  
208 - while (false); 227 + } while (false);
209 228
210 $this->echoJson($result); 229 $this->echoJson($result);
211 } 230 }
@@ -458,14 +477,13 @@ class IndexController extends WebAction @@ -458,14 +477,13 @@ class IndexController extends WebAction
458 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); 477 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
459 // 判断是否下单成功 478 // 判断是否下单成功
460 if (empty($result['data']['order_code'])) { 479 if (empty($result['data']['order_code'])) {
461 - UdpLog::info('【结算信息】判断是否下单成功','order_code'.$result['data']['order_code']); 480 + UdpLog::info('【结算信息】判断是否下单成功', 'order_code' . $result['data']['order_code']);
462 break; 481 break;
463 } 482 }
464 483
465 // 跳转到支付的URL链接 484 // 跳转到支付的URL链接
466 $result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code'])); 485 $result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code']));
467 - }  
468 - while (false); 486 + } while (false);
469 487
470 $this->echoJson($result); 488 $this->echoJson($result);
471 } 489 }
@@ -523,10 +541,10 @@ class IndexController extends WebAction @@ -523,10 +541,10 @@ class IndexController extends WebAction
523 $uid = $this->getUid(); 541 $uid = $this->getUid();
524 $vipLevel = -1; 542 $vipLevel = -1;
525 $data = array(); 543 $data = array();
526 - if(!empty($this->_vip)) { 544 + if (!empty($this->_vip)) {
527 $vipLevel = Helpers::getVipLevel($this->_vip); 545 $vipLevel = Helpers::getVipLevel($this->_vip);
528 } 546 }
529 - if(!empty($productId)) { 547 + if (!empty($productId)) {
530 $data = Product\ItemModel::getCartProductInfo($productId, $uid, $vipLevel); 548 $data = Product\ItemModel::getCartProductInfo($productId, $uid, $vipLevel);
531 } 549 }
532 $this->_view->display('goods-detail', $data); 550 $this->_view->display('goods-detail', $data);
@@ -31,9 +31,30 @@ class IndexController extends WebAction @@ -31,9 +31,30 @@ class IndexController extends WebAction
31 'name' => '个人中心' 31 'name' => '个人中心'
32 ), 32 ),
33 ); 33 );
34 - $leftNav = UserModel::getCenterLeftNav('',$uid); 34 + $leftNav = UserModel::getCenterLeftNav('', $uid);
35 $data = IndexModel::homeData(); 35 $data = IndexModel::homeData();
36 $udid = $uid . $this->getUdid(); 36 $udid = $uid . $this->getUdid();
  37 +
  38 + $channelNum = 1;
  39 + switch ($channel) {
  40 + case 'boys':
  41 + $channelNum = 1;
  42 + break;
  43 + case 'girls':
  44 + $channelNum = 2;
  45 + break;
  46 + case 'kids':
  47 + $channelNum = 3;
  48 + break;
  49 + case 'lifestyle':
  50 + $channelNum = 4;
  51 + break;
  52 + default:
  53 + break;
  54 + }
  55 + // 为你优选 tar add 160701
  56 + $data['recommend'] = IndexModel::preferenceData($channelNum, $uid, $udid, '100004', 30);
  57 +
37 //取消订单原因列表 58 //取消订单原因列表
38 $resons = OrderData::closeReasons(); 59 $resons = OrderData::closeReasons();
39 $cancelReason = isset($resons['data']) ? $resons['data'] : ''; 60 $cancelReason = isset($resons['data']) ? $resons['data'] : '';
@@ -54,10 +75,11 @@ class IndexController extends WebAction @@ -54,10 +75,11 @@ class IndexController extends WebAction
54 'more' => '/brands', 75 'more' => '/brands',
55 'brands' => $data['brand'] 76 'brands' => $data['brand']
56 ), 77 ),
57 - 'newArrival' => $data['new'],  
58 - 'banner' => IndexModel::getFooterBanner() 78 + 'newArrival' => $data['new']
59 ) 79 )
60 ), 80 ),
  81 + 'recommend' => $data['recommend'], //待处理
  82 + 'banner' => IndexModel::getFooterBanner(),
61 'helpUsUrl' => '' 83 'helpUsUrl' => ''
62 ); 84 );
63 $this->_view->display('index', array('meIndexPage' => true, 'me' => $data)); 85 $this->_view->display('index', array('meIndexPage' => true, 'me' => $data));
@@ -274,5 +274,39 @@ class OrdersController extends WebAction @@ -274,5 +274,39 @@ class OrdersController extends WebAction
274 274
275 $this->echoJson($result); 275 $this->echoJson($result);
276 } 276 }
  277 +
  278 + /**
  279 + * 我的订单——再次购买
  280 + */
  281 + public function reAddAction()
  282 + {
  283 + $result = array('code' => 401, 'message' => '商品加入购物车失败', 'data' => '');
  284 +
  285 + do {
  286 + /* 判断是不是AJAX请求 */
  287 + if (!$this->isAjax()) {
  288 + break;
  289 + }
  290 + //获取相关参数
  291 + $uid = $this->getUid(true);
  292 + $orderCode = $this->post('orderCode', '');
  293 + if (!$uid || !$orderCode) {
  294 + $result = array('code' => 400, 'message' => '缺失参数', 'data' => '');
  295 + break;
  296 + }
  297 + $reAddData = OrderData::reAddData($uid, $orderCode);
  298 + if(!isset($reAddData['code']) || $reAddData['code'] != 200){
  299 + break;
  300 + }
  301 + $result = array('code' => 200, 'message' => '商品已重新加入购物车', 'data' => $reAddData['data']);
  302 +
  303 + if (!isset($result['code'])) {
  304 + break;
  305 + }
  306 + }
  307 + while (false);
  308 +
  309 + $this->echoJson($result);
  310 + }
277 311
278 } 312 }