hua-level-bar.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <!-- 等级 -->
  4. <view class="level d-flex align-items-center justify-content-between">
  5. <view class="left">
  6. <view class="curLevel">
  7. <view class="top d-flex align-items-center">
  8. <image :src="data.image" mode=""></image>
  9. <text class="level-name">{{ data.name ? data.name : '默认等级' }}</text>
  10. </view>
  11. <view class="progress">
  12. <u-line-progress :percent="data.diff_growth_percent * 100" :showText="false"
  13. activeColor="#687B8B" inactiveColor="#ffffff" height="4"
  14. :showPercent="false"></u-line-progress>
  15. </view>
  16. <text class="used">已消费{{ userInfo.total_order_amount }}金额</text>
  17. </view>
  18. </view>
  19. <view class="right d-flex ">
  20. <view class="item text-center">
  21. <view class="icon"><text class="iconfont">&#xe649;</text></view>
  22. <text>消费返券</text>
  23. </view>
  24. <view class="item text-center">
  25. <view class="icon"><text class="iconfont">&#xe649;</text></view>
  26. <text>新人有礼</text>
  27. </view>
  28. <text class="iconfont more">&#xe63c;</text>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. mapGetters,
  36. mapActions
  37. } from 'vuex';
  38. export default {
  39. name: 'hua-level-bar',
  40. props: {
  41. data: {}
  42. },
  43. data() {
  44. return {};
  45. },
  46. onLoad() {
  47. console.log(this.data);
  48. },
  49. computed: {
  50. ...mapGetters(['userInfo'])
  51. }
  52. };
  53. </script>
  54. <style lang="scss">
  55. .level {
  56. width: 100%;
  57. background: url('https://shop.xianghuaqi.net.cn/images/levelbg.png') no-repeat;
  58. background-size: 100% 100%;
  59. margin: 24upx auto;
  60. padding: 18upx 30upx;
  61. box-sizing: border-box;
  62. .left {
  63. width: 176upx;
  64. .top {
  65. image {
  66. width: 32upx;
  67. height: 36upx;
  68. margin-right: 20upx;
  69. }
  70. text {
  71. font-size: 28upx;
  72. font-weight: bold;
  73. color: #5d707f;
  74. }
  75. }
  76. .progress {
  77. // margin: 12upx 0 8upx;
  78. }
  79. .used {
  80. font-size: 20upx;
  81. color: #5d707f;
  82. line-height: 1;
  83. }
  84. }
  85. .right {
  86. position: relative;
  87. .item {
  88. margin-left: 80upx;
  89. }
  90. .icon {
  91. width: 52upx;
  92. height: 52upx;
  93. background-color: #d7eaf4;
  94. border-radius: 50%;
  95. text-align: center;
  96. line-height: 52upx;
  97. color: #93a2aa;
  98. margin: 0 auto;
  99. .iconfont {
  100. font-size: 40upx;
  101. }
  102. }
  103. text {
  104. color: #5d707f;
  105. font-size: 20upx;
  106. }
  107. .more {
  108. position: relative;
  109. right: 0;
  110. top: 0;
  111. display: block;
  112. }
  113. }
  114. }
  115. </style>