769 lines
37 KiB
HTML
769 lines
37 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8">
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|||
|
<meta name="description" content="PYXEL || Ultimate Gaming HTML Template">
|
|||
|
|
|||
|
<title>Samsara DAO</title>
|
|||
|
<!-- All CSS files -->
|
|||
|
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
|
|||
|
<link rel="stylesheet" href="static/css/font-awesome.css">
|
|||
|
<link rel="stylesheet" href="static/css/bootstrap.min.css">
|
|||
|
<link rel="stylesheet" href="static/css/app.css">
|
|||
|
<link rel="stylesheet" href="static/js/element-ui-min.css">
|
|||
|
|
|||
|
<style>
|
|||
|
.pro_title{
|
|||
|
flex: 1;
|
|||
|
height: 4vh;
|
|||
|
}
|
|||
|
.pro_txt{
|
|||
|
background-color: #DAE2FE;
|
|||
|
height: 5vh;
|
|||
|
margin-bottom: 2vh;
|
|||
|
display: flex;
|
|||
|
align-items: center;
|
|||
|
padding: 0 10px;
|
|||
|
box-sizing: border-box;
|
|||
|
width: 70%;
|
|||
|
}
|
|||
|
.pro_txt input{
|
|||
|
flex: 1;
|
|||
|
height: 100%;
|
|||
|
border: none;
|
|||
|
outline: none;
|
|||
|
background-color: #DAE2FE;
|
|||
|
color: #fff;
|
|||
|
}
|
|||
|
.pro_txt .pro_adresss{
|
|||
|
flex: 1;
|
|||
|
overflow: hidden;
|
|||
|
white-space: nowrap;
|
|||
|
text-overflow: ellipsis;
|
|||
|
}
|
|||
|
.pro_txt img{
|
|||
|
width: 3vh;
|
|||
|
height: 3vh;
|
|||
|
margin: 0 3%;
|
|||
|
}
|
|||
|
.bind_btn{
|
|||
|
background-color: #446FFA;
|
|||
|
width: 30%;
|
|||
|
height: 5vh;
|
|||
|
line-height: 5vh;
|
|||
|
text-align: center;
|
|||
|
cursor: pointer;
|
|||
|
color: #fff;
|
|||
|
}
|
|||
|
.copy_img{
|
|||
|
cursor: pointer;
|
|||
|
}
|
|||
|
.profile_page{
|
|||
|
background-color: #F2F2F2;
|
|||
|
padding: 6vh;
|
|||
|
}
|
|||
|
.profile_title{
|
|||
|
display: flex;
|
|||
|
justify-content: center;
|
|||
|
align-items: center;
|
|||
|
background-color: #446FFA;
|
|||
|
padding: 1vh 0;
|
|||
|
color: #fff;
|
|||
|
font-weight: 700;
|
|||
|
border-radius: 10px;
|
|||
|
}
|
|||
|
.signup-container >div{
|
|||
|
display: flex;
|
|||
|
justify-content: space-between;
|
|||
|
}
|
|||
|
.profile_page .container-fluid{
|
|||
|
padding: 0 !important;
|
|||
|
}
|
|||
|
.pro_pagination{
|
|||
|
display: flex;
|
|||
|
justify-content: flex-end;
|
|||
|
align-items: center;
|
|||
|
margin-top: 4vh;
|
|||
|
}
|
|||
|
</style>
|
|||
|
</head>
|
|||
|
|
|||
|
<body class="tt-smooth-scroll">
|
|||
|
|
|||
|
<!-- Main Wrapper Start -->
|
|||
|
<div id="app" v-cloak>
|
|||
|
|
|||
|
<!-- HEADER MENU START -->
|
|||
|
<div id="publickHeader"></div>
|
|||
|
<!-- HEADER MENU END -->
|
|||
|
|
|||
|
|
|||
|
<!-- BG-SIGN*UP PAGE # 1 START -->
|
|||
|
<div class="signup-page profile_page" style="background-color: #fff;">
|
|||
|
<h4 class="profile_title">{{currentLanguage == 'zh' ? '我的':'profile'}}</h4>
|
|||
|
<!-- SIGN UP SECTION START -->
|
|||
|
<section class="signup-wrapper py-80">
|
|||
|
<el-row>
|
|||
|
<el-col :span="24">
|
|||
|
<el-descriptions size="small" :column="2" :title="currentLanguage ==='en'?'My balance':'我的余额'">
|
|||
|
<el-descriptions-item label="BNB">
|
|||
|
<el-row style="width: 100%;">
|
|||
|
<el-col :span="6" ><label style="font-weight: 600;font-size: 14px; ">{{userInfos?.bnb||'0.00'}}</label></el-col>
|
|||
|
<el-col :span="16" style="text-align: center;">
|
|||
|
<!-- <el-button size="small" type="primary" plain>{{currentLanguage ==='zh'?'明細':'Detailed'}}</el-button> -->
|
|||
|
<el-button :disabled="!userInfos?.token" size="small" type="primary" @click="showCashoutDialog()">{{currentLanguage ==='zh'?'提 現':'Withdrawal'}}</el-button>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
</el-descriptions-item>
|
|||
|
<el-descriptions-item label="USDT">
|
|||
|
<el-row style="width: 100%;">
|
|||
|
<el-col :span="6"><label style="font-weight: 600; font-size: 14px;">0.00</label></el-col>
|
|||
|
<el-col :span="16" style="text-align: center;">
|
|||
|
<!-- <el-button size="small" type="primary" plain disabled>{{currentLanguage ==='zh'?'明細':'Detailed'}}</el-button> -->
|
|||
|
<el-button size="small" type="primary" disabled>{{currentLanguage ==='zh'?'提 現':'Withdrawal'}}</el-button>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
</el-descriptions-item>
|
|||
|
</el-descriptions>
|
|||
|
</el-col>
|
|||
|
<el-col :span="24" style="margin-top: 24px;">
|
|||
|
<el-descriptions size="small" :column="2" :title="currentLanguage ==='en'?'Essential Information':'基本信息'">
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'nickname':'昵称'">{{userInfos?.nickname}}</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'NFT':'NFT'">{{userInfos?.money||0}}</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'Email':'郵箱'">{{userInfos?.email?.replace(/(\w{1})\w+(\w{1})@/g, '$1****$2@')||''}}</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'Promotion link':'推廣鏈接'">
|
|||
|
<template v-if="userInfos?.token">
|
|||
|
<label @click="copyText(userInfos.icode)"> {{baseBindUrl + userInfos?.icode}}</label>
|
|||
|
<i style="margin-left: 12px; cursor: pointer;" @click="copyText(baseBindUrl + userInfos.icode)" class="el-icon-copy-document"></i>
|
|||
|
</template>
|
|||
|
</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'score':'積分'">{{userInfos?.score||0}}</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'My invitation code':'我的邀請碼'">
|
|||
|
<template v-if="userInfos?.token">
|
|||
|
<label @click="copyText(userInfos.icode)"> {{ userInfos.icode}}</label>
|
|||
|
<i style="margin-left: 12px; cursor: pointer;" @click="copyText(userInfos.icode)" class="el-icon-copy-document"></i>
|
|||
|
</template>
|
|||
|
</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage ==='en'?'NFT Treasure chest':'NFT 寶箱'">{{userInfos?.box||0}}</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage == 'zh' ? '綁定邀請碼':'Bind invitation code'">
|
|||
|
{{userInfos?.paddress}}
|
|||
|
<el-input style="width: 45%;" size="mini" placeholder="請輸入邀請碼" v-if="!userInfos?.paddress && userInfos?.token" v-model="bindIcode" class="input-with-select">
|
|||
|
<el-button slot="append" class="send" size="mini" @click="toBind">{{currentLanguage == 'zh'?'綁 定':'Binding'}}</el-button>
|
|||
|
</el-input>
|
|||
|
</el-descriptions-item>
|
|||
|
<el-descriptions-item :label="currentLanguage == 'zh' ? '关联元智算的钱包地址':'Wallet address associated with meta computing power'">
|
|||
|
{{userInfos?.wallet}}
|
|||
|
<el-input style="width: 38%;" size="mini" placeholder="請輸入" v-if="!userInfos?.wallet && userInfos?.token" v-model="wallet" class="input-with-select">
|
|||
|
<el-button :disabled="!wallet" slot="append" class="send" :class="{'disabled':!wallet}" size="mini" @click="toWallet">{{currentLanguage == 'zh'?'提 交':'Submit'}}</el-button>
|
|||
|
</el-input>
|
|||
|
</el-descriptions-item>
|
|||
|
|
|||
|
</el-descriptions>
|
|||
|
</el-col>
|
|||
|
<el-col :span="24" style="margin-top: 24px;">
|
|||
|
<el-descriptions size="small" :column="1" :title="currentLanguage ==='zh'?'記錄':'Record'"></el-descriptions>
|
|||
|
</el-col>
|
|||
|
<el-col :span="24">
|
|||
|
<el-row style=" width: 100%;">
|
|||
|
<el-col :span="24">
|
|||
|
<el-radio-group v-model="ifications" @change="()=>{ page=1; getonrules()}">
|
|||
|
<el-radio-button :label="item.value" v-for="item in classIfications" :key="item.value" >{{currentLanguage ==='zh'?item.name_zh:item.name_en}}</el-radio-button>
|
|||
|
</el-radio-group>
|
|||
|
</el-col>
|
|||
|
<el-col :span="24">
|
|||
|
<el-table
|
|||
|
:data="rewardRules.data"
|
|||
|
:empty-text="currentLanguage == 'zh' ?'暫無數據':'No Data'"
|
|||
|
style="width: 100%;margin-top: 24px;">
|
|||
|
<el-table-column
|
|||
|
:prop="ifications"
|
|||
|
align="center"
|
|||
|
:label="changeText()">
|
|||
|
</el-table-column>
|
|||
|
<el-table-column
|
|||
|
prop="before"
|
|||
|
align="center"
|
|||
|
:label="currentLanguage == 'zh' ?'變動前':'Before the change'">
|
|||
|
</el-table-column>
|
|||
|
<el-table-column
|
|||
|
prop="after"
|
|||
|
align="center"
|
|||
|
:label="currentLanguage == 'zh' ?'變動後':'After the change'">
|
|||
|
</el-table-column>
|
|||
|
<el-table-column
|
|||
|
:prop="currentLanguage == 'zh'?'memo_cn':'memo'"
|
|||
|
align="center"
|
|||
|
:label="currentLanguage == 'zh' ?'變動原因':'Reason for change'" >
|
|||
|
</el-table-column>
|
|||
|
<el-table-column
|
|||
|
prop="createtime"
|
|||
|
align="center"
|
|||
|
:formatter="formatDate"
|
|||
|
:label="currentLanguage == 'zh' ?'时间':'Date'">
|
|||
|
</el-table-column>
|
|||
|
</el-table>
|
|||
|
</el-col>
|
|||
|
<el-col :span="24">
|
|||
|
<div class="pro_pagination">
|
|||
|
<el-pagination
|
|||
|
background
|
|||
|
layout="prev, pager, next"
|
|||
|
:page-size="10"
|
|||
|
:current-page.sync="page"
|
|||
|
@current-change="handleCurrentChange"
|
|||
|
:total="rewardRules.total">
|
|||
|
</el-pagination>
|
|||
|
</div>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
</section>
|
|||
|
<!-- SIGN UP SECTION END -->
|
|||
|
|
|||
|
</div>
|
|||
|
<!-- BG-SIGN*UP PAGE # 1 END -->
|
|||
|
<el-dialog size="small" :visible.sync="showDialog" width="600" :before-close="closeDialog" :close-on-click-modal="false">
|
|||
|
<label slot="title">{{currentLanguage ==='zh'?'提現':'Withdrawal'}}</label>
|
|||
|
<el-row>
|
|||
|
<el-col :span="22">
|
|||
|
<el-form ref="form" :rules="rules" :model="cashout" label-width="200px">
|
|||
|
<el-form-item prop="amount" :label="currentLanguage ==='zh'?'數量:':'Quantity:'">
|
|||
|
<el-input placeholder="請輸入" v-model="cashout.amount"></el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item prop="googleauthcode" :label="currentLanguage ==='zh'?'Google驗證碼:':'Google captcha:'">
|
|||
|
<el-input v-model="cashout.googleauthcode" placeholder="請輸入">
|
|||
|
<el-button class="send" @click="sendCode" v-if="showSendCodeTimer == 0" slot="append" type="primary">
|
|||
|
{{currentLanguage ==='zh'?'發送驗證碼':'Send Code'}}
|
|||
|
</el-button>
|
|||
|
<el-button class="send" v-else slot="append" type="primary">
|
|||
|
{{showSendCodeTimer + 's'}}
|
|||
|
</el-button>
|
|||
|
</el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item prop="emailcode" :label="currentLanguage ==='zh'?'Email驗證碼:':'Email captcha:'">
|
|||
|
<el-input v-model="cashout.emailcode" placeholder="請輸入">
|
|||
|
<el-button class="send" :class="{'disabled':emailSending}" :disabled="emailSending" @click="sendCode('e')" slot="append" type="primary">
|
|||
|
{{currentLanguage ==='zh'?'發送驗證碼':'Send Code'}}
|
|||
|
</el-button>
|
|||
|
|
|||
|
</el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item prop="address" :label="currentLanguage ==='zh'?'提幣地址:':'Withdrawal address:'">
|
|||
|
<el-input v-model="cashout.address" placeholder="請輸入"></el-input>
|
|||
|
</el-form-item>
|
|||
|
</el-form>
|
|||
|
</el-col>
|
|||
|
</el-row>
|
|||
|
<div slot="footer" class="dialog-footer">
|
|||
|
<el-button @click="closeDialog"> {{currentLanguage == 'zh' ? '取 消':'Cancel'}}</el-button>
|
|||
|
<el-button type="primary" @click="submitCashout">{{currentLanguage == 'zh' ? '確 認':'Confirm'}}</el-button>
|
|||
|
</div>
|
|||
|
</el-dialog>
|
|||
|
|
|||
|
<!-- FOOTER START -->
|
|||
|
<div id="publciFooter"></div>
|
|||
|
<!-- FOOTER END -->
|
|||
|
<!-- 钱包选择弹窗 -->
|
|||
|
<el-dialog :visible.sync="moneyDialogVisible" width="40%" custom-class="wallet-dialog">
|
|||
|
<div class="wallet-container">
|
|||
|
<i class="el-icon-close" @click="moneyDialogVisible = false"></i>
|
|||
|
<div class="wallet-left">
|
|||
|
<h6 style="font-weight: 700;margin-bottom: 4vh;">{{currentLanguage == 'zh' ? '連接錢包' : 'Connect wallet'}}</h6>
|
|||
|
<p class="wallet-tip">
|
|||
|
{{ currentLanguage == 'zh' ? '首先,連接以下其中一個錢包。 請務必安全地儲存您的私密金鑰或助記詞,永遠不要與任何人分享它們。' : 'Firstly, connect one of the following wallets. Please make sure to securely store your private keys or mnemonics and never share them with anyone.' }}
|
|||
|
</p>
|
|||
|
|
|||
|
<div class="wallet-grid">
|
|||
|
<div v-for="(wallet,index) in wallets" :key="index" class="wallet-item"
|
|||
|
@click="selectWallet(wallet)">
|
|||
|
<img :src="wallet.icon" :alt="wallet.name">
|
|||
|
<span>{{ wallet.name }}</span>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="wallet-right" v-if="selectMoney.icon">
|
|||
|
<div class="connecting-status">
|
|||
|
<img :src="selectMoney.icon" class="tp-logo">
|
|||
|
<p class="status-text">{{ currentLanguage == 'zh' ? '正在打開' : 'Opening' }} {{selectMoney.name}}</p>
|
|||
|
<p class="confirm-text">
|
|||
|
{{ currentLanguage == 'zh' ? '請在' : 'Please in' }}
|
|||
|
{{selectMoney.name}}
|
|||
|
{{ currentLanguage == 'zh' ? '中確認' : 'Confirm in the middle' }}</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div v-else style="display: flex;justify-content: center;align-items: center;width: 50%;">{{ moneyTip(moneyTipMessage) }}</div>
|
|||
|
</div>
|
|||
|
</el-dialog>
|
|||
|
<!-- 钱包地址弹窗 -->
|
|||
|
<el-dialog :visible.sync="showMoneyAdress" width="30%" :close-on-click-modal="false">
|
|||
|
<div style="color: #000;">
|
|||
|
{{ currentLanguage == 'zh' ? '錢包地址:' : 'Wallet address:' }}
|
|||
|
{{ userMoneyAdressAll }}
|
|||
|
<img src="static/image/fuzhi.png" @click="copyText(userMoneyAdressAll)" style="margin-left: 5px;vertical-align: middle;cursor: pointer;">
|
|||
|
</div>
|
|||
|
</el-dialog>
|
|||
|
</div>
|
|||
|
|
|||
|
<!-- Back To Top Start -->
|
|||
|
<button class="scrollToTopBtn"><i class="fa fa-arrow-up"></i></button>
|
|||
|
<!-- Mobile Menu Start -->
|
|||
|
<div class="mobile-nav__wrapper">
|
|||
|
<div class="mobile-nav__overlay mobile-nav__toggler"></div>
|
|||
|
<div class="mobile-nav__content">
|
|||
|
<span class="mobile-nav__close mobile-nav__toggler"><i class="fa fa-times"></i></span>
|
|||
|
<div class="logo-box">
|
|||
|
<a href="index.html" aria-label="logo image"><img src="static/picture/logo.png" alt=""></a>
|
|||
|
</div>
|
|||
|
<div class="mobile-nav__container"></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- Mobile Menu End -->
|
|||
|
<!-- Jquery Js -->
|
|||
|
<script src="static/js/bootstrap.min.js"></script>
|
|||
|
<script src="static/js/jquery-3.6.3.min.js"></script>
|
|||
|
<script src="static/js/jquery-validator.js"></script>
|
|||
|
<script src="static/js/publickDOM.js"></script>
|
|||
|
<!-- 引入翻譯文件 -->
|
|||
|
<script src="static/js/translation.js"></script>
|
|||
|
<script src="static/js/i18n.js"></script>
|
|||
|
<!-- 獲取用戶信息 -->
|
|||
|
<script src="static/js/getIsUser.js"></script>
|
|||
|
<!-- 引入 Vue.js -->
|
|||
|
<script src="static/js/vue.js"></script>
|
|||
|
<!-- 引入 axios -->
|
|||
|
<script src="static/js/axios.min.js"></script>
|
|||
|
<!-- 引入 Element UI JS -->
|
|||
|
<script src="static/js/element-ui.js"></script>
|
|||
|
<script src="static/js/moment.min.js"></script>
|
|||
|
<script>
|
|||
|
console.log(baseUrl , 8888888)
|
|||
|
// 創建一個增強版的 localStorage
|
|||
|
const enhancedStorage = {
|
|||
|
setItem: function (key, value) {
|
|||
|
localStorage.setItem(key, value);
|
|||
|
// 觸發自定義事件
|
|||
|
window.dispatchEvent(new CustomEvent('localStorageChange', {
|
|||
|
detail: { key, value }
|
|||
|
}));
|
|||
|
},
|
|||
|
getItem: function (key) {
|
|||
|
return localStorage.getItem(key);
|
|||
|
}
|
|||
|
};
|
|||
|
|
|||
|
// 替換原始的 setItem 方法
|
|||
|
const originalSetItem = localStorage.setItem;
|
|||
|
localStorage.setItem = function (key, value) {
|
|||
|
originalSetItem.call(localStorage, key, value);
|
|||
|
window.dispatchEvent(new CustomEvent('localStorageChange', {
|
|||
|
detail: { key, value }
|
|||
|
}));
|
|||
|
};
|
|||
|
|
|||
|
new Vue({
|
|||
|
el: "#app",
|
|||
|
data() {
|
|||
|
return {
|
|||
|
// 钱包登录开始
|
|||
|
userMoneyAdressAll:"",
|
|||
|
showMoneyAdress:false,
|
|||
|
hasAdress:false,
|
|||
|
moneyTipMessage:"",
|
|||
|
selectMoney:{},
|
|||
|
wallets: [
|
|||
|
{
|
|||
|
name: 'MetaMask',
|
|||
|
icon: 'static/metamask.png'
|
|||
|
},
|
|||
|
{
|
|||
|
name: 'TokenPocket',
|
|||
|
icon: 'static/tokenpocket.png'
|
|||
|
},
|
|||
|
{
|
|||
|
name: 'OKX Wallet',
|
|||
|
icon: 'static/okx-wallet.png'
|
|||
|
}
|
|||
|
],
|
|||
|
moneyDialogVisible: false,
|
|||
|
userIsLogin: false,
|
|||
|
userMoneyAdress: "",
|
|||
|
// 钱包登录结尾
|
|||
|
googleClientId:"103792825870-7mp9kit8p6salsiqp8ov4gpqngqpj82g.apps.googleusercontent.com",
|
|||
|
currentLanguage: localStorage.getItem('languageNow') || 'en',
|
|||
|
userInfos:{token:''}, //d966623f-153c-4b46-a675-dad2fa7c8611
|
|||
|
baseBindUrl:baseUrl+"web/signup.html?icode=",
|
|||
|
bindIcode:"",
|
|||
|
rewardRules:{},
|
|||
|
page: 1,
|
|||
|
listrow: 10,
|
|||
|
classIfications:[
|
|||
|
{name_zh:'積分',name_en:'Score',value:'score'},
|
|||
|
{name_zh:'錢包',name_en:'Money',value:'money'},
|
|||
|
{name_zh:'寶箱',name_en:'Treasure chest',value:'box'},
|
|||
|
{name_zh:'BNB',name_en:'BNB',value:'bnb'}
|
|||
|
],
|
|||
|
ifications:'bnb',
|
|||
|
showDialog:false,
|
|||
|
cashout:{
|
|||
|
amount:'0.00000000',
|
|||
|
googleauthcode:'',
|
|||
|
address:'',
|
|||
|
emailcode:'',
|
|||
|
type:'bnb'
|
|||
|
},
|
|||
|
rules: {
|
|||
|
amount: [
|
|||
|
{ required: true, message: '提現數量', trigger: 'blur' },
|
|||
|
],
|
|||
|
googleauthcode: [
|
|||
|
{ required: true, message: 'Google驗證碼', trigger: 'blur' },
|
|||
|
],
|
|||
|
address: [
|
|||
|
{ required: true, message: '提幣地址', trigger: 'blur' },
|
|||
|
],
|
|||
|
emailcode: [
|
|||
|
{ required: true, message: 'Email驗證碼', trigger: 'blur' },
|
|||
|
],
|
|||
|
},
|
|||
|
showSendCodeTimer:0,
|
|||
|
interval:null,
|
|||
|
emailSending:false,
|
|||
|
wallet:'',
|
|||
|
|
|||
|
}
|
|||
|
},
|
|||
|
async created(){
|
|||
|
const user = window.localStorage.getItem("userInfo")
|
|||
|
if (user) {
|
|||
|
this.userIsLogin = true;
|
|||
|
}
|
|||
|
// 钱包登录开始
|
|||
|
const provider = window.web3?.currentProvider;
|
|||
|
let accounts1 = [];
|
|||
|
let accounts2 = [];
|
|||
|
let accounts3 = [];
|
|||
|
if(provider){
|
|||
|
accounts1 = await provider.request({method: 'eth_accounts'});
|
|||
|
}
|
|||
|
if(window.tokenpocket?.ethereum){
|
|||
|
accounts2 = await window.tokenpocket.ethereum.request({method: 'eth_accounts'});
|
|||
|
}
|
|||
|
if(window.okxwallet || (window.ethereum && window.ethereum?.isOKExWallet)){
|
|||
|
accounts3 = await window.okxwallet.request({method: 'eth_accounts'});
|
|||
|
}
|
|||
|
console.log(accounts1,accounts2,accounts3,'see');
|
|||
|
let _adressM = accounts1[0] || accounts2[0] || accounts3[0];
|
|||
|
if(_adressM){
|
|||
|
this.userMoneyAdressAll = _adressM;
|
|||
|
this.userMoneyAdress = _adressM.slice(0,4) + "...." + _adressM.slice(-4);
|
|||
|
}
|
|||
|
// 钱包登录结尾
|
|||
|
},
|
|||
|
mounted() {
|
|||
|
window.addEventListener('localStorageChange', (event) => {
|
|||
|
if (event.detail.key === 'languageNow') {
|
|||
|
this.currentLanguage = event.detail.value;
|
|||
|
}
|
|||
|
});
|
|||
|
// this.userInfos = {token:'dc6f6ec7-4986-4181-b1c4-863d4eba8e91'}
|
|||
|
let userInfo = window.localStorage.getItem('userInfo')
|
|||
|
if(userInfo){
|
|||
|
this.userInfos = JSON.parse(userInfo)
|
|||
|
}
|
|||
|
|
|||
|
this.getuserInfos();
|
|||
|
if(this.currentLanguage =='en'){
|
|||
|
this.rules.amount[0].message = 'Quantity'
|
|||
|
this.rules.googleauthcode[0].message = 'Google captcha'
|
|||
|
this.rules.address[0].message = 'Withdrawal address'
|
|||
|
this.rules.emailcode[0].message = 'Email captcha'
|
|||
|
}
|
|||
|
},
|
|||
|
methods: {
|
|||
|
// <-- -------------------------钱包登录开始 --------------------------->
|
|||
|
copyText(txt){
|
|||
|
let message = this.currentLanguage == 'zh' ? '複製成功!' : 'Copy successful!';
|
|||
|
navigator.clipboard.writeText(txt)
|
|||
|
.then(()=>{
|
|||
|
this.$message.success(message)
|
|||
|
})
|
|||
|
.catch(err=>{
|
|||
|
console.log(err,'error');
|
|||
|
})
|
|||
|
},
|
|||
|
allMoney(){
|
|||
|
this.showMoneyAdress = true;
|
|||
|
},
|
|||
|
userMoneyAdressOptions(adress){
|
|||
|
if(adress){
|
|||
|
return adress
|
|||
|
}else{
|
|||
|
return this.currentLanguage == 'zh' ? '連接錢包' : 'Connect wallet'
|
|||
|
}
|
|||
|
},
|
|||
|
moneyTip(txt){
|
|||
|
if(txt){
|
|||
|
return txt
|
|||
|
}else{
|
|||
|
return this.currentLanguage == 'zh' ? '請選擇連接錢包' : 'Please choose to connect the wallet'
|
|||
|
}
|
|||
|
},
|
|||
|
selectWallet(wallet) {
|
|||
|
this.selectMoney = {};
|
|||
|
if(wallet.name == 'MetaMask') {
|
|||
|
if(window.web3?.currentProvider){
|
|||
|
this.selectMoney = wallet;
|
|||
|
this.connectWallet(wallet.name);
|
|||
|
}else{
|
|||
|
this.moneyTipMessage = this.currentLanguage == 'zh' ? 'MetaMask未安裝' : 'MetaMask not installed';
|
|||
|
}
|
|||
|
}
|
|||
|
if (wallet.name == 'TokenPocket') {
|
|||
|
if(window.tokenpocket?.ethereum){
|
|||
|
this.selectMoney = wallet;
|
|||
|
this.connectWallet(wallet.name);
|
|||
|
}else{
|
|||
|
this.moneyTipMessage = this.currentLanguage == 'zh' ? 'TokenPocket未安裝' : 'TokenPocket not installed';
|
|||
|
}
|
|||
|
}
|
|||
|
if(wallet.name == "OKX Wallet"){
|
|||
|
if(window.okxwallet || (window.ethereum && window.ethereum.isOKExWallet)){
|
|||
|
this.selectMoney = wallet;
|
|||
|
this.connectWallet(wallet.name);
|
|||
|
}else{
|
|||
|
this.moneyTipMessage = this.currentLanguage == 'zh' ? '欧易钱包未安装' : 'OKX Wallet not installed';
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
async connectWallet(walletType){
|
|||
|
let account = "";
|
|||
|
try {
|
|||
|
if (walletType == 'MetaMask') {
|
|||
|
const provider = window.web3.currentProvider;
|
|||
|
const accounts = await provider.request({
|
|||
|
method: 'eth_requestAccounts'
|
|||
|
});
|
|||
|
account = accounts[0];
|
|||
|
}
|
|||
|
if (walletType == 'TokenPocket') {
|
|||
|
const tpAccounts = await window.tokenpocket.ethereum.request({
|
|||
|
method: 'eth_requestAccounts'
|
|||
|
});
|
|||
|
account = tpAccounts[0];
|
|||
|
}
|
|||
|
if (walletType == 'OKX Wallet') {
|
|||
|
const okxAccounts = await window.okxwallet.request({
|
|||
|
method: 'eth_requestAccounts'
|
|||
|
});
|
|||
|
account = okxAccounts[0];
|
|||
|
}
|
|||
|
console.log(account,'xxaa');
|
|||
|
let _adressM = account;
|
|||
|
this.userMoneyAdressAll = account;
|
|||
|
this.userMoneyAdress = _adressM.slice(0,4) + "...." + _adressM.slice(-4);
|
|||
|
this.moneyDialogVisible = false;
|
|||
|
} catch (error) {
|
|||
|
console.log(error);
|
|||
|
}
|
|||
|
},
|
|||
|
toConnectWallet() {
|
|||
|
if(this.userMoneyAdress){
|
|||
|
if(this.isShowSale){
|
|||
|
return
|
|||
|
}
|
|||
|
this.hasAdress = !this.hasAdress;
|
|||
|
return
|
|||
|
};
|
|||
|
this.moneyDialogVisible = true;
|
|||
|
},
|
|||
|
//<-- -------------------------钱包登录结尾 --------------------------->
|
|||
|
formatDate(row, column, cellValue){
|
|||
|
return moment(cellValue*1000).format("YYYY-MM-DD HH:mm:ss");
|
|||
|
},
|
|||
|
showCashoutDialog(){
|
|||
|
this.cashout.amount = this.userInfos.bnb
|
|||
|
this.showDialog = true
|
|||
|
},
|
|||
|
toWallet(){
|
|||
|
const loading = this.$loading({
|
|||
|
lock: true,
|
|||
|
text: 'Loading',
|
|||
|
spinner: 'el-icon-loading',
|
|||
|
background: 'rgba(0, 0, 0, 0.7)'
|
|||
|
});
|
|||
|
axios.post(baseUrl+'api/user/refyzswallet',{'wallet':this.userInfos?.wallet},{headers:{token:this.userInfos?.token}}).then(res=>{
|
|||
|
loading.close()
|
|||
|
if(res.data.code == 1){
|
|||
|
this.$message.success(this.currentLanguage =='zh'?'保存成功':'Saved successfully')
|
|||
|
}else{
|
|||
|
this.$message.error(res.data.msg)
|
|||
|
}
|
|||
|
}).catch(err=>{
|
|||
|
loading.close()
|
|||
|
this.$message.error(this.currentLanguage =='zh'?'保存失败':'Save failed')
|
|||
|
});
|
|||
|
},
|
|||
|
closeDialog(){
|
|||
|
this.showDialog = false;
|
|||
|
this.showSendCodeTimer = 0
|
|||
|
this.interval && clearInterval(this.interval)
|
|||
|
},
|
|||
|
sendCode(v){
|
|||
|
if(v === 'e'){
|
|||
|
this.emailSending = true
|
|||
|
axios.post(baseUrl+'api/ems/send',{email:this.userInfos.email,event:'cashout'}).then(res=>{
|
|||
|
|
|||
|
if(res.data.code === 1){
|
|||
|
const msg = this.currentLanguage =='zh'?"發送成功,請查收":'Sent successfully, please check'
|
|||
|
this.$message.success(msg)
|
|||
|
setTimeout(()=>{
|
|||
|
this.emailSending = false
|
|||
|
},60000)
|
|||
|
}else{
|
|||
|
this.emailSending = false
|
|||
|
const msg = this.currentLanguage =='zh'?"發送失败":'Sent failed'
|
|||
|
this.$message.error(msg)
|
|||
|
}
|
|||
|
})
|
|||
|
return
|
|||
|
}
|
|||
|
this.showSendCodeTimer = 60
|
|||
|
let interval = setInterval(()=>{
|
|||
|
if(this.showSendCodeTimer === 0){
|
|||
|
clearInterval(this.interval)
|
|||
|
}else{
|
|||
|
this.showSendCodeTimer--
|
|||
|
}
|
|||
|
},1000)
|
|||
|
},
|
|||
|
submitCashout(){
|
|||
|
this.$refs['form'].validate((valid) => {
|
|||
|
if (valid) {
|
|||
|
const loading = this.$loading({
|
|||
|
lock: true,
|
|||
|
text: 'Loading',
|
|||
|
spinner: 'el-icon-loading',
|
|||
|
background: 'rgba(0, 0, 0, 0.7)'
|
|||
|
});
|
|||
|
axios.post(baseUrl+'api/user/cashout',{...this.cashout},{headers:{token:this.userInfos?.token}}).then(res=>{
|
|||
|
loading.close()
|
|||
|
if(res.data.code == 1){
|
|||
|
this.$message.success(this.currentLanguage =='zh'?'操作成功':'Operation successful')
|
|||
|
this.showDialog = false
|
|||
|
this.getuserInfos()
|
|||
|
}else{
|
|||
|
this.$message.error(res.data.msg)
|
|||
|
}
|
|||
|
}).catch(err=>{
|
|||
|
loading.close()
|
|||
|
this.$message.error(this.currentLanguage =='zh'?'操作失败':'Operation failed')
|
|||
|
});
|
|||
|
} else {
|
|||
|
return false;
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
|
|||
|
},
|
|||
|
changeText(){
|
|||
|
const i = this.classIfications.find(item =>{
|
|||
|
return item.value == this.ifications
|
|||
|
})
|
|||
|
return this.currentLanguage == 'zh'?i.name_zh:i.name_en
|
|||
|
},
|
|||
|
mobileLang(){
|
|||
|
this.currentLanguage = mobileLang()
|
|||
|
this.rules.amount[0].message = this.currentLanguage =='en'?'Quantity':'提現數量'
|
|||
|
this.rules.googleauthcode[0].message = this.currentLanguage =='en'?'Google captcha':'Google驗證碼'
|
|||
|
this.rules.address[0].message = this.currentLanguage =='en'?'Withdrawal address':'提幣地址'
|
|||
|
this.rules.emailcode[0].message = this.currentLanguage =='en'?'Email captcha':'Email驗證碼'
|
|||
|
|
|||
|
},
|
|||
|
handleCurrentChange(val){
|
|||
|
this.page = val
|
|||
|
this.getonrules();
|
|||
|
},
|
|||
|
async getuserInfos(){
|
|||
|
if(!this.userInfos?.token){return}
|
|||
|
let res = await axios.post(baseUrl+'api/user/index',{},{headers:{token:this.userInfos?.token}});
|
|||
|
if(res.data.code == 1){
|
|||
|
this.userInfos = res.data.data.userinfo;
|
|||
|
this.getonrules();
|
|||
|
}
|
|||
|
},
|
|||
|
async getonrules(){
|
|||
|
if(!this.userInfos?.token){return}
|
|||
|
const loading = this.$loading({
|
|||
|
lock: true,
|
|||
|
text: 'Loading',
|
|||
|
spinner: 'el-icon-loading',
|
|||
|
background: 'rgba(0, 0, 0, 0.7)'
|
|||
|
});
|
|||
|
let res = await axios.get(baseUrl+'api/user/getlogs?type='+this.ifications+'&page='+this.page,{ headers:{token:this.userInfos.token}});
|
|||
|
if(res.data.code == 1){
|
|||
|
this.rewardRules = res.data.data;
|
|||
|
}
|
|||
|
loading.close()
|
|||
|
},
|
|||
|
copyText(txt){
|
|||
|
let message = this.currentLanguage == 'zh' ? '複製成功!' : 'Copy successful!';
|
|||
|
navigator.clipboard.writeText(txt)
|
|||
|
.then(()=>{
|
|||
|
this.$message.success(message)
|
|||
|
})
|
|||
|
.catch(err=>{
|
|||
|
console.log(err,'error');
|
|||
|
})
|
|||
|
},
|
|||
|
async toBind(){
|
|||
|
let tipMessage = this.currentLanguage == 'zh' ? '請輸入邀請碼' : 'Please enter the invitation code';
|
|||
|
if(!this.bindIcode){
|
|||
|
this.$message.error(tipMessage)
|
|||
|
return
|
|||
|
}
|
|||
|
let res = await axios.post(
|
|||
|
baseUrl+'api/user/bindicode',
|
|||
|
{ icode:this.bindIcode,},
|
|||
|
{ headers:{
|
|||
|
token:this.userInfos.token
|
|||
|
}}
|
|||
|
);
|
|||
|
if(res.data.code == 1){
|
|||
|
this.$message.success("ok");
|
|||
|
}else{
|
|||
|
this.$message.error("error");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
})
|
|||
|
</script>
|
|||
|
<script src="static/js/app.js"></script>
|
|||
|
</body>
|
|||
|
<style>
|
|||
|
.el-descriptions-item__label,.el-descriptions-item__content{
|
|||
|
font-weight: 600;
|
|||
|
font-size: 14px;
|
|||
|
line-height: 32px;
|
|||
|
}
|
|||
|
.el-descriptions__body{
|
|||
|
border-top: 1px solid #d8d8d8;
|
|||
|
padding-top: 24px;
|
|||
|
}
|
|||
|
.send{
|
|||
|
background-color: #446FFA !important;
|
|||
|
color: #fff !important;
|
|||
|
}
|
|||
|
.send.disabled{
|
|||
|
background-color: #d8d8d8 !important;
|
|||
|
}
|
|||
|
.send.disabled:hover{
|
|||
|
border-color: #d8d8d8 !important;
|
|||
|
}
|
|||
|
</style>
|
|||
|
|
|||
|
</html>
|