Browse Source

feat:首页不能下滑问题+设置巡检日历没有巡检不能跳转

master
zhaobing’ 1 year ago
parent
commit
2e54dc3211
  1. 12
      weapp/package/subSystem/subSystem.js
  2. 4
      weapp/pages/home/home.wxml
  3. 2
      weapp/pages/home/home.wxss

12
weapp/package/subSystem/subSystem.js

@ -37,6 +37,7 @@ Page({
}, },
date: '', date: '',
show: true, show: true,
record:[],//巡检记录
currentPatrolCount: 0, //当月巡检次数 currentPatrolCount: 0, //当月巡检次数
currentRepairCount: 0, //当月维修次数 currentRepairCount: 0, //当月维修次数
// level1Count: 0, //轻微 // level1Count: 0, //轻微
@ -71,9 +72,19 @@ Page({
}, },
onDateSelect(e) { onDateSelect(e) {
const currentDate =moment(e.detail).format('YYYY-MM-DD')
const inspectionData = this.data.record.find(item => currentDate == moment(item.inspectionTime).format('YYYY-MM-DD'));
if (inspectionData) {
wx.navigateTo({ wx.navigateTo({
url: `/package/subSystem/dayPatrolInfo/dayPatrolInfo?day=${moment(e.detail).format('YYYY-MM-DD')}&subType=${this.subType}`, url: `/package/subSystem/dayPatrolInfo/dayPatrolInfo?day=${moment(e.detail).format('YYYY-MM-DD')}&subType=${this.subType}`,
}) })
}else{
wx.showToast({
title: '当天没有巡检记录',
icon: 'none',
});
}
}, },
/** /**
@ -194,6 +205,7 @@ Page({
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, questions:totalValue,
record:res,
formatter: function (e) { formatter: function (e) {
let allRecordsAreClean=false let allRecordsAreClean=false
// console.log('filter',filteredData) // console.log('filter',filteredData)

4
weapp/pages/home/home.wxml

@ -5,7 +5,7 @@
<swiper class="home-swiper" indicator-dots="true" autoplay="{{true}}" interval="{{2000}}" duration="{{500}}"> <swiper class="home-swiper" indicator-dots="true" autoplay="{{true}}" interval="{{2000}}" duration="{{500}}">
<block wx:for-items="{{swiperData}}" wx:key="*this"> <block wx:for-items="{{swiperData}}" wx:key="*this">
<swiper-item> <swiper-item>
<image src="{{item.imgurl}}" class="slide-image" /> <image src="{{item.imgurl}}" mode="aspectFill"/>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -73,5 +73,5 @@
</view> </view>
</view> </view>
<view></view>
</view> </view>

2
weapp/pages/home/home.wxss

@ -62,7 +62,7 @@
.slide-image { .slide-image {
/* background: 100% 100% */ /* background: 100% 100% */
background-size:cover; /* background-size:cover; */
} }
.fontStyle { .fontStyle {
width: 18px; width: 18px;

Loading…
Cancel
Save