优化今日活动

master
chen 2022-07-25 15:19:09 +08:00
parent d3c0b5c916
commit 3cd892bd36
1 changed files with 39 additions and 22 deletions

View File

@ -161,7 +161,14 @@
babyBirthdayData: 0, babyBirthdayData: 0,
babyNotice:0,// babyNotice:0,//
dynamicPictureData: "", dynamicPictureData: "",
noonArr: [], noonArr: [
// {
// Ampm:'',
// Content:[
// {TimePart:'05:32',Name:''}
// ]
// },
],
moId:"", moId:"",
model:"", model:"",
className:'',// className:'',//
@ -229,6 +236,7 @@
EquipmentID: this.$storage.get('EquipmentID') EquipmentID: this.$storage.get('EquipmentID')
}, },
}); });
if(data.data.data){
if(data.data.data.VideoUrls!=undefined){ if(data.data.data.VideoUrls!=undefined){
this.videoSrc = data.data.data.VideoUrls; this.videoSrc = data.data.data.VideoUrls;
this.$storage.set('videoSrc',this.videoSrc); this.$storage.set('videoSrc',this.videoSrc);
@ -237,6 +245,7 @@
this.classImgArr = data.data.data.PictureUrls; this.classImgArr = data.data.data.PictureUrls;
this.$storage.set('classImgArr',this.classImgArr); this.$storage.set('classImgArr',this.classImgArr);
} }
}
} else { } else {
if(this.$storage.get('videoSrc')!=undefined){ if(this.$storage.get('videoSrc')!=undefined){
this.videoSrc = this.$storage.get('videoSrc'); this.videoSrc = this.$storage.get('videoSrc');
@ -265,11 +274,17 @@
}, },
// //
scrollEv(){ scrollEv(){
if(this.noonArr.length){
this.topVal = 0; this.topVal = 0;
clearInterval(this.monitorTimer); clearInterval(this.monitorTimer);
let parentHeight = $('.right-content').height(); let parentHeight = $('.right-content').height();
let childrenHeight = $('#innerbox').height(); let childrenHeight = $('#innerbox').height();
this.diffHeight = childrenHeight - parentHeight; this.diffHeight = childrenHeight - parentHeight;
let timeLen = 100;
if(this.diffHeight<100){
timeLen = 500;
}
if(childrenHeight>(parentHeight)){
this.monitorTimer = setInterval(()=>{ this.monitorTimer = setInterval(()=>{
let topFlag = $('#innerbox').position().top; let topFlag = $('#innerbox').position().top;
if(-topFlag*1==0){ if(-topFlag*1==0){
@ -278,7 +293,9 @@
if(-topFlag*1==this.diffHeight*1){ if(-topFlag*1==this.diffHeight*1){
this.downEv(); this.downEv();
} }
},100) },timeLen)
}
}
}, },
downEv(){ downEv(){
$('#innerbox').animate({top:0+'px'},(this.diffHeight/4)*100,'linear'); $('#innerbox').animate({top:0+'px'},(this.diffHeight/4)*100,'linear');
@ -327,7 +344,7 @@
EquipmentID: this.$storage.get('EquipmentID') EquipmentID: this.$storage.get('EquipmentID')
}, },
}); });
if(data.data.data!=null){ if(data.data.data){
this.noticeData = data.data.count; this.noticeData = data.data.count;
this.noticeObj = data.data.data; this.noticeObj = data.data.data;
this.noticeObj.PublishTime = this.noticeObj.PublishTime.slice(0,11); this.noticeObj.PublishTime = this.noticeObj.PublishTime.slice(0,11);
@ -355,7 +372,7 @@
EquipmentID: this.$storage.get('EquipmentID') EquipmentID: this.$storage.get('EquipmentID')
}, },
}); });
if(data.data.data!=undefined){ if(data.data.data){
this.noonArr = data.data.data[0].WeekData; this.noonArr = data.data.data[0].WeekData;
this.$storage.set('noonArr',this.noonArr) this.$storage.set('noonArr',this.noonArr)
this.animate = true; this.animate = true;