order.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="order">
  3. <view class="top ss-flex ss-row-between">
  4. <span>{{ orderData.order_sn }}</span>
  5. <span>{{ orderData.create_time.split(' ')[1] }}</span>
  6. </view>
  7. <template v-if="from != 'msg'">
  8. <view class="bottom ss-flex" v-for="item in orderData.items" :key="item">
  9. <image class="image" :src="sheep.$url.cdn(item.goods_image)" mode="aspectFill"> </image>
  10. <view class="ss-flex-1">
  11. <view class="title ss-line-2">
  12. {{ item.goods_title }}
  13. </view>
  14. <view v-if="item.goods_num" class="num ss-m-b-10"> 数量:{{ item.goods_num }} </view>
  15. <view class="ss-flex ss-row-between ss-m-t-8">
  16. <span class="price">¥{{ item.goods_price }}</span>
  17. <span class="status">{{ orderData.status_text }}</span>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <template v-else>
  23. <view class="bottom ss-flex" v-for="item in [orderData.items[0]]" :key="item">
  24. <image class="image" :src="sheep.$url.cdn(item.goods_image)" mode="aspectFill"> </image>
  25. <view class="ss-flex-1">
  26. <view class="title title-1 ss-line-1">
  27. {{ item.goods_title }}
  28. </view>
  29. <view class="order-total ss-flex ss-row-between ss-m-t-8">
  30. <span>共{{ orderData.items.length }}件商品</span>
  31. <span>合计 ¥{{ orderData.pay_fee }}</span>
  32. </view>
  33. <view class="ss-flex ss-row-right ss-m-t-8">
  34. <span class="status">{{ orderData.status_text }}</span>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. </view>
  40. </template>
  41. <script setup>
  42. import sheep from '@/sheep';
  43. const props = defineProps({
  44. from: String,
  45. orderData: {
  46. type: Object,
  47. default: {},
  48. },
  49. });
  50. </script>
  51. <style lang="scss" scoped>
  52. .order {
  53. background: #fff;
  54. padding: 20rpx;
  55. border-radius: 12rpx;
  56. .top {
  57. line-height: 40rpx;
  58. font-size: 24rpx;
  59. font-weight: 400;
  60. color: #999;
  61. border-bottom: 1px solid rgba(223, 223, 223, 0.5);
  62. margin-bottom: 20rpx;
  63. }
  64. .bottom {
  65. margin-bottom: 20rpx;
  66. &:last-of-type {
  67. margin-bottom: 0;
  68. }
  69. .image {
  70. flex-shrink: 0;
  71. width: 116rpx;
  72. height: 116rpx;
  73. margin-right: 20rpx;
  74. }
  75. .title {
  76. height: 64rpx;
  77. line-height: 32rpx;
  78. font-size: 26rpx;
  79. font-weight: 500;
  80. color: #333;
  81. &.title-1 {
  82. height: 32rpx;
  83. width: 300rpx;
  84. }
  85. }
  86. .num {
  87. font-size: 24rpx;
  88. font-weight: 400;
  89. color: #999;
  90. }
  91. .price {
  92. font-size: 26rpx;
  93. font-weight: 500;
  94. color: #ff3000;
  95. }
  96. .status {
  97. font-size: 24rpx;
  98. font-weight: 500;
  99. color: var(--ui-BG-Main);
  100. }
  101. .order-total {
  102. line-height: 28rpx;
  103. font-size: 24rpx;
  104. font-weight: 400;
  105. color: #999;
  106. }
  107. }
  108. }
  109. </style>