Authored by 陈轩

fix

'use strict';
const fs = require('fs');
let devHost = '172.16.10.123';
let devHost = 'localhost';
fs.readFile('.devhost', (err, buf)=> {
if (!err) {
... ...
... ... @@ -191,7 +191,7 @@ getIndexHtml = function() {
if (data) {
if (avatarSwiperClone) {
avatarSwiperClone.destroy(true, true);
avatarSwiperClone = '';
avatarSwiperClone = null;
}
$mainContent.html(data);
... ... @@ -227,46 +227,44 @@ starIScroll.iScroll.on('scrollStart', function() {
});
starIScroll.iScroll.on('scroll', function() {
var avatarOffsetT;
if (this.directionY !== -1) {
setTimeout(function() {
starIScroll.iScroll.refresh();
}, 0);
}
console.log(this);
$window.trigger('scroll');
avatarOffsetT = $avatarWrap[0].offsetTop;
if (-this.y >= avatarOffsetT) {
$avatarClone.show();
if (!avatarSwiperClone) {
avatarSwiperClone = new Swiper($avatarClone[0], {
loop: true,
initialSlide: $avatarWrap.find('.swiper-slide-active').index() % bannerLen,
centeredSlides: true,
slidesPerView: 'auto',
loopedSlides: bannerLen,
spaceBetween: 10,
slidesOffsetBefore: -swiperNum,
watchSlidesProgress: true,
watchSlidesVisibility: true,
onInit: function() {
$avatarClone.find('li').on('click', function() {
res = bindAvatar($(this));
return res;
});
}
});
// if ($avatarWrap.offset().top <= headTabH) {
// $avatarClone.show();
//
// if (!avatarSwiperClone) {
// avatarSwiperClone = new Swiper('.avatar-0', {
// loop: true,
// initialSlide: $('.avatar-1').find('.swiper-slide-active').index() % bannerLen,
// centeredSlides: true,
// slidesPerView: 'auto',
// loopedSlides: bannerLen,
// spaceBetween: 10,
// slidesOffsetBefore: -swiperNum,
// watchSlidesProgress: true,
// watchSlidesVisibility: true,
// onInit: function() {
// $('.avatar-0 li').on('click', function() {
// res = bindAvatar($(this));
// return res;
// });
// }
// });
//
// avatarSwiperClone.params.control = avatarSwiper;
// avatarSwiper.params.control = avatarSwiperClone;
// }
// }
//
// if ($avatarWrap.offset().top > $('.avatar-1')[0].scrollHeight) {
// $avatarClone.hide();
// }
avatarSwiperClone.params.control = avatarSwiper;
avatarSwiper.params.control = avatarSwiperClone;
}
} else {
$avatarClone.hide();
}
});
starIScroll.iScroll.on('scrollEnd', function() {
... ...
... ... @@ -35,7 +35,7 @@ function PullRefresh(seclector, options) {
this.iScroll = new IScroll($em.get(0), {
click: true,
probeType: 2
probeType: 3
});
this.iScroll.on('scrollStart', function() {
... ...