familyList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view :class="$isEmpty(user_list)?'empty-wrap':''">
  3. <view class="nav_section" v-if="user_list!=null && user_list.length!=0">
  4. <view v-for="(item, index) in user_list" :key="index" class="nav_list">
  5. <view class="nav_section_items">
  6. <view class="section_image" data-aid="undefined">
  7. <image v-if="item.imageUri" mode="aspectFill" :src="item.imageUri">
  8. </image>
  9. <image v-if="item.imageUri==null" mode="aspectFill" src="http://139.9.103.171:1888/img/image/head.png">
  10. </image>
  11. </view>
  12. <view class="section_cont" data-aid="undefined">
  13. <view class="section_cont_sub">
  14. <text>姓名:{{item.name}}</text>
  15. </view>
  16. <view class="section_cont_tel">
  17. <text>手机:{{item.tel}}</text>
  18. </view>
  19. <view class="section_cont_tel">
  20. <text v-if="item.type==0">身份:业主</text>
  21. <text v-else-if="item.type==1">身份:成员</text>
  22. <text v-else-if="item.type==2">身份:租客</text>
  23. <text v-else-if="item.type==3">身份:访客</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 1-业主 业主身份才能添加房屋成员 wx:if="{{relationship==1}}" -->
  30. <!-- <view class='submit_btn'>
  31. <navigator url='/pages/myHome/myHomeFamily/addMyHomeFamily/addMyHomeFamily?room_id={{room_id}}&relationship={{relationship}}'>
  32. <button class="ar_btn">添加成员</button>
  33. </navigator>
  34. </view> -->
  35. <view class="default" v-else>
  36. <image src="/static/common/empty.png" mode="heightFix"></image>
  37. <view>
  38. <text>没有获取到房屋成员信息</text>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. //获取app实例
  45. var app = getApp();
  46. export default {
  47. data() {
  48. return {
  49. user_list: null
  50. };
  51. },
  52. onLoad(options) {
  53. let room_id = options.room_id; //获取房间下的住户
  54. console.log(room_id)
  55. this.getUserByRoomId(room_id);
  56. },
  57. methods: {
  58. //获取房间下的住户
  59. getUserByRoomId: function (room_id) {
  60. let that = this;
  61. let params = {
  62. pageSize:200,
  63. pageNum:0,
  64. room_id:room_id
  65. };
  66. let operation = 'user/getUserByRoomId';
  67. app.globalData.postRequest(params, operation, function (res) {
  68. console.info("获取数据结构" + res.data.result_msg); //获取成功
  69. if (res.data.result_code == 1) {
  70. that.setData({
  71. user_list: res.data.list
  72. });
  73. }
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss">
  80. page {
  81. overflow-y: scroll;
  82. }
  83. .nav_section {
  84. width: 100%;
  85. padding-bottom: 120rpx;
  86. }
  87. .nav_list{
  88. margin-top: 2rpx;
  89. }
  90. .nav_section_items {
  91. display: flex;
  92. flex-direction: row;
  93. justify-content: space-between;
  94. padding: 30rpx;
  95. position: relative;
  96. background: #fff;
  97. }
  98. .nav_section_items .section_image {
  99. width: 120rpx;
  100. height: 120rpx;
  101. position: absolute;
  102. top: 50%;
  103. transform: translate(0, -50%);
  104. }
  105. .nav_section_items .identity {
  106. font-size: 24rpx;
  107. color: #d24a58;
  108. }
  109. .nav_section_items .section_image image {
  110. width: 100%;
  111. height: 100%;
  112. }
  113. .nav_section_items .section_cont {
  114. width: 400rpx;
  115. font-size: 24rpx;
  116. color: #666;
  117. margin-left: 140rpx;
  118. }
  119. .nav_section_items .section_cont view {
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. white-space: nowrap;
  123. display: block;
  124. }
  125. .nav_section_items .section_cont .section_cont_intro {
  126. white-space: normal;
  127. display: -webkit-box;
  128. -webkit-line-clamp: 2;
  129. -webkit-box-orient: vertical;
  130. }
  131. .nav_section_items .section_cont .section_cont_sub {
  132. font-size: 28rpx;
  133. line-height: 50rpx;
  134. color: #666;
  135. margin-bottom: 10rpx;
  136. }
  137. .nav_section_items .section_cont .section_cont_tel {
  138. font-size: 28rpx;
  139. color: #666;
  140. line-height: 50rpx;
  141. margin-bottom: 10rpx;
  142. }
  143. .nav_section_items .section_cont .section_cont_state {
  144. font-size: 28rpx;
  145. }
  146. .nav_section_items .section_edit {
  147. width: 80rpx;
  148. height: 40rpx;
  149. font-size: 26rpx;
  150. border-radius: 10rpx;
  151. background: #d24a58;
  152. line-height: 40rpx;
  153. color: #fff;
  154. text-align: center;
  155. position: absolute;
  156. top: 50%;
  157. right: 20rpx;
  158. transform: translate(0, -50%);
  159. }
  160. .building {
  161. height: 80rpx;
  162. line-height: 80rpx;
  163. background: #fff;
  164. padding: 0 20rpx;
  165. color: #333;
  166. border-bottom: 2rpx solid #ddd;
  167. }
  168. .building image {
  169. width: 40rpx;
  170. height: 40rpx;
  171. vertical-align: text-top;
  172. margin-right: 10rpx;
  173. }
  174. .figure{
  175. color: #d24a58;
  176. border:1px solid #d24a58;
  177. border-radius: 6rpx;
  178. font-size: 24rpx;
  179. padding: 0 6rpx;
  180. margin-left: 10rpx;
  181. }
  182. .figure.renter{
  183. color: $base-btn-color;
  184. border:1px solid $base-btn-color;
  185. }
  186. .default {
  187. text-align: center;
  188. position: fixed;
  189. left: 50%;
  190. top: 40%;
  191. transform: translate(-50%, -50%);
  192. }
  193. .default text{
  194. color: #AAAAAA;
  195. }
  196. .default image {
  197. height: 250rpx;
  198. display: inline-block;
  199. }
  200. .empty-wrap{
  201. background-color: #FFFFFF;
  202. min-height: 100vh;
  203. }
  204. </style>