detail.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view style="background-color: #FFFFFF;min-height: 100vh;">
  3. <view style="padding: 20rpx;">
  4. <view style="position: relative;">
  5. <image v-if="current==0" @click="$util.preview(detailData.enterImgPath)" :src="detailData.enterImgPath?detailData.enterImgPath:'/static/index/noimg3.png'" style="width: 100%;height: 400rpx;"></image>
  6. <image v-if="current==1" @click="$util.preview(detailData.outImgPath)" :src="detailData.outImgPath?detailData.outImgPath:'/static/index/noimg3.png'" style="width: 100%;height: 400rpx;"></image>
  7. <text style="font-size: 32rpx;color: #FFFFFF;position: absolute;bottom: 20rpx;left: 20rpx;">{{detailData.carNo}}</text>
  8. </view>
  9. <u-cell-group >
  10. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="bookmark-fill" title="车牌号:" :value="detailData.carNo"></u-cell-item>
  11. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="map-fill" title="入场车道:" :value="detailData.enterGateName"></u-cell-item>
  12. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="clock-fill" title="入场时间:" :value="detailData.enterTime"></u-cell-item>
  13. <u-cell-item v-if="current==1" :icon-style="iconStyle" :arrow="false" icon="map-fill" title="出口车道:" :value="detailData.outGateName"></u-cell-item>
  14. <u-cell-item v-if="current==1" :icon-style="iconStyle" :arrow="false" icon="clock-fill" title="出场时间:" :value="detailData.outTime"></u-cell-item>
  15. <u-cell-item :icon-style="iconStyle" :border-bottom="false" :arrow="false" icon="rmb-circle-fill" title="进出费用:" :value="detailData.totalAmount?'¥'+detailData.totalAmount:'¥0'"></u-cell-item>
  16. </u-cell-group>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: '',
  23. data() {
  24. return {
  25. id:'',
  26. current:0,
  27. detailData:{},
  28. iconStyle:{
  29. color:"#5064eb"
  30. },
  31. };
  32. },
  33. onLoad(options) {
  34. this.id=options.id
  35. this.current=options.current
  36. this.fetchDetail()
  37. },
  38. methods:{
  39. fetchDetail(id,current){
  40. if (this.current==0) {
  41. //入场
  42. this.$api.car.enterPage({id:this.id}).then(res=>{
  43. this.detailData=res.data.records[0]
  44. })
  45. }else if (this.current==1) {
  46. //出场
  47. this.$api.car.outPage({id:this.id}).then(res=>{
  48. this.detailData=res.data.records[0]
  49. })
  50. }
  51. },
  52. }
  53. };
  54. </script>
  55. <style lang="scss" scoped>
  56. </style>