Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
14 changed files
with
255 additions
and
77 deletions
@@ -442,7 +442,7 @@ class AbstractAction extends Controller_Abstract | @@ -442,7 +442,7 @@ class AbstractAction extends Controller_Abstract | ||
442 | break; | 442 | break; |
443 | } | 443 | } |
444 | } | 444 | } |
445 | - | 445 | + |
446 | $this->_view->assign('pageHeader', $header); | 446 | $this->_view->assign('pageHeader', $header); |
447 | } | 447 | } |
448 | 448 |
library/LibModels/Wap/Home/HelpData.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace LibModels\Wap\Home; | ||
4 | + | ||
5 | +use Api\Yohobuy; | ||
6 | +use Api\Sign; | ||
7 | +/** | ||
8 | + * 帮助中心数据模型 | ||
9 | + * | ||
10 | + */ | ||
11 | +class HelpData | ||
12 | +{ | ||
13 | + | ||
14 | + /* | ||
15 | + * 获取帮助列表(分类),缓存1h | ||
16 | + * clientType客户端 | ||
17 | + */ | ||
18 | + public static function serviceInfo() | ||
19 | + { | ||
20 | + //构建必传参数 | ||
21 | + $param = Yohobuy::param(); | ||
22 | + $param['method'] = 'app.help.li'; | ||
23 | + $param['client_secret'] = Sign::getSign($param); | ||
24 | + | ||
25 | + return Yohobuy::post(Yohobuy::API_URL, $param, $param); | ||
26 | + } | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | +} | ||
31 | + | ||
32 | + |
@@ -73,6 +73,7 @@ class DetailData | @@ -73,6 +73,7 @@ class DetailData | ||
73 | $param['limit'] = $pageSize; | 73 | $param['limit'] = $pageSize; |
74 | $param['client_secret'] = Sign::getSign($param); | 74 | $param['client_secret'] = Sign::getSign($param); |
75 | 75 | ||
76 | + | ||
76 | return Yohobuy::get(Yohobuy::API_URL, $param); | 77 | return Yohobuy::get(Yohobuy::API_URL, $param); |
77 | } | 78 | } |
78 | 79 | ||
@@ -86,7 +87,15 @@ class DetailData | @@ -86,7 +87,15 @@ class DetailData | ||
86 | */ | 87 | */ |
87 | public static function commentList($productId, $pageNum, $pageSize) | 88 | public static function commentList($productId, $pageNum, $pageSize) |
88 | { | 89 | { |
89 | - // 暂未提供提口 | 90 | + $param = Yohobuy::param(); |
91 | + $param['method'] = 'app.comment.li'; | ||
92 | + $param['product_id'] = $productId; | ||
93 | + $param['page'] = $pageNum; | ||
94 | + $param['limit'] = $pageSize; | ||
95 | + $param['client_secret'] = Sign::getSign($param); | ||
96 | + | ||
97 | + | ||
98 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
90 | } | 99 | } |
91 | 100 | ||
92 | /** | 101 | /** |
@@ -182,6 +182,10 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() { | @@ -182,6 +182,10 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() { | ||
182 | $(this).addClass('highlight'); | 182 | $(this).addClass('highlight'); |
183 | }).on('touchend touchcancel', '.tap-hightlight', function() { | 183 | }).on('touchend touchcancel', '.tap-hightlight', function() { |
184 | $(this).removeClass('highlight'); | 184 | $(this).removeClass('highlight'); |
185 | + | ||
186 | +}); | ||
187 | +$('.nav-home').on('touchstart', function() { | ||
188 | + $('.homebuttom').toggleClass('none'); | ||
185 | }); | 189 | }); |
186 | 190 | ||
187 | (function() { | 191 | (function() { |
@@ -123,4 +123,47 @@ | @@ -123,4 +123,47 @@ | ||
123 | padding-top: 90rem / $pxConvertRem; | 123 | padding-top: 90rem / $pxConvertRem; |
124 | } | 124 | } |
125 | } | 125 | } |
126 | +} | ||
127 | + | ||
128 | +.homebuttom{ | ||
129 | + display: block; | ||
130 | + width: 100%; | ||
131 | + height: 90rem / $pxConvertRem; | ||
132 | + overflow: hidden; | ||
133 | + @include background-image(linear-gradient(#323232, #414141)); | ||
134 | + border-top: 1px solid #444; | ||
135 | + color: #fff; | ||
136 | + // position: absolute; | ||
137 | + // top: 90rem / $pxConvertRem; | ||
138 | + // left: 0; | ||
139 | + // z-index: 10; | ||
140 | + ul{ | ||
141 | + width: 100%; | ||
142 | + height: 90%; | ||
143 | + overflow: hidden; | ||
144 | + padding-top: 12rem / $pxConvertRem; | ||
145 | + li{ | ||
146 | + width: 25%; | ||
147 | + height: 100%; | ||
148 | + overflow: hidden; | ||
149 | + float: left; | ||
150 | + text-align: center; | ||
151 | + i{ | ||
152 | + width: 100%; | ||
153 | + height: 40%; | ||
154 | + overflow: hidden; | ||
155 | + display: block; | ||
156 | + } | ||
157 | + span{ | ||
158 | + width: 100%; | ||
159 | + height: auto; | ||
160 | + overflow: hidden; | ||
161 | + display: block; | ||
162 | + line-height: 40rem / $pxConvertRem; | ||
163 | + } | ||
164 | + } | ||
165 | + } | ||
166 | +} | ||
167 | +.none{ | ||
168 | + display: none; | ||
126 | } | 169 | } |
@@ -2,28 +2,6 @@ | @@ -2,28 +2,6 @@ | ||
2 | width: 100%; | 2 | width: 100%; |
3 | height: auto; | 3 | height: auto; |
4 | overflow: hidden; | 4 | overflow: hidden; |
5 | - .helpSearch{ | ||
6 | - width: 90%; | ||
7 | - height: 84rem / $pxConvertRem; | ||
8 | - overflow: hidden; | ||
9 | - position: relative; | ||
10 | - margin: 0 auto; | ||
11 | - input{ | ||
12 | - width: 100%; | ||
13 | - height: 100%; | ||
14 | - overflow: hidden; | ||
15 | - border:none; | ||
16 | - font-size: 54em / $pxConvertRem; | ||
17 | - } | ||
18 | - i{ | ||
19 | - height: 100%; | ||
20 | - line-height: 88rem / $pxConvertRem; | ||
21 | - position: absolute; | ||
22 | - right: 20rem / $pxConvertRem; | ||
23 | - top: 0; | ||
24 | - color: #e0e0e0; | ||
25 | - } | ||
26 | - } | ||
27 | ul{ | 5 | ul{ |
28 | width: 100%; | 6 | width: 100%; |
29 | height: auto; | 7 | height: auto; |
@@ -31,7 +9,7 @@ | @@ -31,7 +9,7 @@ | ||
31 | display: block; | 9 | display: block; |
32 | border-top: 1px solid #e0e0e0; | 10 | border-top: 1px solid #e0e0e0; |
33 | li{ | 11 | li{ |
34 | - width: 95%; | 12 | + width: 100%; |
35 | height: 80rem / $pxConvertRem; | 13 | height: 80rem / $pxConvertRem; |
36 | line-height: 84rem / $pxConvertRem; | 14 | line-height: 84rem / $pxConvertRem; |
37 | overflow: hidden; | 15 | overflow: hidden; |
@@ -43,10 +21,11 @@ | @@ -43,10 +21,11 @@ | ||
43 | border-bottom:none; | 21 | border-bottom:none; |
44 | } | 22 | } |
45 | span{ | 23 | span{ |
46 | - width: 88%; | 24 | + width: 85%; |
47 | height: 100%; | 25 | height: 100%; |
48 | overflow: hidden; | 26 | overflow: hidden; |
49 | float: left; | 27 | float: left; |
28 | + padding-left: 5%; | ||
50 | } | 29 | } |
51 | i{ | 30 | i{ |
52 | color: #e0e0e0; | 31 | color: #e0e0e0; |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="iHelp"> | 2 | <div class="iHelp"> |
3 | - <div class="helpSearch"> | ||
4 | - <input type="text" placeholder="查找关键字"> | ||
5 | - <i class="iconfont"></i> | ||
6 | - </div> | ||
7 | <ul> | 3 | <ul> |
8 | {{# iHelp}} | 4 | {{# iHelp}} |
9 | - <li><a href="{{ url }}"><span>{{ name }}</span><i class="iconfont num"></i></a></li> | 5 | + <li><a href="/home/helpDetail?caption={{ caption}}"><span>{{ caption}}</span><i class="iconfont num"></i></a></li> |
10 | {{/ iHelp}} | 6 | {{/ iHelp}} |
11 | </ul> | 7 | </ul> |
12 | </div> | 8 | </div> |
@@ -4,13 +4,34 @@ | @@ -4,13 +4,34 @@ | ||
4 | <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back"></a> | 4 | <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back"></a> |
5 | {{/navBack}} | 5 | {{/navBack}} |
6 | {{#navHome}} | 6 | {{#navHome}} |
7 | - <a href="{{.}}" class="iconfont nav-home"></a> | 7 | + <a class="iconfont nav-home"></a> |
8 | {{/navHome}} | 8 | {{/navHome}} |
9 | {{#navTitle}} | 9 | {{#navTitle}} |
10 | <p class="nav-title">{{.}}</p> | 10 | <p class="nav-title">{{.}}</p> |
11 | {{/navTitle}} | 11 | {{/navTitle}} |
12 | {{# navBtn}} | 12 | {{# navBtn}} |
13 | - <span class="nav-btn">{{.}}</span> | 13 | + <!-- <span class="nav-btn">{{.}}</span> --> |
14 | + <i class="iconfont nav-home"></i> | ||
14 | {{/ navBtn}} | 15 | {{/ navBtn}} |
15 | </header> | 16 | </header> |
17 | + <div class="homebuttom none"> | ||
18 | + <ul> | ||
19 | + <li> | ||
20 | + <i class="iconfont"></i> | ||
21 | + <span>首页</span> | ||
22 | + </li> | ||
23 | + <li> | ||
24 | + <i class="iconfont"></i> | ||
25 | + <span>分类</span> | ||
26 | + </li> | ||
27 | + <li> | ||
28 | + <i class="iconfont"></i> | ||
29 | + <span>购物车</span> | ||
30 | + </li> | ||
31 | + <li> | ||
32 | + <i class="iconfont"></i> | ||
33 | + <span>我的</span> | ||
34 | + </li> | ||
35 | + </ul> | ||
36 | + </div> | ||
16 | {{/pageHeader}} | 37 | {{/pageHeader}} |
@@ -41,14 +41,14 @@ class HomeController extends AbstractAction | @@ -41,14 +41,14 @@ class HomeController extends AbstractAction | ||
41 | { | 41 | { |
42 | // 设置网站标题 | 42 | // 设置网站标题 |
43 | $this->setTitle('个人中心'); | 43 | $this->setTitle('个人中心'); |
44 | - $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1'); | 44 | + $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1', '', true); |
45 | 45 | ||
46 | $data = array( | 46 | $data = array( |
47 | 'myIndexPage' => true, | 47 | 'myIndexPage' => true, |
48 | 'showDownloadApp' => true, | 48 | 'showDownloadApp' => true, |
49 | 'pageFooter' => true, | 49 | 'pageFooter' => true, |
50 | 'cartUrl' => Helpers::url('/cart/index/index', null), | 50 | 'cartUrl' => Helpers::url('/cart/index/index', null), |
51 | - 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))), | 51 | + 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ), |
52 | ); | 52 | ); |
53 | $uid = $this->getUid(false); | 53 | $uid = $this->getUid(false); |
54 | if ($uid) { | 54 | if ($uid) { |
@@ -781,14 +781,14 @@ class HomeController extends AbstractAction | @@ -781,14 +781,14 @@ class HomeController extends AbstractAction | ||
781 | // 审判跳转登录页 | 781 | // 审判跳转登录页 |
782 | $this->auditJumpLogin(); | 782 | $this->auditJumpLogin(); |
783 | 783 | ||
784 | + $this->setTitle('支付中心'); | ||
785 | + $this->setNavHeader('支付中心'); | ||
786 | + | ||
784 | $orderCode = $this->get('order_code'); | 787 | $orderCode = $this->get('order_code'); |
785 | if (empty($orderCode)) { | 788 | if (empty($orderCode)) { |
786 | $this->error(); | 789 | $this->error(); |
787 | } | 790 | } |
788 | 791 | ||
789 | - $this->setTitle('支付中心'); | ||
790 | - $this->setNavHeader('支付中心'); | ||
791 | - | ||
792 | $this->_view->display('pay', array( | 792 | $this->_view->display('pay', array( |
793 | 'payCenterPage' => true, | 793 | 'payCenterPage' => true, |
794 | 'payAppInfo' => array( | 794 | 'payAppInfo' => array( |
@@ -814,40 +814,90 @@ class HomeController extends AbstractAction | @@ -814,40 +814,90 @@ class HomeController extends AbstractAction | ||
814 | )); | 814 | )); |
815 | } | 815 | } |
816 | 816 | ||
817 | +// /* | ||
818 | +// * 我的订单-确认收货 | ||
819 | +// */ | ||
820 | +// private function confirmAction(){ | ||
821 | +// // | ||
822 | +// $gender = Helpers::getGenderByCookie(); | ||
823 | +// $order_code = $this->get('id'); | ||
824 | +// $order_code = ''; | ||
825 | +// $yh_channel = $this->get('yh_channel', 1); | ||
826 | +// $data = OrderData::confirmData($gender,$order_code,$yh_channel,$this->_uid); | ||
827 | +// $this->echoJson($data); | ||
828 | +// } | ||
829 | + | ||
817 | /** | 830 | /** |
818 | * 订单详情页 | 831 | * 订单详情页 |
819 | */ | 832 | */ |
820 | public function orderDetailAction() | 833 | public function orderDetailAction() |
821 | { | 834 | { |
822 | - // 审判跳转登录页 | ||
823 | - $this->auditJumpLogin(); | ||
824 | - | ||
825 | - $orderCode = $this->get('order_code', 1507880870); | ||
826 | - if (empty($orderCode)) { | ||
827 | - $this->error(); | ||
828 | - } | ||
829 | - | ||
830 | - $this->setTitle('订单详情'); | ||
831 | - $this->setNavHeader('订单详情'); | ||
832 | - | ||
833 | - $this->_view->display('order-detail', array( | ||
834 | - 'orderDetailPage' => true, | ||
835 | - 'orderDetail' => OrderModel::orderDetail($orderCode, 967016/*$this->_uid*/, 'a3aadd4cce408f8ee062a9add02e8faa'/*$this->_session*/), | ||
836 | - )); | ||
837 | - } | ||
838 | - | ||
839 | -// /** | ||
840 | -// * 帮助列表页 | ||
841 | -// */ | ||
842 | -// public function helpAction() | ||
843 | -// { | ||
844 | -// $this->setTitle('帮助中心'); | ||
845 | -// $this->setNavHeader('帮助中心'); | ||
846 | -// $data = array( | ||
847 | -// 'iHelp' => array( | ||
848 | -// array('name' => '新用户注册', 'url' => 'http://m.dev.yohobuy.com/'), | ||
849 | -// ) | ||
850 | -// ); | ||
851 | -// $this->_view->display('i-help', $data); | ||
852 | -// } | 835 | + $data = array( |
836 | + 'name' => '毛毛莉Lydia', | ||
837 | + 'phoneNum' => '18600001133', | ||
838 | + 'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼', | ||
839 | + 'orderStatus' => '订单取消', | ||
840 | + 'orderNum' => '418358063', | ||
841 | + 'orderTime' => '2014-03-10 17:25:10', | ||
842 | + 'orderCancel' => true, | ||
843 | + 'goods' => array( | ||
844 | + array( | ||
845 | + 'id' => 1, | ||
846 | + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
847 | + 'name' => 'Adidas Originals ZX FLUXM22508', | ||
848 | + 'color' => '黄', | ||
849 | + 'size' => '43', | ||
850 | + 'price' => '699.00', | ||
851 | + 'count' => '2' | ||
852 | + ), | ||
853 | + array( | ||
854 | + 'id' => 1, | ||
855 | + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', | ||
856 | + 'name' => 'B.Duck浴室玩伴mini浮水鸭', | ||
857 | + 'gift' => true, | ||
858 | + 'color' => '黄', | ||
859 | + 'size' => '43', | ||
860 | + 'price' => '0.00', | ||
861 | + 'count' => '1' | ||
862 | + ) | ||
863 | + ), | ||
864 | + 'sumPrice' => 799, | ||
865 | + 'salePrice' => 80, | ||
866 | + 'freight' => 5, | ||
867 | + 'coupon' => 0, | ||
868 | + 'yohoCoin' => 5, | ||
869 | + 'price' => 719 | ||
870 | + ); | ||
871 | + $this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true)); | ||
872 | + } | ||
873 | + | ||
874 | + /** | ||
875 | + * 帮助列表页 | ||
876 | + */ | ||
877 | + public function helpAction() | ||
878 | + { | ||
879 | + $this->setTitle('帮助中心'); | ||
880 | + $this->setNavHeader('帮助中心'); | ||
881 | + $data = array( | ||
882 | + 'iHelp' => array( | ||
883 | + array('caption' => '新用户注册'), | ||
884 | + ) | ||
885 | + ); | ||
886 | + $this->_view->display('i-help', $data); | ||
887 | + } | ||
888 | + | ||
889 | + /** | ||
890 | + * 帮助列表页 | ||
891 | + */ | ||
892 | + public function helpDetailAction() | ||
893 | + { | ||
894 | + $this->setTitle('帮助中心'); | ||
895 | + $this->setNavHeader('帮助中心'); | ||
896 | + $data = array( | ||
897 | + 'iHelp' => array( | ||
898 | + array('name' => '新用户注册'), | ||
899 | + ) | ||
900 | + ); | ||
901 | + $this->_view->display('helpDetail', $data); | ||
902 | + } | ||
853 | } | 903 | } |
1 | +<?php | ||
2 | + | ||
3 | +namespace Home; | ||
4 | + | ||
5 | +use LibModels\Wap\Home\HelpData; | ||
6 | +use Plugin\Helpers; | ||
7 | + | ||
8 | +/** | ||
9 | + * 帮助中心相关数据处理 | ||
10 | + */ | ||
11 | +class HelpModel | ||
12 | +{ | ||
13 | + /* | ||
14 | + * 获取帮助中心列表 | ||
15 | + */ | ||
16 | + | ||
17 | + public static function serviceInfo() | ||
18 | + { | ||
19 | + //调用接口获取数据 | ||
20 | + $res = json_decode(HelpData::serviceInfo(), TRUE); | ||
21 | + $cateInfo = $res['data']; | ||
22 | + $iHelp = array(); | ||
23 | + $list = array(); | ||
24 | + if ($cateInfo) { | ||
25 | + foreach ($cateInfo as $key => $value) { | ||
26 | + $iHelp[$key]['name'] = $value['caption']; | ||
27 | + $iHelp[$key]['code'] = $value['code']; | ||
28 | + } | ||
29 | + | ||
30 | + } | ||
31 | + return $iHelp; | ||
32 | + } | ||
33 | + | ||
34 | + | ||
35 | +} | ||
36 | + |
@@ -449,6 +449,11 @@ class DetailModel | @@ -449,6 +449,11 @@ class DetailModel | ||
449 | 449 | ||
450 | /** | 450 | /** |
451 | * 获取评价列表 | 451 | * 获取评价列表 |
452 | + * | ||
453 | + * @param int $productId 产品ID | ||
454 | + * @param int $pageNum 页码数 | ||
455 | + * @param int $pageSize 每页显示个数 | ||
456 | + * @return array | ||
452 | */ | 457 | */ |
453 | public static function getComments($productId, $pageNum = 1, $pageSize = 300) | 458 | public static function getComments($productId, $pageNum = 1, $pageSize = 300) |
454 | { | 459 | { |
@@ -456,13 +461,13 @@ class DetailModel | @@ -456,13 +461,13 @@ class DetailModel | ||
456 | 461 | ||
457 | if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { | 462 | if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { |
458 | $commentList = DetailData::commentList($productId, $pageNum, $pageSize); | 463 | $commentList = DetailData::commentList($productId, $pageNum, $pageSize); |
459 | - if (!empty($commentList)) { | 464 | + if (!empty($commentList['data'])) { |
460 | $build = array(); | 465 | $build = array(); |
461 | - foreach ($commentList as $value) { | ||
462 | - $build['userName'] = ''; | ||
463 | - $build['desc'] = ''; | ||
464 | - $build['content'] = ''; | ||
465 | - $build['time'] = ''; | 466 | + foreach ($commentList['data'] as $value) { |
467 | + $build['userName'] = $value['nickname']; | ||
468 | + $build['desc'] = $value['color_name'] . '/' . $value['size_name']; | ||
469 | + $build['content'] = $value['content']; | ||
470 | + $build['time'] = $value['create_time']; | ||
466 | $result[] = $build; | 471 | $result[] = $build; |
467 | } | 472 | } |
468 | } | 473 | } |
@@ -90,7 +90,7 @@ class DetailController extends AbstractAction | @@ -90,7 +90,7 @@ class DetailController extends AbstractAction | ||
90 | 'goodsCommentsPage' => true, | 90 | 'goodsCommentsPage' => true, |
91 | 'pageFooter' => true, | 91 | 'pageFooter' => true, |
92 | 'comments' => array( | 92 | 'comments' => array( |
93 | - 'list' => \Product\DetailModel::getConsults($productId), | 93 | + 'list' => \Product\DetailModel::getComments($productId), |
94 | ), | 94 | ), |
95 | ); | 95 | ); |
96 | 96 |
-
Please register or login to post a comment