OrderScroll.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="order-scroll-section">
  3. <!-- <SectionTitle :title="title" /> -->
  4. <swiper
  5. class="order-swiper"
  6. :autoplay="autoplay"
  7. circular
  8. horizontal
  9. :duration="duration"
  10. :interval="interval"
  11. >
  12. <swiper-item
  13. class="order-item"
  14. v-for="order in orderList"
  15. :key="order.id"
  16. @click="handleItemClick(order)"
  17. >
  18. <view class="order-info">
  19. <view
  20. class="_item_wrapper"
  21. v-for="(val, num) in order.goods"
  22. :key="num"
  23. >
  24. <view class="thumb_img">
  25. <image :src="val.pic_url" class="_img"></image>
  26. </view>
  27. <view class="goods_info">
  28. <view class="info_name">
  29. <view class="_name">{{ val.goodTitle }}</view>
  30. <view class="_price"
  31. >{{ symbol.symbol }}&nbsp;{{ Moneyhtml(val.price) }}</view
  32. >
  33. </view>
  34. <view class="spec_info">
  35. <view class="spec_desc">{{ val.sku_desc }}</view>
  36. <view class="spec_num">x{{ val.total }}</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="order_status">
  41. <view class="order-price">
  42. <view class="price_text"> <trans _t="总价" />: </view>
  43. <text>{{ symbol.symbol }}{{ Moneyhtml(order.amount) }}</text>
  44. </view>
  45. <text>{{ order.status_txt }}</text>
  46. </view>
  47. </view>
  48. </swiper-item>
  49. </swiper>
  50. </view>
  51. </template>
  52. <script setup>
  53. import { ref, computed } from "vue";
  54. import SectionTitle from "./SectionTitle";
  55. import { t } from "@/locale";
  56. import { useSystemStore } from "@/store";
  57. import { Moneyhtml, MoneyAbouthtml } from "@/utils";
  58. const useSystem = useSystemStore();
  59. const symbol = computed(() => useSystem.getSymbol);
  60. const props = defineProps({
  61. // 订单列表(必传)
  62. orderList: {
  63. type: Array,
  64. required: true,
  65. },
  66. // 轮播标题(默认“追踪订单”)
  67. title: {
  68. type: String,
  69. default: "追踪订单",
  70. },
  71. autoplay: {
  72. type: Boolean,
  73. default: true,
  74. },
  75. // 滚动动画时长(毫秒,默认500)
  76. duration: {
  77. type: Number,
  78. default: 500,
  79. },
  80. // 轮播间隔(毫秒,默认5000)
  81. interval: {
  82. type: Number,
  83. default: 5000,
  84. },
  85. });
  86. const emits = defineEmits(["itemClick"]);
  87. const handleItemClick = (order) => {
  88. emits("itemClick", order);
  89. };
  90. </script>
  91. <style lang="less" scoped>
  92. @import url("@/style.less");
  93. .order-scroll-section {
  94. .order-swiper {
  95. width: 100%;
  96. padding: 16rpx;
  97. background-color: var(--bg);
  98. border-radius: 16rpx;
  99. // border: var(--bor1);
  100. box-sizing: border-box;
  101. .order-item {
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. padding: 0 24rpx;
  106. width: 100%;
  107. box-sizing: border-box;
  108. cursor: pointer;
  109. .order-info {
  110. width: 100%;
  111. ._item_wrapper {
  112. .flex();
  113. .thumb_img {
  114. width: 140rpx;
  115. height: 140rpx;
  116. ._img {
  117. width: inherit;
  118. height: inherit;
  119. border-radius: 16rpx;
  120. }
  121. }
  122. .goods_info {
  123. margin-left: 16rpx;
  124. flex: 1;
  125. .info_name {
  126. color: var(--text);
  127. .size(24rpx);
  128. font-weight: 700;
  129. line-height: 44rpx;
  130. .ver();
  131. ._name {
  132. flex: 1;
  133. .ellipsis();
  134. margin-right: 8rpx;
  135. }
  136. }
  137. .spec_info {
  138. .flex();
  139. flex: 1;
  140. margin-top: 8rpx;
  141. color: var(--text-01);
  142. .size(24rpx);
  143. line-height: 40rpx;
  144. .spec_desc {
  145. flex: 1;
  146. margin-right: 8rpx;
  147. }
  148. }
  149. .no_return {
  150. border: var(--danger-bor);
  151. border-radius: 40rpx;
  152. color: var(--danger);
  153. cursor: pointer;
  154. .size(24rpx);
  155. line-height: 40rpx;
  156. margin-top: 16rpx;
  157. padding: 0 24rpx;
  158. width: max-content;
  159. }
  160. }
  161. }
  162. .order_status {
  163. width: 100%;
  164. color: var(--primary);
  165. .size(24rpx);
  166. .hor(space-between);
  167. align-items: center;
  168. padding-left: 156rpx;
  169. .order-price {
  170. .flex_position(flex-end);
  171. color: var(--primary);
  172. color: var(--red);
  173. .size();
  174. font-weight: 700;
  175. .price_text {
  176. color: var(--text);
  177. .size(24rpx);
  178. font-weight: 400;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>