s-order-card.vue 2.5 KB

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