diff --git a/src/apps/AppVillageDiscuss/Detail.vue b/src/apps/AppVillageDiscuss/Detail.vue index bbe2cdc7..067f33a5 100644 --- a/src/apps/AppVillageDiscuss/Detail.vue +++ b/src/apps/AppVillageDiscuss/Detail.vue @@ -42,10 +42,24 @@
- + + {{ data.voteType === '1' ? '投票清单(可多选)' : '投票清单' }} + + + + 已截止 + + +
+
+ {{ item.content }} + {{ item.count }} + +
+
-
+
我来说两句...
@@ -124,6 +138,19 @@ export default { if (discussTime >= nowTime) { this.timestamp = discussTime - nowTime } + + if (res.data.voteType === '1') { + const total = Object.values(res.data.statistic).reduce((x, y) => { + return x + y + }) + this.data.voteList = res.data.voteItems.map(v => { + return { + ...v, + count: res.data.statistic[v.item], + percentage: (res.data.statistic[v.item] / total) * 100 + '%' + } + }) + } } }) }, @@ -320,6 +347,46 @@ export default { padding: 0 32px 20px; font-size: 28px; background: #fff; + + .vote-item { + display: flex; + position: relative; + align-items: center; + justify-content: space-between; + height: 64px; + line-height: 64px; + margin-bottom: 16px; + padding: 0 32px; + background: #FFFFFF; + border-radius: 8px; + overflow: hidden; + border: 1px solid #95CBFF; + + em { + position: absolute; + left: 0; + top: 0; + z-index: 0; + height: 100%; + background: #DCE8F4; + } + + span { + position: relative; + z-index: 1; + color: #5B84B3; + font-size: 28px; + } + + i { + position: relative; + z-index: 1; + font-style: normal; + color: #5B84B3; + font-size: 28px; + } + } + .totalCount { display: flex; justify-content: space-between;