金诚优选前端代码
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.

167 lines
3.6 KiB

  1. <template>
  2. <view>
  3. <lf-nav :spreadOut="true" :showIcon="true" bgColor="white" title="优惠券"></lf-nav>
  4. <view class="special_tab">
  5. <u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
  6. </view>
  7. <view class="coupon-wrap">
  8. <view class="coupon-card lf-m-b-30" :class="{'invalid-bg': i == 2}" v-for="i of 3">
  9. <view class="coupon-circle-top">
  10. <view class="coupon-circle1"></view>
  11. </view>
  12. <view class="coupon-circle-bottom">
  13. <view class="coupon-circle1"></view>
  14. </view>
  15. <view class="coupon-radius">
  16. <view class="coupon-left">
  17. <view class="lf-font-36 lf-color-white" style="line-height: 1;">
  18. <text></text>
  19. <text class="lf-font-70 lf-font-bold">200</text>
  20. </view>
  21. <view class="coupon-tag">
  22. 待使用
  23. </view>
  24. </view>
  25. <view class="coupon-right">
  26. <view class="lf-font-32 lf-font-bold lf-color-white">满1200减200</view>
  27. <view class="lf-font-24 lf-color-white">有效期2021.09.09-2021-09.15</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. current: 0,
  39. tab_list: [
  40. {name: '全部'},
  41. {name: '待使用'},
  42. {name: '已使用'},
  43. {name: '已过期'}
  44. ]
  45. }
  46. },
  47. methods: {
  48. tabChange(index){
  49. this.current = index;
  50. },
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .coupon-circle1 {
  56. width: 40rpx;
  57. height: 40rpx;
  58. background-color: white;
  59. border-radius: 50%;
  60. }
  61. .coupon-circle-top {
  62. width: 50rpx;
  63. height: 50rpx;
  64. border-radius: 50%;
  65. // background-color: red;
  66. position: absolute;
  67. border: 1px dashed #ccc;
  68. left: 190rpx;
  69. top: -20rpx;
  70. display: flex;
  71. align-items: center;
  72. text-align: center;
  73. justify-content: center;
  74. }
  75. .coupon-circle-bottom {
  76. width: 50rpx;
  77. height: 50rpx;
  78. border-radius: 50%;
  79. // background-color: red;
  80. position: absolute;
  81. border: 1px dashed #ccc;
  82. left: 190rpx;
  83. bottom: -20rpx;
  84. display: flex;
  85. align-items: center;
  86. text-align: center;
  87. justify-content: center;
  88. }
  89. .coupon-right {
  90. text-align: left;
  91. justify-content: center;
  92. align-items: flex-start;
  93. display: flex;
  94. flex-direction: column;
  95. margin-left: 84rpx;
  96. }
  97. .coupon-left {
  98. margin-left: 20rpx;
  99. display: flex;
  100. flex-direction: column;
  101. justify-content: center;
  102. align-items: center;
  103. }
  104. .coupon-tag {
  105. width: max-content;
  106. margin-top: 10rpx;
  107. padding: 0 24rpx;
  108. height: 43rpx;
  109. border-radius: 22rpx;
  110. border: 2rpx solid #FFFFFF;
  111. font-size: 24rpx;
  112. color: white;
  113. }
  114. .coupon-wrap {
  115. display: flex;
  116. justify-content: center;
  117. margin-top: 30rpx;
  118. flex-direction: column;
  119. align-content: center;
  120. align-items: center;
  121. }
  122. .coupon-card {
  123. overflow: hidden;
  124. position: relative;
  125. display: flex;
  126. align-items: center;
  127. justify-content: center;
  128. width: 674rpx;
  129. // display: flex;
  130. height: 171rpx;
  131. // opacity: 0.59;
  132. // border: 1rpx solid #FFFFFF;
  133. background: #15716E;
  134. border-radius: 20rpx;
  135. }
  136. .invalid-bg{
  137. background-color: #999999;
  138. }
  139. .coupon-radius {
  140. width: 664rpx;
  141. display: flex;
  142. height: 161rpx;
  143. border: 1rpx dashed #ccc;
  144. // background: #15716E;
  145. border-radius: 20rpx;
  146. }
  147. /deep/.u-scroll-box {
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  152. }
  153. /deep/.special_tab .u-tabs .u-scroll-box .u-tab-bar {
  154. background-color: #15716E!important;
  155. width: 80rpx!important;
  156. position: absolute;
  157. height: 10rpx;
  158. left: 0;
  159. border-radius: 8rpx 8rpx 0px 0px!important;
  160. bottom: -12rpx;
  161. }
  162. /deep/ .u-tab-item {
  163. font-size: 28rpx!important;
  164. }
  165. </style>