unitlist.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view>
  3. <image src="https://121.37.40.217/app/images//background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 90rpx;">
  5. <back></back>
  6. </view>
  7. <view style="padding-top: 60rpx;">
  8. <view style="margin: 20rpx;">
  9. <u-search placeholder="请输入楼宇名称" v-model="nameValue" :action-style="{'font-size':'40rpx'}" @custom="getProjectList()"></u-search>
  10. </view>
  11. <view v-for="(item,index) in list" :key="index" >
  12. <view class="project-content" @click="gotoindex(item)">
  13. <view>
  14. <view class="font-forty-eight blue">
  15. {{item.name}}<u-icon name="arrow-right"></u-icon>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import service from '@/api/index.js'
  26. export default {
  27. data() {
  28. return {
  29. list:[],
  30. value:'',
  31. nameValue:'',
  32. civilPower:'',
  33. community:'',
  34. building:''
  35. }
  36. },
  37. onLoad(e) {
  38. console.log(e)
  39. this.value = e.value
  40. this.community = e.community
  41. this.building = e.building
  42. this.buildingName=e.buildingName
  43. this.getProjectList();
  44. this.getUserName();
  45. },
  46. methods: {
  47. gotoindex(item){
  48. console.log(item)
  49. let url1=null
  50. if (this.value==0)
  51. { url1=`/pages/noLogin/emergencyRepairOrder/emergencyRepairOrder?unit=${item.id}`
  52. console.log(this.value)
  53. }else if(this.value==2)
  54. {
  55. url1=`/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?unit=${item.id}&community=${this.community}&building=${this.building}`
  56. console.log(this.value)
  57. }else if(this.value==3)
  58. {
  59. url1=`/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?unit=${item.id}&building=${this.building}&buildingName=${item.name}&unitName=${item.name}`
  60. console.log(this.value)
  61. }
  62. uni.navigateTo({
  63. url:url1
  64. })
  65. },
  66. topage(url){
  67. uni.navigateTo({
  68. url
  69. })
  70. },
  71. getProjectList() {
  72. service.getUnitList({buildingId:this.building}).then(res=>{
  73. console.log('getProjectType', res)
  74. if(res.length == 0){
  75. this.$UTILS.showPrompt('暂无项目!')
  76. }
  77. this.list = res;
  78. })
  79. },
  80. getUserName(){
  81. service.getUserName().then(res=>{
  82. this.civilPower = res.civilPower;
  83. })
  84. },
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .background {
  90. z-index: -1;
  91. position: fixed;
  92. width: 100%;
  93. height: 100%;
  94. background-size: 100% 100%;
  95. }
  96. .project {
  97. border-radius: 72rpx;
  98. padding: 25rpx 0;
  99. text-align: center;
  100. margin: 170rpx 55rpx 0;
  101. }
  102. .project-content {
  103. border: 4rpx solid #3857F3;
  104. margin: 40rpx 55rpx 0;
  105. padding: 30rpx 20rpx;
  106. border-radius: 48rpx;
  107. }
  108. .position{
  109. position: absolute;
  110. bottom: 100rpx;
  111. right: 50rpx;
  112. .arrow{
  113. width: 152rpx;
  114. height: 152rpx;
  115. border-radius: 50%;
  116. padding: 25rpx;
  117. margin-left: 20rpx;
  118. }
  119. }
  120. </style>