Authored by liangxs

订单详情地址修改功能,文件添加

... ... @@ -3,11 +3,11 @@
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/30
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
security = require('../plugin/security'),
loading = require('../plugin/loading');
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
security = require('../plugin/security'),
loading = require('../plugin/loading');
var $addressForm = $('.edit-address'),
$submit = $('.submit'),
... ... @@ -96,6 +96,8 @@ $addressForm.on('submit', function() {
} else {
if (queryString.refer === 'shopping') {
window.location.href = '/cart/index/selectAddress';
} else if (queryString.refer === 'modify') {
window.location.href = '/home/addressModify';
} else {
window.location.href = '/home/address';
}
... ...
/**
* Created by Administrator on 2016/5/10.
* 订单 地址修改
* @author: liangxiaosong
* @date: 2016/5/11
*/
console.log('ss');
\ No newline at end of file
var $ = require('jquery'),
tip = require('../plugin/tip');
var $confimMod = $('.confim-modify-mask'),
$modifyAdd = $('.modifyAdd'),
deleteId;
require('../common');
$('.address-item').on('touchend', function() {
if ($(this).data('transfer') === 'true') {
if ($modifyAdd.data('rel') === 'true') {
$confimMod.find('.content').text('关联订单的收货地址将会一起修改且不可修改第二次,请确认是否修改?');
$confimMod.fadeIn();
} else {
$confimMod.find('.content').text('收货地址仅且只能修改一次,请确认是否修改?');
$confimMod.fadeIn();
}
} else {
tip.show('由于运送方式不支持,不能修改地址!');
}
}).on('touchend', '.edit', function() {
window.location.href = $(this).data('href');
return false;
}).on('touchstart', '.del', function() {
deleteId = $(this).data('id');
});
... ...
... ... @@ -10,7 +10,8 @@ var $ = require('jquery'),
dialog = require('./dialog'),
tip = require('../plugin/tip');
var orderId = $('#order-detail').data('id');
var orderId = $('#order-detail').data('id'),
$ownerInfo = $('.owner-info');
var optHammer;
... ... @@ -87,3 +88,10 @@ optHammer.on('tap', function(e) {
});
}
});
if ($ownerInfo.data('changeable') === true) {
$ownerInfo.find('.rest').show();
$ownerInfo.on('touchend', function() {
location.href = '/home/addressModify';
});
}
... ...
.modify-address-page {
.confim-modify-mask {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0, 0, 0, .5);
z-index: 5;
}
.confim-box {
position: absolute;
left: 50%;
top: 50%;
margin-left: -270px;
margin-top: -144px;
width: 540px;
text-align: center;
color: #444;
background: #fff;
font-size: 32px;
font-weight: bold;
border-radius: 10px;
.content {
text-align: left;
padding: 30px 20px;
line-height: 80px;
}
.action {
line-height: 88px;
border-top: 1px solid #e0e0e0;
span {
display: inline-block;
width: 260px;
&:first-child {
border-right: 1px solid #e0e0e0;
}
}
}
.confim {
color: #d0021b;
}
}
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,7 @@
@import "fav";
@import "suggest";
@import "address";
@import "address-modify";
@import "online-service";
@import "my-guang";
@import "ihelp";
... ...
... ... @@ -61,6 +61,19 @@
margin-top: 10px;
}
.rest {
display: none;
position: relative;
width: 100%;
text-align: right;
color: #f00;
font-size: 24px;
.iconAddress {
position: static;
font-size: 24px;
}
}
.order-status {
margin: 20px 0;
border-top: 1px solid #e0e0e0;
... ...
{{> layout/header}}
<div class="my-address-page select-address-page yoho-page">
<div class="page-wrap clearfix">
<div class="my-address-page modify-address-page select-address-page yoho-page">
<div class="page-wrap clearfix modifyAdd" data-rel="{{hasRelations}}">
{{# address}}
<div class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" data-href="/cart/index/orderEnsure">
<div class="address-item" data-address-id="{{address_id}}" data-is-support="{{is_support}}" data-href="/home/orderdetail" data-transfer="{{transfer}}">
<span class="name">{{consignee}}</span>
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
<div class="action iconfont">
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=shopping">&#xe61e;</span>
<span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=modify">&#xe61e;</span>
<span class="del" data-id="{{address_id}}">&#xe621;</span>
</div>
</div>
{{/ address}}
<a class="add-address" data-href="/home/addressAct?refer=shopping">
<a class="add-address" data-href="/home/addressAct?refer=modify">
添加新地址
</a>
... ... @@ -32,6 +32,22 @@
</div>
</div>
</div>
<div class="confim-modify-mask hide">
<div class="confim-box">
<div class="content">
关联订单的收货地址将一起修改且不可修改第二次,请确认是否修改?
</div>
<div class="action">
<span class="cancel">
取消
</span>
<span class="confim">
确认
</span>
</div>
</div>
</div>
</div>
</div>
{{> layout/footer}}
... ...
... ... @@ -2,7 +2,7 @@
<div class="order-detail-page yoho-page">
{{# orderDetail}}
<div id="order-detail" data-id="{{orderNum}}">
<section class="owner-info block">
<section class="owner-info block" data-changeable="{{changeable}}">
<span class="iconfont">&#xe631;</span>
<div class="beside-icon">
... ... @@ -14,6 +14,8 @@
<p class="address">
{{address}}
</p>
<div class="rest">其他地址<span class="iconfont iconAddress">&#xe614;</span></div>
</div>
</section>
... ...
... ... @@ -399,5 +399,6 @@
{{#if addressModifyPage}}
<script>
seajs.use('js/me/address-modify');
seajs.use('js/me/address');
</script>
{{/if}}
... ...
... ... @@ -451,14 +451,13 @@ class HomeController extends AbstractAction
$this->auditJumpLogin();
// 设置网站标题
$this->setTitle('地址管理');
$this->setNavHeader('地址管理', Helpers::url('/home'), false);
$this->setTitle('地址修改');
$this->setNavHeader('地址修改', Helpers::url('/home'), false);
$uid = $this->_uid;
$address = UserModel::getAddressData($uid);
//以下为测试数据
$address['hasRelataions'] = 'true';
$this->_view->display('address_modify', array(
'addressModifyPage' => true,
... ...