Merge branch 'feature/shopping' of git.yoho.cn:fe/yoho-blk into feature/shopping
Showing
4 changed files
with
36 additions
and
5 deletions
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | </span> | 10 | </span> |
11 | </p> | 11 | </p> |
12 | <div class="content"> | 12 | <div class="content"> |
13 | - <ul class="clearfix shrink"> | 13 | + <ul class="clearfix address-list shrink"> |
14 | {{#each address}} | 14 | {{#each address}} |
15 | <li class="address{{#if focus}} focus{{/if}}" data-id="{{id}}"> | 15 | <li class="address{{#if focus}} focus{{/if}}" data-id="{{id}}"> |
16 | <div class="address-header"></div> | 16 | <div class="address-header"></div> |
@@ -36,9 +36,7 @@ | @@ -36,9 +36,7 @@ | ||
36 | <span class="delete">删除</span> | 36 | <span class="delete">删除</span> |
37 | </p> | 37 | </p> |
38 | </div> | 38 | </div> |
39 | - {{#if focus}} | ||
40 | - <span class="address-chosed iconfont"></span> | ||
41 | - {{/if}} | 39 | + <span class="address-chosed iconfont"></span> |
42 | </li> | 40 | </li> |
43 | {{/each}} | 41 | {{/each}} |
44 | </ul> | 42 | </ul> |
@@ -37,6 +37,23 @@ require('../plugins/check'); | @@ -37,6 +37,23 @@ require('../plugins/check'); | ||
37 | 37 | ||
38 | lazyLoad($('img.lazy')); | 38 | lazyLoad($('img.lazy')); |
39 | 39 | ||
40 | +// 地址切换 | ||
41 | +$('.address-list').on('click', '.address', function() { | ||
42 | + var $this = $(this); | ||
43 | + | ||
44 | + if ($this.hasClass('focus')) { | ||
45 | + return; | ||
46 | + } | ||
47 | + | ||
48 | + $this.addClass('focus'); | ||
49 | + $this.siblings('.focus').removeClass('focus'); | ||
50 | +}); | ||
51 | + | ||
52 | +// 显示全部地址 | ||
53 | +$('.address-all').click(function() { | ||
54 | + $(this).siblings('.address-list').removeClass('shrink').end().remove(); | ||
55 | +}); | ||
56 | + | ||
40 | /** | 57 | /** |
41 | * 发票弹窗Factory | 58 | * 发票弹窗Factory |
42 | */ | 59 | */ |
@@ -19,6 +19,22 @@ | @@ -19,6 +19,22 @@ | ||
19 | overflow: hidden; | 19 | overflow: hidden; |
20 | } | 20 | } |
21 | } | 21 | } |
22 | + | ||
23 | + .new-address { | ||
24 | + height: 52px; | ||
25 | + } | ||
26 | + } | ||
27 | + | ||
28 | + .address { | ||
29 | + cursor: pointer; | ||
30 | + | ||
31 | + .address-chosed { | ||
32 | + display: none; | ||
33 | + } | ||
34 | + | ||
35 | + &.focus .address-chosed { | ||
36 | + display: block; | ||
37 | + } | ||
22 | } | 38 | } |
23 | 39 | ||
24 | .new-address .iconfont { | 40 | .new-address .iconfont { |
-
Please register or login to post a comment