Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
15 changed files
with
218 additions
and
151 deletions
@@ -21,3 +21,23 @@ DATA: | @@ -21,3 +21,23 @@ DATA: | ||
21 | --------------- | 21 | --------------- |
22 | {"code":200,"message":"Last Search List.","data":{"product_list":[{"brand_id":144,"market_price":590,"vip_price":0,"sales_price":590,"vip_discount_type":1,"product_id":"150783","max_sort_id":3,"storage_num":38,"product_name":"VANS M JT CARGO\t ","cn_alphabet":"VANSMJTCARGOVN02NJCMA","product_skn":51088175,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207531","color_name":"\u7eff\u8272","color_id":"6","color_code":"#47ba17","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202881","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"},{"brand_id":144,"market_price":490,"vip_price":0,"sales_price":490,"vip_discount_type":1,"product_id":"150781","max_sort_id":3,"storage_num":3,"product_name":"VANS M WARRICK\t ","cn_alphabet":"VANSMWARRICKVN02NIBHH","product_skn":51088174,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207529","color_name":"\u9ed1\u8272","color_id":"2","color_code":"#333333","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202880","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"}],"page_total":2,"total":52,"page":1,"content_code":""},"md5":"b66258633f505562a520e0fccf0b8803"} | 22 | {"code":200,"message":"Last Search List.","data":{"product_list":[{"brand_id":144,"market_price":590,"vip_price":0,"sales_price":590,"vip_discount_type":1,"product_id":"150783","max_sort_id":3,"storage_num":38,"product_name":"VANS M JT CARGO\t ","cn_alphabet":"VANSMJTCARGOVN02NJCMA","product_skn":51088175,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207531","color_name":"\u7eff\u8272","color_id":"6","color_code":"#47ba17","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202881","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"},{"brand_id":144,"market_price":490,"vip_price":0,"sales_price":490,"vip_discount_type":1,"product_id":"150781","max_sort_id":3,"storage_num":3,"product_name":"VANS M WARRICK\t ","cn_alphabet":"VANSMWARRICKVN02NIBHH","product_skn":51088174,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207529","color_name":"\u9ed1\u8272","color_id":"2","color_code":"#333333","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202880","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"}],"page_total":2,"total":52,"page":1,"content_code":""},"md5":"b66258633f505562a520e0fccf0b8803"} |
23 | 23 | ||
24 | + | ||
25 | + | ||
26 | +## 检测是否嵌入APP, APP里直接使用浏览器打开HTML5页面 | ||
27 | + | ||
28 | +URL: | ||
29 | +--------------- | ||
30 | +正式: http://m.yohobuy.com/appembed | ||
31 | +测试: http://buy.test.yoho.cn/appembed | ||
32 | + | ||
33 | +DATA: | ||
34 | +--------------- | ||
35 | +{ | ||
36 | + "open": "Y", | ||
37 | + "url": "http://m.yohobuy.com" | ||
38 | +} | ||
39 | +或 | ||
40 | +{ | ||
41 | + "open": "N", | ||
42 | + "url": "http://m.yohobuy.com" | ||
43 | +} |
@@ -19,7 +19,7 @@ class GradeData | @@ -19,7 +19,7 @@ class GradeData | ||
19 | * @param string $uid 用户id | 19 | * @param string $uid 用户id |
20 | * @return array 接口返回的会员等级数据 | 20 | * @return array 接口返回的会员等级数据 |
21 | */ | 21 | */ |
22 | - public function getGradeData($gender, $channel, $uid) { | 22 | + public static function getGradeData($gender, $channel, $uid) { |
23 | $urlList = array(); | 23 | $urlList = array(); |
24 | //获取会员等级数据 | 24 | //获取会员等级数据 |
25 | $param = Yohobuy::param(); | 25 | $param = Yohobuy::param(); |
@@ -39,4 +39,39 @@ class OrderData | @@ -39,4 +39,39 @@ class OrderData | ||
39 | return Yohobuy::get(Yohobuy::API_URL2, $param); | 39 | return Yohobuy::get(Yohobuy::API_URL2, $param); |
40 | } | 40 | } |
41 | 41 | ||
42 | + /* | ||
43 | + * 取消订单 | ||
44 | + * To change this template file, choose Tools | Templates | ||
45 | + * and open the template in the editor. | ||
46 | + */ | ||
47 | + | ||
48 | + public function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) { | ||
49 | + $param = Yohobuy::param(); | ||
50 | + $param['order_code'] = $order_code; | ||
51 | + $param['uid'] = $uid; | ||
52 | + $param['gender'] = $gender; | ||
53 | + $param['yh_channel'] = $yh_channel; | ||
54 | + $param['method'] = $method; | ||
55 | + $param['client_secret'] = Sign::getSign($param); | ||
56 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
57 | + } | ||
58 | + | ||
59 | + /* | ||
60 | + * 删除订单 | ||
61 | + * To change this template file, choose Tools | Templates | ||
62 | + * and open the template in the editor. | ||
63 | + */ | ||
64 | + | ||
65 | + public function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) { | ||
66 | + $param = Yohobuy::param(); | ||
67 | + $param['order_code'] = $order_code; | ||
68 | + $param['uid'] = $uid; | ||
69 | + $param['gender'] = $gender; | ||
70 | + $param['yh_channel'] = $yh_channel; | ||
71 | + $param['method'] = $method; | ||
72 | + $param['client_secret'] = Sign::getSign($param); | ||
73 | + | ||
74 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
75 | + } | ||
76 | + | ||
42 | } | 77 | } |
@@ -17,6 +17,12 @@ server | @@ -17,6 +17,12 @@ server | ||
17 | allow 172.16.0.0/16; | 17 | allow 172.16.0.0/16; |
18 | deny all; | 18 | deny all; |
19 | 19 | ||
20 | + #检测是否嵌入APP | ||
21 | + location = /appembed { | ||
22 | + default_type application/json; | ||
23 | + return 200 '{"open":"Y","url":"http://m.yohobuy.com"}'; | ||
24 | + } | ||
25 | + | ||
20 | #账号相关 | 26 | #账号相关 |
21 | location = /reg.html { | 27 | location = /reg.html { |
22 | root /Data/code/git/yohobuy/assets; | 28 | root /Data/code/git/yohobuy/assets; |
@@ -20,7 +20,7 @@ goodsSwiper = new Swiper('.banner-swiper', { | @@ -20,7 +20,7 @@ goodsSwiper = new Swiper('.banner-swiper', { | ||
20 | lazyLoadingInPrevNext: true, | 20 | lazyLoadingInPrevNext: true, |
21 | loop: true, | 21 | loop: true, |
22 | paginationClickable: true, | 22 | paginationClickable: true, |
23 | - pagination: '.swiper-pagination', | 23 | + pagination: '.banner-top .pagination-inner', |
24 | nextButton: '.swiper-button-next', | 24 | nextButton: '.swiper-button-next', |
25 | prevButton: '.swiper-button-prev' | 25 | prevButton: '.swiper-button-prev' |
26 | }); | 26 | }); |
1 | var $ = require('jquery'), | 1 | var $ = require('jquery'), |
2 | Hammer = require('yoho.hammer'), | 2 | Hammer = require('yoho.hammer'), |
3 | Swiper = require('yoho.iswiper'), | 3 | Swiper = require('yoho.iswiper'), |
4 | - lazyLoad = require('yoho.lazyload') | ||
5 | - | ||
6 | -loading = require('../../plugin/loading');; | 4 | + lazyLoad = require('yoho.lazyload'), |
5 | + loading = require('../../plugin/loading'); | ||
7 | 6 | ||
8 | var page = 1, | 7 | var page = 1, |
9 | winH, | 8 | winH, |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <ul> | 3 | <ul> |
4 | <li><span>头像</span><span><i class="head-portrait"><img src="{{ head_ico }}"></i></span></li> | 4 | <li><span>头像</span><span><i class="head-portrait"><img src="{{ head_ico }}"></i></span></li> |
5 | <li><span>昵称</span><span>{{ username }}</span></li> | 5 | <li><span>昵称</span><span>{{ username }}</span></li> |
6 | - <li><span>性别</span><span></span></li> | 6 | + <li><span>性别</span><span>{{ gender }}</span></li> |
7 | <li><span>生日</span><span>{{ birthday }}</span></li> | 7 | <li><span>生日</span><span>{{ birthday }}</span></li> |
8 | <li><span>会员等级</span> | 8 | <li><span>会员等级</span> |
9 | <span> | 9 | <span> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <ul class="swiper-wrapper clearfix"> | 3 | <ul class="swiper-wrapper clearfix"> |
4 | {{# tabs}} | 4 | {{# tabs}} |
5 | {{# title}} | 5 | {{# title}} |
6 | - <li class="swiper-slide nav-item"> | 6 | + <li class="swiper-slide nav-item {{#if @first}} active{{/if}}"> |
7 | <span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span> | 7 | <span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span> |
8 | </li> | 8 | </li> |
9 | {{/ title}} | 9 | {{/ title}} |
1 | - | ||
2 | -{{#if hasWxShare}} | ||
3 | - <script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> | ||
4 | -{{/if}} | ||
5 | -{{#if rlsEnv}} | ||
6 | -<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> | ||
7 | -<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | ||
8 | -{{/if}} | ||
9 | -{{#if preEnv}} | ||
10 | -<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script> | ||
11 | -<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script> | ||
12 | -{{/if}} | ||
13 | -{{#if testEnv}} | ||
14 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"></script> | ||
15 | -<script src="http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index-debug.js"></script> | ||
16 | -{{/if}} | ||
17 | -{{#if devEnv}} | ||
18 | -<script src="http://localhost:8000/static/js/sea.js?nowrap"></script> | ||
19 | -<script>seajs.config({base: 'http://localhost:8000/'});</script> | ||
20 | -{{/if}} | ||
21 | - | ||
22 | -<script type="text/javascript"> | ||
23 | - (function(w,d,s,j,f){ | ||
24 | - w['YohoAcquisitionObject']=f; | ||
25 | - w[f]=function(){w[f].p=arguments;}; | ||
26 | - var a=d.createElement(s); | ||
27 | - var m=d.getElementsByTagName(s)[0]; | ||
28 | - a.async=1; | ||
29 | - a.src=j; | ||
30 | - m.parentNode.insertBefore(a,m); | ||
31 | - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.13/yas.js','_yas'); | ||
32 | -</script> | ||
33 | - | ||
34 | -{{> layout/use}} | ||
35 | - | ||
36 | -{{> layout/analysis}} | ||
37 | -</body> | ||
38 | -</html> |
@@ -4,6 +4,7 @@ use Action\AbstractAction; | @@ -4,6 +4,7 @@ use Action\AbstractAction; | ||
4 | use home\GradeModel; | 4 | use home\GradeModel; |
5 | use home\OrderModel; | 5 | use home\OrderModel; |
6 | use Plugin\Helpers; | 6 | use Plugin\Helpers; |
7 | +use LibModels\Wap\Home\OrderData; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 个人中心相关的控制器 | 10 | * 个人中心相关的控制器 |
@@ -42,57 +43,6 @@ class HomeController extends AbstractAction | @@ -42,57 +43,6 @@ class HomeController extends AbstractAction | ||
42 | } | 43 | } |
43 | 44 | ||
44 | /** | 45 | /** |
45 | - * 用户订单 | ||
46 | - */ | ||
47 | - public function ordersAction() | ||
48 | - { | ||
49 | - // 设置网站标题 | ||
50 | - $this->setTitle('我的订单'); | ||
51 | - $this->setNavHeader('我的订单', true, SITE_MAIN); | ||
52 | - | ||
53 | - $uid = $this->getUid(); | ||
54 | - $uid = 8826435; | ||
55 | - $type = $this->get('type', 1); | ||
56 | - | ||
57 | - $order = \Index\UserModel::getUserOrderData($uid, $type); | ||
58 | - | ||
59 | - $order = array( | ||
60 | - 'orders' => array( | ||
61 | - array( | ||
62 | - 'orderNum' => '408539077', | ||
63 | - 'tradingStatus' => '交易成功', | ||
64 | - 'goods' => array( | ||
65 | - array( | ||
66 | - 'id' => 1, | ||
67 | - 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
68 | - 'name' => 'Adidas Originals ZX FLUXM22508', | ||
69 | - 'color' => '黄', | ||
70 | - 'size' => '43', | ||
71 | - 'price' => '699.00', | ||
72 | - 'count' => '2' | ||
73 | - ), | ||
74 | - array( | ||
75 | - 'id' => 1, | ||
76 | - 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
77 | - 'name' => 'B.Duck浴室玩伴mini浮水鸭', | ||
78 | - 'gift' => true, | ||
79 | - 'color' => '黄', | ||
80 | - 'size' => '43', | ||
81 | - 'price' => '0.00', | ||
82 | - 'count' => '1' | ||
83 | - ) | ||
84 | - ), | ||
85 | - 'count' => 2, | ||
86 | - 'sumCost' => '699.00', | ||
87 | - 'unpaid' => true, | ||
88 | - ) | ||
89 | - ) | ||
90 | - ); | ||
91 | - | ||
92 | - $this->_view->display('order', array('order' => $order, 'orderPage' => true)); | ||
93 | - } | ||
94 | - | ||
95 | - /** | ||
96 | * 用户收藏的商品 | 46 | * 用户收藏的商品 |
97 | */ | 47 | */ |
98 | public function favoriteAction() { | 48 | public function favoriteAction() { |
@@ -131,7 +81,7 @@ class HomeController extends AbstractAction | @@ -131,7 +81,7 @@ class HomeController extends AbstractAction | ||
131 | ), | 81 | ), |
132 | 'hasFavBrand' => array( | 82 | 'hasFavBrand' => array( |
133 | '0' => array( | 83 | '0' => array( |
134 | - 'id'=> '1', | 84 | + 'id' => '1', |
135 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | 85 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', |
136 | 'brandName' => 'VANS', | 86 | 'brandName' => 'VANS', |
137 | 'update' => 12, | 87 | 'update' => 12, |
@@ -161,7 +111,7 @@ class HomeController extends AbstractAction | @@ -161,7 +111,7 @@ class HomeController extends AbstractAction | ||
161 | ) | 111 | ) |
162 | ), | 112 | ), |
163 | '1' => array( | 113 | '1' => array( |
164 | - 'id'=> '2', | 114 | + 'id' => '2', |
165 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | 115 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', |
166 | 'brandName' => 'VANS', | 116 | 'brandName' => 'VANS', |
167 | 'update' => 12, | 117 | 'update' => 12, |
@@ -191,7 +141,7 @@ class HomeController extends AbstractAction | @@ -191,7 +141,7 @@ class HomeController extends AbstractAction | ||
191 | ) | 141 | ) |
192 | ), | 142 | ), |
193 | '2' => array( | 143 | '2' => array( |
194 | - 'id'=> '3', | 144 | + 'id' => '3', |
195 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | 145 | 'brandImg' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', |
196 | 'brandName' => 'VANS', | 146 | 'brandName' => 'VANS', |
197 | 'update' => 12, | 147 | 'update' => 12, |
@@ -391,19 +341,19 @@ class HomeController extends AbstractAction | @@ -391,19 +341,19 @@ class HomeController extends AbstractAction | ||
391 | * 意见反馈 | 341 | * 意见反馈 |
392 | */ | 342 | */ |
393 | public function suggestAction() { | 343 | public function suggestAction() { |
344 | + // 设置网站标题 | ||
345 | + $this->setTitle('意见反馈'); | ||
346 | + $this->setNavHeader('意见反馈', true, SITE_MAIN); | ||
347 | + | ||
394 | $udid = $this->getUdid(); | 348 | $udid = $this->getUdid(); |
395 | $page = $this->get('page', 1); | 349 | $page = $this->get('page', 1); |
396 | $limit = $this->get('limit', 30); | 350 | $limit = $this->get('limit', 30); |
397 | 351 | ||
398 | $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); | 352 | $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); |
399 | 353 | ||
400 | - //print_r($suggest); | 354 | + print_r($suggest); |
401 | $this->_view->display('suggest', array( | 355 | $this->_view->display('suggest', array( |
402 | 'suggestPage' => true, //加载js | 356 | 'suggestPage' => true, //加载js |
403 | - 'pageHeader' => array( | ||
404 | - 'navBack' => true, | ||
405 | - 'navTitle' => '意见反馈' | ||
406 | - ), | ||
407 | 'pageFooter' => true, | 357 | 'pageFooter' => true, |
408 | 'suggest' => true, | 358 | 'suggest' => true, |
409 | 'suggestContent' => array( | 359 | 'suggestContent' => array( |
@@ -429,12 +379,10 @@ class HomeController extends AbstractAction | @@ -429,12 +379,10 @@ class HomeController extends AbstractAction | ||
429 | )); | 379 | )); |
430 | } | 380 | } |
431 | 381 | ||
432 | - | ||
433 | /** | 382 | /** |
434 | * 意见反馈-提交表单 | 383 | * 意见反馈-提交表单 |
435 | */ | 384 | */ |
436 | - public function suggest_subAction() | ||
437 | - { | 385 | + public function suggest_subAction() { |
438 | $udid = $this->getUdid(); | 386 | $udid = $this->getUdid(); |
439 | $page = $this->get('page', 1); | 387 | $page = $this->get('page', 1); |
440 | $limit = $this->get('limit', 30); | 388 | $limit = $this->get('limit', 30); |
@@ -452,15 +400,13 @@ class HomeController extends AbstractAction | @@ -452,15 +400,13 @@ class HomeController extends AbstractAction | ||
452 | 'suggestSub' => true, | 400 | 'suggestSub' => true, |
453 | 'pageFooter' => true | 401 | 'pageFooter' => true |
454 | )); | 402 | )); |
455 | - | ||
456 | } | 403 | } |
457 | 404 | ||
458 | /** | 405 | /** |
459 | * 异步保存意见反馈数据 | 406 | * 异步保存意见反馈数据 |
460 | */ | 407 | */ |
461 | - public function savesuggestAction() | ||
462 | - { | ||
463 | - if($this->isAjax()) { | 408 | + public function savesuggestAction() { |
409 | + if ($this->isAjax()) { | ||
464 | $uid = $this->getUid(); | 410 | $uid = $this->getUid(); |
465 | $content = $this->post('content', ''); | 411 | $content = $this->post('content', ''); |
466 | $suggest_type = $this->get('suggest_type', 2); | 412 | $suggest_type = $this->get('suggest_type', 2); |
@@ -491,6 +437,7 @@ class HomeController extends AbstractAction | @@ -491,6 +437,7 @@ class HomeController extends AbstractAction | ||
491 | /* | 437 | /* |
492 | * 会员特权查看页 | 438 | * 会员特权查看页 |
493 | */ | 439 | */ |
440 | + | ||
494 | public function preferentialAction() { | 441 | public function preferentialAction() { |
495 | //设置网站seo信息 | 442 | //设置网站seo信息 |
496 | $this->setTitle('会员等级'); | 443 | $this->setTitle('会员等级'); |
@@ -507,7 +454,24 @@ class HomeController extends AbstractAction | @@ -507,7 +454,24 @@ class HomeController extends AbstractAction | ||
507 | /* | 454 | /* |
508 | * 我的订单页面 | 455 | * 我的订单页面 |
509 | */ | 456 | */ |
510 | - public function orderAction() { | 457 | + public function orderAction(){ |
458 | + $type = $this -> get('type',1); | ||
459 | + $data = OrderModel::getNavs($type); | ||
460 | + if(!empty($data)){ | ||
461 | + $order['navs'] = $data; | ||
462 | + } | ||
463 | + $this->_view->display('order', array( | ||
464 | + 'order' => $order | ||
465 | + )); | ||
466 | + } | ||
467 | + | ||
468 | + | ||
469 | + //ajax请求订单页面 | ||
470 | + public function getOrderAction() { | ||
471 | + //判断是不是ajax请求 | ||
472 | + if (!$this->isAjax()) { | ||
473 | + $this->error(); | ||
474 | + } | ||
511 | //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 | 475 | //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 |
512 | $type = $this->get('type', 1); | 476 | $type = $this->get('type', 1); |
513 | $page = $this->get('page', 1); | 477 | $page = $this->get('page', 1); |
@@ -516,56 +480,71 @@ class HomeController extends AbstractAction | @@ -516,56 +480,71 @@ class HomeController extends AbstractAction | ||
516 | $yh_channel = $this->get('yh_channel', 1); | 480 | $yh_channel = $this->get('yh_channel', 1); |
517 | $uid = $this->getUid(); | 481 | $uid = $this->getUid(); |
518 | $uid = '7566245'; //测试用 | 482 | $uid = '7566245'; //测试用 |
519 | - $this -> setTitle('我的订单'); | ||
520 | - $this -> setNavHeader('我的订单'); | ||
521 | //调用模型层getOrder方法获得并处理数据 | 483 | //调用模型层getOrder方法获得并处理数据 |
522 | $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); | 484 | $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); |
523 | //如果没有订单数据,就给一个随便逛逛链接 | 485 | //如果没有订单数据,就给一个随便逛逛链接 |
486 | + //print_r($data); | ||
524 | $order = array(); | 487 | $order = array(); |
525 | - // if (!empty($data)) { | ||
526 | - // $order['orders'] = $data; | ||
527 | - // } else { | ||
528 | - // $order['walkwayUrl'] = 'http://www.baidu.com'; | ||
529 | - // } | ||
530 | - $order['navs'] = array( | ||
531 | - array( | ||
532 | - 'name' => '全部', | ||
533 | - 'active' => true, | ||
534 | - 'typeId' => '1' | ||
535 | - ), | ||
536 | - array( | ||
537 | - 'name' => '待付款', | ||
538 | - 'typeId' => '2' | ||
539 | - ), | ||
540 | - array( | ||
541 | - 'name' => '待发货', | ||
542 | - 'typeId' => '3' | ||
543 | - ), | ||
544 | - array( | ||
545 | - 'name' => '待收货', | ||
546 | - 'typeId' => '4' | ||
547 | - ) | ||
548 | - ); | 488 | + if (!empty($data)) { |
489 | + $order['orders'] = $data; | ||
490 | + } else { | ||
491 | + $order['walkwayUrl'] = 'http://www.baidu.com'; | ||
492 | + } | ||
549 | //渲染模板 | 493 | //渲染模板 |
550 | - $this->_view->display('order', array( | 494 | + $this->_view->display('orderContent', array( |
551 | 'order' => $order, | 495 | 'order' => $order, |
552 | 'orderPage' => true, | 496 | 'orderPage' => true, |
553 | - 'pageFooter' => true | ||
554 | )); | 497 | )); |
555 | } | 498 | } |
556 | 499 | ||
557 | /* | 500 | /* |
558 | - * 我的订单-处理ajax请求页面(切换订单状态) | 501 | + * 我的订单-取消订单 |
559 | */ | 502 | */ |
560 | - public function getOrdersAction() { | 503 | + |
504 | + public function cancelOrderAction() { | ||
561 | 505 | ||
562 | //判断是不是ajax请求 | 506 | //判断是不是ajax请求 |
563 | if (!$this->isAjax()) { | 507 | if (!$this->isAjax()) { |
564 | $this->error(); | 508 | $this->error(); |
565 | } | 509 | } |
566 | - self::orderAction(); | 510 | + //传入order_code和uid以取消订单 |
511 | + $order_code = $this->get('orderCode'); | ||
512 | + $uid = $this->getUid(); | ||
513 | + $uid = '10267443'; //测试用 | ||
514 | + $gender = Helpers::getGenderByCookie(); | ||
515 | + $yh_channel = $this->get('yh_channel', 1); | ||
516 | + $method = 'app.SpaceOrders.close'; | ||
517 | + $data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method); | ||
518 | + if ($data['code'] == 200) { | ||
519 | + echo $data['message']; | ||
520 | + } | ||
567 | } | 521 | } |
568 | 522 | ||
523 | + /* | ||
524 | + * 我的订单-删除订单 | ||
525 | + */ | ||
526 | + | ||
527 | + public function deleteOrderAction() { | ||
528 | + //判断是不是ajax请求 | ||
529 | + if (!$this->isAjax()) { | ||
530 | + $this->error(); | ||
531 | + } | ||
532 | + //传入order_code和uid以删除订单 | ||
533 | + $order_code = $this->get('orderCode'); | ||
534 | + $uid = $this->getUid(); | ||
535 | + $uid = '10267443'; //测试用 | ||
536 | + $gender = Helpers::getGenderByCookie(); | ||
537 | + $yh_channel = $this->get('yh_channel', 1); | ||
538 | + $method = 'app.SpaceOrders.delOrderByCode'; | ||
539 | + $data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method); | ||
540 | + if ($data['code'] == 200) { | ||
541 | + echo $data['message']; | ||
542 | + } | ||
543 | + } | ||
544 | + | ||
545 | + /** | ||
546 | + * 订单详情页 | ||
547 | + */ | ||
569 | public function orderDetailAction() | 548 | public function orderDetailAction() |
570 | { | 549 | { |
571 | $data = array( | 550 | $data = array( |
@@ -15,7 +15,7 @@ class GradeModel | @@ -15,7 +15,7 @@ class GradeModel | ||
15 | * 获取个人中心-会员等级数据 | 15 | * 获取个人中心-会员等级数据 |
16 | */ | 16 | */ |
17 | 17 | ||
18 | - public function getGrade($gender, $channel, $uid) { | 18 | + public static function getGrade($gender, $channel, $uid) { |
19 | $result = array(); | 19 | $result = array(); |
20 | 20 | ||
21 | if (USE_CACHE) { | 21 | if (USE_CACHE) { |
@@ -27,6 +27,8 @@ class GradeModel | @@ -27,6 +27,8 @@ class GradeModel | ||
27 | } | 27 | } |
28 | //调用接口获取数据 | 28 | //调用接口获取数据 |
29 | $data = GradeData::getGradeData($gender, $channel, $uid); | 29 | $data = GradeData::getGradeData($gender, $channel, $uid); |
30 | + | ||
31 | + if (!empty($data['grade'])) { | ||
30 | switch (intval($data['grade']['current_vip_level'])) { | 32 | switch (intval($data['grade']['current_vip_level'])) { |
31 | case 0://普通会员 | 33 | case 0://普通会员 |
32 | $result['vipGrade']['vip0'] = true; | 34 | $result['vipGrade']['vip0'] = true; |
@@ -60,7 +62,7 @@ class GradeModel | @@ -60,7 +62,7 @@ class GradeModel | ||
60 | $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null); | 62 | $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null); |
61 | //当前vip等级享受的特权 | 63 | //当前vip等级享受的特权 |
62 | $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential']; | 64 | $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential']; |
63 | - | 65 | + } |
64 | 66 | ||
65 | if (USE_CACHE) { | 67 | if (USE_CACHE) { |
66 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. | 68 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. |
@@ -122,4 +122,54 @@ class OrderModel | @@ -122,4 +122,54 @@ class OrderModel | ||
122 | return $arr; | 122 | return $arr; |
123 | } | 123 | } |
124 | 124 | ||
125 | + //根据type值设置nav属性 | ||
126 | + public function getNavs($type){ | ||
127 | + $nav = array( | ||
128 | + array( | ||
129 | + 'name' => '全部', | ||
130 | + 'typeId' => '1' | ||
131 | + ), | ||
132 | + array( | ||
133 | + 'name' => '待付款', | ||
134 | + 'typeId' => '2' | ||
135 | + ), | ||
136 | + array( | ||
137 | + 'name' => '待发货', | ||
138 | + 'typeId' => '3' | ||
139 | + ), | ||
140 | + array( | ||
141 | + 'name' => '待收货', | ||
142 | + 'typeId' => '4' | ||
143 | + ) | ||
144 | + ); | ||
145 | + foreach($nav as $key => $vo){ | ||
146 | + switch ($type) { | ||
147 | + case 1: | ||
148 | + if($vo['typeId'] == 1){ | ||
149 | + $nav[$key]['active'] = true; | ||
150 | + } | ||
151 | + break; | ||
152 | + case 2: | ||
153 | + if($vo['typeId'] == 2){ | ||
154 | + $nav[$key]['active'] = true; | ||
155 | + } | ||
156 | + break; | ||
157 | + case 3: | ||
158 | + if($vo['typeId'] == 3){ | ||
159 | + $nav[$key]['active'] = true; | ||
160 | + } | ||
161 | + break; | ||
162 | + case 4: | ||
163 | + if($vo['typeId'] == 4){ | ||
164 | + $nav[$key]['active'] = true; | ||
165 | + } | ||
166 | + break; | ||
167 | + default: | ||
168 | + break; | ||
169 | + } | ||
170 | + } | ||
171 | + return $nav; | ||
172 | + | ||
173 | + } | ||
174 | + | ||
125 | } | 175 | } |
@@ -33,6 +33,7 @@ class UserModel | @@ -33,6 +33,7 @@ class UserModel | ||
33 | // 处理个人详情数据 | 33 | // 处理个人详情数据 |
34 | if (isset($userData['data']) && !empty($userData['data'])) { | 34 | if (isset($userData['data']) && !empty($userData['data'])) { |
35 | $result = $userData['data']; | 35 | $result = $userData['data']; |
36 | + $result['gender'] = $result['gender'] == 1 ? '男' : '女'; | ||
36 | $result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128); | 37 | $result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128); |
37 | } | 38 | } |
38 | 39 | ||
@@ -291,10 +292,10 @@ class UserModel | @@ -291,10 +292,10 @@ class UserModel | ||
291 | } else if (empty($consignee)) { | 292 | } else if (empty($consignee)) { |
292 | $result['code'] = 403; | 293 | $result['code'] = 403; |
293 | $result['message'] = '请输入收件人姓名'; | 294 | $result['message'] = '请输入收件人姓名'; |
294 | - } else if (!empty($email) && Helpers::verifyEmail($email)) { | 295 | + } else if (!empty($email) && !Helpers::verifyEmail($email)) { |
295 | $result['code'] = 404; | 296 | $result['code'] = 404; |
296 | $result['message'] = '输入的邮箱地址格式不正确'; | 297 | $result['message'] = '输入的邮箱地址格式不正确'; |
297 | - } else if (!empty($mobile) && Helpers::verifyMobile($mobile)) { | 298 | + } else if (!empty($mobile) && !Helpers::verifyMobile($mobile)) { |
298 | $result['code'] = 404; | 299 | $result['code'] = 404; |
299 | $result['message'] = '输入的手机号码格式不正确'; | 300 | $result['message'] = '输入的手机号码格式不正确'; |
300 | } else { | 301 | } else { |
@@ -302,7 +303,8 @@ class UserModel | @@ -302,7 +303,8 @@ class UserModel | ||
302 | $address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code); | 303 | $address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code); |
303 | // 处理返回结果 | 304 | // 处理返回结果 |
304 | if (isset($address['code']) && $address['code'] == 200) { | 305 | if (isset($address['code']) && $address['code'] == 200) { |
305 | - $result = $address['data']; | 306 | + $result['code'] = $address['code']; |
307 | + $result['message'] = $address['message']; | ||
306 | } | 308 | } |
307 | } | 309 | } |
308 | 310 | ||
@@ -348,7 +350,20 @@ class UserModel | @@ -348,7 +350,20 @@ class UserModel | ||
348 | 350 | ||
349 | // 处理意见反馈数据 | 351 | // 处理意见反馈数据 |
350 | if (isset($suggest['data']) && !empty($suggest['data'])) { | 352 | if (isset($suggest['data']) && !empty($suggest['data'])) { |
351 | - $result = $suggest['data']; | 353 | + $one = array(); |
354 | + foreach ($suggest['data']['list'] as $val) { | ||
355 | + $one = array(); | ||
356 | + $one['hasImage'] = $val['has_image']; | ||
357 | + $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240); | ||
358 | + $one['title'] = $val['filter_content']; | ||
359 | + $one['content'] = $val['reply_content']; | ||
360 | + $one['good'] = $val['is_reliable']; | ||
361 | + $one['bad'] = !$val['is_reliable']; | ||
362 | + $one['goodNum'] = $val['reliable']; | ||
363 | + $one['badNum'] = $val['unreliable']; | ||
364 | + | ||
365 | + $result[] = $one; | ||
366 | + } | ||
352 | } | 367 | } |
353 | 368 | ||
354 | return $result; | 369 | return $result; |
@@ -112,7 +112,6 @@ class NewsaleController extends AbstractAction | @@ -112,7 +112,6 @@ class NewsaleController extends AbstractAction | ||
112 | $gender = Helpers::getGenderByCookie(); | 112 | $gender = Helpers::getGenderByCookie(); |
113 | $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page); | 113 | $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page); |
114 | } | 114 | } |
115 | - | ||
116 | if (empty($result)) { | 115 | if (empty($result)) { |
117 | echo ' '; | 116 | echo ' '; |
118 | } else { | 117 | } else { |
-
Please register or login to post a comment