Commit bf0cc816 authored by xhx's avatar xhx

fix

parent 5d3185f7
<template>
<div class="mining-card bg-card-color px-2 pt-10 pb-2 rounded-lg">
<div class="mining-card bg-card-color px-2 pb-2 rounded-lg">
<div class="mining-name bg-gradient-3 text-white text-13px rounded-r-full">{{ info.name }}</div>
<!-- <time-box :date="runDays" :prefix="prefix" /> -->
<div class="text-right text-white2 text-sm" @click="showInfo">票池每票日产出</div>
<!-- <div class="text-right text-white2 text-sm" @click="showInfo">票池每票日产出</div> -->
<div>
<div class="px-2 flex items-center justify-between">
<div class="px-2 pt-3 pl-14 pb-8 flex items-center justify-between">
<span class="font-semibold text-white1">{{ info.friendlyName }}</span>
</div>
<div class="pb-3 flex items-center justify-between">
<div class="px-2 flex flex-col items-start">
<div class="income-count">{{ rest || 0 }}</div>
<div class="text-xs text-white2">可委托票数约</div>
<div class="income-count">{{ rest || 0 }}</div>
</div>
<button class="w-24 h-9 rounded-full text-sm text-brown1 text-medium bg-gradient-4" @click="goMining">立即委托</button>
</div>
......
......@@ -37,11 +37,11 @@
<template v-slot:right><span>{{ info.selfEntrustTicket || 0 }} 票</span></template>
</list-line> -->
<list-line>
当前委托人数
委托人数
<template v-slot:right><span class="special">{{ info.entrustPerson || 0 }}</span></template>
</list-line>
<list-line>
当前委托投票票数
委托总票
<template v-slot:right><span class="special">{{ info.entrustTicket || 0 }}</span></template>
</list-line>
</div>
......@@ -73,8 +73,8 @@ export default Vue.extend({
},
computed: {
address(): string {
const length = this.info.minerAddr.length
return this.info.minerAddr.slice(0, 10) + '...' + this.info.minerAddr.slice(length-10)
const length = this.info.minerAddr?.length
return this.info?.minerAddr?.slice(0, 10) + '...' + this.info?.minerAddr?.slice(length-10)
}
}
})
......
......@@ -162,32 +162,32 @@ export default Vue.extend({
sellDays: string,
startTime: string
}) {
service.getTicketAddress(this.$store.state.app.address).then(r => {
// service.getTicketAddress(this.$store.state.app.address).then(r => {
// 已经投过票,跳过封闭期
if (r.data.result?.data) {
checkBind(val.id).then(res => {
if (res.data.data.isSucc) {
Toast.clear()
// if (r.data.result?.data) {
// checkBind(val.id).then(res => {
// if (res.data.data.isSucc) {
// Toast.clear()
this.$router.push({ path: '/details', query: { id: val.id || '1' }})
}
}).catch(() => {
Toast('该账号已绑定过票池')
})
} else {
// 未投过,检测封闭期是否到期,到期停止进入
const _now = Date.now()
const endTime = (+val.startTime + (+val.sellDays * 24 * 3600)) * 1000
if (endTime < _now && val.sellDays !== '0') {
Toast('该票池已过封闭期,您不能进入')
} else {
// 清除失败提示
Toast.clear()
this.$router.push({ path: '/details', query: { id: val.id || '1' }})
}
}
}).catch(() => {
Toast('网络异常')
})
// }
// }).catch(() => {
// Toast('该账号已绑定过票池')
// })
// } else {
// // 未投过,检测封闭期是否到期,到期停止进入
// const _now = Date.now()
// const endTime = (+val.startTime + (+val.sellDays * 24 * 3600)) * 1000
// if (endTime < _now && val.sellDays !== '0') {
// Toast('该票池已过封闭期,您不能进入')
// } else {
// // 清除失败提示
// Toast.clear()
// this.$router.push({ path: '/details', query: { id: val.id || '1' }})
// }
// }
// }).catch(() => {
// Toast('网络异常')
// })
},
addInvite(val: string) {
if (!val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment