Browse Source

no message

BF-202205051124\Administrator 3 years ago
parent
commit
ea244e7dfb
6 changed files with 102 additions and 11 deletions
  1. 2 2
      api/member.js
  2. 5 5
      pages/login/index.vue
  3. 95 4
      pages/login/register.vue
  4. BIN
      static/bg/share.jpg
  5. BIN
      static/img/bg/dlbg.jpg
  6. BIN
      static/img/bg/share.jpg

+ 2 - 2
api/member.js

@@ -2,5 +2,5 @@ import {request} from './ajax.js'
 
 const newsUrl = '/api/member/'
 // 登陆
-export const member = (data) => request(newsUrl + 'login', 'post', { ...data },false)
-export const resetPwd = (data) => request(newsUrl + 'resetpwd', 'post', { ...data },false)
+export const login = (data) => request(newsUrl + 'login', 'post', { ...data },false)
+export const register = (data) => request(newsUrl + 'register', 'post', { ...data },false)

+ 5 - 5
pages/login/index.vue

@@ -7,7 +7,7 @@
   import EnLoading from "../../components/en-utils/en-loading/en-loading";
   import bitkeepTron from "../../common/wallet/bitkeep-wallet/bitkeep-tron";
   import tools from "../../common/js/tools";
-  import {member} from "@/api/member";
+  import {login} from "@/api/member";
   export default {
     components: {
       EnLoading
@@ -37,13 +37,13 @@
         })
       },
       login(Address){
-        member({'address':Address}).then((res)=>{
+        login({'address':Address}).then((res)=>{
           if(res.code===1){
             tools.setLoginInfo(res.data)
             setTimeout(()=>{
-              // uni.reLaunch({
-              //   url: '/pages/index/index'
-              // })
+              uni.reLaunch({
+                url: '/pages/index/index'
+              })
             },50)
           }else {
             uni.reLaunch({

+ 95 - 4
pages/login/register.vue

@@ -1,24 +1,115 @@
 <template>
-  <view>
-
+  <view class="register-box">
+      <view class="register-logo"></view>
+      <view class="register-from">
+          <view class="from-input"><input v-model="inviteCode" placeholder="请输入推荐码"></view>
+          <view class="from-but"><button @click="register">确定</button></view>
+      </view>
   </view>
 </template>
 <script>
+import {register} from "@/api/member";
+import tools from "@/common/js/tools";
+
 export default {
   name: "register",
   props: {},
   components: {},
   data() {
-    return {}
+    return {
+      address:'',
+      inviteCode:'',
+      isAjax:false
+    }
+  },
+  onLoad(query) {
+    if(query.address!==undefined){
+      this.address=query.address
+    }else {
+      tools.leftClick()
+    }
   },
   mounted() {
 
   },
-  methods: {}
+  methods: {
+    register(){
+      if(this.inviteCode===''){
+        tools.error('请输入推荐码')
+        return;
+      }
+      if(this.isAjax){
+        return;
+      }
+      this.isAjax=true
+      register({'inviteCode':this.inviteCode,'address':this.address}).then((res)=>{
+        if(res.code){
+          tools.setLoginInfo(res.data)
+          setTimeout(()=>{
+            uni.reLaunch({
+              url: '/pages/index/index'
+            })
+          },50)
+        }else {
+          tools.error(res.msg)
+          this.isAjax=false
+        }
+      }).catch((e)=>{
+        this.isAjax=false
+      })
+    }
+  }
 
 }
 </script>
 
 <style scoped lang="scss">
+.register-box{
+  width: 100vw;
+  height: 100vh;
+  max-height: 100vh;
+  background-image: url("/static/img/bg/dlbg.jpg");
+  background-repeat: no-repeat;
+  background-position: center center;
+  background-size: cover;
+  //padding-top: 400rpx;
+  .register-logo{
+    height: 300rpx;
+  }
+  .register-from{
+    border-radius: 20rpx;
+    width:calc(100vw - 214rpx);
+    margin: auto;
+    height: 300rpx;
+    background: #131E30;
+    padding: 80rpx 64rpx 0 64rpx;
+    .from-input{
+
+      input{
+        border-radius: 6rpx;
+        height: 100rpx;
+        border: 2rpx solid #3e526b;
+        color: #7388a7;
+        font-size: 42rpx;
+        line-height: 100rpx;
+        text-align: center;
+      }
+      input::placeholder{
+
+      }
+    }
+    .from-but{
+      margin-top: 40rpx;
+      button{
+        height: 82rpx;
+        line-height: 82rpx;
+        border: 2rpx solid #146AF0;
+        border-radius: 6rpx;
+        background: #146AF0;
+        color: #FFFFFF;
+      }
+    }
+  }
+}
 
 </style>

BIN
static/bg/share.jpg


BIN
static/img/bg/dlbg.jpg


BIN
static/img/bg/share.jpg