<template>
  <div class="order-info-con common">
    <div class="title">订单信息</div>
    <div class="info-list">
      <div class="item">
        <div class="label">提货单号：</div>
        <div class="val">{{ data.deliveryId }}</div>
        <div class="copy" @click="handleCopy(data.deliveryId)">复制</div>
      </div>
      <div class="item">
        <div class="label">提货时间：</div>
        <div class="val">{{ data.createTime | timeFilter }}</div>
      </div>
      <div class="item">
        <div class="label">快递单号：</div>
        <div class="val">{{ data.expressNo || "--" }}</div>
        <div class="copy" @click="handleCopy(data.expressNo)">复制</div>
      </div>
      <div class="item">
        <div class="label">发货时间：</div>
        <div class="val">{{ data.deliveryTime | timeFilter }}</div>
      </div>
      <div class="item">
        <div class="label">签收时间：</div>
        <div class="val">{{ data.finishTime | timeFilter }}</div>
      </div>
    </div>
    <div class="link flex-default">
      <div class="item flex-default" @click="platformList">
        <m-icon icon="icon-service" :size="18" />
        <span class="label">联系客服</span>
      </div>
      <div class="line" />
      <div class="item flex-default" @click="shopList">
        <m-icon icon="icon-shop-red" :size="18" />
        <span class="label">联系卖家</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  computed: {},
  methods: {
    shopList() {
      this.contactCustomer(this.data.merchantId);
    },
    platformList() {
      this.contactCustomer("e3ac4b4a4e65460dbd9f1ec6cbd7a900");
    },
    contactCustomer(merchantId) {
      this.$showLoading();
      this.$api({
        apiName: "listShopCustomer",
        postData: { merchantId: merchantId },
        success: (res) => {
          if (res && res.length > 0) {
            let customer = res[0];
            let query = { customer: JSON.stringify(customer) };
            this.$router.push({ name: "customer-service-chat", query });
          } else {
            this.$toast("该商家暂未开通客服！");
          }
        },
        complete: () => {
          this.$hideLoading();
        },
      });
    },
  },
};
</script>

<style lang="less">
@import "../components/order-info.less";
</style>



