mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 17:49:36 +08:00
189 lines
4.2 KiB
JavaScript
189 lines
4.2 KiB
JavaScript
const app = getApp()
|
|
|
|
import Dialog from '@vant/weapp/dialog/dialog';
|
|
import Notify from '@vant/weapp/notify/notify';
|
|
|
|
import {
|
|
showroomDetailRq
|
|
} from "../../../../api/meeting/exhibition.js"
|
|
|
|
import {
|
|
meetingRoomDetailRq,
|
|
getCustomerTicketRq,
|
|
calculateMeetingRoomAmountRq,
|
|
saveMeetingRecordRq
|
|
} from "../../../../api/meeting/meetingRoom.js"
|
|
|
|
import {
|
|
selfFormatTimeYMD,
|
|
selfFormatTimeHM,
|
|
twoTimeInterval
|
|
} from "../../../../utils/util.js"
|
|
|
|
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
IMG_NAME: app.IMG_NAME,
|
|
protocolFlag: true,
|
|
protocolTitle: '《展厅服务协议》',
|
|
id: null,
|
|
bannerList: [],
|
|
detail: {},
|
|
userData: {},
|
|
startTime: null,
|
|
endTime: null,
|
|
selectDay: null,
|
|
selectCountTime: null,
|
|
formData: {}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
console.log('onLoad', options);
|
|
let selectCountTime = selfFormatTimeHM(options.startTime) + "-" + selfFormatTimeHM(options.endTime) + ' 共计' + twoTimeInterval(options.startTime, options.endTime)
|
|
this.setData({
|
|
...options,
|
|
userData: wx.getStorageSync('user'),
|
|
selectDay: selfFormatTimeYMD(options.startTime),
|
|
selectCountTime
|
|
})
|
|
// 详细信息
|
|
this.getDetail();
|
|
},
|
|
|
|
// 详细信息
|
|
getDetail() {
|
|
let _this = this;
|
|
showroomDetailRq(this.data.id).then(res => {
|
|
_this.setData({
|
|
detail: res,
|
|
bannerList: [res.indoorPicUrl]
|
|
})
|
|
})
|
|
},
|
|
|
|
// 主题修改监听
|
|
titleChange(event) {
|
|
this.setData({
|
|
title: event.detail
|
|
})
|
|
},
|
|
|
|
// 协议点击
|
|
protocolChange() {
|
|
let _this = this;
|
|
_this.setData({
|
|
protocolFlag: !_this.data.protocolFlag
|
|
});
|
|
},
|
|
|
|
// 跳转协议
|
|
jumpProtocol() {
|
|
let _this = this;
|
|
wx.navigateTo({
|
|
url: "/pages/meeting/meetingRoom/meetingProtocol/meetingProtocol?title=" + _this.data.protocolTitle,
|
|
})
|
|
},
|
|
|
|
// 提交订单
|
|
submitCase() {
|
|
let _this = this
|
|
// 参数校验
|
|
if (!_this.data.title) {
|
|
// 错误提示
|
|
Notify({
|
|
type: 'danger',
|
|
message: '请输入会议主题!'
|
|
});
|
|
return;
|
|
}
|
|
if (!_this.data.protocolFlag) {
|
|
// 错误提示
|
|
Notify({
|
|
type: 'danger',
|
|
message: `请同意${_this.data.protocolTitle}!`
|
|
});
|
|
return;
|
|
}
|
|
|
|
saveMeetingRecordRq({
|
|
"roomContentId": _this.data.meetingRoomId,
|
|
"userId": _this.data.userData.id,
|
|
"ticketId": _this.data.couponId,
|
|
"customerId": _this.data.userData.icsCustomerId,
|
|
"title": _this.data.title,
|
|
"startTime": _this.data.startTime,
|
|
"endDate": _this.data.endTime,
|
|
"orderMoney": _this.data.totalAmount,
|
|
}).then(res => {
|
|
console.log('saveMeetingRecordRq', res);
|
|
if (res.code == 0) {
|
|
wx.redirectTo({
|
|
url: "/pages/meeting/pay/waitPay/waitPay?id=" + res.reservationId,
|
|
})
|
|
} else {
|
|
// 错误提示
|
|
Notify({
|
|
type: 'danger',
|
|
message: res.msg
|
|
});
|
|
}
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
console.log('onShow');
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |