buildinglist.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view>
  3. <image src="https://121.37.40.217/app/images/background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 90rpx;">
  5. <back></back>
  6. </view>
  7. <view style="padding-top: 60rpx;">
  8. <view style="margin: 20rpx;">
  9. <u-search placeholder="请输入楼宇名称" v-model="nameValue" :action-style="{'font-size':'40rpx'}" @custom="getProjectList()"></u-search>
  10. </view>
  11. <view v-for="(item,index) in list" :key="index" >
  12. <view class="project-content" @click="gotoindex(item)">
  13. <view>
  14. <view class="font-forty-eight blue">
  15. {{item.name}}<u-icon name="arrow-right"></u-icon>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import service from '@/api/index.js'
  26. export default {
  27. data() {
  28. return {
  29. list:[],
  30. value:'',
  31. nameValue:'',
  32. civilPower:'',
  33. community:''
  34. }
  35. },
  36. onLoad(e) {
  37. console.log(e)
  38. this.value = e.value
  39. this.community=e.community
  40. this.getProjectList();
  41. this.getUserName();
  42. },
  43. methods: {
  44. gotoindex(item){
  45. console.log(item)
  46. uni.navigateTo({
  47. url:`/pages/noLogin/unitlist?value=${this.value}&community=${item.id}&building=${item.id}&buildingName=${item.name}`
  48. })
  49. },
  50. topage(url){
  51. uni.navigateTo({
  52. url
  53. })
  54. },
  55. getProjectList() {
  56. service.getBuildingList({areaId:this.community}).then(res=>{
  57. console.log('getProjectType', res)
  58. if(res.length == 0){
  59. this.$UTILS.showPrompt('暂无项目!')
  60. }
  61. this.list = res;
  62. })
  63. },
  64. getUserName(){
  65. service.getUserName().then(res=>{
  66. this.civilPower = res.civilPower;
  67. })
  68. },
  69. },
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .background {
  74. z-index: -1;
  75. position: fixed;
  76. width: 100%;
  77. height: 100%;
  78. background-size: 100% 100%;
  79. }
  80. .project {
  81. border-radius: 72rpx;
  82. padding: 25rpx 0;
  83. text-align: center;
  84. margin: 170rpx 55rpx 0;
  85. }
  86. .project-content {
  87. border: 4rpx solid #3857F3;
  88. margin: 40rpx 55rpx 0;
  89. padding: 30rpx 20rpx;
  90. border-radius: 48rpx;
  91. }
  92. .position{
  93. position: absolute;
  94. bottom: 100rpx;
  95. right: 50rpx;
  96. .arrow{
  97. width: 152rpx;
  98. height: 152rpx;
  99. border-radius: 50%;
  100. padding: 25rpx;
  101. margin-left: 20rpx;
  102. }
  103. }
  104. </style>