index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="recharge">
  3. <u-popup
  4. :show="show"
  5. :mode="mode"
  6. round="20rpx"
  7. :close-on-click-overlay="false"
  8. @close="close"
  9. >
  10. <view class="container">
  11. <view class="static-text main-between cross-center">
  12. <text>充值金币</text>
  13. <u-icon name="close-circle" size="52rpx" color="#BEBDBB" @click="close" />
  14. </view>
  15. <view class="overage">账户余额:<text>3金币</text></view>
  16. <view class="recharge-group dir-left-wrap">
  17. <view
  18. v-for="(item,index) in recharge"
  19. :key="index"
  20. class="recharge-item dir-top-wrap main-center cross-center"
  21. :class="{active: rechargeActive === index}"
  22. @click="rechargeActive = index"
  23. >
  24. <text class="price">49.99元</text>
  25. <text class="gold">500+300金币</text>
  26. <text class="gift">多送350金币</text>
  27. </view>
  28. </view>
  29. <view class="btn">充值</view>
  30. </view>
  31. </u-popup>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'Recharge',
  37. props: {
  38. show: {
  39. type: Boolean,
  40. default: false
  41. },
  42. mode: {
  43. type: String,
  44. default: 'center'
  45. }
  46. },
  47. data() {
  48. return {
  49. modal: {
  50. show: false
  51. },
  52. recharge: [1, 2, 3, 4],
  53. rechargeActive: 1
  54. }
  55. },
  56. computed: {},
  57. watch: {
  58. show(val) {
  59. this.modal.show = val
  60. }
  61. },
  62. methods: {
  63. close() {
  64. this.$emit('update:show', false)
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .recharge {
  71. font-size: 28rpx;
  72. .container{
  73. width: 700rpx;
  74. border: 2rpx solid;
  75. padding: 30rpx 40rpx;
  76. .static-text{
  77. font-size: 38rpx;
  78. font-weight: 600;
  79. margin-bottom: 40rpx;
  80. }
  81. .overage{
  82. color: $info-color;
  83. text{
  84. color: #FB3651 ;
  85. }
  86. }
  87. .recharge-group{
  88. margin-top: 30rpx;
  89. .recharge-item{
  90. border: 4rpx solid $primary-color;
  91. width: calc(#{600rpx} / 2);
  92. margin-right: 20rpx;
  93. margin-bottom: 20rpx;
  94. border-radius: 10rpx;
  95. padding: 40rpx 20rpx;
  96. transition: .3s;
  97. &:nth-child(2n){
  98. margin-right: 0;
  99. }
  100. &.active{
  101. background: #1b1e32;
  102. border: 4rpx solid #1b1e32;
  103. .price{
  104. color: $default-color;
  105. }
  106. }
  107. .price{
  108. margin-bottom: 40rpx;
  109. font-size: 38rpx;
  110. }
  111. .gold{
  112. color: $primary-color;
  113. margin-bottom: 10rpx;
  114. }
  115. .gift{
  116. color: $info-color;
  117. }
  118. }
  119. }
  120. .btn{
  121. background: linear-gradient(270deg, #6EEBE8 0%, #FF74B9 100%);
  122. width: 90%;
  123. margin: 40rpx auto;
  124. padding: 20rpx 0;
  125. text-align: center;
  126. border-radius: 40rpx;
  127. color: $default-color;
  128. letter-spacing: .1rem;
  129. }
  130. }
  131. }
  132. </style>