修改链交互报错提示
This commit is contained in:
parent
44739ec674
commit
a145be86c1
@ -110,11 +110,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="records-dialog">
|
<el-dialog class="records-dialog" :visible="recordsDialogVisible" :modal="false" :before-close="recordsHandleClose">
|
||||||
<div>
|
<div class="top">
|
||||||
<li></li>
|
<div class="top-title">My inviation</div>
|
||||||
|
<div class="top-close">图片</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<el-table :data="recordsList">
|
||||||
|
<template slot="empty">
|
||||||
|
<div>No Data</div>
|
||||||
|
</template>
|
||||||
|
<el-table-column prop="rank" label="Action" :width="80">Open the Treasure</el-table-column>
|
||||||
|
<el-table-column label="Time" :width="180">
|
||||||
|
<template
|
||||||
|
slot-scope="scope"
|
||||||
|
>{{ scope.row.address.time }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="Username" :width="180">
|
||||||
|
<template
|
||||||
|
slot-scope="scope"
|
||||||
|
>{{ scope.row.address.slice(0,4) }}{{ '……'+scope.row.username }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="score" label="Points"></el-table-column>
|
||||||
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="btm">
|
||||||
|
122112
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -184,6 +207,16 @@ export default {
|
|||||||
],
|
],
|
||||||
pageSize: 6,
|
pageSize: 6,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
recordsDialogVisible: true,
|
||||||
|
recordsList: [
|
||||||
|
{
|
||||||
|
username: 'username',
|
||||||
|
name: 'username',
|
||||||
|
points: '12',
|
||||||
|
address: 'addressaddress',
|
||||||
|
post: '0000',
|
||||||
|
}
|
||||||
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -200,6 +233,7 @@ export default {
|
|||||||
this.token = getToken()
|
this.token = getToken()
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getMyBoxList()
|
this.getMyBoxList()
|
||||||
|
this.openBox()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -210,10 +244,8 @@ export default {
|
|||||||
params: "",
|
params: "",
|
||||||
headers: { Authorization: `Bearer ${this.token}` }
|
headers: { Authorization: `Bearer ${this.token}` }
|
||||||
})
|
})
|
||||||
console.log('boxList', res.data.data)
|
|
||||||
this.boxList = res.data.data
|
this.boxList = res.data.data
|
||||||
this.boxData = res.data.data[0]
|
this.boxData = res.data.data[0]
|
||||||
console.log('boxData', this.boxData)
|
|
||||||
if(this.boxData.bounsCount == 0) {
|
if(this.boxData.bounsCount == 0) {
|
||||||
this.$refs.pendingBg.style.width = '0%'
|
this.$refs.pendingBg.style.width = '0%'
|
||||||
} else {
|
} else {
|
||||||
@ -257,8 +289,8 @@ export default {
|
|||||||
async turnBox(id) {
|
async turnBox(id) {
|
||||||
let address = localStorage.getItem("myAddress")
|
let address = localStorage.getItem("myAddress")
|
||||||
if(this.token) {
|
if(this.token) {
|
||||||
|
try {
|
||||||
let resOpen = await sendOpenChest(address, id)
|
let resOpen = await sendOpenChest(address, id)
|
||||||
console.log(id)
|
|
||||||
if(resOpen) {
|
if(resOpen) {
|
||||||
let serTimeId = setInterval(async () => {
|
let serTimeId = setInterval(async () => {
|
||||||
let res = await this.$axios.post(
|
let res = await this.$axios.post(
|
||||||
@ -273,18 +305,20 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error(e.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 开箱子记录
|
// 开箱子记录
|
||||||
async openBox() {
|
async openBox() {
|
||||||
let res = this.$axios.get('/api/chest/open/history', {
|
let res = await this.$axios.get('/api/chest/open/history', {
|
||||||
params: { },
|
params: { },
|
||||||
headers: { Authorization: `Bearer ${this.token}` }
|
headers: { Authorization: `Bearer ${this.token}` }
|
||||||
})
|
})
|
||||||
|
this.recordsList = res.data.data
|
||||||
console.log(res.data.data)
|
console.log('开箱子记录', res.data.data)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 复制助力链接
|
// 复制助力链接
|
||||||
@ -303,6 +337,10 @@ export default {
|
|||||||
this.$message.success("Copy succeeded");
|
this.$message.success("Copy succeeded");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
recordsHandleClose() {
|
||||||
|
this.recordsDialogVisible = false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -677,5 +715,76 @@ export default {
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.records-dialog {
|
||||||
|
::v-deep .el-dialog {
|
||||||
|
border: 1px solid #924df2;
|
||||||
|
box-shadow: 0px 0px 20px #924df2;
|
||||||
|
background: #1a1821;
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 30px 50px;
|
||||||
|
.el-dialog__header {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.el-dialog__body {
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
.top-title {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 28px;
|
||||||
|
font-family: "Anton-Regular";
|
||||||
|
}
|
||||||
|
.top-close {
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
right: -20px;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
margin: 20px 0;
|
||||||
|
.el-table {
|
||||||
|
background: #1a1821;
|
||||||
|
.el-table__header-wrapper {
|
||||||
|
border-radius: 20px;
|
||||||
|
.el-table__header {
|
||||||
|
tr {
|
||||||
|
background: #1a1821;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
.el-table__cell {
|
||||||
|
border: 0px;
|
||||||
|
background: #2d2738;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.el-table__cell:last-child {
|
||||||
|
border-radius: 0 20px 20px 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-table__body-wrapper {
|
||||||
|
.el-table__body {
|
||||||
|
.el-table__row {
|
||||||
|
background: #1a1821;
|
||||||
|
.el-table__cell {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
background: #1a1821;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btm {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -64,10 +64,9 @@ export default {
|
|||||||
let res = await this.$axios.post('/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }})
|
let res = await this.$axios.post('/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }})
|
||||||
let id = res.data.data.id
|
let id = res.data.data.id
|
||||||
if(id){
|
if(id){
|
||||||
console.log(id)
|
try{
|
||||||
let result = await sendExplore(myAddress, id)
|
let result = await sendExplore(myAddress, id)
|
||||||
if(result) {
|
if(result) {
|
||||||
console.log(id)
|
|
||||||
let serTimeId = setInterval(async () => {
|
let serTimeId = setInterval(async () => {
|
||||||
let resExplore = await apiGameStep(id);
|
let resExplore = await apiGameStep(id);
|
||||||
console.log(resExplore.data)
|
console.log(resExplore.data)
|
||||||
@ -79,6 +78,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
} catch(e) {
|
||||||
|
this.$message.error(e.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('Get the number of explorations')
|
this.$message.error('Get the number of explorations')
|
||||||
|
@ -730,7 +730,6 @@ export default {
|
|||||||
if (!localStorage.getItem(storeageKey)) {
|
if (!localStorage.getItem(storeageKey)) {
|
||||||
try {
|
try {
|
||||||
const chainRes = await sendClaimTask(address, id)
|
const chainRes = await sendClaimTask(address, id)
|
||||||
console.log(chainRes)
|
|
||||||
if (chainRes && chainRes.transactionHash) {
|
if (chainRes && chainRes.transactionHash) {
|
||||||
localStorage.setItem(storeageKey, chainRes.transactionHash)
|
localStorage.setItem(storeageKey, chainRes.transactionHash)
|
||||||
}
|
}
|
||||||
@ -789,9 +788,9 @@ export default {
|
|||||||
// 签到
|
// 签到
|
||||||
async walletCheck() {
|
async walletCheck() {
|
||||||
let address = localStorage.getItem("myAddress")
|
let address = localStorage.getItem("myAddress")
|
||||||
console.log(await isWalletConnected())
|
|
||||||
if(await isWalletConnected()) {
|
if(await isWalletConnected()) {
|
||||||
if(address) {
|
if(address) {
|
||||||
|
try{
|
||||||
let resChain = await sendDailyCheckIn(address);
|
let resChain = await sendDailyCheckIn(address);
|
||||||
if (resChain) {
|
if (resChain) {
|
||||||
let serTimeId = setInterval(async () => {
|
let serTimeId = setInterval(async () => {
|
||||||
@ -801,6 +800,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
|
} catch(e) {
|
||||||
|
console.log(e)
|
||||||
|
this.$message.error(e.message)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.walletDialogVisible = true
|
this.walletDialogVisible = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user