register.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="register-box">
  3. <view class="register-logo"></view>
  4. <header class="header">
  5. <image class="hd-logo" src="/static/img/icon/logow.png?=1" mode="aspectFill" />
  6. </header>
  7. <view class="register-from">
  8. <view class="from-input"><input v-model="inviteCode" placeholder="请输入推荐码"></view>
  9. <view class="from-but"><button @click="register">确定</button></view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {register} from "@/api/member";
  15. import tools from "@/common/js/tools";
  16. export default {
  17. name: "register",
  18. props: {},
  19. components: {},
  20. data() {
  21. return {
  22. address:'',
  23. inviteCode:'',
  24. isAjax:false
  25. }
  26. },
  27. onLoad(query) {
  28. if(query.address!==undefined){
  29. this.address=query.address
  30. }else {
  31. tools.leftClick()
  32. }
  33. },
  34. mounted() {
  35. },
  36. methods: {
  37. register(){
  38. if(this.inviteCode===''){
  39. tools.error('请输入推荐码')
  40. return;
  41. }
  42. if(this.isAjax){
  43. return;
  44. }
  45. this.isAjax=true
  46. register({'inviteCode':this.inviteCode,'address':this.address}).then((res)=>{
  47. if(res.code){
  48. tools.setLoginInfo(res.data)
  49. setTimeout(()=>{
  50. uni.reLaunch({
  51. url: '/pages/index/index'
  52. })
  53. },50)
  54. }else {
  55. tools.error(res.msg)
  56. this.isAjax=false
  57. }
  58. }).catch((e)=>{
  59. this.isAjax=false
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .register-box{
  67. width: 100vw;
  68. height: 100vh;
  69. max-height: 100vh;
  70. background-image: url("/static/img/bg/dlbg.jpg");
  71. background-repeat: no-repeat;
  72. background-position: center center;
  73. background-size: cover;
  74. //padding-top: 400rpx;
  75. .register-logo{
  76. height: 100rpx;
  77. }
  78. .header{
  79. position: fixed; left: 0; top: 0; width: 100%; height: 54px; background: #131E30; z-index: 10; overflow: hidden;
  80. .hd-logo{ display: block; max-width: 52%; height: 34px; margin: 10px auto;}
  81. }
  82. .register-from{
  83. border-radius: 20rpx;
  84. width:calc(100vw - 214rpx);
  85. margin: auto;
  86. height: 300rpx;
  87. background: #131E30;
  88. padding: 80rpx 64rpx 0 64rpx;
  89. .from-input{
  90. input{
  91. border-radius: 6rpx;
  92. height: 100rpx;
  93. border: 2rpx solid #3e526b;
  94. color: #7388a7;
  95. font-size: 42rpx;
  96. line-height: 100rpx;
  97. text-align: center;
  98. }
  99. input::placeholder{
  100. }
  101. }
  102. .from-but{
  103. margin-top: 40rpx;
  104. button{
  105. height: 82rpx;
  106. line-height: 82rpx;
  107. border: 2rpx solid #146AF0;
  108. border-radius: 6rpx;
  109. background: #146AF0;
  110. color: #FFFFFF;
  111. }
  112. }
  113. }
  114. }
  115. </style>