Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -442,7 +442,7 @@ class AbstractAction extends Controller_Abstract
break;
}
}
$this->_view->assign('pageHeader', $header);
}
... ...
<?php
namespace LibModels\Wap\Home;
use Api\Yohobuy;
use Api\Sign;
/**
* 帮助中心数据模型
*
*/
class HelpData
{
/*
* 获取帮助列表(分类),缓存1h
* clientType客户端
*/
public static function serviceInfo()
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.help.li';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param, $param);
}
}
... ...
... ... @@ -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);
}
/**
... ...
... ... @@ -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() {
... ...
... ... @@ -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
... ...
... ... @@ -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;
... ...
{{> layout/header}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="iHelp">
<div class="helpSearch">
<input type="text" placeholder="查找关键字">
<i class="iconfont">&#xe60f;</i>
</div>
<ul>
{{# iHelp}}
<li><a href="{{ url }}"><span>{{ name }}</span><i class="iconfont num">&#xe604;</i></a></li>
<li><a href="/home/helpDetail?caption={{ caption}}"><span>{{ caption}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
... ...
... ... @@ -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
... ...
... ... @@ -4,13 +4,34 @@
<a href="{{#if backUrl}}{{backUrl}}{{^}}javascript:history.go(-1);{{/if}}" class="iconfont nav-back">&#xe610;</a>
{{/navBack}}
{{#navHome}}
<a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
<a class="iconfont nav-home">&#xe611;</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">&#xe638;</i>
{{/ navBtn}}
</header>
<div class="homebuttom none">
<ul>
<li>
<i class="iconfont">&#xe62e;</i>
<span>首页</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>分类</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>购物车</span>
</li>
<li>
<i class="iconfont">&#xe62e;</i>
<span>我的</span>
</li>
</ul>
</div>
{{/pageHeader}}
\ No newline at end of file
... ...
... ... @@ -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);
}
}
... ...
<?php
namespace Home;
use LibModels\Wap\Home\HelpData;
use Plugin\Helpers;
/**
* 帮助中心相关数据处理
*/
class HelpModel
{
/*
* 获取帮助中心列表
*/
public static function serviceInfo()
{
//调用接口获取数据
$res = json_decode(HelpData::serviceInfo(), TRUE);
$cateInfo = $res['data'];
$iHelp = array();
$list = array();
if ($cateInfo) {
foreach ($cateInfo as $key => $value) {
$iHelp[$key]['name'] = $value['caption'];
$iHelp[$key]['code'] = $value['code'];
}
}
return $iHelp;
}
}
... ...
... ... @@ -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;
}
}
... ...
... ... @@ -90,7 +90,7 @@ class DetailController extends AbstractAction
'goodsCommentsPage' => true,
'pageFooter' => true,
'comments' => array(
'list' => \Product\DetailModel::getConsults($productId),
'list' => \Product\DetailModel::getComments($productId),
),
);
... ...