鸿宇研学生前端代码
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.

86 lines
2.2 KiB

2 months ago
2 months ago
2 months ago
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. import { mapState } from 'vuex'
  14. export default {
  15. data() {
  16. return {
  17. }
  18. },
  19. computed: {
  20. ...mapState(['userCenterData']),
  21. list() {
  22. return [
  23. // 订单状态 0待支付 1已支付 2已完成
  24. { id: '001', label: '待支付', value: this.userCenterData.orderStatus0 || 0, index: 1, icon: '/pages_order/static/center/order-1.png' },
  25. { id: '002', label: '已支付', value: this.userCenterData.orderStatus1 || 0, index: 2, icon: '/pages_order/static/center/order-2.png' },
  26. { id: '003', label: '已完成', value: this.userCenterData.orderStatus2 || 0, index: 3, icon: '/pages_order/static/center/order-3.png' },
  27. // todo: check
  28. { id: '004', label: '售后', value: 0, index: 0, icon: '/pages_order/static/center/order-4.png' },
  29. { id: '005', label: '全部', index: 0, icon: '/pages_order/static/center/order-5.png' },
  30. ]
  31. }
  32. },
  33. methods: {
  34. jumpToOrderList(index) {
  35. this.$utils.navigateTo(`/pages_order/order/orderList/index?index=${index}`)
  36. }
  37. },
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. @import './styles/card.scss';
  42. .card {
  43. padding: 32rpx;
  44. column-gap: 16rpx;
  45. }
  46. .icon {
  47. position: relative;
  48. width: 48rpx;
  49. height: 48rpx;
  50. &-img {
  51. width: 100%;
  52. height: 100%;
  53. }
  54. .sup {
  55. position: absolute;
  56. top: 0;
  57. right: 0;
  58. transform: translate(50%, -50%);
  59. min-width: 32rpx;
  60. height: 32rpx;
  61. font-family: PingFang SC;
  62. font-weight: 500;
  63. font-size: 24rpx;
  64. line-height: 1.3;
  65. color: #FFFFFF;
  66. background: #F53F3F;
  67. border-radius: 32rpx;
  68. }
  69. }
  70. .label {
  71. margin-top: 12rpx;
  72. font-family: PingFang SC;
  73. font-weight: 400;
  74. font-size: 28rpx;
  75. line-height: 1;
  76. color: #252545;
  77. }
  78. </style>