描述:服务

This commit is contained in:
SelfRidicule 2024-06-27 12:00:33 +08:00
parent 288cc186b5
commit 1fb5419424
8 changed files with 362 additions and 220 deletions

View File

@ -71,7 +71,8 @@
"pages/meeting/exhibition/booked/booked", "pages/meeting/exhibition/booked/booked",
"pages/meeting/exhibition/order/order", "pages/meeting/exhibition/order/order",
"pages/meeting/reservationRecord/exhibitionRecord/list/list", "pages/meeting/reservationRecord/exhibitionRecord/list/list",
"pages/meeting/reservationRecord/exhibitionRecord/detail/detail" "pages/meeting/reservationRecord/exhibitionRecord/detail/detail",
"pages/meeting/meetingRoom/meetingService/meetingService"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
@ -85,7 +86,8 @@
"borderStyle": "black", "borderStyle": "black",
"selectedColor": "#5C8EFF", "selectedColor": "#5C8EFF",
"color": "#333333", "color": "#333333",
"list": [{ "list": [
{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "/images/tabbar/home.png", "iconPath": "/images/tabbar/home.png",
"selectedIconPath": "/images/tabbar/home-select.png", "selectedIconPath": "/images/tabbar/home-select.png",

View File

@ -195,6 +195,9 @@ Page({
wx.setStorageSync('openid', userDetail.openid) wx.setStorageSync('openid', userDetail.openid)
wx.setStorageSync('user', userDetail) wx.setStorageSync('user', userDetail)
wx.setStorageSync('userId', userDetail.id) wx.setStorageSync('userId', userDetail.id)
wx.setStorageSync('tenantId', app.tenantId)
wx.setStorageSync('parkId', app.parkId)
wx.setStorageSync('parkName', app.parkName)
_this.setData({ _this.setData({
userDetail userDetail
}) })

View File

@ -44,7 +44,7 @@ Page({
}).then(res => { }).then(res => {
console.log('queryServiceMsgRq', res); console.log('queryServiceMsgRq', res);
for (let i = 0; i < res.data.length; i++) { for (let i = 0; i < res.data.length; i++) {
if (res.data[i].dictValue == wx.getStorageSync('parkId')) { if (res.data[i].dictValue == app.tenantId) {
_this.setData({ _this.setData({
msg: res.data[i].dictLabel msg: res.data[i].dictLabel
}) })

View File

@ -35,17 +35,7 @@ Page({
bannerList: [], bannerList: [],
room: {}, room: {},
userData: {}, userData: {},
couponId: '', serviceList : [],
couponData: {},
couponList: [],
couponCount: 0,
couponUseList: [],
couponUseCount: 0,
couponNotUseList: [],
couponNotUseCount: 0,
countAmount: '',
totalAmount: '',
priceDialogShow: false,
}, },
/** /**
@ -62,8 +52,6 @@ Page({
}) })
// 详细信息 // 详细信息
this.getDetail(); this.getDetail();
// 获取优惠卷
this.getCustomerTicket();
}, },
// 详细信息 // 详细信息
@ -86,45 +74,6 @@ Page({
}) })
}, },
// 获取优惠卷
getCustomerTicket() {
let _this = this;
getCustomerTicketRq({
"userId": _this.data.userData.id,
"customerId": _this.data.userData.icsCustomerId,
"meetingId": _this.data.meetingRoomId,
"type": '1'
}).then(res => {
let nowTime = new Date().getTime();
let dataList = res.data.map(item => {
item.startTime = selfFormatTimeYMD(item.startTime)
item.endDate = selfFormatTimeYMD(item.endDate)
let kaishiTime = new Date(item.startTime + " 00:00:00")
let jieshuTime = new Date(item.endDate + " 23:59:59")
if (nowTime >= kaishiTime && nowTime <= jieshuTime) {
item.isDisable = false
} else {
item.isDisable = true
}
return item;
})
// 可用
let useList = res.data.filter(item => !item.isDisable)
// 不可用
let notUseList = res.data.filter(item => item.isDisable)
_this.setData({
couponList: dataList,
couponCount: selfArrSum(dataList.map(item => item.num)),
couponUseList: useList,
couponUseCount: selfArrSum(useList.map(item => item.num)),
couponNotUseList: notUseList,
couponNotUseCount: selfArrSum(notUseList.map(item => item.num)),
})
})
},
// 主题修改监听 // 主题修改监听
titleChange(event) { titleChange(event) {
this.setData({ this.setData({
@ -135,42 +84,12 @@ Page({
// 跳转-空间设施 // 跳转-空间设施
jumpMeetingFacilities() { jumpMeetingFacilities() {
let meetingRoomId = this.data.meetingRoomId; let meetingRoomId = this.data.meetingRoomId;
let serviceListJsonStr = JSON.stringify(this.data.serviceList)
wx.navigateTo({ wx.navigateTo({
url: '/pages/meeting/meetingRoom/meetingFacilities/meetingFacilities?meetingRoomId=' + meetingRoomId, url: `/pages/meeting/meetingRoom/meetingService/meetingService?meetingRoomId=${meetingRoomId}&serviceList=${serviceListJsonStr}`
}) })
}, },
// 跳转-优惠卷
jumpMeetingCoupon() {
let _this = this;
wx.navigateTo({
url: `/pages/meeting/meetingRoom/meetingCoupon/meetingCoupon?type=1&couponId=${_this.data.couponId}&meetingRoomId=${_this.data.meetingRoomId}`,
})
},
// 协议点击
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,
})
},
// 价格明细
priceDetail() {
let _this = this
_this.setData({
priceDialogShow: true
})
},
// 提交订单 // 提交订单
submitCase() { submitCase() {
@ -184,14 +103,6 @@ Page({
}); });
return; return;
} }
if (!_this.data.protocolFlag) {
// 错误提示
Notify({
type: 'danger',
message: `请同意${_this.data.protocolTitle}!`
});
return;
}
saveMeetingRecordRq({ saveMeetingRecordRq({
"roomContentId": _this.data.meetingRoomId, "roomContentId": _this.data.meetingRoomId,
@ -232,26 +143,7 @@ Page({
onShow() { onShow() {
console.log('onShow'); console.log('onShow');
let _this = this let _this = this
// 更新选择的优惠卷
if (_this.data.couponId) {
let couponData = _this.data.couponList.find(item => item.ticketId == _this.data.couponId)
_this.setData({
couponData
})
}
// 查询金额
calculateMeetingRoomAmountRq({
"startTime": _this.data.startTime,
"endDate": _this.data.endTime,
"roomContentId": _this.data.meetingRoomId,
"ticketId": _this.data.couponId
}).then(res => {
console.log('calculateMeetingRoomAmountRq', res);
_this.setData({
countAmount: res.amount.totalMoney,
totalAmount: res.amount.paidMoney,
})
})
}, },
/** /**

View File

@ -0,0 +1,167 @@
const app = getApp()
import {
getMeetingRoomServiceAndEquipmentRq,
queryServiceMsgRq
} from "../../../../api/meeting/meetingRoom.js"
Page({
/**
* 页面的初始数据
*/
data: {
IMG_NAME: app.IMG_NAME,
meetingRoomId: null,
detail: {},
msg: {},
serviceList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let _this = this;
let serviceList = JSON.parse(options.serviceList)
_this.setData({
...options,
serviceList
})
// 获取数据
_this.getData();
},
// 获取数据
getData() {
let _this = this;
if (!(_this.data.serviceList && _this.data.serviceList.length > 0)) {
// 查询服务列表
getMeetingRoomServiceAndEquipmentRq(_this.data.meetingRoomId).then(res => {
let serviceList = res.data.roomFServe.map(item => {
return {
serveId: item.id,
serveName: item.serveName,
isSelect: false,
num: '',
}
})
_this.setData({
serviceList
})
})
}
// 查询服务信息
queryServiceMsgRq({
"dictType": "server_info"
}).then(res => {
console.log('queryServiceMsgRq', res);
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].dictValue == app.tenantId) {
_this.setData({
msg: res.data[i].dictLabel
})
break;
}
}
})
},
// 服务选择
checkBoxClick(e) {
let _this = this;
console.log('checkBoxClick', e);
// get param
let id = e.target.dataset.id
let serviceList = _this.data.serviceList.map(item => {
if (item.serveId == id) {
item.isSelect = !item.isSelect
}
return item
})
_this.setData({
serviceList
})
},
// 服务输入数量
inputChange(e) {
let _this = this;
console.log('inputChange', e);
// get param
let id = e.currentTarget.dataset.id
let num = e.detail;
let serviceList = _this.data.serviceList.map(item => {
if (item.serveId == id) {
item.num = num
}
return item
})
_this.setData({
serviceList
})
},
// 确定
submit() {
let _this = this;
let pages = getCurrentPages(); //获取page
let prevPage = pages[pages.length - 2]; //上一个页面(父页面)
prevPage.setData({
serviceList: _this.data.serviceList
})
wx.navigateBack();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,9 @@
{
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-field": "@vant/weapp/field/index"
},
"navigationBarTitleText": "会议服务"
}

View File

@ -0,0 +1,23 @@
<view class="containerView public">
<!-- 增值服务 -->
<view class="serviceView">
<view class="leftLineTitle">增值服务</view>
<view class="serviceItemView">
<view class="serviceItem" wx:for="{{serviceList}}" wx:key="*this">
<van-checkbox value="{{ item.isSelect }}" data-id="{{item.serveId}}" shape="square" bind:tap="checkBoxClick"></van-checkbox>
<view class="name" data-id="{{item.serveId}}" bind:tap="checkBoxClick">{{item.serveName}}</view>
<van-field style="width: 220rpx;" data-id="{{item.serveId}}" value="{{ item.num }}" type="number" clearable placeholder="请输入人数" border="{{ false }}" bind:change="inputChange" />
</view>
</view>
</view>
<!-- 声明信息 -->
<view class="statementView">
{{msg}}
</view>
<view class="submitBtn" bind:tap="submit">确定</view>
</view>

View File

@ -0,0 +1,46 @@
.serviceView {
margin-top: 40rpx;
}
.serviceView .leftLineTitle {
margin-left: 20rpx;
}
.serviceView .serviceItemView {
margin-top: 30rpx;
}
.serviceView .serviceItemView .serviceItem {
border-bottom: 1px solid rgb(126, 126, 126, 0.2);
display: flex;
justify-content: space-between;
align-items: center;
word-break: break-all;
padding: 20rpx 20rpx;
}
.serviceView .serviceItemView .serviceItem:first-of-type {
border-top: 1px solid rgb(126, 126, 126, 0.2);
}
.serviceView .serviceItem .name {
position: relative;
flex: 1;
margin-right: 20rpx;
padding-left: 10rpx;
font-size: 26rpx;
}
.serviceView .serviceItem .content {
color: red;
font-size: 24rpx;
max-width: 400rpx;
}
.statementView {
padding: 80rpx 40rpx;
font-size: 24rpx;
text-indent: 48rpx;
color: gray;
}