Authored by 梁志锋

merge APP4.3

... ... @@ -54,17 +54,24 @@ class IndexData
* @param string $contentCode 内容位置码
* @param integer $limit 查询返回的最大限字数,默认为20
* @param integer $page 分页第几页,默认为第1页
* @param integer $uid 用户id
* @modify sefon 2016-4-19 13:33:49
* @return array 首页频道数据
*/
public static function getResourceData($gender, $contentCode, $limit = 20, $page = 1)
public static function getResourceData($gender, $contentCode, $limit = 20, $page = 1, $uid = 0)
{
$param = Yohobuy::param();
if ($uid) {
$param['uid'] = $uid;
} else {
//新设备(用户未登录状态,默认新设备):Y/N
$param['new_device'] = 'Y';
}
$param['gender'] = $gender;
$param['content_code'] = $contentCode;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/home', $param, false, false, 2);
}
... ...
... ... @@ -451,4 +451,34 @@ class FloorProcess
return $result;
}
/**
* 新人专享
* @param $data
* @param $type
* @author sefon 2016-4-19 11:43:56
* @return array
*/
private static function new_user_floor($data, $type)
{
$result = array();
$result['title']['title'] = $data['title']['title'];
if ($data['title']['more_url']) {
$result['title']['more_url'] = $data['title']['more_url'];
}
$result['big_image']['url'] = $data['banner_image'][0]['url'];
$result['big_image']['title'] = $data['banner_image'][0]['title'];
$result['big_image']['img'] = Helpers::getImageUrl($data['banner_image'][0]['src'], 640, 200);
if (empty($data['list'])) {
return $result;
}
foreach ($data['list'] as $key => $val) {
$result['list'][$key]['url'] = Helpers::getUrlBySkc($val['product_id'], $val['goods_list'][0]['goods_id'], $val['cn_alphabet']);
$result['list'][$key]['img'] = helpers::getImageUrl($val['default_images'], 235, 314);
$result['list'][$key]['title'] = $val['product_name'];
$result['list'][$key]['salePrice'] = number_format($val['sales_price'], 2);
$result['list'][$key]['price'] = number_format($val['market_price'], 2);
}
return array('freshOnly'=>$result);
}
}
\ No newline at end of file
... ...
... ... @@ -695,7 +695,7 @@ class Helpers
* @param int $count 计商品件数
* @return array $arr 处理之后的加价购商品数据
*/
public static function formatAdvanceGoods($advanceGoods, &$count = 0)
public static function formatAdvanceGoods($advanceGoods, &$count = 0, $isGift = false)
{
$arr = array();
... ... @@ -714,7 +714,7 @@ class Helpers
$oneGoods['name'] = $single['product_name'];
$oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : '';
$oneGoods['price'] = self::transPrice($single['last_price']);
$oneGoods['marketPrice'] = self::transPrice($single['market_price']);
$oneGoods['marketPrice'] = $isGift ? '0.00' : self::transPrice($single['market_price']);
$oneGoods['count'] = $single['storage_number'];
$gift['goods'][] = $oneGoods;
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
/**
* 新人专享
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/3/3
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
lazyLoad($('img.lazy'));
\ No newline at end of file
.fresh-swiper {
position: relative;
height: 200px;
overflow: hidden;
ul {
ul {
li {
float: left;
width: 100%;
... ... @@ -17,17 +17,17 @@
position: absolute;
left: 0;
right: 0;
bottom: 20px;
bottom: 20rem / $pxConvertRem;
text-align: center;
.pagination-inner {
display: inline-block;
span {
display: inline-block;
width: 14px;
height: 14px;
width: 14rem / $pxConvertRem;
height: 14rem / $pxConvertRem;
background: #fff;
opacity: 0.5;
margin: 0 9px;
margin: 0 (9rem / $pxConvertRem);
border-radius: 50%;
}
span.swiper-active-switch {
... ... @@ -39,8 +39,9 @@
.fresh-list-swiper {
overflow: hidden;
padding-bottom: 15px;
padding-bottom: 15rem / $pxConvertRem;
background-color: #fff;
height: 470rem / $pxConvertRem;
ul {
box-sizing: border-box;
... ... @@ -48,26 +49,31 @@
li {
float:left;
width:240px;
margin: 20px 10px 0 10px;
width:240rem / $pxConvertRem;
margin: (20rem / $pxConvertRem) (10rem / $pxConvertRem) 0 (10rem / $pxConvertRem);
border: none;
&:first-child {
margin-left: 20px;
margin-left: 20rem / $pxConvertRem;
}
&:last-child {
margin-right: 20px;
margin-right: 20rem / $pxConvertRem;
}
.img-box {
height: 100%;
height:320px;
width: 100%;
height:320rem / $pxConvertRem;
overflow: hidden;
text-align: center;
position: relative;
img {
width: 100%;
height: 100%;
height: 320rem / $pxConvertRem;
vertical-align: middle;
border: none;
outline: none;
}
}
... ... @@ -79,34 +85,33 @@
width: 100%;
white-space: nowrap;
color: #444;
line-height: 48px;
font-size: 22px;
line-height: 48rem / $pxConvertRem;
font-size: 22rem / $pxConvertRem;
}
.cur-price {
color: #d62927;
font-size: 22px;
font-size: 22rem / $pxConvertRem;
}
.old-price {
margin: 0 0 0 10px;
margin: 0 0 0 (10rem / $pxConvertRem);
color: #b0b0b0;
text-decoration: line-through;
font-size: 22px;
font-size: 22rem / $pxConvertRem;
}
.fresh-icon {
background: #d62927;
width: 100px;
height: 33px;
width: 100rem / $pxConvertRem;
height: 20px;
display: block;
margin: 8px auto 0 auto;
margin: (8rem / $pxConvertRem) auto 0 auto;
color: #fff;
text-align: center;
border-radius: 40px;
line-height: 37px;
font-size:12px;
border-radius: 40rem / $pxConvertRem;
line-height: 20px;
}
}
}
... ... @@ -114,5 +119,5 @@
.fresh-list{
position: relative;
padding:15px 0 0 15px;
padding:(15rem / $pxConvertRem) 0 0 (15rem / $pxConvertRem);
}
\ No newline at end of file
... ...
@import "header-download", "banner-top","banner-center","banner-bottom", "side-nav", "floor-header", "hot-brands", "fine-brands", "creative-life", "plus-star", "maybe-like",
"icons-enter","trendsetter-collocation",
"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row";
"trend-topics","goods-category","hot-brands", "hot-category", "home-header", "thumb-row", "fresh-only";
.mobile-container{
width: 100%;
... ...
... ... @@ -31,16 +31,6 @@
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</div>
<div class="connect-item connect-tel">
<a href="tel:400-889-9646" title="电话客服">
<span class="icon iconfont icon-tel">&#xe63e;</span>
电话客服
<p>
400-889-9646 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
</p>
</a>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="fresh-list">
{{# freshList}}
{{> good}}
{{/freshList}}
</ul>
{{> layout/footer}}
\ No newline at end of file
... ... @@ -51,6 +51,10 @@
{{# plusStar}}
{{> home/plus_star}}
{{/ plusStar}}
{{! 新人专享}}
{{# freshOnly}}
{{> home/fresh_only}}
{{/ freshOnly}}
{{/ content}}
{{! 可能喜欢}}
... ...
... ... @@ -47,6 +47,10 @@
{{# plusStar}}
{{> home/plus_star}}
{{/ plusStar}}
{{! 新人专享}}
{{# freshOnly}}
{{> home/fresh_only}}
{{/ freshOnly}}
{{/ content}}
{{! 可能喜欢}}
... ...
{{# title}}
<div class="floor-header-more">
<h2>{{title}}</h2>
<a class="more-btn iconfont" href="{{more_url}}">&#xe618;</a>
{{#if more_url}}
<a class="more-btn iconfont" href="{{more_url}}">&#xe618;</a>
{{/if}}
</div>
{{/ title}}
\ No newline at end of file
... ...
... ... @@ -22,11 +22,11 @@
<p class="price">
<span class="cur-price"{{salePrice}}</span>
{{# price}}
<span class="old-price"{{.}}<span>
<span class="old-price"{{.}}</span>
{{/price}}
</p>
<span class="fresh-icon">新人价</span>
</div>
</div>
</li>
{{/ list}}
</ul>
... ...
... ... @@ -12,9 +12,9 @@
{{#currencyDetailPage}}
<a href="/home/helpDetail?code=20111130-152530&caption=如何使用YOHO币支付" class="iconfont nav-home">&#xe639;</a>
{{/currencyDetailPage}}
{{#navPhone}}
<a href="{{.}}" class="iconfont nav-home">&#xe641;</a>
{{/navPhone}}
{{#serviceUrl}}
<a href="{{serviceUrl}}" target="_blank" class="iconfont nav-home">&#xe63c;</a>
{{/serviceUrl}}
{{#navTitle}}
<p class="nav-title">{{.}}</p>
{{/navTitle}}
... ...
... ... @@ -22,15 +22,14 @@ class BoysController extends AbstractAction
// 设置浏览器缓存5分钟
$this->setExpires(300); // 缓存5分钟
}
// 设置网站标题
$this->setTitle('男生首页');
// 显示侧边栏
$this->setNavSide('boys');
// 显示底部TAB
$this->setNavFooterTab();
$content = Index\HomeModel::getBoysFloor();
$uid = $this->getUid(true);
$content = Index\HomeModel::getBoysFloor($uid);
// $content[] = array(
// 'notice' => array(
// 'open' => true,
... ...
... ... @@ -23,13 +23,13 @@ class GirlsController extends AbstractAction
$this->setNavSide('girls');
// 显示底部TAB
$this->setNavFooterTab();
$uid = $this->getUid(true);
// 渲染模板并输出
$this->_view->display('index', array(
'grilsHomePage' => true,
'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
'maybeLike' => true,
'content' => Index\HomeModel::getGirlsFloor(),
'content' => Index\HomeModel::getGirlsFloor($uid),
'pageFooter' => true,
));
}
... ...
... ... @@ -1033,7 +1033,7 @@ class HomeController extends AbstractAction
$this->_view->display('order-detail', array(
'orderDetailPage' => true,
'navPhone' => 'tel:400-889-9646',
'serviceUrl' => 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=',
'orderDetail' => $orderDetail,
'orderCode' => $orderCode,
'orderTotal' => isset($orderDetail['goodsAmount']) ? $orderDetail['goodsAmount'] : 0,
... ...
... ... @@ -23,13 +23,13 @@ class KidsController extends AbstractAction
$this->setNavSide('kids');
// 显示底部TAB
$this->setNavFooterTab();
$uid = $this->getUid(true);
// 渲染模板并输出
$this->_view->display('index', array(
'kidsHomePage' => true,
'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
'maybeLike' => true,
'content' => Index\HomeModel::getKidsFloor(),
'content' => Index\HomeModel::getKidsFloor($uid),
'pageFooter' => true,
));
}
... ...
... ... @@ -23,13 +23,13 @@ class LifestyleController extends AbstractAction
$this->setNavSide('lifestyle');
// 显示底部TAB
$this->setNavFooterTab();
$uid = $this->getUid(true);
// 渲染模板并输出
$this->_view->display('index', array(
'lifestyleHomePage' => true,
'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
'maybeLike' => true,
'content' => Index\HomeModel::getLifestyleFloor(),
'content' => Index\HomeModel::getLifestyleFloor($uid),
'pageFooter' => true,
));
}
... ...
... ... @@ -3,6 +3,7 @@
namespace Index;
use LibModels\Wap\Home\CartData;
use LibModels\Wap\Home\OrderData;
use Plugin\Helpers;
use Plugin\Images;
... ... @@ -869,7 +870,8 @@ class CartModel
if ($onlyGift) {
// 赠品
$result['freebie'] = Helpers::formatAdvanceGoods($data['gift_list']);
$count = 0;
$result['freebie'] = Helpers::formatAdvanceGoods($data['gift_list'], $count, true);
break;
}
if ($onlyAdvanceBuy) {
... ... @@ -932,4 +934,24 @@ class CartModel
return $result;
}
/**
* 支付成功页
*/
public static function paySuccessData($orderCode, $uid)
{
$result = array();
$orderInfo = OrderData::viewOrderData($orderCode, $uid, '');
if (isset($orderInfo['code']) && $orderInfo['code'] == 200 && !empty($orderInfo['data'])) {
if ($orderInfo['data']['payment_amount'] > 0) {
$result['price'] = $orderInfo['data']['payment_amount'];
}
}
$param = array('order_code'=>$orderCode);
$result['guang'] = Helpers::url('','','guang');
$result['orderDetail'] = Helpers::url('/home/orderDetail',$param);
return $result;
}
}
... ...
... ... @@ -178,10 +178,9 @@ class HomeModel
*
* @return array | false
*/
public static function getBoysFloor()
public static function getBoysFloor($uid = 0)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_BOYS_INDEX, 'master');
... ... @@ -189,9 +188,8 @@ class HomeModel
return $result;
}
}
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('1,3', self::CODE_FLOOR_BOYS);
$channelData = IndexData::getResourceData('1,3', self::CODE_FLOOR_BOYS, 20, 1, $uid);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data']);
}
... ... @@ -215,7 +213,7 @@ class HomeModel
*
* @return array | false
*/
public static function getGirlsFloor()
public static function getGirlsFloor($uid = 0)
{
$result = array();
... ... @@ -228,7 +226,7 @@ class HomeModel
}
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('2,3', self::CODE_FLOOR_GIRLS);
$channelData = IndexData::getResourceData('2,3', self::CODE_FLOOR_GIRLS, 20, 1, $uid);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data'], 2);
}
... ... @@ -249,10 +247,11 @@ class HomeModel
/**
* 获取潮童首页的楼层数据
*
* @param int $uid
* @modify sefon 2016-4-19 13:21:28
* @return array | false
*/
public static function getKidsFloor()
public static function getKidsFloor($uid = 0)
{
$result = false;
... ... @@ -267,7 +266,7 @@ class HomeModel
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('', self::CODE_FLOOR_KIDS);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data'], 3);
$result = FloorProcess::getContent($channelData['data'], 3, 20, 1, $uid);
}
if (USE_CACHE) {
... ... @@ -286,10 +285,11 @@ class HomeModel
/**
* 获取创意生活首页的楼层数据
*
* @param int $uid
* @modify sefon 2016-4-19 13:22:34
* @return array | false
*/
public static function getLifestyleFloor()
public static function getLifestyleFloor($uid = 0)
{
$result = false;
... ... @@ -302,7 +302,7 @@ class HomeModel
}
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
$channelData = IndexData::getResourceData('', self::CODE_FLOOR_LIFESTYLE);
$channelData = IndexData::getResourceData('', self::CODE_FLOOR_LIFESTYLE, 20, 1, $uid);
if (isset($channelData['code']) && $channelData['code'] == 200) {
$result = FloorProcess::getContent($channelData['data'], 4);
}
... ...