activation.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <uni-popup ref="popup" :mask-click="false">
  3. <div class="popup_con">
  4. <div class="p_tit">
  5. <span class="tit">{{ tit }}</span>
  6. <span @click="close" class="close iconfont">&#xe609;</span>
  7. </div>
  8. <div class="p_con">
  9. <div class="con_txt">请输入激活码</div>
  10. <input class="activation_code dinB" :focus="focus" v-model="code" />
  11. </div>
  12. <div class="btnbar">
  13. <div class="btn" @click="jihuo">立即激活</div>
  14. </div>
  15. </div>
  16. </uni-popup>
  17. </template>
  18. <script>
  19. import { post } from "@/request/api.js";
  20. export default {
  21. name: "activation",
  22. props: {},
  23. props: {
  24. tit: {
  25. type: String,
  26. default: "激活"
  27. },
  28. },
  29. components: {},
  30. data() {
  31. return {
  32. code: "", //激活码
  33. focus: false
  34. };
  35. },
  36. methods: {
  37. jihuo() {
  38. let code = this.code
  39. post("local/activation", { code }).then(res => {
  40. if (res.code == 0) {
  41. uni.showToast({ title: "激活成功", icon: "none" });
  42. this.close()
  43. }
  44. })
  45. },
  46. open() {
  47. this.$refs.popup.open('center');
  48. this.focus = true
  49. },
  50. close() {
  51. this.$refs.popup.close()
  52. this.$emit('close');
  53. }
  54. },
  55. onLoad(da) {},
  56. onShow() {},
  57. mounted() {},
  58. };
  59. </script>
  60. <style scoped lang='scss'>
  61. .popup_con {
  62. background-color: #fff;
  63. width: 80vw;
  64. border-radius: 16rpx;
  65. padding: 0 30rpx 28rpx;
  66. .p_tit {
  67. min-height: 80rpx;
  68. line-height: 80rpx;
  69. text-align: center;
  70. .close {
  71. color: #666;
  72. font-size: 40rpx;
  73. font-weight: bold;
  74. float: right;
  75. }
  76. }
  77. .p_con {
  78. padding: 50rpx 0;
  79. .con_txt {
  80. color: #999;
  81. font-size: 30rpx;
  82. text-align: center;
  83. margin-bottom: 16rpx;
  84. }
  85. .activation_code {
  86. height: 70rpx;
  87. background-color: rgba($color: #000, $alpha: 0.05);
  88. border-radius: 12rpx;
  89. text-align: center;
  90. font-weight: bold;
  91. letter-spacing: 4rpx;
  92. font-size: 38rpx;
  93. }
  94. }
  95. .btnbar {
  96. // margin-top: 28rpx;
  97. .btn {
  98. font-weight: bold;
  99. height: 70rpx;
  100. line-height: 70rpx;
  101. text-align: center;
  102. background: radial-gradient(circle, #d3aa79, #ebcda8);
  103. border-radius: 35rpx;
  104. }
  105. }
  106. }
  107. </style>