|
@@ -33,7 +33,7 @@
|
33
|
33
|
<!-- 投票 -->
|
34
|
34
|
<view class="VoteContainer" v-if="IsVote">
|
35
|
35
|
<image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/toupiao.png"></image>
|
36
|
|
- <view class="List" v-if="ShowVoteRes">
|
|
36
|
+ <view class="List" v-if="!ShowVoteRes">
|
37
|
37
|
<view v-for="(item, index) in VoteList" :key="index" class="flex-h" @tap="VoteIndex = index">
|
38
|
38
|
<text class="iconfont iconweigouxuan" v-if="VoteIndex !== index"></text>
|
39
|
39
|
<text class="iconfont icongouxuan" v-else></text>
|
|
@@ -42,12 +42,15 @@
|
42
|
42
|
</view>
|
43
|
43
|
</view>
|
44
|
44
|
</view>
|
45
|
|
- <text @tap="ToPostActivityVote" v-if="ShowVoteRes">提交</text>
|
|
45
|
+ <text @tap="ToPostActivityVote" v-if="!ShowVoteRes">提交</text>
|
46
|
46
|
<button open-type="getPhoneNumber" class="GetPhoneBtn" v-if="!DataLock && ShowGetPhoneBtn && ShowVoteRes" @getphonenumber="GetPhoneNumber">授权手机号</button>
|
47
|
|
- <view class="ResList" v-if="!ShowVoteRes">
|
|
47
|
+ <view class="ResList" v-if="ShowVoteRes">
|
48
|
48
|
<view v-for="(item, index) in VoteResList" :key="index">
|
49
|
|
- <text class="Text">{{item.name}}({{item.num}}/{{item.total}})</text>
|
50
|
|
- <view>
|
|
49
|
+ <view class="Text flex-h">
|
|
50
|
+ <text class="flex-item">{{item.name}}({{item.num}}/{{item.total}})</text>
|
|
51
|
+ <text>{{item.selfVoted ? '我投过的' : ''}}</text>
|
|
52
|
+ </view>
|
|
53
|
+ <view class="Line">
|
51
|
54
|
<view>
|
52
|
55
|
<view :style="{width: `${item.pec}%`}"></view>
|
53
|
56
|
</view>
|
|
@@ -147,7 +150,7 @@ export default {
|
147
|
150
|
if (this.ActivityInfo.isVote) {
|
148
|
151
|
this.VoteList = this.ActivityInfo.voteItemList.slice(0)
|
149
|
152
|
this.CreateVoteResList()
|
150
|
|
- this.ShowVoteRes = !!this.ActivityInfo.isSelfVoted
|
|
153
|
+ this.ShowVoteRes = !!this.ActivityInfo.selfVoted
|
151
|
154
|
}
|
152
|
155
|
this.IsVote = this.ActivityInfo.isVote
|
153
|
156
|
})
|
|
@@ -159,7 +162,7 @@ export default {
|
159
|
162
|
VoteTotal += item.voteNum - 0
|
160
|
163
|
})
|
161
|
164
|
this.VoteList.map((item) => {
|
162
|
|
- this.VoteResList.push({ name: item.name, pec: Math.floor((item.voteNum / VoteTotal) * 100), total: VoteTotal, num: item.voteNum })
|
|
165
|
+ this.VoteResList.push({ name: item.name, pec: Math.floor((item.voteNum / VoteTotal) * 100), total: VoteTotal, num: item.voteNum, selfVoted: this.ActivityInfo.selfVoted === item.itemId })
|
163
|
166
|
})
|
164
|
167
|
},
|
165
|
168
|
ToShare () {
|
|
@@ -187,6 +190,8 @@ export default {
|
187
|
190
|
icon: 'none',
|
188
|
191
|
duration: 2000
|
189
|
192
|
})
|
|
193
|
+ this.ActivityInfo.selfVoted = this.VoteList[this.VoteIndex].itemId
|
|
194
|
+ this.CreateVoteResList()
|
190
|
195
|
this.ShowVoteRes = true
|
191
|
196
|
}).catch(() => {
|
192
|
197
|
this.DataLock = false
|