From 7ec132a2f96c069d260b0186302af29ae099557d Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 3 May 2022 21:24:37 +0800 Subject: [PATCH] show details on my votes --- src/views/WalletVotes.vue | 102 +++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/src/views/WalletVotes.vue b/src/views/WalletVotes.vue index 248c0e84..a0c310d5 100644 --- a/src/views/WalletVotes.vue +++ b/src/views/WalletVotes.vue @@ -13,62 +13,67 @@ md="12" > - + - {{ p.chain.chain_name }} #{{ p.id }}. - + {{ p.title }} - - -
-
-

- Type -

-
- {{ formatType(p.contents['@type']) }} -
-
-
-

- Start Date -

-
- {{ formatDate(p.voting_start_time) }} -
-
-
-

- End Date -

-
- {{ formatDate(p.voting_end_time) }} -
-
-
-

- Deposit -

-
- {{ formatToken(p.total_deposit) || '-' }} -
-
+ + +
+ +
+
+
+

+ Type +

+
+ {{ formatType(p.contents['@type']) }} +
- +
+

+ Start Date +

+
+ {{ formatDate(p.voting_start_time) }} +
+
+
+

+ End Date +

+
+ {{ formatDate(p.voting_end_time) }} +
+
+
+

+ Deposit +

+
+ {{ formatToken(p.total_deposit) || '-' }} +
+
+
import { VBTooltip, BTabs, BTab, BRow, BCol, BCard, BCardFooter, BBadge, - BCardTitle, BCardBody, BProgress, BProgressBar, BTooltip, BAvatar, + BCardTitle, BProgress, BProgressBar, BTooltip, BAvatar, } from 'bootstrap-vue' import Ripple from 'vue-ripple-directive' import { @@ -153,6 +158,7 @@ import { } from '@/libs/utils' import dayjs from 'dayjs' import WalletUpgradeEvents from './WalletUpgradeEvents.vue' +import ObjectFieldComponent from './ObjectFieldComponent.vue' export default { components: { @@ -164,12 +170,12 @@ export default { BCard, BCardFooter, BCardTitle, - BCardBody, BBadge, BProgress, BProgressBar, BTooltip, WalletUpgradeEvents, + ObjectFieldComponent, }, directives: { 'b-tooltip': VBTooltip, @@ -179,6 +185,7 @@ export default { return { islive: true, proposals: [], + descId: null, tally: {}, // voters: [], // need to be query. votes: [], // votes of voters @@ -201,6 +208,9 @@ export default { this.islive = false }, methods: { + description(v) { + this.descId = v === this.descId ? null : v + }, color(v) { switch (v) { case 'VOTE_OPTION_YES':