Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
18 changed files
with
298 additions
and
173 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 | } |
@@ -70,7 +70,7 @@ class NewSaleProcess | @@ -70,7 +70,7 @@ class NewSaleProcess | ||
70 | $tabItem = array(); | 70 | $tabItem = array(); |
71 | $tabItem['title'] = $one; | 71 | $tabItem['title'] = $one; |
72 | $tabItem['dataId'] = $key; | 72 | $tabItem['dataId'] = $key; |
73 | - if ($key === 1) { | 73 | + if ($key === 0) { |
74 | $tabItem['focus'] = true; | 74 | $tabItem['focus'] = true; |
75 | } | 75 | } |
76 | $result['tabs'][] = $tabItem; | 76 | $result['tabs'][] = $tabItem; |
@@ -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; |
static/img/me/no-order.png
0 → 100644
1.62 KB
static/img/me/vip-se5df70ae85.png
deleted
100644 → 0
8.05 KB
@@ -37,7 +37,7 @@ function getOrders() { | @@ -37,7 +37,7 @@ function getOrders() { | ||
37 | } | 37 | } |
38 | 38 | ||
39 | inAjax = true; | 39 | inAjax = true; |
40 | - loading.show(); | 40 | + loading.showLoadingMask(); |
41 | 41 | ||
42 | $.ajax({ | 42 | $.ajax({ |
43 | type: 'GET', | 43 | type: 'GET', |
@@ -62,7 +62,7 @@ function getOrders() { | @@ -62,7 +62,7 @@ function getOrders() { | ||
62 | } | 62 | } |
63 | 63 | ||
64 | inAjax = false; | 64 | inAjax = false; |
65 | - loading.hide(); | 65 | + loading.hideLoadingMask(); |
66 | } | 66 | } |
67 | }); | 67 | }); |
68 | } | 68 | } |
@@ -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 | -$vip: sprite-map("me/vip/*.png"); | ||
2 | .my-page { | 1 | .my-page { |
3 | background: #f0f0f0; | 2 | background: #f0f0f0; |
4 | 3 | ||
@@ -27,8 +26,8 @@ $vip: sprite-map("me/vip/*.png"); | @@ -27,8 +26,8 @@ $vip: sprite-map("me/vip/*.png"); | ||
27 | 26 | ||
28 | .vip-icon { | 27 | .vip-icon { |
29 | display: inline-block; | 28 | display: inline-block; |
30 | - width: pxToRem(70px); | ||
31 | - height: pxToRem(30px); | 29 | + width: pxToRem(72px); |
30 | + height: pxToRem(32px); | ||
32 | vertical-align: middle; | 31 | vertical-align: middle; |
33 | } | 32 | } |
34 | 33 |
1 | +$vip: sprite-map("me/vip/*.png", $spacing: 10px); | ||
2 | + | ||
1 | @import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service"; | 3 | @import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service"; |
2 | 4 |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | background: #f0f0f0; | 2 | background: #f0f0f0; |
3 | 3 | ||
4 | .order { | 4 | .order { |
5 | + position: relative; | ||
5 | display: block; | 6 | display: block; |
6 | background: #fff; | 7 | background: #fff; |
7 | margin: 30rem / $pxConvertRem 0; | 8 | margin: 30rem / $pxConvertRem 0; |
@@ -64,17 +65,38 @@ | @@ -64,17 +65,38 @@ | ||
64 | } | 65 | } |
65 | 66 | ||
66 | .no-order { | 67 | .no-order { |
68 | + position: absolute; | ||
69 | + background: #fff; | ||
67 | text-align: center; | 70 | text-align: center; |
68 | - color: #f0f0f0; | 71 | + top: 50%; |
72 | + margin-top: -220rem / $pxConvertRem; | ||
73 | + width: 100%; | ||
69 | 74 | ||
70 | - .iconfont { | ||
71 | - font-size: 50px; | 75 | + .icon { |
76 | + width: 153rem / $pxConvertRem; | ||
77 | + height: 196rem / $pxConvertRem; | ||
78 | + background: image-url('me/no-order.png') no-repeat; | ||
79 | + background-size: 100%; | ||
80 | + margin: 0 auto; | ||
81 | + } | ||
82 | + | ||
83 | + span { | ||
84 | + display: block; | ||
85 | + color: #b0b0b0; | ||
86 | + font-size: 24rem / $pxConvertRem; | ||
87 | + margin: 30rem / $pxConvertRem 0 110rem / $pxConvertRem; | ||
72 | } | 88 | } |
73 | 89 | ||
74 | .walk-way { | 90 | .walk-way { |
75 | display: block; | 91 | display: block; |
92 | + height: 80rem / pxConvertRem; | ||
93 | + line-height: 80rem / $pxConvertRem; | ||
94 | + width: 70%; | ||
95 | + margin: 0 auto; | ||
96 | + text-align: center; | ||
97 | + font-size: 30rem / $pxConvertRem; | ||
76 | color: #fff; | 98 | color: #fff; |
77 | - background: #fff; | 99 | + background: #444; |
78 | @include border-radius(5px); | 100 | @include border-radius(5px); |
79 | } | 101 | } |
80 | } | 102 | } |
1 | {{#if walkwayUrl}} | 1 | {{#if walkwayUrl}} |
2 | <div class="no-order"> | 2 | <div class="no-order"> |
3 | - <span class="iconfont"></span> | 3 | + <div class="icon"></div> |
4 | <span>你还没有订单</span> | 4 | <span>你还没有订单</span> |
5 | <a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a> | 5 | <a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a> |
6 | </div> | 6 | </div> |
@@ -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 | * 个人中心相关的控制器 |
@@ -25,10 +26,10 @@ class HomeController extends AbstractAction | @@ -25,10 +26,10 @@ class HomeController extends AbstractAction | ||
25 | $this->setTitle('个人中心'); | 26 | $this->setTitle('个人中心'); |
26 | $this->setNavHeader('个人中心', true, SITE_MAIN); | 27 | $this->setNavHeader('个人中心', true, SITE_MAIN); |
27 | 28 | ||
28 | - // $uid = $this->getUid(); | ||
29 | - $uid = 8826435; | ||
30 | - $data = \Index\UserModel::getUserProfileData($uid); | ||
31 | - $data += \Index\UserModel::getInfoNumData($uid); | 29 | + // $uid = $this->getUid(); |
30 | + $uid = 8826435; | ||
31 | + $data = \Index\UserModel::getUserProfileData($uid); | ||
32 | + $data += \Index\UserModel::getInfoNumData($uid); | ||
32 | 33 | ||
33 | // 优选新品数据 | 34 | // 优选新品数据 |
34 | $channel = Helpers::getChannelByCookie(); | 35 | $channel = Helpers::getChannelByCookie(); |
@@ -41,57 +42,6 @@ class HomeController extends AbstractAction | @@ -41,57 +42,6 @@ class HomeController extends AbstractAction | ||
41 | $this->_view->display('index', $data); | 42 | $this->_view->display('index', $data); |
42 | } | 43 | } |
43 | 44 | ||
44 | - /** | ||
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 | /** | 45 | /** |
96 | * 用户收藏的商品 | 46 | * 用户收藏的商品 |
97 | */ | 47 | */ |
@@ -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, |
@@ -244,18 +194,18 @@ class HomeController extends AbstractAction | @@ -244,18 +194,18 @@ class HomeController extends AbstractAction | ||
244 | $currency = \Index\UserModel::getYohoCoinData($uid); | 194 | $currency = \Index\UserModel::getYohoCoinData($uid); |
245 | 195 | ||
246 | $this->setTitle('优惠券'); | 196 | $this->setTitle('优惠券'); |
247 | - $this->setNavHeader('优惠券', true, SITE_MAIN); | ||
248 | - // $uid = $this->getUid(); | ||
249 | - $uid = 8826435; | ||
250 | - $coupons = array( | ||
251 | - 'couponsUrl' => array( | ||
252 | - \Index\UserModel::getCouponData($uid, 0), | ||
253 | - \Index\UserModel::getCouponData($uid, 1), | ||
254 | - ), | ||
255 | - 'couponsPage' => true | ||
256 | - ); | ||
257 | - | ||
258 | - print_r($coupons); | 197 | + $this->setNavHeader('优惠券', true, SITE_MAIN); |
198 | + // $uid = $this->getUid(); | ||
199 | + $uid = 8826435; | ||
200 | + $coupons = array( | ||
201 | + 'couponsUrl' => array( | ||
202 | + \Index\UserModel::getCouponData($uid, 0), | ||
203 | + \Index\UserModel::getCouponData($uid, 1), | ||
204 | + ), | ||
205 | + 'couponsPage' => true | ||
206 | + ); | ||
207 | + | ||
208 | + print_r($coupons); | ||
259 | $this->_view->display('coupons', $coupons); | 209 | $this->_view->display('coupons', $coupons); |
260 | } | 210 | } |
261 | 211 | ||
@@ -403,19 +353,19 @@ class HomeController extends AbstractAction | @@ -403,19 +353,19 @@ class HomeController extends AbstractAction | ||
403 | * 意见反馈 | 353 | * 意见反馈 |
404 | */ | 354 | */ |
405 | public function suggestAction() { | 355 | public function suggestAction() { |
356 | + // 设置网站标题 | ||
357 | + $this->setTitle('意见反馈'); | ||
358 | + $this->setNavHeader('意见反馈', true, SITE_MAIN); | ||
359 | + | ||
406 | $udid = $this->getUdid(); | 360 | $udid = $this->getUdid(); |
407 | $page = $this->get('page', 1); | 361 | $page = $this->get('page', 1); |
408 | $limit = $this->get('limit', 30); | 362 | $limit = $this->get('limit', 30); |
409 | 363 | ||
410 | $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); | 364 | $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); |
411 | 365 | ||
412 | - //print_r($suggest); | 366 | + print_r($suggest); |
413 | $this->_view->display('suggest', array( | 367 | $this->_view->display('suggest', array( |
414 | 'suggestPage' => true, //加载js | 368 | 'suggestPage' => true, //加载js |
415 | - 'pageHeader' => array( | ||
416 | - 'navBack' => true, | ||
417 | - 'navTitle' => '意见反馈' | ||
418 | - ), | ||
419 | 'pageFooter' => true, | 369 | 'pageFooter' => true, |
420 | 'suggest' => true, | 370 | 'suggest' => true, |
421 | 'suggestContent' => array( | 371 | 'suggestContent' => array( |
@@ -441,12 +391,10 @@ class HomeController extends AbstractAction | @@ -441,12 +391,10 @@ class HomeController extends AbstractAction | ||
441 | )); | 391 | )); |
442 | } | 392 | } |
443 | 393 | ||
444 | - | ||
445 | /** | 394 | /** |
446 | * 意见反馈-提交表单 | 395 | * 意见反馈-提交表单 |
447 | */ | 396 | */ |
448 | - public function suggest_subAction() | ||
449 | - { | 397 | + public function suggest_subAction() { |
450 | $udid = $this->getUdid(); | 398 | $udid = $this->getUdid(); |
451 | $page = $this->get('page', 1); | 399 | $page = $this->get('page', 1); |
452 | $limit = $this->get('limit', 30); | 400 | $limit = $this->get('limit', 30); |
@@ -464,18 +412,16 @@ class HomeController extends AbstractAction | @@ -464,18 +412,16 @@ class HomeController extends AbstractAction | ||
464 | 'suggestSub' => true, | 412 | 'suggestSub' => true, |
465 | 'pageFooter' => true | 413 | 'pageFooter' => true |
466 | )); | 414 | )); |
467 | - | ||
468 | } | 415 | } |
469 | 416 | ||
470 | - /** | ||
471 | - * 异步保存意见反馈数据 | ||
472 | - */ | ||
473 | - public function savesuggestAction() | ||
474 | - { | ||
475 | - if($this->isAjax()) { | ||
476 | - $uid = $this->getUid(); | ||
477 | - $content = $this->post('content', ''); | ||
478 | - $suggest_type = $this->get('suggest_type', 2); | 417 | + /** |
418 | + * 异步保存意见反馈数据 | ||
419 | + */ | ||
420 | + public function savesuggestAction() { | ||
421 | + if ($this->isAjax()) { | ||
422 | + $uid = $this->getUid(); | ||
423 | + $content = $this->post('content', ''); | ||
424 | + $suggest_type = $this->get('suggest_type', 2); | ||
479 | $result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type); | 425 | $result = \Index\UserModel::saveSuggestData($uid, $content, $suggest_type); |
480 | 426 | ||
481 | $this->echoJson($result); | 427 | $this->echoJson($result); |
@@ -503,6 +449,7 @@ class HomeController extends AbstractAction | @@ -503,6 +449,7 @@ class HomeController extends AbstractAction | ||
503 | /* | 449 | /* |
504 | * 会员特权查看页 | 450 | * 会员特权查看页 |
505 | */ | 451 | */ |
452 | + | ||
506 | public function preferentialAction() { | 453 | public function preferentialAction() { |
507 | //设置网站seo信息 | 454 | //设置网站seo信息 |
508 | $this->setTitle('会员等级'); | 455 | $this->setTitle('会员等级'); |
@@ -519,7 +466,24 @@ class HomeController extends AbstractAction | @@ -519,7 +466,24 @@ class HomeController extends AbstractAction | ||
519 | /* | 466 | /* |
520 | * 我的订单页面 | 467 | * 我的订单页面 |
521 | */ | 468 | */ |
522 | - public function orderAction() { | 469 | + public function orderAction(){ |
470 | + $type = $this -> get('type',1); | ||
471 | + $data = OrderModel::getNavs($type); | ||
472 | + if(!empty($data)){ | ||
473 | + $order['navs'] = $data; | ||
474 | + } | ||
475 | + $this->_view->display('order', array( | ||
476 | + 'order' => $order | ||
477 | + )); | ||
478 | + } | ||
479 | + | ||
480 | + | ||
481 | + //ajax请求订单页面 | ||
482 | + public function getOrderAction() { | ||
483 | + //判断是不是ajax请求 | ||
484 | + if (!$this->isAjax()) { | ||
485 | + $this->error(); | ||
486 | + } | ||
523 | //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 | 487 | //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 |
524 | $type = $this->get('type', 1); | 488 | $type = $this->get('type', 1); |
525 | $page = $this->get('page', 1); | 489 | $page = $this->get('page', 1); |
@@ -528,54 +492,66 @@ class HomeController extends AbstractAction | @@ -528,54 +492,66 @@ class HomeController extends AbstractAction | ||
528 | $yh_channel = $this->get('yh_channel', 1); | 492 | $yh_channel = $this->get('yh_channel', 1); |
529 | $uid = $this->getUid(); | 493 | $uid = $this->getUid(); |
530 | $uid = '7566245'; //测试用 | 494 | $uid = '7566245'; //测试用 |
531 | - $this -> setTitle('我的订单'); | ||
532 | - $this -> setNavHeader('我的订单'); | ||
533 | //调用模型层getOrder方法获得并处理数据 | 495 | //调用模型层getOrder方法获得并处理数据 |
534 | $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); | 496 | $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid); |
535 | //如果没有订单数据,就给一个随便逛逛链接 | 497 | //如果没有订单数据,就给一个随便逛逛链接 |
498 | + //print_r($data); | ||
536 | $order = array(); | 499 | $order = array(); |
537 | - // if (!empty($data)) { | ||
538 | - // $order['orders'] = $data; | ||
539 | - // } else { | ||
540 | - // $order['walkwayUrl'] = 'http://www.baidu.com'; | ||
541 | - // } | ||
542 | - $order['navs'] = array( | ||
543 | - array( | ||
544 | - 'name' => '全部', | ||
545 | - 'active' => true, | ||
546 | - 'typeId' => '1' | ||
547 | - ), | ||
548 | - array( | ||
549 | - 'name' => '待付款', | ||
550 | - 'typeId' => '2' | ||
551 | - ), | ||
552 | - array( | ||
553 | - 'name' => '待发货', | ||
554 | - 'typeId' => '3' | ||
555 | - ), | ||
556 | - array( | ||
557 | - 'name' => '待收货', | ||
558 | - 'typeId' => '4' | ||
559 | - ) | ||
560 | - ); | 500 | + if (!empty($data)) { |
501 | + $order['orders'] = $data; | ||
502 | + } else { | ||
503 | + $order['walkwayUrl'] = 'http://www.baidu.com'; | ||
504 | + } | ||
561 | //渲染模板 | 505 | //渲染模板 |
562 | - $this->_view->display('order', array( | 506 | + $this->_view->display('orderContent', array( |
563 | 'order' => $order, | 507 | 'order' => $order, |
564 | 'orderPage' => true, | 508 | 'orderPage' => true, |
565 | - 'pageFooter' => true | ||
566 | )); | 509 | )); |
567 | } | 510 | } |
568 | 511 | ||
569 | /* | 512 | /* |
570 | - * 我的订单-处理ajax请求页面(切换订单状态) | 513 | + * 我的订单-取消订单 |
571 | */ | 514 | */ |
572 | - public function getOrdersAction() { | 515 | + |
516 | + public function cancelOrderAction() { | ||
573 | 517 | ||
574 | //判断是不是ajax请求 | 518 | //判断是不是ajax请求 |
575 | if (!$this->isAjax()) { | 519 | if (!$this->isAjax()) { |
576 | $this->error(); | 520 | $this->error(); |
577 | } | 521 | } |
578 | - self::orderAction(); | 522 | + //传入order_code和uid以取消订单 |
523 | + $order_code = $this->get('orderCode'); | ||
524 | + $uid = $this->getUid(); | ||
525 | + $uid = '10267443'; //测试用 | ||
526 | + $gender = Helpers::getGenderByCookie(); | ||
527 | + $yh_channel = $this->get('yh_channel', 1); | ||
528 | + $method = 'app.SpaceOrders.close'; | ||
529 | + $data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method); | ||
530 | + if ($data['code'] == 200) { | ||
531 | + echo $data['message']; | ||
532 | + } | ||
533 | + } | ||
534 | + | ||
535 | + /* | ||
536 | + * 我的订单-删除订单 | ||
537 | + */ | ||
538 | + | ||
539 | + public function deleteOrderAction() { | ||
540 | + //判断是不是ajax请求 | ||
541 | + if (!$this->isAjax()) { | ||
542 | + $this->error(); | ||
543 | + } | ||
544 | + //传入order_code和uid以删除订单 | ||
545 | + $order_code = $this->get('orderCode'); | ||
546 | + $uid = $this->getUid(); | ||
547 | + $uid = '10267443'; //测试用 | ||
548 | + $gender = Helpers::getGenderByCookie(); | ||
549 | + $yh_channel = $this->get('yh_channel', 1); | ||
550 | + $method = 'app.SpaceOrders.delOrderByCode'; | ||
551 | + $data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method); | ||
552 | + if ($data['code'] == 200) { | ||
553 | + echo $data['message']; | ||
554 | + } | ||
579 | } | 555 | } |
580 | 556 | ||
581 | public function orderDetailAction() | 557 | public function orderDetailAction() |
@@ -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,40 +27,42 @@ class GradeModel | @@ -27,40 +27,42 @@ class GradeModel | ||
27 | } | 27 | } |
28 | //调用接口获取数据 | 28 | //调用接口获取数据 |
29 | $data = GradeData::getGradeData($gender, $channel, $uid); | 29 | $data = GradeData::getGradeData($gender, $channel, $uid); |
30 | - switch (intval($data['grade']['current_vip_level'])) { | ||
31 | - case 0://普通会员 | ||
32 | - $result['vipGrade']['vip0'] = true; | ||
33 | - break; | ||
34 | - case 1://银卡会员 | ||
35 | - $result['vipGrade']['vip1'] = true; | ||
36 | - break; | ||
37 | - case 2://金卡会员 | ||
38 | - $result['vipGrade']['vip2'] = true; | ||
39 | - break; | ||
40 | - case 3://白金会员 | ||
41 | - $result['vipGrade']['vip3'] = true; | ||
42 | - break; | ||
43 | - } | ||
44 | - | ||
45 | - //今年总消费 | ||
46 | - $result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost']; | ||
47 | - //升级下一等级会员的进度; | ||
48 | - $result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2)); | ||
49 | - //距离升级所需消费金额 | ||
50 | - | ||
51 | - if ($data['grade']['current_vip_level'] != 3) { | ||
52 | - $result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost']; | ||
53 | - } | ||
54 | - //消费总计 | ||
55 | - $result['vipGrade']['sumCost'] = $data['grade']['current_total_cost']; | ||
56 | - //username 调用获取用户基本信息数据,获得username; | ||
57 | - //$userProfile = GradeData::getUserProfileData($gender,$uid,$channel); | ||
58 | - $result['vipGrade']['name'] = $data['userProfile']['username']; | ||
59 | - //跳转url(会员特权详情) | ||
60 | - $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null); | ||
61 | - //当前vip等级享受的特权 | ||
62 | - $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential']; | ||
63 | 30 | ||
31 | + if (!empty($data['grade'])) { | ||
32 | + switch (intval($data['grade']['current_vip_level'])) { | ||
33 | + case 0://普通会员 | ||
34 | + $result['vipGrade']['vip0'] = true; | ||
35 | + break; | ||
36 | + case 1://银卡会员 | ||
37 | + $result['vipGrade']['vip1'] = true; | ||
38 | + break; | ||
39 | + case 2://金卡会员 | ||
40 | + $result['vipGrade']['vip2'] = true; | ||
41 | + break; | ||
42 | + case 3://白金会员 | ||
43 | + $result['vipGrade']['vip3'] = true; | ||
44 | + break; | ||
45 | + } | ||
46 | + | ||
47 | + //今年总消费 | ||
48 | + $result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost']; | ||
49 | + //升级下一等级会员的进度; | ||
50 | + $result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2)); | ||
51 | + //距离升级所需消费金额 | ||
52 | + | ||
53 | + if ($data['grade']['current_vip_level'] != 3) { | ||
54 | + $result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost']; | ||
55 | + } | ||
56 | + //消费总计 | ||
57 | + $result['vipGrade']['sumCost'] = $data['grade']['current_total_cost']; | ||
58 | + //username 调用获取用户基本信息数据,获得username; | ||
59 | + //$userProfile = GradeData::getUserProfileData($gender,$uid,$channel); | ||
60 | + $result['vipGrade']['name'] = $data['userProfile']['username']; | ||
61 | + //跳转url(会员特权详情) | ||
62 | + $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null); | ||
63 | + //当前vip等级享受的特权 | ||
64 | + $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential']; | ||
65 | + } | ||
64 | 66 | ||
65 | if (USE_CACHE) { | 67 | if (USE_CACHE) { |
66 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. | 68 | // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. |
@@ -121,5 +121,55 @@ class OrderModel | @@ -121,5 +121,55 @@ class OrderModel | ||
121 | } | 121 | } |
122 | return $arr; | 122 | return $arr; |
123 | } | 123 | } |
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 | + } | ||
124 | 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; |
-
Please register or login to post a comment