communitylist.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" mode="" class="background"></image>
  4. <view style="padding-top: 120rpx;">
  5. <view style="margin: 20rpx;">
  6. <u-search placeholder="请输入小区名称" v-model="nameValue" :action-style="{'font-size':'40rpx'}" @custom="getProjectList()"></u-search>
  7. </view>
  8. <view v-for="(item,index) in list" :key="index" >
  9. <view class="project-content houseList" @click="gotoindex(item)">
  10. <view class="font-forty-eight houseList_in">
  11. <span>{{item.name}}</span>
  12. <u-icon name="arrow-right"></u-icon>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import service from '@/api/index.js'
  21. export default {
  22. data() {
  23. return {
  24. list:[],
  25. value:'',
  26. nameValue:'',
  27. civilPower:''
  28. }
  29. },
  30. onLoad(e) {
  31. console.log(e)
  32. this.value = e.value
  33. this.getProjectList();
  34. this.getUserName();
  35. },
  36. methods: {
  37. gotoindex(item){
  38. console.log(item)
  39. if(this.value==2)
  40. {
  41. uni.navigateTo({
  42. url:`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?community=${item.id}&communityName=${item.name}`
  43. })
  44. }else if(this.value==3)
  45. {
  46. uni.navigateTo({
  47. url:`/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?community=${item.id}&communityName=${item.name}`
  48. })
  49. }else
  50. {
  51. uni.navigateTo({
  52. url:`/pages/noLogin/buildinglist?value=${this.value}&community=${item.id}`
  53. })
  54. }
  55. },
  56. topage(url){
  57. uni.navigateTo({
  58. url
  59. })
  60. },
  61. getProjectList() {
  62. service.getArea().then(res=>{
  63. console.log('getProjectType', res)
  64. if(res.length == 0){
  65. this.$UTILS.showPrompt('暂无项目!')
  66. }
  67. this.list = res;
  68. })
  69. },
  70. getUserName(){
  71. service.getUserName().then(res=>{
  72. this.civilPower = res.civilPower;
  73. })
  74. },
  75. },
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .background {
  80. z-index: -1;
  81. position: fixed;
  82. width: 100%;
  83. height: 100%;
  84. background-size: 100% 100%;
  85. }
  86. .project {
  87. border-radius: 72rpx;
  88. padding: 25rpx 0;
  89. text-align: center;
  90. margin: 170rpx 55rpx 0;
  91. }
  92. .project-content {
  93. width: 90%;
  94. margin: 40rpx auto;
  95. padding: 30rpx 20rpx;
  96. border-radius: 20rpx;
  97. background: #edf5ff;
  98. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  99. }
  100. .houseList_in{
  101. display: flex;
  102. justify-content:space-between;
  103. align-items:center;
  104. color: #cbcbcb;
  105. font-size: 38rpx;
  106. }
  107. .houseList_in span{
  108. font-size: 36rpx;
  109. color: #333;
  110. }
  111. .position{
  112. position: absolute;
  113. bottom: 100rpx;
  114. right: 50rpx;
  115. .arrow{
  116. width: 152rpx;
  117. height: 152rpx;
  118. border-radius: 50%;
  119. padding: 25rpx;
  120. margin-left: 20rpx;
  121. }
  122. }
  123. // 小区列表
  124. </style>