mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 11:59:37 +08:00
描述:展厅预约
This commit is contained in:
parent
41b9c96eae
commit
f3507b8a53
@ -57,3 +57,11 @@ export function saveShowRoomRecordRq(data) {
|
||||
});
|
||||
}
|
||||
|
||||
// 查询预约记录
|
||||
export function selectShowroomRecordRq(data) {
|
||||
return request({
|
||||
url: `/api/showroom/selectShowroomRecord?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
@ -1,20 +1,101 @@
|
||||
// pages/meeting/reservationRecord/exhibitionRecord/list.js
|
||||
const app = getApp()
|
||||
|
||||
import Notify from '@vant/weapp/notify/notify';
|
||||
|
||||
import {
|
||||
selectShowroomRecordRq,
|
||||
} from "../../../../../api/meeting/exhibition.js"
|
||||
|
||||
import {
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM
|
||||
} from "../../../../../utils/util.js"
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
IMG_NAME: app.IMG_NAME,
|
||||
userDetail: {},
|
||||
// 预约
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dataList: [],
|
||||
isAll: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let _this = this;
|
||||
let userDetail = wx.getStorageSync('user')
|
||||
_this.setData({
|
||||
...options,
|
||||
userDetail,
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
_this.getDataList()
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
getDataList() {
|
||||
let _this = this;
|
||||
if (_this.data.isAll) {
|
||||
return;
|
||||
}
|
||||
selectShowroomRecordRq({
|
||||
userId: _this.data.userDetail.id,
|
||||
pageNum: _this.data.pageNum,
|
||||
pageSize: _this.data.pageSize,
|
||||
}).then(res => {
|
||||
console.log('selectShowroomRecordRq', res);
|
||||
let dataList = res.data.records
|
||||
if (dataList && dataList.length > 0) {
|
||||
dataList = _this.data.dataList.concat(_this.formartData(dataList))
|
||||
_this.setData({
|
||||
dataList,
|
||||
pageNum: _this.data.pageNum + 1,
|
||||
})
|
||||
} else {
|
||||
_this.setData({
|
||||
isAll: true
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 格式化数据
|
||||
formartData(list) {
|
||||
return list.map(item => {
|
||||
let color = "#3794FF"
|
||||
if (item.status == 0) { // 待审核
|
||||
color = "#3794FF"
|
||||
} else if (item.status == 1) { // 审核通过
|
||||
color = "#62c855"
|
||||
} else if (item.status == 2) { // 审核驳回
|
||||
color = "red"
|
||||
}
|
||||
item.timeSlot = selfFormatTimeYMD(item.startTime) + ' ' + selfFormatTimeHM(item.startTime) + '~' + selfFormatTimeHM(item.endDate);
|
||||
console.log('item.timeSlot', item.timeSlot);
|
||||
item.statusColor = color;
|
||||
return item;
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转-详情、修改
|
||||
goDetail(e) {
|
||||
console.log('goDetail', e);
|
||||
let id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/visitorIinvitation/detail/detail'
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@ -54,7 +135,10 @@ Page({
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
console.log('onReachBottom');
|
||||
let _this = this;
|
||||
// 获取数据
|
||||
_this.getDataList()
|
||||
},
|
||||
|
||||
/**
|
||||
@ -62,5 +146,5 @@ Page({
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
},
|
||||
})
|
@ -1,3 +1,9 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
"navigationBarTitleText": "展厅预约",
|
||||
"onReachBottomDistance": 100,
|
||||
"usingComponents": {
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-notify": "@vant/weapp/notify/index",
|
||||
"van-divider": "@vant/weapp/divider/index"
|
||||
}
|
||||
}
|
@ -1,2 +1,28 @@
|
||||
<!--pages/meeting/reservationRecord/exhibitionRecord/list.wxml-->
|
||||
<text>pages/meeting/reservationRecord/exhibitionRecord/list.wxml</text>
|
||||
<view class="containerView public">
|
||||
<view class="itemView" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this" bind:tap="goDetail" data-id="{{item.id}}">
|
||||
<view class="headView">
|
||||
<view class="number">{{item.reservationNumber}}</view>
|
||||
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="contentView">
|
||||
<image class="img" src="{{IMG_NAME + item.indoorPicUrl}}" mode="aspectFill"></image>
|
||||
<view class="msgView">
|
||||
<view class="title">{{item.capacityNum}}人间 | {{item.roomName}} | {{item.buildingName}}</view>
|
||||
<view class="name">{{item.title}}</view>
|
||||
<view class="time">{{item.timeSlot}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnView">
|
||||
<view class="btn">查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loadAllLine" wx:if="{{isAll}}">
|
||||
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
|
||||
</view>
|
||||
|
||||
<!-- 提示框 -->
|
||||
<van-dialog id="van-dialog" />
|
||||
<!-- 提示框 -->
|
||||
<van-notify id="van-notify" />
|
||||
|
||||
</view>
|
@ -1 +1,93 @@
|
||||
/* pages/meeting/reservationRecord/exhibitionRecord/list.wxss */
|
||||
.containerView.public {
|
||||
background: none;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.itemView {
|
||||
background: white;
|
||||
margin: 30rpx 20rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
/* box-shadow: rgba(210,210,210,0.5) 0px 3.752px 3.752px 0px; */
|
||||
}
|
||||
|
||||
.itemView .headView {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.itemView .headView .number {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.itemView .headView .status {
|
||||
font-size: 26rpx;
|
||||
color: #4e96f8;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.itemView .contentView {
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
padding: 30rpx 20rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.itemView .contentView .img {
|
||||
border-radius: 10rpx;
|
||||
width: 200rpx;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.itemView .contentView .msgView {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.itemView .contentView .msgView .title {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.itemView .contentView .msgView .name,
|
||||
.itemView .contentView .msgView .time {
|
||||
font-size: 24rpx;
|
||||
color: gray;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.itemView .btnView {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.itemView .btnView .btn {
|
||||
border: 1px solid #4e96f8;
|
||||
position: relative;
|
||||
border-radius: 10rpx;
|
||||
margin-left: 16rpx;
|
||||
padding: 10rpx 24rpx;
|
||||
font-size: 24rpx;
|
||||
color: #4e96f8;
|
||||
}
|
||||
|
||||
.shareBtn {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.loadAllLine {
|
||||
margin-top: 80rpx;
|
||||
}
|
@ -28,6 +28,13 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转-展厅
|
||||
jumpExhibitionRecord() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/reservationRecord/exhibitionRecord/list/list',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@
|
||||
<view class="title">访客预约记录</view>
|
||||
<van-icon class="goImg" name="share" size="80rpx" color="#ffffff"/>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item" bind:tap="jumpExhibitionRecord">
|
||||
<van-icon name="live" size="80rpx" color="#ffffff"/>
|
||||
<view class="title">展厅预约记录</view>
|
||||
<van-icon class="goImg" name="share" size="80rpx" color="#ffffff"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user