优化停车费缴费周期问题

This commit is contained in:
java110 2020-08-12 18:12:57 +08:00
parent 6888b31298
commit 99c0da393f
6 changed files with 28 additions and 162 deletions

View File

@ -107,8 +107,8 @@
data() { data() {
return { return {
showFeeMonth: false, showFeeMonth: false,
feeMonthList: ['一个月', '半年', '一年', '两年'], feeMonthList: [],
feeMonthName: '一个月', feeMonthName: '',
feeMonth: 1, feeMonth: 1,
endTime: '', endTime: '',
ordEndTime: '', ordEndTime: '',
@ -122,7 +122,9 @@
communityId: '', communityId: '',
communityName: '', communityName: '',
feeId: '', feeId: '',
appId:'' appId:'',
feeFlag:'',
paymentCycle:1,
}; };
}, },
@ -155,6 +157,12 @@
this.feePrice = _fee.feePrice; this.feePrice = _fee.feePrice;
this.endTime = util.date.formatDate(_endTime); this.endTime = util.date.formatDate(_endTime);
this.ordEndTime = _fee.endTime; this.ordEndTime = _fee.endTime;
this.feeFlag = _fee.feeFlag;
this.paymentCycle = _fee.paymentCycle;
for (let _index = 1; _index < 7; _index++) {
this.feeMonthList.push(_index * this.paymentCycle + '个月')
}
this.feeMonthName = this.paymentCycle + '个月';
var pages = getCurrentPages(); var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; // var prevPage = pages[pages.length - 2]; //
@ -162,36 +170,6 @@
prevPage.needFefresh = false; prevPage.needFefresh = false;
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
@ -202,19 +180,7 @@
console.log("onConfirm", e); console.log("onConfirm", e);
let _feeMonthName = null; let _feeMonthName = null;
_feeMonthName = this.feeMonthList[e.detail.value]; _feeMonthName = this.feeMonthList[e.detail.value];
let _feeMonth = 1; let _feeMonth = _feeMonthName.replace("个月","");;
if (_feeMonthName == '一个月') {
_feeMonth = 1;
} else if (_feeMonthName == '半年') {
_feeMonth = 6;
} else if (_feeMonthName == '一年') {
_feeMonth = 12;
} else if (_feeMonthName == '两年') {
_feeMonth = 24;
} else {
return;
}
let _receivableAmount = _feeMonth * this.feePrice ; let _receivableAmount = _feeMonth * this.feePrice ;

View File

@ -85,12 +85,6 @@
onLoad: function(options) { onLoad: function(options) {
context.onLoad(options); context.onLoad(options);
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
@ -104,31 +98,6 @@
_that._loadParkingSpace(_owner); _that._loadParkingSpace(_owner);
}); });
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {},
methods: { methods: {
payFee: function(_item) { payFee: function(_item) {
uni.navigateTo({ uni.navigateTo({
@ -157,7 +126,6 @@
_that.parkingSpaces = _parkingSpaces; _that.parkingSpaces = _parkingSpaces;
if (_parkingSpaces.length == 0) { if (_parkingSpaces.length == 0) {
_that.noData = true; _that.noData = true;
return; return;
} }
_that.curParkingSpace = _parkingSpaces[0]; _that.curParkingSpace = _parkingSpaces[0];
@ -203,7 +171,6 @@
_fee.endTime = util.date.formatDate(_endTime); _fee.endTime = util.date.formatDate(_endTime);
_fee.num = _that.curParkingSpace.num; _fee.num = _that.curParkingSpace.num;
let _now = new Date(); let _now = new Date();
if (_endTime > _now) { if (_endTime > _now) {
_fee.feeStateName = '正常' _fee.feeStateName = '正常'
} else { } else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -239,8 +239,8 @@ var util = context.util;var _default =
data: function data() { data: function data() {
return { return {
showFeeMonth: false, showFeeMonth: false,
feeMonthList: ['一个月', '半年', '一年', '两年'], feeMonthList: [],
feeMonthName: '一个月', feeMonthName: '',
feeMonth: 1, feeMonth: 1,
endTime: '', endTime: '',
ordEndTime: '', ordEndTime: '',
@ -254,7 +254,9 @@ var util = context.util;var _default =
communityId: '', communityId: '',
communityName: '', communityName: '',
feeId: '', feeId: '',
appId: '' }; appId: '',
feeFlag: '',
paymentCycle: 1 };
}, },
@ -287,6 +289,12 @@ var util = context.util;var _default =
this.feePrice = _fee.feePrice; this.feePrice = _fee.feePrice;
this.endTime = util.date.formatDate(_endTime); this.endTime = util.date.formatDate(_endTime);
this.ordEndTime = _fee.endTime; this.ordEndTime = _fee.endTime;
this.feeFlag = _fee.feeFlag;
this.paymentCycle = _fee.paymentCycle;
for (var _index = 1; _index < 7; _index++) {
this.feeMonthList.push(_index * this.paymentCycle + '个月');
}
this.feeMonthName = this.paymentCycle + '个月';
var pages = getCurrentPages(); var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; //上一个页面 var prevPage = pages[pages.length - 2]; //上一个页面
@ -295,38 +303,8 @@ var util = context.util;var _default =
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 用户点击右上角分享
*/ */
onReady: function onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function onShareAppMessage() {}, onShareAppMessage: function onShareAppMessage() {},
methods: { methods: {
@ -334,19 +312,7 @@ var util = context.util;var _default =
console.log("onConfirm", e); console.log("onConfirm", e);
var _feeMonthName = null; var _feeMonthName = null;
_feeMonthName = this.feeMonthList[e.detail.value]; _feeMonthName = this.feeMonthList[e.detail.value];
var _feeMonth = 1; var _feeMonth = _feeMonthName.replace("个月", "");;
if (_feeMonthName == '一个月') {
_feeMonth = 1;
} else if (_feeMonthName == '半年') {
_feeMonth = 6;
} else if (_feeMonthName == '一年') {
_feeMonth = 12;
} else if (_feeMonthName == '两年') {
_feeMonth = 24;
} else {
return;
}
var _receivableAmount = _feeMonth * this.feePrice; var _receivableAmount = _feeMonth * this.feePrice;

View File

@ -221,15 +221,9 @@ var util = context.util;var noDataPage = function noDataPage() {__webpack_requir
onLoad: function onLoad(options) { onLoad: function onLoad(options) {
context.onLoad(options); context.onLoad(options);
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面显示
*/ */
onReady: function onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function onShow() { onShow: function onShow() {
var _that = this; var _that = this;
if (!this.needFefresh) { if (!this.needFefresh) {
@ -240,31 +234,6 @@ var util = context.util;var noDataPage = function noDataPage() {__webpack_requir
_that._loadParkingSpace(_owner); _that._loadParkingSpace(_owner);
}); });
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function onShareAppMessage() {},
methods: { methods: {
payFee: function payFee(_item) { payFee: function payFee(_item) {
uni.navigateTo({ uni.navigateTo({
@ -293,7 +262,6 @@ var util = context.util;var noDataPage = function noDataPage() {__webpack_requir
_that.parkingSpaces = _parkingSpaces; _that.parkingSpaces = _parkingSpaces;
if (_parkingSpaces.length == 0) { if (_parkingSpaces.length == 0) {
_that.noData = true; _that.noData = true;
return; return;
} }
_that.curParkingSpace = _parkingSpaces[0]; _that.curParkingSpace = _parkingSpaces[0];
@ -339,7 +307,6 @@ var util = context.util;var noDataPage = function noDataPage() {__webpack_requir
_fee.endTime = util.date.formatDate(_endTime); _fee.endTime = util.date.formatDate(_endTime);
_fee.num = _that.curParkingSpace.num; _fee.num = _that.curParkingSpace.num;
var _now = new Date(); var _now = new Date();
if (_endTime > _now) { if (_endTime > _now) {
_fee.feeStateName = '正常'; _fee.feeStateName = '正常';
} else { } else {