Commit b5d567cf authored by xhx's avatar xhx

fix:弹窗及导入地址获取

parent bae01511
NODE_ENV="development"
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:8090"
VUE_APP_URL="http://172.16.100.59:8092"
VUE_APP_CHAIN="http://172.16.100.247:8801"
VUE_APP_AIRDROP = "http://172.16.100.59:8091"
VUE_APP_NODE=http://118.24.145.138:8801
NODE_ENV='development'
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:8090"
VUE_APP_URL="http://172.16.100.59:8092"
VUE_APP_CHAIN="http://172.16.100.247:8801"
VUE_APP_NODE=http://118.24.145.138:8801
......@@ -14,7 +14,7 @@
</noscript>
<div id="app"></div>
<script>
console.log('v1.0.2')
console.log('v1.0.4')
</script>
<!-- built files will be auto injected -->
</body>
......
......@@ -27,6 +27,22 @@
</div>
</div>
<x-popup :show="show" @getMessage="addInvite" />
<van-dialog
v-model="showSure"
title="注意"
:show-cancel-button="false"
:show-confirm-button="false"
>
<div class="px-2 mt-2">
<p>1台手机仅可为一个钱包地址提供委托服务,一旦绑定委托关系,无法解绑。</p>
<br>
<p>请再次确认推荐人地址:<span class="text-orange1">{{ value }}</span></p>
</div>
<div class="flex justify-around border-t mt-2">
<div class="py-3 flex-1 border-r" @click="showSure = false">取消</div>
<div class="py-3 flex-1" @click="handleConfirm">{{ text }}</div>
</div>
</van-dialog>
<van-popup v-model="showInfo">
<div class="mining-card-info">
<p class="text-lg text-white">票池每日矿产出</p>
......@@ -47,15 +63,16 @@ import constant from '@/constance/Image'
import Bus from '@/utils/bus'
import { invitePool, poolList, checkBind } from '@/service/pool'
import service from '@/service/chain33'
import { PullRefresh, Toast, Popup } from 'vant'
import { PullRefresh, Toast, Popup, Dialog } from 'vant'
// import { getDeviceId, getCurrentBTYAddress } from '@/utils/bridge' // 币钱包环境
export default Vue.extend({
components: {
'van-pull-refresh': PullRefresh,
'van-popup': Popup,
'van-dialog': Dialog.Component,
MiningCard,
'x-popup': xPopup
'x-popup': xPopup,
},
data() {
return {
......@@ -70,7 +87,11 @@ export default Vue.extend({
show: false,
showInfo: false,
coins: 0,
val: ''
val: '',
showSure: false,
text: '5',
value: '',
tipsTimer: 0
}
},
computed: {
......@@ -184,10 +205,55 @@ export default Vue.extend({
Toast('请先输入推荐人地址')
return
}
invitePool(val).then((res: any) => {
this.value = val
this.text = '5'
if (this.tipsTimer) clearInterval(this.tipsTimer)
this.tipsTimer = setInterval(() => {
console.log('run---------')
this.text = +this.text > 0 ? +this.text - 1 + '' : '确定'
}, 1000)
this.showSure = true
// Dialog.confirm({
// title: '提示',
// message: `注意:1台手机仅可为一个钱包地址提供委托服务,一旦绑定委托关系,无法解绑。\n请再次确认推荐人地址:${val}`,
// confirmButtonText: `${text}`,
// }).then(() => {
// // on close
// if (+text > 0) {
// console.log('-----------------')
// return false;
// }
// invitePool(val).then((res: any) => {
// if (res.data.data.isSucc) {
// Toast('添加成功')
// this.show = false
// this.getList()
// Bus.$emit('updateMsg', true)
// } else {
// Toast('请输入正确的推荐人地址')
// }
// }).catch((e) => {
// console.log(e)
// const { status } = e.response
// if (status === 413) {
// Toast('该设备已绑定过推荐人')
// } else {
// Toast('请输入正确的推荐人地址')
// }
// })
// });
},
handleConfirm() {
if (+this.text > 0) {
this.showSure = true;
return;
}
console.log('this.val', this.value)
invitePool(this.value).then((res: any) => {
if (res.data.data.isSucc) {
Toast('添加成功')
this.show = false
this.showSure = false
this.getList()
Bus.$emit('updateMsg', true)
} else {
......@@ -201,8 +267,9 @@ export default Vue.extend({
} else {
Toast('请输入正确的推荐人地址')
}
this.showSure = false
})
},
}
},
mounted() {
setTimeout(() => {
......@@ -290,4 +357,9 @@ export default Vue.extend({
/deep/ .van-popup--center {
border-radius: 27px;
}
/deep/ .van-dialog__header {
font-weight: bold;
color: #f00;
font-size: 16px;
}
</style>
\ No newline at end of file
......@@ -79,13 +79,9 @@ import { passwdInputProxy } from '@/utils/passwdProxy';
import { importSeed } from '@/utils/bridge';
import { createAccount } from '@/utils/account';
import { Toast, Dialog } from 'vant';
import { mapState } from 'vuex';
export default Vue.extend({
data() {
return {
// mapState({
// wifiName: ''
// }),
pageShow: false,
wifiName: '',
devices: [] as Array<any>,
......@@ -100,9 +96,6 @@ export default Vue.extend({
btyAddress():string {
return this.$store.state.app.address
},
// ...mapState({
// btyAddress: (state: any) => state.app.address
// })
},
components: {
DeviceItem,
......@@ -126,7 +119,7 @@ export default Vue.extend({
},
resetWalletHandler(params: any){
if (!this.isEqualBtyAddress(params.mineAddress)) {
this.$toast('请确认当前币钱包地址与设备地址一致');
this.$toast('请确认当前币钱包地址与YUAN-miner设备地址一致');
return;
}
let toast: any;
......@@ -169,8 +162,8 @@ export default Vue.extend({
Dialog
.alert({
title: '关闭成功',
// message: '矿机程序已经下载完成,请手动重启设备',//请等待程序重启
message: '节点关闭成功,请手动关闭设备',
// message: '矿机程序已经下载完成,请手动重启YUAN-miner设备',//请等待YUAN-miner程序重启
message: '节点关闭成功,请手动关闭YUAN-miner设备',
})
.then(() => {
// on close
......@@ -200,7 +193,7 @@ export default Vue.extend({
},
routeTo(params: any) {
if (!this.isEqualBtyAddress(params.mineAddress)) {
this.$toast('请确认当前币钱包地址与设备地址一致');
this.$toast('请确认当前币钱包地址与YUAN-miner设备地址一致');
return;
}
this.$router.push({
......@@ -228,7 +221,7 @@ export default Vue.extend({
forbidClick: true,
message: '正在导入钱包,请稍后...'
});
const label = '节点';
const label = 'YUAN-miner节点';
await createAccount({
seed,
passwd,
......@@ -308,4 +301,4 @@ export default Vue.extend({
min-height: 80vh;
}
}
</style>
\ No newline at end of file
</style>
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