| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <script>
- import tools from "@/common/js/tools";
- import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
- import {register} from "@/api/member";
- export default {
- name: "invite-page",
- components: {},
- data() {
- return {
- formData: {
- address: '',
- inviteCode: ''
- }
- };
- },
- mounted() {
- },
- methods: {
- async getAccount(){
- console.log('---------------------------------',tokenpocketBnb)
- tokenpocketBnb.getAccounts().then(async (Address) => {
- console.log(Address)
- if (Address) {
- this.formData.address=Address
- this.login()
- } else {
- // tools.goToError(2)
- }
- }).catch((e)=>{
- console.log(e)
- // tools.goToError(2)
- })
- },
- login(){
- register(this.formData).then((res) => {
- if(res.code===1){
- tools.setLoginInfo(res.data)
- setTimeout(()=>{
- uni.reLaunch({
- url: '/pages/index/index'
- })
- },50)
- }else {
- uni.reLaunch({
- url: 'pages/login/register?address='+Address
- })
- }
- })
- }
- },
- }
- </script>
- <template>
- <view class="flex-common-css box-b align-items-center flex-justify-center">
- <view class="fs-14 fc-f mb-10">
- 请输入邀请码
- </view>
- <view class="w-80 mb-50">
- <input class="input-b" v-model="formData.inviteCode" placeholder="" placeholder-class="text-align-center fs-14"></input>
- </view>
- <view class="but-b b-rad-20 text-align-center fc-f fs-14" @click="getAccount">
- 确认绑定
- </view>
- </view>
- </template>
- <style scoped lang="scss">
- .box-b {
- background-image: linear-gradient(46deg, #3364d1, #42d6dd);
- }
- .input-b{
- height: 50px;
- border: none;
- border-radius: 10px;
- background: #fff;
- text-align: center;
- }
- .w-80{
- width: 80%;
- }
- .but-b{
- background-image: linear-gradient(46deg, #7a8fbf, #59b3b7);
- width: 60%;
- line-height: 40px;
- border: 1px solid #fff;
- }
- </style>
|