xcx 4 gadus atpakaļ
vecāks
revīzija
7afcb34acd

+ 12
- 7
src/pages/HuiShengHuo/ActivityList/ActivityDetail/index.vue Parādīt failu

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

+ 11
- 6
src/pages/HuiShengHuo/ActivityList/ActivityDetail/page.scss Parādīt failu

128
             padding: 22px 0;
128
             padding: 22px 0;
129
             border-bottom: 2px solid #f5f5f5;
129
             border-bottom: 2px solid #f5f5f5;
130
             margin-bottom: 20px;
130
             margin-bottom: 20px;
131
-            > text {
132
-              display: block;
133
-              font-size: 28px;
134
-              color: #666;
135
-              line-height: 40px;
131
+            > view.flex-h {
132
+              align-items: center;
133
+              > text {
134
+                font-size: 28px;
135
+                color: #666;
136
+                line-height: 40px;
137
+                &:last-child {
138
+                  margin-right: 20px;
139
+                }
140
+              }
136
             }
141
             }
137
-            > view {
142
+            > view.Line {
138
               padding-right: 20px;
143
               padding-right: 20px;
139
               > view {
144
               > view {
140
                 margin-top: 20px;
145
                 margin-top: 20px;