s-order-card.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!-- 装修用户组件:用户订单 -->
  2. <template>
  3. <view class="ss-order-menu-wrap ss-flex ss-col-center">
  4. <view class="menu-item ss-flex-1 ss-flex-col ss-row-center ss-col-center" v-for="item in orderMap"
  5. :key="item.title" @tap="sheep.$router.go(item.path, { type: item.value })">
  6. <uni-badge class="uni-badge-left-margin" :text="numData.orderCount[item.count]" absolute="rightTop"
  7. size="small">
  8. <image class="item-icon" :src="sheep.$url.static(item.icon)" mode="aspectFit" />
  9. </uni-badge>
  10. <view class="menu-title ss-m-t-28">{{ item.title }}</view>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. /**
  16. * 装修组件 - 订单菜单组
  17. */
  18. import sheep from '@/sheep';
  19. import {
  20. computed
  21. } from 'vue';
  22. import {
  23. useI18n
  24. } from 'vue-i18n';
  25. const {
  26. t
  27. } = useI18n();
  28. const orderMap = [{
  29. title: t('order.pending_payment'),
  30. value: '1',
  31. icon: '/static/images/no_pay.png',
  32. path: '/pages/order/list',
  33. type: 'unpaid',
  34. count: 'unpaidCount',
  35. },
  36. {
  37. title: t('order.pending_shipment'),
  38. value: '2',
  39. icon: '/static/images/change_order.png',
  40. path: '/pages/order/list',
  41. type: 'undelivered',
  42. count: 'undeliveredCount',
  43. },
  44. {
  45. title: t('order.pending_receipt'),
  46. value: '3',
  47. icon: '/static/images/no_take.png',
  48. path: '/pages/order/list',
  49. type: 'noget',
  50. count: 'deliveredCount',
  51. },
  52. {
  53. title: t('order.pending_review'),
  54. value: '4',
  55. icon: '/static/images/no_comment.png',
  56. path: '/pages/order/list',
  57. type: 'nocomment',
  58. count: 'uncommentedCount',
  59. },
  60. {
  61. title: t('order.all_orders'),
  62. value: '0',
  63. icon: '/static/images/all_order.png',
  64. path: '/pages/order/list',
  65. },
  66. ];
  67. const numData = computed(() => sheep.$store('user').numData);
  68. </script>
  69. <style lang="scss" scoped>
  70. .ss-order-menu-wrap {
  71. .menu-item {
  72. height: 160rpx;
  73. position: relative;
  74. z-index: 10;
  75. .menu-title {
  76. font-size: 24rpx;
  77. line-height: 24rpx;
  78. color: #333333;
  79. }
  80. .item-icon {
  81. width: 44rpx;
  82. height: 44rpx;
  83. }
  84. .num-icon {
  85. position: absolute;
  86. right: 18rpx;
  87. top: 18rpx;
  88. // width: 40rpx;
  89. padding: 0 8rpx;
  90. height: 26rpx;
  91. background: #ff4d4f;
  92. border-radius: 13rpx;
  93. color: #fefefe;
  94. display: flex;
  95. align-items: center;
  96. .num {
  97. font-size: 24rpx;
  98. transform: scale(0.8);
  99. }
  100. }
  101. }
  102. }
  103. </style>