myhome.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view :class="$isEmpty(room_list)?'empty-wrap':''">
  3. <view v-if="!$isEmpty(room_list)" style="padding-bottom: 90rpx;">
  4. <view class="data" v-for="(item, index) in room_list" :key="index">
  5. <view class="top">
  6. <view class="left">
  7. <u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
  8. <view class="title">{{item.residentialName}}</view>
  9. </view>
  10. </view>
  11. <view class="item">
  12. <view class="left">
  13. <view style="padding: 0 30rpx;">
  14. <view class="content">
  15. <text>楼栋信息:</text>
  16. <text >{{item.unitName}}</text>
  17. </view>
  18. <view class="content">
  19. <text>房间信息:</text>
  20. <text>{{item.name}}</text>
  21. </view>
  22. <view class="content">
  23. <text>身份:</text>
  24. <text v-if="item.relationshipType==0">业主</text>
  25. <text v-if="item.relationshipType==1">成员</text>
  26. <text v-if="item.relationshipType==2">租户</text>
  27. <text v-if="item.relationshipType==3">访客</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="bottom" >
  33. <view class="cu-btn sm round bg-red-btn" @click="jump(item.id)">
  34. 房屋成员
  35. </view>
  36. </view>
  37. </view>
  38. <view @tap="choosePlot" class="footer-fixed" >
  39. <view class="cu-btn flex text-lg bg-red-btn" style="padding: 46rpx 0;">
  40. 添加房屋认证
  41. </view>
  42. </view>
  43. </view>
  44. <view class="default" v-else>
  45. <image src="/static/common/empty.png" mode="heightFix"></image>
  46. <view>
  47. <text>没有获取到我的房屋信息</text>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. //获取app实例
  54. var app = getApp();
  55. export default {
  56. data() {
  57. return {
  58. room_list: null
  59. };
  60. },
  61. components: {},
  62. props: {},
  63. /**
  64. * 生命周期函数--监听页面加载
  65. */
  66. onLoad: function (options) {
  67. //获取房屋信息
  68. this.geRoomByMemberId();
  69. },
  70. methods: {
  71. jump(id){
  72. uni.navigateTo({
  73. url:"./familyList?room_id="+id
  74. })
  75. },
  76. //根据会员id获取我的房屋列表
  77. geRoomByMemberId: function () {
  78. let that = this;
  79. let params = {};
  80. params['member_id'] = app.globalData.member.id;
  81. params['pageSize'] = 200;
  82. let operation = 'estate/getRoomByMemberId';
  83. app.globalData.postRequest(params, operation, function (res) {
  84. console.info("获取成功" + res.data.result_msg); //获取成功
  85. if (res.data.result_code == 1) {
  86. let list = [];
  87. if (uni.getStorageSync('plotName')) {
  88. res.data.list.map(item => {
  89. if (item.residentialName == uni.getStorageSync('plotName')) {
  90. list.push(item);
  91. }
  92. });
  93. } else {
  94. list = res.data.list;
  95. }
  96. that.setData({
  97. room_list: list
  98. });
  99. app.globalData.room_list = list;
  100. }
  101. });
  102. },
  103. choosePlot() {
  104. if(!this.$isEmpty(app.globalData.totalStep)){
  105. app.globalData.totalStep=2
  106. }
  107. uni.navigateTo({
  108. url:"../auth/auth"
  109. })
  110. }
  111. }
  112. };
  113. </script>
  114. <style lang="scss">
  115. view,
  116. button
  117. {
  118. box-sizing: border-box;
  119. }
  120. .cu-btn.sm {
  121. padding: 0 24upx;
  122. font-size: 24upx;
  123. height: 52upx;
  124. }
  125. .data {
  126. width: 710rpx;
  127. background-color: #ffffff;
  128. margin: 20rpx auto;
  129. border-radius: 6rpx;
  130. box-sizing: border-box;
  131. padding: 20rpx;
  132. font-size: 28rpx;
  133. .top {
  134. display: flex;
  135. justify-content: space-between;
  136. .left {
  137. display: flex;
  138. align-items: center;
  139. .title {
  140. margin: 0 10rpx;
  141. font-size: 32rpx;
  142. font-weight: bold;
  143. }
  144. }
  145. }
  146. .item {
  147. margin: 40rpx 0 20rpx 0;
  148. .content {
  149. border-bottom: 1rpx dashed #DDDDDD;
  150. display: flex;
  151. justify-content: space-between;
  152. padding: 30rpx 0;
  153. }
  154. }
  155. .bottom {
  156. display: flex;
  157. margin-top: 30rpx;
  158. justify-content: flex-end;
  159. align-items: center;
  160. }
  161. }
  162. .default {
  163. text-align: center;
  164. position: fixed;
  165. left: 50%;
  166. top: 40%;
  167. transform: translate(-50%, -50%);
  168. }
  169. .default text{
  170. color: #AAAAAA;
  171. }
  172. .default image {
  173. height: 250rpx;
  174. display: inline-block;
  175. }
  176. .empty-wrap{
  177. background-color: #FFFFFF;
  178. min-height: 100vh;
  179. }
  180. </style>