Authored by ccbikai

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

... ... @@ -893,4 +893,37 @@
//查看全部VIP特权页面
all: true
}
}
### 我的订单
{
order: {
allOrders: [
...
]
}
}
//订单
{
orderNum: '',
tradingStatus: '',
goods: [
{
id: '',
thumb: '',
gift: true, //是否赠品
advanceBuy: true, //是否加价购
name: '',
color: '黄色',
size: 'X',
price: '588',
count: 2
},
...
],
count: 1,
sumCost: '199.00'
}
\ No newline at end of file
... ...
... ... @@ -8,5 +8,6 @@ require('./js/home/entry');
require('./js/index/entry');
require('./js/passport/entry');
require('./js/product/entry');
require('./js/me/entry');
module.exports = yohobuy;
... ...
/**
* 个人中心js打包入口文件
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/10
*/
require('./order');
\ No newline at end of file
... ...
/**
* 个人中心--我的订单
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/10
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
var $navLi = $('#order-nav > li'),
$orderContainer = $('#order-container');
var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container
var navHammer;
lazyLoad();
navHammer = new Hammer(document.getElementById('order-nav'));
navHammer.on('tap', function(e) {
var $cur = $(e.target).closest('li'),
index;
if ($cur.length === 0 || $cur.hasClass('active')) {
return;
}
index = $cur.index();
$navLi.filter('.active').removeClass('active');
$cur.addClass('active');
$curContainer.addClass('hide');
$curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide');
});
... ...
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
\ No newline at end of file
... ...
@import "home", "vip-grade";
\ No newline at end of file
@import "home", "vip-grade", "order";
\ No newline at end of file
... ...
.order-page {
background: #f0f0f0;
.order {
background: #fff;
margin: 30rem / $pxConvertRem 0;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
.header, .footer {
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
font-size: 30rem / $pxConvertRem;
padding: 0 30rem / $pxConvertRem;
}
.header {
border-bottom: 1px solid #e0e0e0;
}
.trading-status {
float: right;
}
.footer {
text-align: right;
border-top: 1px solid #e0e0e0;
}
.sum-cost {
color: #e01;
}
}
}
.order-nav {
border-bottom: 1px solid #e0e0e0;
background: #fff;
> li{
float: left;
height: 90rem / $pxConvertRem;
width: 25%;
line-height: 90rem / $pxConvertRem;
color: #b0b0b0;
font-size: 26rem / $pxConvertRem;
text-align: center;
&.active {
color: #000;
}
}
}
.order-good {
position: relative;
padding: 20rem / $pxConvertRem 0;
margin-left: 34rem / $pxConvertRem;
height: 160rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
font-size: 26rem / $pxConvertRem;
&:last-child {
border-bottom: none;
}
.thumb-wrap {
position: relative;
float: left;
width: 120rem / $pxConvertRem;
height: 160rem / $pxConvertRem;
}
.thumb {
width: 100%;
height: 100%;
}
.tag {
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: #fff;
text-align: center;
font-size: 12px;
}
.gift-tag {
height: 25rem / $pxConvertRem;
background: #a1ce4e;
&:before {
content: '赠品';
}
}
.advance-buy-tag {
height: 25rem / $pxConvertRem;
background: #eb76aa;
&:before {
content: '加价购';
}
}
.deps {
margin-left: 135rem / $pxConvertRem;
}
.name {
font-size: 28rem / $pxConvertRem;
max-width: 70%;
}
.row:nth-child(2) {
height: 45rem / $pxConvertRem;
line-height: 45rem / $pxConvertRem;
> span {
margin-right: 15rem / $pxConvertRem;
}
}
.color, .size {
color: #b6b6b6;
}
.price-wrap {
position: absolute;
top: 20rem / $pxConvertRem;
right: 30rem / $pxConvertRem;
}
.price {
color: #e01;
}
.count {
display: block;
color: #999;
text-align: right;
line-height: 45rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
.rank-main {
padding: (14rem / $pxConvertRem) 0 0 (30rem / $pxConvertRem);
background: #fff;
li {
height: 230rem / $pxConvertRem;
overflow: hidden;
.item-img {
float: left;
width: 150rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
padding: (14rem / $pxConvertRem) 0;
line-height: 200rem / $pxConvertRem;
text-align: center;
img {
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
}
.item-content {
float: left;
width: 407rem / $pxConvertRem;
height: 213rem / $pxConvertRem;
margin: 0 0 0 (13rem / $pxConvertRem);
padding: (14rem / $pxConvertRem) 0 0 (30rem / $pxConvertRem);
border-top: 1px solid #e0e0e0;
overflow: hidden;
.rank-icon {
display: block;
height: 45rem / $pxConvertRem;
width: 50rem / $pxConvertRem;
line-height: 50rem / $pxConvertRem;
text-align: center;
font-size: 22rem / $pxConvertRem;
color: #fff;
background: image-url("sale-icon/rank.png") no-repeat;
background-position: center top;
background-size: auto 100%;
&.top {
background: image-url("sale-icon/rank-t.png") no-repeat;
background-position: center top;
background-size: 100%;
line-height: 58rem / $pxConvertRem;
}
}
h2 {
margin: (15rem / $pxConvertRem) 0 0 !important;
padding: 0 !important;
width: 9.5rem;
line-height: 36rem / $pxConvertRem;
color: #444;
font-size: 28rem / $pxConvertRem;
&.hasActive {
margin: (5rem / $pxConvertRem) 0 0 !important;
}
}
p {
margin: 0 !important;
padding: 0 !important;
width: 9.5rem;
line-height: 36rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
color: #d0021b;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
span {
text-decoration: line-through;
color: #b0b0b0;
margin-left: 10rem / $pxConvertRem;
}
}
}
}
li:first-child {
.item-content {
border: none;
}
}
}
.goods-nav {
border-bottom: (2rem / $pxConvertRem) solid #e6e6e6;
height: 67rem / $pxConvertRem;
overflow: hidden;
li {
float: left;
width: auto;
height: 67rem / $pxConvertRem;
line-height: 67rem / $pxConvertRem;
width: 145rem / $pxConvertRem;
text-align: center;
font-size: 28rem / $pxConvertRem;
a {
display: inline-block;
padding: 0 (5rem / $pxConvertRem);
font-size: 28rem / $pxConvertRem;
color: #999;
height: 65rem / $pxConvertRem;
}
}
li:first-child {
margin-left: 30rem / $pxConvertRem;
}
li.focus {
a {
border-bottom: (4rem / $pxConvertRem) solid #000;
color: #000;
}
}
}
.s-goods-nav {
overflow: hidden;
li {
margin: 0 0 0 (50rem / $pxConvertRem);
width: auto;
a {
padding: 0;
}
}
li:first-child {
margin: 0 0 0 (39rem / $pxConvertRem);
}
}
\ No newline at end of file
... ...
@import "new-arrival", "discount", "list", "detail", "suspend-cart";
\ No newline at end of file
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";
\ No newline at end of file
... ...
{{> layout/header}}
<div class="my-guang-page yoho-page">
<div class="info-list">
{{# myGuang}}
{{> guang/info}}
{{/ myGuang}}
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="order-page yoho-page">
{{# order}}
<ul id="order-nav" class="order-nav clearfix">
<li class="active">
全部
</li>
<li>
待付款
</li>
<li>
待发货
</li>
<li>
待收货
</li>
</ul>
<div id="order-container" class="order-container">
<div class="all orders">
{{# allOrders}}
{{> me/order/order}}
{{/ allOrders}}
</div>
<div class="obligation orders hide"></div>
<div class="unshipped orders hide"></div>
<div class="unreceived orders hide"></div>
</div>
{{/ order}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -3,51 +3,41 @@
{{# 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}}
{{# listNav}}
<div class="s-goods-nav goods-nav">
<ul class="swiper-wrapper clearfix">
{{# list}}
<li class="swiper-slide nav-item" data-sort="{{sort}}">
<span>{{textCn}}</span>
</li>
{{/ list}}
</ul>
</div>
{{/ listNav}}
{{# rankList}}
<div class="rank-main">
<ul>
{{# list}}
<li>
<a class="clearfix" href="{{url}}">
<div class="item-img">
<img class="lazy" data-original="{{img}}">
</div>
<div class="item-content">
<i class="rank-icon top">{{rank}}</i>
<h2 {{# active}}class="hasActive"{{/ active}}>{{title}}</h2>
{{# active}}
<p>{{.}}</p>
{{/ active}}
<p>{{sPrice}}<span>{{price}}</span></p>
</div>
</a>
</li>
{{/ list}}
</ul>
</div>
{{/ rankList}}
{{#if brand}}
<input id="brand" type="hidden" value={{brand}}>
... ...
... ... @@ -187,4 +187,11 @@
<script>
seajs.use('js/shopping-cart/gift-advance');
</script>
{{/if}}
{{!-- 个人中心 --}}
{{#if orderPage}}
<script>
seajs.use('js/me/order');
</script>
{{/if}}
\ No newline at end of file
... ...
<div class="order-good" data-id={{id}}>
<div class="thumb-wrap">
<img class="thumb lazy" data-original={{thumb}}>
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
<div class="deps">
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
颜色:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
</span>
{{/if}}
</p>
<p class="row price-wrap">
<span class="price">
¥{{price}}
</span>
<span class="count">
×{{count}}
</span>
</p>
</div>
</div>
\ No newline at end of file
... ...
<div class="order">
<header class="header">
订单编号:{{orderNum}}
<span class="trading-status">{{tradingStatus}}</span>
</header>
<section class="order-goods">
{{# goods}}
{{> me/order/good}}
{{/ goods}}
</section>
<footer class="footer">
共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
</footer>
</div>
\ No newline at end of file
... ...
... ... @@ -39,12 +39,45 @@ class HomeController extends AbstractAction
*/
public function ordersAction()
{
$uid = $this->getUid();
$type = $this->get('type', 1);
$orders = \Index\UserModel::getUserOrderData(967016, $type);
print_r($orders);
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$order = array(
'allOrders' => array(
array(
'orderNum' => '408539077',
'tradingStatus' => '交易成功',
'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'
)
),
'count' => 2,
'sumCost' => '699.00'
)
)
);
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
// print_r($orders);
}
/**
... ... @@ -110,6 +143,14 @@ class HomeController extends AbstractAction
}
/**
* 我的逛
*/
public function myGuangAction()
{
echo 'My Guang';
}
/**
* 意见反馈
*/
public function suggestAction()
... ...