diff --git a/constant/UrlConstant.js b/constant/UrlConstant.js index 67fe852..15e7dee 100644 --- a/constant/UrlConstant.js +++ b/constant/UrlConstant.js @@ -83,6 +83,9 @@ const listActivitiess = baseUrl + "/app/activities.listActivitiess"; //查询小区广告 const listAdvertPhoto = baseUrl +"/app/advert.listAdvertPhoto"; +//查询报修单 +const listMyRepair = baseUrl + "/app/ownerRepair.listOwnerRepairs"; + module.exports = { baseUrl: baseUrl, @@ -114,5 +117,6 @@ module.exports = { listCommunitys: listCommunitys, listActivitiess: listActivitiess, filePath: filePath, - listAdvertPhoto: listAdvertPhoto + listAdvertPhoto: listAdvertPhoto, + listMyRepair: listMyRepair }; \ No newline at end of file diff --git a/pages/familyList/familyList.wxml b/pages/familyList/familyList.wxml index 3c42ac5..a6655de 100644 --- a/pages/familyList/familyList.wxml +++ b/pages/familyList/familyList.wxml @@ -28,8 +28,5 @@ button-text="添加成员" bind:submit="goAdd" > - - - \ No newline at end of file diff --git a/pages/myRepair/myRepair.js b/pages/myRepair/myRepair.js index 3e30d4d..6c6e227 100644 --- a/pages/myRepair/myRepair.js +++ b/pages/myRepair/myRepair.js @@ -1,17 +1,53 @@ // pages/myRepair/myRepair.js +const context = require('../../context/Java110Context.js'); +const factory = context.factory; +const constant = context.constant; Page({ /** * 页面的初始数据 */ data: { - + active:0, + ownerId:'', + roomId:'', + communityId:'', + waitRepair:[], + doingRepair:[], + repaired:[] }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + let that = this; + context.getRooms().then(function (res) { + let _owner = res.data.owner; + + let _rooms = res.data.rooms; + if(_rooms == null || _rooms == undefined || _rooms.length == 0){ + return ; + } + + let _roomId = ''; + + _rooms.forEach(function(_item){ + _roomId += (_item.roomId+','); + }); + + if(_roomId != ''){ + _roomId = _roomId.substring(0,_roomId.length-1); + } + + that.setData({ + communityId: _owner.communityId, + ownerId: _owner.memberId, + roomId: _roomId + }); + that._loadRepair(that.data.active); + }); + }, @@ -62,5 +98,72 @@ Page({ */ onShareAppMessage: function () { + }, + /** + * 加载我的报修 + */ + _loadRepair:function(_active){ + let that = this; + + let _state = ''; + if (_active == 0){ + _state = '1000'; + }else if(_active == 1){ + _state = '1100'; + }else{ + _state = '1200'; + } + + let _paramIn = { + "communityId": that.data.communityId, + "ownerId": that.data.ownerId, + "roomId":that.data.roomId, + "state":_state, + "page":1, + "row":10 + }; + context.request({ + url: constant.url.listMyRepair, + header: context.getHeaders(), + method: "GET", + data: _paramIn, + success: function (res) { + if (res.statusCode == 200) { + let _ownerRepairs = res.data.ownerRepairs; + if (_active == 0){ + that.setData({ + waitRepair: _ownerRepairs + }); + } else if (_active == 1){ + that.setData({ + doingRepair: _ownerRepairs + }); + }else{ + that.setData({ + repaired: _ownerRepairs + }); + } + return; + } + + wx.showToast({ + title: "查询报修单失败", + icon: 'none', + duration: 2000 + }); + }, + fail: function (e) { + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) + } + }) + }, + onChange:function(e){ + console.log(e); + + this._loadRepair(e.detail.index); } }) \ No newline at end of file diff --git a/pages/myRepair/myRepair.wxml b/pages/myRepair/myRepair.wxml index 9d6b727..c5a446d 100644 --- a/pages/myRepair/myRepair.wxml +++ b/pages/myRepair/myRepair.wxml @@ -1,9 +1,93 @@ - - 内容 1 - 内容 2 - 内容 3 - + + + + + + + 报修类型: + {{item.repairTypeName}} + + + 报修人: + {{item.repairName}} + + + 报修房间: + {{item.roomId}} + + + 预约时间: + {{item.appointmentTime }} + - + + 报修内容: + {{item.context}} + + + + + + + + + + + 报修类型: + {{item.repairTypeName}} + + + 报修人: + {{item.repairName}} + + + 报修房间: + {{item.roomId}} + + + 预约时间: + {{item.appointmentTime }} + + + + 报修内容: + {{item.context}} + + + + + + + + + + + 报修类型: + {{item.repairTypeName}} + + + 报修人: + {{item.repairName}} + + + 报修房间: + {{item.roomId}} + + + 预约时间: + {{item.appointmentTime }} + + + + 报修内容: + {{item.context}} + + + + + + + + \ No newline at end of file diff --git a/pages/myRepair/myRepair.wxss b/pages/myRepair/myRepair.wxss index becad45..e58f8e9 100644 --- a/pages/myRepair/myRepair.wxss +++ b/pages/myRepair/myRepair.wxss @@ -1 +1,31 @@ -/* pages/myRepair/myRepair.wxss */ \ No newline at end of file +.ppfl_c{ + padding: 0rpx 20rpx 0rpx 20rpx; + margin-top: 40rpx; +} + +.block__title { + margin: 0; + font-weight: 400; + font-size: 14px; + color: rgba(69,90,100,.6); + padding: 40rpx 30rpx 20rpx; +} + +.ppfl_context{ + padding: 20rpx 40rpx 40rpx 40rpx; + font-size: 28rpx; + color: #8a8a8a; +} + +.ppfl_context .ppfl_context_row{ + margin-top: 30rpx; +} + + +.button_up_blank{ + height: 40rpx; +} + +.block__bottom{ + height: 160rpx; +} \ No newline at end of file diff --git a/pages/repair/repair2.js b/pages/repair/repair2.js index a69e449..54c2fff 100644 --- a/pages/repair/repair2.js +++ b/pages/repair/repair2.js @@ -178,7 +178,6 @@ Page({ data:obj, //动态数据 success: function(res) { if (res.statusCode == 200) { - wx.redirectTo({ url: '/pages/myRepair/myRepair', }); @@ -189,6 +188,13 @@ Page({ icon: 'none', duration: 2000 }) + }, + fail:function(e){ + wx.showToast({ + title: "服务器异常了", + icon: 'none', + duration: 2000 + }) } }); diff --git a/pages/repair/repair2.wxml b/pages/repair/repair2.wxml index b7c02bd..6eee406 100644 --- a/pages/repair/repair2.wxml +++ b/pages/repair/repair2.wxml @@ -9,8 +9,8 @@ - - + +