This commit is contained in:
unknown 2020-01-17 17:56:55 +08:00
parent b2a16072d6
commit 579f689dc0
5 changed files with 184 additions and 124 deletions

View File

@ -64,6 +64,9 @@ const queryParkingSpacesByOwner = baseUrl+"app/parkingSpace.queryParkingSpacesBy
//查询停车位费用
const queryFeeByParkingSpace = baseUrl+"app/fee.queryFeeByParkingSpace";
//查询物业费用
const queryFeeByOwner = baseUrl + "app/fee.queryFee";
//预下单
const preOrder = baseUrl +"/app/payment/toPay";
@ -94,6 +97,7 @@ module.exports = {
queryRoomsByOwner: queryRoomsByOwner,
queryParkingSpacesByOwner: queryParkingSpacesByOwner,
queryFeeByParkingSpace: queryFeeByParkingSpace,
queryFeeByOwner: queryFeeByOwner,
preOrder: preOrder,
listCommunitys: listCommunitys
};

View File

@ -2,120 +2,180 @@ const context = require('../../context/Java110Context.js');
const constant = context.constant;
// Page({
// data: {
// items: [
// { name: "商品A",fee: 20},
// { name: "商品B",fee: 30 }
// ]
// }
// })
Page({
data: {
tableData: [{
"fee_type_cd ": "物业费",
"community_id": "双流小区",
"start_time": "2019-10",
"end_time": "2019-12",
"amount": "200"
}, {
"fee_type_cd ": "停车费",
"community_id": "双流小区",
"start_time": "2019-06",
"end_time": "2019-07",
"amount": "20"
}, {
"fee_type_cd ": "物业费",
"community_id": "山上小区",
"start_time": "2019-09",
"end_time": "2019-11",
"amount": "100"
}],
rooms: [],
page: 1,
totalPage: 0,
loading: false
},
onLoad: function () {
this.getTable(1);
},
// onLoad: function () {
// this.getTable(1);
// },
onShow: function () {
let that = this;
},
getTable: function (page, override) {
console.log(888888888);
let that = this;
// onShow: function () {
// let that = this;
// },
// getTable: function (page, override) {
// console.log(888888888);
// let that = this;
// this.setData({
// loading: true
// })
// return this.request({
// storeTypeCd: '800900000003',
// storeId: '402019032924930007',
// userName: 'wuxw',
// userId: '30518940136629616640',
// complaintId: '111',
// typeCd: '809002',
// complaintName: '111',
// page: '1',
// row: '10',
// communityId: '7020181217000001'
// // "page": page,
// // "row": 10
// }).then(res => {
// console.log(res, 9999999999999)
// that.setData({
// tableData: override ? res.data.complaints : this.data.tableData.concat(res.data.complaints),
// totalPage: res.data.records,
// page: page,
// loading: false
// })
// })
// },
// goAdd: function (e) {
// wx.navigateTo({
// url: "/pages/complaint/complaint"
// })
// },
// gotoDetail: function (e) {
// wx.navigateTo({
// url: "/pages/repairList/detail/detail?item=" + JSON.stringify(e.currentTarget.dataset.item)
// })
// },
// onPullDownRefresh: function () {
// // 上拉刷新
// if (!this.data.loading) {
// this.getTable(1, true).then(() => {
// // 处理完成后,终止下拉刷新
// wx.stopPullDownRefresh()
// })
// }
// },
// onReachBottom: function () {
// console.log(1, !this.data.loading, this.data.page < this.data.totalPage);
// // 下拉触底,先判断是否有请求正在进行中
// // 以及检查当前请求页数是不是小于数据总页数,如符合条件,则发送请求
// if (!this.data.loading && this.data.page < this.data.totalPage) {
// this.getTable(this.data.page + 1)
// }
// },
// //封装请求
// request: function (data) {
// return new Promise((resolve, reject) => {
// wx.request({
// url: constant.url.listComplaints,
// header: context.getHeaders(),
// method: "GET",
// data: data,
// success: function (res) {
// if (res.statusCode == 200) {
// resolve(res);
// }
// },
// fail: function (req) {
// console.log(constant.url.listComplaints, req);
// }
// })
// })
// },
onLoad: function () {
this.loadOwnerHouse(1);
let _communityInfo = context.getCurrentCommunity();
this.setData({
loading: true
})
return this.request({
storeTypeCd: '800900000003',
storeId: '402019032924930007',
userName: 'wuxw',
userId: '30518940136629616640',
complaintId: '111',
typeCd: '809002',
complaintName: '111',
page: '1',
row: '10',
communityId: '7020181217000001'
// "page": page,
// "row": 10
}).then(res => {
console.log(res, 9999999999999)
that.setData({
tableData: override ? res.data.complaints : this.data.tableData.concat(res.data.complaints),
totalPage: res.data.records,
page: page,
loading: false
})
})
communityId: _communityInfo.communityId,
communityName: _communityInfo.communityName
});
},
goAdd: function (e) {
wx.navigateTo({
url: "/pages/complaint/complaint"
})
},
gotoDetail: function (e) {
wx.navigateTo({
url: "/pages/repairList/detail/detail?item=" + JSON.stringify(e.currentTarget.dataset.item)
})
},
onPullDownRefresh: function () {
// 上拉刷新
if (!this.data.loading) {
this.getTable(1, true).then(() => {
// 处理完成后,终止下拉刷新
wx.stopPullDownRefresh()
})
}
},
onReachBottom: function () {
console.log(1, !this.data.loading, this.data.page < this.data.totalPage);
// 下拉触底,先判断是否有请求正在进行中
// 以及检查当前请求页数是不是小于数据总页数,如符合条件,则发送请求
if (!this.data.loading && this.data.page < this.data.totalPage) {
this.getTable(this.data.page + 1)
}
},
//封装请求
request: function (data) {
return new Promise((resolve, reject) => {
wx.request({
url: constant.url.listComplaints,
header: context.getHeaders(),
method: "GET",
data: data,
success: function (res) {
if (res.statusCode == 200) {
resolve(res);
}
},
fail: function (req) {
console.log(constant.url.listComplaints, req);
/**
* 加载业主房屋信息
*/
loadOwnerHouse: function () {
let _that = this;
context.getRooms().then(res => {
if (res) {
console.log("res=",res);
let _room = res.data.rooms;
let _owner = res.data.owner;
if (_room.length == 0) {
wx.showToast({
title: "未查询到房间",
icon: 'none',
duration: 2000
});
return;
}
})
for (let _psIndex = 0; _psIndex < _room.length; _psIndex++) {
_that._loadParkingSpaceFee(_owner,_room[_psIndex], function (_fee) {
let _tmpEndTime = _fee.endTime.replace(/\-/g, "/")
let _endTime = new Date(_tmpEndTime);
_parkingSpaces[_psIndex].endTime = util.date.formatDate(_endTime);
let _now = new Date();
if (_endTime > _now) {
_parkingSpaces[_psIndex].feeStateName = '正常'
} else {
_parkingSpaces[_psIndex].feeStateName = '欠费'
}
_parkingSpaces[_psIndex].additionalAmount = _fee.additionalAmount;
_parkingSpaces[_psIndex].feeId = _fee.feeId;
_that.setData({
parkingSpaces: _parkingSpaces
});
});
}
_that.setData({
rooms: res.data.rooms
});
}
})
},
_loadParkingSpaceFee: function (_owner,_room, callBack) {
let _that = this;
let _objData = {
page: 1,
row: 10,
roomId: _room.roomId,
communityId: _owner.communityId
}
context.request({
url: constant.url.queryFeeByOwner,
header: context.getHeaders(),
method: "GET",
data: _objData, //动态数据
success: function (res) {
console.log(res);
if (res.statusCode == 200) {
//成功情况下跳转
let _roomFee = res.data;
callBack(_roomFee);
}
},
fail: function (e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
});
}
})

View File

@ -1,20 +1,18 @@
<!-- <view>
<block wx:for="{{items}}" wx:for-item="item" wx:key="index">
<view>{{index}}:{{item.name}}:{{item.fee}}</view>
</block>
</view> -->
<view class="user-container">
<view wx:for="{{tableData}}" wx:for-index="idx" wx:for-item="item" class="notice" data-item="{{item}}" bindtap="gotoDetail">
<view wx:for="{{rooms}}" wx:for-index="idx" wx:for-item="item" class="notice" data-item="{{item}}" bindtap="gotoDetail">
<view class="title">
<view>{{item.fee_type_cd}}</view>
</view>
<view class="main">
<view>
<view class="text"> 小区ID: {{item.community_id}}</view>
<view class="text"> 开始时间: {{item.start_time}}</view>
<view class="text"> 结束时间: {{item.end_time}}</view>
<view class="text"> 总金额: {{item.amount}}</view>
<view class="text"> 小区名字: {{communityName}}</view>
<view class="text"> 小区ID: {{communityId}}</view>
<view class="text"> 房间ID: {{item.roomId}}</view>
<view class="text"> 房间号: {{item.roomNum}}</view>
<view class="text"> 单元ID: {{item.unitId}}</view>
<view class="text"> 总金额: {{item.amount}}</view>
</view>
<text>{{}}</text>
<view>
<button class="button" size="mini" type="default" catchtap="gotoDetail" data-item="{{item}}">付款</button>
<button class="button" size="mini" type="default" catchtap="gotoDetail" data-item="{{item}}">反馈</button>

View File

@ -4,8 +4,6 @@
/*border: 1px solid black;*/
}
.add_button{
}
.notice {
margin: 10rpx 7rpx;
padding: 25rpx;

View File

@ -1,13 +1,13 @@
{
"description": "项目配置文件。",
"packOptions": {
"ignore": [
{
"type": "folder",
"value": "readme"
}
]
},
"packOptions": {
"ignore": [
{
"type": "folder",
"value": "readme"
}
]
},
"setting": {
"urlCheck": false,
"es6": true,