coupon.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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 list2" :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. '现金券(0)',
  177. '折扣券(0)'
  178. ],
  179. list:[],
  180. current:0,
  181. show:false,
  182. list2:[],
  183. list1:['/static/coupon/overdue.png',
  184. '/static/coupon/used.png','/static/coupon/used.png',
  185. '/static/coupon/overdue.png','/static/coupon/overdue.png'],
  186. }
  187. },
  188. onLoad(option) {
  189. },
  190. onShow(){
  191. },
  192. methods: {
  193. onClickItem(e){
  194. this.current = e.currentIndex
  195. },
  196. openPopup(){
  197. this.show = true
  198. }
  199. },
  200. }
  201. </script>
  202. <style>
  203. ::-webkit-scrollbar{
  204. width: 0;
  205. height: 0;
  206. color: transparent;
  207. }
  208. .u-drawer-content-visible{
  209. border-radius: 32rpx 32rpx 0rpx 0rpx;
  210. overflow: hidden;
  211. }
  212. </style>
  213. <style scope>
  214. .status_img{
  215. width: 161rpx;
  216. height: 161rpx;
  217. position: absolute;
  218. top: 40rpx;
  219. left: 20%;
  220. }
  221. .popup_list{
  222. border-radius: 32rpx 32rpx 0rpx 0rpx;
  223. height: 580rpx;
  224. margin-bottom: 20rpx;
  225. }
  226. .popup_box{
  227. height: 600rpx;
  228. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  229. border-radius: 32rpx 32rpx 0rpx 0rpx;
  230. background: #F2F3F6;
  231. padding-left: 20rpx;
  232. padding-right: 20rpx;
  233. }
  234. .footer_btn{
  235. width: 686rpx;
  236. height: 88rpx;
  237. background: #FFFFFF;
  238. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  239. border-radius: 32rpx;
  240. text-align: center;
  241. line-height: 88rpx;
  242. margin: 0 auto;
  243. margin-top: 10rpx;
  244. }
  245. .footer{
  246. position: fixed;
  247. bottom: 0;
  248. width: 100%;
  249. height: 120rpx;
  250. background: #F2F3F6;
  251. text-align: center;
  252. }
  253. .price_box view{
  254. padding: 0;
  255. }
  256. .date{
  257. font-size: 20rpx;
  258. color: #636A75;
  259. margin-top: 20rpx;
  260. }
  261. .time{
  262. font-size: 20rpx;
  263. color: #636A75;
  264. margin-top: 20rpx;
  265. }
  266. .tip{
  267. font-size: 20rpx;
  268. color: #636A75;
  269. opacity: 0.5;
  270. margin-top: 20rpx;
  271. }
  272. .coupon_btn{
  273. width: 112rpx;
  274. height: 48rpx;
  275. background: #32467B;
  276. border-radius: 16rpx;
  277. line-height: 48rpx;
  278. text-align: center;
  279. font-size: 20rpx;
  280. color: #FFFFFF;
  281. }
  282. .coupon_title{
  283. width: 140rpx;
  284. height: 48rpx;
  285. background: #FFFFFF;
  286. border: 2rpx solid #32467B;
  287. border-radius: 16rpx;
  288. font-size: 24rpx;
  289. color: #636A75;
  290. line-height: 48rpx;
  291. text-align: center;
  292. }
  293. .price_box{
  294. text-align: center;
  295. vertical-align: middle;
  296. height: 240rpx;
  297. border-right:1px dashed #EEEEEE;
  298. }
  299. .price_unit{
  300. font-size: 24rpx;
  301. color: #636A75;
  302. }
  303. .price_num{
  304. font-size: 88rpx;
  305. font-family: Impact;
  306. font-weight: bold;
  307. color: #32467B;
  308. line-height: 240rpx;
  309. }
  310. .box_head{
  311. z-index: 999;
  312. padding: 20rpx 100rpx;
  313. height: 96rpx;
  314. position: fixed;
  315. width: 100%;
  316. background-color: #F2F3F6;
  317. text-align: center;
  318. }
  319. .box{
  320. padding-top: 96rpx;
  321. padding-left: 20rpx;
  322. padding-right: 20rpx;
  323. padding-bottom: 120rpx;
  324. overflow-x: hidden;
  325. overflow-y: auto;
  326. }
  327. .c_log{
  328. font-size: 20rpx;
  329. font-family: PingFang SC;
  330. font-weight: 400;
  331. color: #2F4379;
  332. position: absolute;
  333. bottom: 10rpx;
  334. }
  335. .c_title{
  336. font-size: 30rpx;
  337. font-family: PingFang SC;
  338. font-weight: bold;
  339. color: #2F4379;
  340. padding-top: 10rpx;
  341. }
  342. .c_img{
  343. width: 278rpx;
  344. height: 134rpx;
  345. }
  346. .c_t1{
  347. font-size: 20rpx;
  348. color: #2F4379;
  349. padding: 15rpx;
  350. }
  351. .content{
  352. margin-top: 20rpx;
  353. width: 100%;
  354. height: 240rpx;
  355. background: #FFFFFF;
  356. border-radius: 32rpx;
  357. position: relative;
  358. }
  359. .content:after {
  360. content: '';
  361. position: absolute;
  362. top: 0px;
  363. bottom: 0px;
  364. left: -35rpx;
  365. width: 70rpx;
  366. height: 100%;
  367. background: radial-gradient(circle, #F2F3F6, #F2F3F6 30rpx, transparent 35rpx);
  368. }
  369. .content:before {
  370. content: '';
  371. position: absolute;
  372. top: 0px;
  373. bottom: 0px;
  374. right: -35rpx;
  375. width: 70rpx;
  376. height: 100%;
  377. background: radial-gradient(circle, #F2F3F6, #F2F3F6 30rpx, transparent 35rpx);
  378. }
  379. .segmented-control__text{
  380. font-size: 24rpx !important;
  381. }
  382. .segmented-control{
  383. height: 56rpx !important;
  384. background-color: #F8F9FF;
  385. }
  386. page {
  387. background: #F2F3F6;
  388. }
  389. </style>