修复数据不更新
This commit is contained in:
parent
272adea0aa
commit
a42e351939
Binary file not shown.
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 2.5 KiB |
BIN
src/assets/common/head_default.jpg
Normal file
BIN
src/assets/common/head_default.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-btm-con">
|
||||
<div class="content-no" v-if="boxData.level == null">
|
||||
<div class="content-no" v-if="!boxData">
|
||||
<div class="box-img-no">
|
||||
<img src="./../../assets/box/Unlock .png" alt="">
|
||||
</div>
|
||||
@ -79,7 +79,8 @@
|
||||
</div>
|
||||
<div class="box-btm-con-img">
|
||||
<div>
|
||||
<img :src="require(`./../../assets/box/box0${boxData.level}.png`)" alt="">
|
||||
<img v-if="!boxData.level" src="./../../assets/box/Unlock .png" alt="">
|
||||
<img v-else :src="require(`./../../assets/box/box0${boxData.level}.png`)" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-btm-con-boost">
|
||||
@ -116,7 +117,7 @@
|
||||
<div class="box-title-btm">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-list-no" v-if="boxList.length == 0">
|
||||
<div class="box-list-no" v-if="!currentPageItems">
|
||||
<div>
|
||||
<p>None</p>
|
||||
</div>
|
||||
@ -194,7 +195,7 @@
|
||||
<template slot="empty">
|
||||
<div>No Data</div>
|
||||
</template>
|
||||
<el-table-column prop="rank" label="Action">Open the Treasure</el-table-column>
|
||||
<el-table-column label="Action">Open the Treasure</el-table-column>
|
||||
<el-table-column label="Time">
|
||||
<template
|
||||
slot-scope="scope"
|
||||
@ -352,6 +353,9 @@ export default {
|
||||
computed: {
|
||||
// 计算当前页应该显示的数据
|
||||
currentPageItems() {
|
||||
// if(this.pageBoxList.length == 0){
|
||||
// return this.pageBoxList
|
||||
// }
|
||||
let start = (this.currentPage - 1) * this.pageSize;
|
||||
let end = start + this.pageSize;
|
||||
this.pageBoxList = this.boxList.slice(start, end)
|
||||
@ -361,6 +365,9 @@ export default {
|
||||
|
||||
// 计算开箱子分页
|
||||
recordsCurrentPageItems() {
|
||||
// if(this.recordsList.length == 0){
|
||||
// return this.recordsList
|
||||
// }
|
||||
let start = (this.recordsCurrentPage - 1) * this.recordsPageSize;
|
||||
let end = start + this.recordsPageSize;
|
||||
return this.recordsList.slice(start, end)
|
||||
@ -450,8 +457,8 @@ export default {
|
||||
try {
|
||||
storeageKey = await sendToChain('chest_open', address, id)
|
||||
} catch (err) {
|
||||
this.$showErr(err.data.message)
|
||||
this.isLoading = false
|
||||
this.$message.error(`error send chain request`)
|
||||
return
|
||||
}
|
||||
|
||||
@ -469,6 +476,7 @@ export default {
|
||||
// alert(`领取成功,显示奖励: ${JSON.stringify(data)}`)
|
||||
this.getMyBoxList()
|
||||
this.openBoxLog()
|
||||
this.getUserState()
|
||||
this.isLoading = false
|
||||
this.$emit('awardDialog', data)
|
||||
localStorage.removeItem(storeageKey)
|
||||
@ -514,6 +522,9 @@ export default {
|
||||
})
|
||||
this.recordsList = res.data.data
|
||||
},
|
||||
rewBoxList() {
|
||||
this.getMyBoxList()
|
||||
},
|
||||
|
||||
// 开箱记录分页
|
||||
onRecordsChangePage(val) {
|
||||
@ -533,6 +544,15 @@ export default {
|
||||
onBoostingChangePage(val) {
|
||||
this.boostingCurrentPage = val
|
||||
},
|
||||
|
||||
// 获取用户状态
|
||||
getUserState() {
|
||||
this.$axios.get(process.env.VUE_APP_API_URL+'/api/user/state',{ params: '',
|
||||
headers: { Authorization: `Bearer ${this.token}` },
|
||||
}).then(res => {
|
||||
localStorage.setItem('userData', JSON.stringify(res.data.data))
|
||||
})
|
||||
},
|
||||
|
||||
// 复制助力链接
|
||||
copyLink(data) {
|
||||
@ -700,6 +720,7 @@ export default {
|
||||
.box-log {
|
||||
display: flex;
|
||||
margin: 20px 0;
|
||||
margin-top: 40px;
|
||||
.btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -899,8 +920,6 @@ export default {
|
||||
width: 380px;
|
||||
height: 600px;
|
||||
padding: 30px;
|
||||
background: url("./../../assets/common/Right_box.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.box-page {
|
||||
.box-title {
|
||||
.box-title-top {
|
||||
|
@ -110,9 +110,10 @@ export default {
|
||||
this.isLoading = false
|
||||
cc.mainAnim.setCurrPos(getTotalUsed)
|
||||
cc.mainAnim.setData(step)
|
||||
setTimeout(
|
||||
this.$emit('awardDialog', data),
|
||||
step*2000)
|
||||
let stepTimeId = setInterval(() => {
|
||||
this.$emit('awardDialog', data)
|
||||
clearInterval(stepTimeId)
|
||||
},step*2000)
|
||||
localStorage.removeItem(storeageKey)
|
||||
clearInterval(serTimeId)
|
||||
}
|
||||
|
@ -227,8 +227,8 @@ export default {
|
||||
try {
|
||||
storeageKey = await sendToChain('chest_enhance', address, boxCode)
|
||||
} catch (err) {
|
||||
this.$showErr(err.data.message)
|
||||
this.isLoading = false;
|
||||
this.$message.error(`error send chain request`)
|
||||
return
|
||||
}
|
||||
let serTimeId = setInterval(async () => {
|
||||
@ -248,6 +248,7 @@ export default {
|
||||
this.$emit('awardDialog', this.awardData)
|
||||
this.$emit('handleClose')
|
||||
}
|
||||
this.getUserState()
|
||||
localStorage.removeItem(storeageKey)
|
||||
clearInterval(serTimeId)
|
||||
} else if (errcode !== 14) {
|
||||
@ -273,6 +274,14 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取用户状态
|
||||
getUserState() {
|
||||
this.$axios.get(process.env.VUE_APP_API_URL+'/api/user/state',{ params: '',
|
||||
headers: { Authorization: `Bearer ${this.token}` },
|
||||
}).then(res => {
|
||||
localStorage.setItem('userData', JSON.stringify(res.data.data))
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭弹窗
|
||||
helpDialog() {
|
||||
|
@ -84,7 +84,7 @@
|
||||
<h4>How it works</h4>
|
||||
<div
|
||||
class="desc"
|
||||
>Every step is filled with possibilities; every movement might begin a new chapter All on-chain activities are built on opBNB Click on the smiley face to view more details on Medium</div>
|
||||
>Every step is filled with possibilities; every movement might begin a new chapter. <br /> All on-chain activities are built on opBNB. <br />Click on the smiley face to view more details on Medium</div>
|
||||
</div>
|
||||
<div class="explore-desc-map" v-if="navIndex == 1">
|
||||
<li>
|
||||
@ -203,7 +203,7 @@
|
||||
<div v-if="token != null" class="btn">
|
||||
<div class="is-btn">
|
||||
<div v-if="item.status == 0" class="started" @click.stop="toPost(item)">{{ item.actionTitle }}</div>
|
||||
<CheckBtn v-if="item.status == 1" @stateupdate="toCheck" :dataid="item.id" time="10" title="Check" class="started">Verify</CheckBtn>
|
||||
<CheckBtn v-if="item.status == 1" @stateupdate="toCheck" :dataid="item.id" time="10" title="Verify" class="started">Verify</CheckBtn>
|
||||
<div v-if="item.status == 2" class="claim" @click.stop="getTaskClaim(item.id)">Claim</div>
|
||||
<div v-if="item.status == 3" class="success">+{{ item.score }} <img src="./../../assets/common/Checkmark (1).png" alt=""></div>
|
||||
</div>
|
||||
@ -557,7 +557,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-btm" v-show="navIndex == 3">
|
||||
<BoxBtm @toExplore="toExplore" @awardDialog="activityDialog" />
|
||||
<BoxBtm ref="boxList" @toExplore="toExplore" @awardDialog="activityDialog" />
|
||||
</div>
|
||||
<div class="box-btm" v-show="navIndex == 4">
|
||||
<Ranking :activityName="activityData.name" />
|
||||
@ -1013,9 +1013,11 @@ export default {
|
||||
}
|
||||
});
|
||||
this.dialogTitle = 'Explore successfully and get rewards'
|
||||
this.$refs.boxList.rewBoxList()
|
||||
} else {
|
||||
this.dialogTitle = 'Congratulations'
|
||||
}
|
||||
this.getUserState()
|
||||
this.getGameStat()
|
||||
this.ExploreDialogVisible = true
|
||||
},
|
||||
@ -1035,6 +1037,7 @@ export default {
|
||||
this.awardData = val
|
||||
this.eventName = 'help_event'
|
||||
this.dialogTitle = 'Congratulations'
|
||||
this.getUserState()
|
||||
this.ExploreDialogVisible = true
|
||||
},
|
||||
|
||||
@ -1110,17 +1113,18 @@ export default {
|
||||
// return
|
||||
// ToDo
|
||||
let res = await apiCheckinClaimSeq(day)
|
||||
console.log(res)
|
||||
console.info(res)
|
||||
this.getGameStat();
|
||||
},
|
||||
|
||||
// 获取累计签到奖励
|
||||
async getCheckClaim(days) {
|
||||
let res = await apiCheckinClaim(days);
|
||||
if (res.ticket) {
|
||||
// if (res.ticket) {
|
||||
console.info(res)
|
||||
this.getGameStat();
|
||||
this.$message.success('Received successfully')
|
||||
}
|
||||
// this.$message.success('Received successfully')
|
||||
// }
|
||||
},
|
||||
|
||||
// 获取钱包地址
|
||||
@ -1234,6 +1238,15 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// 获取用户状态
|
||||
getUserState() {
|
||||
this.$axios.get(process.env.VUE_APP_API_URL+'/api/user/state',{ params: '',
|
||||
headers: { Authorization: `Bearer ${this.token}` },
|
||||
}).then(res => {
|
||||
localStorage.setItem('userData', JSON.stringify(res.data.data))
|
||||
})
|
||||
},
|
||||
|
||||
// nav 导航
|
||||
navBtn(index) {
|
||||
this.navIndex = index;
|
||||
|
@ -78,6 +78,9 @@ export default {
|
||||
computed: {
|
||||
// 计算我的助力分页
|
||||
logCurrentPageItems() {
|
||||
if(this.invitationList.length == 0){
|
||||
return this.invitationList
|
||||
}
|
||||
let start = (this.logCurrentPage - 1) * this.logPageSize;
|
||||
let end = start + this.logPageSize;
|
||||
return this.invitationList.slice(start, end)
|
||||
|
@ -12,7 +12,8 @@
|
||||
<div class="list-btm">
|
||||
<div class="points">
|
||||
<!-- <formatPrice /> -->
|
||||
<span>{{ userData.scoreTotal }}</span>
|
||||
<span v-if="userData">{{ userData.scoreTotal }}</span>
|
||||
<span v-else>{{ userData.scoreTotal }}</span>
|
||||
<img src="./../../assets/common/Icon_Points.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
@ -22,12 +23,18 @@
|
||||
<div class="list-btm">
|
||||
<div class="ranking" v-if="userData.rankTotal == '-'">{{ userData.rankTotal }}</div>
|
||||
<div class="ranking" v-else-if="userData.rankTotal >= 100">Not in the top 100 yet</div>
|
||||
<div class="ranking" v-else>{{ userData.rankTotal+1 }}</div>
|
||||
<div class="ranking" v-else-if="userData.rankTotal">{{ userData.rankTotal+1 }}</div>
|
||||
<div class="ranking" v-else>-</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ranking-content-left-forward">
|
||||
<div v-if="rankingTableData.length == 0" class="ranking-content-left-forward-no">
|
||||
<div>
|
||||
<p>None</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="ranking-content-left-forward">
|
||||
<div class="forward-list">
|
||||
<li>
|
||||
<div class="forward-list-item-star">
|
||||
@ -35,10 +42,15 @@
|
||||
</div>
|
||||
<div class="forward-list-item-top">
|
||||
<div class="user-img">
|
||||
<img :src="rankingTableData[1].avatar" alt="">
|
||||
<img v-if="!rankingTableData[1]" src="@/assets/common/head_default.jpg" alt="">
|
||||
<img v-else :src="rankingTableData[1].avatar" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="forward-list-item-btm">
|
||||
<div class="forward-list-item-btm" v-if="!rankingTableData[1]">
|
||||
<div class="name">none</div>
|
||||
<div>0</div>
|
||||
</div>
|
||||
<div class="forward-list-item-btm" v-else>
|
||||
<div class="name">{{ rankingTableData[1].nickname }}</div>
|
||||
<div>{{ rankingTableData[1].score }}</div>
|
||||
</div>
|
||||
@ -49,7 +61,8 @@
|
||||
</div>
|
||||
<div class="forward-list-item-top">
|
||||
<div class="user-img">
|
||||
<img :src="rankingTableData[0].avatar" alt="">
|
||||
<img v-if="rankingTableData.length == 0" :src="rankingTableData[0].avatar" alt="">
|
||||
<img v-else :src="rankingTableData[0].avatar" alt="">
|
||||
</div>
|
||||
<!-- <div>{{ rankingTableData[0].nickname.slice(0,4) }}{{ '…'+rankingTableData[0].nickname.slice(-4) }}</div> -->
|
||||
</div>
|
||||
@ -63,11 +76,17 @@
|
||||
<img src="@/assets/box/Icon_Star_01.png" alt="">
|
||||
</div>
|
||||
<div class="forward-list-item-top">
|
||||
<div class="user-img">
|
||||
<img :src="rankingTableData[0].avatar" alt="">
|
||||
<div class="user-img">{{rankingTableData[2].avatar}}
|
||||
<img v-if="!rankingTableData[2]" src="@/assets/common/head_default.jpg" alt="">
|
||||
<img v-else-if="rankingTableData[2].avatar == ''" src="@/assets/common/head_default.jpg" alt="">
|
||||
<img v-else :src="rankingTableData[2].avatar" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="forward-list-item-btm">
|
||||
<div class="forward-list-item-btm" v-if="!rankingTableData[2]">
|
||||
<div class="name">none</div>
|
||||
<div>0</div>
|
||||
</div>
|
||||
<div class="forward-list-item-btm" v-else>
|
||||
<div class="name">{{ rankingTableData[2].nickname }}</div>
|
||||
<div>{{ rankingTableData[2].score }}</div>
|
||||
</div>
|
||||
@ -76,7 +95,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="ranking-content-right">
|
||||
<div class="ranking-content-right-list">
|
||||
<div v-if="rankingTableData.length == 0" class="ranking-content-right-list-no">
|
||||
<div>
|
||||
<p>None</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="ranking-content-right-list">
|
||||
<li v-for="(item, index) in rankingTableData" :key="index">
|
||||
<div class="left">
|
||||
<div class="left-left">
|
||||
@ -90,7 +114,7 @@
|
||||
<div class="left-right">
|
||||
<div class="user-img">
|
||||
<img class="one-img" v-if="item.avatar != ''" :src="item.avatar" alt="">
|
||||
<img class="one-img" v-else src="./../../assets/home/Nav bar_character.png" alt="">
|
||||
<img class="one-img" v-else src="@/assets/common/head_default.jpg" alt="">
|
||||
</div>
|
||||
<div class="user-name">
|
||||
<div class="label">Name</div>
|
||||
@ -359,6 +383,27 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.ranking-content-left-forward-no {
|
||||
height: 500px;
|
||||
position: relative;
|
||||
div {
|
||||
position: absolute;
|
||||
top: -8%;
|
||||
left: 50%;
|
||||
transform: translate(-0%, -50%);
|
||||
width: 200px;
|
||||
height: 140px;
|
||||
background: url('./../../assets/box/none01.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
p {
|
||||
position: absolute;
|
||||
bottom: 8%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ranking-content-right {
|
||||
width: 30%;
|
||||
@ -477,6 +522,27 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.ranking-content-right-list-no {
|
||||
height: 500px;
|
||||
position: relative;
|
||||
div {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 200px;
|
||||
height: 140px;
|
||||
background: url('./../../assets/box/none01.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
p {
|
||||
position: absolute;
|
||||
bottom: 8%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user