Commit 153c9039 authored by xhx's avatar xhx

调整

parent 7bb75be5
NODE_ENV="development" NODE_ENV="development"
#VUE_APP_URL="http://172.16.100.59:8090" VUE_APP_URL="http://172.16.100.59:8090"
VUE_APP_URL="http://172.16.100.59:8092" #VUE_APP_URL="http://172.16.100.59:8092"
VUE_APP_CHAIN="http://172.16.100.59:8801" VUE_APP_CHAIN="http://172.16.100.59:8801"
#VUE_APP_CHAIN="https://mainnet.bityuan.com/api" #VUE_APP_CHAIN="https://mainnet.bityuan.com/api"
\ No newline at end of file
NODE_ENV='development' NODE_ENV='development'
#VUE_APP_URL="http://172.16.100.59:8090" VUE_APP_URL="http://172.16.100.59:8090"
VUE_APP_URL="http://172.16.100.59:8092" #VUE_APP_URL="http://172.16.100.59:8092"
VUE_APP_CHAIN="http://172.16.100.59:8801" VUE_APP_CHAIN="http://172.16.100.59:8801"
\ No newline at end of file
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
// } // }
export const test = { export const test = {
// addr: '1Lm22ZxsCHYE3PNtEnGYZJduJs5KG95GUp', // addr: '1Lm22ZxsCHYE3PNtEnGYZJduJs5KG95GUp',
addr: '16vD58z9z2Uvpci8ssvj797ENahbYZ497W', // addr: '16vD58z9z2Uvpci8ssvj797ENahbYZ497W',
// addr: '16GgdskdRFasxuMdtBaxNS4ZagyZgEUuMs', addr: '16GgdskdRFasxuMdtBaxNS4ZagyZgEUuMs',
// addr: '1LGQLmGVHSNthZcLbGpVfJTDmcicMQprZs', // addr: '1LGQLmGVHSNthZcLbGpVfJTDmcicMQprZs',
privateKey: '0xa65b62735022cd47b11c5a88b0caac8d360810257aaf1e14bbc330dee63b35ff' privateKey: '0xa65b62735022cd47b11c5a88b0caac8d360810257aaf1e14bbc330dee63b35ff'
} }
......
...@@ -52,9 +52,6 @@ export default Vue.extend({ ...@@ -52,9 +52,6 @@ export default Vue.extend({
service.getBalance(this.$store.state.app.address, 'coins').then((res: any) => { service.getBalance(this.$store.state.app.address, 'coins').then((res: any) => {
this.profit = Math.floor((res.data.result as any)[0].balance / 1e8) this.profit = Math.floor((res.data.result as any)[0].balance / 1e8)
}) })
service.getBalance(this.$store.state.app.address, 'ticket').then((res: any) => {
this.ticket = Math.floor((res.data.result as any)[0].balance / 1e8)
})
}, },
getInfo() { getInfo() {
poolInfo(this.$route.query.id as string).then((res: any) => { poolInfo(this.$route.query.id as string).then((res: any) => {
...@@ -91,6 +88,9 @@ export default Vue.extend({ ...@@ -91,6 +88,9 @@ export default Vue.extend({
note: 'coins->ticket', note: 'coins->ticket',
execName: 'ticket' execName: 'ticket'
}) })
// service.getBalance(this.$store.state.app.address, 'coins').then((res: any) => {
// this.profit = Math.floor((res.data.result as any)[0].balance / 1e8)
// })
const sign = await this.signGroup([bindRes.data.result.txHex, transRes.data.result]); const sign = await this.signGroup([bindRes.data.result.txHex, transRes.data.result]);
Toast.loading({ Toast.loading({
duration: 0, duration: 0,
...@@ -117,7 +117,7 @@ export default Vue.extend({ ...@@ -117,7 +117,7 @@ export default Vue.extend({
if (isBind) return if (isBind) return
bindPool(this.info.id, value, isBind).then(async (r: any) => { bindPool(this.info.id, value, isBind).then(async (r: any) => {
if (r.data.data.isSucc) { if (r.data.data.isSucc) {
this.$store.commit('global/SET_BALANCE', this.ticketNum * Number(value) + this.ticket) this.$store.commit('global/SET_BALANCE', this.ticket)
this.$toast('购买成功') this.$toast('购买成功')
} }
}).catch(e => { }).catch(e => {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue' import Vue from 'vue'
import service from '@/service/chain33' import service from '@/service/chain33'
import { TICKET_COUNT } from '@/constance/const' import { TICKET_COUNT, INCOME } from '@/constance/const'
import { Toast } from 'vant' import { Toast } from 'vant'
import Bus from '@/utils/bus' import Bus from '@/utils/bus'
export default Vue.extend({ export default Vue.extend({
...@@ -55,20 +55,16 @@ export default Vue.extend({ ...@@ -55,20 +55,16 @@ export default Vue.extend({
service.getBalance(this.$store.state.app.address, 'ticket').then((res: any) => { service.getBalance(this.$store.state.app.address, 'ticket').then((res: any) => {
this.profit = Math.floor((res.data.result as any)[0].balance / 1e8) this.profit = Math.floor((res.data.result as any)[0].balance / 1e8)
this.ticketNum = Math.floor((res.data.result as any)[0].frozen / 1e8 / TICKET_COUNT) this.ticketNum = Math.floor((res.data.result as any)[0].frozen / 1e8 / TICKET_COUNT)
console.log(this.$store.state.global.inputBalance, 'income')
console.log(this.profit, 'profit')
// 等待 freezon // 等待 freezon
if (this.$store.state.global.inputBalance <= this.profit) { // if (this.profit <= this.$store.state.global.inputBalance + INCOME) {
this.btnClick = true // this.btnClick = true
this.btnText = '等待挖矿' // this.btnText = '等待挖矿'
this.waitToPool() // this.waitToPool()
} else { // } else {
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
// 普通状态 重置 inputBalance
this.$store.commit('global/SET_BALANCE', 0)
this.btnText = '领取收益' this.btnText = '领取收益'
this.btnClick = false this.btnClick = false
} // }
}) })
}, },
getFee() { getFee() {
......
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