sh-wallet.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <!-- 钱包卡片 -->
  3. <view class="sh-wallet-box u-flex u-m-b-10 u-p-r-20">
  4. <view class="u-flex wallet-left">
  5. <view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/wallet/index')">
  6. <text class="wallet-item__detail item-balance u-ellipsis-1">{{ userInfo.money || '0' }}</text>
  7. <text class="wallet-item__title">账户余额</text>
  8. </view>
  9. <view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/user/wallet/score-balance')">
  10. <text class="wallet-item__detail item-score u-ellipsis-1">{{ userInfo.score || '0' }}</text>
  11. <text class="wallet-item__title">积分</text>
  12. </view>
  13. <view class="wallet-item u-flex-col u-col-center" @tap="jump('/pages/app/coupon/list')">
  14. <text class="wallet-item__detail item-coupon u-ellipsis-1">{{ userOtherData.coupons_num || '0' }}</text>
  15. <text class="wallet-item__title">优惠券</text>
  16. </view>
  17. </view>
  18. <view class="wallet-item u-flex-col wallet-right u-col-center" @tap="jump('/pages/user/wallet/index')">
  19. <image class="cut-off--line" :src="$IMG_URL + '/imgs/user/cut_off_line.png'" mode=""></image>
  20. <image class="wallet-img" :src="$IMG_URL + '/imgs/user/wallet.png'" mode="aspectFill"></image>
  21. <text class="wallet-item__title">我的钱包</text>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. /**
  27. * 钱包样式卡片
  28. */
  29. import { mapMutations, mapActions, mapState, mapGetters } from 'vuex';
  30. export default {
  31. components: {},
  32. data() {
  33. return {};
  34. },
  35. computed: {
  36. ...mapGetters(['userInfo', 'userOtherData'])
  37. },
  38. methods: {
  39. jump(path, query) {
  40. this.$Router.push({
  41. path: path,
  42. query: query
  43. });
  44. }
  45. }
  46. };
  47. </script>
  48. <style lang="scss">
  49. // 钱包卡片
  50. .sh-wallet-box {
  51. background: #fff;
  52. height: 180rpx;
  53. position: relative;
  54. .wallet-left {
  55. flex: 4;
  56. }
  57. .wallet-right {
  58. position: relative;
  59. .cut-off--line {
  60. position: absolute;
  61. top: 50%;
  62. transform: translateY(-50%);
  63. right: (750rpx/5) - 15rpx;
  64. width: 30rpx;
  65. height: 136rpx;
  66. }
  67. }
  68. .wallet-item {
  69. flex: 1;
  70. .wallet-img {
  71. width: 46rpx;
  72. height: 46rpx;
  73. }
  74. .wallet-item__detail {
  75. font-size: 28rpx;
  76. width: 180rpx;
  77. text-align: center;
  78. font-weight: 500;
  79. color: rgba(168, 112, 13, 1);
  80. }
  81. .wallet-item__title {
  82. font-size: 26rpx;
  83. font-weight: 400;
  84. color: rgba(153, 153, 153, 1);
  85. margin-top: 20rpx;
  86. }
  87. .item-balance::after {
  88. content: '元';
  89. font-size: 16rpx;
  90. margin-left: 4rpx;
  91. }
  92. .item-score::after {
  93. content: '个';
  94. font-size: 14rpx;
  95. margin-left: 4rpx;
  96. }
  97. .item-coupon::after {
  98. content: '张';
  99. font-size: 16rpx;
  100. margin-left: 4rpx;
  101. }
  102. }
  103. }
  104. </style>