Skip to content

Commit

Permalink
优化 UI & fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaLotus committed Feb 6, 2021
1 parent ed15ed3 commit 0a21684
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
23 changes: 14 additions & 9 deletions src/components/NftGroup.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<template>
<div class="page-group">
<div class="page" id="page-wallet-index">
<header class="bar bar-nav">
<h3 class="title">{{$t('nft.nft_list')}}</h3>
<router-link :to="link('/')" replace class="icon icon-left"></router-link>
</header>
<div ref="bg" id="bg"></div>
<div class="content pull-to-refresh-content" ref="content">
<div class="tab-container">
Expand Down Expand Up @@ -38,7 +42,7 @@
</div>
</template>
<script>
import {swiper, swiperSlide} from 'vue-awesome-swiper';
// import {swiper, swiperSlide} from 'vue-awesome-swiper';
import AccountImage from './sub/AccountImage.vue';
import LeftPanel from './sub/LeftPanel.vue';
import AccountQRCode from './sub/AccountQRCode.vue';
Expand Down Expand Up @@ -108,7 +112,8 @@
}),
showNFTInfo (item) {
let query = {
from: this.$route.fullPath
from: this.$route.fullPath,
type: this.type
};
this.$router.push({
path: this.link(`/nftInfo/${item.id}`, query)
Expand Down Expand Up @@ -383,7 +388,7 @@
};
let timer = setTimeout(end, 1000);
});
this.swiper.update();
// this.swiper.update();
},
computed: {
showLoyaltyProgram () {
Expand Down Expand Up @@ -412,14 +417,14 @@
});
return best_price;
}
},
swiper () {
return this.$refs.mySwiper.swiper;
}
// swiper () {
// return this.$refs.mySwiper.swiper;
// }
},
components: {
swiper,
swiperSlide,
// swiper,
// swiperSlide,
AccountImage,
LeftPanel,
AccountQRCode,
Expand All @@ -445,7 +450,7 @@
#page-wallet-index {
.content {
top: 0;
top: 2.2rem;
-webkit-overflow-scrolling: auto;
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/NftInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
</div>
</div>
</div>
<transfer-nft :currentaccount="this.currentWallet.account" :nftinfo="nftinfo" ref="confirm1" @closeModal="onCancel" @onTransferConfirm="onConfirm" :show='showTransfer' ></transfer-nft>
<transfer-nft :currentaccount="this.currentWallet.account" :nftinfo="nftinfo" ref="confirm1" @closeModal="onCancel" @onTransferConfirm="onConfirm" :show='showTransfer'></transfer-nft>
<password-confirm ref="unlock" @unlocking="unlocking"></password-confirm>
<transfer-nft-confirm ref="confirm" :account="this.currentWallet.account" :pwd="password" :to="to" :param="param" :fee="fee" @closeConfirmModal="closeConfirmModal" ></transfer-nft-confirm>
<transfer-nft-confirm ref="confirm" :account="this.currentWallet.account" :pwd="password" :to="to" :param="param" :fee="fee" @closeConfirmModal="closeConfirmModal" :contract="type"></transfer-nft-confirm>
</div>
</template>
<script>
Expand Down Expand Up @@ -82,7 +82,8 @@
toAccount: '',
param: {},
fee: {},
nftinfo: {}
nftinfo: {},
type: process.env.nftContract
};
},
computed: {
Expand All @@ -92,6 +93,7 @@
},
mounted () {
let id = this.$route.params.id;
this.type = this.$route.query.type;
if (this.accountNFT.length === 0) {
this.getNFTInfo();
} else {
Expand All @@ -117,7 +119,7 @@
},
async getNFTInfo () {
let _id = this.$route.params.id;
let _token = await get_contract_table(process.env.nftContract, 'token', _id, _id + 1);
let _token = await get_contract_table(this.type, 'token', _id, _id + 1);
this.nftinfo = _token.rows[0];
},
async onConfirm (account) {
Expand Down Expand Up @@ -152,7 +154,7 @@
let _id = String(this.toAccount.id).split('.')[2];
this.param = {'id': this.nftinfo.id, 'to': _id, 'name': this.nftinfo.name};
call_contract(this.currentWallet.account, process.env.nftContract, 'transfer', this.param, 0, pwd, false).then(res => {
call_contract(this.currentWallet.account, this.type, 'transfer', this.param, 0, pwd, false).then(res => {
let op = res && res.operations && res.operations[0];
this.fee = op[1].fee;
return get_assets_by_ids([this.fee.asset_id || '1.3.1']);
Expand Down
3 changes: 3 additions & 0 deletions src/components/WalletIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@
}
.list-block.nft-list{
margin:0 auto;
.item-inner {
display: flex;
}
}
.table-assets {
position: relative;
Expand Down
6 changes: 5 additions & 1 deletion src/components/sub/TransferNftConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
},
param: {
type: Object
},
contract: {
type: String,
default: process.env.nftContract
}
},
methods: {
Expand All @@ -100,7 +104,7 @@
return;
}
this.submitting = true;
call_contract(this.account, process.env.nftContract, 'transfer', this.param, 0, this.pwd, true).then(res => {
call_contract(this.account, this.contract, 'transfer', this.param, 0, this.pwd, true).then(res => {
console.log(res);
$.closeModal($(this.$el));
this.$emit('closeConfirmModal');
Expand Down
1 change: 1 addition & 0 deletions src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const locale = {
send: 'Send',
please_input_account: 'Please Input Account',
view_info: 'View Detail',
nft_list: 'NFT List',
confirm_send: 'Confirm',
details: 'Detail: ',
total: 'Total: ',
Expand Down
1 change: 1 addition & 0 deletions src/locales/ko-KR.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const locale = {
send: 'Send',
please_input_account: 'Please Input Account',
view_info: 'View Detail',
nft_list: 'NFT List',
confirm_send: 'Confirm',
details: 'Detail: ',
total: 'Total: ',
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const locale = {
send: '发送',
please_input_account: '请输入账号',
view_info: '查看信息',
nft_list: 'NFT列表',
confirm_send: '确认发送',
details: '简介:',
total: '总量:',
Expand Down

0 comments on commit 0a21684

Please sign in to comment.