mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 18:59:36 +08:00
修复部分问题
This commit is contained in:
parent
36e780d615
commit
dc6952a381
@ -41,8 +41,32 @@ Page({
|
||||
value: null,
|
||||
},
|
||||
personDict: {
|
||||
list: [],
|
||||
value: null,
|
||||
list: [{
|
||||
text: '人数',
|
||||
value: ''
|
||||
}, {
|
||||
text: '1-10',
|
||||
value: 1
|
||||
}, {
|
||||
text: '11-20',
|
||||
value: 2
|
||||
}, {
|
||||
text: '21-30',
|
||||
value: 3
|
||||
}, {
|
||||
text: '31-40',
|
||||
value: 4
|
||||
}, {
|
||||
text: '41-50',
|
||||
value: 5
|
||||
}, {
|
||||
text: '51-100',
|
||||
value: 6
|
||||
}, {
|
||||
text: '100 以上',
|
||||
value: 7
|
||||
}],
|
||||
value: '',
|
||||
},
|
||||
itemDict: {
|
||||
list: [],
|
||||
@ -155,106 +179,26 @@ Page({
|
||||
}, ...typeList]
|
||||
queryParam.shapeDict.list = typeList
|
||||
|
||||
let numList = []
|
||||
for (let key in dataObj.personNum) {
|
||||
let eachObj = dataObj.personNum[key]
|
||||
// const keys = Object.keys(eachObj)
|
||||
numList.push({
|
||||
text: eachObj,
|
||||
value: eachObj
|
||||
})
|
||||
}
|
||||
numList = [{
|
||||
text: "人数",
|
||||
value: null
|
||||
}, ...numList]
|
||||
queryParam.personDict.list = numList
|
||||
// let numList = []
|
||||
// for (let key in dataObj.personNum) {
|
||||
// let eachObj = dataObj.personNum[key]
|
||||
// // const keys = Object.keys(eachObj)
|
||||
// numList.push({
|
||||
// text: eachObj,
|
||||
// value: eachObj
|
||||
// })
|
||||
// }
|
||||
// numList = [{
|
||||
// text: "人数",
|
||||
// value: null
|
||||
// }, ...numList]
|
||||
// queryParam.personDict.list = numList
|
||||
|
||||
_this.setData({
|
||||
queryParam
|
||||
})
|
||||
})
|
||||
// 1.会议室类型,2.人数,3.会议室设备,4.形式
|
||||
// meetingRoomDict("1").then(res => {
|
||||
// console.log('meetingRoomDict("1")', res);
|
||||
// // 封装参数
|
||||
// let list = res.roomContents.map(item => {
|
||||
// return {
|
||||
// text: item.typeName,
|
||||
// value: item.typeValue
|
||||
// }
|
||||
// })
|
||||
// list = [{
|
||||
// text: "楼层",
|
||||
// value: null
|
||||
// }, ...list]
|
||||
// // 赋值参数
|
||||
// let queryParam = _this.data.queryParam;
|
||||
// queryParam.meetingTypeDict.list = list;
|
||||
// _this.setData({
|
||||
// queryParam
|
||||
// })
|
||||
// console.log('meetingRoomDict("1")=>', list);
|
||||
// })
|
||||
// meetingRoomDict("2").then(res => {
|
||||
// console.log('meetingRoomDict("2")', res);
|
||||
// // 封装参数
|
||||
// let list = res.roomContents.map(item => {
|
||||
// return {
|
||||
// text: item.capacityNum + '人',
|
||||
// value: item.capacityNum
|
||||
// }
|
||||
// })
|
||||
// list = [{
|
||||
// text: "人数",
|
||||
// value: null
|
||||
// }, ...list]
|
||||
// // 赋值参数
|
||||
// let queryParam = _this.data.queryParam;
|
||||
// queryParam.personDict.list = list;
|
||||
// _this.setData({
|
||||
// queryParam
|
||||
// })
|
||||
// console.log('meetingRoomDict("2")=>', list);
|
||||
// })
|
||||
// meetingRoomDict("3").then(res => {
|
||||
// console.log('meetingRoomDict("3")', res);
|
||||
// // 封装参数
|
||||
// let list = res.roomItem.map(item => {
|
||||
// return {
|
||||
// text: item.name,
|
||||
// value: item.id
|
||||
// }
|
||||
// })
|
||||
// // 赋值参数
|
||||
// let queryParam = _this.data.queryParam;
|
||||
// queryParam.itemDict.list = list;
|
||||
// _this.setData({
|
||||
// queryParam
|
||||
// })
|
||||
// console.log('meetingRoomDict("3")=>', list);
|
||||
// })
|
||||
// meetingRoomDict("4").then(res => {
|
||||
// console.log('meetingRoomDict("4")', res);
|
||||
// // 封装参数
|
||||
// let list = res.roomContents.map(item => {
|
||||
// return {
|
||||
// text: item.shape,
|
||||
// value: item.shape
|
||||
// }
|
||||
// })
|
||||
// list = [{
|
||||
// text: "形式",
|
||||
// value: null
|
||||
// }, ...list]
|
||||
// // 赋值参数
|
||||
// let queryParam = _this.data.queryParam;
|
||||
// queryParam.shapeDict.list = list;
|
||||
// _this.setData({
|
||||
// queryParam
|
||||
// })
|
||||
// console.log('meetingRoomDict("4")=>', list);
|
||||
// })
|
||||
|
||||
// 数据-会议室列表
|
||||
this.meetingRoomList()
|
||||
},
|
||||
@ -314,15 +258,31 @@ Page({
|
||||
devicesArr.push(eachObj.value)
|
||||
}
|
||||
}
|
||||
// let roomItemList = queryParam.itemDict.list.filter(item => item.select).map(item => {
|
||||
// return {
|
||||
// "id": item.value,
|
||||
// "name": item.text
|
||||
// }
|
||||
// })
|
||||
let minPerNum = 0
|
||||
let maxPerNum = 1000
|
||||
let perNumValue = queryParam.personDict.value
|
||||
if (perNumValue == 6) {
|
||||
// 51-100
|
||||
maxPerNum = 100
|
||||
minPerNum = 51
|
||||
} else if (perNumValue == 7) {
|
||||
// 100以上
|
||||
minPerNum = 101
|
||||
maxPerNum = 1000
|
||||
} else if (perNumValue == '') {
|
||||
// 全部
|
||||
minPerNum = 1
|
||||
maxPerNum = 1000
|
||||
} else {
|
||||
// 其余,符合规则即可
|
||||
// perNumValue * 10 - 9 ~ perNumValue * 10
|
||||
maxPerNum = parseInt(perNumValue) * 10
|
||||
minPerNum = maxPerNum - 9
|
||||
}
|
||||
let param = {
|
||||
floor: queryParam.meetingTypeDict.value, // 楼层
|
||||
capacityNum: queryParam.personDict.value, // 人数
|
||||
min: minPerNum, // 最小容纳人数
|
||||
max: maxPerNum, // 最大容纳人数
|
||||
devices: devicesArr, // 设备
|
||||
typeName: queryParam.shapeDict.value, // 形状
|
||||
timeFormat: queryParam.timeRangeDict.value, // 预约时间格式:0 任意时间(管理员),1上午,2下午,3晚上 4 全天。值为0时,读取startTime和endTime为预约会议时间范围;其他值读取mrdate,再拼接时间为预约会议时间范围。
|
||||
@ -357,7 +317,7 @@ Page({
|
||||
timeRange = timeRange ? timeRange : 0
|
||||
// 跳转预约详情
|
||||
wx.navigateTo({
|
||||
url: "/pages/meeting/meetingRoom/meetingRoom?status="+ e.currentTarget.dataset.status +"&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
|
||||
url: "/pages/meeting/meetingRoom/meetingRoom?status=" + e.currentTarget.dataset.status + "&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -164,22 +164,8 @@ Page({
|
||||
console.log(`JSON error : ${error}`);
|
||||
}
|
||||
}
|
||||
_this.getService(serveId)
|
||||
// 提前处理服务,不需要进入页面后获取
|
||||
// let serviceList = detail.roomServeList.map(item => {
|
||||
// let isSel = false
|
||||
// if (serveId.includes(item.id)) {
|
||||
// isSel = true
|
||||
// }
|
||||
// return {
|
||||
// serveId: item.id,
|
||||
// serveName: item.serveName,
|
||||
// isSelect: isSel,
|
||||
// num: '',
|
||||
// type: 'free'
|
||||
// }
|
||||
// })
|
||||
console.log(detail)
|
||||
let hasServeId = detail.ext1
|
||||
_this.getService(hasServeId, serveId)
|
||||
_this.setData({
|
||||
// serviceList: serviceList,
|
||||
room: detail,
|
||||
@ -187,8 +173,18 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
getService(serveId) {
|
||||
getService(hasServeId, serveId) {
|
||||
console.log(hasServeId)
|
||||
let _this = this;
|
||||
if (!hasServeId || hasServeId == '') {
|
||||
// 为空,此时无服务
|
||||
_this.setData({
|
||||
serviceList: []
|
||||
})
|
||||
return
|
||||
}
|
||||
// 拆分此会议室拥有的服务id,与字典比对
|
||||
let hasServeIdArr = hasServeId.split(',')
|
||||
meetingRoomDict().then(res => {
|
||||
console.log('meetingRoomDict', res)
|
||||
let queryParam = _this.data.queryParam
|
||||
@ -200,6 +196,8 @@ Page({
|
||||
const keys = Object.keys(eachObj)
|
||||
let isSel = false
|
||||
let sId = eachObj[keys[0]]
|
||||
if (hasServeIdArr.includes(sId)) {
|
||||
// 此房间拥有的服务才继续处理
|
||||
if (serveId.includes(sId)) {
|
||||
isSel = true
|
||||
}
|
||||
@ -211,6 +209,7 @@ Page({
|
||||
type: 'free'
|
||||
})
|
||||
}
|
||||
}
|
||||
// queryParam.shapeDict.list = typeList
|
||||
_this.setData({
|
||||
serviceList: serviceList
|
||||
@ -234,7 +233,12 @@ Page({
|
||||
|
||||
// 跳转-空间设施
|
||||
jumpMeetingFacilities() {
|
||||
console.log(this.data.serviceList)
|
||||
console.log('跳转', this.data.serviceList)
|
||||
if (this.data.serviceList.length == 0) {
|
||||
// 没有服务
|
||||
Notify('此会议室不提供服务!')
|
||||
return
|
||||
}
|
||||
let meetingRoomId = this.data.meetingRoomId;
|
||||
let serviceListJsonStr = JSON.stringify(this.data.serviceList)
|
||||
wx.navigateTo({
|
||||
|
Loading…
x
Reference in New Issue
Block a user