|
@@ -59,6 +59,9 @@
|
|
|
<u-grid-item @click="gotoUrl('/pages/message/messageList?type=AA&typeName=账单提醒')">
|
|
|
<view class="icon icon3">
|
|
|
<image class="img" src="@/assets/img/antFill-account-book.svg" mode=""></image>
|
|
|
+ <view class="dot" v-if="headlineBill.unReadtNum" >
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="grid-text">账单提醒
|
|
|
</view>
|
|
@@ -66,6 +69,9 @@
|
|
|
<u-grid-item @click="gotoUrl('/pages/message/messageList?type=3&typeName=断电提醒')">
|
|
|
<view class="icon icon9">
|
|
|
<image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
|
|
|
+ <view class="dot" v-if="unReadtNum(3)" >
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="grid-text">断电提醒
|
|
|
</view>
|
|
@@ -73,6 +79,9 @@
|
|
|
<u-grid-item @click="gotoUrl('/pages/message/messageList?type=5&typeName=停电通知')">
|
|
|
<view class="icon icon5">
|
|
|
<image class="img" src="@/assets/img/antFill-notification.svg" mode=""></image>
|
|
|
+ <view class="dot" v-if="unReadtNum(5)" >
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="grid-text">停电通知
|
|
|
|
|
@@ -81,6 +90,9 @@
|
|
|
<u-grid-item @click="gotoUrl('/pages/message/messageList?type=4?type=5&typeName=故障警报')">
|
|
|
<view class="icon icon6">
|
|
|
<image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
|
|
|
+ <view class="dot" v-if="unReadtNum(4)" >
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="grid-text">故障警报
|
|
|
|
|
@@ -147,26 +159,67 @@
|
|
|
background: {
|
|
|
backgroundColor: '#3D86FF',
|
|
|
},
|
|
|
- prefetchNum:0
|
|
|
-
|
|
|
+ prefetchNum:0,
|
|
|
+ headlineBill:{},
|
|
|
+ messageList:[],
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onShow(){
|
|
|
this.homePage()
|
|
|
this.prefetch()
|
|
|
},
|
|
|
methods: {
|
|
|
+ unReadtNum(num){
|
|
|
+ for(var i in this.messageList){
|
|
|
+ var item=this.messageList[i];
|
|
|
+ if(item.typeId==num){
|
|
|
+ return item.unReadtNum
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+ },
|
|
|
prefetch(){
|
|
|
API_message.prefetch({
|
|
|
|
|
|
}).then((response) => {
|
|
|
- //this.prefetchNum=response.data
|
|
|
+ this.prefetchNum=response.data
|
|
|
+
|
|
|
+ this.getBillList()
|
|
|
+ this.getMessageTypeList()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ //uni.hideLoading();
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getMessageTypeList(){
|
|
|
+
|
|
|
+ API_message.messageTypeList().then((response) => {
|
|
|
+
|
|
|
+ this.messageList=response.data.typeList;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.hideLoading();
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getBillList(){
|
|
|
+
|
|
|
+ API_message.headlineBill().then((response) => {
|
|
|
+
|
|
|
+ this.headlineBill=response.data;
|
|
|
+ var num=response.data.unReadtNum;
|
|
|
+
|
|
|
if (this.$refs.tabbarMain) {
|
|
|
- this.$refs.tabbarMain.setprefetchNum(response.data);
|
|
|
+ this.$refs.tabbarMain.setprefetchNum(this.prefetchNum+num);
|
|
|
}
|
|
|
|
|
|
}).catch(error => {
|
|
|
- //uni.hideLoading();
|
|
|
+ uni.hideLoading();
|
|
|
|
|
|
})
|
|
|
},
|
|
@@ -260,7 +313,15 @@
|
|
|
color: #333333;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
-
|
|
|
+ .dot{
|
|
|
+ width: 20rpx;
|
|
|
+ height: 20rpx;
|
|
|
+ border-radius:999px;
|
|
|
+ background-color: rgba(255,0,0,1);
|
|
|
+ position: absolute;
|
|
|
+ top:24rpx;
|
|
|
+ right:24rpx;
|
|
|
+ }
|
|
|
.grid-text {
|
|
|
margin-top: 28rpx;
|
|
|
color: rgba(51, 51, 51, 1);
|