Commit 92d579d2 by 姜雷

Merge branch 'test'

parents 568791d7 0fde1104
import { deviceFetch } from '../../api/fetch'; import { deviceFetch } from '../../api/fetch';
import { IMyApp } from '../../app';
const app = getApp<IMyApp>();
// miniprogram/pages/equipment/equipment.js // miniprogram/pages/equipment/equipment.js
Page({ Page({
...@@ -11,14 +14,15 @@ Page({ ...@@ -11,14 +14,15 @@ Page({
statusAmount: [], statusAmount: [],
totalAmount: [], totalAmount: [],
total: 0, total: 0,
warningCount: 0,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad() { onLoad() {
console.log('in onLoad');
this.fetchList(); this.fetchList();
this.fetchWarningCount();
}, },
fetchList() { fetchList() {
...@@ -53,6 +57,20 @@ Page({ ...@@ -53,6 +57,20 @@ Page({
}); });
}); });
}, },
fetchWarningCount() {
deviceFetch({
url: '/device/warning/count',
data: {
operatorId: app.globalData.userInfo.operateId,
},
})
.then(res => {
this.setData!({
warningCount: res.data,
});
})
.catch(err => {});
},
goReportPage(e) { goReportPage(e) {
const { index } = e.currentTarget.dataset; const { index } = e.currentTarget.dataset;
const item = this.data.areaDeviceAmount[index]; const item = this.data.areaDeviceAmount[index];
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<view class="equipment-title"> <view class="equipment-title">
<view class="equipment-title-color"></view> <view class="equipment-title-color"></view>
<view class="equipment-title-text">设备总数({{total}}台)</view> <view class="equipment-title-text">设备总数({{total}}台)</view>
<view class="equipment-title-warn">
<image class="equipment-title-warnIcon" src="../../images/ic_bj@2x.png" />
<view>{{warningCount}}条</view>
</view>
</view> </view>
<view class="equipment-canvas autoheight"> <view class="equipment-canvas autoheight">
<equipment-chart dataList="{{totalAmount}}" /> <equipment-chart dataList="{{totalAmount}}" />
......
...@@ -18,6 +18,20 @@ ...@@ -18,6 +18,20 @@
border-radius: 50%; border-radius: 50%;
background-color: #6895fe; background-color: #6895fe;
} }
.equipment-title-text {
flex: 1;
}
.equipment-title-warn {
display: flex;
align-items: center;
font-size: 24rpx;
color: #333;
}
.equipment-title-warnIcon {
width: 24rpx;
height: 24rpx;
margin-right: 12rpx;
}
.equipment-area { .equipment-area {
padding: 40rpx 24rpx; padding: 40rpx 24rpx;
background-color: #f8f8f8; background-color: #f8f8f8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment