普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.2 KiB

2 months ago
2 months ago
  1. <template>
  2. <view class="flex card cols">
  3. <view class="flex flex-column col" v-for="item in list" :key="item.id" @click="jumpToOrderList(item.index)">
  4. <view class="icon">
  5. <image class="icon-img" :src="item.icon" mode="scaleToFill"></image>
  6. <view class="flex sup" v-if="item.value">{{ item.value }}</view>
  7. </view>
  8. <view class="label">{{ item.label }}</view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. props: {
  15. statistics: {
  16. type: Object,
  17. default() {
  18. return {}
  19. }
  20. }
  21. },
  22. data() {
  23. return {
  24. }
  25. },
  26. computed: {
  27. list() {
  28. return [
  29. { id: '001', label: '待支付', value: this.statistics[0] || 0, index: 1, icon: '/pages_order/static/center/order-1.png' },
  30. { id: '002', label: '待发货', value: this.statistics[1] || 0, index: 2, icon: '/pages_order/static/center/order-2.png' },
  31. { id: '003', label: '待收货', value: this.statistics[2] || 0, index: 3, icon: '/pages_order/static/center/order-3.png' },
  32. // todo: check
  33. { id: '004', label: '售后', value: this.statistics['afterSales'] || 0, index: 0, icon: '/pages_order/static/center/order-4.png' },
  34. { id: '005', label: '全部', index: 0, icon: '/pages_order/static/center/order-5.png' },
  35. ]
  36. }
  37. },
  38. methods: {
  39. jumpToOrderList(index) {
  40. this.$utils.navigateTo(`/pages_order/order/orderList/index?index=${index}`)
  41. }
  42. },
  43. }
  44. </script>
  45. <style scoped lang="scss">
  46. @import './styles/card.scss';
  47. .card {
  48. padding: 32rpx;
  49. column-gap: 16rpx;
  50. }
  51. .icon {
  52. position: relative;
  53. width: 48rpx;
  54. height: 48rpx;
  55. &-img {
  56. width: 100%;
  57. height: 100%;
  58. }
  59. .sup {
  60. position: absolute;
  61. top: 0;
  62. right: 0;
  63. transform: translate(50%, -50%);
  64. min-width: 32rpx;
  65. height: 32rpx;
  66. font-family: PingFang SC;
  67. font-weight: 500;
  68. font-size: 24rpx;
  69. line-height: 1.3;
  70. color: #FFFFFF;
  71. background: #F53F3F;
  72. border-radius: 32rpx;
  73. }
  74. }
  75. .label {
  76. margin-top: 12rpx;
  77. font-family: PingFang SC;
  78. font-weight: 400;
  79. font-size: 28rpx;
  80. line-height: 1;
  81. color: #252545;
  82. }
  83. </style>