车位申请

This commit is contained in:
曾成 2020-09-23 16:51:46 +08:00
parent d40e847d64
commit 18255068a7
3 changed files with 101 additions and 159 deletions

View File

@ -151,6 +151,10 @@ const queryRentingPool= baseUrl + 'app/renting/queryRentingPool'; //查询房源
const searchParkingSpace= baseUrl + 'app/searchParkingSpace/listParkingSpace'; //查询空闲车位
/**
* 不需要登录页面
*/
@ -236,5 +240,6 @@ module.exports = {
ownerRegisterWxPhoto:ownerRegisterWxPhoto,
changeStaffPwd:changeStaffPwd,
changeOwnerPhone:changeOwnerPhone,
queryRentingPool:queryRentingPool
queryRentingPool:queryRentingPool,
searchParkingSpace:searchParkingSpace
};

View File

@ -10,13 +10,23 @@ const constant = require("../constant/index.js");
const factory = require("../factory/index.js");
import {getHeaders,request,requestNoAuth} from '../api/java110Request.js'
import {
getHeaders,
request,
requestNoAuth
} from '../api/java110Request.js'
import {getCurOwner} from '../api/owner/ownerApi.js'
import {
getCurOwner
} from '../api/owner/ownerApi.js'
import {getProperty} from '../api/property/propertyApi.js'
import {
getProperty
} from '../api/property/propertyApi.js'
import {onLoad} from '../api/init/initApi.js'
import {
onLoad
} from '../api/init/initApi.js'
let util = {};
@ -131,9 +141,9 @@ const _loadArea = function(_level, _parentAreaCode, callBack = _areaList => {})
const getOwner = function(callBack = _ownerInfo => {}) {
// 从硬盘中获取 业主信息
getCurOwner()
.then((_owner)=>{
callBack(_owner);
})
.then((_owner) => {
callBack(_owner);
})
};
@ -254,6 +264,13 @@ const navigateTo = function(_param) {
};
module.exports = {
constant: constant,
util: util,
@ -271,5 +288,5 @@ module.exports = {
getProperty: getProperty,
checkLoginStatus: checkLoginStatus,
onLoad: onLoad,
navigateTo: navigateTo
navigateTo: navigateTo,
};

View File

@ -1,16 +1,8 @@
<template>
<view>
<view class="block__title">车位信息</view>
<view class="cu-form-group" >
<view class="title">车库</view>
<picker bindchange="PickerChange" :value="index" :range="roomCloums" @change="roomChange">
<view class="picker">
{{roomName?roomName:'请选择'}}
</view>
</picker>
</view>
<view class="cu-form-group" >
<view class="title">车位</view>
<view class="block__title">车位申请</view>
<view class="cu-form-group">
<view class="title">空闲车位</view>
<picker bindchange="PickerChange" :value="index" :range="roomCloums" @change="roomChange">
<view class="picker">
{{roomName?roomName:'请选择'}}
@ -30,8 +22,8 @@
<input v-model="layer" style="text-align:right"></input>
</view>
<view class="button_up_blank"></view>
<view class="flex flex-direction">
@ -43,20 +35,17 @@
<script>
const context = require("../../context/Java110Context.js");
const constant = context.constant;
import {queryRentingConfig,hireRoom} from '../../api/room/roomApi.js'
import base64 from '../../factory/Base64Factory.js'
export default {
data() {
return {
rooms:[],
apartment:'',
builtUpArea:'',
layer:'',
price:'',
rooms: [],
apartment: '',
builtUpArea: '',
layer: '',
price: '',
roomCloums: [],
roomIdArr: [],
roomName: "",
@ -64,74 +53,50 @@
roomShow: false,
imgList: [],
userTel: '',
userName:'',
page: 1,
row: 7,
userName: '',
photos: [],
communityId: "",
communityName: "",
paymentTypes: [{
id:'1001',
paymentTypeName:'押一付一'
},{
id:'2002',
paymentTypeName:'押一付三'
},{
id:'3003',
paymentTypeName:'押一付六'
id: '1001',
paymentTypeName: '押一付一'
}, {
id: '2002',
paymentTypeName: '押一付三'
}, {
id: '3003',
paymentTypeName: '押一付六'
}],
paymentTypeIndex:0,
paymentTypeIndex: 0,
paymentType: '1001',
paymentTypeName: '',
checkIns: [{
id:'1001',
checkInName:'立即入住'
},{
id:'2002',
checkInName:'预约'
id: '1001',
checkInName: '立即入住'
}, {
id: '2002',
checkInName: '预约'
}],
checkInIndex:0,
checkInIndex: 0,
checkIn: '1001',
checkInName: '',
checkInName: '',
rentingTypes: [],
rentingTypeIndex:0,
rentingTypeIndex: 0,
rentingType: '',
rentingTypeName: '',
rentingConfigId:'',
servicePrice:'',
rentingDesc:'',
rentingTitle:''
rentingConfigId: '',
servicePrice: '',
rentingDesc: '',
rentingTitle: ''
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this;
this.vc.onLoad(options);
context.getRooms().then(res => {
let arr = res.data.rooms;
that.rooms = arr;
let roomCloums = [];
let roomIdArr = [];
arr.map(item => {
roomCloums.push(item.floorNum + "号楼" + item.unitNum + "单元" + item.roomNum + "室");
roomIdArr.push(item.roomId);
})
that.roomCloums = roomCloums;
that.roomIdArr = roomIdArr;
that.userTel = res.data.owner.link;
that.userName = res.data.owner.appUserName;
that.communityId = res.data.owner.communityId;
that.communityName = res.data.owner.communityName;
});
//
this._loadRentingTypes();
this.listParkingSpace();
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: {
submitHireRoom: function() {
@ -146,9 +111,9 @@
"photos": [],
"rentingDesc": this.rentingDesc,
"ownerTel": this.userTel,
"ownerName":this.userName,
"state":"0",
"checkIn":this.checkIn
"ownerName": this.userName,
"state": "0",
"checkIn": this.checkIn
}
let _photos = this.photos;
_photos.forEach(function(_item) {
@ -156,88 +121,43 @@
"photo": _item
});
});
hireRoom(obj)
.then((res)=>{
//
_that.vc.navigateBack();
},(error)=>{
console.log(error);
uni.showToast({
icon:'none',
title:error
.then((res) => {
//
_that.vc.navigateBack();
}, (error) => {
console.log(error);
uni.showToast({
icon: 'none',
title: error
})
})
})
},
deleteImage: function(e) {
console.log(e);
let imageArr = this.$data.imgList;
imageArr.splice(e, 1);
},
ChooseImage: function(e) {
let that = this;
wx.chooseImage({
count: 4, //9
sizeType: ['original', 'compressed'], //
sourceType: ['album'], //
listParkingSpace: function() {
let _this = this;
let _paramIn = {
"page": _this.page,
"row": _this.row
};
context.request({
url: constant.url.searchParkingSpace,
header: context.getHeaders(),
method: "GET",
data: _paramIn,
success: (res) => {
console.log(res);
that.$data.imgList.push(res.tempFilePaths[0]);
let _base64Photo = '';
base64.urlTobase64(res.tempFilePaths[0]).then(function(_res) {
_base64Photo = _res;
console.log('base64', _base64Photo);
that.photos.push(_base64Photo);
});
console.log(res)
},
fail(res) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
},
roomChange: function(e) {
let _that = this;
this.roomId = this.roomIdArr[e.detail.value];
this.roomName = this.roomCloums[e.detail.value];
this.rooms.forEach(function(item){
if(item.roomId == _that.roomId){
_that.apartment = item.apartment;
_that.builtUpArea = item.builtUpArea;
_that.layer = item.layer;
}
})
},
paymentTypeChange:function(e){
this.paymentTypeIndex = e.target.value //
let selected = this.paymentTypes[this.paymentTypeIndex] //
this.paymentType = selected.id //id
this.paymentTypeName = selected.paymentTypeName //id
},
_loadRentingTypes:function(){
let _that = this;
queryRentingConfig()
.then((_rentingTypes)=>{
_that.rentingTypes = _rentingTypes;
if(_rentingTypes.length >0){
let selected = _rentingTypes[0];
_that.rentingConfigId = selected.rentingConfigId;
_that.servicePrice = (selected.servicePrice * selected.serviceOwnerRate)+'元';
}
});
},
rentingTypeChange:function(e){
this.rentingTypeIndex = e.target.value //
let selected = this.rentingTypes[this.rentingTypeIndex] //
this.rentingConfigId = selected.rentingConfigId //id
this.rentingTypeName = selected.rentingTypeName //id
this.servicePrice = (selected.servicePrice * selected.serviceOwnerRate)+'元';
},
checkInChange:function(e){
this.checkInIndex = e.target.value //
let selected = this.checkIns[this.checkInIndex] //
this.checkIn = selected.id //id
},
}
}
};
</script>