Commit 0fde1104 by 姜雷

Merge branch 'develop' into test

parents 1a20cb38 c02fb3e4
import { deviceFetch } from '../../api/fetch';
import { IMyApp } from '../../app';
const app = getApp<IMyApp>();
// miniprogram/pages/equipment/equipment.js
Page({
......@@ -11,14 +14,15 @@ Page({
statusAmount: [],
totalAmount: [],
total: 0,
warningCount: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
console.log('in onLoad');
this.fetchList();
this.fetchWarningCount();
},
fetchList() {
......@@ -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) {
const { index } = e.currentTarget.dataset;
const item = this.data.areaDeviceAmount[index];
......
......@@ -4,6 +4,10 @@
<view class="equipment-title">
<view class="equipment-title-color"></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 class="equipment-canvas autoheight">
<equipment-chart dataList="{{totalAmount}}" />
......
......@@ -18,6 +18,20 @@
border-radius: 50%;
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 {
padding: 40rpx 24rpx;
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