index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="house" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#272727" left-icon="left" @clickLeft="getBackFn" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. </uni-nav-bar>
  6. </view>
  7. <view class="houtop">
  8. <!-- 有 -->
  9. <view class="flexc mb10" v-if="list.length">
  10. <view class="tit">嗨,袁玥!</view>
  11. <view class="tita flexcc">户主</view>
  12. <view class="flex1"></view>
  13. <view class="tbtns flex0 flexc" @click="getListFn">家庭成员
  14. <image :src="more"></image>
  15. </view>
  16. </view>
  17. <!-- 无 -->
  18. <block v-else>
  19. <view class="flexc mb10">
  20. <view class="tit">我的房屋</view>
  21. </view>
  22. <view class="txt mb10 fw5">您还未添加房屋信息喔~</view>
  23. </block>
  24. <view class="txt">Welcome back home</view>
  25. <image :src="housebg" class="houseimg"></image>
  26. </view>
  27. <view class="housebox" v-if="list.length">
  28. <view class="hblist">
  29. <view class="laber"><text>房屋坐落</text>:</view>
  30. <view class="tit">幸福大街88号幸福小区12#1101室</view>
  31. <image :src="adrs" class="adrs"></image>
  32. </view>
  33. <view class="flexc">
  34. <view class="hblist w50">
  35. <view class="laber"><text>房屋所属</text>:</view>
  36. <view class="tit">袁玥</view>
  37. </view>
  38. <view class="hblist w50">
  39. <view class="laber"><text>建筑面积</text>:</view>
  40. <view class="tit">121.3m²</view>
  41. </view>
  42. </view>
  43. <view class="flexc">
  44. <view class="hblist w50">
  45. <view class="laber"><text>房型</text>:</view>
  46. <view class="tit">3室1厅</view>
  47. </view>
  48. <view class="hblist w50">
  49. <view class="laber"><text>居住人口</text>:</view>
  50. <view class="tit">3口人</view>
  51. </view>
  52. </view>
  53. <view class="flexc">
  54. <view class="hblist w50">
  55. <view class="laber"><text>有无车位</text>:</view>
  56. <view class="tit">有</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="hbtns bga mb18" v-if="list.length">修改信息</view>
  61. <view class="hbtns bgb" :class="list.length?'':'mt110'" @click="getAddFn">添加房屋</view>
  62. <loading></loading>
  63. </view>
  64. </template>
  65. <script>
  66. import config from '@/config'
  67. const baseUrl = config.baseUrl
  68. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  69. export default{
  70. components:{},
  71. data(){
  72. return{
  73. housebg:require('@/mine/static/house/house.png'),
  74. more:require("@/work/static/visitor/more.png"),
  75. adrs:require('@/mine/static/house/adrs.png'),
  76. backgroundColor: "transparent",
  77. nvaHeight:44,
  78. list:[{tit:'123'}],
  79. pageSize: 10,
  80. pageNum: 1,
  81. reachflag: true,
  82. wtdt:'',
  83. }
  84. },
  85. onLoad: function() {
  86. uni.getSystemInfo({
  87. success: (e) => {
  88. this.nvaHeight = Number(e.statusBarHeight)+44;
  89. }
  90. })
  91. },
  92. onPageScroll(e) {
  93. var scrollTop = Number(e.scrollTop);
  94. if (scrollTop > 0) {
  95. this.backgroundColor = '#CCDDFF'
  96. } else {
  97. this.backgroundColor = 'transparent'
  98. }
  99. },
  100. methods:{
  101. checkPermi, checkRole,
  102. getAddFn(){
  103. this.$tab.navigateTo("/mine/pages/house/addhouse")
  104. },
  105. getBackFn(){
  106. uni.navigateBack({
  107. delta:1
  108. })
  109. },
  110. getDataFn(){
  111. return
  112. var params={
  113. pageSize:this.pageSize,
  114. pageNum: this.pageNum,
  115. }
  116. params.noticeType=this.tabidx
  117. getNoticeList(params).then(res=>{
  118. if(res.code==200){
  119. }else{
  120. this.$toast(res.msg)
  121. }
  122. })
  123. },
  124. }
  125. }
  126. </script>
  127. <style>
  128. page{background: #F3F3F0;}
  129. </style>
  130. <style lang="scss" scoped>
  131. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  132. .house{min-height: 100vh;background: linear-gradient(180deg, #CDDDFF 0%, rgba(255,255,255,0) 100%) no-repeat;background-size: 100% 578rpx;padding: 0 54rpx 100rpx;
  133. .houtop{padding: 20rpx 4rpx 0 4rpx;height:520rpx;box-sizing: border-box;margin-bottom: 50rpx;position: relative;
  134. .tit{font-size: 36rpx;font-weight: bold;color: #272727;}
  135. .txt{font-size: 26rpx;color: #272727;}
  136. .tita{min-width: 86rpx;font-weight: 500;margin-left: 26rpx;font-size: 24rpx;color: #0156FE;height: 36rpx;border-radius: 18rpx;border: 2rpx solid #0156FE;}
  137. .houseimg{width: 596rpx;height:204rpx;position: absolute;bottom: 0;right: -58rpx;}
  138. .tbtns{font-weight: 500;font-size: 26rpx;color: #0256FD;
  139. image{width: 20rpx;height: 16rpx;margin-left: 10rpx;}
  140. }
  141. }
  142. .housebox{width: 100%;background: #FFFFFF;border-radius: 20rpx;padding: 36rpx 24rpx 16rpx;box-sizing: border-box;margin-bottom: 100rpx;
  143. .hblist{display: flex;margin-bottom: 20rpx;
  144. .laber{font-weight: 500;font-size: 26rpx;color: #666666;flex: 0 0 auto;
  145. text{min-width: 104rpx;text-align-last: justify;display: inline-block;}
  146. }
  147. .tit{color: #272727;font-weight: 500;font-size: 26rpx;}
  148. .adrs{width: 20rpx;height: 22rpx;margin-left: 16rpx;flex: 0 0 auto;margin-top: 6rpx;}
  149. }
  150. }
  151. .hbtns{font-weight: bold;display: flex;align-items: center;justify-content: center;font-size: 26rpx;height: 88rpx;border-radius: 44rpx;box-sizing: border-box;
  152. &.bga{border: 1px solid #0256FD;color: #0256FD;background: #CADBFF;}
  153. &.bgb{border: 1px solid #45CB99;color: #45CB99;background: #DBF8ED;}
  154. }
  155. }
  156. </style>