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, { }) return httpPost(url, { })
} }
// 宝箱助力 // 宝箱助力
export const apiEnhanceBox = async (coder) => { export const apiEnhanceBox = async (code) => {
const url = `${API_BASE}/api/chest/enhance`; const url = `${API_BASE}/api/chest/enhance`;
return httpPost(url, {coder}) return httpPost(url, {code})
} }
// 开启宝箱 // 开启宝箱
export const apiBoxOpen = async (chestId) => { export const apiBoxOpen = async (chestId) => {

View File

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

View File

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

View File

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

View File

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