Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
15 changed files
with
150 additions
and
57 deletions
@@ -370,7 +370,7 @@ class AbstractAction extends Controller_Abstract | @@ -370,7 +370,7 @@ class AbstractAction extends Controller_Abstract | ||
370 | * 设置网站导航头部信息 | 370 | * 设置网站导航头部信息 |
371 | * | 371 | * |
372 | * @param string $title 头部标题 | 372 | * @param string $title 头部标题 |
373 | - * @param string $backUrl 返回的链接 | 373 | + * @param mixed $backUrl 返回的链接 |
374 | * @param string $homeUrl 返回首页的链接 | 374 | * @param string $homeUrl 返回首页的链接 |
375 | * @return void | 375 | * @return void |
376 | */ | 376 | */ |
@@ -385,6 +385,9 @@ class AbstractAction extends Controller_Abstract | @@ -385,6 +385,9 @@ class AbstractAction extends Controller_Abstract | ||
385 | 385 | ||
386 | if ($backUrl) { | 386 | if ($backUrl) { |
387 | $header['navBack'] = true; | 387 | $header['navBack'] = true; |
388 | + if (is_string($backUrl) && $backUrl != '') { | ||
389 | + $header['backUrl'] = $backUrl; | ||
390 | + } | ||
388 | } | 391 | } |
389 | if (!empty($title)) { | 392 | if (!empty($title)) { |
390 | $header['navTitle'] = $title; | 393 | $header['navTitle'] = $title; |
@@ -18,17 +18,21 @@ class Yohobuy | @@ -18,17 +18,21 @@ class Yohobuy | ||
18 | { | 18 | { |
19 | /* 正式环境 */ | 19 | /* 正式环境 */ |
20 | 20 | ||
21 | - // const API_URL = 'http://api2.open.yohobuy.com/'; | ||
22 | - // const API_URL2 = 'http://api.open.yohobuy.com/'; | ||
23 | - // const SERVICE_URL = 'http://service.api.yohobuy.com/'; | ||
24 | - // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
25 | - // const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/'; | ||
26 | - | ||
27 | - /* 测试环境 */ | ||
28 | - const API_URL = 'http://testapi.yoho.cn:28078/'; | ||
29 | - const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | 21 | +// const API_URL = 'http://api2.open.yohobuy.com/'; |
22 | +// const API_URL2 = 'http://api.open.yohobuy.com/'; | ||
23 | +// const SERVICE_URL = 'http://service.api.yohobuy.com/'; | ||
24 | +// const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
25 | + | ||
26 | + const API_URL = 'http://apih5.yoho.cn/'; | ||
27 | + const API_URL2 = 'http://apih5.yoho.cn/'; | ||
28 | + const SERVICE_URL = 'http://serviceh5.yoho.cn/'; | ||
30 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
31 | 30 | ||
31 | +// /* 测试环境 */ | ||
32 | +// const API_URL = 'http://testapi.yoho.cn:28078/'; | ||
33 | +// const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | ||
34 | +// const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
35 | + | ||
32 | /** | 36 | /** |
33 | * 私钥列表 | 37 | * 私钥列表 |
34 | * | 38 | * |
@@ -212,7 +216,6 @@ class Yohobuy | @@ -212,7 +216,6 @@ class Yohobuy | ||
212 | if (!empty($data)) { | 216 | if (!empty($data)) { |
213 | $str = http_build_query($data, null, '&'); | 217 | $str = http_build_query($data, null, '&'); |
214 | // 新加支持application/x-www-form-urlencoded调用方式 | 218 | // 新加支持application/x-www-form-urlencoded调用方式 |
215 | - | ||
216 | //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); | 219 | //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); |
217 | curl_setopt($ch, CURLOPT_POSTFIELDS, $str); | 220 | curl_setopt($ch, CURLOPT_POSTFIELDS, $str); |
218 | } | 221 | } |
@@ -517,6 +517,52 @@ class Helpers | @@ -517,6 +517,52 @@ class Helpers | ||
517 | } | 517 | } |
518 | 518 | ||
519 | /** | 519 | /** |
520 | + * 订单状态,按订单支付类型和订单状态 | ||
521 | + * @var array | ||
522 | + */ | ||
523 | + public static function getOrderStatus() | ||
524 | + { | ||
525 | + return array( | ||
526 | + '1' => array(//在线支付 | ||
527 | + 0 => '待付款', | ||
528 | + 1 => '已付款', | ||
529 | + 2 => '已付款', | ||
530 | + 3 => '已付款', | ||
531 | + 4 => '已发货', | ||
532 | + 5 => '已发货', | ||
533 | + 6 => '交易成功' | ||
534 | + ), | ||
535 | + '2' => array(//货到付款 | ||
536 | + 0 => '备货中', | ||
537 | + 1 => '已付款', | ||
538 | + 2 => '已付款', | ||
539 | + 3 => '已付款', | ||
540 | + 4 => '已发货', | ||
541 | + 5 => '已发货', | ||
542 | + 6 => '交易成功' | ||
543 | + ), | ||
544 | + '3' => array(//现金支付 | ||
545 | + 0 => '待付款', | ||
546 | + 1 => '已付款', | ||
547 | + 2 => '已付款', | ||
548 | + 3 => '已付款', | ||
549 | + 4 => '已发货', | ||
550 | + 5 => '已发货', | ||
551 | + 6 => '交易成功' | ||
552 | + ), | ||
553 | + '4' => array(//抵消支付 | ||
554 | + 0 => '待付款', | ||
555 | + 1 => '已付款', | ||
556 | + 2 => '已付款', | ||
557 | + 3 => '已付款', | ||
558 | + 4 => '已发货', | ||
559 | + 5 => '已发货', | ||
560 | + 6 => '交易成功' | ||
561 | + ) | ||
562 | + ); | ||
563 | + } | ||
564 | + | ||
565 | + /** | ||
520 | * 获取会员的级别 | 566 | * 获取会员的级别 |
521 | * | 567 | * |
522 | * @param string $vipInfo | 568 | * @param string $vipInfo |
@@ -2816,10 +2816,10 @@ $loginBtn.on('touchstart', function() { | @@ -2816,10 +2816,10 @@ $loginBtn.on('touchstart', function() { | ||
2816 | dataType: 'jsonp' | 2816 | dataType: 'jsonp' |
2817 | }); | 2817 | }); |
2818 | 2818 | ||
2819 | - //1s后跳转页面 | 2819 | + //2s后跳转页面 |
2820 | setTimeout(function() { | 2820 | setTimeout(function() { |
2821 | location.href = res.href; | 2821 | location.href = res.href; |
2822 | - }, 1000); | 2822 | + }, 2000); |
2823 | } else { | 2823 | } else { |
2824 | showErrTip(data.message); | 2824 | showErrTip(data.message); |
2825 | } | 2825 | } |
@@ -2948,10 +2948,10 @@ $loginBtn.on('touchstart', function() { | @@ -2948,10 +2948,10 @@ $loginBtn.on('touchstart', function() { | ||
2948 | dataType: 'jsonp' | 2948 | dataType: 'jsonp' |
2949 | }); | 2949 | }); |
2950 | 2950 | ||
2951 | - //1000ms后跳转页面 | 2951 | + //2000ms后跳转页面 |
2952 | setTimeout(function() { | 2952 | setTimeout(function() { |
2953 | location.href = res.href; | 2953 | location.href = res.href; |
2954 | - }, 1000); | 2954 | + }, 2000); |
2955 | } else { | 2955 | } else { |
2956 | showErrTip(data.message); | 2956 | showErrTip(data.message); |
2957 | } | 2957 | } |
@@ -5154,7 +5154,8 @@ $consultForm.on('submit', function() { | @@ -5154,7 +5154,8 @@ $consultForm.on('submit', function() { | ||
5154 | isSubmiting = false; | 5154 | isSubmiting = false; |
5155 | loading.hideLoadingMask(); | 5155 | loading.hideLoadingMask(); |
5156 | } else { | 5156 | } else { |
5157 | - window.history.go(-1); | 5157 | + tip.show('提交成功~'); |
5158 | + setTimeout(window.history.go(-1), 3000); | ||
5158 | } | 5159 | } |
5159 | }).fail(function() { | 5160 | }).fail(function() { |
5160 | tip.show('网络出了点问题~'); | 5161 | tip.show('网络出了点问题~'); |
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.
@@ -73,6 +73,8 @@ $loginBtn.on('touchstart', function() { | @@ -73,6 +73,8 @@ $loginBtn.on('touchstart', function() { | ||
73 | return; | 73 | return; |
74 | } | 74 | } |
75 | 75 | ||
76 | + $loginBtn.text('正在登录...').addClass('disable'); | ||
77 | + | ||
76 | if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) { | 78 | if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) { |
77 | $.ajax({ | 79 | $.ajax({ |
78 | type: 'POST', | 80 | type: 'POST', |
@@ -83,7 +85,8 @@ $loginBtn.on('touchstart', function() { | @@ -83,7 +85,8 @@ $loginBtn.on('touchstart', function() { | ||
83 | password: pwd | 85 | password: pwd |
84 | }, | 86 | }, |
85 | success: function(data) { | 87 | success: function(data) { |
86 | - var res; | 88 | + var res, |
89 | + time; | ||
87 | 90 | ||
88 | if (data.code === 200) { | 91 | if (data.code === 200) { |
89 | res = data.data; | 92 | res = data.data; |
@@ -91,19 +94,32 @@ $loginBtn.on('touchstart', function() { | @@ -91,19 +94,32 @@ $loginBtn.on('touchstart', function() { | ||
91 | 94 | ||
92 | $.ajax({ | 95 | $.ajax({ |
93 | url: res.session, | 96 | url: res.session, |
94 | - dataType: 'jsonp' | 97 | + dataType: 'jsonp', |
98 | + success: function() { | ||
99 | + clearTimeout(time); | ||
100 | + | ||
101 | + //Cookie写入成功后,1s后跳转页面 | ||
102 | + setTimeout(function() { | ||
103 | + location.href = res.href; | ||
104 | + }, 1000); | ||
105 | + } | ||
95 | }); | 106 | }); |
96 | 107 | ||
97 | - //1000ms后跳转页面 | ||
98 | - setTimeout(function() { | 108 | + //3秒后强制跳转 |
109 | + time = setTimeout(function() { | ||
99 | location.href = res.href; | 110 | location.href = res.href; |
100 | - }, 1000); | 111 | + }, 3000); |
112 | + | ||
113 | + showErrTip('登录成功'); | ||
101 | } else { | 114 | } else { |
102 | showErrTip(data.message); | 115 | showErrTip(data.message); |
103 | } | 116 | } |
104 | }, | 117 | }, |
105 | error: function() { | 118 | error: function() { |
106 | showErrTip('网络断开连接啦~'); | 119 | showErrTip('网络断开连接啦~'); |
120 | + }, | ||
121 | + complete: function() { | ||
122 | + $loginBtn.text('登录').removeClass('disable'); | ||
107 | } | 123 | } |
108 | }); | 124 | }); |
109 | } else { | 125 | } else { |
@@ -76,6 +76,8 @@ $loginBtn.on('touchstart', function() { | @@ -76,6 +76,8 @@ $loginBtn.on('touchstart', function() { | ||
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | 78 | ||
79 | + $loginBtn.text('正在登录...').addClass('disable'); | ||
80 | + | ||
79 | //验证账号(数字或者邮箱)和密码合理性 | 81 | //验证账号(数字或者邮箱)和密码合理性 |
80 | if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) { | 82 | if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) { |
81 | $.ajax({ | 83 | $.ajax({ |
@@ -86,28 +88,40 @@ $loginBtn.on('touchstart', function() { | @@ -86,28 +88,40 @@ $loginBtn.on('touchstart', function() { | ||
86 | password: pwd | 88 | password: pwd |
87 | }, | 89 | }, |
88 | success: function(data) { | 90 | success: function(data) { |
89 | - var res; | 91 | + var res, |
92 | + time; | ||
90 | 93 | ||
91 | if (data.code === 200) { | 94 | if (data.code === 200) { |
92 | res = data.data; | 95 | res = data.data; |
93 | 96 | ||
94 | - showErrTip('登录成功'); | ||
95 | - | ||
96 | $.ajax({ | 97 | $.ajax({ |
97 | url: res.session, | 98 | url: res.session, |
98 | - dataType: 'jsonp' | 99 | + dataType: 'jsonp', |
100 | + success: function() { | ||
101 | + clearTimeout(time); | ||
102 | + | ||
103 | + //Cookie写入成功后,1s后跳转页面 | ||
104 | + setTimeout(function() { | ||
105 | + location.href = res.href; | ||
106 | + }, 1000); | ||
107 | + } | ||
99 | }); | 108 | }); |
100 | 109 | ||
101 | - //1s后跳转页面 | ||
102 | - setTimeout(function() { | 110 | + //3秒后强制跳转 |
111 | + time = setTimeout(function() { | ||
103 | location.href = res.href; | 112 | location.href = res.href; |
104 | - }, 1000); | 113 | + }, 3000); |
114 | + | ||
115 | + showErrTip('登录成功'); | ||
105 | } else { | 116 | } else { |
106 | showErrTip(data.message); | 117 | showErrTip(data.message); |
107 | } | 118 | } |
108 | }, | 119 | }, |
109 | error: function() { | 120 | error: function() { |
110 | showErrTip('网络断开连接啦~'); | 121 | showErrTip('网络断开连接啦~'); |
122 | + }, | ||
123 | + complete: function() { | ||
124 | + $loginBtn.text('登录').removeClass('disable'); | ||
111 | } | 125 | } |
112 | }); | 126 | }); |
113 | } else { | 127 | } else { |
@@ -67,7 +67,9 @@ $consultForm.on('submit', function() { | @@ -67,7 +67,9 @@ $consultForm.on('submit', function() { | ||
67 | loading.hideLoadingMask(); | 67 | loading.hideLoadingMask(); |
68 | } else { | 68 | } else { |
69 | tip.show('提交成功~'); | 69 | tip.show('提交成功~'); |
70 | - setTimeout(window.history.go(-1), 3000); | 70 | + setTimeout(function() { |
71 | + window.history.go(-1); | ||
72 | + }, 3000); | ||
71 | } | 73 | } |
72 | }).fail(function() { | 74 | }).fail(function() { |
73 | tip.show('网络出了点问题~'); | 75 | tip.show('网络出了点问题~'); |
@@ -636,14 +636,15 @@ class HomeController extends AbstractAction | @@ -636,14 +636,15 @@ class HomeController extends AbstractAction | ||
636 | * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) | 636 | * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) |
637 | * | 637 | * |
638 | */ | 638 | */ |
639 | - | ||
640 | public function ordersAction() | 639 | public function ordersAction() |
641 | { | 640 | { |
642 | // 审判跳转登录页 | 641 | // 审判跳转登录页 |
643 | $this->auditJumpLogin(); | 642 | $this->auditJumpLogin(); |
644 | 643 | ||
644 | + $backUrl = Helpers::url('/home'); | ||
645 | + | ||
645 | $this->setTitle('我的订单'); | 646 | $this->setTitle('我的订单'); |
646 | - $this->setNavHeader('我的订单'); | 647 | + $this->setNavHeader('我的订单', $backUrl); |
647 | 648 | ||
648 | $order = array(); | 649 | $order = array(); |
649 | //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 | 650 | //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 |
@@ -772,14 +773,13 @@ class HomeController extends AbstractAction | @@ -772,14 +773,13 @@ class HomeController extends AbstractAction | ||
772 | /* | 773 | /* |
773 | * 我的订单-付款跳转页 | 774 | * 我的订单-付款跳转页 |
774 | */ | 775 | */ |
775 | - | ||
776 | public function payAction() | 776 | public function payAction() |
777 | { | 777 | { |
778 | // 审判跳转登录页 | 778 | // 审判跳转登录页 |
779 | $this->auditJumpLogin(); | 779 | $this->auditJumpLogin(); |
780 | 780 | ||
781 | - $this->setTitle('支付'); | ||
782 | - $this->setNavHeader('支付'); | 781 | + $this->setTitle('支付中心'); |
782 | + $this->setNavHeader('支付中心'); | ||
783 | 783 | ||
784 | $orderCode = $this->get('order_code'); | 784 | $orderCode = $this->get('order_code'); |
785 | if (empty($orderCode)) { | 785 | if (empty($orderCode)) { |
@@ -793,16 +793,16 @@ class HomeController extends AbstractAction | @@ -793,16 +793,16 @@ class HomeController extends AbstractAction | ||
793 | 'payLink' => Helpers::url('/shopping/pay/index', array('order_code' => $orderCode, 'payment_type' => 18)), | 793 | 'payLink' => Helpers::url('/shopping/pay/index', array('order_code' => $orderCode, 'payment_type' => 18)), |
794 | 'appId' => 'alipay', | 794 | 'appId' => 'alipay', |
795 | 'app' => '支付宝支付', | 795 | 'app' => '支付宝支付', |
796 | - 'hint' => '需下载支付宝客户端', | ||
797 | - 'subHint' => '推荐使用', | 796 | + 'hint' => '支付宝钱包支付', |
797 | + 'subHint' => '推荐支付宝用户使用', | ||
798 | ), | 798 | ), |
799 | 1 => array( | 799 | 1 => array( |
800 | 'appIcon' => '', | 800 | 'appIcon' => '', |
801 | 'payLink' => '', | 801 | 'payLink' => '', |
802 | 'appId' => 'weixin', | 802 | 'appId' => 'weixin', |
803 | 'app' => '微信支付', | 803 | 'app' => '微信支付', |
804 | - 'hint' => '需下载微信客户端', | ||
805 | - 'subHint' => '推荐使用', | 804 | + 'hint' => '需安装微信客户端', |
805 | + 'subHint' => '', | ||
806 | ), | 806 | ), |
807 | ), | 807 | ), |
808 | 'orderCode' => $orderCode, | 808 | 'orderCode' => $orderCode, |
@@ -61,17 +61,23 @@ class OrderModel | @@ -61,17 +61,23 @@ class OrderModel | ||
61 | { | 61 | { |
62 | $result = array(); | 62 | $result = array(); |
63 | //调用接口获得数据 | 63 | //调用接口获得数据 |
64 | - $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid); | 64 | + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid); |
65 | // 判断是否还有数据, 没有数据则返回空 | 65 | // 判断是否还有数据, 没有数据则返回空 |
66 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { | 66 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { |
67 | return $result; | 67 | return $result; |
68 | } | 68 | } |
69 | //检查数据返回是否正常,正常则处理数据 | 69 | //检查数据返回是否正常,正常则处理数据 |
70 | if (!empty($data['data']['order_list'])) { | 70 | if (!empty($data['data']['order_list'])) { |
71 | + // 订单的状态列表 | ||
72 | + $orderStatus = Helpers::getOrderStatus(); | ||
73 | + | ||
71 | foreach ($data['data']['order_list'] as $key => $vo) { | 74 | foreach ($data['data']['order_list'] as $key => $vo) { |
75 | + if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) { | ||
76 | + $vo['status'] = 1; | ||
77 | + } | ||
72 | //订单号,支付状态,订单商品数量,订单总价格 | 78 | //订单号,支付状态,订单商品数量,订单总价格 |
73 | $result[$key]['orderNum'] = $vo['order_code']; | 79 | $result[$key]['orderNum'] = $vo['order_code']; |
74 | - $result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str']; | 80 | + $result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ]; |
75 | $result[$key]['count'] = count($vo['order_goods']); | 81 | $result[$key]['count'] = count($vo['order_goods']); |
76 | $result[$key]['sumCost'] = $vo['amount']; | 82 | $result[$key]['sumCost'] = $vo['amount']; |
77 | //类内调用格式化订单商品数据方法 | 83 | //类内调用格式化订单商品数据方法 |
@@ -27,7 +27,7 @@ class HomeModel | @@ -27,7 +27,7 @@ class HomeModel | ||
27 | /* 女生楼层资源的位置码 */ | 27 | /* 女生楼层资源的位置码 */ |
28 | const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002'; | 28 | const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002'; |
29 | /* 潮童楼层资源的位置码 */ | 29 | /* 潮童楼层资源的位置码 */ |
30 | - const CODE_FLOOR_KIDS = '66cad79d93e055ad6fc5c8744086066d'; // '66cad79d93e055ad6fc5c8744086066d'; | 30 | + const CODE_FLOOR_KIDS = 'b8c1bff53d4ea60f978926d538620636'; // '66cad79d93e055ad6fc5c8744086066d'; |
31 | /* 创意生活楼层资源的位置码 */ | 31 | /* 创意生活楼层资源的位置码 */ |
32 | const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62'; | 32 | const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62'; |
33 | 33 |
@@ -248,7 +248,7 @@ class UserModel | @@ -248,7 +248,7 @@ class UserModel | ||
248 | $product = array(); | 248 | $product = array(); |
249 | foreach ($val['new_product'] as $one) { | 249 | foreach ($val['new_product'] as $one) { |
250 | $product = array(); | 250 | $product = array(); |
251 | - $product['link'] = isset($val['goodsList'][0]) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsList'][0]['id'] . '/' . $val['cnAlphabet'] . '.html') : ''; | 251 | + $product['link'] = isset($one['goods'][0]) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : ''; |
252 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; | 252 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; |
253 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; | 253 | $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; |
254 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0; | 254 | $product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0; |
@@ -31,7 +31,7 @@ class DetailModel | @@ -31,7 +31,7 @@ class DetailModel | ||
31 | 31 | ||
32 | if (is_numeric($productId) && is_numeric($goodsId)) { | 32 | if (is_numeric($productId) && is_numeric($goodsId)) { |
33 | // 调用服务 | 33 | // 调用服务 |
34 | - $baseInfo = DetailData::baseInfo($productId, $uid); | 34 | + $baseInfo = DetailData::baseInfo($productId, $uid); |
35 | 35 | ||
36 | // 判断商品是否在架 | 36 | // 判断商品是否在架 |
37 | if (empty($baseInfo['status'])) { | 37 | if (empty($baseInfo['status'])) { |
@@ -42,7 +42,7 @@ class DetailModel | @@ -42,7 +42,7 @@ class DetailModel | ||
42 | if (isset($baseInfo['productName'])) { | 42 | if (isset($baseInfo['productName'])) { |
43 | $result['goodsName'] = $baseInfo['productName']; | 43 | $result['goodsName'] = $baseInfo['productName']; |
44 | } | 44 | } |
45 | - | 45 | + |
46 | // 商品促销短语 | 46 | // 商品促销短语 |
47 | if (!empty($baseInfo['salesPhrase'])) { | 47 | if (!empty($baseInfo['salesPhrase'])) { |
48 | $result['goodsSubtitle'] = $baseInfo['salesPhrase']; | 48 | $result['goodsSubtitle'] = $baseInfo['salesPhrase']; |
@@ -141,7 +141,7 @@ class DetailModel | @@ -141,7 +141,7 @@ class DetailModel | ||
141 | $build['time'] = $value['createTime']; | 141 | $build['time'] = $value['createTime']; |
142 | $result['feedbacks']['comments'][] = $build; | 142 | $result['feedbacks']['comments'][] = $build; |
143 | } | 143 | } |
144 | - $result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum'])); | 144 | + //$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum'])); |
145 | } | 145 | } |
146 | 146 | ||
147 | // 品牌信息 | 147 | // 品牌信息 |
@@ -211,12 +211,14 @@ class DetailModel | @@ -211,12 +211,14 @@ class DetailModel | ||
211 | // 悬浮的购物车信息 | 211 | // 悬浮的购物车信息 |
212 | $result['cartInfo'] = array( | 212 | $result['cartInfo'] = array( |
213 | 'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接 | 213 | 'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接 |
214 | - 'addToCartUrl' => Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'), // 加入购物车链接 | ||
215 | 'numInCart' => 0, | 214 | 'numInCart' => 0, |
216 | 'goodsInstore' => $baseInfo['storage'], // 库存量 | 215 | 'goodsInstore' => $baseInfo['storage'], // 库存量 |
217 | 'soldOut' => $baseInfo['storage'] == 0, // 已售磬 | 216 | 'soldOut' => $baseInfo['storage'] == 0, // 已售磬 |
218 | 'notForSale' => $baseInfo['attribute'] == 2, // 非卖品 | 217 | 'notForSale' => $baseInfo['attribute'] == 2, // 非卖品 |
219 | ); | 218 | ); |
219 | + if (!$result['cartInfo']['soldOut'] && !$result['cartInfo']['notForSale']) { | ||
220 | + $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); // 加入购物车链接 | ||
221 | + } | ||
220 | 222 | ||
221 | // 是否收藏 | 223 | // 是否收藏 |
222 | $result['isCollect'] = false; | 224 | $result['isCollect'] = false; |
@@ -289,24 +291,23 @@ class DetailModel | @@ -289,24 +291,23 @@ class DetailModel | ||
289 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); | 291 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); |
290 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); | 292 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); |
291 | $gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3; | 293 | $gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3; |
292 | - $referenceName = '参考尺码'; | ||
293 | - if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference) ) { | 294 | + $referenceName = '参考尺码'; |
295 | + if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) { | ||
294 | $referenceName = '参考尺码'; | 296 | $referenceName = '参考尺码'; |
295 | - } | ||
296 | - elseif ($gender == 3 && $boyReference) { | 297 | + } elseif ($gender == 3 && $boyReference) { |
297 | $referenceName = '参考尺码(男)'; | 298 | $referenceName = '参考尺码(男)'; |
298 | - } | ||
299 | - elseif ($gender == 3 && $girlReference) { | 299 | + } elseif ($gender == 3 && $girlReference) { |
300 | $referenceName = '参考尺码(女)'; | 300 | $referenceName = '参考尺码(女)'; |
301 | } | 301 | } |
302 | - | ||
303 | - $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称 | 302 | + |
303 | + $referenceList = array(); | ||
304 | // 判断是否显示参考尺码 | 304 | // 判断是否显示参考尺码 |
305 | - $showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']); | 305 | + $showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']) && ($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == $gender || $sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == 3); |
306 | if ($showReference) { | 306 | if ($showReference) { |
307 | - $sizeNameList[1] = array('param' => $referenceName); | 307 | + $referenceList[0] = array('param' => $referenceName); |
308 | } | 308 | } |
309 | - $referenceList = array(); | 309 | + |
310 | + $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称 | ||
310 | $sizeBoGroup = array(); // 尺码按ID分组 | 311 | $sizeBoGroup = array(); // 尺码按ID分组 |
311 | foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) { | 312 | foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) { |
312 | $sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']); | 313 | $sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']); |
@@ -416,6 +417,7 @@ class DetailModel | @@ -416,6 +417,7 @@ class DetailModel | ||
416 | '\r\n\t' => '', | 417 | '\r\n\t' => '', |
417 | '</p>' => '', | 418 | '</p>' => '', |
418 | '<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=", | 419 | '<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=", |
420 | + '<img border="0" src=' => "<img border=\"0\" class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=", | ||
419 | )), | 421 | )), |
420 | ); | 422 | ); |
421 | } | 423 | } |
-
Please register or login to post a comment