Authored by lea guo

回寄地址

1 <template> 1 <template>
2 <div class="address-wrapper"> 2 <div class="address-wrapper">
3 - <i class="address-icon"></i> 3 + <i
  4 + v-if="$route.params.owner === 'sell'"
  5 + class="address-icon back-address-icon"
  6 + ></i>
  7 + <i v-else class="address-icon"></i>
4 <div> 8 <div>
5 - <p class="consignee">{{ userAddress.consignee }}</p> 9 + <p class="consignee">
  10 + {{
  11 + isSell ? `回寄地址: ${userAddress.consignee}` : userAddress.consignee
  12 + }}
  13 + </p>
6 <p class="area">{{ userAddress.area }}</p> 14 <p class="area">{{ userAddress.area }}</p>
7 <p class="mobile">{{ userAddress.mobile }}</p> 15 <p class="mobile">{{ userAddress.mobile }}</p>
8 </div> 16 </div>
@@ -15,7 +23,11 @@ const { mapGetters } = createNamespacedHelpers("order/orderDetail"); @@ -15,7 +23,11 @@ const { mapGetters } = createNamespacedHelpers("order/orderDetail");
15 23
16 export default { 24 export default {
17 computed: { 25 computed: {
18 - ...mapGetters(["userAddress"]) 26 + ...mapGetters(["userAddress"]),
  27 + isSell() {
  28 + const { owner } = this.$route.params;
  29 + return owner === "sell";
  30 + }
19 } 31 }
20 }; 32 };
21 </script> 33 </script>
@@ -46,7 +58,10 @@ export default { @@ -46,7 +58,10 @@ export default {
46 display: block; 58 display: block;
47 background-size: contain; 59 background-size: contain;
48 margin-right: 40px; 60 margin-right: 40px;
49 - background-image: url("~statics/image/order/addr-icon@3x.png"); 61 + }
  62 +
  63 + .back-address-icon {
  64 + background-image: url("~statics/image/order/blackAddress@3x.png");
50 } 65 }
51 } 66 }
52 </style> 67 </style>
@@ -77,8 +77,9 @@ export default { @@ -77,8 +77,9 @@ export default {
77 77
78 // 获取订单数据 78 // 获取订单数据
79 asyncData({ store, router }) { 79 asyncData({ store, router }) {
  80 + const { status } = router.params;
80 store.commit(`${STORE_PATH}/resetData`); 81 store.commit(`${STORE_PATH}/resetData`);
81 - store.commit(`${STORE_PATH}/setOrderStatus`, router.params.status); 82 + store.commit(`${STORE_PATH}/setOrderStatus`, status);
82 return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params); 83 return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params);
83 }, 84 },
84 85
@@ -87,7 +88,7 @@ export default { @@ -87,7 +88,7 @@ export default {
87 fetchData() { 88 fetchData() {
88 this.fetchOrderList(this.$route.params); 89 this.fetchOrderList(this.$route.params);
89 } 90 }
90 - }, 91 + }
91 }; 92 };
92 </script> 93 </script>
93 <style lang="scss" scoped> 94 <style lang="scss" scoped>