Authored by 梁志锋

update

... ... @@ -7,6 +7,7 @@
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../plugin/tip'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho.lazyload');
var navHammer,
... ... @@ -65,7 +66,7 @@ if (lifestyleType) {
});
}
//loading.init($('.maybe-like'));
loading.init($('.maybe-like'));
function search() {
if (searching) {
... ... @@ -73,7 +74,7 @@ function search() {
}
searching = true;
//loading.showLoadingMask();
loading.showLoadingMask();
//num = $goodList.find('.good-info').length;
$.ajax({
... ... @@ -123,15 +124,13 @@ function search() {
}
searching = false;
//loading.hideLoadingMask();
loading.hideLoadingMask();
page++;
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
//loading.hideLoadingMask();
loading.hideLoadingMask();
}
});
}
... ...
... ... @@ -8,19 +8,30 @@ var $ = require('jquery');
var $page = $('.yoho-page');
var $loading;
var $loading,
hasInit = false;
//初始化
(function() {
/** modify by liangzhifeng at 2015.11.2 */
// 初始化
function init($container) {
hasInit = true;
if ($container === undefined) {
$container = $page;
}
var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
$page.append(html);
$container.append(html);
$loading = $page.children('.loading-mask');
}());
$loading = $container.children('.loading-mask');
}
//显示loading
function showLoadingMask() {
if (!hasInit) {
init();
hasInit = true;
}
$loading.removeClass('hide');
}
... ... @@ -29,5 +40,6 @@ function hideLoadingMask() {
$loading.addClass('hide');
}
exports.init = init;
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;
\ No newline at end of file
... ...
.loading-mask {
position: fixed;
position: absolute;
background: rgba(0,0,0,.1);
top: 0;
bottom: 0;
... ... @@ -17,4 +17,5 @@
margin-left: -50rem / $pxConvertRem;
margin-top: -20rem / $pxConvertRem;
}
}
\ No newline at end of file
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@
border-top: 1px solid #ccc;
// border-bottom: 1px solid #ccc;
margin-top: 30rem / $pxConvertRem;
position: relative;
.title {
height: 104rem / $pxConvertRem;
font-size: 38rem / $pxConvertRem;
... ...