| | |
| | | vc.http.apiGet('/room.queryRooms', |
| | | param, |
| | | function (json, res) { |
| | | console.log('Room query response:', json); |
| | | let _json = JSON.parse(json); |
| | | vc.copyObject(_json.rooms[0], $that.roomCreateFeeInfo); |
| | | $that.changeTab('simplifyRoomFee'); |
| | | if (_json.rooms && _json.rooms.length > 0) { |
| | | let roomInfo = _json.rooms[0]; |
| | | console.log('Fetched room info:', roomInfo); |
| | | vc.copyObject(roomInfo, $that.roomCreateFeeInfo); |
| | | $that.changeTab('simplifyRoomFee'); |
| | | } else { |
| | | console.error('No room data found for roomId:', $that.roomCreateFeeInfo.roomId); |
| | | } |
| | | |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | console.error('Room query failed:', errInfo, error); |
| | | } |
| | | ); |
| | | }, |
| | |
| | | |
| | | changeTab: function (_tab) { |
| | | $that.roomCreateFeeInfo._currentTab = _tab; |
| | | vc.emit(_tab, 'switch', { |
| | | ownerId: $that.roomCreateFeeInfo.ownerId, |
| | | ownerName: $that.roomCreateFeeInfo.ownerName, |
| | | roomId: $that.roomCreateFeeInfo.roomId, |
| | | roomName: $that.roomCreateFeeInfo.roomName, |
| | | }) |
| | | console.log('Changing to tab:', _tab, 'with room info:', $that.roomCreateFeeInfo); |
| | | |
| | | // 构建完整的房间信息对象 |
| | | let roomInfo = { |
| | | ownerId: $that.roomCreateFeeInfo.ownerId || '', |
| | | ownerName: $that.roomCreateFeeInfo.ownerName || '', |
| | | roomId: $that.roomCreateFeeInfo.roomId || '', |
| | | roomName: $that.roomCreateFeeInfo.roomName || '', |
| | | floorNum: $that.roomCreateFeeInfo.floorNum || '', |
| | | unitNum: $that.roomCreateFeeInfo.unitNum || '', |
| | | roomNum: $that.roomCreateFeeInfo.roomNum || '', |
| | | roomType: $that.roomCreateFeeInfo.roomType || '', |
| | | builtUpArea: $that.roomCreateFeeInfo.builtUpArea || 0 |
| | | }; |
| | | |
| | | console.log('Emitting room info to', _tab, ':', roomInfo); |
| | | vc.emit(_tab, 'switch', roomInfo); |
| | | }, |
| | | _roomCreateFeetoSimplifyAcceptance: function () { |
| | | let _date = new Date(); |