From 9b1799b98ab39787eb1ce7cd39b4ddb5ee503770 Mon Sep 17 00:00:00 2001 From: yuyongdong Date: Fri, 12 Apr 2024 22:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=AA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/boxBtm.vue | 181 ++++++++++++++++++----------------- src/views/home/index.vue | 148 ++++++++++++++++++++++++---- src/views/home/logDialog.vue | 15 +-- 3 files changed, 234 insertions(+), 110 deletions(-) diff --git a/src/views/home/boxBtm.vue b/src/views/home/boxBtm.vue index 35025ad..6c83f81 100644 --- a/src/views/home/boxBtm.vue +++ b/src/views/home/boxBtm.vue @@ -102,7 +102,7 @@
MAX
* Unlock the treasure will consume a small amount of gas
-
Turn On
+
Turn On
@@ -258,85 +258,88 @@ export default { recordsPageSize: 8, recordsCurrentPage: 1, boostingDialogVisible: false, - myRecordsList: [ - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - }, - { - username: 'username', - name: 'username', - points: '12', - address: 'addressaddress', - post: '0000', - } - ], + + // myRecordsList: [ + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // }, + // { + // username: 'username', + // name: 'username', + // points: '12', + // address: 'addressaddress', + // post: '0000', + // } + // ], + + myRecordsList: [], boostingPageSize: 6, boostingCurrentPage: 1, } @@ -367,11 +370,13 @@ export default { }, mounted() { this.token = getToken() - this.$nextTick(() => { - this.getMyBoxList() - this.openBoxLog() - this.getMyHistoricalLog() - }) + if(this.token) { + this.$nextTick(() => { + this.getMyBoxList() + this.openBoxLog() + this.getMyHistoricalLog() + }) + } }, methods: { // 我的宝箱 @@ -425,6 +430,7 @@ export default { console.log('助力记录', this.boostingList) } }, + async openBoxToChain(id) { let address = this.$store.state.user.address; if (!this.$store.state.wallet.connected || !address) { @@ -448,7 +454,10 @@ export default { clearInterval(serTimeId) } } else { - alert(`领取成功,显示奖励: ${JSON.stringify(data)}`) + // alert(`领取成功,显示奖励: ${JSON.stringify(data)}`) + this.getMyBoxList() + this.openBoxLog() + this.$emit('awardDialog', data) localStorage.removeItem(storeageKey) clearInterval(serTimeId) } diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 3306ad7..2369c7e 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -57,8 +57,8 @@

Invite friends to earn

more rewards

-
Copy referral code
-
+
Copy referral code
+
See invites
@@ -213,7 +213,7 @@

Cumulative Rewards

-
+
  • @@ -244,10 +244,56 @@
  • +
    +
  • +
    +
    +
    + + × 1 +
    +
    5 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 2 +
    +
    10 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 3 +
    +
    20 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 4 +
    +
    30 Days
    +
    +
    +
  • +

    Bonus Rewards

    -
    +
  • @@ -278,6 +324,52 @@
  • +
    +
  • +
    +
    +
    + + × 1 +
    +
    3 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 2 +
    +
    7 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 3 +
    +
    15 Days
    +
    +
    +
  • +
  • +
    +
    +
    + + × 4 +
    +
    30 Days
    +
    +
    +
  • +
    @@ -395,7 +487,7 @@
    - +
    @@ -503,7 +595,7 @@ export default { ], navIndex: 0, walletDialogVisible: false, - gameStateData: [], + gameStateData: {}, activityName: "", activityId: "uaw_activity", isWallet: false, @@ -795,6 +887,11 @@ export default { this.ExploreDialogVisible = true }, + // // 开宝箱奖励 + // boxAwardDialog(val) { + + // }, + // 关闭奖励弹窗 ExploreHandleClose() { this.ExploreDialogVisible = false; @@ -919,16 +1016,29 @@ export default { }, // 复制链接 - copyLink(text) { - let url = `http://192.168.100.216:8030/home/new=${text}/box=undefined/id=undefined`; - let oInput = document.createElement("input"); - oInput.value = url; - document.body.appendChild(oInput); - oInput.select(); - document.execCommand("Copy"); - oInput.className = "oInput"; - oInput.style.display = "none"; - this.$message.success("Copy succeeded"); + copyLinkCode() { + if(this.token) { + let text = this.userData.code + let url = `http://192.168.100.216:8030/home/new=${text}/box=undefined/id=undefined`; + let oInput = document.createElement("input"); + oInput.value = url; + document.body.appendChild(oInput); + oInput.select(); + document.execCommand("Copy"); + oInput.className = "oInput"; + oInput.style.display = "none"; + this.$message.success("Copy succeeded"); + } else { + this.walletDialogVisible = true + } + + }, + isLogin() { + if(this.token) { + this.logDialogVisible = true + } else { + this.walletDialogVisible = true + } }, // nav 导航 @@ -1338,7 +1448,7 @@ export default { .bar { margin-bottom: 10px; .bar-top { - + display: flex; } .bar-btm { font-size: 10px; @@ -2022,6 +2132,10 @@ export default { z-index: 1; } .light-btn{ + background: #ffc35b; + color: #000; + padding: 5px 10px; + border-radius: 20px; cursor: pointer; } .Explore-dialog { diff --git a/src/views/home/logDialog.vue b/src/views/home/logDialog.vue index aaad0c3..4a58bc9 100644 --- a/src/views/home/logDialog.vue +++ b/src/views/home/logDialog.vue @@ -65,13 +65,14 @@ export default { return { logPageSize: 6, logCurrentPage: 1, - invitationList: [ - { - level: 1, // 段位 - nickname: "用户昵称", - score: 100 // 获得的积分 - } - ], + // invitationList: [ + // { + // level: 1, // 段位 + // nickname: "用户昵称", + // score: 100 // 获得的积分 + // } + // ], + invitationList: [], }; }, computed: {