my-ticket.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="my-ticket flex-common-css">
  3. <Nav title="我的优惠券" titleColor="#333" bgckgroundBox='#fff'></Nav>
  4. <view class="tab-box flex-justify-around bgc-f ">
  5. <view class="tab-but flex-1 flex-direction align-items-center" @click="tabStitle(index)"
  6. v-for="(item, index) in tabList" :key="index">
  7. <view class="fs-32 mb-18" :class="tabNum==index?'fc-41ABF5':'fc-3'">
  8. {{item}}
  9. </view>
  10. <view v-show="tabNum==index" class="tab-hr bgc-41ABF5"></view>
  11. </view>
  12. </view>
  13. <scroll-view :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  14. <view class="list-box">
  15. <view class="item-box display-flex mb-20" v-for="(item,index) in itemData" :key="index">
  16. <view class="item-left flex-direction align-items-center flex-justify-center"
  17. :class="item.type == 0?'bgc-FCE7E2':'bgc-E6E6E6'">
  18. <view class="align-items-center">
  19. <view class="fs-30 fw-600" :class="item.type == 0?'fc-FB3D03':'fc-9'">¥</view>
  20. <view class="fs-48 fw-600" :class="item.type == 0?'fc-FB3D03':'fc-9'">10</view>
  21. </view>
  22. <view class="fs-24" :class="item.type == 0?'fc-6':'fc-9'">
  23. 满90元可用
  24. </view>
  25. <view class="ball"></view>
  26. <view class="ball-two"></view>
  27. </view>
  28. <view class="item-hr" :class="item.type == 0?'':'item-hr-two'"></view>
  29. <view class="item-right flex-1 bgc-f">
  30. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis"
  31. :class="item.type == 0?'fc-3':'fc-9'">
  32. {{item.name}}
  33. </view>
  34. <view class="fs-24 fc-FB3D03 mb-12" v-if="item.type == 0">
  35. 仅剩时间:01:59:32
  36. </view>
  37. <view class="fs-24 fc-9 mb-12" v-else>
  38. 2024.05.08-2024.05.24
  39. </view>
  40. <view class="flex-justify-space">
  41. <view class="fs-24" :class="item.type == 0?'fc-3':'fc-9'">
  42. 券类型:外卖券
  43. </view>
  44. <view class="align-items-center">
  45. <view class="fs-24 fc-9">
  46. 规则
  47. </view>
  48. <image class="toRight" src="@/static/img/toRight.png" mode=""></image>
  49. </view>
  50. </view>
  51. <view class="item-but fc-FB3D03" v-if="item.type == 0">
  52. 去使用
  53. </view>
  54. <image class="item-img" src="@/static/img/my/ysy.png" mode="" v-else-if="item.type == 1">
  55. </image>
  56. <image class="item-img" src="@/static/img/my/ysx.png" mode="" v-else></image>
  57. </view>
  58. </view>
  59. </view>
  60. </scroll-view>
  61. <view class="bot-but flex-justify-center align-items-center bgc-f" @click="goToUrl(2)">
  62. <view class="fc-41ABF5 fs-32 fw-600 mr-8">
  63. 去领券中心
  64. </view>
  65. <image class="toRight" src="@/static/img/my/to-right.png" mode=""></image>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. components: {},
  72. data() {
  73. return {
  74. tabList: ['待使用', '已使用', '已失效'],
  75. tabNum: 0,
  76. itemData: [{
  77. type: 0,
  78. name: '优惠券名称优惠券名称惠券名'
  79. },
  80. {
  81. type: 0,
  82. name: '优惠券名称'
  83. }, {
  84. type: 1,
  85. name: '优惠券名称'
  86. }, {
  87. type: 2,
  88. name: '优惠券名称优惠券名称惠券名'
  89. },
  90. {
  91. type: 2,
  92. name: '优惠券名称优惠券名称惠券名'
  93. },
  94. {
  95. type: 2,
  96. name: '优惠券名称优惠券名称惠券名'
  97. }
  98. ]
  99. };
  100. },
  101. mounted() {},
  102. methods: {
  103. tabStitle(index) {
  104. this.tabNum = index
  105. },
  106. scrolltolower() {}
  107. },
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .tab-box {
  112. padding: 22rpx 0 4rpx 0;
  113. }
  114. .tab-hr {
  115. width: 40rpx;
  116. height: 4rpx;
  117. border-radius: 2rpx;
  118. }
  119. .list-box {
  120. padding: 24rpx 20rpx 4rpx;
  121. box-sizing: border-box;
  122. }
  123. .item-hr {
  124. width: 0px;
  125. height: auto;
  126. border-right: 1rpx dashed #FB7850;
  127. }
  128. .item-hr-two {
  129. width: 0px;
  130. height: auto;
  131. border-right: 1rpx dashed #999;
  132. }
  133. .item-left {
  134. width: 200rpx;
  135. height: auto;
  136. padding: 34rpx 36rpx 44rpx;
  137. box-sizing: border-box;
  138. position: relative;
  139. border-radius: 20rpx 0 0 20rpx;
  140. }
  141. .ball {
  142. width: 24rpx;
  143. height: 24rpx;
  144. border-radius: 50%;
  145. position: absolute;
  146. top: -12rpx;
  147. right: -12rpx;
  148. background: #F5F5F5;
  149. z-index: 10;
  150. }
  151. .ball-two {
  152. width: 24rpx;
  153. height: 24rpx;
  154. border-radius: 50%;
  155. position: absolute;
  156. background: #F5F5F5;
  157. z-index: 10;
  158. bottom: -12rpx;
  159. right: -12rpx;
  160. }
  161. .item-right {
  162. padding: 24rpx;
  163. box-sizing: border-box;
  164. border-radius: 0 20rpx 20rpx 0;
  165. position: relative;
  166. }
  167. .ticket-name {
  168. max-width: 280rpx;
  169. }
  170. .toRight {
  171. width: 32rpx;
  172. height: 32rpx;
  173. }
  174. .item-but {
  175. width: 124rpx;
  176. height: 52rpx;
  177. text-align: center;
  178. line-height: 52rpx;
  179. border: 1rpx solid #FB3D03;
  180. border-radius: 200rpx;
  181. position: absolute;
  182. bottom: 55%;
  183. right: 24rpx;
  184. }
  185. .item-img {
  186. width: 88rpx;
  187. height: 88rpx;
  188. position: absolute;
  189. bottom: 40%;
  190. right: 24rpx;
  191. }
  192. .bot-but {
  193. padding: 22rpx 0;
  194. }
  195. </style>