<!-- 售后进度  -->
<template>
  <s-layout :title="$t('order.aftersale.log.title')">
    <view class="log-box">
      <view  v-for="(item, index) in state.info" :key="item.title">
        <log-item :item="item" :index="index" :data="state.info"></log-item>
      </view>
    </view>
  </s-layout>
</template>

<script setup>
  import sheep from '@/sheep';
  import { onLoad } from '@dcloudio/uni-app';
  import { reactive } from 'vue';
  import logItem from './log-item.vue';

  const state = reactive({
    active: 1,
    commentImages: [],
    list: [
      {
        title: $t('order.aftersale.log.paid'),
        desc: '2018-11-11',
      },
      {
        title: $t('order.aftersale.log.delivery'),
        desc: '2018-11-12',
      },
      {
        title: $t('order.aftersale.log.received'),
        desc: '2018-11-13',
      },
      {
        title: $t('order.aftersale.log.complete'),
        desc: '2018-11-14',
      },
    ],
  });
  async function getDetail(id) {
    const { code, data } = await sheep.$api.order.aftersale.detail(id);
    if (code === 1) {
      state.info = data.logs;
    }
  }
  onLoad((options) => {
    state.aftersaleId = options.id;
    getDetail(options.id);
  });
</script>

<style lang="scss" scoped>
  .log-box {
    padding: 24rpx 24rpx 24rpx 40rpx;
    background-color: #fff;
    
  }
</style>
