index.vue 4.8 KB

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