Showing
10 changed files
with
139 additions
and
17 deletions
@@ -3,11 +3,11 @@ | @@ -3,11 +3,11 @@ | ||
3 | * @author: bikai<kai.bi@yoho.cn> | 3 | * @author: bikai<kai.bi@yoho.cn> |
4 | * @date: 2015/11/30 | 4 | * @date: 2015/11/30 |
5 | */ | 5 | */ |
6 | - var $ = require('jquery'), | ||
7 | - Hammer = require('yoho.hammer'), | ||
8 | - tip = require('../plugin/tip'), | ||
9 | - security = require('../plugin/security'), | ||
10 | - loading = require('../plugin/loading'); | 6 | +var $ = require('jquery'), |
7 | + Hammer = require('yoho.hammer'), | ||
8 | + tip = require('../plugin/tip'), | ||
9 | + security = require('../plugin/security'), | ||
10 | + loading = require('../plugin/loading'); | ||
11 | 11 | ||
12 | var $addressForm = $('.edit-address'), | 12 | var $addressForm = $('.edit-address'), |
13 | $submit = $('.submit'), | 13 | $submit = $('.submit'), |
@@ -96,6 +96,8 @@ $addressForm.on('submit', function() { | @@ -96,6 +96,8 @@ $addressForm.on('submit', function() { | ||
96 | } else { | 96 | } else { |
97 | if (queryString.refer === 'shopping') { | 97 | if (queryString.refer === 'shopping') { |
98 | window.location.href = '/cart/index/selectAddress'; | 98 | window.location.href = '/cart/index/selectAddress'; |
99 | + } else if (queryString.refer === 'modify') { | ||
100 | + window.location.href = '/home/addressModify'; | ||
99 | } else { | 101 | } else { |
100 | window.location.href = '/home/address'; | 102 | window.location.href = '/home/address'; |
101 | } | 103 | } |
1 | /** | 1 | /** |
2 | - * Created by Administrator on 2016/5/10. | 2 | + * 订单 地址修改 |
3 | + * @author: liangxiaosong | ||
4 | + * @date: 2016/5/11 | ||
3 | */ | 5 | */ |
4 | -console.log('ss'); | ||
6 | + | ||
7 | +var $ = require('jquery'), | ||
8 | + tip = require('../plugin/tip'); | ||
9 | + | ||
10 | +var $confimMod = $('.confim-modify-mask'), | ||
11 | + $modifyAdd = $('.modifyAdd'), | ||
12 | + deleteId; | ||
13 | + | ||
14 | +require('../common'); | ||
15 | + | ||
16 | +$('.address-item').on('touchend', function() { | ||
17 | + if ($(this).data('transfer') === 'true') { | ||
18 | + if ($modifyAdd.data('rel') === 'true') { | ||
19 | + $confimMod.find('.content').text('关联订单的收货地址将会一起修改且不可修改第二次,请确认是否修改?'); | ||
20 | + $confimMod.fadeIn(); | ||
21 | + } else { | ||
22 | + $confimMod.find('.content').text('收货地址仅且只能修改一次,请确认是否修改?'); | ||
23 | + $confimMod.fadeIn(); | ||
24 | + } | ||
25 | + } else { | ||
26 | + tip.show('由于运送方式不支持,不能修改地址!'); | ||
27 | + } | ||
28 | +}).on('touchend', '.edit', function() { | ||
29 | + window.location.href = $(this).data('href'); | ||
30 | + return false; | ||
31 | +}).on('touchstart', '.del', function() { | ||
32 | + deleteId = $(this).data('id'); | ||
33 | +}); | ||
34 | + |
@@ -10,7 +10,8 @@ var $ = require('jquery'), | @@ -10,7 +10,8 @@ var $ = require('jquery'), | ||
10 | dialog = require('./dialog'), | 10 | dialog = require('./dialog'), |
11 | tip = require('../plugin/tip'); | 11 | tip = require('../plugin/tip'); |
12 | 12 | ||
13 | -var orderId = $('#order-detail').data('id'); | 13 | +var orderId = $('#order-detail').data('id'), |
14 | + $ownerInfo = $('.owner-info'); | ||
14 | 15 | ||
15 | var optHammer; | 16 | var optHammer; |
16 | 17 | ||
@@ -87,3 +88,10 @@ optHammer.on('tap', function(e) { | @@ -87,3 +88,10 @@ optHammer.on('tap', function(e) { | ||
87 | }); | 88 | }); |
88 | } | 89 | } |
89 | }); | 90 | }); |
91 | + | ||
92 | +if ($ownerInfo.data('changeable') === true) { | ||
93 | + $ownerInfo.find('.rest').show(); | ||
94 | + $ownerInfo.on('touchend', function() { | ||
95 | + location.href = '/home/addressModify'; | ||
96 | + }); | ||
97 | +} |
static/sass/me/_address-modify.css
0 → 100644
1 | +.modify-address-page { | ||
2 | + .confim-modify-mask { | ||
3 | + position: fixed; | ||
4 | + width: 100%; | ||
5 | + height: 100%; | ||
6 | + left: 0; | ||
7 | + top: 0; | ||
8 | + background: rgba(0, 0, 0, .5); | ||
9 | + z-index: 5; | ||
10 | + } | ||
11 | + | ||
12 | + .confim-box { | ||
13 | + position: absolute; | ||
14 | + left: 50%; | ||
15 | + top: 50%; | ||
16 | + margin-left: -270px; | ||
17 | + margin-top: -144px; | ||
18 | + width: 540px; | ||
19 | + text-align: center; | ||
20 | + color: #444; | ||
21 | + background: #fff; | ||
22 | + font-size: 32px; | ||
23 | + font-weight: bold; | ||
24 | + border-radius: 10px; | ||
25 | + | ||
26 | + .content { | ||
27 | + text-align: left; | ||
28 | + padding: 30px 20px; | ||
29 | + line-height: 80px; | ||
30 | + } | ||
31 | + | ||
32 | + .action { | ||
33 | + line-height: 88px; | ||
34 | + border-top: 1px solid #e0e0e0; | ||
35 | + | ||
36 | + span { | ||
37 | + display: inline-block; | ||
38 | + width: 260px; | ||
39 | + | ||
40 | + &:first-child { | ||
41 | + border-right: 1px solid #e0e0e0; | ||
42 | + } | ||
43 | + } | ||
44 | + } | ||
45 | + | ||
46 | + .confim { | ||
47 | + color: #d0021b; | ||
48 | + } | ||
49 | + } | ||
50 | +} |
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | @import "fav"; | 8 | @import "fav"; |
9 | @import "suggest"; | 9 | @import "suggest"; |
10 | @import "address"; | 10 | @import "address"; |
11 | +@import "address-modify"; | ||
11 | @import "online-service"; | 12 | @import "online-service"; |
12 | @import "my-guang"; | 13 | @import "my-guang"; |
13 | @import "ihelp"; | 14 | @import "ihelp"; |
@@ -61,6 +61,19 @@ | @@ -61,6 +61,19 @@ | ||
61 | margin-top: 10px; | 61 | margin-top: 10px; |
62 | } | 62 | } |
63 | 63 | ||
64 | + .rest { | ||
65 | + display: none; | ||
66 | + position: relative; | ||
67 | + width: 100%; | ||
68 | + text-align: right; | ||
69 | + color: #f00; | ||
70 | + font-size: 24px; | ||
71 | + .iconAddress { | ||
72 | + position: static; | ||
73 | + font-size: 24px; | ||
74 | + } | ||
75 | + } | ||
76 | + | ||
64 | .order-status { | 77 | .order-status { |
65 | margin: 20px 0; | 78 | margin: 20px 0; |
66 | border-top: 1px solid #e0e0e0; | 79 | border-top: 1px solid #e0e0e0; |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | -<div class="my-address-page select-address-page yoho-page"> | ||
3 | - <div class="page-wrap clearfix"> | 2 | +<div class="my-address-page modify-address-page select-address-page yoho-page"> |
3 | + <div class="page-wrap clearfix modifyAdd" data-rel="{{hasRelations}}"> | ||
4 | {{# address}} | 4 | {{# address}} |
5 | - <div class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" data-href="/cart/index/orderEnsure"> | 5 | + <div class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" data-href="/home/orderdetail" data-transfer="{{transfer}}"> |
6 | <span class="name">{{consignee}}</span> | 6 | <span class="name">{{consignee}}</span> |
7 | <span class="tel">{{mobile}}</span> | 7 | <span class="tel">{{mobile}}</span> |
8 | <p class="address-info">{{area}} {{address}}</p> | 8 | <p class="address-info">{{area}} {{address}}</p> |
9 | <div class="action iconfont"> | 9 | <div class="action iconfont"> |
10 | - <span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=shopping"></span> | 10 | + <span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=modify"></span> |
11 | <span class="del" data-id="{{address_id}}"></span> | 11 | <span class="del" data-id="{{address_id}}"></span> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
14 | {{/ address}} | 14 | {{/ address}} |
15 | 15 | ||
16 | - <a class="add-address" data-href="/home/addressAct?refer=shopping"> | 16 | + <a class="add-address" data-href="/home/addressAct?refer=modify"> |
17 | 添加新地址 | 17 | 添加新地址 |
18 | </a> | 18 | </a> |
19 | 19 | ||
@@ -32,6 +32,22 @@ | @@ -32,6 +32,22 @@ | ||
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | </div> | 34 | </div> |
35 | + | ||
36 | + <div class="confim-modify-mask hide"> | ||
37 | + <div class="confim-box"> | ||
38 | + <div class="content"> | ||
39 | + 关联订单的收货地址将一起修改且不可修改第二次,请确认是否修改? | ||
40 | + </div> | ||
41 | + <div class="action"> | ||
42 | + <span class="cancel"> | ||
43 | + 取消 | ||
44 | + </span> | ||
45 | + <span class="confim"> | ||
46 | + 确认 | ||
47 | + </span> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + </div> | ||
35 | </div> | 51 | </div> |
36 | </div> | 52 | </div> |
37 | {{> layout/footer}} | 53 | {{> layout/footer}} |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div class="order-detail-page yoho-page"> | 2 | <div class="order-detail-page yoho-page"> |
3 | {{# orderDetail}} | 3 | {{# orderDetail}} |
4 | <div id="order-detail" data-id="{{orderNum}}"> | 4 | <div id="order-detail" data-id="{{orderNum}}"> |
5 | - <section class="owner-info block"> | 5 | + <section class="owner-info block" data-changeable="{{changeable}}"> |
6 | <span class="iconfont"></span> | 6 | <span class="iconfont"></span> |
7 | 7 | ||
8 | <div class="beside-icon"> | 8 | <div class="beside-icon"> |
@@ -14,6 +14,8 @@ | @@ -14,6 +14,8 @@ | ||
14 | <p class="address"> | 14 | <p class="address"> |
15 | {{address}} | 15 | {{address}} |
16 | </p> | 16 | </p> |
17 | + | ||
18 | + <div class="rest">其他地址<span class="iconfont iconAddress"></span></div> | ||
17 | </div> | 19 | </div> |
18 | </section> | 20 | </section> |
19 | 21 |
@@ -451,14 +451,13 @@ class HomeController extends AbstractAction | @@ -451,14 +451,13 @@ class HomeController extends AbstractAction | ||
451 | $this->auditJumpLogin(); | 451 | $this->auditJumpLogin(); |
452 | 452 | ||
453 | // 设置网站标题 | 453 | // 设置网站标题 |
454 | - $this->setTitle('地址管理'); | ||
455 | - $this->setNavHeader('地址管理', Helpers::url('/home'), false); | 454 | + $this->setTitle('地址修改'); |
455 | + $this->setNavHeader('地址修改', Helpers::url('/home'), false); | ||
456 | 456 | ||
457 | $uid = $this->_uid; | 457 | $uid = $this->_uid; |
458 | $address = UserModel::getAddressData($uid); | 458 | $address = UserModel::getAddressData($uid); |
459 | 459 | ||
460 | //以下为测试数据 | 460 | //以下为测试数据 |
461 | - $address['hasRelataions'] = 'true'; | ||
462 | 461 | ||
463 | $this->_view->display('address_modify', array( | 462 | $this->_view->display('address_modify', array( |
464 | 'addressModifyPage' => true, | 463 | 'addressModifyPage' => true, |
-
Please register or login to post a comment