listProject.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view>
  3. <image src="/static/icon/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.typeValue}}
  16. </view>
  17. <view class="font-forty-eight blue">
  18. 项目名称:{{item.name}}
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import service from '@/api/index.js'
  28. export default {
  29. data() {
  30. return {
  31. list:[],
  32. value:'',
  33. nameValue:'',
  34. civilPower:''
  35. }
  36. },
  37. onLoad(e) {
  38. console.log(e)
  39. this.nameValue = e.nameValue
  40. this.getProjectList();
  41. this.getUserName();
  42. },
  43. methods: {
  44. gotoindex(item){
  45. console.log(item)
  46. if(item.type==1)
  47. {//调压箱
  48. console.log(item)
  49. uni.navigateTo({
  50. url: `/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?type=1&id=${item.id}`
  51. })
  52. }else if(item.type==2)
  53. {//庭院管理
  54. uni.navigateTo({
  55. url: `/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?type=1&id=${item.id}`
  56. })
  57. }else if(item.type==3)
  58. {//抢险维修
  59. uni.navigateTo({
  60. url: `/pages/noLogin/emergencyRepairOrder/emergencyRepairOrder?type=1&id=${item.id}`
  61. })
  62. }else if(item.type==4)
  63. {//警示桩
  64. console.log(item)
  65. let url1= `/pages/noLogin/WarningPileForm/WarningPileForm?type=1&id=${item.id}`
  66. uni.navigateTo({
  67. url: url1
  68. })
  69. }
  70. // uni.switchTab({
  71. // url:'/pages/index/index'
  72. // })
  73. },
  74. topage(url){
  75. uni.navigateTo({
  76. url
  77. })
  78. },
  79. getProjectList() {
  80. service.getSearch({value:this.nameValue}).then(res=>{
  81. console.log('getProjectType', res)
  82. if(res.length == 0){
  83. this.$UTILS.showPrompt('暂无历史记录!')
  84. return
  85. }
  86. let list1=[]
  87. list1=res
  88. list1.forEach(item=>{
  89. if(item.type==1)
  90. {
  91. item.typeValue='调压箱'
  92. }else if(item.type==2)
  93. {
  94. item.typeValue='庭院管网'
  95. }
  96. else if(item.type==3)
  97. {
  98. item.typeValue='抢险维修'
  99. }else if(item.type==4)
  100. {
  101. item.typeValue='警示桩'
  102. }
  103. this.list.push(item)
  104. })
  105. //this.list = res;
  106. })
  107. },
  108. getUserName(){
  109. service.getUserName().then(res=>{
  110. this.civilPower = res.civilPower;
  111. })
  112. },
  113. },
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .background {
  118. z-index: -1;
  119. position: fixed;
  120. width: 100%;
  121. height: 100%;
  122. background-size: 100% 100%;
  123. }
  124. .project {
  125. border-radius: 72rpx;
  126. padding: 25rpx 0;
  127. text-align: center;
  128. margin: 170rpx 55rpx 0;
  129. }
  130. .project-content {
  131. border: 4rpx solid #3857F3;
  132. margin: 40rpx 55rpx 0;
  133. padding: 30rpx 20rpx;
  134. border-radius: 48rpx;
  135. }
  136. .position{
  137. position: absolute;
  138. bottom: 100rpx;
  139. right: 50rpx;
  140. .arrow{
  141. width: 152rpx;
  142. height: 152rpx;
  143. border-radius: 50%;
  144. padding: 25rpx;
  145. margin-left: 20rpx;
  146. }
  147. }
  148. </style>