Browse Source

安检巡查分页

lisu_V4.3.1
李素 1 year ago
parent
commit
90f5827ae6
  1. 2
      README.md
  2. 68
      subpages/securityCheck/pages/securityCheck.js
  3. 5
      subpages/securityCheck/pages/securityCheck.wxml
  4. 4
      utils/config.js

2
README.md

@ -13,3 +13,5 @@
12345678 12345678
17637262085 17637262085
Makui240345 Makui240345
13215601578
287504

68
subpages/securityCheck/pages/securityCheck.js

@ -3,7 +3,7 @@ import {securityCheckk} from "../../../utils/api";
Page({ Page({
data: { data: {
pageNo: 1, pageNo: 1,
pageSize:10, pageSize:3,
id: 0, id: 0,
waitingCheckStyle: "color: #1974ec;border-bottom: 2px solid blue;", waitingCheckStyle: "color: #1974ec;border-bottom: 2px solid blue;",
qualifiedStyle: "", qualifiedStyle: "",
@ -12,7 +12,11 @@ Page({
], ],
flag0Array:[], flag0Array:[],
flag1Array:[], flag1Array:[],
checkResultFlag:0 checkResultFlag:0,
lowerThreshold:'5',
loadMoreVisible:false,
loadMoreType: "none",
nodata:false,
}, },
onLoad(options) { onLoad(options) {
@ -26,20 +30,58 @@ Page({
url: '/subpages/InspectionReport/pages/InspectionReport/InspectionReport' url: '/subpages/InspectionReport/pages/InspectionReport/InspectionReport'
}) })
}, },
onScrollToLower(e){
console.log('gundaodi')
if (this.data.loadMoreType === 'more') {
this.setData({
loadMoreVisible: true,
})
this.data.pageNo += 1
this.getList()
}
},
getList() { getList() {
this.setData({
loadMoreVisible: true,
nodata: false,
loadMoreType: "more",
})
securityCheckk({ securityCheckk({
pageNo: this.data.pageNo, pageNo: this.data.pageNo,
pageSize: this.data.pageSize, pageSize: this.data.pageSize,
checkResultFlag:this.data.checkResultFlag checkResultFlag:this.data.checkResultFlag
}).then(({data}) => { }).then(({data}) => {
console.log(data) // this.setData({
// marsi: data.list,
// total: data.total
// })
// this.memem();
this.setData({ this.setData({
marsi: data.list, loadMoreType: data.list.length === this.data.pageSize ? 'more' : 'none',
total: data.total flag0Array: this.data.flag0Array.concat(data.list).filter(item => item.checkResultFlag === 0 || item.checkResultFlag == null),
flag1Array: this.data.flag1Array.concat(data.list).filter(item => item.checkResultFlag === 1)
})
if (this.data.flag0Array.length == 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
}
if (this.data.flag1Array.length == 0) {
this.setData({
loadMoreVisible: false,
nodata: true
})
}
}).catch(err=>{
console.log(err);
this.setData({
loadMoreVisible: false,
nodata: true,
})
}) })
this.memem();
// console.log("asdsa",this.data.marsi)
});
}, },
memem() { memem() {
this.setData({ this.setData({
@ -54,22 +96,24 @@ Page({
}) })
}, },
toggleColor(e) { toggleColor(e) {
console.log(123);
let value = e.currentTarget.dataset.value; // 获取点击选项的值 let value = e.currentTarget.dataset.value; // 获取点击选项的值
if (value === "1") { if (value === "1") {
this.setData({ this.setData({
waitingCheckStyle: "color: blue;border-bottom: 2px solid blue;", waitingCheckStyle: "color: blue;border-bottom: 2px solid blue;",
qualifiedStyle: "" qualifiedStyle: "",
flag0Array: []
}); });
this.data.checkResultFlag = 0 this.data.checkResultFlag = 0
this.data.pageNo = 1
this.getList() this.getList()
} else if (value === "2") { } else if (value === "2") {
this.setData({ this.setData({
waitingCheckStyle: "", waitingCheckStyle: "",
qualifiedStyle: "color: blue; border-bottom: 2px solid blue;" qualifiedStyle: "color: blue; border-bottom: 2px solid blue;",
flag1Array: []
}); });
this.data.checkResultFlag = 1 this.data.checkResultFlag = 1
this.data.pageNo = 1
this.getList() this.getList()
} }
}, },

5
subpages/securityCheck/pages/securityCheck.wxml

@ -10,7 +10,8 @@
</view> </view>
<view class=""> <view class="">
<view class="section_5"> <view class="section_5">
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;"> <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{waitingCheckStyle}}" style="width: 100%; height: 90vh;"
lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="list_1" wx:for="{{flag0Array}}" bind:tap="toDetails" data-resiId="{{item.id}}"> <view class="list_1" wx:for="{{flag0Array}}" bind:tap="toDetails" data-resiId="{{item.id}}">
<view class="section_1-0" id="scrollToHere"> <view class="section_1-0" id="scrollToHere">
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>
@ -29,7 +30,7 @@
</scroll-view> </scroll-view>
<scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;"> <scroll-view scroll-y="{{true}}" scroll-into-view="scrollToHere" wx:if="{{qualifiedStyle}}" style="width: 100%; height: 90vh;" lower-threshold="{{ lowerThreshold }}" bindscrolltolower="onScrollToLower">
<view class="list_1" wx:for="{{flag1Array}}" data-resiId="{{item.id}}" bind:tap="toDetails"> <view class="list_1" wx:for="{{flag1Array}}" data-resiId="{{item.id}}" bind:tap="toDetails">
<view class="section_1-0" id="scrollToHere" > <view class="section_1-0" id="scrollToHere" >
<view class="title">{{item.name}}</view> <view class="title">{{item.name}}</view>

4
utils/config.js

@ -5,9 +5,9 @@ module.exports = {
}; };
function BASEURL() { function BASEURL() {
return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境 // return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境 // return 'http://192.168.1.144/api/' //测试环境
// return 'http://219.146.91.110:30801/api/' return 'http://219.146.91.110:30801/api/'
// return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境 // return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境 // return 'http://192.168.1.144/api/' //测试环境

Loading…
Cancel
Save