myhome.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="">
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  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 class="right text-orange">
  11. <text v-if="item.relationshipType==0">业主</text>
  12. <text v-if="item.relationshipType==1">家属</text>
  13. <text v-if="item.relationshipType==2">租户</text>
  14. <text v-if="item.relationshipType==3">访客</text>
  15. </view>
  16. </view>
  17. <view class="item">
  18. <view class="left">
  19. <view style="padding: 0 30rpx;">
  20. <view class="content">
  21. <text>房屋信息:</text>
  22. <text >{{item.buildingName}},{{item.unitName}},{{item.name}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="bottom" >
  28. <view class="cu-btn sm round bg-red-btn" @click="jump(item.id)">
  29. 房屋成员
  30. </view>
  31. </view>
  32. </view>
  33. </mescroll-body>
  34. <view @tap="choosePlot" class="footer-fixed " >
  35. <view class="cu-btn flex text-lg bg-red-btn" style="padding: 46rpx 0;">
  36. 添加房屋认证
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. var app=getApp()
  43. import MescrollMixin from "@/comps/mescroll-body/mescroll-mixins.js";
  44. export default {
  45. mixins: [MescrollMixin], // 使用mixin
  46. name: '',
  47. data() {
  48. return {
  49. room_list:[],
  50. downOption:{
  51. auto:false,
  52. use:true
  53. },
  54. upOption:{
  55. auto:true,
  56. use:true,
  57. noMoreSize:5
  58. }
  59. };
  60. },
  61. onLoad() {
  62. },
  63. methods:{
  64. /**房屋成员
  65. * @param {Object} id
  66. */
  67. jump(id){
  68. uni.navigateTo({
  69. url:"./familyList?room_id="+id
  70. })
  71. },
  72. /**
  73. * 房屋认证
  74. */
  75. choosePlot() {
  76. if(!this.$isEmpty(getApp().globalData.totalStep)){
  77. getApp().globalData.totalStep=2
  78. }
  79. uni.navigateTo({
  80. url:"../auth/auth"
  81. })
  82. },
  83. /**
  84. * 下拉刷新回调
  85. * @param {Object} mescroll
  86. */
  87. downCallback(mescroll){
  88. setTimeout(()=>{
  89. uni.showToast({
  90. title:"刷新成功",
  91. icon:"none"
  92. })
  93. this.mescroll.resetUpScroll()
  94. },1500)
  95. },
  96. /**
  97. * 上拉加载回调
  98. */
  99. upCallback(mescroll){
  100. let that = this
  101. let parmas={
  102. id:getApp().globalData.member.id,
  103. residentialId:uni.getStorageSync('residentialId')
  104. }
  105. try{
  106. this.$http.getRoomByMemberId(parmas).then(res =>{
  107. if (!res.data.success) {
  108. mescroll.endErr()
  109. return
  110. }
  111. let data=res.data.data
  112. //不推荐
  113. mescroll.endSuccess(data.length)
  114. if(mescroll.num == 1) that.room_list = []
  115. that.room_list = that.room_list.concat(data)
  116. getApp().globalData.room_list = that.room_list
  117. })
  118. }catch(e){
  119. mescroll.endErr()
  120. }
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss">
  126. view,
  127. button
  128. {
  129. box-sizing: border-box;
  130. }
  131. .data {
  132. width: 710rpx;
  133. background-color: #ffffff;
  134. margin: 20rpx auto;
  135. border-radius: 6rpx;
  136. box-sizing: border-box;
  137. padding: 20rpx;
  138. font-size: 28rpx;
  139. .top {
  140. display: flex;
  141. justify-content: space-between;
  142. border-bottom: 1rpx dashed #DDDDDD;
  143. padding-bottom: 20rpx;
  144. .left {
  145. display: flex;
  146. align-items: center;
  147. .title {
  148. margin: 0 10rpx;
  149. font-size: 32rpx;
  150. font-weight: bold;
  151. }
  152. }
  153. }
  154. .item {
  155. margin: 40rpx 0 20rpx 0;
  156. .content {
  157. display: flex;
  158. justify-content: space-between;
  159. padding: 10rpx 0;
  160. }
  161. }
  162. .bottom {
  163. display: flex;
  164. margin-top: 20rpx;
  165. justify-content: flex-end;
  166. align-items: center;
  167. }
  168. }
  169. </style>