mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-06-12 10:00:57 +08:00
新增车位申请功能
This commit is contained in:
parent
cc567d454f
commit
e63f743c38
@ -208,9 +208,9 @@
|
|||||||
}, 5000) //延迟时间
|
}, 5000) //延迟时间
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// wx.redirectTo({
|
wx.redirectTo({
|
||||||
// url: '/pages/complaintList/complaintList',
|
url: '/pages/parkingInfo/parkingInfo',
|
||||||
// });
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</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"
|
<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">
|
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">
|
<view class="flex padding-bottom-xs solid-bottom justify-between">
|
||||||
@ -120,6 +120,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
listParkingSpace: function() {
|
listParkingSpace: function() {
|
||||||
|
let _that = this;
|
||||||
context.request({
|
context.request({
|
||||||
url: constant.url.queryOwnerCars,
|
url: constant.url.queryOwnerCars,
|
||||||
header: context.getHeaders(),
|
header: context.getHeaders(),
|
||||||
@ -129,7 +130,7 @@
|
|||||||
"row": this.row,
|
"row": this.row,
|
||||||
"communityId": this.communityId,
|
"communityId": this.communityId,
|
||||||
"state": this.code,
|
"state": this.code,
|
||||||
"ownerId":this.ownerId
|
"applyPersonId":this.ownerId
|
||||||
},
|
},
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
let data = res.data.data;
|
let data = res.data.data;
|
||||||
@ -137,6 +138,10 @@
|
|||||||
this.noData = true;
|
this.noData = true;
|
||||||
}
|
}
|
||||||
this.parkings = data;
|
this.parkings = data;
|
||||||
|
if(this.parkings.length > 0){
|
||||||
|
_that._loadParkingSpaceFee();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
fail(res) {
|
fail(res) {
|
||||||
wx.showToast({
|
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) {
|
switchParkingSpace: function(_parkingSpace) {
|
||||||
this.code = _parkingSpace.code;
|
this.code = _parkingSpace.code;
|
||||||
this.noData = false;
|
this.noData = false;
|
||||||
this.listParkingSpace();
|
this.listParkingSpace();
|
||||||
},
|
},
|
||||||
payFee: function(_item) {
|
payFee: function(_item) {
|
||||||
|
let _moreParkingSpaces = this.moreParkingSpaces[0];
|
||||||
|
_moreParkingSpaces["carNum"]=this.parkings[0].carNum;
|
||||||
this.vc.navigateTo({
|
this.vc.navigateTo({
|
||||||
url: '/pages/payParkingApplyFee/payParkingApplyFee?fee=' + JSON.stringify(_item),
|
url: '/pages/payParkingApplyFee/payParkingApplyFee?fee=' + JSON.stringify(_moreParkingSpaces),
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,6 +112,9 @@
|
|||||||
// pages/payParkingFee/payParkingFee.js
|
// pages/payParkingFee/payParkingFee.js
|
||||||
const context = require("../../context/Java110Context.js");
|
const context = require("../../context/Java110Context.js");
|
||||||
const constant = context.constant;
|
const constant = context.constant;
|
||||||
|
import {
|
||||||
|
getCurCommunity
|
||||||
|
} from '../../api/community/communityApi.js'
|
||||||
import vcDiscount from '@/components/vc-discount/vc-discount.vue'
|
import vcDiscount from '@/components/vc-discount/vc-discount.vue'
|
||||||
import {
|
import {
|
||||||
addMonth,
|
addMonth,
|
||||||
@ -160,6 +163,7 @@
|
|||||||
*/
|
*/
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
context.onLoad(options);
|
context.onLoad(options);
|
||||||
|
let _that = this;
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
let accountInfo = uni.getAccountInfoSync();
|
let accountInfo = uni.getAccountInfoSync();
|
||||||
this.appId = accountInfo.miniProgram.appId;
|
this.appId = accountInfo.miniProgram.appId;
|
||||||
@ -169,15 +173,19 @@
|
|||||||
this.appId = uni.getStorageSync(constant.mapping.W_APP_ID)
|
this.appId = uni.getStorageSync(constant.mapping.W_APP_ID)
|
||||||
// #endif
|
// #endif
|
||||||
let _fee = JSON.parse(options.fee);
|
let _fee = JSON.parse(options.fee);
|
||||||
|
console.log(_fee);
|
||||||
let _receivableAmount = _fee.paymentCycle * _fee.feePrice;
|
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);
|
let _lastDate = new Date(_fee.endTime);
|
||||||
|
|
||||||
|
|
||||||
this.receivableAmount = _receivableAmount;
|
this.receivableAmount = _receivableAmount;
|
||||||
this.communityId = _communityInfo.communityId;
|
|
||||||
this.communityName = _communityInfo.communityName;
|
|
||||||
this.num = _fee.num;
|
this.num = _fee.num;
|
||||||
this.feeTypeCdName = _fee.feeTypeCdName;
|
this.feeTypeCdName = _fee.feeTypeCdName;
|
||||||
this.carNum = _fee.carNum;
|
this.carNum = _fee.carNum;
|
||||||
|
|||||||
@ -80,7 +80,8 @@
|
|||||||
curParkingSpace: {},
|
curParkingSpace: {},
|
||||||
moreParkingSpaces: [],
|
moreParkingSpaces: [],
|
||||||
needFefresh: true,
|
needFefresh: true,
|
||||||
noData: false
|
noData: false,
|
||||||
|
appId: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -92,6 +93,7 @@
|
|||||||
*/
|
*/
|
||||||
onLoad: function(options) {
|
onLoad: function(options) {
|
||||||
context.onLoad(options);
|
context.onLoad(options);
|
||||||
|
this.appId = options.wAppId;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
@ -108,6 +110,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
payFee: function(_item) {
|
payFee: function(_item) {
|
||||||
|
_item["carNum"]=this.curParkingSpace.carNum;
|
||||||
this.vc.navigateTo({
|
this.vc.navigateTo({
|
||||||
url: '/pages/payParkingFee/payParkingFee?fee=' + JSON.stringify(_item),
|
url: '/pages/payParkingFee/payParkingFee?fee=' + JSON.stringify(_item),
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user