Merge branch 'master' of http://git.kingsome.cn/yuyongdong/UAW
This commit is contained in:
commit
b8413a32ec
BIN
src/assets/common/Picture frame .png
Normal file
BIN
src/assets/common/Picture frame .png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
@ -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) => {
|
||||
|
@ -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 }}
|
||||
|
@ -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')
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user