Authored by ccbikai

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

... ... @@ -1243,6 +1243,6 @@
'cartInfo' : {
'numInCart' : 3,
'goodsInstore' : 0,
'isCollect':true
'isCollect':true//
}
}
... ...
... ... @@ -51,17 +51,17 @@ class CartData
}
/**
* 修改购物车商品数据
* 移入收藏夹
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $swapData)
public static function addToFav($uid, $sku)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.swap';
$param['swap_data'] = $swapData;
$param['method'] = 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
... ... @@ -69,17 +69,35 @@ class CartData
}
/**
* 移入收藏夹
* 获取购物车商品数据
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param int $skn 商品skn
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
public static function cartProductData($uid, $skn)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['method'] = 'app.product.data';
$param['product_skn'] = $skn;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $swapData)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.swap';
$param['swap_data'] = $swapData;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
... ...
... ... @@ -47,15 +47,6 @@ function search() {
slidesPerView: 'auto'
});
//优选
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -12,7 +12,6 @@ var goodsSwiper;
require('./desc');
require('./comments-consults');
require('./like');
require('../recommend-for-you.js');
lazyLoad($('img.lazy'));
... ...
... ... @@ -44,6 +44,6 @@ likeHammer.on('tap', function(e) {
});
$('#likeBtn').on('click', function(e) {
return false;
});
\ No newline at end of file
// $('#likeBtn').on('click', function(e) {
// return false;
// });
\ No newline at end of file
... ...
... ... @@ -106,3 +106,21 @@
color: #fff;
}
}
.systemMain{
width: 92%;
height: 100%;
overflow: hidden;
background-color:#444;
color: #fff;
padding:0 4%;
position: absolute;
top: 0;
left: 0;
p{
font-size: 52em / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
&:first-of-type{
padding-top: 90rem / $pxConvertRem;
}
}
}
\ No newline at end of file
... ...
.goods-comments-page {
.goods-comments {
.comment-item {
border: 1px solid $borderC;
border-bottom: 1px solid $borderC;
padding: 0 pxToRem(28px);
.user-name {
font-size: pxToRem(24px);
... ... @@ -39,12 +39,14 @@
}
.goods-consults-page {
background-color: #f0f0f0;
.goto-consult {
padding: 0 pxToRem(28px);
height: pxToRem(120px);
background-color: #ffffff;
i,
span {
span,
a {
line-height: pxToRem(120px);
font-size: pxToRem(28px);
color: $mainFontC;
... ... @@ -59,6 +61,7 @@
}
.goods-consults {
.consult-item {
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
.question {
... ... @@ -98,10 +101,10 @@
}
}
}
.gap-block {
min-height: 30rem/$pxConvertRem;
background-color: #f0f0f0;
}
// .gap-block {
// min-height: 30rem/$pxConvertRem;
// background-color: #f0f0f0;
// }
}
.consult-form-page {
... ...
... ... @@ -30,7 +30,8 @@ $basicBtnC:#eb0313;
left: pxToRem(30px);
right: auto;
}
.tag-container{
.tag-container {
position: absolute;
left: pxToRem(108px);
top: pxToRem(40px);
... ... @@ -40,14 +41,14 @@ $basicBtnC:#eb0313;
font-size: pxToRem(20px);
line-height: pxToRem(35px);
z-index: 2;
.good-tag{
.good-tag {
display: inline-block;
box-sizing: border-box;
margin-left: .5px;
font-size: pxToRem(23px);
text-align: center;
line-height: pxToRem(35px);
padding:0 8px;
padding: 0 8px;
}
.new-tag {
background-color: #78dc7e;
... ... @@ -69,11 +70,12 @@ $basicBtnC:#eb0313;
border: 1px solid #000;
color: #000;
}
.soonSoldOut-tag{
background-color:#ffac5b;
color:#fff;
.soonSoldOut-tag {
background-color: #ffac5b;
color: #fff;
}
}
.good-detail-page {
overflow: hidden;
background-color: #f0f0f0;
... ... @@ -105,14 +107,14 @@ $basicBtnC:#eb0313;
// .row {
// display: table-row;
.column {
box-sizing:border-box;
box-sizing: border-box;
display: table-cell;
padding: pxToRem(16px) pxToRem(12px);
width: 50%;
border: 1px solid #fff;
font-size: pxToRem(24px);
background-color: $tableCellC;
float:left;
float: left;
}
// }
}
... ... @@ -136,15 +138,15 @@ $basicBtnC:#eb0313;
position: absolute;
z-index: 2;
bottom: pxToRem(40px);
.pagination-inner{
span{
.pagination-inner {
span {
background-color: #b0b0b0;
}
.swiper-pagination-bullet {
margin-right: 2px;
}
.swiper-pagination-bullet-active {
background-color: #000 ;
background-color: #000;
}
}
}
... ... @@ -227,8 +229,47 @@ $basicBtnC:#eb0313;
vertical-align: middle;
}
}
.vip-level {
box-sizing: box-border;
padding-left: pxToRem(28px);
padding-right: pxToRem(28px);
min-height: pxToRem(88px);
background-color: #fff;
font-size: pxToRem(22px);
color: #999999;
border-bottom: 1px solid $borderC;
.icons-item {
float: left;
width: 33.3%;
height: pxToRem(88px);
margin: 0;
span {
vertical-align: middle;
display: inline-block;
line-height: pxToRem(88px);
}
.vip-img {
width: pxToRem(53px);
height: pxToRem(32px);
}
&:nth-child(3) .vip-img{
background: image-url('product/silver.png') no-repeat;
}
&:nth-child(2) .vip-img{
background: image-url('product/golden.png') no-repeat;
}
&:nth-child(1) .vip-img{
background: image-url('product/platinum.png') no-repeat;
}
&:first-child {
text-align: left;
}
&:last-child {
text-align: right;
}
}
}
.vipLevel {
width: 100%;
box-sizing: border-box;
background-color: #fff;
display: table;
... ... @@ -242,25 +283,24 @@ $basicBtnC:#eb0313;
display: table-cell;
vertical-align: middle;
}
.vip-img{
.vip-img {
padding-right: pxToRem(22px);
.img{
width: pxToRem(52px);
height: pxToRem(32px);
.img {
width: pxToRem(53px);
height: pxToRem(33px);
}
&:nth-child(3n-3) .img{
&:nth-child(3n-3) .img {
background: image-url('product/silver.png') no-repeat;
}
&:nth-child(3n-2) .img{
&:nth-child(3n-2) .img {
background: image-url('product/golden.png') no-repeat;
}
&:nth-child(3n-1) .img{
&:nth-child(3n-1) .img {
background: image-url('product/platinum.png') no-repeat;
}
}
.vip-price {
padding-right: pxToRem(55px);
padding-right: pxToRem(52px);
}
.vip-price:last-child {
padding-right: 0;
... ... @@ -295,7 +335,6 @@ $basicBtnC:#eb0313;
.goodsDiscount {
text-indent: pxToRem(-14px);
}
.enter-store {
min-height: pxToRem(100px);
display: table;
... ... @@ -327,7 +366,6 @@ $basicBtnC:#eb0313;
}
}
}
//底部固定栏
.cart-bar {
position: relative;
... ... @@ -350,10 +388,10 @@ $basicBtnC:#eb0313;
font-size: pxToRem(34px);
color: #ccc
}
&.favorite.liked{
color:$basicBtnC;;
&.favorite.liked {
color: $basicBtnC;
;
}
&.addto-cart,
&.sold-out {
height: pxToRem(80px);
... ... @@ -382,11 +420,10 @@ $basicBtnC:#eb0313;
font-size: pxToRem(24px);
}
}
.recommend-for-you{
.recommend-for-you {
margin-bottom: pxToRem(120px);
}
}
@import "comments-consults";
@import "product-description";
... ...
{{> layout/header}}
<div class="systemMain">
<P>尊敬的顾客:</P>
<P>您好!</P>
<P>为了向您提供更优质的服务,目前系统正在升级,请您耐心等待。</P>
<P>系统升级期间,部分地区用户体验会有暂 时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。</P>
<P>稍后系统将恢复正常使用,欢迎您继续光顾 YOHO!BUY 有货!</P>
<P>带来不便之处深表 歉意,请您谅解!</P>
<P>特此公告</P>
<P>YOHO!BUY 有货 客户服务中心。</P>
</div>
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="goods-comments-page yoho-page">
{{#comments}}
<div class="goods-comments">
<div class="goods-comments" id="goods-comments">
{{#list}}
<div class="comment-item">
<span class="user-name">
... ... @@ -21,6 +21,9 @@
</div>
{{/comments}}
{{#if loadmore}}
<input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
{{/if}}
</div>
{{> layout/footer}}
... ...
... ... @@ -3,12 +3,11 @@
<div class="goto-consult">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<i class="iconfont enter-consult-page">&#xe604;</i>
<a href="/consultform" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults">
<div class="goods-consults" id="goods-consults">
{{#list}}
<div class="gap-block"></div>
<div class="consult-item">
<div class="question">
<span class="iconfont">&#xe639;</span>
... ... @@ -27,5 +26,9 @@
{{/list}}
</div>
{{/ consults}}
{{#if loadmore}}
<input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
{{/if}}
</div>
{{> layout/footer}}
... ...
... ... @@ -53,6 +53,19 @@
</div>
{{# vipLevel}}
<ul class="vip-level clearfix">
{{# list}}
<li class="icons-item">
<span class="vip-img" style="background-size:cover;">
<!-- <div class="img" alt="" style="background-size:cover;"></div> -->
</span>
<span class="vip-price">{{text}}</span>
</li>
{{/ list}}
</ul>
{{/vipLevel}}
<!-- {{# vipLevel}}
<div class="vipLevel">
{{# list}}
<span class="vip-img">
... ... @@ -61,7 +74,7 @@
<span class="vip-price">{{text}}</span>
{{/ list}}
</div>
{{/ vipLevel}}
{{/ vipLevel}} -->
{{# goodsDiscount}}
<div class="goodsDiscount">
... ... @@ -112,17 +125,14 @@
{{#if numInCart}}
<span class="num-tag">{{numInCart}}</span>
{{/if}}
<a href="" class="num-incart iconfont">&#xe62c;</a>
<a href="/shoppingCart" class="num-incart iconfont">&#xe62c;</a>
{{#if goodsInstore}}
<a href="" class="addto-cart ">加入购物车</a>
{{else}}
<a href="" class="sold-out">已售罄</a>
{{/if}}
{{#if isCollect}}
<a href="#" id="likeBtn" class="favorite iconfont liked">&#xe605;</a>
<a href="/shoppingCart" class="addto-cart ">加入购物车</a>
{{else}}
<a href="" id="likeBtn" class="favorite iconfont">&#xe605;</a>
<a href="javascript:;" class="sold-out">已售罄</a>
{{/if}}
<a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a>
</div>
{{/cartInfo}}
... ...
... ... @@ -45,7 +45,7 @@
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{#if systemUpdate}}
<div class="systemUpdate">
<a href="systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a>
<a href="index/systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a>
<span>X</span>
</div>
{{/if}}
... ...
... ... @@ -166,7 +166,13 @@
{{!-- 商品详情评论 --}}
{{#if goodsCommentsPage}}
<script>
seajs.use('js/product/detail/comments-consults');
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情咨询 --}}
{{#if goodsConsultsPage}}
<script>
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 品类 --}}
... ...
... ... @@ -59,7 +59,7 @@
<span class="iconfont">&#xe63c;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<a href="/consultform">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -38,9 +38,11 @@ class IndexController extends AbstractAction
*
*/
public function systemUpdate()
public function systemUpdateAction()
{
$this->_view->display('systemUpdate','');
$this->setTitle('关于系统升级的公告');
$this->_view->display('systemUpdate');
}
}
... ...
... ... @@ -231,54 +231,19 @@ class ShoppingCartController extends AbstractAction
public function goodinfoAction()
{
$result = array();
if ($this->isAjax()) {
$data = array(
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',
'name' => '黄伟文Wyman X y yohood 联名商品YYYOHOOD圆领卫衣',
'price' => 289,
'salePrice' => 241,
'colors' => array(
array(
'id' => 1,
'name' => '黄色'
),
array(
'id' => 2,
'chosed' => true,
'name' => '白色'
)
),
'sizes' => array(
array(
'id' => 1,
'name' => 'XS'
),
array(
'id' => 2,
'name' => 'S'
),
array(
'id' => 3,
'chosed' => true,
'name' => 'M'
),
array(
'id' => 4,
'name' => 'L'
),
array(
'id' => 5,
'name' => 'XL'
),
array(
'id' => 6,
'name' => 'XXL'
)
),
'num' => 1
);
$num = $this->get('buy_num', 1);
$skn = $this->get('id', 1);
$result = CartModel::cartProductData($this->_uid, $skn, $num); // 测试skn的ID为51172055
$result['num'] = $num;
}
$this->echoJson(array('code' => 200, 'data' => $data));
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
}
... ...
... ... @@ -3,6 +3,7 @@
namespace Index;
use LibModels\Wap\Home\CartData;
use Plugin\Helpers;
use Plugin\Images;
/**
... ... @@ -98,6 +99,70 @@ class CartModel
}
/**
* 处理购物车商品数据
*
* @param int $uid 用户ID
* @param int $skn 商品skn
* @param int $num 购买数目
* @return array 接口返回的数据
*/
public static function cartProductData($uid, $skn, $num)
{
$result = array('code' => 400, 'message' => '出错啦~');
$product = CartData::cartProductData($uid, $skn);
if (isset($product['code']) && $product['code'] === 200) {
$result['code'] = 200;
$data = array();
$productData = $product['data'];
// 品牌信息
if (isset($productData['brand_info']) && !empty($productData['brand_info'])) {
$data['thumb'] = Helpers::getImageUrl($productData['brand_info']['brand_ico'], 120, 120);
}
$data['name'] = $productData['product_name'];
$data['price'] = $productData['market_price'];
$data['salePrice'] = $productData['sales_price'];
$data['storage'] = $productData['storage_sum'];
$data['num'] = $num;
// 商品选择
if (isset($productData['goods_list'])) {
$goodsList = $productData['goods_list'];
$colors = array();
$oneColor = array();
$sizes = array();
$oneSize = array();
foreach ($goodsList as $val) {
// 颜色
$oneColor = array();
$oneColor['id'] = $val['color_id'];
$oneColor['name'] = $val['color_name'];
// 尺码
foreach ($val['size_list'] as $one) {
$oneSize = array();
$oneSize['id'] = $one['size_id'];
$oneSize['name'] = $one['size_name'];
}
$sizes[] = $oneSize;
$oneColor['sizes'] = $sizes;
$colors[] = $oneColor;
}
$data['colors'] = $colors;
}
$result['data'] = $data;
}
return $result;
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
... ... @@ -135,6 +200,7 @@ class CartModel
// 购买的商品列表
foreach ($data['goods_list'] as $value) {
$oneGoods['id'] = $value['product_sku'];
$oneGoods['skn'] = $value['product_skn'];
$oneGoods['name'] = $value['product_name'];
$oneGoods['thumb'] = Images::getImageUrl($value['goods_images'], 120, 120);
$oneGoods['color'] = $value['color_name'];
... ...