orderItem.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="goods-info">
  3. <div class="goods-box">
  4. <div class="goods-img">
  5. <img :src="orderInfo.order_goods[0].sku_image ? $util.img(orderInfo.order_goods[0].sku_image) : $util.img(defaultGoodsImage)"
  6. alt />
  7. </div>
  8. <div class="goods-desc">
  9. <div class="text-hidden-two-row">{{orderInfo.order_name}}</div>
  10. <div>订单状态:{{orderInfo.order_status_name}}</div>
  11. <div class="flex-box"> <span class="ns-text-color">¥{{orderInfo.order_money}}</span> <span>{{orderInfo.delivery_type_name}}</span>
  12. </div>
  13. </div>
  14. </div>
  15. <!-- v-if="canSend" -->
  16. <div class="more text-center">
  17. <div class="order-num">订单号:454564645665</div>
  18. <div @click="jumo_order()" class="see-order">
  19. 查看订单<i class="el-icon-arrow-right"></i>
  20. </div>
  21. <!-- <el-breadcrumb-item :to="{ path: '/member/order_detail?order_id=' + orderId }">订单详情</el-breadcrumb-item> -->
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import {
  27. apiOrderDetail
  28. } from "@/api/order/order"
  29. import {
  30. mapGetters
  31. } from "vuex"
  32. export default {
  33. name: "orderItem",
  34. props: {
  35. orderId: 0,
  36. canSend: {
  37. type: Boolean,
  38. default: false
  39. }
  40. },
  41. data() {
  42. return {
  43. orderInfo: {
  44. order_status_name: '',
  45. delivery_type_name: '',
  46. order_money: '',
  47. order_goods: [{
  48. sku_image: ''
  49. }]
  50. }
  51. }
  52. },
  53. computed: {
  54. ...mapGetters(["defaultGoodsImage"])
  55. },
  56. created() {
  57. if (!this.orderId) return;
  58. this.getOrderInfo()
  59. },
  60. methods: {
  61. sendMessage() {
  62. this.$emit("sendMessage")
  63. },
  64. jumo_order() {
  65. this.$util.pushToTab('/member/order_detail?order_id=' + this.orderId)
  66. },
  67. getOrderInfo() {
  68. apiOrderDetail({
  69. order_id: this.orderId
  70. }).then((res) => {
  71. if (res.code >= 0) {
  72. this.orderInfo = res.data
  73. }
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .goods-info {
  81. padding: 0 10px;
  82. border: 1px solid #eee;
  83. box-sizing: border-box;
  84. border-radius: 10px;
  85. background-color: #eee;
  86. width: 350px;
  87. .goods-box {
  88. display: flex;
  89. border-bottom: 1px solid #eee;
  90. margin: 10px 0;
  91. padding: 10px;
  92. border-radius: 10px;
  93. box-sizing: border-box;
  94. background-color: white;
  95. .goods-img {
  96. overflow: hidden;
  97. width: 80px;
  98. border-radius: 4px;
  99. height: 80px;
  100. margin-right: 10px;
  101. }
  102. .goods-desc {
  103. width: 250px;
  104. display: flex;
  105. flex-direction: column;
  106. justify-content: space-between;
  107. .text-hidden-two-row {
  108. color: #000000;
  109. font-size: 15px;
  110. }
  111. .flex-box {
  112. display: flex;
  113. align-items: center;
  114. justify-content: space-between;
  115. }
  116. .price {
  117. color: #999999;
  118. }
  119. }
  120. }
  121. .more {
  122. margin: 10px 0 5px;
  123. cursor: pointer;
  124. display: flex;
  125. justify-content: space-between;
  126. .order-num {
  127. color: #909399;
  128. }
  129. .see-order {
  130. align-items: center;
  131. color: $base-color;
  132. }
  133. }
  134. }
  135. </style>