Authored by ccbikai

地址管理三级菜单

... ... @@ -12,7 +12,11 @@ var $action = $('.action'),
$submit = $('.submit'),
$addAddress = $('.add-address'),
$editAddressPage = $('.my-edit-address-page'),
isSubmiting;
$addressListPage = $('.my-address-list-page'),
$area = $('.area'),
$footer = $('#yoho-footer'),
isSubmiting,
newArea = [];
function editAddress(data) {
data = data || {};
... ... @@ -71,3 +75,30 @@ $addressForm.on('submit', function() {
});
return false;
});
// 省市区
$area.on('touchend', function() {
$footer.hide();
$addressListPage.show();
});
$addressListPage.on('touchend', '.address', function() {
newArea.push($(this).children('.caption').text());
$(this).siblings().hide();
$(this).children('ul').show();
return false;
}).on('touchend', '.address-last', function() {
// 填结果到 html
newArea.push($(this).children('.caption').text());
$('[name="area"]').val(newArea.join(' '));
$('[name="area_code"]').val($(this).data('id'));
// 恢复默认的三级选择
$addressListPage.hide();
$addressListPage.find('ul').hide();
$addressListPage.children('ul').show().children('li').show();
$footer.show();
newArea = [];
return false;
});
... ...
... ... @@ -102,7 +102,7 @@
.my-edit-address-page {
position: absolute;
bottom: 0;
top: pxToRem(90px);
top: 0;
width: 100%;
color: #d0d0d0;
background: #f0f0f0;
... ... @@ -157,7 +157,7 @@
textarea {
height: pxToRem(58px) * 2;
padding: pxToRem(20px) pxToRem(10px);
padding: pxToRem(20px) 0;
}
}
... ... @@ -172,3 +172,31 @@
line-height: pxToRem(88px);
}
}
.my-address-list-page {
position: absolute;
bottom: 0;
top: 0;
width: 100%;
color: #444;
background: #fff;
li {
padding: 0 pxToRem(30px);
font-size: pxToRem(32px);
line-height: pxToRem(88px);
border-bottom: 1px solid #e0e0e0;
.iconfont {
float: right;
color: #d0d0d0;
}
ul {
display: none;
position: absolute;
top: 0;
left: 0;
background: #fff;
width: 100%;
}
}
}
... ...
... ... @@ -6,7 +6,7 @@
<span class="tel">{{mobile}}</span>
<p class="address-info">{{area}} {{address}}</p>
<div class="action iconfont">
<a href="/home/address/edit?id={{address_id}}" class="edit">&#xe61e;</a>
<span class="edit" data-id="{{address_id}}" data-consignee="{{consignee}}" data-mobile="{{mobile}}" data-area-code="{{area_code}}" data-area="{{area}}" data-address="{{address}}">&#xe61e;</span>
<span class="del" data-id="{{address_id}}">&#xe621;</span>
</div>
</div>
... ... @@ -30,5 +30,7 @@
</div>
</div>
</div>
{{> me/address/edit-address}}
{{> me/address/address-list}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="my-edit-address-page yoho-page">
<form class="edit-address">
<label class="username">
用户名
<input type="text" name="name" value="张三">
</label>
<label class="mobile">
手机号码
<input type="text" name="mobile" value="18911110110">
</label>
<label class="area">
省市区
<input type="text" name="area" value="江苏省南京市栖霞区">
<span class="iconfont">&#xe604;</span>
</label>
<label class="address">
详细地址
<textarea name="address">东大街西大66号茶馆东大街西大66号茶馆东大街西大66号茶馆</textarea>
</label>
</form>
<div class="submit">
确认
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/header}}
<div class="online-service-page yoho-page">
{{# service}}
<div class="question">
<div class="question-title">问题查询</div>
<div class="question-tab">
{{#tab}}
<span class="tab-item {{#current}}current{{/current}}" data-tab="{{tabid}}">{{tabname}}</span>
{{#iscut}}<span class="line"></span>{{/iscut}}
{{/tab}}
</div>
{{#question}}
<ul class="question-list {{#current}}current{{/current}}" data-tab-name="{{name}}">
{{#list}}
<li class="question-item">
<a href="{{link}}" title="{{title}}">
{{title}}
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</li>
{{/list}}
</ul>
{{/question}}
</div>
{{/ service}}
<div class="connect-info">
<div class="connect-item connect-online">
<a href="http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&amp;configID=123576&amp;jid=9277320930" target="_blank" title="在线客服">
<span class="icon iconfont icon-chat">&#xe63c;</span>
在线客服
<span class="iconfont icon-yoho-enter">&#xe604;</span>
</a>
</div>
<div class="connect-item connect-tel">
<a href="tel:400-889-9649" title="电话客服">
<span class="icon iconfont icon-tel">&#xe63e;</span>
电话客服
<p>
400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
</p>
</a>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/header}}
<div class="online-service-detail-page yoho-page">
<div class="qa-list">
{{# list}}
<div class="question-item">
<div class="question">Q:{{q}}</div>
<div class="answer">{{a}}</div>
</div>
{{/ list}}
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ... @@ -231,3 +231,8 @@
seajs.use('js/me/online-service');
</script>
{{/if}}
{{#if addressPage}}
<script>
seajs.use('js/me/address');
</script>
{{/if}}
\ No newline at end of file
... ...
<div class="my-address-list-page hide">
{{# addressList}}
<ul class="address-list">
{{# addressList}}
<li class="address">
{{caption}}
<span class="caption">{{caption}}</span>
<span class="iconfont">&#xe604;</span>
<ul>
{{# sub}}
<li class="address">
{{caption}}
<span class="caption">{{caption}}</span>
<span class="iconfont">&#xe604;</span>
<ul class="address-list">
{{# sub}}
<li class="address-last" data-id="{{code}}">
{{caption}}, {{code}}
<span class="caption">{{caption}}</span>
</li>
{{/ sub}}
</ul>
... ... @@ -19,6 +20,6 @@
{{/ sub}}
</ul>
</li>
{{/ addressList}}
</ul>
{{/ addressList}}
</div>
\ No newline at end of file
... ...
... ... @@ -12,7 +12,7 @@
<label class="area">
省市区
<input type="hidden" name="area_code" value="">
<input type="text" name="area" value="">
<input type="text" name="area" value="" readonly>
<span class="iconfont">&#xe604;</span>
</label>
<label class="address">
... ...
... ... @@ -207,7 +207,7 @@ class HomeController extends AbstractAction
$address = \Index\UserModel::getAddressData($uid);
$addressList = \Index\UserModel::getAddressListData($uid);
// print_r($address);
// print_r($addressList);
$this->_view->display('address', array(
'addressPage' => true,
... ... @@ -277,7 +277,7 @@ class HomeController extends AbstractAction
$service = home\OnlineModel::getOnlineServiceInfo();
$this->_view->display('online_service', array(
$this->_view->display('online-service', array(
'onlineServicePage' => true,
// 'pageFooter' => true,
'service' => $service
... ... @@ -295,7 +295,7 @@ class HomeController extends AbstractAction
}
$this->setTitle('在线客服');
$this->setNavHeader($cateName, true, '');
$this->_view->display('online_service_detail', $service);
$this->_view->display('online-service-detail', $service);
}
/**
... ...
... ... @@ -296,10 +296,10 @@ class UserModel
} else if (empty($consignee)) {
$result['code'] = 403;
$result['message'] = '请输入收件人姓名';
} else if (!empty($email) && Helpers::verifyEmail($email)) {
} else if (!empty($email) && !Helpers::verifyEmail($email)) {
$result['code'] = 404;
$result['message'] = '输入的邮箱地址格式不正确';
} else if (!empty($mobile) && Helpers::verifyMobile($mobile)) {
} else if (!empty($mobile) && !Helpers::verifyMobile($mobile)) {
$result['code'] = 404;
$result['message'] = '输入的手机号码格式不正确';
} else {
... ...