实现进入预约记录页默认为待开始-20250522

This commit is contained in:
luoyu 2025-05-22 22:07:58 +08:00
parent 7c37fc1cf4
commit c9e652e1fa
4 changed files with 68 additions and 17 deletions

View File

@ -22,7 +22,7 @@ Page({
type: "record", type: "record",
name: "预约记录", name: "预约记录",
img: "/profile/static/meeting/index/record.png", img: "/profile/static/meeting/index/record.png",
path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord", path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord?status=7",
visible: true visible: true
}, { }, {
type: "approve", type: "approve",
@ -85,7 +85,7 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
Dialog.alert({ Dialog.alert({
message: '1、此系统分配的账号仅用于会议室申请预约请各单位专人扎口负责会议预定管理工作。\n2、系统提示“预约提交成功”后请及时关注预约进度和短信通知若有疑问请随时拨打会议服务热线83605343。\n3、会议开始前如需调整会议请及时通过系统操作或电话告知已预约成功的会议室可能因临时重大会议取消或调剂请理解配合。\n注会议预定系统技术支持QQ群技术支持临时群929670630', message: '1、此系统分配的账号仅用于会议室申请预约请各单位专人扎口负责会议预定管理工作。\n2、系统提示"预约提交成功"后请及时关注预约进度和短信通知若有疑问请随时拨打会议服务热线83605343。\n3、会议开始前如需调整会议请及时通过系统操作或电话告知已预约成功的会议室可能因临时重大会议取消或调剂请理解配合。\n注会议预定系统技术支持QQ群技术支持临时群929670630',
messageAlign: 'left', messageAlign: 'left',
}).then(() => { }).then(() => {
// on close // on close
@ -205,7 +205,7 @@ Page({
item.visible = true item.visible = true
} }
if (item.type == 'record') { if (item.type == 'record') {
item.path = '/pages/meeting/reservationRecord/approve/approve?act=show' item.path = '/pages/meeting/reservationRecord/approve/approve?act=show&status=7'
item.visible = true item.visible = true
} }
return item return item

View File

@ -174,8 +174,8 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let act = options.act // 这里opt接收options以处理查看更多
if (act == 'show') { if (options.act == 'show') {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '预约记录', title: '预约记录',
}) })
@ -183,6 +183,23 @@ Page({
'search.status.value': '' 'search.status.value': ''
}) })
} }
// 检查是否有URL参数指定状态
if (options && options.status) {
this.setData({
'search.status.value': parseInt(options.status) || 7
});
// 初始化状态文本
const statusOption = this.data.search.status.option;
const selectedOption = statusOption.find(option => option.value === this.data.search.status.value);
if (selectedOption) {
this.setData({
'search.status.text': selectedOption.text
});
}
}
let _this = this; let _this = this;
let userDetail = wx.getStorageSync('user') let userDetail = wx.getStorageSync('user')
_this.setData({ _this.setData({

View File

@ -35,7 +35,8 @@ Page({
value: '' value: ''
}, },
status: { status: {
value: '', text: '待开始',
value: 7,
option: [{ option: [{
text: '全部预约', text: '全部预约',
value: '' value: ''
@ -154,6 +155,23 @@ Page({
reservationIsDataAll: false, reservationIsDataAll: false,
['search.status.value']: e.detail ['search.status.value']: e.detail
}) })
// 更新状态文本
const statusOption = this.data.search.status.option;
const selectedOption = statusOption.find(option => option.value === e.detail);
if (selectedOption) {
this.setData({
['search.status.text']: selectedOption.text
});
// 手动更新页面组件
if (this.selectComponent) {
const dropdown = this.selectComponent('.van-dropdown-menu');
if (dropdown) {
dropdown.updateItemTitle(1, selectedOption.text);
}
}
}
this.getDataList() this.getDataList()
}, },
changeSearchSort(e) { changeSearchSort(e) {
@ -172,17 +190,27 @@ Page({
onLoad(options) { onLoad(options) {
let _this = this; let _this = this;
let userDetail = wx.getStorageSync('user') let userDetail = wx.getStorageSync('user')
// 检查是否有URL参数指定状态
if (options && options.status) {
this.setData({
['search.status.value']: parseInt(options.status) || 7
});
}
// 初始化状态文本
const statusOption = _this.data.search.status.option;
const selectedOption = statusOption.find(option => option.value === _this.data.search.status.value);
let statusText = '待开始';
if (selectedOption) {
statusText = selectedOption.text;
}
_this.setData({ _this.setData({
userData: userDetail, userData: userDetail,
['search.status.text']: statusText
}) })
// 获取数据
let userId = _this.data.userData.id
// 获取预约数据
_this.getReservationData({
userId,
pageNum: _this.data.reservationPageNum,
pageSize: _this.data.reservationPageSize,
})
// 获取两周后时间,默认只能选两周之后,管理员可以选一年后的 // 获取两周后时间,默认只能选两周之后,管理员可以选一年后的
const today = new Date() const today = new Date()
const newDate = new Date(today) const newDate = new Date(today)
@ -195,6 +223,9 @@ Page({
maxDate: newDate.getTime() maxDate: newDate.getTime()
}) })
// 使用getDataList统一获取数据确保应用筛选条件
_this.getDataList();
// 获取参与数据 // 获取参与数据
// _this.getParticipateData({ // _this.getParticipateData({
// userId, // userId,
@ -574,7 +605,10 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
// 确保初始状态正确
this.setData({
['search.status.value']: 7 // 确保状态值为待开始
});
}, },
/** /**

View File

@ -50,7 +50,7 @@
</view> </view>
</van-tab> </van-tab>
</van-tabs> --> </van-tabs> -->
<van-dropdown-menu> <van-dropdown-menu class="van-dropdown-menu">
<van-dropdown-item id="item" title="{{ search.title.text }}"> <van-dropdown-item id="item" title="{{ search.title.text }}">
<van-cell> <van-cell>
<van-field clearable value="{{ search.title.value }}" placeholder="请输入会议名称模糊查询" bind:change="changeSearchTitle" /> <van-field clearable value="{{ search.title.value }}" placeholder="请输入会议名称模糊查询" bind:change="changeSearchTitle" />
@ -61,7 +61,7 @@
</van-button> </van-button>
</view> </view>
</van-dropdown-item> </van-dropdown-item>
<van-dropdown-item value="{{ search.status.value }}" options="{{ search.status.option }}" bind:change="changeSearchStatus" /> <van-dropdown-item title="待开始" value="{{ search.status.value }}" options="{{ search.status.option }}" bind:change="changeSearchStatus" />
<van-dropdown-item value="{{ search.sort.value }}" options="{{ search.sort.option }}" bind:change="changeSearchSort" /> <van-dropdown-item value="{{ search.sort.value }}" options="{{ search.sort.option }}" bind:change="changeSearchSort" />
</van-dropdown-menu> </van-dropdown-menu>
<view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this"> <view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this">