优化今日活动

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,13 +236,15 @@
EquipmentID: this.$storage.get('EquipmentID') EquipmentID: this.$storage.get('EquipmentID')
}, },
}); });
if(data.data.data.VideoUrls!=undefined){ if(data.data.data){
this.videoSrc = data.data.data.VideoUrls; if(data.data.data.VideoUrls!=undefined){
this.$storage.set('videoSrc',this.videoSrc); this.videoSrc = data.data.data.VideoUrls;
} this.$storage.set('videoSrc',this.videoSrc);
if(data.data.data.PictureUrls.length){ }
this.classImgArr = data.data.data.PictureUrls; if(data.data.data.PictureUrls.length){
this.$storage.set('classImgArr',this.classImgArr); this.classImgArr = data.data.data.PictureUrls;
this.$storage.set('classImgArr',this.classImgArr);
}
} }
} else { } else {
if(this.$storage.get('videoSrc')!=undefined){ if(this.$storage.get('videoSrc')!=undefined){
@ -265,20 +274,28 @@
}, },
// //
scrollEv(){ scrollEv(){
this.topVal = 0; if(this.noonArr.length){
clearInterval(this.monitorTimer); this.topVal = 0;
let parentHeight = $('.right-content').height(); clearInterval(this.monitorTimer);
let childrenHeight = $('#innerbox').height(); let parentHeight = $('.right-content').height();
this.diffHeight = childrenHeight - parentHeight; let childrenHeight = $('#innerbox').height();
this.monitorTimer = setInterval(()=>{ this.diffHeight = childrenHeight - parentHeight;
let topFlag = $('#innerbox').position().top; let timeLen = 100;
if(-topFlag*1==0){ if(this.diffHeight<100){
this.upEv(); timeLen = 500;
} }
if(-topFlag*1==this.diffHeight*1){ if(childrenHeight>(parentHeight)){
this.downEv(); this.monitorTimer = setInterval(()=>{
let topFlag = $('#innerbox').position().top;
if(-topFlag*1==0){
this.upEv();
}
if(-topFlag*1==this.diffHeight*1){
this.downEv();
}
},timeLen)
} }
},100) }
}, },
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;