Authored by 郝肖肖

h5 购物车支付状态

@@ -65,10 +65,8 @@ class Yohobuy @@ -65,10 +65,8 @@ class Yohobuy
65 */ 65 */
66 public static function clientType() 66 public static function clientType()
67 { 67 {
68 -  
69 if(self::isMobile()) { 68 if(self::isMobile()) {
70 return 'h5'; 69 return 'h5';
71 -  
72 } 70 }
73 else { 71 else {
74 return 'web'; 72 return 'web';
@@ -487,7 +485,6 @@ class Yohobuy @@ -487,7 +485,6 @@ class Yohobuy
487 485
488 return $result; 486 return $result;
489 } 487 }
490 -  
491 /** 488 /**
492 * 获取用户User-Agent 489 * 获取用户User-Agent
493 * @return bool 490 * @return bool
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.
@@ -1959,7 +1959,9 @@ $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { @@ -1959,7 +1959,9 @@ $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() {
1959 // overflow: 'visible' 1959 // overflow: 'visible'
1960 // }); 1960 // });
1961 1961
1962 - location.reload(); 1962 + // location.reload();
  1963 +
  1964 + history.go(0);
1963 }); 1965 });
1964 1966
1965 function setAvatar() { 1967 function setAvatar() {
@@ -2101,7 +2103,7 @@ $(document).ready(function() { @@ -2101,7 +2103,7 @@ $(document).ready(function() {
2101 exports.calculateMonthDays = CalendarHandler.calculateMonthDays; 2103 exports.calculateMonthDays = CalendarHandler.calculateMonthDays;
2102 2104
2103 }); 2105 });
2104 -define("js/guang/collocation-list", ["jquery","lazyload"], function(require, exports, module){ 2106 +define("js/guang/collocation-list", ["jquery","lazyload","mlellipsis"], function(require, exports, module){
2105 /** 2107 /**
2106 * 星潮教室-星搭配分页加载 2108 * 星潮教室-星搭配分页加载
2107 * @author: wsl<shuiling.wang@yoho.cn> 2109 * @author: wsl<shuiling.wang@yoho.cn>
@@ -2112,13 +2114,18 @@ var $ = require("jquery"), @@ -2112,13 +2114,18 @@ var $ = require("jquery"),
2112 tip = require("js/plugin/tip"), 2114 tip = require("js/plugin/tip"),
2113 loading = require("js/plugin/loading"), 2115 loading = require("js/plugin/loading"),
2114 lazyLoad = require("lazyload"), 2116 lazyLoad = require("lazyload"),
  2117 + ellipsis = require("mlellipsis"),
2115 stopLoading = false; 2118 stopLoading = false;
2116 2119
2117 var page = 1; 2120 var page = 1;
2118 2121
  2122 +ellipsis.init();
  2123 +
2119 $('body').addClass('star-class-body'); 2124 $('body').addClass('star-class-body');
2120 2125
2121 function massageAJAX(page) { 2126 function massageAJAX(page) {
  2127 + var $this, $title, $cont;
  2128 +
2122 loading.showLoadingMask(); 2129 loading.showLoadingMask();
2123 $.ajax({ 2130 $.ajax({
2124 type: 'GET', 2131 type: 'GET',
@@ -2136,6 +2143,17 @@ function massageAJAX(page) { @@ -2136,6 +2143,17 @@ function massageAJAX(page) {
2136 } 2143 }
2137 2144
2138 $('.collocation-list').append(data); 2145 $('.collocation-list').append(data);
  2146 +
  2147 + // 限制标题字数
  2148 + $('.cont-area').each(function() {
  2149 + $this = $(this);
  2150 + $title = $this.find('.title');
  2151 + $cont = $this.find('.cont-txt');
  2152 +
  2153 + $title[0].mlellipsis(2);
  2154 + $cont[0].mlellipsis(2);
  2155 + });
  2156 +
2139 loading.hideLoadingMask(); 2157 loading.hideLoadingMask();
2140 lazyLoad($('img.lazy')); 2158 lazyLoad($('img.lazy'));
2141 }, 2159 },
@@ -2223,6 +2241,7 @@ $(document).on('touchstart', '.collection', function(event) { @@ -2223,6 +2241,7 @@ $(document).on('touchstart', '.collection', function(event) {
2223 } 2241 }
2224 }); 2242 });
2225 }); 2243 });
  2244 +
2226 }); 2245 });
2227 define("js/home/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ 2246 define("js/home/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){
2228 /** 2247 /**
@@ -11866,11 +11885,15 @@ if (!orderInfo('addressId')) { @@ -11866,11 +11885,15 @@ if (!orderInfo('addressId')) {
11866 orderInfo('addressId', $addressWrap.data('id')); 11885 orderInfo('addressId', $addressWrap.data('id'));
11867 } 11886 }
11868 11887
11869 -$('.dispatch-mode').on('touchend', 'li', function() { 11888 +$('.delivery-id').on('touchend', 'li', function() {
11870 orderInfo('deliveryId', $(this).data('id')); 11889 orderInfo('deliveryId', $(this).data('id'));
11871 orderCompute(); 11890 orderCompute();
11872 }); 11891 });
11873 11892
  11893 +$('.payment-type').on('touchend', 'li', function() {
  11894 + orderInfo('paymentType', $('.icon-cb-radio', this).data('id'));
  11895 +});
  11896 +
11874 $('.dispatch-time').on('touchend', 'li', function() { 11897 $('.dispatch-time').on('touchend', 'li', function() {
11875 orderInfo('deliveryTimeId', $(this).data('id')); 11898 orderInfo('deliveryTimeId', $(this).data('id'));
11876 }); 11899 });
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -238,11 +238,15 @@ if (!orderInfo('addressId')) { @@ -238,11 +238,15 @@ if (!orderInfo('addressId')) {
238 orderInfo('addressId', $addressWrap.data('id')); 238 orderInfo('addressId', $addressWrap.data('id'));
239 } 239 }
240 240
241 -$('.dispatch-mode').on('touchend', 'li', function() { 241 +$('.delivery-id').on('touchend', 'li', function() {
242 orderInfo('deliveryId', $(this).data('id')); 242 orderInfo('deliveryId', $(this).data('id'));
243 orderCompute(); 243 orderCompute();
244 }); 244 });
245 245
  246 +$('.payment-type').on('touchend', 'li', function() {
  247 + orderInfo('paymentType', $('.icon-cb-radio', this).data('id'));
  248 +});
  249 +
246 $('.dispatch-time').on('touchend', 'li', function() { 250 $('.dispatch-time').on('touchend', 'li', function() {
247 orderInfo('deliveryTimeId', $(this).data('id')); 251 orderInfo('deliveryTimeId', $(this).data('id'));
248 }); 252 });
@@ -12,9 +12,9 @@ @@ -12,9 +12,9 @@
12 {{#currencyDetailPage}} 12 {{#currencyDetailPage}}
13 <a href="/home/helpDetail?code=20111130-152530&caption=如何使用YOHO币支付" class="iconfont nav-home">&#xe639;</a> 13 <a href="/home/helpDetail?code=20111130-152530&caption=如何使用YOHO币支付" class="iconfont nav-home">&#xe639;</a>
14 {{/currencyDetailPage}} 14 {{/currencyDetailPage}}
15 - {{#orderEnsure}} 15 + {{#orderDetail}}
16 <a href="{{serviceUrl}}" target="_blank" class="iconfont nav-home">&#xe63c;</a> 16 <a href="{{serviceUrl}}" target="_blank" class="iconfont nav-home">&#xe63c;</a>
17 - {{/orderEnsure}} 17 + {{/orderDetail}}
18 {{#navTitle}} 18 {{#navTitle}}
19 <p class="nav-title">{{.}}</p> 19 <p class="nav-title">{{.}}</p>
20 {{/navTitle}} 20 {{/navTitle}}
@@ -368,9 +368,9 @@ class CartModel @@ -368,9 +368,9 @@ class CartModel
368 368
369 // cookie保存的数据 369 // cookie保存的数据
370 if (!empty($orderInfo)) { 370 if (!empty($orderInfo)) {
371 - $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentTypeId'], $orderInfo['couponCode'], $orderInfo['yohoCoin'], $skuList);  
372 - }  
373 371
  372 + $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentType'], $orderInfo['couponCode'], $orderInfo['yohoCoin'], $skuList);
  373 + }
374 // 根据地址id查询地址信息 374 // 根据地址id查询地址信息
375 if (isset($orderInfo['address'])) { 375 if (isset($orderInfo['address'])) {
376 $address = $orderInfo['address']; 376 $address = $orderInfo['address'];
@@ -392,10 +392,9 @@ class CartModel @@ -392,10 +392,9 @@ class CartModel
392 392
393 // 配送方式 393 // 配送方式
394 if (isset($payReturn['delivery_way'])) { 394 if (isset($payReturn['delivery_way'])) {
395 - $idArr = array();  
396 $defaultKey = 0; 395 $defaultKey = 0;
397 $oneDeliv = array(); 396 $oneDeliv = array();
398 - 397 + $isDeliveryId = true;
399 $deliveries = $payReturn['delivery_way']; 398 $deliveries = $payReturn['delivery_way'];
400 if (isset($orderCompute['delivery_way']) && !empty($orderCompute['delivery_way'])) { 399 if (isset($orderCompute['delivery_way']) && !empty($orderCompute['delivery_way'])) {
401 $deliveries = $orderCompute['delivery_way']; 400 $deliveries = $orderCompute['delivery_way'];
@@ -412,15 +411,15 @@ class CartModel @@ -412,15 +411,15 @@ class CartModel
412 $oneDeliv['cost'] = $val['delivery_way_cost']; 411 $oneDeliv['cost'] = $val['delivery_way_cost'];
413 ($val['default'] === 'Y') && $defaultKey = $key; 412 ($val['default'] === 'Y') && $defaultKey = $key;
414 413
415 - $idArr[$key] = $oneDeliv['id']; 414 + if (isset($orderInfo['deliveryId']) && $orderInfo['deliveryId'] === $oneDeliv['id']) {
  415 + $oneDeliv['isSelected'] = true;
  416 + $isDeliveryId = false;
  417 + }
416 418
417 $result['dispatchMode'][$key] = $oneDeliv; 419 $result['dispatchMode'][$key] = $oneDeliv;
418 } 420 }
419 421
420 - if (isset($orderInfo['deliveryId']) && isset($idArr[$orderInfo['deliveryId']])) {  
421 - $flag = array_search($orderInfo['deliveryId'], $idArr);  
422 - $flag !== false && $result['dispatchMode'][$flag]['isSelected'] = true;  
423 - } else { 422 + if ($isDeliveryId) {
424 $result['dispatchMode'][$defaultKey]['isSelected'] = true; 423 $result['dispatchMode'][$defaultKey]['isSelected'] = true;
425 } 424 }
426 } 425 }
@@ -486,6 +485,7 @@ class CartModel @@ -486,6 +485,7 @@ class CartModel
486 // 支付方式 485 // 支付方式
487 if (isset($payReturn['payment_way'])) { 486 if (isset($payReturn['payment_way'])) {
488 $onePay = array(); 487 $onePay = array();
  488 + $isPaymentType = true;
489 foreach ($payReturn['payment_way'] as $pay) { 489 foreach ($payReturn['payment_way'] as $pay) {
490 if ($pay['is_support'] !== 'Y') { 490 if ($pay['is_support'] !== 'Y') {
491 continue; 491 continue;
@@ -497,12 +497,18 @@ class CartModel @@ -497,12 +497,18 @@ class CartModel
497 $onePay['name'] = $pay['payment_type_name']; 497 $onePay['name'] = $pay['payment_type_name'];
498 $onePay['isSupport'] = $pay['is_support'] === 'Y'; 498 $onePay['isSupport'] = $pay['is_support'] === 'Y';
499 // $onePay['default'] = ($pay['default'] === 'Y'); 499 // $onePay['default'] = ($pay['default'] === 'Y');
500 - if ($onePay['paymentType'] == 1) { 500 + if (isset($orderInfo['paymentType']) && $onePay['paymentType'] === $orderInfo['paymentType']) {
501 $onePay['recommend'] = true; 501 $onePay['recommend'] = true;
  502 + $isPaymentType = false;
502 } 503 }
503 504
504 $result['paymentWay'][] = $onePay; 505 $result['paymentWay'][] = $onePay;
505 } 506 }
  507 +
  508 + //默认第一个
  509 + if ($isPaymentType) {
  510 + $result['paymentWay'][0]['recommend'] = true;
  511 + }
506 } 512 }
507 513
508 // 有货币 514 // 有货币
@@ -323,7 +323,6 @@ class IndexController extends AbstractAction @@ -323,7 +323,6 @@ class IndexController extends AbstractAction
323 'isOrdinaryCart' => ($cartType !== 'advance'), 323 'isOrdinaryCart' => ($cartType !== 'advance'),
324 'orderEnsure' => $order 324 'orderEnsure' => $order
325 ); 325 );
326 -  
327 $this->setTitle('确认订单'); 326 $this->setTitle('确认订单');
328 $this->setNavHeader('确认订单', $returnUrl, false); // 不显示右上角home按钮 327 $this->setNavHeader('确认订单', $returnUrl, false); // 不显示右上角home按钮
329 328