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

96 lines
2.4 KiB

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