This commit is contained in:
yuexin 2024-04-14 01:35:09 +08:00
commit b8413a32ec
6 changed files with 66 additions and 41 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -210,9 +210,9 @@ export const apiBoxList = async () => {
return httpPost(url, { })
}
// 宝箱助力
export const apiEnhanceBox = async (coder) => {
export const apiEnhanceBox = async (code) => {
const url = `${API_BASE}/api/chest/enhance`;
return httpPost(url, {coder})
return httpPost(url, {code})
}
// 开启宝箱
export const apiBoxOpen = async (chestId) => {

View File

@ -206,6 +206,7 @@
slot-scope="scope"
>
<div class="touxiang">
<!-- <div class=""></div> -->
<img src="./../../assets/home/Nav bar_character.png" alt="" />
{{ scope.row.address.slice(0,4) }}
{{ '……'+scope.row.username }}

View File

@ -67,10 +67,11 @@
<script>
import { getToken } from './../../utils/cookies.js'
import { sendHelp } from './../../utils/chainapi.js'
import { sendToChain } from './../../utils/chainapi.js'
import {
checkReCaptcha,
apiUploadInviteCode
apiUploadInviteCode,
apiEnhanceBox
} from "./../../utils/webapi.js";
export default {
@ -102,7 +103,7 @@ export default {
this.getBoxData()
if(this.token) {
this.getHelpBoxLog()
this.helpConfirm()
// this.helpConfirm()
this.initBoxState(this.boxCode,this.boxId)
}
},
@ -140,6 +141,8 @@ export default {
// headers: { Authorization: `Bearer ${this.token}` }
// });
let res = await apiUploadInviteCode(newInvite)
console.log('领取助力奖励 || 判断是否是新用户',res)
return
if (res.data.errcode == 0) {
this.isNewUser = 0
} else {
@ -158,38 +161,39 @@ export default {
// 3
if(this.boxState.enhanced == 0) {
// 4
this.sendEnhanceReq(this.boxCode)
try{
// 5
let helpRes = await sendHelp(address, this.boxCode)
if(helpRes) {
// 6
let serTimeId = setInterval(async () => {
let res = await this.$axios.post(
"/api/chest/enhance",
{ code: this.boxCode },
{ headers: { Authorization: `Bearer ${this.token}` } }
);
if (res.data.errcode == 0) {
// 7
if(this.isNewUser == 0) {
// 8
this.awardData = {...res.data.data, isNewUser: this.isNewUser}
this.$emit('awardDialog', this.awardData)
this.$emit('handleClose')
} else {
// 8
this.awardData = {...res.data.data, isNewUser: this.isNewUser}
this.$emit('awardDialog', this.awardData)
this.$emit('handleClose')
}
clearInterval(serTimeId)
}
}, 2000)
}
} catch(e) {
this.$message.error(e.message)
}
await this.sendEnhanceReq(this.boxCode)
// return
// try{
// // 5
// let helpRes = await sendHelp(address, this.boxCode)
// if(helpRes) {
// // 6
// let serTimeId = setInterval(async () => {
// let res = await this.$axios.post(
// process.env.VUE_APP_API_URL+"/api/chest/enhance",
// { code: this.boxCode },
// { headers: { Authorization: `Bearer ${this.token}` } }
// );
// if (res.data.errcode == 0) {
// // 7
// if(this.isNewUser == 0) {
// // 8
// this.awardData = {...res.data.data, isNewUser: this.isNewUser}
// this.$emit('awardDialog', this.awardData)
// this.$emit('handleClose')
// } else {
// // 8
// this.awardData = {...res.data.data, isNewUser: this.isNewUser}
// this.$emit('awardDialog', this.awardData)
// this.$emit('handleClose')
// }
// clearInterval(serTimeId)
// }
// }, 2000)
// }
// } catch(e) {
// this.$message.error(e.message)
// }
} else {
this.$emit('handleClose')
this.$message.error('Already helped this treasure chest')

View File

@ -175,7 +175,7 @@
<p>attempts.</p>
</div>
</div>
<div class="bar-right">{{filteredBar}}
<div class="bar-right">
<div class="bar-no" v-if="filteredBar < 100">
<span>X 3 </span>
<img src="@/assets/common/Icon_explore0.png" alt="">
@ -966,7 +966,7 @@ export default {
this.level2 = []
this.level3 = []
this.level4 = []
val.chest.forEach(element => {
val.chests.forEach(element => {
if (element.level == "1") {
this.level1.push(element)
} else if (element.level == "2") {
@ -1173,6 +1173,8 @@ export default {
// });
console.log("[code]", newInvite)
let res = await apiUploadInviteCode(newInvite)
console.log('领取助力奖励 || 判断是否是新用户---',res)
return
if (res.data.errcode == 0) {
this.isNewUser = 0
// this.getUploadInviteCode(newInvite)
@ -1344,10 +1346,23 @@ export default {
}
}
.touxiang {
width: 80px;
height: 80px;
position: absolute;
top: 50%;
right: -20px;
transform: translateY(-50%);
background: url('@/assets/common/Picture frame .png') no-repeat;
background-size: 100% 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 5px;
box-sizing: border-box;
img {
width: 100%;
height: 100%;
}
}
}
.left-top-points-right {

View File

@ -399,11 +399,16 @@ export default {
.user-img {
width: 45px;
height: 45px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: url('@/assets/common/Picture frame .png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
img {
width: 100%;
height: 100%;
width: 95%;
height: 95%;
}
}
.user-name {