Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -21,6 +21,7 @@ var $addressForm = $('.edit-address'),
isSubmiting,
currentPage = 'edit',
newArea = [],
chinaAddressList,
queryString = $.queryString();
$($editAddressPage, $addressListPage).css('min-height', function() {
... ... @@ -118,12 +119,7 @@ $submit.on('touchend', function() {
$(this).removeClass('highlight');
});
// 省市区列表异步加载
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000
}).then(function(html) {
function bindAddressListEvent(html) {
$addressListPage.html(html);
// 省市区
... ... @@ -185,6 +181,27 @@ $.ajax({
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
}).fail(function() {
}
// 读取省市区列表缓存
if (window.localStorage && window.localStorage.getItem) {
chinaAddressList = window.localStorage.getItem('chinaAddressList');
}
if (chinaAddressList) {
bindAddressListEvent(chinaAddressList);
} else {
// 省市区列表异步加载
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000
}).then(function(html) {
bindAddressListEvent(html);
if (window.localStorage && window.localStorage.setItem) {
window.localStorage.setItem('chinaAddressList', html);
}
}).fail(function() {
tip.show('获取省市区列表失败');
});
});
}
... ...
... ... @@ -4,5 +4,6 @@ require('./js/common');
require('./js/product/entry');
require('./js/home/entry');
require('./js/passport/entry');
module.exports = webYohobuy;
... ...
/*
* 密码中心打包入口文件
*/
require('./reg');
require('./back');
require('./login');
require('./reset');
\ No newline at end of file
... ...