Authored by ccbikai

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

... ... @@ -10,4 +10,8 @@ npm-debug.log
composer.lock
vendor/
.jscsrc
.jshintrc
\ No newline at end of file
.jshintrc
.tags
.tags_sorted_by_file
yohobuyP.sublime-project
yohobuyP.sublime-workspace
... ...
... ... @@ -767,4 +767,111 @@
price: '',
discount: ''
}
}
## 购物车
{
shoppingCart: {
cartNav: true, //显示预售和普通switch导航
commonGoodsCount: 2,
presellGoodsCount: 2, //普通商品和预售商品数目,显示在导航中
showLoginInfo: true, //是否显示登录提示
commonCart: {
goods: [
//购物车商品(见下),
...
],
freebieOrAdvanceBuy: true, //是否显示赠品和加价购
freebie: {
url: '',
count: 2
},
advanceBuy: {
url: '',
count: 1
},
price: 322,
activityPrice: 223, //活动价
count: 8,
sumPrice: 400
},
preSellCart: {
//同普通购物车
...
}
}
}
### 选择尺码、数目、颜色面板
{
thumb: '',
name: '',
price: '',
salePrice: '',
colors: [
{
id: 1,
chosed: true,
name: '黄色'
},
...
],
sizes: [
{
id: 2,
chosed: true,
name: 'X'
},
...
],
num: 2
}
### 购物车商品
{
id: 1,
thumb: '',
name: '',
color: '黄色',
size: 'L',
appearDate: '12月', //上市期
price: 200,
count: 2,
soldOut: true, //售罄
lowStocks: true, //库存不足
}
### 赠品和加价购
{
shoppingCart: {
gift: [
//赠品(见下)
],
//or
advance: [
{
title: '',
goods: [
//加价购商品(见下)
]
}
]
}
}
### 赠品和加价购商品
{
id: 1,
thumb: '',
name: '',
color: '黄色',
size: 'L', //颜色和尺寸需要显示就传,不显示不传
price: 562,
count: 3
}
\ No newline at end of file
... ...
... ... @@ -354,6 +354,11 @@ class AbstractAction extends Controller_Abstract
{
$header = array();
// 判断是否是微信浏览器浏览
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false) {
$header['isShow'] = true;
}
if ($backUrl) {
$header['navBack'] = true;
}
... ...
... ... @@ -63,13 +63,13 @@ function hideSideBar() {
}
}
$('.overlay').on('touchend', function(e) {
$('.overlay').on('touchstart', function(e) {
hideSideBar();
return false;
});
//点击一级导航,弹出二级导航
$sideNav.on('touchend', 'li', function (e) {
$sideNav.on('touchstart', 'li', function (e) {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
... ... @@ -83,12 +83,12 @@ $sideNav.on('touchend', 'li', function (e) {
//返回一级导航,收起二级导航
$subNav.each(function () {
$(this).find('li').eq(0).on('touchend', function (e) {
$(this).find('li').eq(0).on('touchstart', function (e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
return false;
});
}).on('touchend', function(e) {
}).on('touchstart', function(e) {
if (e.currentTarget !== e.target) {
$subNav.find('li').removeClass('current');
}
... ...
... ... @@ -4,14 +4,18 @@
* @date: 2015/10/20
*/
var $ = require('jquery');
var $ = require('jquery'),
Hammer = require('yoho.hammer');
var $cartContent = $('.cart-content');
var navHammer;
require('./good');
$('.cart-nav').delegate('li', 'tap', function() {
var $this = $(this);
navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);
navHammer.on('tap', function(e) {
var $this = $(e.target).closest('li');
if ($this.hasClass('active')) {
return;
... ...
... ... @@ -5,8 +5,8 @@
* @date: 2015/10/21
*/
var $ = require('jquery');
var Handlebars = require('yoho.handlebars');
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
var $page = $('.yoho-page');
... ... @@ -37,7 +37,7 @@ function remove() {
$('.chose-panel').remove();
}
$('.yoho-page').delegate('.chose-panel', 'tap', function(e) {
$('.yoho-page').on('touchstart', '.chose-panel', function(e) {
var $cur = $(e.target);
if ($cur.closest('.main').length > 0) {
... ... @@ -46,10 +46,10 @@ $('.yoho-page').delegate('.chose-panel', 'tap', function(e) {
//点击蒙版消失
remove();
}).delegate('#chose-btn-sure', 'tap', function() {
}).on('touchstart', '#chose-btn-sure', function() {
//确定
}).delegate('.block', 'tap', function() {
}).on('touchstart', '.block', function() {
//尺寸颜色点选
var $this = $(this);
... ... @@ -60,7 +60,7 @@ $('.yoho-page').delegate('.chose-panel', 'tap', function(e) {
$this.siblings('.chosed').removeClass('chosed');
$this.addClass('chosed');
}).delegate('.btn-minus', 'tap', function() {
}).on('touchstart', '.btn-minus', function() {
var num = +$num.val();
if (num === 1) {
... ... @@ -68,7 +68,7 @@ $('.yoho-page').delegate('.chose-panel', 'tap', function(e) {
}
$num.val(num - 1);
}).delegate('.btn-plus', 'tap', function() {
}).on('touchstart', '.btn-plus', function() {
var num = +$num.val();
//TODO:库存数验证
... ...
... ... @@ -10,21 +10,16 @@ var $ = require('jquery'),
var chosePanel = require('./chose-panel');
function docTouchEvt(e) {
var $tar = $(e.target);
var $curDelPanel;
if ($tar.closest('.opt-panel').length === 0) {
$('.opt-panel:not(.hide)').addClass('hide');
//删除面板显示后任何点击行为都将触发隐藏面板
function docTouchEvt() {
$curDelPanel && $curDelPanel.addClass('hide');
//
$(document).unbind('tap', docTouchEvt);
}
//
$(document).off('touchstart', docTouchEvt);
}
// function unbindDocTouchEvt(e) {
// $(document).unbind('tap', docTouchEvt);
// }
ellipsis.init();
lazyLoad($('.lazy'));
... ... @@ -32,7 +27,7 @@ lazyLoad($('.lazy'));
$('.name')[0].mlellipsis(2);
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').delegate('.checkbox', 'tap', function() {
$('.cart-goods').on('touchstart', '.checkbox', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
... ... @@ -40,7 +35,7 @@ $('.cart-goods').delegate('.checkbox', 'tap', function() {
} else {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
}).delegate('.icon-edit', 'tap', function() {
}).on('touchstart', '.icon-edit', function() {
var id = $(this).closest('.shopping-cart-good').data('id');
$.ajax({
... ... @@ -55,36 +50,36 @@ $('.cart-goods').delegate('.checkbox', 'tap', function() {
}
}
});
}).delegate('.icon-del', 'tap', function(e) {
}).on('touchstart', '.icon-del', function(e) {
e.stopPropagation();
$(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
//手动触发docTouchEvt清除因点击到del按钮上而被阻止冒泡到doc上的事件从而清除已打开的删除面板
docTouchEvt();
$curDelPanel = $(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
$(document).bind('tap', docTouchEvt);
}).delegate('.opt-panel', 'tap', function() {
$(document).on('touchstart', docTouchEvt);
}).on('touchstart', '.opt-panel', function() {
var $this = $(this),
id = $this.closest('.shopping-cart-good').data('id');
id = $this.closest('.shopping-cart-good').data('id'),
url;
if ($this.closest('.put-in-favorite')) {
//移入收藏夹
$.ajax({
type: 'POST',
url: '/shoppingCart/col',
data: {
id: id
}
});
url = '/shoppingCart/col';
} else {
//删除
$.ajax({
type: 'POST',
url: '/shoppingCart/del',
data: {
id: id
}
});
url = '/shoppingCart/del';
}
$.ajax({
type: 'POST',
url: url,
data: {
id: id
}
});
});
... ...
... ... @@ -21,7 +21,7 @@
"yoho.iswiper": "3.0.1",
"iscroll": "5.1.2",
"import-style": "1.0.0",
"yoho.lazyload": "1.1.0",
"yoho.lazyload": "1.1.2",
"yoho.handlebars": "3.0.3",
"yoho.hammer": "2.0.4"
},
... ...
.brand-page {
.newbrand-search {
width: 93.75%;
height: 60rem / $pxConvertRem;
... ...
.yoho-footer {
font-size: 12px;
background-color: #fff;
margin-bottom: 2.5rem;
.op-row {
position: relative;
... ...
... ... @@ -107,8 +107,9 @@
.opt-panel {
position: absolute;
width: 220rem / $pxConvertRem;
height: 190rem / $pxConvertRem;
right: 0;
top: 0;
bottom: 0;
color: #fff;
... ...
... ... @@ -8,14 +8,14 @@
padding-bottom: 120rem / $pxConvertRem;
.cart-nav {
height: 30rem / $pxConvertRem;
color: #c6c6c6;
border-bottom: 1px solid #e0e0e0;
padding: 30rem / $pxConvertRem 0;
li {
float: left;
width: 50%;
padding: 30rem / $pxConvertRem 0;
height: 30rem / $pxConvertRem;
}
li.active {
... ...
... ... @@ -2,7 +2,7 @@
<div class="shopping-cart-page yoho-page">
{{# shoppingCart}}
{{#if cartNav}}
<ul class="cart-nav">
<ul class="cart-nav clearfix">
<li class="active">
<span>
普通商品({{commonGoodsCount}})
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up">&#xe615;</i>
<i class="iconfont down cur">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{> filter}}
</div>
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
{{/if}}
{{#if gender}}
<input id="gender" type="hidden" value={{gender}}>
{{/if}}
{{#if sort}}
<input id="sort" type="hidden" value={{sort}}>
{{/if}}
{{#if msort}}
<input id="msort" type="hidden" value={{msort}}>
{{/if}}
{{#if misort}}
<input id="misort" type="hidden" value={{misort}}>
{{/if}}
{{#if color}}
<input id="color" type="hidden" value={{color}}>
{{/if}}
{{#if size}}
<input id="size" type="hidden" value={{size}}>
{{/if}}
{{#if price}}
<input id="price" type="hidden" value={{price}}>
{{/if}}
{{#if p_d}}
<input id="p_d" type="hidden" value={{p_d}}>
{{/if}}
{{#if channel}}
<input id="channel" type="hidden" value={{channel}}>
{{/if}}
{{#if limit}}
<input id="limit" type="hidden" value={{limit}}>
{{/if}}
{{#if page}}
<input id="page" type="hidden" value={{page}}>
{{/if}}
{{#if discount}}
<input id="discount" type="hidden" value={{discount}}>
{{/if}}
{{> product/suspend-cart}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{#pageHeader}}
{{# isShow}}
<header class="yoho-header{{#if boys}} boys{{/if}}{{#if girls}} girls{{/if}}{{#if kids}} kids{{/if}}{{#if lifeStyle}} life-style{{/if}}">
{{#if navBack}}
<a href="javascript:history.go(-1);" class="nav-back"></a>
... ... @@ -10,4 +11,5 @@
<p class="nav-title">{{.}}</p>
{{/navTitle}}
</header>
{{/ isShow}}
{{/pageHeader}}
\ No newline at end of file
... ...
... ... @@ -32,14 +32,14 @@
<div class="price-compute">
<p class="sum-price">
<span class="title">总价</span>
{{price}}
¥{{price}}
</p>
<p class="activity-price">
<span class="title">
活动价
<i class="minus">-</i>
</span>
{{activityPrice}}
¥{{activityPrice}}
</p>
</div>
... ... @@ -47,11 +47,11 @@
<span class="iconfont icon-cb-checked"></span>
<p>
<span>
{{count}}件总计:{{sumPrice}}
{{count}}件总计:¥{{sumPrice}}
</span>
<span class="tip">(不含运费)</span>
</p>
<button class="btn-balance">
结算
</button>
</div>
\ No newline at end of file
</div>
\ No newline at end of file
... ...
... ... @@ -6,9 +6,9 @@
<div class="text-info">
<p class="name">{{name}}</p>
<p class="price">
<span class="sale-price{{^price}} no-price{{/price}}">{{salePrice}}</span>
<span class="sale-price{{^price}} no-price{{/price}}">¥{{salePrice}}</span>
{{#if price}}
<span class="market-price">{{price}}</span>
<span class="market-price">¥{{price}}</span>
{{/if}}
</p>
</div>
... ...
... ... @@ -20,7 +20,7 @@
</p>
<p class="row">
<span class="price">
{{price}}
¥{{price}}
</span>
<span class="count">
×{{count}}
... ...
... ... @@ -25,7 +25,7 @@
</p>
<p class="row">
<span class="price">
{{price}}
¥{{price}}
</span>
<span class="count">
×{{count}}
... ...
... ... @@ -134,9 +134,9 @@ class ShoppingCartController extends AbstractAction
public function tplAction()
{
if($this->isAjax()) {
//$data = file_get_contents('../../../template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml');
$data = file_get_contents('../../../template/m.yohobuy.com/partials/shopping-cart/chose-panel.phtml');
//echo($data);
echo($data);
}
}
... ...
... ... @@ -70,6 +70,33 @@ class NewsaleController extends AbstractAction
}
/**
* 热销排行榜
*
* @param int channel 1:男生,2:女生,3:潮童,4:创意生活
*/
public function hotrankAction()
{
$this->setTitle('热销排行榜');
$this->setNavHeader('热销排行榜');
// 设置一些默认参数
$data = array(
'discountPage' => true,
'showDownloadApp' => true,
'pageFooter' => true,
'brand' => '0',
'sort' => '0',
'gender' => Helpers::getGenderByCookie(),
'price' => '0',
'size' => '0',
'discount' => '0.1,0.9',
'cartUrl' => Helpers::url('/cart/index/index', null),
);
$this->_view->display('hotrank', $data);
}
/**
* Ajax方式筛选新品到着、折扣专区商品
*
* @return array 根据指定条件筛选之后的商品
... ...
... ... @@ -53,6 +53,6 @@ application.assets.path = ROOT_PATH "/assets"
application.version = "1.1.5"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
application.seo.title = "Yoho!Buy有货 丨 年轻人潮流购物中心"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
... ...
... ... @@ -53,7 +53,7 @@ application.assets.path = ROOT_PATH "/assets"
application.version = "1.1.5"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
application.seo.title = "Yoho!Buy有货 丨 年轻人潮流购物中心"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
... ...
... ... @@ -53,7 +53,7 @@ application.assets.path = ROOT_PATH "/assets"
application.version = "1.1.5"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
application.seo.title = "Yoho!Buy有货 丨 年轻人潮流购物中心"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
... ...
... ... @@ -53,6 +53,6 @@ application.assets.path = ROOT_PATH "/assets"
application.version = "1.1.5"
; 网站SEO信息
application.seo.title = "Yoho!Buy有货"
application.seo.title = "Yoho!Buy有货 丨 年轻人潮流购物中心"
application.seo.keywords = "Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"
application.seo.description = "YOHO! 有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"
... ...
... ... @@ -89,6 +89,13 @@ routes.productsale.route.module = Product
routes.productsale.route.controller = Newsale
routes.productsale.route.action = Discount
; 热销排行榜
routes.productsale.type = "rewrite"
routes.productsale.match = "/hotrank"
routes.productsale.route.module = Product
routes.productsale.route.controller = Newsale
routes.productsale.route.action = Hotrank
; 女生首页
routes.girls.type = "rewrite"
routes.girls.match = "/girl$"
... ...