diff --git a/library/Action/AbstractAction.php b/library/Action/AbstractAction.php index 345294a..3bc6430 100644 --- a/library/Action/AbstractAction.php +++ b/library/Action/AbstractAction.php @@ -442,7 +442,7 @@ class AbstractAction extends Controller_Abstract break; } } - + $this->_view->assign('pageHeader', $header); } diff --git a/library/LibModels/Wap/Product/DetailData.php b/library/LibModels/Wap/Product/DetailData.php index 71d3d2c..61f11e5 100644 --- a/library/LibModels/Wap/Product/DetailData.php +++ b/library/LibModels/Wap/Product/DetailData.php @@ -73,6 +73,7 @@ class DetailData $param['limit'] = $pageSize; $param['client_secret'] = Sign::getSign($param); + return Yohobuy::get(Yohobuy::API_URL, $param); } @@ -86,7 +87,15 @@ class DetailData */ public static function commentList($productId, $pageNum, $pageSize) { - // 暂未提供提口 + $param = Yohobuy::param(); + $param['method'] = 'app.comment.li'; + $param['product_id'] = $productId; + $param['page'] = $pageNum; + $param['limit'] = $pageSize; + $param['client_secret'] = Sign::getSign($param); + + + return Yohobuy::get(Yohobuy::API_URL, $param); } /** diff --git a/static/js/common.js b/static/js/common.js index 4981f59..c126a13 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -182,6 +182,10 @@ $yohoPage.on('touchstart', '.tap-hightlight', function() { $(this).addClass('highlight'); }).on('touchend touchcancel', '.tap-hightlight', function() { $(this).removeClass('highlight'); + +}); +$('.nav-home').on('touchstart', function() { + $('.homebuttom').toggleClass('none'); }); (function() { diff --git a/static/sass/layout/_header.scss b/static/sass/layout/_header.scss index fd305b7..3e17928 100644 --- a/static/sass/layout/_header.scss +++ b/static/sass/layout/_header.scss @@ -123,4 +123,47 @@ padding-top: 90rem / $pxConvertRem; } } +} + +.homebuttom{ + display: block; + width: 100%; + height: 90rem / $pxConvertRem; + overflow: hidden; + @include background-image(linear-gradient(#323232, #414141)); + border-top: 1px solid #444; + color: #fff; + // position: absolute; + // top: 90rem / $pxConvertRem; + // left: 0; + // z-index: 10; + ul{ + width: 100%; + height: 90%; + overflow: hidden; + padding-top: 12rem / $pxConvertRem; + li{ + width: 25%; + height: 100%; + overflow: hidden; + float: left; + text-align: center; + i{ + width: 100%; + height: 40%; + overflow: hidden; + display: block; + } + span{ + width: 100%; + height: auto; + overflow: hidden; + display: block; + line-height: 40rem / $pxConvertRem; + } + } + } +} +.none{ + display: none; } \ No newline at end of file diff --git a/static/sass/me/_ihelp.scss b/static/sass/me/_ihelp.scss index cc222f3..f8a476f 100644 --- a/static/sass/me/_ihelp.scss +++ b/static/sass/me/_ihelp.scss @@ -2,28 +2,6 @@ width: 100%; height: auto; overflow: hidden; - .helpSearch{ - width: 90%; - height: 84rem / $pxConvertRem; - overflow: hidden; - position: relative; - margin: 0 auto; - input{ - width: 100%; - height: 100%; - overflow: hidden; - border:none; - font-size: 54em / $pxConvertRem; - } - i{ - height: 100%; - line-height: 88rem / $pxConvertRem; - position: absolute; - right: 20rem / $pxConvertRem; - top: 0; - color: #e0e0e0; - } - } ul{ width: 100%; height: auto; @@ -31,7 +9,7 @@ display: block; border-top: 1px solid #e0e0e0; li{ - width: 95%; + width: 100%; height: 80rem / $pxConvertRem; line-height: 84rem / $pxConvertRem; overflow: hidden; @@ -43,10 +21,11 @@ border-bottom:none; } span{ - width: 88%; + width: 85%; height: 100%; overflow: hidden; float: left; + padding-left: 5%; } i{ color: #e0e0e0; diff --git a/template/m.yohobuy.com/actions/index/home/helpDetail.phtml b/template/m.yohobuy.com/actions/index/home/helpDetail.phtml new file mode 100644 index 0000000..930ccc8 --- /dev/null +++ b/template/m.yohobuy.com/actions/index/home/helpDetail.phtml @@ -0,0 +1,3 @@ +{{> layout/header}} + +{{> layout/footer}} \ No newline at end of file diff --git a/template/m.yohobuy.com/actions/index/home/i-help.phtml b/template/m.yohobuy.com/actions/index/home/i-help.phtml index 75a6359..525705f 100644 --- a/template/m.yohobuy.com/actions/index/home/i-help.phtml +++ b/template/m.yohobuy.com/actions/index/home/i-help.phtml @@ -1,12 +1,8 @@ {{> layout/header}} <div class="iHelp"> - <div class="helpSearch"> - <input type="text" placeholder="查找关键字"> - <i class="iconfont"></i> - </div> <ul> {{# iHelp}} - <li><a href="{{ url }}"><span>{{ name }}</span><i class="iconfont num"></i></a></li> + <li><a href="/home/helpDetail?caption={{ caption}}"><span>{{ caption}}</span><i class="iconfont num"></i></a></li> {{/ iHelp}} </ul> </div> diff --git a/template/m.yohobuy.com/partials/layout/header.phtml b/template/m.yohobuy.com/partials/layout/header.phtml index 9b1fed4..165d1dd 100644 --- a/template/m.yohobuy.com/partials/layout/header.phtml +++ b/template/m.yohobuy.com/partials/layout/header.phtml @@ -49,4 +49,4 @@ <span>X</span> </div> {{/if}} - {{> layout/page_header}} \ No newline at end of file +{{> layout/page_header}} \ No newline at end of file diff --git a/template/m.yohobuy.com/partials/layout/page_header.phtml b/template/m.yohobuy.com/partials/layout/page_header.phtml index 1ba77d4..ad62990 100644 --- a/template/m.yohobuy.com/partials/layout/page_header.phtml +++ b/template/m.yohobuy.com/partials/layout/page_header.phtml @@ -4,13 +4,34 @@ <a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back"></a> {{/navBack}} {{#navHome}} - <a href="{{.}}" class="iconfont nav-home"></a> + <a class="iconfont nav-home"></a> {{/navHome}} {{#navTitle}} <p class="nav-title">{{.}}</p> {{/navTitle}} {{# navBtn}} - <span class="nav-btn">{{.}}</span> + <!-- <span class="nav-btn">{{.}}</span> --> + <i class="iconfont nav-home"></i> {{/ navBtn}} </header> + <div class="homebuttom none"> + <ul> + <li> + <i class="iconfont"></i> + <span>首页</span> + </li> + <li> + <i class="iconfont"></i> + <span>分类</span> + </li> + <li> + <i class="iconfont"></i> + <span>购物车</span> + </li> + <li> + <i class="iconfont"></i> + <span>我的</span> + </li> + </ul> + </div> {{/pageHeader}} \ No newline at end of file diff --git a/yohobuy/m.yohobuy.com/application/controllers/Home.php b/yohobuy/m.yohobuy.com/application/controllers/Home.php index f9c8b04..3af5535 100644 --- a/yohobuy/m.yohobuy.com/application/controllers/Home.php +++ b/yohobuy/m.yohobuy.com/application/controllers/Home.php @@ -41,14 +41,14 @@ class HomeController extends AbstractAction { // 设置网站标题 $this->setTitle('个人中心'); - $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1'); + $this->setNavHeader('个人中心', SITE_MAIN . '/?go=1', '', true); $data = array( 'myIndexPage' => true, 'showDownloadApp' => true, 'pageFooter' => true, 'cartUrl' => Helpers::url('/cart/index/index', null), - 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))), + 'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ), ); $uid = $this->getUid(false); if ($uid) { @@ -781,14 +781,14 @@ class HomeController extends AbstractAction // 审判跳转登录页 $this->auditJumpLogin(); + $this->setTitle('支付中心'); + $this->setNavHeader('支付中心'); + $orderCode = $this->get('order_code'); if (empty($orderCode)) { $this->error(); } - $this->setTitle('支付中心'); - $this->setNavHeader('支付中心'); - $this->_view->display('pay', array( 'payCenterPage' => true, 'payAppInfo' => array( @@ -814,40 +814,90 @@ class HomeController extends AbstractAction )); } +// /* +// * 我的订单-确认收货 +// */ +// private function confirmAction(){ +// // +// $gender = Helpers::getGenderByCookie(); +// $order_code = $this->get('id'); +// $order_code = ''; +// $yh_channel = $this->get('yh_channel', 1); +// $data = OrderData::confirmData($gender,$order_code,$yh_channel,$this->_uid); +// $this->echoJson($data); +// } + /** * 订单详情页 */ public function orderDetailAction() { - // 审判跳转登录页 - $this->auditJumpLogin(); - - $orderCode = $this->get('order_code', 1507880870); - if (empty($orderCode)) { - $this->error(); - } - - $this->setTitle('订单详情'); - $this->setNavHeader('订单详情'); - - $this->_view->display('order-detail', array( - 'orderDetailPage' => true, - 'orderDetail' => OrderModel::orderDetail($orderCode, 967016/*$this->_uid*/, 'a3aadd4cce408f8ee062a9add02e8faa'/*$this->_session*/), - )); - } - -// /** -// * 帮助列表页 -// */ -// public function helpAction() -// { -// $this->setTitle('帮助中心'); -// $this->setNavHeader('帮助中心'); -// $data = array( -// 'iHelp' => array( -// array('name' => '新用户注册', 'url' => 'http://m.dev.yohobuy.com/'), -// ) -// ); -// $this->_view->display('i-help', $data); -// } + $data = array( + 'name' => '毛毛莉Lydia', + 'phoneNum' => '18600001133', + 'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼', + 'orderStatus' => '订单取消', + 'orderNum' => '418358063', + 'orderTime' => '2014-03-10 17:25:10', + 'orderCancel' => true, + 'goods' => array( + array( + 'id' => 1, + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', + 'name' => 'Adidas Originals ZX FLUXM22508', + 'color' => '黄', + 'size' => '43', + 'price' => '699.00', + 'count' => '2' + ), + array( + 'id' => 1, + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', + 'name' => 'B.Duck浴室玩伴mini浮水鸭', + 'gift' => true, + 'color' => '黄', + 'size' => '43', + 'price' => '0.00', + 'count' => '1' + ) + ), + 'sumPrice' => 799, + 'salePrice' => 80, + 'freight' => 5, + 'coupon' => 0, + 'yohoCoin' => 5, + 'price' => 719 + ); + $this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true)); + } + + /** + * 帮助列表页 + */ + public function helpAction() + { + $this->setTitle('帮助中心'); + $this->setNavHeader('帮助中心'); + $data = array( + 'iHelp' => array( + array('caption' => '新用户注册'), + ) + ); + $this->_view->display('i-help', $data); + } + + /** + * 帮助列表页 + */ + public function helpDetailAction() + { + $this->setTitle('帮助中心'); + $this->setNavHeader('帮助中心'); + $data = array( + 'iHelp' => array( + array('name' => '新用户注册'), + ) + ); + $this->_view->display('helpDetail', $data); + } } diff --git a/yohobuy/m.yohobuy.com/application/models/Product/Detail.php b/yohobuy/m.yohobuy.com/application/models/Product/Detail.php index 36f6ce6..9c4aac8 100644 --- a/yohobuy/m.yohobuy.com/application/models/Product/Detail.php +++ b/yohobuy/m.yohobuy.com/application/models/Product/Detail.php @@ -121,11 +121,11 @@ class DetailModel $build['answer'] = $value['answer']; $result['feedbacks']['consults'][] = $build; } - $result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum'])); + $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum'])); } // 暂无咨询 else { - $result['feedbacks']['link'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId)); + $result['feedbacks']['consultsUrl'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId)); } // 商品评价 @@ -141,8 +141,8 @@ class DetailModel $build['time'] = $value['createTime']; $result['feedbacks']['comments'][] = $build; } - //$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum'])); - } + $result['feedbacks']['commentsUrl'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum'])); + } // 品牌信息 if (!empty($baseInfo['brand'])) { @@ -449,6 +449,11 @@ class DetailModel /** * 获取评价列表 + * + * @param int $productId 产品ID + * @param int $pageNum 页码数 + * @param int $pageSize 每页显示个数 + * @return array */ public static function getComments($productId, $pageNum = 1, $pageSize = 300) { @@ -456,13 +461,13 @@ class DetailModel if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) { $commentList = DetailData::commentList($productId, $pageNum, $pageSize); - if (!empty($commentList)) { + if (!empty($commentList['data'])) { $build = array(); - foreach ($commentList as $value) { - $build['userName'] = ''; - $build['desc'] = ''; - $build['content'] = ''; - $build['time'] = ''; + foreach ($commentList['data'] as $value) { + $build['userName'] = $value['nickname']; + $build['desc'] = $value['color_name'] . '/' . $value['size_name']; + $build['content'] = $value['content']; + $build['time'] = $value['create_time']; $result[] = $build; } } diff --git a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php index 42d439c..dcced4a 100644 --- a/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php +++ b/yohobuy/m.yohobuy.com/application/modules/Product/controllers/Detail.php @@ -90,7 +90,7 @@ class DetailController extends AbstractAction 'goodsCommentsPage' => true, 'pageFooter' => true, 'comments' => array( - 'list' => \Product\DetailModel::getConsults($productId), + 'list' => \Product\DetailModel::getComments($productId), ), );