s-order-card.vue 2.4 KB

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