国外MOSE官网
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.

139 lines
2.7 KiB

4 days ago
4 days ago
  1. <template>
  2. <view class="points-card">
  3. <!-- 可用积分背景 -->
  4. <view class="points-background">
  5. <image src="/static/可用积分背景图.png" class="bg-image" mode="aspectFill"></image>
  6. <!-- 积分内容 -->
  7. <view class="points-content">
  8. <view class="points-text">
  9. <text class="points-label">可用积分</text>
  10. <text class="points-value">{{ points }}</text>
  11. </view>
  12. </view>
  13. <!-- 积分明细按钮 -->
  14. <view class="points-detail" @click="showPointsDetail">
  15. <image src="/static/商城_积分明细框.png" class="detail-bg" mode="aspectFit"></image>
  16. <text class="detail-text">积分明细</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'PointsCard',
  24. props: {
  25. points: {
  26. type: [String, Number],
  27. default: 1385
  28. }
  29. },
  30. methods: {
  31. showPointsDetail() {
  32. // 跳转到积分明细页面
  33. uni.navigateTo({
  34. url: '/subPages/shop/pointsDetail'
  35. })
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .points-card {
  42. width: 96%;
  43. margin: 0 auto;
  44. // margin-top: -80rpx;
  45. position: relative;
  46. z-index: 10;
  47. }
  48. .points-background {
  49. position: relative;
  50. width: 100%;
  51. height: 290rpx;
  52. border-radius: 20rpx;
  53. overflow: hidden;
  54. .bg-image {
  55. width: 100%;
  56. height: 100%;
  57. position: absolute;
  58. top: 0;
  59. left: 0;
  60. }
  61. .points-content {
  62. position: absolute;
  63. top: 0;
  64. left: 0;
  65. width: 100%;
  66. height: 100%;
  67. display: flex;
  68. align-items: center;
  69. justify-content: space-between;
  70. padding: 0 40rpx;
  71. .points-text {
  72. // background: red;
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. // justify-content: center;
  77. gap: 10rpx;
  78. .points-label {
  79. font-size: 30rpx;
  80. color: #ffffff;
  81. margin-bottom: 15rpx;
  82. opacity: 0.9;
  83. }
  84. .points-value {
  85. font-size: 58rpx;
  86. color: #ffffff;
  87. font-weight: bold;
  88. line-height: 1;
  89. }
  90. }
  91. .points-icon {
  92. width: 120rpx;
  93. height: 120rpx;
  94. .icon-image {
  95. width: 100%;
  96. height: 100%;
  97. }
  98. }
  99. }
  100. .points-detail {
  101. position: absolute;
  102. bottom: 10rpx;
  103. left: 30rpx;
  104. width: 160rpx;
  105. height: 60rpx;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. .detail-bg {
  110. position: absolute;
  111. width: 100%;
  112. height: 100%;
  113. top: 0;
  114. left: 0;
  115. }
  116. .detail-text {
  117. font-size: 24rpx;
  118. color: $uni-color-primary;
  119. position: relative;
  120. z-index: 1;
  121. }
  122. }
  123. }
  124. </style>