Authored by Rock Zhang

Merge branch 'develop' into test

@@ -212,7 +212,16 @@ class Yohobuy @@ -212,7 +212,16 @@ class Yohobuy
212 unset($data['private_key']); 212 unset($data['private_key']);
213 } 213 }
214 if (!empty($data)) { 214 if (!empty($data)) {
215 - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 215 + // 新加支持application/x-www-form-urlencoded调用方式
  216 + $str = '';
  217 + foreach ($data as $key => $val) {
  218 + $str .= $key . '=' . $val . '&';
  219 + }
  220 +
  221 + $str = rtrim($str, '&');
  222 +
  223 +// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  224 + curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
216 } 225 }
217 $result = curl_exec($ch); 226 $result = curl_exec($ch);
218 if (!$returnJson && !empty($result)) { 227 if (!$returnJson && !empty($result)) {
@@ -12,13 +12,27 @@ var goodsSwiper, @@ -12,13 +12,27 @@ var goodsSwiper,
12 $discountFolder = $('.goodsDiscount .discount-folder'), 12 $discountFolder = $('.goodsDiscount .discount-folder'),
13 $discountArrow = $('.goodsDiscount .first-item span'); 13 $discountArrow = $('.goodsDiscount .first-item span');
14 14
15 -var goodsDiscountHammer = new Hammer(document.getElementById('goodsDiscount')); 15 +var goodsDiscountEl = document.getElementById('goodsDiscount'),
  16 + goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
16 17
17 require('./desc'); 18 require('./desc');
18 require('./comments-consults'); 19 require('./comments-consults');
19 20
20 //add extra marign-bottom for footer to show the yoho copyright 21 //add extra marign-bottom for footer to show the yoho copyright
21 -window.reMarginFooter('.cart-bar'); 22 +function showFooter() {
  23 + var $cartBar = $('.cart-bar');
  24 +
  25 + var timer = setInterval(function() {
  26 + if ($cartBar) {
  27 + window.reMarginFooter('.cart-bar');
  28 + clearInterval(timer);
  29 + } else {
  30 + $cartBar = $('.cart-bar');
  31 + }
  32 + }, 200);
  33 +}
  34 +
  35 +showFooter();
22 36
23 lazyLoad($('img.lazy')); 37 lazyLoad($('img.lazy'));
24 38
@@ -40,15 +54,19 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) { @@ -40,15 +54,19 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
40 } 54 }
41 55
42 //goods-discount下拉按钮点击事件 56 //goods-discount下拉按钮点击事件
43 -goodsDiscountHammer.on('tap', function(e) {  
44 - if ($discountFolder.is(':hidden')) {  
45 - $discountArrow.removeClass('icon-down').addClass('icon-up').html('');  
46 - $discountFolder.slideDown();  
47 - } else {  
48 - $discountArrow.removeClass('icon-up').addClass('icon-down').html('');  
49 - $discountFolder.slideUp();  
50 - }  
51 - return false;  
52 -}); 57 +if (goodsDiscountHammer) {
  58 + goodsDiscountHammer.on('tap', function(e) {
  59 + if ($discountFolder.is(':hidden')) {
  60 + $discountArrow.removeClass('icon-down').addClass('icon-up').html('');
  61 + $discountFolder.slideDown();
  62 + } else {
  63 + $discountArrow.removeClass('icon-up').addClass('icon-down').html('');
  64 + $discountFolder.slideUp();
  65 + }
  66 + return false;
  67 + });
  68 +}
  69 +
53 70
54 require('./like'); 71 require('./like');
  72 +
@@ -471,6 +471,7 @@ class HomeController extends AbstractAction @@ -471,6 +471,7 @@ class HomeController extends AbstractAction
471 471
472 $service = array( 472 $service = array(
473 'header' => array('title' => '在线客服'), 473 'header' => array('title' => '在线客服'),
  474 + 'pageFooter' => true,
474 'service' => $service 475 'service' => $service
475 ); 476 );
476 477