新增车位申请功能

This commit is contained in:
1098226878@qq.com 2022-01-17 17:51:01 +08:00
parent cc567d454f
commit e63f743c38
4 changed files with 77 additions and 11 deletions

View File

@ -208,9 +208,9 @@
}, 5000) //
},
})
// wx.redirectTo({
// url: '/pages/complaintList/complaintList',
// });
wx.redirectTo({
url: '/pages/parkingInfo/parkingInfo',
});
return;
}
wx.showToast({

View File

@ -11,7 +11,7 @@
</view>
</scroll-view>
</view>
<view v-if="noData == false" style="margin-top: 100upx;">
<view v-if="noData == false" style="margin-top: 150upx;">
<view v-for="(item,index) in parkings" :key="index"
class="bg-white margin-bottom margin-right-xs radius margin-left-xs padding-top padding-left padding-right">
<view class="flex padding-bottom-xs solid-bottom justify-between">
@ -120,6 +120,7 @@
},
methods: {
listParkingSpace: function() {
let _that = this;
context.request({
url: constant.url.queryOwnerCars,
header: context.getHeaders(),
@ -129,7 +130,7 @@
"row": this.row,
"communityId": this.communityId,
"state": this.code,
"ownerId":this.ownerId
"applyPersonId":this.ownerId
},
success: (res) => {
let data = res.data.data;
@ -137,6 +138,10 @@
this.noData = true;
}
this.parkings = data;
if(this.parkings.length > 0){
_that._loadParkingSpaceFee();
}
},
fail(res) {
wx.showToast({
@ -147,14 +152,64 @@
}
});
},
_loadParkingSpaceFee: function() {
let _that = this;
let _objData = {
page: 1,
row: 30,
payerObjId: _that.parkings[0].carId,
communityId: _that.parkings[0].communityId
}
_that.moreParkingSpaces = [];
context.request({
url: constant.url.queryFeeByOwner,
header: context.getHeaders(),
method: "GET",
data: _objData, //
success: function(res) {
if (res.statusCode == 200) {
//
let _parkingSpaceFees = res.data.fees;
if (_parkingSpaceFees.length < 1) {
_that.noData = true;
}
_parkingSpaceFees.forEach(function(_fee) {
let _tmpEndTime = _fee.endTime.replace(/\-/g, "/")
let _endTime = new Date(_tmpEndTime);
_fee.endTime = formatDate(_endTime);
_fee.num = _that.parkings[0].num;
let _now = new Date();
if (_endTime > _now) {
_fee.feeStateName = '正常'
} else {
_fee.feeStateName = '欠费'
}
_that.moreParkingSpaces.push(_fee);
});
console.log(_that.moreParkingSpaces);
}
},
fail: function(e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
},
switchParkingSpace: function(_parkingSpace) {
this.code = _parkingSpace.code;
this.noData = false;
this.listParkingSpace();
},
payFee: function(_item) {
let _moreParkingSpaces = this.moreParkingSpaces[0];
_moreParkingSpaces["carNum"]=this.parkings[0].carNum;
this.vc.navigateTo({
url: '/pages/payParkingApplyFee/payParkingApplyFee?fee=' + JSON.stringify(_item),
url: '/pages/payParkingApplyFee/payParkingApplyFee?fee=' + JSON.stringify(_moreParkingSpaces),
})
},
}

View File

@ -112,6 +112,9 @@
// pages/payParkingFee/payParkingFee.js
const context = require("../../context/Java110Context.js");
const constant = context.constant;
import {
getCurCommunity
} from '../../api/community/communityApi.js'
import vcDiscount from '@/components/vc-discount/vc-discount.vue'
import {
addMonth,
@ -160,6 +163,7 @@
*/
onLoad: function(options) {
context.onLoad(options);
let _that = this;
// #ifdef MP-WEIXIN
let accountInfo = uni.getAccountInfoSync();
this.appId = accountInfo.miniProgram.appId;
@ -169,15 +173,19 @@
this.appId = uni.getStorageSync(constant.mapping.W_APP_ID)
// #endif
let _fee = JSON.parse(options.fee);
console.log(_fee);
let _receivableAmount = _fee.paymentCycle * _fee.feePrice;
let _communityInfo = context.getCurrentCommunity();
getCurCommunity()
.then(function(_communityInfo){
_that.communityId = _communityInfo.communityId;
_that.communityName = _communityInfo.communityName;
})
let _lastDate = new Date(_fee.endTime);
this.receivableAmount = _receivableAmount;
this.communityId = _communityInfo.communityId;
this.communityName = _communityInfo.communityName;
this.num = _fee.num;
this.feeTypeCdName = _fee.feeTypeCdName;
this.carNum = _fee.carNum;

View File

@ -80,7 +80,8 @@
curParkingSpace: {},
moreParkingSpaces: [],
needFefresh: true,
noData: false
noData: false,
appId: ''
};
},
components: {
@ -92,6 +93,7 @@
*/
onLoad: function(options) {
context.onLoad(options);
this.appId = options.wAppId;
},
/**
* 生命周期函数--监听页面显示
@ -108,6 +110,7 @@
},
methods: {
payFee: function(_item) {
_item["carNum"]=this.curParkingSpace.carNum;
this.vc.navigateTo({
url: '/pages/payParkingFee/payParkingFee?fee=' + JSON.stringify(_item),
})