Commit 959d4750 authored by xhx's avatar xhx

fix:邀请人验证

parent 738c427e
......@@ -13,9 +13,7 @@
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script>
console.log('v1.1.0')
</script>
<script>console.log('v1.3.0')</script>
<!-- built files will be auto injected -->
</body>
</html>
......@@ -50,6 +50,15 @@ export const bindPool = function(id: string, amount: string|number, isBind?: boo
}
/**
* 是否是超级节点|社区节点
* @param addr
* @returns
*/
export const getTop = function(addr: string) {
return service.get('/web/is-top', {params: { addr }})
}
/**
* 是否初次绑定委托
* @param id
* @returns
......
......@@ -61,7 +61,7 @@ import MiningCard from '@/components/MiningCard.vue'
import xPopup from '@/components/Popup.vue'
import constant from '@/constance/Image'
import Bus from '@/utils/bus'
import { invitePool, poolList, checkBind } from '@/service/pool'
import { invitePool, poolList, checkBind, getTop } from '@/service/pool'
import service from '@/service/chain33'
import { PullRefresh, Toast, Popup, Dialog } from 'vant'
import { mapState } from 'vuex'
......@@ -219,11 +219,9 @@ export default Vue.extend({
Toast('请先输入推荐人地址')
return
} else {
// 查询冻结余额, > 9000 可推荐
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) {
getTop(val).then(res => {
console.log('res-isTop', res)
if (res.data.data.isSucc) {
this.value = val
this.text = '5'
if (this.tipsTimer) clearInterval(this.tipsTimer)
......@@ -232,7 +230,22 @@ export default Vue.extend({
}, 1000)
this.showSure = true
} else {
Toast('该推荐人暂无推荐资格')
// 查询冻结余额, > 9000 可推荐
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'
if (this.tipsTimer) clearInterval(this.tipsTimer)
this.tipsTimer = setInterval(() => {
this.text = +this.text > 0 ? +this.text - 1 + '' : '确定'
}, 1000)
this.showSure = true
} else {
Toast('该推荐人暂无推荐资格')
}
})
}
})
}
......
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