order_item.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="order_list">
  3. <view class="order_header">
  4. <!-- <view class="header_img">
  5. <image
  6. :src="`../../static/shop/icon_${item.channel}.png`"
  7. class="img"
  8. ></image>
  9. </view> -->
  10. <view class="create_time">
  11. <trans _t="创建时间" />:
  12. {{ useGlobal().$format(item.indate) }}
  13. </view>
  14. </view>
  15. <view class="order_item">
  16. <view
  17. class="order_item_wrapper"
  18. v-for="(val, num) in item.goods"
  19. :key="num"
  20. @click="handleClick"
  21. >
  22. <view class="_item_wrapper">
  23. <view class="thumb_img">
  24. <image :src="val.pic_url" class="_img"></image>
  25. </view>
  26. <view class="goods_info">
  27. <view class="info_name">
  28. <view class="_name">{{ val.goodTitle }}</view>
  29. <view class="_price"
  30. >{{ symbol.symbol }}&nbsp;{{ Moneyhtml(val.price) }}</view
  31. >
  32. </view>
  33. <view class="spec_info">
  34. <view class="spec_desc">{{ val.sku_desc }}</view>
  35. <view class="spec_num">x{{ val.total }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="order_status">
  40. <text>{{ item.status_txt }}&nbsp;</text>
  41. <!-- <i class="icon-font icon-question2"></i> -->
  42. </view>
  43. </view>
  44. <view class="order_footer" v-if="item.status == 300">
  45. <view class="order_price">
  46. <view class="price_text"> <trans _t="运费" />: </view>
  47. <text>{{ symbol.symbol }}{{ Moneyhtml(item.money) }}</text>
  48. </view>
  49. <view class="order_btns">
  50. <view class="btn pay_btn" @click.stop="handleAction">
  51. <trans _t="支付" />
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script setup>
  59. import { computed } from "vue";
  60. import { t } from "@/locale";
  61. import { useSystemStore } from "@/store";
  62. import { useGlobal, Moneyhtml } from "@/utils";
  63. const useSystem = useSystemStore();
  64. const symbol = computed(() => useSystem.getSymbol);
  65. const props = defineProps({
  66. item: {
  67. type: Object,
  68. required: true,
  69. },
  70. });
  71. const emit = defineEmits(["click", "action"]);
  72. const handleClick = () => {
  73. emit("click", props.item);
  74. };
  75. const handleAction = () => {
  76. emit("action", props.item);
  77. };
  78. </script>
  79. <style lang="less" scoped>
  80. @import url("@/style.less");
  81. .order_list {
  82. margin-top: 24rpx;
  83. padding: 16rpx 24rpx;
  84. background-color: var(--light);
  85. border: var(--bor1);
  86. border-radius: 16rpx;
  87. .order_header {
  88. .ver();
  89. margin-bottom: 16rpx;
  90. .header_img {
  91. width: 48rpx;
  92. height: 48rpx;
  93. margin-right: 16rpx;
  94. .img {
  95. width: inherit;
  96. height: inherit;
  97. border-radius: 8rpx;
  98. }
  99. }
  100. .create_time {
  101. .size(24rpx);
  102. color: var(--text);
  103. font-weight: 700;
  104. text {
  105. font-weight: 500;
  106. }
  107. }
  108. }
  109. .order_item {
  110. &_wrapper {
  111. margin-top: 16rpx;
  112. ._item_wrapper {
  113. .flex();
  114. .thumb_img {
  115. width: 140rpx;
  116. height: 140rpx;
  117. ._img {
  118. width: inherit;
  119. height: inherit;
  120. border-radius: 16rpx;
  121. }
  122. }
  123. .goods_info {
  124. margin-left: 16rpx;
  125. flex: 1;
  126. .info_name {
  127. color: var(--text);
  128. .size(24rpx);
  129. font-weight: 700;
  130. line-height: 44rpx;
  131. .ver();
  132. ._name {
  133. flex: 1;
  134. .ellipsis();
  135. margin-right: 8rpx;
  136. }
  137. }
  138. .spec_info {
  139. .flex();
  140. flex: 1;
  141. margin-top: 8rpx;
  142. color: var(--text-01);
  143. .size(24rpx);
  144. line-height: 40rpx;
  145. .spec_desc {
  146. flex: 1;
  147. margin-right: 8rpx;
  148. }
  149. }
  150. .no_return {
  151. border: var(--danger-bor);
  152. border-radius: 40rpx;
  153. color: var(--danger);
  154. cursor: pointer;
  155. .size(24rpx);
  156. line-height: 40rpx;
  157. margin-top: 16rpx;
  158. padding: 0 24rpx;
  159. width: max-content;
  160. }
  161. }
  162. }
  163. .order_status {
  164. color: var(--primary);
  165. .size(24rpx);
  166. height: 40rpx;
  167. .flex_position(flex-end);
  168. margin-top: 16rpx;
  169. .icon-question2 {
  170. .size(36rpx);
  171. }
  172. }
  173. .order-cancel {
  174. margin-top: 16rpx;
  175. color: var(--text-01);
  176. .size(24rpx);
  177. line-height: 40rpx;
  178. .time {
  179. color: var(--danger);
  180. font-weight: 700;
  181. }
  182. .content {
  183. margin-top: 8rpx;
  184. color: var(--text);
  185. font-weight: 500;
  186. }
  187. }
  188. }
  189. .order_footer {
  190. margin-top: 16rpx;
  191. border-top: 1px solid #f5f6f7;
  192. .order_price {
  193. padding-top: 16rpx;
  194. .flex_position(flex-end);
  195. color: var(--primary);
  196. color: var(--red);
  197. .size();
  198. font-weight: 700;
  199. height: 48rpx;
  200. line-height: 1;
  201. .price_text {
  202. color: var(--text);
  203. .size(24rpx);
  204. font-weight: 400;
  205. }
  206. .icon-question2 {
  207. font-weight: 400;
  208. color: var(--text-01);
  209. margin-left: 8rpx;
  210. }
  211. }
  212. .end_time {
  213. .flex_position(flex-end);
  214. margin-top: 16rpx;
  215. color: #e62e2e;
  216. font-weight: 700;
  217. .size(24rpx);
  218. text {
  219. font-weight: 400;
  220. }
  221. }
  222. .order_btns {
  223. .flex_position(flex-end);
  224. margin-top: 16rpx;
  225. gap: 16rpx;
  226. .btn {
  227. .flex_center();
  228. border-radius: 16rpx;
  229. padding: 0 30rpx;
  230. .size(24rpx);
  231. height: 48rpx;
  232. border: 1px solid var(--black);
  233. background-color: var(--light);
  234. color: var(--black);
  235. }
  236. .pay_btn {
  237. color: var(--light);
  238. background-color: var(--black);
  239. }
  240. }
  241. }
  242. }
  243. }
  244. </style>