communitylist.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 if(this.value==3)
  47. {
  48. uni.navigateTo({
  49. url:`/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?community=${item.id}&communityName=${item.name}`
  50. })
  51. }else
  52. {
  53. uni.navigateTo({
  54. url:`/pages/noLogin/buildinglist?value=${this.value}&community=${item.id}`
  55. })
  56. }
  57. },
  58. topage(url){
  59. uni.navigateTo({
  60. url
  61. })
  62. },
  63. getProjectList() {
  64. service.getArea().then(res=>{
  65. console.log('getProjectType', res)
  66. if(res.length == 0){
  67. this.$UTILS.showPrompt('暂无项目!')
  68. }
  69. this.list = res;
  70. })
  71. },
  72. getUserName(){
  73. service.getUserName().then(res=>{
  74. this.civilPower = res.civilPower;
  75. })
  76. },
  77. },
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .background {
  82. z-index: -1;
  83. position: fixed;
  84. width: 100%;
  85. height: 100%;
  86. background-size: 100% 100%;
  87. }
  88. .project {
  89. border-radius: 72rpx;
  90. padding: 25rpx 0;
  91. text-align: center;
  92. margin: 170rpx 55rpx 0;
  93. }
  94. .project-content {
  95. border: 4rpx solid #3857F3;
  96. margin: 40rpx 55rpx 0;
  97. padding: 30rpx 20rpx;
  98. border-radius: 48rpx;
  99. }
  100. .position{
  101. position: absolute;
  102. bottom: 100rpx;
  103. right: 50rpx;
  104. .arrow{
  105. width: 152rpx;
  106. height: 152rpx;
  107. border-radius: 50%;
  108. padding: 25rpx;
  109. margin-left: 20rpx;
  110. }
  111. }
  112. </style>