我的房屋

This commit is contained in:
his-uncles-father 2020-01-09 11:44:48 +08:00
parent c0605dcf52
commit c20f71a55e
11 changed files with 304 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{
"pages": [
"pages/index/index",
"pages/my/myHouse",
"pages/bindOwner/bindOwner",
"pages/viewBindOwner/viewBindOwner",
"pages/applicationKey/applicationKey",
@ -26,8 +27,8 @@
"pages/complaint/complaint",
"pages/viewComplaint/viewComplaint",
"pages/payParkingFeeList/payParkingFeeList",
"pages/payParkingFee/payParkingFee"
"pages/payParkingFee/payParkingFee",
"pages/my/myHouseDetail"
],
"window": {
"navigationBarTextStyle": "white",

View File

@ -62,5 +62,10 @@ Page({
},
onGotUserInfo: function (e) {
console.log("nickname=" + JSON.stringify(e.detail.userInfo));
},
myHouse() {
wx.navigateTo({
url: '../my/myHouse',
})
}
})

View File

@ -49,6 +49,13 @@
</view>
<view class="tab-arrow"></view>
</view>
<view class="tab-item border-bottom" hover-class="tab-item-hover" catchtap="myHouse">
<view>
<text class="iconfont iconaccount icon"></text>
<text class="tab-text">我的房屋</text>
</view>
<view class="tab-arrow"></view>
</view>
<!-- <view class="tab-item" hover-class="tab-item-hover" catchtap="goMyBooks">
<view>

92
pages/my/myHouse.js Normal file
View File

@ -0,0 +1,92 @@
// pages/my/myHouse.js
const context = require('../../context/Java110Context.js');
const constant = context.constant;
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.loadOwnerHouse();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
myHouseDetail: function(e) {
var roomDetail = e.currentTarget.dataset.item;
wx.setStorageSync('roomDetail',roomDetail);
wx.navigateTo({
url: '../my/myHouseDetail',
})
},
/**
* 加载业主房屋信息
*/
loadOwnerHouse:function(){
let _that = this;
context.getRooms().then(res=>{
if(res){
_that.setData({
rooms: res.data.rooms
});
}
})
}
})

5
pages/my/myHouse.json Normal file
View File

@ -0,0 +1,5 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的房屋",
"enablePullDownRefresh": true
}

17
pages/my/myHouse.wxml Normal file
View File

@ -0,0 +1,17 @@
<view class="tab-container bg-white">
<view wx:if="{{rooms.length > 0}}" wx:for="{{rooms}}" wx:key="key" wx:for-item="item" data-item="{{item}}" class="tab-item border-bottom" hover-class="tab-item-hover" catchtap="myHouseDetail">
<view>
<text class="iconfont iconaccount icon"></text>
<text class="tab-text" > {{item.floorNum}}# {{item.unitNum}}单元{{item.roomNum}}</text>
</view>
<view class="tab-arrow"></view>
</view>
<view wx:if="{{rooms.length === 0}}" class="tab-item border-bottom" hover-class="tab-item-hover" catchtap="">
<view>
<text class="iconfont iconemail icon"></text>
<text class="tab-text">暂无房屋信息</text>
</view>
</view>
</view>

47
pages/my/myHouse.wxss Normal file
View File

@ -0,0 +1,47 @@
.tab-container {
/*border: 1px solid black;*/
margin-top: 30rpx;
}
.tab-item {
padding: 20rpx 30rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.tab-item-hover {
background-color: #e6e6e6;
}
.tab-icon {
width: 30rpx;
height: 30rpx;
}
.tab-text {
display: inline-block;
margin-left: 10rpx;
color: #1e1e1e;
}
.tab-arrow {
display: inline-block;
width: 20rpx;
height: 20rpx;
border: 1px solid #cdcdcd;
border-left: none;
border-bottom: none;
transform: rotate(45deg);
}
.border-bottom .icon{
font-size: 38rpx;
line-height: 38rpx;
}

97
pages/my/myHouseDetail.js Normal file
View File

@ -0,0 +1,97 @@
// pages/my/myHouseDetail.js
const context = require('../../context/Java110Context.js');
const factory = context.factory;
Page({
/**
* 页面的初始数据
*/
data: {
ownerInfo: {}, // 用户信息
userInfo: {}, // 用户信息
ownerFlag: false, // 是否有业主信息 标记 如果有为 true 没有为false
roomDetail:{}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let _that = this;
factory.login.checkLoginStatus(function() {
_that.setData({
userInfo: context.getUserInfo(),
roomDetail:wx.getStorageSync('roomDetail')
});
});
//查询用户信息
_that.loadOwenrInfo();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
loadOwenrInfo: function() {
let _that = this;
context.getOwner(function(_ownerInfo) {
console.log(_ownerInfo);
if (_ownerInfo) {
_that.setData({
ownerFlag: true,
ownerInfo: _ownerInfo
})
} else {
_that.setData({
ownerFlag: false
})
}
});
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的房屋明细"
}

View File

@ -0,0 +1,26 @@
<view>
<view class="block__title">业主信息</view>
<van-cell-group>
<van-cell title="业主ID" value="{{ownerInfo.memberId}}"/>
<van-cell title="名称" value="{{ownerInfo.appUserName}}" />
<van-cell title="身份证" value="{{ownerInfo.idCard}}" />
<van-cell title="联系方式" value="{{ownerInfo.link}}" />
<van-cell title="年龄" value="{{userInfo.age}}" />
<van-cell title="性别" value="{{userInfo.sex == '0' ? '女' : '男'}}" />
</van-cell-group>
<view class="block__title">房屋信息</view>
<van-cell-group>
<van-cell title="房屋ID" value="{{roomDetail.roomId}}" />
<van-cell title="房屋编号" value="{{roomDetail.roomNum}}" />
<van-cell title="单元" value="{{roomDetail.unitNum}}" />
<van-cell title="楼层" value="{{roomDetail.layer+'层'}}" />
<van-cell title="房间数" value="{{roomDetail.section}}" />
<van-cell title="户型" value="{{roomDetail.apartment}}" />
<van-cell title="建筑面积" value="{{roomDetail.builtUpArea+'平方米'}}" />
<van-cell title="单价" value="{{roomDetail.unitPrice+'元/平方米'}}" />
</van-cell-group>
<view class="button_up_blank"></view>
</view>

View File

@ -0,0 +1 @@
/* pages/my/myHouseDetail.wxss */