track.vue 1.2 KB
Newer Older
sin's avatar
sin committed
1
<template>
sin's avatar
sin committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15
  <div style="background: #f7f7f7;">
    <headerNav title="进度详情"/>

    <van-cell-group>
      <van-cell title="服务单号" :value="serviceNumber"/>
    </van-cell-group>
    <van-steps direction="vertical" :active="0" active-color="#f60" style="margin-top: 15px;">
      <van-step v-for="(item, itemIndex) in details" :key="detailIndex">
        <h3>{{item.logisticsInformation}}</h3>
        <p>{{item.logisticsTimeText}}</p>
      </van-step>
    </van-steps>

  </div>
sin's avatar
sin committed
16 17 18 19
</template>

<script>

sin's avatar
sin committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
  import moment from 'moment';
  import { getLogisticsInfo } from '../../../api/order';

  export default {
    data() {
      return {
        serviceNumber: '',
        details: [],
      }
    },
    mounted() {
      console.log(this.$route.params)
      const { id, serviceNumber } = this.$route.params;
      this.serviceNumber = serviceNumber
      getLogisticsInfo(id).then(res => {
        const { details } = res;

        this.details = details.map(item => {
          return {
            ...item,
            logisticsTimeText: moment(item.logisticsTime).format("YYYY-MM-DD HH:mm")
          }
        })
      })
    },
  }
sin's avatar
sin committed
46 47 48 49 50
</script>

<style>

</style>