listProject.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 0rpx;">
  5. <!-- <back></back> -->
  6. </view>
  7. <view style="padding-top: 40rpx;">
  8. <view style="margin: 20rpx;">
  9. <u-search placeholder="请输入搜索内容" v-model="nameValue" :show-action="false" :action-style="{'font-size':'40rpx'}" @search="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. uni.setNavigationBarTitle({
  43. title: '历史记录',
  44. });
  45. uni.setNavigationBarColor({
  46. frontColor: '#ffffff',
  47. backgroundColor: '#2d95f4',
  48. })
  49. },
  50. methods: {
  51. gotoindex(item){
  52. console.log(item)
  53. if(item.type==1)
  54. {//调压箱
  55. console.log(item)
  56. uni.navigateTo({
  57. url: `/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?type=1&id=${item.id}`
  58. })
  59. }else if(item.type==2)
  60. {//庭院管理
  61. uni.navigateTo({
  62. url: `/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?type=1&id=${item.id}`
  63. })
  64. }else if(item.type==3)
  65. {//抢险维修
  66. uni.navigateTo({
  67. url: `/pages/noLogin/emergencyRepairOrder/emergencyRepairOrder?type=1&id=${item.id}`
  68. })
  69. }else if(item.type==4)
  70. {//警示桩
  71. console.log(item)
  72. let url1= `/pages/noLogin/WarningPileForm/WarningPileForm?type=1&id=${item.id}`
  73. uni.navigateTo({
  74. url: url1
  75. })
  76. }
  77. // uni.switchTab({
  78. // url:'/pages/index/index'
  79. // })
  80. },
  81. topage(url){
  82. uni.navigateTo({
  83. url
  84. })
  85. },
  86. getProjectList() {
  87. this.list=[]
  88. service.getSearch({value:this.nameValue}).then(res=>{
  89. console.log('getProjectType', res)
  90. if(res.length == 0){
  91. this.$UTILS.showPrompt('暂无历史记录!')
  92. return
  93. }
  94. let list1=[]
  95. list1=res
  96. list1.forEach(item=>{
  97. if(item.type==1)
  98. {
  99. item.typeValue='调压箱'
  100. }else if(item.type==2)
  101. {
  102. item.typeValue='庭院管网'
  103. }
  104. else if(item.type==3)
  105. {
  106. item.typeValue='抢险维修'
  107. }else if(item.type==4)
  108. {
  109. item.typeValue='警示桩'
  110. }
  111. this.list.push(item)
  112. })
  113. //this.list = res;
  114. })
  115. },
  116. getUserName(){
  117. service.getUserName().then(res=>{
  118. this.civilPower = res.civilPower;
  119. })
  120. },
  121. },
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .background {
  126. z-index: -1;
  127. position: fixed;
  128. width: 100%;
  129. height: 100%;
  130. background-size: 100% 100%;
  131. }
  132. .project {
  133. border-radius: 72rpx;
  134. padding: 25rpx 0;
  135. text-align: center;
  136. margin: 170rpx 55rpx 0;
  137. }
  138. .project-content {
  139. border: 4rpx solid #3857F3;
  140. margin: 40rpx 55rpx 0;
  141. padding: 30rpx 20rpx;
  142. border-radius: 48rpx;
  143. }
  144. .position{
  145. position: absolute;
  146. bottom: 100rpx;
  147. right: 50rpx;
  148. .arrow{
  149. width: 152rpx;
  150. height: 152rpx;
  151. border-radius: 50%;
  152. padding: 25rpx;
  153. margin-left: 20rpx;
  154. }
  155. }
  156. </style>