coupon.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view>
  3. <uni-popup ref="popupCoupon" type="bottom">
  4. <view class="pop-coupon box-border-box p-24">
  5. <view class="text-align-center fs-36 fw-600 box-title mb-32">
  6. 选择优惠券
  7. <uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
  8. </view>
  9. <view class="flex-justify-around">
  10. <view @click="setType(1)" class="fs-28 fw-600 mb-24" :class="type == 1?'fc-41ABF5':''">可用优惠券(1)</view>
  11. <view @click="setType(2)" class="fs-28 fw-600 mb-24" :class="type == 2?'fc-41ABF5':''">可领优惠券(2)</view>
  12. </view>
  13. <view class="scroll-view-css" v-if="type == 1">
  14. <scroll-view :scroll-y="true" class="scroll-view-css">
  15. <view class="item-box display-flex mb-20" v-for="(item,i) in 10" :key="i">
  16. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  17. <view class="align-items-center">
  18. <view class="fs-30 fw-600 fc-FB3D03">¥</view>
  19. <view class="fs-48 fw-600 fc-FB3D03">10</view>
  20. </view>
  21. <view class="fs-24" :class="item.type == 0?'fc-6':'fc-9'">
  22. 满90元可用
  23. </view>
  24. <view class="ball"></view>
  25. <view class="ball-two"></view>
  26. </view>
  27. <view class="item-hr"></view>
  28. <view class="item-right flex-1 bgc-f">
  29. <view class="fs-28 fw-600 mb-12 ticket-name text-overflow-ellipsis w382">
  30. 优惠券名称优惠券名称惠券名优惠券名称优惠券名称惠券名优惠券名称优惠券名称惠券名
  31. </view>
  32. <view class="fs-24 mb-12 fc-FB3D03">
  33. 2024.05.08-2024.05.24
  34. </view>
  35. <view class="flex-justify-space">
  36. <view class="fs-24 fc-6">
  37. 券类型:外卖券
  38. </view>
  39. </view>
  40. </view>
  41. <image v-if="id==i" class="s-icon" src="@/static/img/common/y-select.png" mode=""></image>
  42. <image v-else class="s-icon"src="@/static/img/common/n-select.png" mode=""></image>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. <view class="scroll-view-css" v-else>
  47. <view class="scroll-view-css">
  48. <view class=" display-flex mb-20" v-for="(item,index) in 10" :key="index">
  49. <view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
  50. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
  51. 优惠券名称优惠券名称优惠券名称优惠券名称优
  52. </view>
  53. <view class="fs-24 fc-6 mb-12">
  54. 有效时间:2024.05.08-2024.05.24
  55. </view>
  56. <view class="flex-justify-space">
  57. <view class="fs-24 fc-6">
  58. 券类型:外卖券
  59. </view>
  60. </view>
  61. </view>
  62. <view class="item-hr"></view>
  63. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  64. <view class="align-items-center">
  65. <view class="fs-30 fw-600 fc-FB3D03">¥</view>
  66. <view class="fs-48 fw-600 fc-FB3D03">10</view>
  67. </view>
  68. <view class="fs-24 mb-18 fc-6">
  69. 满90元可用
  70. </view>
  71. <view class="but-box fs-28 fc-f">
  72. 立即领取
  73. </view>
  74. <view class="ball"></view>
  75. <view class="ball-two"></view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </uni-popup>
  82. </view>
  83. </template>
  84. <script>
  85. export default {
  86. data(){
  87. return{
  88. type:1,//1可用 2可领
  89. id:1,
  90. }
  91. },
  92. methods:{
  93. getList(){
  94. this.openPop();
  95. },
  96. setType(type){
  97. if(type != this.type){
  98. this.type = type
  99. }
  100. },
  101. openPop(){
  102. this.$refs.popupCoupon.open();
  103. },
  104. closeCoupon(){
  105. this.$refs.popupCoupon.close();
  106. },
  107. },
  108. }
  109. </script>
  110. <style scoped lang="scss">
  111. .w382{
  112. width: 382rpx;
  113. }
  114. .item-box{
  115. position: relative;
  116. .s-icon{
  117. width: 32rpx;
  118. height: 32rpx;
  119. position: absolute;
  120. top: 45%;
  121. right: 24rpx;
  122. }
  123. }
  124. .pop-coupon{
  125. width: 100%;
  126. height: 70vh;
  127. background-color: #F5F4F9;
  128. border-radius: 24rpx 24rpx 0rpx 0rpx;
  129. padding-top: 32rpx !important;
  130. display: flex;
  131. flex-direction: column;
  132. .box-title{
  133. position: relative;
  134. .box-close{
  135. position: absolute;
  136. right: 22rpx;
  137. }
  138. }
  139. .item-right {
  140. padding: 24rpx;
  141. box-sizing: border-box;
  142. border-radius: 20rpx 0 0 20rpx;
  143. position: relative;
  144. }
  145. .item-hr {
  146. width: 0px;
  147. height: auto;
  148. border-right: 1rpx dashed #FB7850;
  149. }
  150. .item-hr-two {
  151. width: 0px;
  152. height: auto;
  153. border-right: 1rpx dashed #999;
  154. }
  155. .item-left {
  156. width: 200rpx;
  157. height: auto;
  158. padding: 20rpx 24rpx;
  159. box-sizing: border-box;
  160. position: relative;
  161. border-radius: 0 20rpx 20rpx 0;
  162. }
  163. .but-box {
  164. width: 152rpx;
  165. height: 52rpx;
  166. line-height: 52rpx;
  167. text-align: center;
  168. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  169. border-radius: 200rpx;
  170. }
  171. .ball {
  172. width: 24rpx;
  173. height: 24rpx;
  174. border-radius: 50%;
  175. position: absolute;
  176. top: -12rpx;
  177. left: -12rpx;
  178. background: #F5F5F5;
  179. z-index: 2;
  180. }
  181. .ball-two {
  182. width: 24rpx;
  183. height: 24rpx;
  184. border-radius: 50%;
  185. position: absolute;
  186. background: #F5F5F5;
  187. z-index: 10;
  188. bottom: -12rpx;
  189. left: -12rpx;
  190. }
  191. }
  192. </style>