diff --git a/.gitignore b/.gitignore index b7d7578..8e8c264 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ ### NetBeans ### -unpackage/ \ No newline at end of file +unpackage/ +.idea \ No newline at end of file diff --git a/api/applyRoom/applyRoomApi.js b/api/applyRoom/applyRoomApi.js new file mode 100644 index 0000000..08c4761 --- /dev/null +++ b/api/applyRoom/applyRoomApi.js @@ -0,0 +1,65 @@ +/** + * 申请房信息处理 api 接口类 + * + * add by 吴学文 QQ 928255095 + */ + + +import { + request +} from '../java110Request.js' +import +url +from '../../constant/url.js' + +/** + * 查询优惠类型 + */ +export function queryApplyRoomDiscountType(_data) { + return new Promise((resolve, reject) => { + request({ + url: url.queryApplyRoomDiscountType, + method: "GET", + data: _data, + success: function(res) { + + let data = res.data; + if (data.code == 0) { + resolve(data.data); + } else { + reject(data.msg); + } + }, + fail: function(res) { + reject(res); + } + }); + }) +} + +/** + * 提交申请 + * @param {Object} _data 查询 入参 + */ +export function saveApplyRoomDiscount(_data) { + return new Promise((resolve, reject) => { + request({ + url: url.saveApplyRoomDiscount, + method: "POST", + data: _data, + success: function(res) { + let data = res.data; + if (data.code == 0) { + resolve(); + } else { + uni.showToast({ + title: data.msg + }) + } + }, + fail: function(res) { + reject(res); + } + }); + }) +} \ No newline at end of file diff --git a/api/index/indexApi.js b/api/index/indexApi.js index b44b5c3..ab30f1d 100644 --- a/api/index/indexApi.js +++ b/api/index/indexApi.js @@ -89,6 +89,11 @@ export function getCategoryList() { name: "车位申请", src: "/static/images/index_parking.png", href: "/pages/applyparking/applyparking" + }, + { + name: "空置房", + src: "/static/images/index_openDoor.png", + href: "/pages/applyRoom/applyRoom" } ] }; diff --git a/components/vc-discount/vc-discount.vue b/components/vc-discount/vc-discount.vue index a5e85eb..60ff4b1 100644 --- a/components/vc-discount/vc-discount.vue +++ b/components/vc-discount/vc-discount.vue @@ -41,6 +41,18 @@ cycles: { type: String, default: 1 + }, + payerObjType: { + type: String, + default: '' + }, + payerObjId: { + type: String, + default: '' + }, + endTime: { + type: String, + default: '' } }, computed: {}, @@ -52,7 +64,10 @@ row: 20, feeId: _feeId, communityId: _communityId, - cycles: _feeMonth + cycles: _feeMonth, + payerObjType: this.payerObjType, + payerObjId: this.payerObjId, + endTime: this.endTime }).then((data) => { _that.discounts = data; diff --git a/constant/url.js b/constant/url.js index 0095b7b..3e85881 100644 --- a/constant/url.js +++ b/constant/url.js @@ -102,6 +102,9 @@ export default { goodsUnifieldOrder: baseUrl + 'goods/unifieldOrder', deleteOwner: baseUrl + "/app/owner.deleteOwner", computeFeeDiscount: baseUrl + "/app/feeDiscount/computeFeeDiscount", + // 查询申请类型(空置房) + queryApplyRoomDiscountType: baseUrl + "app/applyRoomDiscount/queryApplyRoomDiscountType", + saveApplyRoomDiscount: baseUrl + "app/applyRoomDiscount/saveApplyRoomDiscount", openDoor:baseUrl + "/app/machine/openDoor", NEED_NOT_LOGIN_PAGE: [ diff --git a/pages.json b/pages.json index 8e5e649..b8a4d86 100644 --- a/pages.json +++ b/pages.json @@ -398,7 +398,25 @@ "enablePullDownRefresh": false } - } + }, + { + "path" : "pages/applyRoom/applyRoom", + "style" : + { + "navigationBarTitleText": "选择房屋", + "enablePullDownRefresh": false + } + + } + ,{ + "path" : "pages/applyRoomDetail/applyRoomDetail", + "style" : + { + "navigationBarTitleText": "空置房申请", + "enablePullDownRefresh": false + } + + } ], "tabBar": { "color": "#272636", diff --git a/pages/applyRoom/applyRoom.vue b/pages/applyRoom/applyRoom.vue new file mode 100644 index 0000000..b6a2475 --- /dev/null +++ b/pages/applyRoom/applyRoom.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/pages/applyRoomDetail/applyRoomDetail.vue b/pages/applyRoomDetail/applyRoomDetail.vue new file mode 100644 index 0000000..661e04d --- /dev/null +++ b/pages/applyRoomDetail/applyRoomDetail.vue @@ -0,0 +1,293 @@ + + + + + diff --git a/pages/roomFee/roomFee.vue b/pages/roomFee/roomFee.vue index b3e9889..8b5ec94 100644 --- a/pages/roomFee/roomFee.vue +++ b/pages/roomFee/roomFee.vue @@ -74,7 +74,7 @@ {{endTime }} - + @@ -117,7 +117,7 @@ import {getPayInfo} from '../../factory/WexinAppPayFactory.js' // #endif - import {addMonth,formatDate} from '../../utils/DateUtil.js' + import {addMonth,formatDate,date2String} from '../../utils/DateUtil.js' export default { components:{ vcDiscount @@ -136,11 +136,13 @@ feeMonth: 1, endTime: '', ordEndTime: '', + formatEndTime: '', amount: 0, receivableAmount: 0.00, communityId: '', communityName: '', feeId: '', + roomId: '', floorNum: '', unitNum: '', roomNum: '', @@ -177,12 +179,14 @@ this.floorNum = _fee.floorNum; this.unitNum = _fee.unitNum; this.roomNum = _fee.roomNum; + this.roomId = _fee.roomId; this.layer = _fee.layer; this.builtUpArea = _fee.builtUpArea; this.feeId = _fee.feeId; this.amount = _amount; this.additionalAmount = _fee.additionalAmount; this.ordEndTime = _fee.endTime; + this.formatEndTime = date2String(_fee.endTime); this.feeFlag = _fee.feeFlag; if(this.feeFlag == '2006012'){ return; @@ -196,7 +200,10 @@ let _endTime = addMonth(_lastDate, parseInt(this.feeMonth)); this.endTime = formatDate(_endTime); - this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth); + // this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth); + this.$nextTick(() => { + this.$refs.vcDiscountRef._loadFeeDiscount(this.feeId,this.communityId,this.feeMonth); + }) }, methods: { computeFeeDiscount:function(_price){ @@ -318,7 +325,11 @@ feeName: '物业费', receivedAmount: _receivedAmount, tradeType: _tradeType, - appId: this.appId + appId: this.appId, + payerObjId: this.roomId, + payerObjType: 3333, + endTime: this.formatEndTime + }; context.request({ url: constant.url.preOrder, diff --git a/utils/DateUtil.js b/utils/DateUtil.js index 908d2e6..963b531 100644 --- a/utils/DateUtil.js +++ b/utils/DateUtil.js @@ -114,6 +114,36 @@ export function getDateYYYYMMDDHHMISS() { return year + "" + month + "" + day + "" + hour + "" + minute + "" + second; }; +/** + * 日期转化为字符串‘Y-m-d H:i:s’ + * @param {Object} _date + */ +export function date2String(_date){ + let date = new Date(_date); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + let hour = date.getHours(); + let minute = date.getMinutes(); + let second = date.getSeconds(); + if (month < 10) { + month = '0' + month; + } + if (day < 10) { + day = '0' + day; + } + if (hour < 10) { + hour = '0' + hour; + } + if (minute < 10) { + minute = '0' + minute; + } + if (second < 10) { + second = '0' + second; + } + return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second; +}; + /** * @description 当前时间加 指定年 * @param {Object} _date 指定时间 @@ -211,4 +241,19 @@ export function addSeconds(_date, _second) { let s = _date.getSeconds() + _second; //获取秒 let newDate = new Date(year, mon, da, h, m, s); return newDate; +} + +/** + * 对比时间 + * @param {Object} date1 + * @param {Object} date2 + */ +export function compareDate(date1,date2){ + var oDate1 = new Date(date1); + var oDate2 = new Date(date2); + if(oDate1.getTime() > oDate2.getTime()){ + return true; //第一个大 + } else { + return false; //第二个大 + } } \ No newline at end of file