coupon.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view>
  3. <u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="卡券使用记录"></u-navbar>
  4. <!-- 卡券筛选 -->
  5. <view class="prize-state">
  6. <u-tabs @change="changeTab" :scrollable="false" :list="stateArr" lineWidth="40" lineHeight="1"
  7. lineColor="#D70909" :activeStyle="{
  8. color: '#D70909',
  9. transform: 'scale(1)'
  10. }" :inactiveStyle="{
  11. color: '#333',
  12. transform: 'scale(1)'
  13. }" itemStyle="padding-left: 25px; padding-right: 25px; height: 44px;">
  14. </u-tabs>
  15. </view>
  16. <!-- 已使用 -->
  17. <view class="prize-coupon">
  18. <view class="prize-coupon-list">
  19. <view class="flex prize-coupon-list-item">
  20. <image src="../../static/logo.png" mode=""></image>
  21. <view class="flex info">
  22. <view class="flex desc">
  23. <view class="title">200元代金券</view>
  24. <view class="txt">使用期限:2022.03.02-2022.04.01</view>
  25. <view class="txt">使用范围:星巴克xxx店</view>
  26. </view>
  27. <view class="flex btn">
  28. <view class="amt"><text>¥</text>100</view>
  29. </view>
  30. <view class="state">已使用</view>
  31. </view>
  32. </view>
  33. <view class="flex prize-coupon-list-item">
  34. <image src="../../static/logo.png" mode=""></image>
  35. <view class="flex info">
  36. <view class="flex desc">
  37. <view class="title">200元代金券</view>
  38. <view class="txt">使用期限:2022.03.02-2022.04.01</view>
  39. <view class="txt">适用范围:星巴克xxx店</view>
  40. </view>
  41. <view class="flex btn">
  42. <view class="amt"><text>¥</text>100</view>
  43. </view>
  44. <view class="state">已过期</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. stateArr: [{
  56. name: '已使用'
  57. }, {
  58. name: '已过期',
  59. }],
  60. state: 0,
  61. };
  62. },
  63. methods: {
  64. changeTab(e) {
  65. if (e.index == 0) {
  66. this.state = 0
  67. } else if (e.index == 1) {
  68. this.state = 1
  69. }
  70. },
  71. changeChecked() {
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .prize-state {
  78. position: fixed;
  79. background-color: #FFFFFF;
  80. width: 100%;
  81. padding-bottom: 16rpx;
  82. z-index: 10;
  83. }
  84. .prize-coupon {
  85. margin-top: 104rpx;
  86. padding: 40rpx 30rpx 100rpx;
  87. &-list {
  88. &-item {
  89. justify-content: space-between;
  90. background-color: #FFFFFF;
  91. padding: 40rpx 20rpx;
  92. border-radius: 10rpx;
  93. margin-bottom: 40rpx;
  94. image {
  95. width: 94rpx;
  96. height: 132rpx;
  97. }
  98. .info {
  99. position: relative;
  100. justify-content: space-between;
  101. flex: 1;
  102. }
  103. .desc {
  104. height: 132rpx;
  105. flex-direction: column;
  106. justify-content: space-between;
  107. align-items: flex-start;
  108. padding-left: 20rpx;
  109. }
  110. .txt {
  111. font-size: 24rpx;
  112. }
  113. .btn {
  114. flex-direction: column;
  115. }
  116. .amt {
  117. font-size: 48rpx;
  118. font-weight: bold;
  119. line-height: 72rpx;
  120. }
  121. text {
  122. font-size: 24rpx;
  123. }
  124. .state{
  125. position: absolute;
  126. right: 50rpx;
  127. transform: rotate(20deg);
  128. -webkit-transform:rotate(20deg);
  129. width: 150rpx;
  130. height: 150rpx;
  131. line-height: 150rpx;
  132. border: #E1E1E1 4px solid;
  133. border-radius: 50%;
  134. background-color: #f9f2ef;
  135. text-align: center;
  136. color: #000000;
  137. opacity: .5;
  138. }
  139. }
  140. &-item:last-child {
  141. margin-bottom: 0;
  142. }
  143. }
  144. }
  145. </style>