communitylist.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" mode="" class="background"></image>
  4. <view style="padding-top: 40rpx;">
  5. <view style="margin: 20rpx;">
  6. <u-search placeholder="请输入小区名称" v-model="nameValue" :action-style="{'font-size':'40rpx'}" :show-action="false" @search="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. uni.setNavigationBarTitle({
  36. title: '选择小区',
  37. });
  38. uni.setNavigationBarColor({
  39. frontColor: '#ffffff',
  40. backgroundColor: '#2d95f4',
  41. })
  42. },
  43. methods: {
  44. gotoindex(item){
  45. console.log(item)
  46. if(this.value==2)
  47. {
  48. uni.navigateTo({
  49. url:`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?community=${item.id}&communityName=${item.name}`
  50. })
  51. }else if(this.value==3)
  52. {
  53. uni.navigateTo({
  54. url:`/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?community=${item.id}&communityName=${item.name}`
  55. })
  56. }else
  57. {
  58. uni.navigateTo({
  59. url:`/pages/noLogin/buildinglist?value=${this.value}&community=${item.id}`
  60. })
  61. }
  62. },
  63. topage(url){
  64. uni.navigateTo({
  65. url
  66. })
  67. },
  68. getProjectList() {
  69. this.list=[]
  70. service.getArea({name:this.nameValue}).then(res=>{
  71. console.log('getProjectType', res)
  72. if(res.length == 0){
  73. this.$UTILS.showPrompt('暂无项目!')
  74. }
  75. this.list = res;
  76. })
  77. },
  78. getUserName(){
  79. service.getUserName().then(res=>{
  80. this.civilPower = res.civilPower;
  81. })
  82. },
  83. },
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .background {
  88. z-index: -1;
  89. position: fixed;
  90. width: 100%;
  91. height: 100%;
  92. background-size: 100% 100%;
  93. }
  94. .project {
  95. border-radius: 72rpx;
  96. padding: 25rpx 0;
  97. text-align: center;
  98. margin: 170rpx 55rpx 0;
  99. }
  100. .project-content {
  101. width: 90%;
  102. margin: 40rpx auto;
  103. padding: 30rpx 20rpx;
  104. border-radius: 20rpx;
  105. background: #edf5ff;
  106. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  107. }
  108. .houseList_in{
  109. display: flex;
  110. justify-content:space-between;
  111. align-items:center;
  112. color: #cbcbcb;
  113. font-size: 38rpx;
  114. }
  115. .houseList_in span{
  116. font-size: 36rpx;
  117. color: #333;
  118. }
  119. .position{
  120. position: absolute;
  121. bottom: 100rpx;
  122. right: 50rpx;
  123. .arrow{
  124. width: 152rpx;
  125. height: 152rpx;
  126. border-radius: 50%;
  127. padding: 25rpx;
  128. margin-left: 20rpx;
  129. }
  130. }
  131. // 小区列表
  132. </style>