敢为人鲜小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.5 KiB

  1. <template>
  2. <view class="new-coupon-popup">
  3. <uv-popup ref="popup" @change="change" min-height="400rpx" closeable>
  4. <view class="coupon-content">
  5. <text class="coupon-title">恭喜获得</text>
  6. <view class="coupon-list">
  7. <view class="coupon-item">
  8. <text class="coupon-name">优惠券名称</text>
  9. <text class="coupon-desc">优惠券描述</text>
  10. </view>
  11. <view class="coupon-item">
  12. <text class="coupon-name">优惠券名称</text>
  13. <text class="coupon-desc">优惠券描述</text>
  14. </view>
  15. </view>
  16. <view class="coupon-btn" hover-class="coupon-btn-hover" @click="getCoupon">
  17. <text class="coupon-btn-text">立即领取</text>
  18. </view>
  19. </view>
  20. </uv-popup>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'newCouponPopup',
  26. data() {
  27. return {
  28. couponList: []
  29. }
  30. },
  31. mounted() {
  32. // this.getCouponList()
  33. // this.$refs.popup.open()
  34. },
  35. methods: {
  36. getCouponList() {
  37. this.$api.getCouponList().then(res => {
  38. this.couponList = res.data
  39. })
  40. },
  41. getCoupon() {
  42. uni.showToast({
  43. title: '领取成功~',
  44. icon: 'success'
  45. })
  46. this.$refs.popup.close()
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .coupon-content{
  53. padding: 40rpx 20rpx;
  54. background-color: #fff;
  55. border-radius: 20rpx;
  56. display: flex;
  57. flex-direction: column;
  58. align-items: center;
  59. gap: 40rpx;
  60. position: relative;
  61. .coupon-title{
  62. color: black;
  63. text-align: center;
  64. font-size: 32rpx;
  65. font-weight: 600;
  66. }
  67. .coupon-list{
  68. display: flex;
  69. flex-direction: column;
  70. align-items: center;
  71. gap: 20rpx;
  72. .coupon-item{
  73. width: 660rpx;
  74. height: 180rpx;
  75. background-color: $uni-color;
  76. border-radius: 10rpx;
  77. }
  78. }
  79. .coupon-btn-hover{
  80. opacity: 0.7;
  81. }
  82. .coupon-btn{
  83. width: 570rpx;
  84. height: 110rpx;
  85. background-color: $uni-color;
  86. border-radius: 55rpx;
  87. display: flex;
  88. align-items: center;
  89. justify-content: center;
  90. .coupon-btn-text{
  91. color: #fff;
  92. font-size: 30rpx;
  93. }
  94. }
  95. }
  96. </style>