Commit 10767c60 authored by xhx's avatar xhx

fix:调整

parent 2e76f9c9
......@@ -80,7 +80,7 @@ export default Vue.extend({
}
},
rest() {
return Math.floor((this.coin - 1)/TICKET_COUNT)
return Math.floor((this.coin - 1)/TICKET_COUNT) < 0 ? 0 : Math.floor((this.coin - 1)/TICKET_COUNT)
}
}
})
......
......@@ -78,7 +78,7 @@ export default Vue.extend({
},
async buy(value: string) {
if ((this.profit-1)/this.ticketNum < +(this.min as number)) {
Toast(`您的票数余额为${Math.floor((this.profit-1)/this.ticketNum)}票,不足${this.min}票`)
Toast(`您的票数余额为${Math.floor((this.profit-1)/this.ticketNum) < 0 ? 0 : Math.floor((this.profit-1)/this.ticketNum)}票,不足${this.min}票`)
return
}
const bindRes = await service.createBindMiner({
......
......@@ -36,12 +36,12 @@ import { mapState } from 'vuex'
export default Vue.extend({
data() {
return {
addr: '',
addr: '', // 当前地址
inviter: '', // 推荐人地址
profit: 0,
ticketNum: 0,
fee: 0,
profit: 0, // 当前收益
ticketNum: 0, // 当前票数
btnText: '领取奖励',
fee: 0,
timer: 0,
waiter: 1000
}
......@@ -62,6 +62,7 @@ export default Vue.extend({
getInfo() {
service.getBalance(this.address, 'ticket').then((res: any) => {
const { result } = res.data
console.log('用户余额', result[0].frozen)
this.profit = Math.floor(result[0].balance / 1e8)
this.ticketNum = Math.floor(result[0].frozen / 1e8 / TICKET_COUNT)
// this.profit = Math.floor((res.data.result as any)[0].balance / 1e8)
......
......@@ -77,18 +77,21 @@ export default Vue.extend({
},
data() {
return {
// 列表相关
lists: [] as any,
isLoading: false,
refresh: false,
page: 1,
pageSize: 10,
count: 0,
count: 0, // 总数
coins: 0, // 计算余票
timer: 0,
waiter: 180000,
show: false,
// 数据展示,暂时隐藏
showInfo: false,
coins: 0,
val: '',
val: '', // 展示信息
show: false, // 邀请人弹窗
// 邀请确认弹窗
showSure: false,
text: '5',
value: '',
......@@ -217,8 +220,9 @@ export default Vue.extend({
return
} else {
// 查询冻结余额, > 9000 可推荐
service.getBalance(this.address, 'ticket').then((res: any) => {
service.getBalance(val, 'ticket').then((res: any) => {
const restFreeze = Math.floor(res.data.result[0].frozen / 1e8)
console.log(res.data.result[0].frozen, '冻结余额--ticket', restFreeze)
if (restFreeze >= 9000) {
this.value = val
this.text = '5'
......
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