mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 13:09:38 +08:00
描述: 会议室
This commit is contained in:
parent
e1bad24bd3
commit
b267089461
@ -38,3 +38,22 @@ export function appointmentRecordRq(data) {
|
||||
});
|
||||
}
|
||||
|
||||
// 查询字典
|
||||
export function listByTypeRq(data) {
|
||||
return request({
|
||||
url: '/api/showroom/listByType',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 新增展厅预约记录
|
||||
export function saveShowRoomRecordRq(data) {
|
||||
return request({
|
||||
url: '/api/showroom/saveShowRoomRecord',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,8 @@
|
||||
"pages/meeting/exhibition/list/list",
|
||||
"pages/meeting/exhibition/detail/detail",
|
||||
"pages/meeting/exhibition/booked/booked",
|
||||
"pages/meeting/exhibition/order/order"
|
||||
"pages/meeting/exhibition/order/order",
|
||||
"pages/meeting/reservationRecord/exhibitionRecord/list/list"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
|
@ -4,16 +4,11 @@ import Dialog from '@vant/weapp/dialog/dialog';
|
||||
import Notify from '@vant/weapp/notify/notify';
|
||||
|
||||
import {
|
||||
showroomDetailRq
|
||||
showroomDetailRq,
|
||||
listByTypeRq,
|
||||
saveShowRoomRecordRq
|
||||
} from "../../../../api/meeting/exhibition.js"
|
||||
|
||||
import {
|
||||
meetingRoomDetailRq,
|
||||
getCustomerTicketRq,
|
||||
calculateMeetingRoomAmountRq,
|
||||
saveMeetingRecordRq
|
||||
} from "../../../../api/meeting/meetingRoom.js"
|
||||
|
||||
import {
|
||||
selfFormatTimeYMD,
|
||||
selfFormatTimeHM,
|
||||
@ -38,7 +33,34 @@ Page({
|
||||
endTime: null,
|
||||
selectDay: null,
|
||||
selectCountTime: null,
|
||||
formData: {}
|
||||
// 选择参观目的
|
||||
visitTypeShow: false,
|
||||
visitTypeList: [],
|
||||
// 来参观人员-dialog
|
||||
dialogShow: false,
|
||||
dialogName: null,
|
||||
dialogJob: null,
|
||||
dialogPhone: null,
|
||||
// 来参观人员
|
||||
personList: [],
|
||||
// 提交数据
|
||||
formData: {
|
||||
showroomId: null, // 展厅id
|
||||
userId: null, // 用户id
|
||||
startTime: null, // 开始时间
|
||||
endDate: null, // 结束时间
|
||||
title: null, // 展厅主题
|
||||
persons: null, // 来参观人员
|
||||
visitType: null, // 参观目的
|
||||
visitTypeName: null, // 参观目的-name
|
||||
explainNeedType: 0, // 讲解需求
|
||||
explainNeedTypeBoolean: false, // 讲解需求-boolean
|
||||
meetingNeedType: 0, // 是否需要会议室
|
||||
meetingNeedTypeBoolean: false, // 是否需要会议室-boolean
|
||||
photographType: 0, // 摄影需求
|
||||
photographTypeBoolean: false, // 摄影需求-boolean
|
||||
remake: null, // 备注
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -46,15 +68,24 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log('onLoad', options);
|
||||
let _this = this;
|
||||
let selectCountTime = selfFormatTimeHM(options.startTime) + "-" + selfFormatTimeHM(options.endTime) + ' 共计' + twoTimeInterval(options.startTime, options.endTime)
|
||||
this.setData({
|
||||
_this.setData({
|
||||
...options,
|
||||
userData: wx.getStorageSync('user'),
|
||||
selectDay: selfFormatTimeYMD(options.startTime),
|
||||
selectCountTime
|
||||
})
|
||||
// 表单数据初始化
|
||||
let formData = _this.data.formData;
|
||||
formData.showroomId = _this.data.id; // 展厅id
|
||||
formData.userId = _this.data.userData.id // 用户id
|
||||
formData.startTime = _this.data.startTime // 开始时间
|
||||
formData.endDate = _this.data.endTime // 结束时间
|
||||
// 详细信息
|
||||
this.getDetail();
|
||||
_this.getDetail();
|
||||
// 获取字典数据
|
||||
_this.getDictData();
|
||||
},
|
||||
|
||||
// 详细信息
|
||||
@ -68,11 +99,156 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 主题修改监听
|
||||
titleChange(event) {
|
||||
this.setData({
|
||||
title: event.detail
|
||||
// 获取字典数据
|
||||
getDictData() {
|
||||
let _this = this
|
||||
listByTypeRq({
|
||||
"dictType": "visit_type"
|
||||
}).then(res => {
|
||||
console.log('getDictData', res);
|
||||
let visitTypeList = res.data.map(item => {
|
||||
return {
|
||||
name: item.dictLabel,
|
||||
value: item.dictValue,
|
||||
}
|
||||
})
|
||||
_this.setData({
|
||||
visitTypeList
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// input监听
|
||||
inputChange(e) {
|
||||
console.log('inputChange', e);
|
||||
let _this = this;
|
||||
let formData = _this.data.formData;
|
||||
formData[e.currentTarget.dataset.name] = e.detail
|
||||
_this.setData({
|
||||
formData
|
||||
})
|
||||
},
|
||||
|
||||
// switch监听
|
||||
switchChange(e) {
|
||||
console.log('switchChange', e);
|
||||
let _this = this;
|
||||
let status = e.detail;
|
||||
let formData = _this.data.formData;
|
||||
formData[e.currentTarget.dataset.name + 'Boolean'] = status
|
||||
if (status) {
|
||||
formData[e.currentTarget.dataset.name] = 1
|
||||
} else {
|
||||
formData[e.currentTarget.dataset.name] = 0
|
||||
}
|
||||
_this.setData({
|
||||
formData
|
||||
})
|
||||
},
|
||||
|
||||
// 显示-参观目的
|
||||
showVisitType() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
visitTypeShow: true
|
||||
})
|
||||
},
|
||||
|
||||
// 隐藏-参观目的
|
||||
hideVisitType() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
visitTypeShow: false
|
||||
})
|
||||
},
|
||||
|
||||
// 选择-参观目的
|
||||
selectVisitType(e) {
|
||||
console.log('selectVisitType', e);
|
||||
let _this = this;
|
||||
let formData = _this.data.formData;
|
||||
formData.visitType = e.detail.value; // 参观目的
|
||||
formData.visitTypeName = e.detail.name; // 参观目的-name
|
||||
_this.setData({
|
||||
formData
|
||||
})
|
||||
},
|
||||
|
||||
// 显示-dialog
|
||||
dialogUnfold() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
dialogShow: true
|
||||
})
|
||||
},
|
||||
// 取消-dialog
|
||||
dialogCancel() {
|
||||
let _this = this;
|
||||
_this.setData({
|
||||
dialogShow: false
|
||||
})
|
||||
},
|
||||
|
||||
// 提交-dialog
|
||||
dialogSubmit() {
|
||||
let _this = this;
|
||||
let name = _this.data.dialogName
|
||||
let job = _this.data.dialogJob
|
||||
let phone = _this.data.dialogPhone
|
||||
if (!name) {
|
||||
// 显示错误信息
|
||||
_this.showErrMsg('请输入姓名!')
|
||||
return;
|
||||
}
|
||||
if (!job) {
|
||||
// 显示错误信息
|
||||
_this.showErrMsg('请输入职务!')
|
||||
return;
|
||||
}
|
||||
// 来参观人员
|
||||
let personList = _this.data.personList;
|
||||
personList.push({
|
||||
id: new Date().getTime(),
|
||||
name,
|
||||
job,
|
||||
phone
|
||||
})
|
||||
_this.setData({
|
||||
personList,
|
||||
dialogShow: false,
|
||||
dialogName: null,
|
||||
dialogJob: null,
|
||||
dialogPhone: null,
|
||||
})
|
||||
},
|
||||
|
||||
// 删除来参观人员
|
||||
removePerson(e) {
|
||||
console.log('removePerson', e);
|
||||
let _this = this;
|
||||
let id = e.currentTarget.dataset.id
|
||||
let personList = _this.data.personList.filter(item => item.id != id)
|
||||
_this.setData({
|
||||
personList
|
||||
})
|
||||
},
|
||||
|
||||
// input监听-dialog
|
||||
dialogInputChange(e) {
|
||||
console.log('dialogInputChange', e);
|
||||
let _this = this;
|
||||
let data = _this.data;
|
||||
data[e.currentTarget.dataset.name] = e.detail
|
||||
_this.setData(data)
|
||||
},
|
||||
|
||||
// 显示错误信息
|
||||
showErrMsg(msg) {
|
||||
// 错误提示
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: msg
|
||||
});
|
||||
},
|
||||
|
||||
// 协议点击
|
||||
@ -91,48 +267,54 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
// 提交订单
|
||||
submitCase() {
|
||||
// 提交
|
||||
submitData() {
|
||||
let _this = this
|
||||
let formData = _this.data.formData;
|
||||
// 参数校验
|
||||
if (!_this.data.title) {
|
||||
//
|
||||
// 展厅主题
|
||||
if (!formData.title) {
|
||||
// 错误提示
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: '请输入会议主题!'
|
||||
});
|
||||
_this.showErrMsg('请输入展厅主题!');
|
||||
return;
|
||||
}
|
||||
// 来参观人员
|
||||
if (_this.data.personList && _this.data.personList.length > 0) {
|
||||
formData.persons = JSON.stringify(_this.data.personList)
|
||||
} else {
|
||||
// 错误提示
|
||||
_this.showErrMsg('请添加来参观人员!');
|
||||
return;
|
||||
}
|
||||
// 参观目的
|
||||
if (!formData.visitType) {
|
||||
// 错误提示
|
||||
_this.showErrMsg('请选择参观目的!');
|
||||
return;
|
||||
}
|
||||
// 同意协议
|
||||
if (!_this.data.protocolFlag) {
|
||||
// 错误提示
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: `请同意${_this.data.protocolTitle}!`
|
||||
});
|
||||
_this.showErrMsg(`请同意${_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);
|
||||
// 提交数据
|
||||
saveShowRoomRecordRq(formData).then(res => {
|
||||
console.log('saveShowRoomRecordRq', res);
|
||||
if (res.code == 0) {
|
||||
wx.redirectTo({
|
||||
url: "/pages/meeting/pay/waitPay/waitPay?id=" + res.reservationId,
|
||||
if (formData.meetingNeedTypeBoolean) {
|
||||
wx.reLaunch({
|
||||
url: "/pages/meeting/meetingReservation/meetingReservation",
|
||||
})
|
||||
} else {
|
||||
// 错误提示
|
||||
Notify({
|
||||
type: 'danger',
|
||||
message: res.msg
|
||||
});
|
||||
wx.reLaunch({
|
||||
url: "/pages/meeting/reservationRecord/exhibitionRecord/list/list",
|
||||
})
|
||||
}
|
||||
} else {
|
||||
_this.showErrMsg(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -5,7 +5,8 @@
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-notify": "@vant/weapp/notify/index",
|
||||
"van-checkbox": "@vant/weapp/checkbox/index",
|
||||
"van-switch": "@vant/weapp/switch/index"
|
||||
"van-switch": "@vant/weapp/switch/index",
|
||||
"van-action-sheet": "@vant/weapp/action-sheet/index"
|
||||
},
|
||||
"navigationBarTitleText": "预约信息"
|
||||
}
|
@ -40,55 +40,55 @@
|
||||
<view class="itemView">
|
||||
<view class="label must">展厅主题</view>
|
||||
<view class="content">
|
||||
<van-field value="{{ title }}" placeholder="请输入展厅主题" input-align="right" border="{{ false }}" bind:change="titleChange" />
|
||||
<van-field value="{{ formData.title }}" placeholder="请输入展厅主题" input-align="right" border="{{ false }}" bind:change="inputChange" data-name="title" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="label must">来参观人员</view>
|
||||
<view class="content">
|
||||
<view class="add">请添加
|
||||
<view class="add" bind:tap="dialogUnfold">请添加
|
||||
<van-icon class="van-icon" name="add-o" size="34rpx" color="#c3c3c3" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView grayBg">
|
||||
<view class="itemView grayBg" wx:if="{{personList.length > 0}}">
|
||||
<view class="personView">
|
||||
<view class="item" wx:for="{{3}}">
|
||||
<view class="data">陈泽</view>
|
||||
<view class="data">国务院院长</view>
|
||||
<view class="data">18360702148</view>
|
||||
<van-icon name="close" size="34rpx"/>
|
||||
<view class="item" wx:for="{{personList}}">
|
||||
<view class="data">{{item.name}}</view>
|
||||
<view class="data">{{item.job}}</view>
|
||||
<view class="data">{{item.phone ? item.phone : '-'}}</view>
|
||||
<van-icon name="close" size="34rpx" data-id="{{item.id}}" bind:tap="removePerson" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="itemView" bind:tap="showVisitType">
|
||||
<view class="label must">参观目的</view>
|
||||
<view class="content">
|
||||
<van-field value="{{ title }}" placeholder="请选择参观目的" input-align="right" border="{{ false }}" readonly is-link arrow-direction="down" bind:change="titleChange" />
|
||||
<van-field value="{{ formData.visitTypeName }}" placeholder="请选择参观目的" input-align="right" border="{{ false }}" readonly is-link arrow-direction="down" bind:change="titleChange" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="label must">讲解需求</view>
|
||||
<view class="content">
|
||||
<van-switch checked="{{ checked }}" bind:change="onChange" size="50rpx" />
|
||||
<van-switch checked="{{ formData.explainNeedTypeBoolean }}" size="50rpx" bind:change="switchChange" data-name="explainNeedType" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="label must">是否需要会议室</view>
|
||||
<view class="content">
|
||||
<van-switch checked="{{ checked }}" bind:change="onChange" size="50rpx" />
|
||||
<van-switch checked="{{ formData.meetingNeedTypeBoolean }}" bind:change="onChange" size="50rpx" bind:change="switchChange" data-name="meetingNeedType" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="label must">摄影需求</view>
|
||||
<view class="content">
|
||||
<van-switch checked="{{ checked }}" bind:change="onChange" size="50rpx" />
|
||||
<van-switch checked="{{ formData.photographTypeBoolean }}" bind:change="onChange" size="50rpx" bind:change="switchChange" data-name="photographType" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="itemView">
|
||||
<view class="label">备注</view>
|
||||
<view class="content">
|
||||
<van-field value="{{ title }}" placeholder="请输入备注" input-align="right" border="{{ false }}" bind:change="titleChange" />
|
||||
<van-field value="{{ formData.remake }}" placeholder="请输入备注" input-align="right" border="{{ false }}" bind:change="inputChange" data-name="remake" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -101,10 +101,26 @@
|
||||
</view>
|
||||
|
||||
<!-- 合计 -->
|
||||
<view class="submitBtn">立即预约</view>
|
||||
<view class="submitBtn" bind:tap="submitData">立即预约</view>
|
||||
|
||||
|
||||
<!-- 提示 -->
|
||||
<van-dialog id="van-dialog" />
|
||||
<!-- 提示 -->
|
||||
<van-notify id="van-notify" />
|
||||
</view>
|
||||
|
||||
<!-- 添加人员弹出框 -->
|
||||
<van-dialog use-slot title="添加-参观人员" show="{{ dialogShow }}" show-confirm-button="{{false}}" show-cancel-button="{{false}}" close-on-click-overlay>
|
||||
<view class="dialogContent">
|
||||
<van-field value="{{ dialogName }}" required clearable label="姓名" placeholder="请输入姓名" bind:change="dialogInputChange" data-name="dialogName" />
|
||||
<van-field value="{{ dialogJob }}" required clearable label="职务" placeholder="请输入职务" bind:change="dialogInputChange" data-name="dialogJob" />
|
||||
<van-field value="{{ dialogPhone }}" clearable label="手机号" placeholder="请输入手机号" bind:change="dialogInputChange" data-name="dialogPhone" />
|
||||
</view>
|
||||
<view class="dialogBtnView">
|
||||
<view class="rejectBtn" bind:tap="dialogCancel">取消</view>
|
||||
<view class="successBtn" bind:tap="dialogSubmit">确定</view>
|
||||
</view>
|
||||
</van-dialog>
|
||||
|
||||
<!-- 提示 -->
|
||||
<van-notify id="van-notify" />
|
||||
|
||||
<!-- 选择-参观目的 -->
|
||||
<van-action-sheet description="请选择参观目的" close-on-click-overlay="{{true}}" show="{{ visitTypeShow }}" actions="{{ visitTypeList }}" bind:select="selectVisitType" bind:close="hideVisitType" />
|
@ -232,3 +232,31 @@
|
||||
position: static;
|
||||
margin-left: 50%;
|
||||
}
|
||||
|
||||
.dialogContent{
|
||||
padding: 40rpx 20rpx;
|
||||
}
|
||||
|
||||
.dialogBtnView {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-top: 1px solid rgb(126, 126, 126, 0.2);
|
||||
}
|
||||
|
||||
.dialogBtnView .rejectBtn,
|
||||
.dialogBtnView .successBtn {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
padding: 30rpx 0;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.dialogBtnView .rejectBtn {
|
||||
border-right: 1px solid rgb(126, 126, 126, 0.2);
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.dialogBtnView .successBtn {
|
||||
color: #4e96f8;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
// pages/meeting/reservationRecord/exhibitionRecord/list.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<!--pages/meeting/reservationRecord/exhibitionRecord/list.wxml-->
|
||||
<text>pages/meeting/reservationRecord/exhibitionRecord/list.wxml</text>
|
@ -0,0 +1 @@
|
||||
/* pages/meeting/reservationRecord/exhibitionRecord/list.wxss */
|
Loading…
x
Reference in New Issue
Block a user