diff --git a/src/assets/common/whitelist01.png b/src/assets/common/whitelist01.png new file mode 100644 index 0000000..bf64d01 Binary files /dev/null and b/src/assets/common/whitelist01.png differ diff --git a/src/components/errorDialog/index.js b/src/components/errorDialog/index.js index f5863ff..49d0fd7 100644 --- a/src/components/errorDialog/index.js +++ b/src/components/errorDialog/index.js @@ -2,16 +2,23 @@ import Vue from 'vue'; import confirm from './errorDialog.vue'; const iErrorMessage = Vue.extend(confirm); function showErrMsg(err) { -let errmsg = '' - +let errmsg = err // alert(err,'----') // let errmsg = err; - // if (typeof err === 'object') { - // errmsg = JSON.stringify(err); - // } - if (err.indexOf('insufficient tickets') > -1) { + if (typeof err === 'object') { + errmsg = JSON.stringify(err); + } + if (errmsg.indexOf('insufficient tickets') > -1) { errmsg = 'Exploration failed, insufficient number of explorations.' - } else if(err.indexOf('invalid opcode: opcode 0xd8 not defined') > -1) { + } else if(errmsg.indexOf('invalid opcode: opcode 0xd8 not defined') > -1) { + errmsg = `Claim failed due to insufficient gas.` + } else if(errmsg.indexOf('User rejected the request') > -1) { + errmsg = `User rejected the request` + } else if(errmsg.indexOf('User denied transaction signature') > -1) { + errmsg = `User denied transaction signature` + } else if(errmsg.indexOf('Internal JSON-RPC error') > -1) { + errmsg = `Claim failed due to insufficient gas.` + } else if(errmsg.indexOf('TransactionBlockTimeoutError') > -1) { errmsg = `Claim failed due to insufficient gas.` } diff --git a/src/components/paginationDialog.vue b/src/components/paginationDialog.vue index 8f1fa9f..dfe5bf1 100644 --- a/src/components/paginationDialog.vue +++ b/src/components/paginationDialog.vue @@ -15,10 +15,10 @@ export default { props:{ total: Number, + pageSize: Number, }, data() { return { - pageSize: 6, currentPage: 1, } }, diff --git a/src/views/home/boxBtm.vue b/src/views/home/boxBtm.vue index 3893bba..491888e 100644 --- a/src/views/home/boxBtm.vue +++ b/src/views/home/boxBtm.vue @@ -167,18 +167,24 @@ slot-scope="scope" >{{ scope.row.address.slice(0,4) }}{{ '……'+scope.row.username }} --> - - @@ -76,13 +75,12 @@ export default { async sendOneAction(getTotalUsed, step) { let address = this.$store.state.user.address; if (!this.$store.state.wallet.connected || !address) { - console.log('====') throw new Error('wallet not connected') } const preRes = await apiPreStep(step) if (preRes.errcode) { // this.$message.error(preRes.errmsg) - this.$showErr(preRes.errmsg) + this.$showErr(preRes) return } this.isLoading = true @@ -90,7 +88,6 @@ export default { try { storeageKey = await sendToChain('explore', address, preRes.data.id) } catch (err) { - this.$showErr(err.data.message) this.isLoading = false this.$showErr(err) return @@ -123,41 +120,6 @@ export default { } }, 3000) }, - // 行动 - async stepBtn(getTotalUsed,amount) { - let myAddress = localStorage.getItem("myAddress") - if(await isWalletConnected()) { - if(amount >= 1) { - cc.mainAnim.setCurrPos(getTotalUsed) - cc.mainAnim.setData(amount) - let res = await this.$axios.post(process.env.VUE_APP_API_URL+'/api/game/pre_step',{step: amount},{headers: { Authorization: `Bearer ${this.token}` }}) - let id = res.data.data.id - if(id){ - try{ - let result = await sendExplore(myAddress, id) - if(result) { - let serTimeId = setInterval(async () => { - let resExplore = await apiGameStep(id); - console.log(resExplore) - if(resExplore.data) { - console.log(resExplore.data) - this.$emit('awardDialog', this.awardData) - clearInterval(serTimeId) - // location.reload() - } - }, 2000) - } - } catch(e) { - this.$message.error(e.message) - } - } - } else { - this.$message.error('Get the number of explorations') - } - } else { - this.$message.error('Log in first') - } - }, } }; diff --git a/src/views/home/helpDialog.vue b/src/views/home/helpDialog.vue index 081c886..fedb299 100644 --- a/src/views/home/helpDialog.vue +++ b/src/views/home/helpDialog.vue @@ -1,6 +1,5 @@