details.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <u-navbar
  4. :title="title"
  5. title-color="#fff"
  6. :custom-back="customBack"
  7. :border-bottom="false"
  8. back-icon-color="#CCE8FF"
  9. :background="{background: 'linear-gradient(99deg, #7A4398 0%, #5A5DB9 100%)' }"></u-navbar>
  10. <view class="base-info">
  11. <view class="base-info-item u-flex u-row-between">
  12. <view class=""><b>路段/停车场:</b>{{pageData.roadName}}</view>
  13. </view>
  14. <view class="base-info-item">
  15. <view class=""><b>问题描述:</b>{{pageData.exceprionDes}}</view>
  16. </view>
  17. <view class="base-info-item">
  18. <view class="">
  19. <b>图片:</b>
  20. <view class="img-list">
  21. <image class="img" v-for="(item,index) in pageData.imgList" @click="previewImage(index)" :src="item" mode="widthFix" :key="index"></image>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default{
  31. data(){
  32. return{
  33. title:'其他问题',
  34. pageData:[],
  35. id:'',
  36. dataList:[],
  37. }
  38. },
  39. onLoad(page){
  40. this.id = page.id;
  41. },
  42. onShow(){
  43. this.getReportDetail();
  44. },
  45. mounted() {
  46. },
  47. onReady() {
  48. // this.$refs.uForm.setRules(this.rules);
  49. },
  50. methods:{
  51. customBack(){
  52. uni.navigateBack()
  53. },
  54. getReportDetail(){
  55. this.$u.api.reportDetail({id:this.id}).then(res=>{
  56. if(res.code==200){
  57. this.pageData = res.data;
  58. // console.log('reportDetail',res);
  59. }else{
  60. uni.showToast({
  61. icon:'none',
  62. title:res.msg
  63. })
  64. }
  65. console.log('res',res);
  66. }).catch(err=>{
  67. console.log('err',err);
  68. })
  69. },
  70. previewImage(index){
  71. uni.previewImage({
  72. current: index,
  73. urls: this.pageData.imgList
  74. });
  75. }
  76. }
  77. }
  78. </script>
  79. <style>
  80. page{background: #F3F3F3;}
  81. </style>
  82. <style lang="scss" scoped>
  83. @import '../report.scss'
  84. </style>