Authored by ccbikai

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

@@ -874,4 +874,23 @@ @@ -874,4 +874,23 @@
874 size: 'L', //颜色和尺寸需要显示就传,不显示不传 874 size: 'L', //颜色和尺寸需要显示就传,不显示不传
875 price: 562, 875 price: 562,
876 count: 3 876 count: 3
  877 + }
  878 +
  879 +## 个人中心
  880 +
  881 +### 会员等级
  882 +
  883 + {
  884 + vipGrade: {
  885 + //会员等级页面
  886 + vip3: true, //vip等级(3,2,1,0),对应等级传true;
  887 + name: '', //user name
  888 + costOfThisYear: 3000,
  889 + percent: 80, //当前消费等级进度条
  890 + costGap: 300, //距离升级所需消费金额(白金会员不传)
  891 + sumCost: 600
  892 +
  893 + //查看全部VIP特权页面
  894 + all: true
  895 + }
877 } 896 }
@@ -11,7 +11,7 @@ var chosePanel = require('./chose-panel'); @@ -11,7 +11,7 @@ var chosePanel = require('./chose-panel');
11 11
12 lazyLoad($('.lazy')); 12 lazyLoad($('.lazy'));
13 13
14 -$('.gift-advance-page').delegate('.chose', 'tap', function() { 14 +$('.gift-advance-page').on('touchstart', '.chose', function() {
15 var id = $(this).closest('.gift-advance-good').data('id'); 15 var id = $(this).closest('.gift-advance-good').data('id');
16 16
17 $.ajax({ 17 $.ajax({
@@ -103,4 +103,23 @@ a { @@ -103,4 +103,23 @@ a {
103 @include border-radius(10px); 103 @include border-radius(10px);
104 } 104 }
105 105
106 -@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "loading", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index", "mine/index"; 106 +/*px转化rem*/
  107 +@function pxToRem($px) {
  108 + $pxConvertRem: 40px;
  109 +
  110 + @if $px == 0 {
  111 + @return 0;
  112 + } @else {
  113 + @return $px / $pxConvertRem * 1rem;
  114 + }
  115 +}
  116 +
  117 +@mixin rem-sprite ($map,$sprite) {
  118 + $offsetY: nth(sprite-position($map,$sprite),2);
  119 + background-image: sprite-url($map);
  120 + background-repeat: no-repeat;
  121 + background-position: 0 pxToRem($offsetY);
  122 + background-size: pxToRem(sprite-width($map)) pxToRem(sprite-height($map));
  123 +}
  124 +
  125 +@import "layout/header", "layout/footer", "layout/footer_tab", "good", "filter", "loading", "passport/index", "guang/index", "home/index", "category/index", "product/index", "index/index", "shopping-cart/index", "me/index";
  1 +@import "home", "vip-grade";
  1 +$vip: sprite-map("me/vip/*.png");
  2 +$privilege: sprite-map("me/privilege/*.png");
  3 +
  4 +.vip-grade-page {
  5 + background: #f0f0f0;
  6 + padding-bottom: 30rem / $pxConvertRem;
  7 +
  8 + .block {
  9 + padding: 0 30rem / $pxConvertRem;
  10 + margin-bottom: 30rem / $pxConvertRem;
  11 + border-top: 1px solid #e0e0e0;
  12 + border-bottom: 1px solid #e0e0e0;
  13 + background: #fff;
  14 + }
  15 +
  16 + .basic-info {
  17 + padding-top: 30rem / $pxConvertRem;
  18 + padding-bottom: 25rem / $pxConvertRem;
  19 +
  20 + .user-name {
  21 + font-size: 25rem / $pxConvertRem;
  22 + }
  23 +
  24 + .vip-icon {
  25 + display: inline-block;
  26 + width: pxToRem(70px);
  27 + height: pxToRem(30px);
  28 + }
  29 +
  30 + .vip-3 {
  31 + @include rem-sprite($vip, vip-3);
  32 + }
  33 +
  34 + .vip-2 {
  35 + @include rem-sprite($vip, vip-2);
  36 + }
  37 +
  38 + .vip-1 {
  39 + @include rem-sprite($vip, vip-1);
  40 + }
  41 +
  42 + .grade-desc {
  43 + padding: 20rem / $pxConvertRem 0;
  44 + font-size: 22rem / $pxConvertRem;
  45 + color: #b0b0b0;
  46 + }
  47 +
  48 + .sum-cost {
  49 + font-size: 22rem / $pxConvertRem;
  50 +
  51 + > span {
  52 + font-style: italic;
  53 + color: #d1021c;
  54 + }
  55 + }
  56 +
  57 + .progresser {
  58 + position: relative;
  59 + width: 100%;
  60 + height: 20rem / $pxConvertRem;
  61 + padding: 20rem / $pxConvertRem 0;
  62 + }
  63 +
  64 + .outer {
  65 + height: 20rem / $pxConvertRem;
  66 + background: #e6e6e6;
  67 + @include border-radius(10px);
  68 + }
  69 +
  70 + .inner {
  71 + position: absolute;
  72 + top: 20rem / $pxConvertRem;
  73 + height: 20rem / $pxConvertRem;
  74 + background: #d1021c;
  75 + @include border-radius(10px);
  76 + }
  77 +
  78 + .beacon {
  79 + position: absolute;
  80 + margin-top: 5rem / $pxConvertRem;
  81 + font-style: italic;
  82 + }
  83 +
  84 + .beacon-max {
  85 + right: 0;
  86 + }
  87 +
  88 + .cost-limit {
  89 + position: absolute;
  90 + top: -5rem / $pxConvertRem;
  91 + right: 0;
  92 + color: #b0b0b0;
  93 + }
  94 +
  95 + .cost-gap {
  96 + color: #000;
  97 + margin: 0 8rem / $pxConvertRem;
  98 + }
  99 +
  100 + .sub-desc {
  101 + display: block;
  102 + }
  103 + }
  104 +
  105 + .cost li {
  106 + height: 90rem / $pxConvertRem;
  107 + line-height: 90rem / $pxConvertRem;
  108 + font-size: 30rem / $pxConvertRem;
  109 + padding-right: 0;
  110 +
  111 + &:first-child {
  112 + border-bottom: 1px solid #e0e0e0;
  113 + }
  114 + > span {
  115 + float: right;
  116 + }
  117 + }
  118 +
  119 + .privilege {
  120 + padding-right: 0;
  121 + padding-bottom: 40rem / $pxConvertRem;
  122 +
  123 + .title {
  124 + height: 90rem / $pxConvertRem;
  125 + line-height: 90rem / $pxConvertRem;
  126 + font-size: 30rem / $pxConvertRem;
  127 + border-bottom: 1px solid #e0e0e0;
  128 + }
  129 +
  130 + .icon {
  131 + float: left;
  132 + display: block;
  133 + width: pxToRem(70px);
  134 + height: pxToRem(70px);
  135 + }
  136 +
  137 + .icon-discount {
  138 + @include rem-sprite($privilege, discount);
  139 + }
  140 +
  141 + .icon-year {
  142 + @include rem-sprite($privilege, year);
  143 + }
  144 +
  145 + .icon-vip {
  146 + @include rem-sprite($privilege, vip);
  147 + }
  148 +
  149 + .icon-birth {
  150 + @include rem-sprite($privilege, birth);
  151 + }
  152 +
  153 + .icon-msg {
  154 + @include rem-sprite($privilege, msg);
  155 + }
  156 +
  157 + .icon-magazine {
  158 + @include rem-sprite($privilege, magazine);
  159 + }
  160 +
  161 + .icon-arrival-soon {
  162 + @include rem-sprite($privilege, arrival-soon);
  163 + }
  164 +
  165 + .icon-gift {
  166 + @include rem-sprite($privilege, gift);
  167 + }
  168 +
  169 + li {
  170 + height: 70rem / $pxConvertRem;
  171 + padding: 25rem / $pxConvertRem 0;
  172 + }
  173 +
  174 + P {
  175 + font-size: 28rem / $pxConvertRem;
  176 + margin-left: 100rem / $pxConvertRem;
  177 + }
  178 +
  179 + span {
  180 + display: block;
  181 + color: #b0b0b0;
  182 + font-size: 22rem / $pxConvertRem;
  183 + }
  184 + }
  185 +
  186 + .all-privilege {
  187 + display: block;
  188 + height: 90rem / $pxConvertRem;
  189 + line-height: 90rem / $pxConvertRem;
  190 + font-size: 30rem / $pxConvertRem;
  191 + margin-bottom: 0;
  192 +
  193 + .iconfont {
  194 + float: right;
  195 + color: #e0e0e0;
  196 + }
  197 +
  198 + }
  199 +}
  1 +{{> layout/header}}
  2 +<div class="vip-grade-page yoho-page">
  3 + {{# vipGrade}}
  4 + {{> me/privilege}}
  5 + {{/ vipGrade}}
  6 +</div>
  7 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="vip-grade-page yoho-page">
  3 + {{# vipGrade}}
  4 + <div class="basic-info block">
  5 + {{> me/vip-grade/basic-info}}
  6 + </div>
  7 +
  8 + <ul class="cost block">
  9 + <li>
  10 + 年度累计金额:
  11 + <span>¥{{costOfThisYear}}</span>
  12 + </li>
  13 + <li>
  14 + 历史消费总金额:
  15 + <span>¥{{sumCost}}</span>
  16 + </li>
  17 + </ul>
  18 +
  19 + {{#unless vip0}}
  20 + <div class="privilege block">
  21 + <h3 class="title">当前可享受的特权</h3>
  22 + {{> me/vip-grade/privilege}}
  23 + </div>
  24 + {{/unless}}
  25 +
  26 + <a class="all-privilege block">
  27 + 查看全部VIP特权
  28 + <span class="iconfont">&#xe604;</span>
  29 + </a>
  30 + {{/ vipGrade}}
  31 +</div>
  32 +{{> layout/footer}}
  1 +{{#if vip3}}
  2 + <p>
  3 + <span class="user-name">{{name}}</span>
  4 + <span class="vip-icon vip-3"></span>
  5 + </p>
  6 + <p class="grade-desc">
  7 + 您已升级至最高的等级啦!
  8 + </p>
  9 + <p class="sum-cost">
  10 + 年度累计金额<span>¥{{costOfThisYear}}</span>
  11 + </p>
  12 + <div class="progresser">
  13 + <div class="outer"></div>
  14 + <div class="inner" style="width: {{percent}}%;"></div>
  15 + <span class="beacon beacon-min">
  16 + 白金卡会员
  17 + </span>
  18 + </div>
  19 +{{/if}}
  20 +
  21 +{{#if vip2}}
  22 + <p>
  23 + <span class="user-name">{{name}}</span>
  24 + <span class="vip-icon vip-2"></span>
  25 + </p>
  26 + <p class="grade-desc">
  27 + 还差<span class="cost-gap"{{costGap}}</span>就可以升级为白金会员!
  28 + <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
  29 + </p>
  30 + <p class="sum-cost">
  31 + 年度累计金额<span>¥{{costOfThisYear}}</span>
  32 + </p>
  33 + <div class="progresser">
  34 + <div class="outer"></div>
  35 + <div class="inner" style="width: {{percent}}%;"></div>
  36 + <span class="beacon beacon-min">
  37 + 金卡会员
  38 + </span>
  39 + <span class="beacon beacon-max">白金卡会员</span>
  40 + <span class="cost-limit"5000.00</span>
  41 + </div>
  42 +{{/if}}
  43 +
  44 +{{#if vip1}}
  45 + <p>
  46 + <span class="user-name">{{name}}</span>
  47 + <span class="vip-icon vip-2"></span>
  48 + </p>
  49 + <p class="grade-desc">
  50 + 还差<span class="cost-gap"{{costGap}}</span>就可以升级为金卡会员!
  51 + <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
  52 + </p>
  53 + <p class="sum-cost">
  54 + 年度累计金额<span>¥{{costOfThisYear}}</span>
  55 + </p>
  56 + <div class="progresser">
  57 + <div class="outer"></div>
  58 + <div class="inner" style="width: {{percent}}%;"></div>
  59 + <span class="beacon beacon-min">
  60 + 银卡会员
  61 + </span>
  62 + <span class="beacon beacon-max">金卡会员</span>
  63 + <span class="cost-limit"2000.00</span>
  64 + </div>
  65 +{{/if}}
  66 +
  67 +{{#if vip0}}
  68 + <p>
  69 + <span class="user-name">{{name}}</span>
  70 + </p>
  71 + <p class="grade-desc">
  72 + 还差<span class="cost-gap"{{costGap}}</span>就可以升级为银卡会员!
  73 + <span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
  74 + </p>
  75 + <p class="sum-cost">
  76 + 年度累计金额<span>¥{{costOfThisYear}}</span>
  77 + </p>
  78 + <div class="progresser">
  79 + <div class="outer"></div>
  80 + <div class="inner" style="width: {{percent}}%;"></div>
  81 + <span class="beacon beacon-min">
  82 + 普通
  83 + </span>
  84 + <span class="beacon beacon-max">银卡会员</span>
  85 + <span class="cost-limit"500.00</span>
  86 + </div>
  87 +{{/if}}
  1 +<ul>
  2 + <li>
  3 + <span class="icon icon-discount"></span>
  4 + <p>
  5 + {{#if vip3}}
  6 + 购物8.8折
  7 + {{/if}}
  8 +
  9 + {{#if vip2}}
  10 + 购物9.0折
  11 + {{/if}}
  12 +
  13 + {{#if vip1}}
  14 + 购物9.5折
  15 + {{/if}}
  16 +
  17 + {{#if all}}
  18 + 全场最高8.8折
  19 + {{/if}}
  20 + <span>在原折扣基础上享受VIP折上折</span>
  21 + </p>
  22 + </li>
  23 + <li>
  24 + <span class="icon icon-year"></span>
  25 + <p>
  26 + 年度优惠活动
  27 + <span>年度级的sale促销活动中,VIP会员可以享受优先购买权</span>
  28 + </p>
  29 + </li>
  30 + <li>
  31 + <span class="icon icon-vip"></span>
  32 + <p>
  33 + VIP活动优惠
  34 + <span>优先参加"VIP会员限定"活动</span>
  35 + </p>
  36 + </li>
  37 + <li>
  38 + <span class="icon icon-birth"></span>
  39 + <p>
  40 + 生日特惠
  41 + <span>赠送生日优惠券</span>
  42 + </p>
  43 + </li>
  44 + <li>
  45 + <span class="icon icon-msg"></span>
  46 + <p>
  47 + 优惠信息
  48 + <span>获得大量的潮流新品及优惠活动的信息</span>
  49 + </p>
  50 + </li>
  51 + <li>
  52 + <span class="icon icon-magazine"></span>
  53 + <p>
  54 + 杂志赠阅
  55 + <span>下载《YOHO!潮流志》电子版,浏览magazine版块,最新最权威的潮流资讯尽在掌握!</span>
  56 + </p>
  57 + </li>
  58 + {{#or vip3 vip2 all}}
  59 + <li>
  60 + <span class="icon icon-arrival-soon"></span>
  61 + <p>
  62 + 快速送达
  63 + <span>
  64 + 白金卡会员的订单将采用最快速度进行配送
  65 + </span>
  66 + </p>
  67 + </li>
  68 + {{/or}}
  69 +
  70 + {{#or vip3 all}}
  71 + <li>
  72 + <span class="icon icon-gift"></span>
  73 + <p>
  74 + 纪念品赠送
  75 + <span>
  76 + 白金会员将有机会获得YOHO!与各潮流品牌和明显合作的联名款纪念品
  77 + </span>
  78 + </p>
  79 + </li>
  80 + {{/or}}
  81 +</ul>
@@ -33,7 +33,8 @@ class ShoppingCartController extends AbstractAction @@ -33,7 +33,8 @@ class ShoppingCartController extends AbstractAction
33 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90', 33 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/09/17/03/014cacfa5c458b9732c68adf1af15d7a45.jpg?imageMogr2/thumbnail/120x120/extent/120x120/background/d2hpdGU=/position/center/quality/90',
34 'name' => 'Life.After.Life纯棉短袜', 34 'name' => 'Life.After.Life纯棉短袜',
35 'salePrice' => 19, 35 'salePrice' => 19,
36 - 'price' => 99 36 + 'price' => 99,
  37 + 'count' => 1
37 ) 38 )
38 ), 39 ),
39 array( 40 array(
@@ -43,7 +44,8 @@ class ShoppingCartController extends AbstractAction @@ -43,7 +44,8 @@ class ShoppingCartController extends AbstractAction
43 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90', 44 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/10/03/10/01bc1878f9154e77ac4f7a6003c954f1b8.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
44 'name' => '银鳞堂民族风牛皮手绳', 45 'name' => '银鳞堂民族风牛皮手绳',
45 'salePrice' => 9, 46 'salePrice' => 9,
46 - 'price' => 19 47 + 'price' => 19,
  48 + 'count' => 1
47 ) 49 )
48 ) 50 )
49 ) 51 )