Authored by 周奇琪

Merge branch 'gray' into 'master'

解決地址选择为空的问题

冒泡导致地址ID没有正确获取

See merge request !9
... ... @@ -11,7 +11,7 @@
<ul class="address-list">
{{# sub}}
<li class="address-last" data-id="{{code}}">
<span class="caption">{{caption}}</span>
<span class="caption" data-id="{{code}}">{{caption}}</span>
</li>
{{/ sub}}
</ul>
... ...
{
"name": "m-yohobuy-node",
"version": "5.2.3",
"version": "5.2.4",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -20,8 +20,7 @@ var $addressForm = $('.edit-address'),
$area = $('.area'),
isSubmiting,
currentPage = 'edit',
newArea = [],
chinaAddressList;
newArea = [];
require('../common.js');
... ... @@ -193,27 +192,28 @@ function bindAddressListEvent(html) {
}
// 读取省市区列表缓存
if (window.localStorage && window.localStorage.getItem) {
chinaAddressList = window.localStorage.getItem('chinaAddressList');
}
// if (window.localStorage && window.localStorage.getItem) {
// chinaAddressList = window.localStorage.getItem('chinaAddressList');
// }
if (chinaAddressList) {
bindAddressListEvent(chinaAddressList);
} else {
// if (chinaAddressList) {
// bindAddressListEvent(chinaAddressList);
// } else {
// 省市区列表异步加载
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000,
cache: true
}).then(function(html) {
bindAddressListEvent(html);
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000,
cache: true
}).then(function(html) {
bindAddressListEvent(html);
// if (window.localStorage && window.localStorage.setItem) {
// window.localStorage.setItem('chinaAddressList', html);
// }
}).fail(function() {
tip.show('获取省市区列表失败');
});
}
}).fail(function() {
tip.show('获取省市区列表失败');
});
// }
... ...