Showing
18 changed files
with
146 additions
and
62 deletions
@@ -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.
static/dist/myohobuy/1.3.11/index.js
deleted
100644 → 0
This diff could not be displayed because it is too large.
static/dist/myohobuy/1.3.11/lib.js
deleted
100644 → 0
This diff could not be displayed because it is too large.
static/dist/myohobuy/1.3.16/index.css
0 → 100644
This diff could not be displayed because it is too large.
static/dist/myohobuy/1.3.16/index.js
0 → 100644
This diff could not be displayed because it is too large.
@@ -718,7 +718,8 @@ require("js/guang/list"); | @@ -718,7 +718,8 @@ require("js/guang/list"); | ||
718 | require("js/guang/detail"); | 718 | require("js/guang/detail"); |
719 | require("js/guang/star-classroom"); | 719 | require("js/guang/star-classroom"); |
720 | require("js/guang/calendar"); | 720 | require("js/guang/calendar"); |
721 | -require("js/guang/collocation-list"); | 721 | +require("js/guang/collocation-list"); |
722 | +require("js/guang/check-top"); | ||
722 | }); | 723 | }); |
723 | define("js/guang/plus-star/list", ["jquery","lazyload","swiper","index"], function(require, exports, module){ | 724 | define("js/guang/plus-star/list", ["jquery","lazyload","swiper","index"], function(require, exports, module){ |
724 | /** | 725 | /** |
@@ -1947,16 +1948,20 @@ $('.add-intimacy').on('touchstart', function(event) { | @@ -1947,16 +1948,20 @@ $('.add-intimacy').on('touchstart', function(event) { | ||
1947 | 1948 | ||
1948 | // 关闭日历弹出窗事件 | 1949 | // 关闭日历弹出窗事件 |
1949 | $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { | 1950 | $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { |
1950 | - $('.pop-intimacy').css({ | ||
1951 | - zIndex: '-1' | ||
1952 | - }).hide(); | ||
1953 | - $('.classroom-mask').css({ | ||
1954 | - zIndex: '-1' | ||
1955 | - }).hide(); | 1951 | + // $('.pop-intimacy').css({ |
1952 | + // zIndex: '-1' | ||
1953 | + // }).hide(); | ||
1954 | + // $('.classroom-mask').css({ | ||
1955 | + // zIndex: '-1' | ||
1956 | + // }).hide(); | ||
1956 | 1957 | ||
1957 | - $('body').css({ | ||
1958 | - overflow: 'visible' | ||
1959 | - }); | 1958 | + // $('body').css({ |
1959 | + // overflow: 'visible' | ||
1960 | + // }); | ||
1961 | + | ||
1962 | + // location.reload(); | ||
1963 | + | ||
1964 | + history.go(0); | ||
1960 | }); | 1965 | }); |
1961 | 1966 | ||
1962 | function setAvatar() { | 1967 | function setAvatar() { |
@@ -2098,7 +2103,7 @@ $(document).ready(function() { | @@ -2098,7 +2103,7 @@ $(document).ready(function() { | ||
2098 | exports.calculateMonthDays = CalendarHandler.calculateMonthDays; | 2103 | exports.calculateMonthDays = CalendarHandler.calculateMonthDays; |
2099 | 2104 | ||
2100 | }); | 2105 | }); |
2101 | -define("js/guang/collocation-list", ["jquery","lazyload"], function(require, exports, module){ | 2106 | +define("js/guang/collocation-list", ["jquery","lazyload","mlellipsis"], function(require, exports, module){ |
2102 | /** | 2107 | /** |
2103 | * 星潮教室-星搭配分页加载 | 2108 | * 星潮教室-星搭配分页加载 |
2104 | * @author: wsl<shuiling.wang@yoho.cn> | 2109 | * @author: wsl<shuiling.wang@yoho.cn> |
@@ -2109,13 +2114,18 @@ var $ = require("jquery"), | @@ -2109,13 +2114,18 @@ var $ = require("jquery"), | ||
2109 | tip = require("js/plugin/tip"), | 2114 | tip = require("js/plugin/tip"), |
2110 | loading = require("js/plugin/loading"), | 2115 | loading = require("js/plugin/loading"), |
2111 | lazyLoad = require("lazyload"), | 2116 | lazyLoad = require("lazyload"), |
2117 | + ellipsis = require("mlellipsis"), | ||
2112 | stopLoading = false; | 2118 | stopLoading = false; |
2113 | 2119 | ||
2114 | var page = 1; | 2120 | var page = 1; |
2115 | 2121 | ||
2122 | +ellipsis.init(); | ||
2123 | + | ||
2116 | $('body').addClass('star-class-body'); | 2124 | $('body').addClass('star-class-body'); |
2117 | 2125 | ||
2118 | function massageAJAX(page) { | 2126 | function massageAJAX(page) { |
2127 | + var $this, $title, $cont; | ||
2128 | + | ||
2119 | loading.showLoadingMask(); | 2129 | loading.showLoadingMask(); |
2120 | $.ajax({ | 2130 | $.ajax({ |
2121 | type: 'GET', | 2131 | type: 'GET', |
@@ -2133,6 +2143,17 @@ function massageAJAX(page) { | @@ -2133,6 +2143,17 @@ function massageAJAX(page) { | ||
2133 | } | 2143 | } |
2134 | 2144 | ||
2135 | $('.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 | + | ||
2136 | loading.hideLoadingMask(); | 2157 | loading.hideLoadingMask(); |
2137 | lazyLoad($('img.lazy')); | 2158 | lazyLoad($('img.lazy')); |
2138 | }, | 2159 | }, |
@@ -2212,14 +2233,53 @@ $(document).on('touchstart', '.collection', function(event) { | @@ -2212,14 +2233,53 @@ $(document).on('touchstart', '.collection', function(event) { | ||
2212 | } | 2233 | } |
2213 | 2234 | ||
2214 | if (code === 201) { | 2235 | if (code === 201) { |
2215 | - window.location = data.data; | 2236 | + if ($('#collocation-link').length <= 0) { |
2237 | + $('body').append('<a href=\'' + data.data + '\' style="display:none;" id="collocation-link">' + | ||
2238 | + '<span class="collocation-link"></span></a>'); | ||
2239 | + } | ||
2240 | + | ||
2241 | + $('.collocation-link').click(); | ||
2216 | } | 2242 | } |
2217 | }, | 2243 | }, |
2218 | error: function() { | 2244 | error: function() { |
2219 | tip.show('网络断开连接了~'); | 2245 | tip.show('网络断开连接了~'); |
2220 | } | 2246 | } |
2221 | }); | 2247 | }); |
2248 | +}); | ||
2249 | + | ||
2222 | }); | 2250 | }); |
2251 | +define("js/guang/check-top", ["jquery"], function(require, exports, module){ | ||
2252 | +/** | ||
2253 | + * 星潮教室-top100 | ||
2254 | + * @author: wsl<shuiling.wang@yoho.cn> | ||
2255 | + * @date: 2016/4/12 | ||
2256 | + */ | ||
2257 | + | ||
2258 | +var $ = require("jquery"); | ||
2259 | + | ||
2260 | +$('body').addClass('star-class-body'); | ||
2261 | + | ||
2262 | +function setAvatar($userAvatar) { | ||
2263 | + var myImage = new Image(), | ||
2264 | + avatar; | ||
2265 | + | ||
2266 | + // 部分老用户没有头像,显示默认头像 | ||
2267 | + avatar = $userAvatar.data('avatar'); | ||
2268 | + myImage.src = avatar; | ||
2269 | + myImage.onload = function() { | ||
2270 | + $userAvatar.css('background-image', 'url(' + avatar + ')'); | ||
2271 | + }; | ||
2272 | +} | ||
2273 | + | ||
2274 | +if ($('.ranking-area li').length > 0) { | ||
2275 | + $.each($('.ranking-area li'), function(key, item) { | ||
2276 | + setAvatar($(item).find('.rank-avatar')); | ||
2277 | + }); | ||
2278 | +} | ||
2279 | + | ||
2280 | +if ($('.user-avatar').attr('data-avatar') !== '') { | ||
2281 | + setAvatar($('.user-avatar')); | ||
2282 | +} | ||
2223 | }); | 2283 | }); |
2224 | define("js/home/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ | 2284 | define("js/home/entry", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){ |
2225 | /** | 2285 | /** |
@@ -11873,11 +11933,15 @@ if (!orderInfo('addressId')) { | @@ -11873,11 +11933,15 @@ if (!orderInfo('addressId')) { | ||
11873 | orderInfo('addressId', $addressWrap.data('id')); | 11933 | orderInfo('addressId', $addressWrap.data('id')); |
11874 | } | 11934 | } |
11875 | 11935 | ||
11876 | -$('.dispatch-mode').on('touchend', 'li', function() { | 11936 | +$('.delivery-id').on('touchend', 'li', function() { |
11877 | orderInfo('deliveryId', $(this).data('id')); | 11937 | orderInfo('deliveryId', $(this).data('id')); |
11878 | orderCompute(); | 11938 | orderCompute(); |
11879 | }); | 11939 | }); |
11880 | 11940 | ||
11941 | +$('.payment-type').on('touchend', 'li', function() { | ||
11942 | + orderInfo('paymentType', $('.icon-cb-radio', this).data('id')); | ||
11943 | +}); | ||
11944 | + | ||
11881 | $('.dispatch-time').on('touchend', 'li', function() { | 11945 | $('.dispatch-time').on('touchend', 'li', function() { |
11882 | orderInfo('deliveryTimeId', $(this).data('id')); | 11946 | orderInfo('deliveryTimeId', $(this).data('id')); |
11883 | }); | 11947 | }); |
@@ -11978,7 +12042,7 @@ function phoneHidden(phone) { | @@ -11978,7 +12042,7 @@ function phoneHidden(phone) { | ||
11978 | 12042 | ||
11979 | $('.info-phone').html(phoneHidden($('.info-phone').html())); | 12043 | $('.info-phone').html(phoneHidden($('.info-phone').html())); |
11980 | 12044 | ||
11981 | -if (orderInfo('address').is_support === 'N') { | 12045 | +if (orderInfo('address') && orderInfo('address').is_support === 'N') { |
11982 | orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id')); | 12046 | orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id')); |
11983 | orderCompute(); | 12047 | orderCompute(); |
11984 | } | 12048 | } |
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 | }); |
@@ -343,7 +347,7 @@ function phoneHidden(phone) { | @@ -343,7 +347,7 @@ function phoneHidden(phone) { | ||
343 | 347 | ||
344 | $('.info-phone').html(phoneHidden($('.info-phone').html())); | 348 | $('.info-phone').html(phoneHidden($('.info-phone').html())); |
345 | 349 | ||
346 | -if (orderInfo('address').is_support === 'N') { | 350 | +if (orderInfo('address') && orderInfo('address').is_support === 'N') { |
347 | orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id')); | 351 | orderInfo('deliveryId', $('.delivery-id .icon-cb-radio').data('id')); |
348 | orderCompute(); | 352 | orderCompute(); |
349 | } | 353 | } |
@@ -8,13 +8,18 @@ var $ = require('jquery'), | @@ -8,13 +8,18 @@ var $ = require('jquery'), | ||
8 | tip = require('../plugin/tip'), | 8 | tip = require('../plugin/tip'), |
9 | loading = require('../plugin/loading'), | 9 | loading = require('../plugin/loading'), |
10 | lazyLoad = require('yoho.lazyload'), | 10 | lazyLoad = require('yoho.lazyload'), |
11 | + ellipsis = require('mlellipsis'), | ||
11 | stopLoading = false; | 12 | stopLoading = false; |
12 | 13 | ||
13 | var page = 1; | 14 | var page = 1; |
14 | 15 | ||
16 | +ellipsis.init(); | ||
17 | + | ||
15 | $('body').addClass('star-class-body'); | 18 | $('body').addClass('star-class-body'); |
16 | 19 | ||
17 | function massageAJAX(page) { | 20 | function massageAJAX(page) { |
21 | + var $this, $title, $cont; | ||
22 | + | ||
18 | loading.showLoadingMask(); | 23 | loading.showLoadingMask(); |
19 | $.ajax({ | 24 | $.ajax({ |
20 | type: 'GET', | 25 | type: 'GET', |
@@ -32,6 +37,17 @@ function massageAJAX(page) { | @@ -32,6 +37,17 @@ function massageAJAX(page) { | ||
32 | } | 37 | } |
33 | 38 | ||
34 | $('.collocation-list').append(data); | 39 | $('.collocation-list').append(data); |
40 | + | ||
41 | + // 限制标题字数 | ||
42 | + $('.cont-area').each(function() { | ||
43 | + $this = $(this); | ||
44 | + $title = $this.find('.title'); | ||
45 | + $cont = $this.find('.cont-txt'); | ||
46 | + | ||
47 | + $title[0].mlellipsis(2); | ||
48 | + $cont[0].mlellipsis(2); | ||
49 | + }); | ||
50 | + | ||
35 | loading.hideLoadingMask(); | 51 | loading.hideLoadingMask(); |
36 | lazyLoad($('img.lazy')); | 52 | lazyLoad($('img.lazy')); |
37 | }, | 53 | }, |
@@ -111,11 +127,16 @@ $(document).on('touchstart', '.collection', function(event) { | @@ -111,11 +127,16 @@ $(document).on('touchstart', '.collection', function(event) { | ||
111 | } | 127 | } |
112 | 128 | ||
113 | if (code === 201) { | 129 | if (code === 201) { |
114 | - window.location = data.data; | 130 | + if ($('#collocation-link').length <= 0) { |
131 | + $('body').append('<a href=\'' + data.data + '\' style="display:none;" id="collocation-link">' + | ||
132 | + '<span class="collocation-link"></span></a>'); | ||
133 | + } | ||
134 | + | ||
135 | + $('.collocation-link').click(); | ||
115 | } | 136 | } |
116 | }, | 137 | }, |
117 | error: function() { | 138 | error: function() { |
118 | tip.show('网络断开连接了~'); | 139 | tip.show('网络断开连接了~'); |
119 | } | 140 | } |
120 | }); | 141 | }); |
121 | -}); | ||
142 | +}); |
@@ -12,4 +12,5 @@ require('./list'); | @@ -12,4 +12,5 @@ require('./list'); | ||
12 | require('./detail'); | 12 | require('./detail'); |
13 | require('./star-classroom'); | 13 | require('./star-classroom'); |
14 | require('./calendar'); | 14 | require('./calendar'); |
15 | -require('./collocation-list'); | ||
15 | +require('./collocation-list'); | ||
16 | +require('./check-top'); |
@@ -251,16 +251,20 @@ $('.add-intimacy').on('touchstart', function(event) { | @@ -251,16 +251,20 @@ $('.add-intimacy').on('touchstart', function(event) { | ||
251 | 251 | ||
252 | // 关闭日历弹出窗事件 | 252 | // 关闭日历弹出窗事件 |
253 | $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { | 253 | $('.pop-intimacy .pop-close, .classroom-mask').on('click', function() { |
254 | - $('.pop-intimacy').css({ | ||
255 | - zIndex: '-1' | ||
256 | - }).hide(); | ||
257 | - $('.classroom-mask').css({ | ||
258 | - zIndex: '-1' | ||
259 | - }).hide(); | 254 | + // $('.pop-intimacy').css({ |
255 | + // zIndex: '-1' | ||
256 | + // }).hide(); | ||
257 | + // $('.classroom-mask').css({ | ||
258 | + // zIndex: '-1' | ||
259 | + // }).hide(); | ||
260 | 260 | ||
261 | - $('body').css({ | ||
262 | - overflow: 'visible' | ||
263 | - }); | 261 | + // $('body').css({ |
262 | + // overflow: 'visible' | ||
263 | + // }); | ||
264 | + | ||
265 | + // location.reload(); | ||
266 | + | ||
267 | + history.go(0); | ||
264 | }); | 268 | }); |
265 | 269 | ||
266 | function setAvatar() { | 270 | function setAvatar() { |
@@ -735,11 +735,6 @@ | @@ -735,11 +735,6 @@ | ||
735 | line-height: 46px; | 735 | line-height: 46px; |
736 | color: #b0b0b0; | 736 | color: #b0b0b0; |
737 | margin-top: 10px; | 737 | margin-top: 10px; |
738 | - overflow : hidden; | ||
739 | - text-overflow: ellipsis; | ||
740 | - display: -webkit-box; | ||
741 | - -webkit-line-clamp: 2; | ||
742 | - -webkit-box-orient: vertical; | ||
743 | } | 738 | } |
744 | 739 | ||
745 | img { | 740 | img { |
@@ -749,16 +744,8 @@ | @@ -749,16 +744,8 @@ | ||
749 | .title { | 744 | .title { |
750 | font-size: 40px; | 745 | font-size: 40px; |
751 | line-height: 48px; | 746 | line-height: 48px; |
752 | - | ||
753 | - a { | ||
754 | - color: #fff; | ||
755 | - width: 100%; | ||
756 | - overflow: hidden; | ||
757 | - text-overflow: ellipsis; | ||
758 | - display: -webkit-box; | ||
759 | - -webkit-line-clamp: 2; | ||
760 | - -webkit-box-orient: vertical; | ||
761 | - } | 747 | + color: #fff; |
748 | + width: 100%; | ||
762 | } | 749 | } |
763 | 750 | ||
764 | .count-area { | 751 | .count-area { |
@@ -890,6 +877,7 @@ | @@ -890,6 +877,7 @@ | ||
890 | text-align: center; | 877 | text-align: center; |
891 | color: #fff; | 878 | color: #fff; |
892 | line-height: 32px; | 879 | line-height: 32px; |
880 | + font-size: 20px; | ||
893 | } | 881 | } |
894 | } | 882 | } |
895 | 883 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <a href="{{url}}"><img class="lazy" src ="" data-original="{{img}}" /></a> | 4 | <a href="{{url}}"><img class="lazy" src ="" data-original="{{img}}" /></a> |
5 | {{/if}} | 5 | {{/if}} |
6 | <div class="cont-area"> | 6 | <div class="cont-area"> |
7 | - <h2 class="title"><a href="{{url}}">{{title}}</a></h2> | 7 | + <a href="{{url}}"><h2 class="title">{{title}}</h2></a> |
8 | <p class="cont-txt">{{content}}</p> | 8 | <p class="cont-txt">{{content}}</p> |
9 | <div class="count-area"> | 9 | <div class="count-area"> |
10 | <span class="time"><i class="iconfont time-ico"></i>{{time}}</span> | 10 | <span class="time"><i class="iconfont time-ico"></i>{{time}}</span> |
@@ -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"></a> | 13 | <a href="/home/helpDetail?code=20111130-152530&caption=如何使用YOHO币支付" class="iconfont nav-home"></a> |
14 | {{/currencyDetailPage}} | 14 | {{/currencyDetailPage}} |
15 | - {{#orderEnsure}} | 15 | + {{#orderDetail}} |
16 | <a href="{{serviceUrl}}" target="_blank" class="iconfont nav-home"></a> | 16 | <a href="{{serviceUrl}}" target="_blank" class="iconfont nav-home"></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); | 371 | + $orderInfo['paymentType'] = isset($orderInfo['paymentType']) ? $orderInfo['paymentType'] : ''; |
372 | + $orderCompute = self::orderCompute($uid, $cartType, $orderInfo['deliveryId'], $orderInfo['paymentType'], $orderInfo['couponCode'], $orderInfo['yohoCoin'], $skuList); | ||
372 | } | 373 | } |
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']; | ||
416 | - | 414 | + if (isset($orderInfo['deliveryId']) && $orderInfo['deliveryId'] === $oneDeliv['id']) { |
415 | + $oneDeliv['isSelected'] = true; | ||
416 | + $isDeliveryId = false; | ||
417 | + } | ||
418 | + | ||
417 | $result['dispatchMode'][$key] = $oneDeliv; | 419 | $result['dispatchMode'][$key] = $oneDeliv; |
418 | } | 420 | } |
419 | - | ||
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 { | 421 | + |
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 |
-
Please register or login to post a comment