Browse Source

feat:补充首页轮播图的图片

master
zhaobing’ 1 year ago
parent
commit
3798803511
  1. BIN
      weapp/images/banner1.png
  2. BIN
      weapp/images/banner2.png
  3. 18
      weapp/package/subSystem/subSystem.js
  4. 2
      weapp/package/subSystem/subSystem.wxml
  5. 6
      weapp/pages/home/home.js
  6. 11
      weapp/pages/home/home.wxss

BIN
weapp/images/banner1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

BIN
weapp/images/banner2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

18
weapp/package/subSystem/subSystem.js

@ -44,6 +44,7 @@ Page({
// level3Count: 0, //严重 // level3Count: 0, //严重
// dataList:[],//饼图数据 // dataList:[],//饼图数据
selectedDate: new Date(), // 设置默认选中的日期为当前日期 selectedDate: new Date(), // 设置默认选中的日期为当前日期
questions:0,//故障数量
formatter(day) { formatter(day) {
return day; return day;
@ -117,20 +118,7 @@ Page({
wx.hideLoading() wx.hideLoading()
}, },
//过滤轻微,中度,重度的巡检个数
filterLevelCount: function (list, level) {
return list?.filter(i => {
const content = i?.points?.inspectContent
if (content && content.length) {
for (let key in content) {
if (content.hasOwnProperty(key)) {
const subObject = content[key];
return subObject.level === level
}
}
}
})?.length
},
getSubSystemPatrolAbout: function (options) { getSubSystemPatrolAbout: function (options) {
// const userInfo=wx.getStorageSync('userInfo'); // const userInfo=wx.getStorageSync('userInfo');
let that = this; let that = this;
@ -199,9 +187,11 @@ Page({
} }
} }
const data1=Object.entries(levelCounts).map(([name, value]) => ({ name, value })); const data1=Object.entries(levelCounts).map(([name, value]) => ({ name, value }));
const totalValue = data1.reduce((accumulator, item) => accumulator + item.value, 0);
that.setData({ that.setData({
currentRepairCount: res?.filter(i => i.patrolRecordIssueHandles.length > 0).length || 0, currentRepairCount: res?.filter(i => i.patrolRecordIssueHandles.length > 0).length || 0,
currentPatrolCount: res.length, currentPatrolCount: res.length,
questions:totalValue,
formatter: function (e) { formatter: function (e) {
filteredData?.map(i => { filteredData?.map(i => {
if (moment(i.inspectionTime).format('YYYY-MM-DD') == moment(e.date).format('YYYY-MM-DD')) { if (moment(i.inspectionTime).format('YYYY-MM-DD') == moment(e.date).format('YYYY-MM-DD')) {

2
weapp/package/subSystem/subSystem.wxml

@ -20,7 +20,7 @@
<text class="fontStyle">故障</text> <text class="fontStyle">故障</text>
</view> </view>
<view class="countStyle"> <view class="countStyle">
总数:{{currentPatrolCount}} 总数:{{questions}}
</view> </view>
</view> </view>
<view style="height: 300px"> <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec }}"></ec-canvas> <view style="height: 300px"> <ec-canvas id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec }}"></ec-canvas>

6
weapp/pages/home/home.js

@ -78,14 +78,14 @@ Page({
const promiseArr = []; const promiseArr = [];
const that = this; const that = this;
var data = { var data = {
"datas": [ datas: [
{ {
"id": 1, "id": 1,
"imgurl": "/images/avatar.png" "imgurl": "/images/banner1.png"
}, },
{ {
"id": 2, "id": 2,
"imgurl": "/images/card_bg.png" "imgurl": "/images/banner2.png"
} }
] ]
}; };

11
weapp/pages/home/home.wxss

@ -57,14 +57,13 @@
} }
.home-swiper { .home-swiper {
width: 95%;
/* height: 360rpx; */
} }
/* .slide-image { .slide-image {
width: 100%; /* background: 100% 100% */
height: 100%; background-size:cover;
} */ }
.fontStyle { .fontStyle {
width: 18px; width: 18px;
height: 17px; height: 17px;

Loading…
Cancel
Save