sh-order-card.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <!-- 订单卡片 -->
  3. <view class="sh-order-box u-flex u-m-b-10 u-p-r-20">
  4. <view class="order-box u-flex">
  5. <view class="order-item u-flex-col " @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
  6. <view class="u-flex-col item-box u-col-center">
  7. <image class="order-img" :src="$IMG_URL + order.img" mode=""></image>
  8. <text class="item-title">{{ order.title }}</text>
  9. <view class="badge" v-if="orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
  10. </view>
  11. </view>
  12. <view class="order-item u-flex-col " @tap="jump('/pages/order/after-sale/list')">
  13. <view class="u-flex-col item-box u-col-center">
  14. <image class="order-img" :src="$IMG_URL + '/imgs/user/tab55.png'" mode=""></image>
  15. <text class="item-title">退换货</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="order-item u-flex-col all-order " @tap="jump('/pages/order/list', { type: 'all' })">
  20. <image class="cut-off--line" :src="$IMG_URL + '/imgs/user/cut_off_line.png'" mode=""></image>
  21. <view class="u-flex-col item-box u-col-center">
  22. <image class="order-img" :src="$IMG_URL + '/imgs/user/all_order.png'" mode="aspectFill"></image>
  23. <text class="item-title">全部订单</text>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. /**
  30. * 订单中心卡片
  31. *
  32. */
  33. import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
  34. export default {
  35. components: {},
  36. data() {
  37. return {
  38. orderNav: [
  39. {
  40. id: 1,
  41. title: '待付款',
  42. img: '/imgs/user/tab11.png',
  43. type: 'nopay'
  44. },
  45. // {
  46. // id: 2,
  47. // title: '待发货',
  48. // img: this.$IMG_URL + '/imgs/user/tab22.png',
  49. // type: 'nosend'
  50. // },
  51. {
  52. id: 3,
  53. title: '待收货',
  54. img: '/imgs/user/tab33.png',
  55. type: 'noget'
  56. },
  57. {
  58. id: 4,
  59. title: '待评价',
  60. img: '/imgs/user/tab44.png',
  61. type: 'nocomment'
  62. }
  63. // {
  64. // id: 5,
  65. // title: '退换货',
  66. // img: this.$IMG_URL + '/imgs/user/tab55.png',
  67. // type: 'aftersale'
  68. // }
  69. ]
  70. };
  71. },
  72. computed: {
  73. ...mapGetters(['isLogin', 'userOtherData']),
  74. orderNum() {
  75. return this.userOtherData.order_num || 0;
  76. }
  77. },
  78. methods: {
  79. jump(path, query) {
  80. this.$Router.push({
  81. path: path,
  82. query: query
  83. });
  84. }
  85. }
  86. };
  87. </script>
  88. <style lang="scss">
  89. .badge {
  90. position: absolute;
  91. /* #ifndef APP-NVUE */
  92. display: inline-flex;
  93. /* #endif */
  94. justify-content: center;
  95. align-items: center;
  96. line-height: 24rpx;
  97. padding: 4rpx 10rpx;
  98. border-radius: 100rpx;
  99. color: #fff;
  100. font-size: 24rpx;
  101. z-index: 9;
  102. background-color: $u-type-error;
  103. transform: scale(0.8);
  104. transform-origin: center center;
  105. left: 100rpx;
  106. top: -6rpx;
  107. white-space: nowrap;
  108. }
  109. // 订单卡片
  110. .sh-order-box {
  111. height: 180rpx;
  112. background: #fff;
  113. .order-box {
  114. flex: 4;
  115. }
  116. .all-order {
  117. position: relative;
  118. .cut-off--line {
  119. position: absolute;
  120. top: 50%;
  121. transform: translateY(-50%);
  122. right: (750rpx/5) - 15rpx;
  123. width: 30rpx;
  124. height: 136rpx;
  125. }
  126. }
  127. .order-item {
  128. flex: 1;
  129. .item-box {
  130. position: relative;
  131. }
  132. .order-img {
  133. width: 46rpx;
  134. height: 46rpx;
  135. }
  136. .item-title {
  137. font-size: 26rpx;
  138. font-weight: 500;
  139. color: rgba(153, 153, 153, 1);
  140. line-height: 24rpx;
  141. margin-top: 20rpx;
  142. }
  143. }
  144. }
  145. </style>