communitylist.vue 3.0 KB

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