mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 17:49:36 +08:00
1
This commit is contained in:
parent
9c4b4b08c2
commit
8335c210ba
@ -35,3 +35,12 @@ export function meetingRoomBookedRecordRq(id) {
|
|||||||
method: "get",
|
method: "get",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前会议室是否可以预约
|
||||||
|
export function selectFreeMeetingRoomRq(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/roomContent/selectFreeMeetingRoom',
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
App({
|
App({
|
||||||
APPID: 'wxd9f93ef41a607dd5',
|
APPID: 'wxd9f93ef41a607dd5',
|
||||||
// 本地测试时不用加/api
|
// 本地测试时不用加/api
|
||||||
// DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名
|
DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名
|
||||||
// IMG_NAME: 'http://192.168.0.11:9227',
|
IMG_NAME: 'http://192.168.0.11:9227',
|
||||||
DOMAIN_NAME: 'http://222.184.49.22:9227', //接口域名
|
// DOMAIN_NAME: 'http://222.184.49.22:9227', //接口域名
|
||||||
IMG_NAME: 'http://222.184.49.22:9227',
|
// IMG_NAME: 'http://222.184.49.22:9227',
|
||||||
globals: {
|
globals: {
|
||||||
refreshMyPages: false,
|
refreshMyPages: false,
|
||||||
homedata: {},
|
homedata: {},
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
const app = getApp()
|
const app = getApp()
|
||||||
|
|
||||||
|
import Notify from '@vant/weapp/notify/notify';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
meetingRoomBookedRecordRq
|
meetingRoomBookedRecordRq,
|
||||||
|
selectFreeMeetingRoomRq
|
||||||
} from "../../../../api/meeting/meetingRoom.js"
|
} from "../../../../api/meeting/meetingRoom.js"
|
||||||
|
|
||||||
import {selfFormatTimeReturnSecond59} from "../../../../utils/util.js"
|
import {
|
||||||
|
selfFormatTimeReturnSecond59,
|
||||||
|
selfFormatTimeYMDHMS
|
||||||
|
} from "../../../../utils/util.js"
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
@ -46,15 +53,35 @@ Page({
|
|||||||
|
|
||||||
// 确认时间
|
// 确认时间
|
||||||
confirmTime() {
|
confirmTime() {
|
||||||
let meetingRoomId = this.data.meetingRoomId;
|
let _this = this;
|
||||||
let startTime = this.data.startTime;
|
let meetingRoomId = _this.data.meetingRoomId;
|
||||||
let endTime = this.data.endTime;
|
let startTime = _this.data.startTime;
|
||||||
|
let endTime = _this.data.endTime;
|
||||||
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + startTime + "&endTime=" + endTime;
|
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + startTime + "&endTime=" + endTime;
|
||||||
wx.navigateTo({
|
|
||||||
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
|
// 当前会议室是否可以预约
|
||||||
})
|
selectFreeMeetingRoomRq({
|
||||||
this.setData({
|
"roomContentId": meetingRoomId,
|
||||||
showTime: false
|
"startTime": selfFormatTimeYMDHMS(startTime),
|
||||||
|
"endDate": selfFormatTimeYMDHMS(endTime)
|
||||||
|
}).then(res => {
|
||||||
|
console.log('selectFreeMeetingRoomRq', res);
|
||||||
|
// 可以预约
|
||||||
|
if (!res.count) {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
|
||||||
|
})
|
||||||
|
_this.setData({
|
||||||
|
showTime: false
|
||||||
|
})
|
||||||
|
} else { // 不能预约
|
||||||
|
Notify({
|
||||||
|
type: 'danger',
|
||||||
|
message: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
selector: '#notify',
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
|
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
|
||||||
"van-popup": "@vant/weapp/popup/index"
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
|
"van-notify": "@vant/weapp/notify/index"
|
||||||
},
|
},
|
||||||
"navigationBarTitleText": "会议室已预约"
|
"navigationBarTitleText": "会议室已预约"
|
||||||
}
|
}
|
@ -4,9 +4,9 @@
|
|||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="leftLineTitle">会议预约情况</view>
|
<view class="leftLineTitle">会议预约情况</view>
|
||||||
<!-- 预约列表 -->
|
<!-- 预约列表 -->
|
||||||
<view class="itemVIew" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this">
|
<view class="itemVIew" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this">
|
||||||
<view class="item">{{item.nowDate}}</view>
|
<view class="item">{{item.nowDate}}</view>
|
||||||
<view class="itemTimeView" wx:for="{{item.reservations}}" wx:for-item="record" wx:key="*this">
|
<view class="itemTimeView" wx:for="{{item.reservations}}" wx:for-item="record" wx:key="*this">
|
||||||
<view class="time">{{record.startTime}}~{{record.endDate}}</view>
|
<view class="time">{{record.startTime}}~{{record.endDate}}</view>
|
||||||
<view class="status">{{record.statusName}}</view>
|
<view class="status">{{record.statusName}}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -18,13 +18,12 @@
|
|||||||
|
|
||||||
<!-- 选择时间 -->
|
<!-- 选择时间 -->
|
||||||
<view class="selfPop" wx:if="{{showTime}}">
|
<view class="selfPop" wx:if="{{showTime}}">
|
||||||
<van-datetime-picker title="请选择开始时间" type="datetime" value="{{ startTime }}" min-date="{{ minTime }}" max-date="{{ maxTime }}" bind:input="onInputStartTime" bind:confirm="confirmTime" bind:cancel="cancelTime"
|
<van-datetime-picker title="请选择开始时间" type="datetime" value="{{ startTime }}" min-date="{{ minTime }}" max-date="{{ maxTime }}" bind:input="onInputStartTime" bind:confirm="confirmTime" bind:cancel="cancelTime" confirm-button-text="" cancel-button-text="" />
|
||||||
confirm-button-text=""
|
|
||||||
cancel-button-text=""/>
|
|
||||||
|
|
||||||
<van-datetime-picker title="请选择结束时间" type="datetime" value="{{ endTime }}" min-date="{{ startTime }}" max-date="{{ endMaxTime }}" bind:input="onInputEndTime"
|
<van-datetime-picker title="请选择结束时间" type="datetime" value="{{ endTime }}" min-date="{{ startTime }}" max-date="{{ endMaxTime }}" bind:input="onInputEndTime" bind:confirm="confirmTime" bind:cancel="cancelTime" />
|
||||||
bind:confirm="confirmTime" bind:cancel="cancelTime"/>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 消息提示 -->
|
||||||
|
<van-notify id="notify" />
|
||||||
|
|
||||||
</view>
|
</view>
|
@ -19,7 +19,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="priceView">
|
<view class="priceView">
|
||||||
<view class="price">¥ 200.00/</view>
|
<view class="price">¥ 200.00/</view>
|
||||||
<view class="unit">半小时 起</view>
|
<view class="unit">小时 起</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -85,6 +85,19 @@ function selfFormatTimeReturnSecond59(time) {
|
|||||||
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, '59'].map(formatNumber).join(':')
|
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, '59'].map(formatNumber).join(':')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回 2017-12-12 12:30:59
|
||||||
|
function selfFormatTimeYMDHMS(time) {
|
||||||
|
let date = new Date(time);
|
||||||
|
let year = date.getFullYear()
|
||||||
|
let month = date.getMonth() + 1
|
||||||
|
let day = date.getDate()
|
||||||
|
let hour = date.getHours()
|
||||||
|
let minute = date.getMinutes()
|
||||||
|
let second = date.getSeconds()
|
||||||
|
|
||||||
|
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const formatNumber = n => {
|
const formatNumber = n => {
|
||||||
n = n.toString()
|
n = n.toString()
|
||||||
@ -98,5 +111,6 @@ module.exports = {
|
|||||||
formatDate2: formatDate2,
|
formatDate2: formatDate2,
|
||||||
formatHour: formatHour,
|
formatHour: formatHour,
|
||||||
formatTime2: formatTime2,
|
formatTime2: formatTime2,
|
||||||
selfFormatTimeReturnSecond59
|
selfFormatTimeReturnSecond59,
|
||||||
|
selfFormatTimeYMDHMS
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user