Authored by ccbikai

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

@@ -893,4 +893,37 @@ @@ -893,4 +893,37 @@
893 //查看全部VIP特权页面 893 //查看全部VIP特权页面
894 all: true 894 all: true
895 } 895 }
  896 + }
  897 +
  898 +
  899 +### 我的订单
  900 + {
  901 + order: {
  902 + allOrders: [
  903 + ...
  904 + ]
  905 + }
  906 + }
  907 +
  908 +
  909 + //订单
  910 + {
  911 + orderNum: '',
  912 + tradingStatus: '',
  913 + goods: [
  914 + {
  915 + id: '',
  916 + thumb: '',
  917 + gift: true, //是否赠品
  918 + advanceBuy: true, //是否加价购
  919 + name: '',
  920 + color: '黄色',
  921 + size: 'X',
  922 + price: '588',
  923 + count: 2
  924 + },
  925 + ...
  926 + ],
  927 + count: 1,
  928 + sumCost: '199.00'
896 } 929 }
@@ -8,5 +8,6 @@ require('./js/home/entry'); @@ -8,5 +8,6 @@ require('./js/home/entry');
8 require('./js/index/entry'); 8 require('./js/index/entry');
9 require('./js/passport/entry'); 9 require('./js/passport/entry');
10 require('./js/product/entry'); 10 require('./js/product/entry');
  11 +require('./js/me/entry');
11 12
12 module.exports = yohobuy; 13 module.exports = yohobuy;
  1 +/**
  2 + * 个人中心js打包入口文件
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/11/10
  5 + */
  6 +
  7 +require('./order');
  1 +/**
  2 + * 个人中心--我的订单
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/11/10
  5 + */
  6 +
  7 +var $ = require('jquery'),
  8 + Hammer = require('yoho.hammer'),
  9 + lazyLoad = require('yoho.lazyload');
  10 +
  11 +var $navLi = $('#order-nav > li'),
  12 + $orderContainer = $('#order-container');
  13 +
  14 +var $curContainer = $orderContainer.children('.orders').first();//保存当前显示的order-container
  15 +
  16 +var navHammer;
  17 +
  18 +lazyLoad();
  19 +
  20 +navHammer = new Hammer(document.getElementById('order-nav'));
  21 +navHammer.on('tap', function(e) {
  22 + var $cur = $(e.target).closest('li'),
  23 + index;
  24 +
  25 + if ($cur.length === 0 || $cur.hasClass('active')) {
  26 + return;
  27 + }
  28 +
  29 + index = $cur.index();
  30 +
  31 + $navLi.filter('.active').removeClass('active');
  32 + $cur.addClass('active');
  33 +
  34 + $curContainer.addClass('hide');
  35 + $curContainer = $orderContainer.children(':eq(' + index + ')').removeClass('hide');
  36 +});
  37 +
  38 +
  1 +var $ = require('jquery'),
  2 + Hammer = require('yoho.hammer'),
  3 + lazyLoad = require('yoho.lazyload');
1 -@import "home", "vip-grade";  
  1 +@import "home", "vip-grade", "order";
  1 +.order-page {
  2 + background: #f0f0f0;
  3 +
  4 + .order {
  5 + background: #fff;
  6 + margin: 30rem / $pxConvertRem 0;
  7 + border-top: 1px solid #e0e0e0;
  8 + border-bottom: 1px solid #e0e0e0;
  9 +
  10 + .header, .footer {
  11 + height: 90rem / $pxConvertRem;
  12 + line-height: 90rem / $pxConvertRem;
  13 + font-size: 30rem / $pxConvertRem;
  14 + padding: 0 30rem / $pxConvertRem;
  15 + }
  16 +
  17 + .header {
  18 + border-bottom: 1px solid #e0e0e0;
  19 + }
  20 +
  21 + .trading-status {
  22 + float: right;
  23 + }
  24 +
  25 + .footer {
  26 + text-align: right;
  27 + border-top: 1px solid #e0e0e0;
  28 + }
  29 +
  30 + .sum-cost {
  31 + color: #e01;
  32 + }
  33 + }
  34 +}
  35 +
  36 +.order-nav {
  37 + border-bottom: 1px solid #e0e0e0;
  38 + background: #fff;
  39 +
  40 + > li{
  41 + float: left;
  42 + height: 90rem / $pxConvertRem;
  43 + width: 25%;
  44 + line-height: 90rem / $pxConvertRem;
  45 + color: #b0b0b0;
  46 + font-size: 26rem / $pxConvertRem;
  47 + text-align: center;
  48 +
  49 + &.active {
  50 + color: #000;
  51 + }
  52 + }
  53 +}
  54 +
  55 +.order-good {
  56 + position: relative;
  57 + padding: 20rem / $pxConvertRem 0;
  58 + margin-left: 34rem / $pxConvertRem;
  59 + height: 160rem / $pxConvertRem;
  60 + border-bottom: 1px solid #e0e0e0;
  61 + font-size: 26rem / $pxConvertRem;
  62 +
  63 + &:last-child {
  64 + border-bottom: none;
  65 + }
  66 +
  67 + .thumb-wrap {
  68 + position: relative;
  69 + float: left;
  70 + width: 120rem / $pxConvertRem;
  71 + height: 160rem / $pxConvertRem;
  72 + }
  73 +
  74 + .thumb {
  75 + width: 100%;
  76 + height: 100%;
  77 + }
  78 +
  79 + .tag {
  80 + position: absolute;
  81 + bottom: 0;
  82 + left: 0;
  83 + right: 0;
  84 + color: #fff;
  85 + text-align: center;
  86 + font-size: 12px;
  87 + }
  88 +
  89 + .gift-tag {
  90 + height: 25rem / $pxConvertRem;
  91 + background: #a1ce4e;
  92 + &:before {
  93 + content: '赠品';
  94 + }
  95 + }
  96 +
  97 + .advance-buy-tag {
  98 + height: 25rem / $pxConvertRem;
  99 + background: #eb76aa;
  100 + &:before {
  101 + content: '加价购';
  102 + }
  103 + }
  104 +
  105 + .deps {
  106 + margin-left: 135rem / $pxConvertRem;
  107 + }
  108 +
  109 + .name {
  110 + font-size: 28rem / $pxConvertRem;
  111 + max-width: 70%;
  112 + }
  113 +
  114 + .row:nth-child(2) {
  115 + height: 45rem / $pxConvertRem;
  116 + line-height: 45rem / $pxConvertRem;
  117 +
  118 + > span {
  119 + margin-right: 15rem / $pxConvertRem;
  120 + }
  121 + }
  122 +
  123 + .color, .size {
  124 + color: #b6b6b6;
  125 + }
  126 +
  127 + .price-wrap {
  128 + position: absolute;
  129 + top: 20rem / $pxConvertRem;
  130 + right: 30rem / $pxConvertRem;
  131 + }
  132 +
  133 + .price {
  134 + color: #e01;
  135 + }
  136 +
  137 + .count {
  138 + display: block;
  139 + color: #999;
  140 + text-align: right;
  141 + line-height: 45rem / $pxConvertRem;
  142 + }
  143 +}
  1 +.rank-main {
  2 + padding: (14rem / $pxConvertRem) 0 0 (30rem / $pxConvertRem);
  3 + background: #fff;
  4 +
  5 + li {
  6 + height: 230rem / $pxConvertRem;
  7 + overflow: hidden;
  8 +
  9 + .item-img {
  10 + float: left;
  11 + width: 150rem / $pxConvertRem;
  12 + height: 200rem / $pxConvertRem;
  13 + padding: (14rem / $pxConvertRem) 0;
  14 + line-height: 200rem / $pxConvertRem;
  15 + text-align: center;
  16 +
  17 + img {
  18 + max-width: 100%;
  19 + max-height: 100%;
  20 + vertical-align: middle;
  21 + }
  22 + }
  23 +
  24 + .item-content {
  25 + float: left;
  26 + width: 407rem / $pxConvertRem;
  27 + height: 213rem / $pxConvertRem;
  28 + margin: 0 0 0 (13rem / $pxConvertRem);
  29 + padding: (14rem / $pxConvertRem) 0 0 (30rem / $pxConvertRem);
  30 + border-top: 1px solid #e0e0e0;
  31 + overflow: hidden;
  32 +
  33 + .rank-icon {
  34 + display: block;
  35 + height: 45rem / $pxConvertRem;
  36 + width: 50rem / $pxConvertRem;
  37 + line-height: 50rem / $pxConvertRem;
  38 + text-align: center;
  39 + font-size: 22rem / $pxConvertRem;
  40 + color: #fff;
  41 + background: image-url("sale-icon/rank.png") no-repeat;
  42 + background-position: center top;
  43 + background-size: auto 100%;
  44 +
  45 + &.top {
  46 + background: image-url("sale-icon/rank-t.png") no-repeat;
  47 + background-position: center top;
  48 + background-size: 100%;
  49 + line-height: 58rem / $pxConvertRem;
  50 + }
  51 + }
  52 +
  53 + h2 {
  54 + margin: (15rem / $pxConvertRem) 0 0 !important;
  55 + padding: 0 !important;
  56 + width: 9.5rem;
  57 + line-height: 36rem / $pxConvertRem;
  58 + color: #444;
  59 + font-size: 28rem / $pxConvertRem;
  60 +
  61 + &.hasActive {
  62 + margin: (5rem / $pxConvertRem) 0 0 !important;
  63 + }
  64 + }
  65 +
  66 + p {
  67 + margin: 0 !important;
  68 + padding: 0 !important;
  69 + width: 9.5rem;
  70 + line-height: 36rem / $pxConvertRem;
  71 + font-size: 24rem / $pxConvertRem;
  72 + color: #d0021b;
  73 + text-overflow: ellipsis;
  74 + overflow: hidden;
  75 + white-space: nowrap;
  76 +
  77 + span {
  78 + text-decoration: line-through;
  79 + color: #b0b0b0;
  80 + margin-left: 10rem / $pxConvertRem;
  81 + }
  82 + }
  83 + }
  84 + }
  85 +
  86 + li:first-child {
  87 + .item-content {
  88 + border: none;
  89 + }
  90 + }
  91 +}
  92 +.goods-nav {
  93 + border-bottom: (2rem / $pxConvertRem) solid #e6e6e6;
  94 + height: 67rem / $pxConvertRem;
  95 + overflow: hidden;
  96 +
  97 + li {
  98 + float: left;
  99 + width: auto;
  100 + height: 67rem / $pxConvertRem;
  101 + line-height: 67rem / $pxConvertRem;
  102 + width: 145rem / $pxConvertRem;
  103 + text-align: center;
  104 + font-size: 28rem / $pxConvertRem;
  105 +
  106 + a {
  107 + display: inline-block;
  108 + padding: 0 (5rem / $pxConvertRem);
  109 + font-size: 28rem / $pxConvertRem;
  110 + color: #999;
  111 + height: 65rem / $pxConvertRem;
  112 + }
  113 + }
  114 +
  115 + li:first-child {
  116 + margin-left: 30rem / $pxConvertRem;
  117 + }
  118 +
  119 + li.focus {
  120 + a {
  121 + border-bottom: (4rem / $pxConvertRem) solid #000;
  122 + color: #000;
  123 + }
  124 + }
  125 +}
  126 +
  127 +.s-goods-nav {
  128 + overflow: hidden;
  129 +
  130 + li {
  131 + margin: 0 0 0 (50rem / $pxConvertRem);
  132 + width: auto;
  133 +
  134 + a {
  135 + padding: 0;
  136 + }
  137 + }
  138 +
  139 + li:first-child {
  140 + margin: 0 0 0 (39rem / $pxConvertRem);
  141 + }
  142 +}
1 -@import "new-arrival", "discount", "list", "detail", "suspend-cart";  
  1 +@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";
  1 +{{> layout/header}}
  2 +<div class="my-guang-page yoho-page">
  3 + <div class="info-list">
  4 + {{# myGuang}}
  5 + {{> guang/info}}
  6 + {{/ myGuang}}
  7 + </div>
  8 +</div>
  9 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="order-page yoho-page">
  3 + {{# order}}
  4 + <ul id="order-nav" class="order-nav clearfix">
  5 + <li class="active">
  6 + 全部
  7 + </li>
  8 + <li>
  9 + 待付款
  10 + </li>
  11 + <li>
  12 + 待发货
  13 + </li>
  14 + <li>
  15 + 待收货
  16 + </li>
  17 + </ul>
  18 +
  19 + <div id="order-container" class="order-container">
  20 + <div class="all orders">
  21 + {{# allOrders}}
  22 + {{> me/order/order}}
  23 + {{/ allOrders}}
  24 + </div>
  25 + <div class="obligation orders hide"></div>
  26 + <div class="unshipped orders hide"></div>
  27 + <div class="unreceived orders hide"></div>
  28 + </div>
  29 + {{/ order}}
  30 +</div>
  31 +{{> layout/footer}}
@@ -3,51 +3,41 @@ @@ -3,51 +3,41 @@
3 {{# headerBanner}} 3 {{# headerBanner}}
4 {{> product/banner_swipe_and_single}} 4 {{> product/banner_swipe_and_single}}
5 {{/ headerBanner}} 5 {{/ headerBanner}}
6 -  
7 - <ul id="list-nav" class="list-nav clearfix">  
8 - <li class="new active">  
9 - <a href="javascript:void(0);">  
10 - <span class="spanTest">最新</span>  
11 - <span class="iconfont cur">&#xe616;</span>  
12 - </a>  
13 - </li>  
14 - <li class="price">  
15 - <a href="javascript:void(0);">  
16 - <span class="spanTest">价格</span>  
17 - <span class="icon">  
18 - <i class="iconfont up">&#xe615;</i>  
19 - <i class="iconfont down cur">&#xe616;</i>  
20 - </span>  
21 - </a>  
22 - </li>  
23 - <li class="discount">  
24 - <a href="javascript:void(0);">  
25 - <span class="spanTest">折扣</span>  
26 - <span class="icon">  
27 - <i class="iconfont up">&#xe615;</i>  
28 - <i class="iconfont down cur">&#xe616;</i>  
29 - </span>  
30 - </a>  
31 - </li>  
32 - <li class="filter">  
33 - <a href="javascript:void(0);">  
34 - <span class="spanTest">筛选</span>  
35 - <span class="iconfont">&#xe613;</span>  
36 - </a>  
37 - </li>  
38 - </ul>  
39 -  
40 - <div id="goods-container" class="goods-container">  
41 - <div class="new-goods container clearfix">  
42 - {{# goods}}  
43 - {{> good}}  
44 - {{/ goods}}  
45 - </div>  
46 - <div class="price-goods container hide clearfix"></div>  
47 - <div class="discount-goods container hide clearfix"></div>  
48 -  
49 - {{> filter}} 6 + {{# listNav}}
  7 + <div class="s-goods-nav goods-nav">
  8 + <ul class="swiper-wrapper clearfix">
  9 + {{# list}}
  10 + <li class="swiper-slide nav-item" data-sort="{{sort}}">
  11 + <span>{{textCn}}</span>
  12 + </li>
  13 + {{/ list}}
  14 + </ul>
50 </div> 15 </div>
  16 + {{/ listNav}}
  17 +
  18 + {{# rankList}}
  19 + <div class="rank-main">
  20 + <ul>
  21 + {{# list}}
  22 + <li>
  23 + <a class="clearfix" href="{{url}}">
  24 + <div class="item-img">
  25 + <img class="lazy" data-original="{{img}}">
  26 + </div>
  27 + <div class="item-content">
  28 + <i class="rank-icon top">{{rank}}</i>
  29 + <h2 {{# active}}class="hasActive"{{/ active}}>{{title}}</h2>
  30 + {{# active}}
  31 + <p>{{.}}</p>
  32 + {{/ active}}
  33 + <p>{{sPrice}}<span>{{price}}</span></p>
  34 + </div>
  35 + </a>
  36 + </li>
  37 + {{/ list}}
  38 + </ul>
  39 + </div>
  40 + {{/ rankList}}
51 41
52 {{#if brand}} 42 {{#if brand}}
53 <input id="brand" type="hidden" value={{brand}}> 43 <input id="brand" type="hidden" value={{brand}}>
@@ -187,4 +187,11 @@ @@ -187,4 +187,11 @@
187 <script> 187 <script>
188 seajs.use('js/shopping-cart/gift-advance'); 188 seajs.use('js/shopping-cart/gift-advance');
189 </script> 189 </script>
  190 +{{/if}}
  191 +
  192 +{{!-- 个人中心 --}}
  193 +{{#if orderPage}}
  194 +<script>
  195 + seajs.use('js/me/order');
  196 +</script>
190 {{/if}} 197 {{/if}}
  1 +<div class="order-good" data-id={{id}}>
  2 + <div class="thumb-wrap">
  3 + <img class="thumb lazy" data-original={{thumb}}>
  4 + <p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
  5 + </div>
  6 + <div class="deps">
  7 + <p class="name row">{{name}}</p>
  8 + <p class="row">
  9 + {{#if color}}
  10 + <span class="color">
  11 + 颜色:{{color}}
  12 + </span>
  13 + {{/if}}
  14 +
  15 + {{#if size}}
  16 + <span class="size">
  17 + 尺码:{{size}}
  18 + </span>
  19 + {{/if}}
  20 + </p>
  21 + <p class="row price-wrap">
  22 + <span class="price">
  23 + ¥{{price}}
  24 + </span>
  25 + <span class="count">
  26 + ×{{count}}
  27 + </span>
  28 + </p>
  29 + </div>
  30 +</div>
  1 +<div class="order">
  2 + <header class="header">
  3 + 订单编号:{{orderNum}}
  4 + <span class="trading-status">{{tradingStatus}}</span>
  5 + </header>
  6 + <section class="order-goods">
  7 + {{# goods}}
  8 + {{> me/order/good}}
  9 + {{/ goods}}
  10 + </section>
  11 + <footer class="footer">
  12 + 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
  13 + </footer>
  14 +</div>
@@ -39,12 +39,45 @@ class HomeController extends AbstractAction @@ -39,12 +39,45 @@ class HomeController extends AbstractAction
39 */ 39 */
40 public function ordersAction() 40 public function ordersAction()
41 { 41 {
42 - $uid = $this->getUid();  
43 - $type = $this->get('type', 1);  
44 -  
45 - $orders = \Index\UserModel::getUserOrderData(967016, $type);  
46 -  
47 - print_r($orders); 42 + // $uid = $this->getUid();
  43 + // $type = $this->get('type', 1);
  44 +
  45 + // $orders = \Index\UserModel::getUserOrderData(967016, $type);
  46 +
  47 + $order = array(
  48 + 'allOrders' => array(
  49 + array(
  50 + 'orderNum' => '408539077',
  51 + 'tradingStatus' => '交易成功',
  52 + 'goods' => array(
  53 + array(
  54 + 'id' => 1,
  55 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  56 + 'name' => 'Adidas Originals ZX FLUXM22508',
  57 + 'color' => '黄',
  58 + 'size' => '43',
  59 + 'price' => '699.00',
  60 + 'count' => '2'
  61 + ),
  62 + array(
  63 + 'id' => 1,
  64 + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  65 + 'name' => 'B.Duck浴室玩伴mini浮水鸭',
  66 + 'gift' => true,
  67 + 'color' => '黄',
  68 + 'size' => '43',
  69 + 'price' => '0.00',
  70 + 'count' => '1'
  71 + )
  72 + ),
  73 + 'count' => 2,
  74 + 'sumCost' => '699.00'
  75 + )
  76 + )
  77 + );
  78 +
  79 + $this->_view->display('order', array('order' => $order, 'orderPage' => true));
  80 + // print_r($orders);
48 } 81 }
49 82
50 /** 83 /**
@@ -110,6 +143,14 @@ class HomeController extends AbstractAction @@ -110,6 +143,14 @@ class HomeController extends AbstractAction
110 } 143 }
111 144
112 /** 145 /**
  146 + * 我的逛
  147 + */
  148 + public function myGuangAction()
  149 + {
  150 + echo 'My Guang';
  151 + }
  152 +
  153 + /**
113 * 意见反馈 154 * 意见反馈
114 */ 155 */
115 public function suggestAction() 156 public function suggestAction()