Authored by lea guo

订单物流信息

  1 +<template>
  2 + <ul class="time-line-wrapper">
  3 + <li
  4 + :class="i === 0 ? 'time-line-item active' : 'time-line-item'"
  5 + v-for="(lineInfo, i) in lineList"
  6 + :key="i"
  7 + >
  8 + <i class="circle"></i>
  9 + <span class="content">{{ lineInfo }}</span>
  10 + </li>
  11 + </ul>
  12 +</template>
  13 +
  14 +<script>
  15 +export default {
  16 + data() {
  17 + return {
  18 + lineList: [
  19 + "已签收",
  20 + "南京市正在派送中,请准备签收(派件人:小明 电话:18323458818)",
  21 + "快件到达【江宁区秣周东路】集散处",
  22 + "南京市快件在【南京江宁集散中心】已装车,准备发往【南京浦口集散处】"
  23 + ]
  24 + };
  25 + }
  26 +};
  27 +</script>
  28 +
  29 +<style lang="scss" scoped>
  30 +.time-line-wrapper {
  31 + padding: 50px;
  32 +
  33 + .time-line-item {
  34 + position: relative;
  35 + padding: 0 40px 40px 40px;
  36 + width: 50%;
  37 + border-left: 1px solid #eee;
  38 + font-size: 28px;
  39 + color: #999;
  40 + display: flex;
  41 + align-items: flex-start;
  42 +
  43 + &:last-child {
  44 + border-left: none;
  45 + }
  46 +
  47 + .content {
  48 + margin-top: -6px;
  49 + }
  50 +
  51 + .circle {
  52 + width: 20px;
  53 + height: 20px;
  54 + background: #eee;
  55 + border-radius: 50%;
  56 + display: block;
  57 + position: absolute;
  58 + left: -10px;
  59 + }
  60 +
  61 + &.active {
  62 + font-size: 32px;
  63 + color: #000;
  64 +
  65 + .content {
  66 + margin-top: 0;
  67 + }
  68 +
  69 + & > i {
  70 + width: 40px;
  71 + height: 40px;
  72 + left: -20px;
  73 + display: block;
  74 + position: absolute;
  75 + border-radius: 50%;
  76 + background-image: url("~statics/image/order/time-icon@3x.png");
  77 + background-size: contain;
  78 + }
  79 + }
  80 + }
  81 +}
  82 +</style>
  1 +<template>
  2 + <div class="delivery-wrapper">
  3 + <ul>
  4 + <li></li>
  5 + </ul>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 +import { createNamespacedHelpers } from "vuex";
  11 +
  12 +export default {
  13 + computed: {}
  14 +};
  15 +</script>
  16 +
  17 +<style lang="scss" scoped>
  18 +</style>
1 <template> 1 <template>
2 <div class="logistics-wrapper"> 2 <div class="logistics-wrapper">
3 - 物流信息 3 + <div class="header">
  4 + <p class="title">{{ logisticInfo.expressSender }}</p>
  5 + <img class="step" alt="" :src="stageImgUrl" />
  6 + </div>
  7 + <div class="platform-delivery-info">
  8 + <time-line />
  9 + </div>
  10 + <div class="platform-identification-info"></div>
  11 + <div class="seller-delivery-info"></div>
4 </div> 12 </div>
5 </template> 13 </template>
6 14
7 <script> 15 <script>
8 import { createNamespacedHelpers } from "vuex"; 16 import { createNamespacedHelpers } from "vuex";
9 -const { mapActions } = createNamespacedHelpers("order/logisticsInfo"); 17 +import TimeLine from "./components/time-line";
  18 +
  19 +const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
  20 + "order/logisticsInfo"
  21 +);
10 22
11 export default { 23 export default {
12 - computed: {}, 24 + components: {
  25 + TimeLine
  26 + },
  27 + computed: {
  28 + ...mapState(["logisticInfo"]),
  29 + ...mapGetters(["stageImgUrl"])
  30 + },
13 mounted() { 31 mounted() {
14 this.fetchLogisticInfo(this.$route.params); 32 this.fetchLogisticInfo(this.$route.params);
15 }, 33 },
@@ -23,5 +41,11 @@ export default { @@ -23,5 +41,11 @@ export default {
23 .logistics-wrapper { 41 .logistics-wrapper {
24 height: 100vh; 42 height: 100vh;
25 -webkit-box-orient: vertical; 43 -webkit-box-orient: vertical;
  44 +
  45 + .step {
  46 + display: block;
  47 + margin: 0 auto;
  48 + height: 100px;
  49 + }
26 } 50 }
27 </style> 51 </style>
  1 +/* eslint-disable operator-linebreak */
1 export default function() { 2 export default function() {
2 return { 3 return {
3 namespaced: true, 4 namespaced: true,
@@ -9,6 +10,13 @@ export default function() { @@ -9,6 +10,13 @@ export default function() {
9 state.logisticInfo = data; 10 state.logisticInfo = data;
10 }, 11 },
11 }, 12 },
  13 + getters: {
  14 + stageImgUrl: ({ logisticInfo: { stage } }) => {
  15 + return stage
  16 + ? require(`../../statics/image/order/logistics_progress_${stage}@3x.png`)
  17 + : '';
  18 + },
  19 + },
12 actions: { 20 actions: {
13 // 获取物流信息 21 // 获取物流信息
14 async fetchLogisticInfo({ commit }, { owner, code } = {}) { 22 async fetchLogisticInfo({ commit }, { owner, code } = {}) {
  1 +// 平台类型
  2 +export const expressType = {
  3 + 1: '卖家',
  4 + 2: 'UFO平台',
  5 +};