2021-12-23 10:00:27 +08:00
|
|
|
|
<template>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<error-page v-if="showError" @closeError="closeError"></error-page>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<!-- 主体内容 -->
|
2022-01-08 17:37:07 +08:00
|
|
|
|
<div class="main-box" v-else>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<!-- 左侧 -->
|
|
|
|
|
<div class="main-left">
|
|
|
|
|
<!-- 班级详情 -->
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="left-one flex-s0">
|
|
|
|
|
<div class="left-content">
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<div class="left-title">
|
|
|
|
|
<div class="pultitle">班级详情</div>
|
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="second-title" v-if="className!=''">{{className}}</div>
|
|
|
|
|
<div class="line" v-if="className!=''"></div>
|
|
|
|
|
<div class="three-content" v-if="className!=''">
|
2021-12-26 19:07:45 +08:00
|
|
|
|
<div>老师:{{teacherName}}</div>
|
|
|
|
|
<div>班级人数:{{classNum}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="line" v-if="className!=''"></div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<div class="left-last">
|
2021-12-26 19:07:45 +08:00
|
|
|
|
<div v-for="(item,index) in daoArr" :key="index">
|
|
|
|
|
<div>{{item.num}}</div>
|
|
|
|
|
<div>{{item.title}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<loading :isShow="showLoading_one"></loading>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 宝宝食谱 -->
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="left-one flex-s0">
|
2021-12-24 09:56:55 +08:00
|
|
|
|
<div class="left-content">
|
|
|
|
|
<div class="left-title">
|
2022-01-08 17:37:07 +08:00
|
|
|
|
<div class="pultitle">今日食谱</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2021-12-26 19:07:45 +08:00
|
|
|
|
<div v-if="threeMeals.length!=0">
|
2021-12-25 13:09:46 +08:00
|
|
|
|
<div class="eat-three">
|
|
|
|
|
<div :class="threeMealIndex == index ? 'threeMealActive' : ''"
|
|
|
|
|
v-for="(item, index) in threeMeals" :key="index" @click="chooseMeal(index)">
|
|
|
|
|
{{ item.Type }}
|
|
|
|
|
</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2021-12-25 13:09:46 +08:00
|
|
|
|
<div class="line"></div>
|
|
|
|
|
<div v-for="(item, index) in threeMeals" :key="index">
|
|
|
|
|
<div v-if="index == threeMealIndex" class="meal-box">
|
|
|
|
|
<img :src="item.Images" />
|
|
|
|
|
<div class="clips2">{{ item.FoodName }}</div>
|
|
|
|
|
</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2021-12-26 19:07:45 +08:00
|
|
|
|
</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<loading :isShow="showLoading_two"></loading>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
<!-- 通知公告 -->
|
|
|
|
|
<div class="left-one">
|
|
|
|
|
<div class="left-content">
|
|
|
|
|
<div class="left-title">
|
|
|
|
|
<div class="pultitle">通知公告</div>
|
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="second-title">{{className}}</div>
|
2022-01-08 17:37:07 +08:00
|
|
|
|
<div class="line" v-if="noticeObj.Content!=''"></div>
|
|
|
|
|
<div class="three-content left-notice" v-if="noticeObj.Content!=''">
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div class="clips2">{{noticeObj.Content}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2022-01-08 17:37:07 +08:00
|
|
|
|
<div class="notice-time" v-if="noticeObj.Content!=''">
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div>{{noticeObj.PublishTime}}</div>
|
|
|
|
|
<div><img src="../../static/img/home/slices.png" />{{noticeObj.BroweTotal}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<loading :isShow="showLoading_three"></loading>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 中部 -->
|
|
|
|
|
<div class="main-center">
|
|
|
|
|
<!-- 班级动态图文 -->
|
|
|
|
|
<div class="center-img-box">
|
|
|
|
|
<div class="center-title">班级动态</div>
|
|
|
|
|
<div class="img-box">
|
2022-01-08 17:37:07 +08:00
|
|
|
|
<swiper class="home-swiper" v-if="classImgArr.length" :options="swiperOption" style="position: relative;">
|
2022-01-10 18:41:59 +08:00
|
|
|
|
<swiper-slide v-for="(item,index) in classImgArr" :key="index" class="home-slide">
|
|
|
|
|
<img :src="item">
|
2022-01-03 16:38:59 +08:00
|
|
|
|
</swiper-slide>
|
|
|
|
|
</swiper>
|
|
|
|
|
<div class="swiper-pagination"></div>
|
|
|
|
|
<loading :isShow="showLoading_four"></loading>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 提醒 -->
|
|
|
|
|
<div class="remind-box">
|
|
|
|
|
<div class="msg-box">
|
2021-12-26 12:04:11 +08:00
|
|
|
|
<img src="../../static/img/home/icon-notice.png" />
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div v-if="noticeData!=0">{{noticeData}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="msg-box">
|
|
|
|
|
<div>宝宝提醒</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div v-if="babyNotice!=0">{{babyNotice}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="msg-box">
|
2021-12-27 20:20:51 +08:00
|
|
|
|
<div >生日提醒</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<div v-if="babyBirthdayData!=0">{{babyBirthdayData}}</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 右侧 -->
|
|
|
|
|
<div class="main-right">
|
|
|
|
|
<div class="left-title">
|
|
|
|
|
<div class="pultitle">今日活动</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right-content">
|
2022-01-10 18:41:59 +08:00
|
|
|
|
<div v-if="noonArr.length!=0" id="innerbox">
|
2021-12-25 13:09:46 +08:00
|
|
|
|
<div v-for="(item, index) in noonArr" :key="index">
|
|
|
|
|
<div class="right-title">{{ item.Ampm }}</div>
|
|
|
|
|
<div class="line" style="margin: 0 6px"></div>
|
|
|
|
|
<div class="right-item-box" v-for="(itemc, indexc) in item.Content"
|
|
|
|
|
:class="indexc % 2 != 0 ? 'oddActive' : ''" :key="indexc">
|
|
|
|
|
<div>{{ itemc.TimePart }}</div>
|
|
|
|
|
<div class="clips3">{{ itemc.Name }}</div>
|
|
|
|
|
</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2021-12-26 19:07:45 +08:00
|
|
|
|
</div>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
2022-01-03 16:38:59 +08:00
|
|
|
|
<loading :isShow="showLoading_five"></loading>
|
2021-12-24 09:56:55 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-12-23 10:00:27 +08:00
|
|
|
|
</template>
|
|
|
|
|
<script>
|
2022-01-10 18:41:59 +08:00
|
|
|
|
import $ from 'jquery'
|
2022-01-03 16:38:59 +08:00
|
|
|
|
import storage from 'good-storage'
|
2021-12-24 09:56:55 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: "homepage",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
threeMeals: [],
|
2021-12-24 09:56:55 +08:00
|
|
|
|
threeMealIndex: 0,
|
2021-12-26 15:21:26 +08:00
|
|
|
|
noticeData: 0,
|
2021-12-27 17:26:14 +08:00
|
|
|
|
babyBirthdayData: 0,
|
2022-01-03 16:38:59 +08:00
|
|
|
|
babyNotice:0,//宝宝提醒数量
|
2021-12-24 09:56:55 +08:00
|
|
|
|
dynamicPictureData: "",
|
2021-12-25 13:09:46 +08:00
|
|
|
|
noonArr: [],
|
2021-12-27 17:34:37 +08:00
|
|
|
|
moId:"",
|
|
|
|
|
model:"",
|
2021-12-26 19:07:45 +08:00
|
|
|
|
className:'',//班级名称
|
|
|
|
|
teacherName:'',//老师姓名
|
|
|
|
|
classNum:'',//班级人数
|
|
|
|
|
daoArr:[],//实到、未到、请假
|
2022-01-03 16:38:59 +08:00
|
|
|
|
classImgArr:[],
|
|
|
|
|
showLoading_one:true,
|
|
|
|
|
showLoading_two:true,
|
|
|
|
|
showLoading_three:true,
|
|
|
|
|
showLoading_four:true,
|
|
|
|
|
showLoading_five:true,
|
2022-01-08 17:37:07 +08:00
|
|
|
|
noticeObj:{
|
|
|
|
|
PublishTime:'',
|
|
|
|
|
Content:''
|
|
|
|
|
},
|
2022-01-03 16:38:59 +08:00
|
|
|
|
classGuid:'',
|
|
|
|
|
timer:null,
|
|
|
|
|
|
|
|
|
|
swiperOption: {
|
|
|
|
|
pagination: '.swiper-pagination',
|
|
|
|
|
paginationClickable: true,
|
|
|
|
|
autoplay: 3000,
|
|
|
|
|
autoplayDisableOnInteraction: false,
|
|
|
|
|
loop: true,
|
|
|
|
|
coverflow: {
|
|
|
|
|
rotate: 30,
|
|
|
|
|
stretch: 10,
|
|
|
|
|
depth: 60,
|
|
|
|
|
modifier: 2,
|
|
|
|
|
slideShadows : true
|
|
|
|
|
}
|
|
|
|
|
},
|
2022-01-08 17:37:07 +08:00
|
|
|
|
showError:false,
|
2022-01-10 18:41:59 +08:00
|
|
|
|
monitorTimer:null,
|
|
|
|
|
animate:false,
|
|
|
|
|
topVal:0,
|
|
|
|
|
scrollTime:null
|
2021-12-24 09:56:55 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2022-01-10 18:41:59 +08:00
|
|
|
|
destroyed() {
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
this.topVal = 0;
|
|
|
|
|
clearInterval(this.scrollTime);
|
|
|
|
|
},
|
2021-12-24 09:56:55 +08:00
|
|
|
|
methods: {
|
2022-01-10 18:41:59 +08:00
|
|
|
|
// 滚动动画
|
|
|
|
|
scrollEv(){
|
|
|
|
|
this.topVal = 0;
|
|
|
|
|
clearInterval(this.scrollTime);
|
|
|
|
|
this.scrollTime = setInterval(()=>{
|
|
|
|
|
let containerHeight = $('.right-content').height();
|
|
|
|
|
let contentHeight = $('#innerbox').height();
|
|
|
|
|
if(contentHeight + this.topVal <= containerHeight) {
|
|
|
|
|
$('#innerbox').animate({top:`${0}px`});
|
|
|
|
|
clearInterval(this.scrollTime);
|
|
|
|
|
this.topVal = 0;
|
|
|
|
|
this.scrollEv();
|
|
|
|
|
} else {
|
|
|
|
|
this.topVal = this.topVal - 50;
|
|
|
|
|
$('#innerbox').animate({top:`${this.topVal}px`});
|
|
|
|
|
}
|
|
|
|
|
},4000)
|
|
|
|
|
// $(function(){
|
|
|
|
|
// $('.pultitle').on('click',function(){
|
|
|
|
|
// $('#innerbox').animate({top:`${30}%`});
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
},
|
2022-01-03 16:38:59 +08:00
|
|
|
|
closeError(){
|
|
|
|
|
this.showError = false;
|
|
|
|
|
},
|
2021-12-24 09:56:55 +08:00
|
|
|
|
// 早中晚餐切换事件
|
|
|
|
|
chooseMeal(e) {
|
|
|
|
|
this.threeMealIndex = e;
|
|
|
|
|
},
|
|
|
|
|
// 宝宝食谱
|
|
|
|
|
async babyRecipeEv() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.babyRecipe,
|
|
|
|
|
methods: "get",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if(data.data.data!=undefined){
|
|
|
|
|
this.threeMeals = data.data.data;
|
|
|
|
|
this.$storage.set('threeMeals',this.threeMeals);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(this.$storage.get('threeMeals')!=undefined){
|
|
|
|
|
this.threeMeals = this.$storage.get('threeMeals');
|
|
|
|
|
}
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.showLoading_two = false;
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
2021-12-27 17:26:14 +08:00
|
|
|
|
// 通知消息数量
|
2021-12-24 09:56:55 +08:00
|
|
|
|
async notice() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.notice,
|
|
|
|
|
methods: "get",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if(data.data.data!=null){
|
|
|
|
|
this.noticeData = data.data.count;
|
|
|
|
|
this.noticeObj = data.data.data;
|
|
|
|
|
this.noticeObj.PublishTime = this.noticeObj.PublishTime.slice(0,11);
|
|
|
|
|
this.$storage.set('noticeData',this.noticeData)
|
|
|
|
|
this.$storage.set('noticeObj',this.noticeObj)
|
|
|
|
|
this.$storage.set('PublishTime',this.noticeObj.PublishTime)
|
|
|
|
|
storage.set('orgGuid',this.noticeObj.OrgGuid);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.noticeData = this.$storage.get('noticeData');
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(this.$storage.get('noticeObj')!=undefined){
|
|
|
|
|
this.noticeObj = this.$storage.get('noticeObj');
|
|
|
|
|
this.noticeObj.PublishTime = this.$storage.get('PublishTime');
|
|
|
|
|
}
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
this.showLoading_three = false;
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
2022-01-03 16:38:59 +08:00
|
|
|
|
// 今日活动
|
2021-12-24 09:56:55 +08:00
|
|
|
|
async schedulingWeb() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.schedulingWeb,
|
|
|
|
|
methods: "get",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if(data.data.data!=undefined){
|
|
|
|
|
this.noonArr = data.data.data[0].WeekData;
|
|
|
|
|
this.$storage.set('noonArr',this.noonArr)
|
2022-01-10 18:41:59 +08:00
|
|
|
|
this.scrollEv();
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(this.$storage.get('noonArr')==undefined){
|
|
|
|
|
this.noonArr = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.noonArr = this.$storage.get('noonArr');
|
2022-01-10 18:41:59 +08:00
|
|
|
|
this.scrollEv();
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.showLoading_five = false;
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
2021-12-27 17:26:14 +08:00
|
|
|
|
// 获取当日宝宝生日
|
2021-12-24 09:56:55 +08:00
|
|
|
|
async babyBirthday() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.babyBirthday,
|
|
|
|
|
methods: "get",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentGuid: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
this.babyBirthdayData = data.data.count;
|
|
|
|
|
this.$storage.set('babyBirthdayData',this.babyBirthdayData)
|
|
|
|
|
} else {
|
|
|
|
|
this.babyBirthdayData = this.$storage.get('babyBirthdayData');
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
2022-01-03 16:38:59 +08:00
|
|
|
|
// 班级动态
|
2021-12-24 09:56:55 +08:00
|
|
|
|
async dynamicPicture() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.dynamicPicture,
|
|
|
|
|
methods: "post",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if(data.data.data!=null){
|
|
|
|
|
this.classImgArr = data.data.data.PictureUrls;
|
|
|
|
|
this.$storage.set('classImgArr',this.classImgArr);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(this.$storage.get('classImgArr')!=undefined){
|
|
|
|
|
this.classImgArr = this.$storage.get('classImgArr');
|
|
|
|
|
}
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
this.showLoading_four = false;
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
2021-12-26 19:07:45 +08:00
|
|
|
|
// 班级情况
|
|
|
|
|
async classStatusEv() {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
this.showError = false;
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
url: this.$https.classStatus,
|
|
|
|
|
methods: "get",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID')
|
2022-01-03 16:38:59 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if(data.data.code==200){
|
|
|
|
|
let classInfo = data.data.data;
|
|
|
|
|
this.className = classInfo.ClassName;
|
|
|
|
|
this.$storage.set('className',this.className);
|
|
|
|
|
let newTeacher = [];
|
|
|
|
|
classInfo.Teachers.forEach(item=>{
|
|
|
|
|
newTeacher.push(item.TeacherName);
|
|
|
|
|
})
|
|
|
|
|
// 老师
|
|
|
|
|
this.teacherName = newTeacher.join(' ');
|
|
|
|
|
this.$storage.set('teacherName',this.teacherName);
|
|
|
|
|
// 班级人数
|
|
|
|
|
this.classNum = classInfo.StudentCount;
|
|
|
|
|
this.$storage.set('classNum',this.classNum);
|
|
|
|
|
// 实到、未到、请假
|
|
|
|
|
this.daoArr = [
|
|
|
|
|
{num:classInfo.Signed,title:'实到'},
|
|
|
|
|
{num:classInfo.NotSigned,title:'未到'},
|
|
|
|
|
{num:classInfo.Holiday,title:'请假'},
|
|
|
|
|
];
|
|
|
|
|
this.$storage.set('daoArr',this.daoArr);
|
|
|
|
|
// 班级guid
|
|
|
|
|
this.classGuid = classInfo.ClassGuid;
|
|
|
|
|
this.$storage.set('classGuid',this.classGuid);
|
|
|
|
|
// 调取宝宝提醒
|
|
|
|
|
this.remindEv();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(this.$storage.get('className')!=undefined){
|
|
|
|
|
this.className = this.$storage.get('className');
|
|
|
|
|
} else {
|
2022-01-03 16:38:59 +08:00
|
|
|
|
this.showError = true;
|
|
|
|
|
}
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(this.$storage.get('teacherName')!=undefined){
|
|
|
|
|
this.teacherName = this.$storage.get('teacherName');
|
|
|
|
|
}
|
|
|
|
|
if(this.$storage.get('classNum')!=undefined){
|
|
|
|
|
this.classNum = this.$storage.get('classNum');
|
|
|
|
|
}
|
|
|
|
|
if(this.$storage.get('daoArr')!=undefined){
|
|
|
|
|
this.daoArr = this.$storage.get('daoArr');
|
|
|
|
|
}
|
|
|
|
|
if(this.$storage.get('classGuid')!=undefined){
|
|
|
|
|
this.classGuid = this.$storage.get('classGuid');
|
|
|
|
|
}
|
2022-01-03 16:38:59 +08:00
|
|
|
|
}
|
|
|
|
|
this.showLoading_one = false;
|
|
|
|
|
},
|
|
|
|
|
// 宝宝提醒
|
|
|
|
|
async remindEv() {
|
|
|
|
|
if(this.$storage.get('network')){
|
|
|
|
|
let data = await this.$axios({
|
|
|
|
|
// 调用 serviceAPI
|
|
|
|
|
url: this.$https.remind,
|
|
|
|
|
methods: "post",
|
|
|
|
|
params: {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
EquipmentID: this.$storage.get('EquipmentID'),
|
2022-01-03 16:38:59 +08:00
|
|
|
|
page:1,
|
|
|
|
|
limit:100,
|
|
|
|
|
ClassGuid:this.classGuid
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
this.babyNotice = data.data.count;
|
|
|
|
|
this.$storage.set('babyNotice',this.babyNotice)
|
|
|
|
|
} else {
|
|
|
|
|
this.babyNotice = this.$storage.get('babyNotice');
|
|
|
|
|
}
|
2021-12-26 19:07:45 +08:00
|
|
|
|
},
|
2022-01-08 17:37:07 +08:00
|
|
|
|
plusReady(){
|
|
|
|
|
var that = this;
|
|
|
|
|
// 手机有效
|
2022-01-10 18:41:59 +08:00
|
|
|
|
this.$storage.set('EquipmentID',plus.device.imei);
|
|
|
|
|
// this.$storage.set('EquipmentID','yaohaotest001');
|
2022-01-08 17:37:07 +08:00
|
|
|
|
if(plus.networkinfo.getCurrentType()!=1){
|
|
|
|
|
that.$storage.set('network',true);
|
|
|
|
|
}
|
|
|
|
|
// 网页网络监听有效
|
|
|
|
|
// window.addEventListener('online', this.updateOnlineStatus); //网络由异常到正常时触发
|
|
|
|
|
// window.addEventListener('offline', this.updateOnlineStatus); //网络由正常到异常时触发
|
|
|
|
|
//网络更改
|
|
|
|
|
document.addEventListener( "netchange", function(res) {
|
|
|
|
|
var network = plus.networkinfo.getCurrentType();
|
|
|
|
|
if(network == 1) {
|
|
|
|
|
that.isNetwork = true;
|
|
|
|
|
that.$storage.set('network',false);
|
|
|
|
|
that.onLine = false;
|
|
|
|
|
// plus.nativeUI.toast('您的网络已断开');
|
|
|
|
|
}else {
|
|
|
|
|
that.activeIndex = '-1';
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
that.activeIndex = that.cunIndex;
|
|
|
|
|
},100)
|
|
|
|
|
that.isNetwork = false;
|
|
|
|
|
that.$storage.set('network',true);
|
|
|
|
|
that.onLine = true;
|
|
|
|
|
// plus.nativeUI.toast('您的网络已连接');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
requestEv(){
|
|
|
|
|
// 班级详情
|
|
|
|
|
this.classStatusEv();
|
|
|
|
|
this.babyRecipeEv();
|
|
|
|
|
this.schedulingWeb();
|
|
|
|
|
this.babyBirthday();
|
|
|
|
|
this.dynamicPicture();
|
|
|
|
|
this.notice();
|
2022-01-10 18:41:59 +08:00
|
|
|
|
},
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
|
|
|
|
mounted() {
|
2022-01-08 17:37:07 +08:00
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.plusReady();
|
|
|
|
|
},500)
|
2022-01-10 18:41:59 +08:00
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.requestEv();
|
2022-01-08 17:37:07 +08:00
|
|
|
|
},1000)
|
2022-01-03 16:38:59 +08:00
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.timer = setInterval(()=>{
|
|
|
|
|
// 宝宝提醒
|
|
|
|
|
this.remindEv();
|
|
|
|
|
// 通知公告
|
|
|
|
|
this.notice();
|
|
|
|
|
// 生日提醒
|
|
|
|
|
this.babyBirthday();
|
|
|
|
|
},1000*60)
|
|
|
|
|
},5000)
|
2022-01-10 18:41:59 +08:00
|
|
|
|
|
2021-12-24 09:56:55 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
2022-01-10 18:41:59 +08:00
|
|
|
|
</script>
|