coupon.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="container">
  3. <!-- 头部优惠券总数量区域 -->
  4. <view class="header">
  5. 可使用优惠券
  6. <text>5张</text>
  7. </view>
  8. <!-- 优惠券列表区域 -->
  9. <view class="body">
  10. <!-- 每一张优惠券区域 -->
  11. <view class="body_item" v-for="item in list" :key="item.id">
  12. <img src="../../static/my/couponTitle.png" />
  13. <view class="item_type" v-if="item.type === 1">折扣卷</view>
  14. <view class="item_type" v-if="item.type === 2">代金卷</view>
  15. <view class="item_box">
  16. <view class="box_left">
  17. <view class="left_title">{{ item.name }}</view>
  18. <view class="left_tags">
  19. <view class="tag">有限期至2023.09.01</view>
  20. <view class="tag">可通用</view>
  21. <view class="tag">全民宿</view>
  22. </view>
  23. </view>
  24. <view class="box_right">
  25. <view class="right_info">
  26. <view class="info_top">{{ item.info }}</view>
  27. <view class="info_bottom">满200可用</view>
  28. </view>
  29. <view class="right_radio">
  30. <radio style="transform: scale(0.8)" color="#096562" :checked="item.isCheck" @click="handleChange(item)" />
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 底部确定按钮区域 -->
  37. <view class="foot_btn">确定</view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. list: [
  45. {
  46. id: 1,
  47. name: '7.5折折扣卷',
  48. type: 1,
  49. info: '7.5折',
  50. isCheck: false
  51. },
  52. {
  53. id: 2,
  54. name: '20元代金券',
  55. type: 2,
  56. info: '¥20',
  57. isCheck: false
  58. },
  59. {
  60. id: 3,
  61. name: '7.5折折扣卷',
  62. type: 1,
  63. info: '7.5折',
  64. isCheck: false
  65. }
  66. ]
  67. }
  68. },
  69. methods: {
  70. handleChange(item) {
  71. item.isCheck = !item.isCheck
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .container {
  78. box-sizing: border-box;
  79. padding: 0 30rpx;
  80. height: 100vh;
  81. background-color: #f7f7f7;
  82. .header {
  83. display: flex;
  84. align-items: center;
  85. height: 100rpx;
  86. font-size: 32rpx;
  87. text {
  88. margin-top: 10rpx;
  89. margin-left: 15rpx;
  90. color: #808080;
  91. font-size: 24rpx;
  92. }
  93. }
  94. .body {
  95. height: calc(100vh - 245rpx);
  96. overflow-y: auto;
  97. .body_item {
  98. position: relative;
  99. margin-bottom: 10rpx;
  100. padding-bottom: 10rpx;
  101. width: 690rpx;
  102. border-radius: 15rpx;
  103. background-color: #fff;
  104. img {
  105. width: 100rpx;
  106. height: 36rpx;
  107. }
  108. .item_type {
  109. position: absolute;
  110. top: 0;
  111. left: 14rpx;
  112. font-size: 24rpx;
  113. font-weight: bold;
  114. color: #fff;
  115. }
  116. .item_box {
  117. padding: 0 25rpx;
  118. display: flex;
  119. .box_left {
  120. flex: 6;
  121. overflow: hidden;
  122. .left_title {
  123. margin: 12rpx 0;
  124. font-size: 36rpx;
  125. font-weight: bold;
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. white-space: nowrap;
  129. }
  130. .left_tags {
  131. display: flex;
  132. flex-wrap: wrap;
  133. color: #808080;
  134. font-size: 24rpx;
  135. .tag {
  136. margin-right: 32rpx;
  137. margin-bottom: 15rpx;
  138. }
  139. }
  140. }
  141. .box_right {
  142. flex: 2;
  143. display: flex;
  144. .right_info {
  145. flex: 1;
  146. display: flex;
  147. flex-direction: column;
  148. width: 100rpx;
  149. color: #ff5733;
  150. .info_top {
  151. margin-top: 10rpx;
  152. font-size: 36rpx;
  153. }
  154. .info_bottom {
  155. margin-top: 10rpx;
  156. font-size: 20rpx;
  157. }
  158. }
  159. .right_radio {
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. width: 40rpx;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. .foot_btn {
  170. display: flex;
  171. justify-content: center;
  172. align-items: center;
  173. margin: 32rpx 0 17rpx;
  174. width: 690rpx;
  175. height: 96rpx;
  176. color: #fff;
  177. font-size: 32rpx;
  178. font-weight: bold;
  179. border-radius: 64rpx;
  180. background-color: #096562;
  181. }
  182. }
  183. </style>