communitylist.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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'}" :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. service.getArea().then(res=>{
  70. console.log('getProjectType', res)
  71. if(res.length == 0){
  72. this.$UTILS.showPrompt('暂无项目!')
  73. }
  74. this.list = res;
  75. })
  76. },
  77. getUserName(){
  78. service.getUserName().then(res=>{
  79. this.civilPower = res.civilPower;
  80. })
  81. },
  82. },
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .background {
  87. z-index: -1;
  88. position: fixed;
  89. width: 100%;
  90. height: 100%;
  91. background-size: 100% 100%;
  92. }
  93. .project {
  94. border-radius: 72rpx;
  95. padding: 25rpx 0;
  96. text-align: center;
  97. margin: 170rpx 55rpx 0;
  98. }
  99. .project-content {
  100. width: 90%;
  101. margin: 40rpx auto;
  102. padding: 30rpx 20rpx;
  103. border-radius: 20rpx;
  104. background: #edf5ff;
  105. box-shadow: 0rpx 6rpx 8rpx #d3e6ff;
  106. }
  107. .houseList_in{
  108. display: flex;
  109. justify-content:space-between;
  110. align-items:center;
  111. color: #cbcbcb;
  112. font-size: 38rpx;
  113. }
  114. .houseList_in span{
  115. font-size: 36rpx;
  116. color: #333;
  117. }
  118. .position{
  119. position: absolute;
  120. bottom: 100rpx;
  121. right: 50rpx;
  122. .arrow{
  123. width: 152rpx;
  124. height: 152rpx;
  125. border-radius: 50%;
  126. padding: 25rpx;
  127. margin-left: 20rpx;
  128. }
  129. }
  130. // 小区列表
  131. </style>