mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 10:49:36 +08:00
描述:修改
This commit is contained in:
parent
a3c744c01f
commit
e9222fa213
@ -82,4 +82,12 @@ export function selectReservationListByUserIdRq(data) {
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 根据id查询预约信息
|
||||
export function selectReservationByIdRq(id) {
|
||||
return request({
|
||||
url: '/api/roomContent/selectReservationById/' + id ,
|
||||
method: "get",
|
||||
});
|
||||
}
|
@ -1,5 +1,15 @@
|
||||
const app = getApp()
|
||||
|
||||
import {
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM,
|
||||
twoTimeIntervalReturnHours
|
||||
} from "../../../../../utils/util.js"
|
||||
|
||||
import {
|
||||
selectReservationByIdRq
|
||||
} from "../../../../../api/meeting/meetingRoom.js"
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -7,13 +17,87 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
IMG_NAME: app.IMG_NAME,
|
||||
id: null,
|
||||
detail: null
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
...options
|
||||
})
|
||||
// 获取详情
|
||||
_this.getDetail();
|
||||
},
|
||||
|
||||
// 获取详情
|
||||
getDetail() {
|
||||
let _this = this;
|
||||
let id = _this.data.id;
|
||||
selectReservationByIdRq(id).then(res => {
|
||||
let detail = res.data;
|
||||
// 时间段
|
||||
detail.timeSlot = selfFormatTimeYMD(detail.startTime) + ' ' + selfFormatTimeHM(detail.startTime) + '~' + selfFormatTimeHM(detail.endDate);
|
||||
// 合计时间
|
||||
detail.countTime = twoTimeIntervalReturnHours(detail.startTime, detail.endDate)
|
||||
// 状态字体颜色
|
||||
let statusColor = "#FFB119";
|
||||
// 按钮是否显示
|
||||
let statusValue = detail.statusValue;
|
||||
let showPay = false;
|
||||
let showInvite = false;
|
||||
let showCancel = false;
|
||||
let showDetail = false;
|
||||
// 待支付 0 :去支付、取消订单、查看详情
|
||||
if (statusValue == 0) {
|
||||
showPay = true;
|
||||
showCancel = true;
|
||||
showDetail = true;
|
||||
// 状态字体颜色
|
||||
statusColor = "#FFB119";
|
||||
}
|
||||
// 待使用 1:去邀请、取消订单、查看详情
|
||||
if (statusValue == 1) {
|
||||
showInvite = true;
|
||||
showCancel = true;
|
||||
showDetail = true;
|
||||
// 状态字体颜色
|
||||
statusColor = "#3794FF";
|
||||
}
|
||||
// 进行中 2:去邀请、查看详情
|
||||
if (statusValue == 2) {
|
||||
showInvite = true;
|
||||
showDetail = true;
|
||||
// 状态字体颜色
|
||||
statusColor = "#FF4040";
|
||||
}
|
||||
// 已结束 3:查看详情
|
||||
if (statusValue == 3) {
|
||||
showDetail = true;
|
||||
// 状态字体颜色
|
||||
statusColor = "#333333";
|
||||
}
|
||||
// 已取消 4:查看详情
|
||||
if (statusValue == 4) {
|
||||
showDetail = true;
|
||||
// 状态字体颜色
|
||||
statusColor = "#7F7F7F";
|
||||
}
|
||||
//
|
||||
// 赋值
|
||||
detail.showPay = showPay;
|
||||
detail.showInvite = showInvite;
|
||||
detail.showCancel = showCancel;
|
||||
detail.showDetail = showDetail;
|
||||
// 状态字体颜色
|
||||
detail.statusColor = statusColor;
|
||||
_this.setData({
|
||||
detail
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -4,13 +4,13 @@
|
||||
<view class="contentView">
|
||||
<image class="img" src="{{IMG_NAME + '/profile/static/index/banner/1.jpg'}}" mode="aspectFill"></image>
|
||||
<view class="msgView">
|
||||
<view class="title">10人间 | B2A | 3F</view>
|
||||
<view class="name">space spacespace spacespace spacespace spacespace space</view>
|
||||
<view class="time">2023-01-01 10:10~12:12</view>
|
||||
<view class="title">{{detail.roomContent.capacityNum}}人间 | {{detail.roomContent.roomName}} | {{detail.roomContent.buildingName}}</view>
|
||||
<view class="name">{{detail.title}}</view>
|
||||
<view class="time">{{detail.timeSlot}}</view>
|
||||
</view>
|
||||
<view class="priceView">
|
||||
<view class="price">¥200.00</view>
|
||||
<view class="unit">/半小时</view>
|
||||
<view class="price">¥{{detail.roomContent.money}}</view>
|
||||
<view class="unit">/{{detail.roomContent.duration}}小时</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -20,19 +20,19 @@
|
||||
<view class="labelTitle">基本信息</view>
|
||||
<view class="cellView">
|
||||
<view class="label">会议时间</view>
|
||||
<view class="content">2024-01-01 10:10~11:10 共计1小时</view>
|
||||
<view class="content">{{detail.timeSlot}} 共计{{detail.countTime}}小时</view>
|
||||
</view>
|
||||
<view class="cellView">
|
||||
<view class="label">会议主题</view>
|
||||
<view class="content">My Meeting Room</view>
|
||||
<view class="content">{{detail.title}}</view>
|
||||
</view>
|
||||
<view class="cellView">
|
||||
<view class="label">会议预约人</view>
|
||||
<view class="content">admin</view>
|
||||
<view class="content"></view>
|
||||
</view>
|
||||
<view class="cellView">
|
||||
<view class="label">联系方式</view>
|
||||
<view class="content">10086</view>
|
||||
<view class="content"></view>
|
||||
</view>
|
||||
<view class="labelTitle">订单信息</view>
|
||||
<view class="cellView">
|
||||
|
@ -134,11 +134,13 @@ Page({
|
||||
url: "/pages/meeting/pay/waitPay/waitPay"
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 跳转-预约详情
|
||||
jumpMeetingDetail() {
|
||||
jumpMeetingDetail(e) {
|
||||
console.log('jumpMeetingDetail' , e);
|
||||
let id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: "/pages/meeting/reservationRecord/meetingRecord/meetingDetail/meetingDetail",
|
||||
url: "/pages/meeting/reservationRecord/meetingRecord/meetingDetail/meetingDetail?id=" + id,
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<view class="containerView public">
|
||||
<van-tabs bind:click="onClick" color="#4e96f8" border animated title-active-color="black" title-inactive-color="gray">
|
||||
<van-tabs bind:click="onClick" color="#4e96f8" border animated title-active-color="black" title-inactive-color="gray">
|
||||
<van-tab title="预约记录">
|
||||
<view class="itemView" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this">
|
||||
<view class="headView">
|
||||
@ -27,14 +27,24 @@
|
||||
<view class="btn" wx:if="{{item.showDetail}}" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">查看详情</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</van-tab>
|
||||
<van-tab title="参与记录">
|
||||
|
||||
<van-tab title="参与记录">
|
||||
<view class="itemView" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this">
|
||||
<view class="headView">
|
||||
<view class="number">{{item.reservationNumber}}</view>
|
||||
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
|
||||
</view>
|
||||
<view class="contentView" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">
|
||||
<image class="img" src="{{IMG_NAME + '/profile/static/index/banner/1.jpg'}}" mode="aspectFill"></image>
|
||||
<view class="msgView">
|
||||
<view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view>
|
||||
<view class="name">{{item.title}}</view>
|
||||
<view class="time">{{item.timeSlot}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
@ -169,6 +169,25 @@ function twoTimeInterval(startTime, endTime) {
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* JS 计算两个时间间隔多久(时)
|
||||
* @param startTime "2019-10-23 15:27:23"
|
||||
* @param endTime "2019-10-23 15:27:55"
|
||||
* @return 12时
|
||||
*/
|
||||
function twoTimeIntervalReturnHours(startTime, endTime) {
|
||||
// 开始时间
|
||||
let date1 = new Date(startTime);
|
||||
// 结束时间
|
||||
let date2 = new Date(endTime);
|
||||
// 时间相差秒数
|
||||
let dateDiff = date2.getTime() - date1.getTime();
|
||||
// 计算出小时数
|
||||
let hours = Math.floor(dateDiff / (3600 * 1000));
|
||||
return hours;
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : '0' + n
|
||||
@ -186,5 +205,6 @@ module.exports = {
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM,
|
||||
selfFormatTimeYMDH,
|
||||
twoTimeInterval
|
||||
twoTimeInterval,
|
||||
twoTimeIntervalReturnHours
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user