mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 14:19:38 +08:00
1
This commit is contained in:
parent
9c4b4b08c2
commit
8335c210ba
@ -35,3 +35,12 @@ export function meetingRoomBookedRecordRq(id) {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 当前会议室是否可以预约
|
||||
export function selectFreeMeetingRoomRq(data) {
|
||||
return request({
|
||||
url: '/api/roomContent/selectFreeMeetingRoom',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
App({
|
||||
APPID: 'wxd9f93ef41a607dd5',
|
||||
// 本地测试时不用加/api
|
||||
// DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名
|
||||
// IMG_NAME: 'http://192.168.0.11:9227',
|
||||
DOMAIN_NAME: 'http://222.184.49.22:9227', //接口域名
|
||||
IMG_NAME: 'http://222.184.49.22:9227',
|
||||
DOMAIN_NAME: 'http://192.168.0.11:9227', //接口域名
|
||||
IMG_NAME: 'http://192.168.0.11:9227',
|
||||
// DOMAIN_NAME: 'http://222.184.49.22:9227', //接口域名
|
||||
// IMG_NAME: 'http://222.184.49.22:9227',
|
||||
globals: {
|
||||
refreshMyPages: false,
|
||||
homedata: {},
|
||||
|
@ -1,9 +1,16 @@
|
||||
const app = getApp()
|
||||
|
||||
import Notify from '@vant/weapp/notify/notify';
|
||||
|
||||
import {
|
||||
meetingRoomBookedRecordRq
|
||||
meetingRoomBookedRecordRq,
|
||||
selectFreeMeetingRoomRq
|
||||
} from "../../../../api/meeting/meetingRoom.js"
|
||||
|
||||
import {selfFormatTimeReturnSecond59} from "../../../../utils/util.js"
|
||||
import {
|
||||
selfFormatTimeReturnSecond59,
|
||||
selfFormatTimeYMDHMS
|
||||
} from "../../../../utils/util.js"
|
||||
|
||||
Page({
|
||||
|
||||
@ -46,16 +53,36 @@ Page({
|
||||
|
||||
// 确认时间
|
||||
confirmTime() {
|
||||
let meetingRoomId = this.data.meetingRoomId;
|
||||
let startTime = this.data.startTime;
|
||||
let endTime = this.data.endTime;
|
||||
let _this = this;
|
||||
let meetingRoomId = _this.data.meetingRoomId;
|
||||
let startTime = _this.data.startTime;
|
||||
let endTime = _this.data.endTime;
|
||||
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + startTime + "&endTime=" + endTime;
|
||||
|
||||
// 当前会议室是否可以预约
|
||||
selectFreeMeetingRoomRq({
|
||||
"roomContentId": meetingRoomId,
|
||||
"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({
|
||||
_this.setData({
|
||||
showTime: false
|
||||
})
|
||||
} else { // 不能预约
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
selector: '#notify',
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 取消时间
|
||||
|
@ -1,7 +1,8 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"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": "会议室已预约"
|
||||
}
|
@ -18,13 +18,12 @@
|
||||
|
||||
<!-- 选择时间 -->
|
||||
<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"
|
||||
confirm-button-text=""
|
||||
cancel-button-text=""/>
|
||||
<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="" />
|
||||
|
||||
<van-datetime-picker title="请选择结束时间" type="datetime" value="{{ endTime }}" min-date="{{ startTime }}" max-date="{{ endMaxTime }}" bind:input="onInputEndTime"
|
||||
bind:confirm="confirmTime" bind:cancel="cancelTime"/>
|
||||
<van-datetime-picker title="请选择结束时间" type="datetime" value="{{ endTime }}" min-date="{{ startTime }}" max-date="{{ endMaxTime }}" bind:input="onInputEndTime" bind:confirm="confirmTime" bind:cancel="cancelTime" />
|
||||
</view>
|
||||
|
||||
<!-- 消息提示 -->
|
||||
<van-notify id="notify" />
|
||||
|
||||
</view>
|
@ -19,7 +19,7 @@
|
||||
</view>
|
||||
<view class="priceView">
|
||||
<view class="price">¥ 200.00/</view>
|
||||
<view class="unit">半小时 起</view>
|
||||
<view class="unit">小时 起</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -85,6 +85,19 @@ function selfFormatTimeReturnSecond59(time) {
|
||||
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 => {
|
||||
n = n.toString()
|
||||
@ -98,5 +111,6 @@ module.exports = {
|
||||
formatDate2: formatDate2,
|
||||
formatHour: formatHour,
|
||||
formatTime2: formatTime2,
|
||||
selfFormatTimeReturnSecond59
|
||||
selfFormatTimeReturnSecond59,
|
||||
selfFormatTimeYMDHMS
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user