diff --git a/src/views/home/boxBtm.vue b/src/views/home/boxBtm.vue
index 48bf921..e600954 100644
--- a/src/views/home/boxBtm.vue
+++ b/src/views/home/boxBtm.vue
@@ -110,11 +110,34 @@
-
-
+
+
+
+ No Data
+
+ Open the Treasure
+
+ {{ scope.row.address.time }}
+
+
+ {{ scope.row.address.slice(0,4) }}{{ '……'+scope.row.username }}
+
+
+
+
+
+ 122112
+
+
@@ -184,6 +207,16 @@ export default {
],
pageSize: 6,
currentPage: 1,
+ recordsDialogVisible: true,
+ recordsList: [
+ {
+ username: 'username',
+ name: 'username',
+ points: '12',
+ address: 'addressaddress',
+ post: '0000',
+ }
+ ],
}
},
computed: {
@@ -200,6 +233,7 @@ export default {
this.token = getToken()
this.$nextTick(() => {
this.getMyBoxList()
+ this.openBox()
})
},
methods: {
@@ -210,10 +244,8 @@ export default {
params: "",
headers: { Authorization: `Bearer ${this.token}` }
})
- console.log('boxList', res.data.data)
this.boxList = res.data.data
this.boxData = res.data.data[0]
- console.log('boxData', this.boxData)
if(this.boxData.bounsCount == 0) {
this.$refs.pendingBg.style.width = '0%'
} else {
@@ -257,34 +289,36 @@ export default {
async turnBox(id) {
let address = localStorage.getItem("myAddress")
if(this.token) {
- let resOpen = await sendOpenChest(address, id)
- console.log(id)
- if(resOpen) {
- let serTimeId = setInterval(async () => {
- let res = await this.$axios.post(
- "/api/chest/open",
- { chestId: id },
- { headers: { Authorization: `Bearer ${this.token}` } }
- );
- if (res.data.errcode == 0) {
- this.getMyBoxList()
- this.openBox()
- clearInterval(serTimeId)
- }
- }, 2000)
+ try {
+ let resOpen = await sendOpenChest(address, id)
+ if(resOpen) {
+ let serTimeId = setInterval(async () => {
+ let res = await this.$axios.post(
+ "/api/chest/open",
+ { chestId: id },
+ { headers: { Authorization: `Bearer ${this.token}` } }
+ );
+ if (res.data.errcode == 0) {
+ this.getMyBoxList()
+ this.openBox()
+ clearInterval(serTimeId)
+ }
+ }, 2000)
+ }
+ } catch (e) {
+ this.$message.error(e.message)
}
}
-
},
// 开箱子记录
async openBox() {
- let res = this.$axios.get('/api/chest/open/history', {
+ let res = await this.$axios.get('/api/chest/open/history', {
params: { },
headers: { Authorization: `Bearer ${this.token}` }
})
-
- console.log(res.data.data)
+ this.recordsList = res.data.data
+ console.log('开箱子记录', res.data.data)
},
// 复制助力链接
@@ -302,7 +336,11 @@ export default {
oInput.style.display = "none";
this.$message.success("Copy succeeded");
},
-
+
+ // 关闭弹窗
+ recordsHandleClose() {
+ this.recordsDialogVisible = false
+ },
},
};
@@ -677,5 +715,76 @@ export default {
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;
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/views/home/gameView.vue b/src/views/home/gameView.vue
index 634e881..95d950d 100644
--- a/src/views/home/gameView.vue
+++ b/src/views/home/gameView.vue
@@ -64,21 +64,25 @@ export default {
let res = await this.$axios.post('/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }})
let id = res.data.data.id
if(id){
- console.log(id)
- let result = await sendExplore(myAddress, id)
- if(result) {
- console.log(id)
- let serTimeId = setInterval(async () => {
- let resExplore = await apiGameStep(id);
- console.log(resExplore.data)
- if(resExplore.data) {
- console.log(resExplore.data)
- alert(resExplore.data)
- clearInterval(serTimeId)
- location.reload()
+ try{
+ let result = await sendExplore(myAddress, id)
+ if(result) {
+ let serTimeId = setInterval(async () => {
+ let resExplore = await apiGameStep(id);
+ console.log(resExplore.data)
+ if(resExplore.data) {
+ console.log(resExplore.data)
+ alert(resExplore.data)
+ clearInterval(serTimeId)
+ location.reload()
+ }
+ }, 2000)
}
- }, 2000)
- }
+ } catch(e) {
+ this.$message.error(e.message)
+ }
+
+
}
} else {
this.$message.error('Get the number of explorations')
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index d9d6c28..e7f87bd 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -730,7 +730,6 @@ export default {
if (!localStorage.getItem(storeageKey)) {
try {
const chainRes = await sendClaimTask(address, id)
- console.log(chainRes)
if (chainRes && chainRes.transactionHash) {
localStorage.setItem(storeageKey, chainRes.transactionHash)
}
@@ -789,17 +788,21 @@ export default {
// 签到
async walletCheck() {
let address = localStorage.getItem("myAddress")
- console.log(await isWalletConnected())
if(await isWalletConnected()) {
if(address) {
- let resChain = await sendDailyCheckIn(address);
- if (resChain) {
- let serTimeId = setInterval(async () => {
- if(await this.getUsercheckin()) {
- this.getGameStat();
- clearInterval(serTimeId)
- }
- }, 2000)
+ try{
+ let resChain = await sendDailyCheckIn(address);
+ if (resChain) {
+ let serTimeId = setInterval(async () => {
+ if(await this.getUsercheckin()) {
+ this.getGameStat();
+ clearInterval(serTimeId)
+ }
+ }, 2000)
+ }
+ } catch(e) {
+ console.log(e)
+ this.$message.error(e.message)
}
} else {
this.walletDialogVisible = true