mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 16:39:37 +08:00
1
This commit is contained in:
parent
896fc7959c
commit
749740100d
@ -19,3 +19,12 @@ export function openDoorRq(data) {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开门记录
|
||||||
|
export function getOpenDoorRecordRq(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/equipment/getOpenDoorRecord?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
@ -2,9 +2,15 @@ const app = getApp()
|
|||||||
|
|
||||||
import Notify from '@vant/weapp/notify/notify';
|
import Notify from '@vant/weapp/notify/notify';
|
||||||
|
|
||||||
|
import {
|
||||||
|
selfFormatTimeYMD,
|
||||||
|
selfFormatTimeHM
|
||||||
|
} from "../../../utils/util.js"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getEquipmentByUserIdRq,
|
getEquipmentByUserIdRq,
|
||||||
openDoorRq
|
openDoorRq,
|
||||||
|
getOpenDoorRecordRq
|
||||||
} from "../../../api/meeting/equipment.js"
|
} from "../../../api/meeting/equipment.js"
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@ -17,6 +23,7 @@ Page({
|
|||||||
activeNames: [0],
|
activeNames: [0],
|
||||||
userDetail: {},
|
userDetail: {},
|
||||||
equipmentDataList: [],
|
equipmentDataList: [],
|
||||||
|
openRecordList: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,6 +42,8 @@ Page({
|
|||||||
})
|
})
|
||||||
// 获取设备数据
|
// 获取设备数据
|
||||||
_this.getEquipmentData();
|
_this.getEquipmentData();
|
||||||
|
// 获取-开门记录数据
|
||||||
|
_this.getOpenRecordData()
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取设备数据
|
// 获取设备数据
|
||||||
@ -60,6 +69,27 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 获取-开门记录数据
|
||||||
|
getOpenRecordData() {
|
||||||
|
let _this = this;
|
||||||
|
getOpenDoorRecordRq({
|
||||||
|
userId: _this.data.userDetail.id,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
}).then(res => {
|
||||||
|
console.log('getOpenRecordData', res);
|
||||||
|
let openRecordList = res.data.records
|
||||||
|
openRecordList = openRecordList.map(item => {
|
||||||
|
item.createTimeYMD = selfFormatTimeYMD(item.createTime)
|
||||||
|
item.createTimeHM = selfFormatTimeHM(item.createTime)
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
_this.setData({
|
||||||
|
openRecordList
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 开门
|
// 开门
|
||||||
openDoor(e) {
|
openDoor(e) {
|
||||||
console.log('openDoor', e);
|
console.log('openDoor', e);
|
||||||
@ -68,7 +98,7 @@ Page({
|
|||||||
let deviceId = e.currentTarget.dataset.deviceid
|
let deviceId = e.currentTarget.dataset.deviceid
|
||||||
let roomId = e.currentTarget.dataset.roomid
|
let roomId = e.currentTarget.dataset.roomid
|
||||||
let status = e.currentTarget.dataset.status
|
let status = e.currentTarget.dataset.status
|
||||||
if (!status == '在线') {
|
if (status != '在线') {
|
||||||
Notify({
|
Notify({
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
message: '设备不在线!'
|
message: '设备不在线!'
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<!-- 门禁控制列表 -->
|
<!-- 门禁控制列表 -->
|
||||||
<view class="controlView">
|
<view class="controlView">
|
||||||
<view class="controlItem" wx:for="{{equipmentDataList}}">
|
<view class="controlItem" wx:for="{{equipmentDataList}}" wx:key="*this">
|
||||||
<view class="msg">
|
<view class="msg">
|
||||||
<view class="title">{{item.equipmentName}}</view>
|
<view class="title">{{item.equipmentName}}</view>
|
||||||
<view class="status {{item.statusClass}}">{{item.equipmentStatus}}</view>
|
<view class="status {{item.statusClass}}">{{item.equipmentStatus}}</view>
|
||||||
@ -24,12 +24,12 @@
|
|||||||
|
|
||||||
<!-- 开门记录 -->
|
<!-- 开门记录 -->
|
||||||
<view class="recordView">
|
<view class="recordView">
|
||||||
<view class="recordItem" wx:for="{{5}}">
|
<view class="recordItem" wx:for="{{openRecordList}}" wx:key="*this">
|
||||||
<view class="timeView">
|
<view class="timeView">
|
||||||
<view class="timeYMD">2024-02-06</view>
|
<view class="timeYMD">{{item.createTimeYMD}}</view>
|
||||||
<view class="timeHm">13:00</view>
|
<view class="timeHm">{{item.createTimeHM}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="msg">西大门开启</view>
|
<view class="msg">{{item.deviceName}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.itemTitleView .more {
|
.itemTitleView .more {
|
||||||
font-size: 26rpx;
|
font-size: 28rpx;
|
||||||
color: #4b89ef;
|
color: #4b89ef;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recordView {
|
.recordView {
|
||||||
padding: 60rpx 24rpx 140rpx;
|
padding: 20rpx 24rpx;
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,74 @@
|
|||||||
// pages/meeting/accessControl/accessControlRecord.js
|
const app = getApp()
|
||||||
|
|
||||||
|
import {
|
||||||
|
selfFormatTimeYMD,
|
||||||
|
selfFormatTimeHM
|
||||||
|
} from "../../../../utils/util.js"
|
||||||
|
|
||||||
|
import {
|
||||||
|
getOpenDoorRecordRq
|
||||||
|
} from "../../../../api/meeting/equipment.js"
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
IMG_NAME: app.IMG_NAME,
|
||||||
|
userDetail: {},
|
||||||
|
openRecordList: [],
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 25,
|
||||||
|
isDataAll: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
let _this = this;
|
||||||
|
let userDetail = wx.getStorageSync('user')
|
||||||
|
_this.setData({
|
||||||
|
userDetail,
|
||||||
|
...options,
|
||||||
|
})
|
||||||
|
// 获取-开门记录数据
|
||||||
|
_this.getOpenRecordData()
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 获取-开门记录数据
|
||||||
|
getOpenRecordData() {
|
||||||
|
let _this = this;
|
||||||
|
if (_this.data.isDataAll) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
getOpenDoorRecordRq({
|
||||||
|
userId: _this.data.userDetail.id,
|
||||||
|
pageNum: _this.data.pageNum,
|
||||||
|
pageSize: _this.data.pageSize
|
||||||
|
}).then(res => {
|
||||||
|
console.log('getOpenRecordData', res);
|
||||||
|
let queryList = res.data.records
|
||||||
|
if (queryList && queryList.length > 0) {
|
||||||
|
queryList = queryList.map(item => {
|
||||||
|
item.createTimeYMD = selfFormatTimeYMD(item.createTime)
|
||||||
|
item.createTimeHM = selfFormatTimeHM(item.createTime)
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
let openRecordList = _this.data.openRecordList.concat(queryList);
|
||||||
|
_this.setData({
|
||||||
|
openRecordList,
|
||||||
|
pageNum: _this.data.pageNum + 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_this.setData({
|
||||||
|
isDataAll: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +110,10 @@ Page({
|
|||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
*/
|
*/
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
|
console.log('onReachBottom 页面上拉触底');
|
||||||
|
let _this = this;
|
||||||
|
// 获取-开门记录数据
|
||||||
|
_this.getOpenRecordData();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {},
|
"usingComponents": {
|
||||||
"navigationBarTitleText": "开门记录"
|
"van-divider": "@vant/weapp/divider/index"
|
||||||
|
},
|
||||||
|
"navigationBarTitleText": "开门记录",
|
||||||
|
"onReachBottomDistance": 100
|
||||||
}
|
}
|
@ -1,19 +1,13 @@
|
|||||||
<view class="container">
|
<view class="containerView public">
|
||||||
<!-- 标题 -->
|
|
||||||
<!-- <view class="itemTitleView">
|
|
||||||
<view class="line"></view>
|
|
||||||
<view class="title">开门记录</view>
|
|
||||||
<view class="line"></view>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<!-- 开门记录 -->
|
<!-- 开门记录 -->
|
||||||
<view class="recordView">
|
<view class="recordView">
|
||||||
<view class="recordItem" wx:for="{{25}}">
|
<view class="recordItem" wx:for="{{openRecordList}}" wx:key="*this">
|
||||||
<view class="timeView">
|
<view class="timeView">
|
||||||
<view class="timeYMD">2024-02-06</view>
|
<view class="timeYMD">{{item.createTimeYMD}}</view>
|
||||||
<view class="timeHm">13:00</view>
|
<view class="timeHm">{{item.createTimeHM}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="msg">西大门开启</view>
|
<view class="msg">{{item.deviceName}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<van-divider wx:if="{{isDataAll}}" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
|
||||||
</view>
|
</view>
|
@ -1,40 +1,10 @@
|
|||||||
|
.containerView.public {
|
||||||
.container{
|
height: auto;
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
background: #ffffff;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.itemTitleView {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.itemTitleView .title {
|
|
||||||
margin: 0 30rpx;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #141414;
|
|
||||||
}
|
|
||||||
|
|
||||||
.itemTitleView .line{
|
|
||||||
flex: 1;
|
|
||||||
height: 1rpx;
|
|
||||||
background: gray;
|
|
||||||
opacity: 0.12;
|
|
||||||
}
|
|
||||||
|
|
||||||
.itemTitleView .more {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #4b89ef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.recordView {
|
.recordView {
|
||||||
padding: 60rpx 24rpx 140rpx;
|
padding: 60rpx 24rpx 10rpx;
|
||||||
background: white;
|
/* background: white; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.recordView .recordItem {
|
.recordView .recordItem {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user