coupon.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <view >
  3. <view class="box_head">
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#2F4379"></uni-segmented-control>
  5. </view>
  6. <view class="box">
  7. <view >
  8. <view v-show="current === 0">
  9. <view class="content" v-for="(item,index) in list" :key="index">
  10. <view>
  11. <u-row >
  12. <u-col span="4" >
  13. <view class="price_box">
  14. <text class="price_num">20</text>
  15. <text class="price_unit">元</text>
  16. </view>
  17. </u-col>
  18. <u-col span="8" >
  19. <view style="margin-top: 20rpx;">
  20. <u-row >
  21. <u-col span="6" >
  22. <view class="coupon_title">
  23. 课程现金券
  24. </view>
  25. </u-col>
  26. <u-col span="4" offset="2">
  27. <view class="coupon_btn">
  28. 立即使用
  29. </view>
  30. </u-col>
  31. </u-row>
  32. </view>
  33. <view class="date">
  34. 有效期:
  35. </view>
  36. <view class="time">
  37. 2021-03-23 ~ 2021-04-22
  38. </view>
  39. <view class="tip">
  40. 所有题库均可使用
  41. </view>
  42. </u-col>
  43. </u-row>
  44. </view>
  45. </view>
  46. </view>
  47. <view v-show="current === 1">
  48. <view class="content" v-for="(item,index) in list" :key="index">
  49. <view>
  50. <u-row >
  51. <u-col span="4" >
  52. <view class="price_box">
  53. <text class="price_num">8.8</text>
  54. <text class="price_unit">折</text>
  55. </view>
  56. </u-col>
  57. <u-col span="8" >
  58. <view style="margin-top: 20rpx;">
  59. <u-row >
  60. <u-col span="6" >
  61. <view class="coupon_title">
  62. 题库折扣券
  63. </view>
  64. </u-col>
  65. <u-col span="4" offset="2">
  66. <view class="coupon_btn">
  67. 立即使用
  68. </view>
  69. </u-col>
  70. </u-row>
  71. </view>
  72. <view class="date">
  73. 有效期:
  74. </view>
  75. <view class="time">
  76. 2021-03-23 ~ 2021-04-22
  77. </view>
  78. <view class="tip">
  79. 所有题库均可使用
  80. </view>
  81. </u-col>
  82. </u-row>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="footer">
  89. <view class="footer_btn" @click="openPopup">
  90. 失效券
  91. </view>
  92. </view>
  93. <u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
  94. <view class="popup_box" >
  95. <scroll-view scroll-y="true" class="popup_list" >
  96. <view class="content" v-for="(item,index) in list1" :key="index" v-show="current === 0">
  97. <view style="position: relative;">
  98. <u-row >
  99. <u-col span="4" >
  100. <view class="price_box">
  101. <text class="price_num">20</text>
  102. <text class="price_unit">元</text>
  103. </view>
  104. </u-col>
  105. <u-col span="8" >
  106. <view style="margin-top: 20rpx;">
  107. <u-row >
  108. <u-col span="6" >
  109. <view class="coupon_title">
  110. 课程现金券
  111. </view>
  112. </u-col>
  113. </u-row>
  114. </view>
  115. <view class="date">
  116. 有效期:
  117. </view>
  118. <view class="time">
  119. 2021-03-23 ~ 2021-04-22
  120. </view>
  121. <view class="tip">
  122. 所有题库均可使用
  123. </view>
  124. </u-col>
  125. </u-row>
  126. <view>
  127. <image :src="item" class="status_img"></image>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="content" v-for="(item,index) in list1" :key="index" v-show="current === 1">
  132. <view style="position: relative;">
  133. <u-row >
  134. <u-col span="4" >
  135. <view class="price_box">
  136. <text class="price_num">5.5</text>
  137. <text class="price_unit">折</text>
  138. </view>
  139. </u-col>
  140. <u-col span="8" >
  141. <view style="margin-top: 20rpx;">
  142. <u-row >
  143. <u-col span="6" >
  144. <view class="coupon_title">
  145. 课程折扣券
  146. </view>
  147. </u-col>
  148. </u-row>
  149. </view>
  150. <view class="date">
  151. 有效期:
  152. </view>
  153. <view class="time">
  154. 2021-03-23 ~ 2021-04-22
  155. </view>
  156. <view class="tip">
  157. 所有题库均可使用
  158. </view>
  159. </u-col>
  160. </u-row>
  161. <view>
  162. <image :src="item" class="status_img"></image>
  163. </view>
  164. </view>
  165. </view>
  166. </scroll-view>
  167. </view>
  168. </u-popup>
  169. </view>
  170. </template>
  171. <script>
  172. export default {
  173. data() {
  174. return {
  175. items: [
  176. '现金券(3)',
  177. '折扣券(2)'
  178. ],
  179. list:[1,1,1,1,1,1,1,1,1,1,1],
  180. current:0,
  181. show:false,
  182. list1:['/static/coupon/overdue.png',
  183. '/static/coupon/used.png','/static/coupon/used.png',
  184. '/static/coupon/overdue.png','/static/coupon/overdue.png'],
  185. }
  186. },
  187. onLoad(option) {
  188. },
  189. onShow(){
  190. },
  191. methods: {
  192. onClickItem(e){
  193. this.current = e.currentIndex
  194. },
  195. openPopup(){
  196. this.show = true
  197. }
  198. },
  199. }
  200. </script>
  201. <style>
  202. ::-webkit-scrollbar{
  203. width: 0;
  204. height: 0;
  205. color: transparent;
  206. }
  207. .u-drawer-content-visible{
  208. border-radius: 32rpx 32rpx 0rpx 0rpx;
  209. overflow: hidden;
  210. }
  211. </style>
  212. <style scope>
  213. .status_img{
  214. width: 161rpx;
  215. height: 161rpx;
  216. position: absolute;
  217. top: 40rpx;
  218. left: 20%;
  219. }
  220. .popup_list{
  221. border-radius: 32rpx 32rpx 0rpx 0rpx;
  222. height: 580rpx;
  223. margin-bottom: 20rpx;
  224. }
  225. .popup_box{
  226. height: 600rpx;
  227. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  228. border-radius: 32rpx 32rpx 0rpx 0rpx;
  229. background: #F2F3F6;
  230. padding-left: 20rpx;
  231. padding-right: 20rpx;
  232. }
  233. .footer_btn{
  234. width: 686rpx;
  235. height: 88rpx;
  236. background: #FFFFFF;
  237. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  238. border-radius: 32rpx;
  239. text-align: center;
  240. line-height: 88rpx;
  241. margin: 0 auto;
  242. margin-top: 10rpx;
  243. }
  244. .footer{
  245. position: fixed;
  246. bottom: 0;
  247. width: 100%;
  248. height: 120rpx;
  249. background: #F2F3F6;
  250. text-align: center;
  251. }
  252. .price_box view{
  253. padding: 0;
  254. }
  255. .date{
  256. font-size: 20rpx;
  257. color: #636A75;
  258. margin-top: 20rpx;
  259. }
  260. .time{
  261. font-size: 20rpx;
  262. color: #636A75;
  263. margin-top: 20rpx;
  264. }
  265. .tip{
  266. font-size: 20rpx;
  267. color: #636A75;
  268. opacity: 0.5;
  269. margin-top: 20rpx;
  270. }
  271. .coupon_btn{
  272. width: 112rpx;
  273. height: 48rpx;
  274. background: #32467B;
  275. border-radius: 16rpx;
  276. line-height: 48rpx;
  277. text-align: center;
  278. font-size: 20rpx;
  279. color: #FFFFFF;
  280. }
  281. .coupon_title{
  282. width: 140rpx;
  283. height: 48rpx;
  284. background: #FFFFFF;
  285. border: 2rpx solid #32467B;
  286. border-radius: 16rpx;
  287. font-size: 24rpx;
  288. color: #636A75;
  289. line-height: 48rpx;
  290. text-align: center;
  291. }
  292. .price_box{
  293. text-align: center;
  294. vertical-align: middle;
  295. height: 240rpx;
  296. border-right:1px dashed #EEEEEE;
  297. }
  298. .price_unit{
  299. font-size: 24rpx;
  300. color: #636A75;
  301. }
  302. .price_num{
  303. font-size: 88rpx;
  304. font-family: Impact;
  305. font-weight: bold;
  306. color: #32467B;
  307. line-height: 240rpx;
  308. }
  309. .box_head{
  310. z-index: 999;
  311. padding: 20rpx 100rpx;
  312. height: 96rpx;
  313. position: fixed;
  314. width: 100%;
  315. background-color: #F2F3F6;
  316. text-align: center;
  317. }
  318. .box{
  319. padding-top: 96rpx;
  320. padding-left: 20rpx;
  321. padding-right: 20rpx;
  322. padding-bottom: 120rpx;
  323. overflow-x: hidden;
  324. overflow-y: auto;
  325. }
  326. .c_log{
  327. font-size: 20rpx;
  328. font-family: PingFang SC;
  329. font-weight: 400;
  330. color: #2F4379;
  331. position: absolute;
  332. bottom: 10rpx;
  333. }
  334. .c_title{
  335. font-size: 30rpx;
  336. font-family: PingFang SC;
  337. font-weight: bold;
  338. color: #2F4379;
  339. padding-top: 10rpx;
  340. }
  341. .c_img{
  342. width: 278rpx;
  343. height: 134rpx;
  344. }
  345. .c_t1{
  346. font-size: 20rpx;
  347. color: #2F4379;
  348. padding: 15rpx;
  349. }
  350. .content{
  351. margin-top: 20rpx;
  352. width: 100%;
  353. height: 240rpx;
  354. background: #FFFFFF;
  355. border-radius: 32rpx;
  356. position: relative;
  357. }
  358. .content:after {
  359. content: '';
  360. position: absolute;
  361. top: 0px;
  362. bottom: 0px;
  363. left: -35rpx;
  364. width: 70rpx;
  365. height: 100%;
  366. background: radial-gradient(circle, #F2F3F6, #F2F3F6 30rpx, transparent 35rpx);
  367. }
  368. .content:before {
  369. content: '';
  370. position: absolute;
  371. top: 0px;
  372. bottom: 0px;
  373. right: -35rpx;
  374. width: 70rpx;
  375. height: 100%;
  376. background: radial-gradient(circle, #F2F3F6, #F2F3F6 30rpx, transparent 35rpx);
  377. }
  378. .segmented-control__text{
  379. font-size: 24rpx !important;
  380. }
  381. .segmented-control{
  382. height: 56rpx !important;
  383. background-color: #F8F9FF;
  384. }
  385. page {
  386. background: #F2F3F6;
  387. }
  388. </style>