communitylist.vue 2.2 KB

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