|
@@ -102,10 +102,10 @@
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
- <ContentSharePoster :show="showPoster" :title="article && article.title" :coverImage="article && article.coverImage" :qrCodeBase64="posterQrCode" typeLabel="好文推荐" @close="showPoster = false" />
|
|
|
|
|
|
|
+ <ContentSharePoster :show="showPoster" :title="article && article.title" :coverImage="article && article.coverImage" :qrCodeBase64="posterQrCode" typeLabel="好文推荐" @close="closePoster" />
|
|
|
|
|
|
|
|
<!-- 浠宝答题弹窗 -->
|
|
<!-- 浠宝答题弹窗 -->
|
|
|
- <view class="quiz-mask" v-if="showQuiz" @click="showQuiz = false">
|
|
|
|
|
|
|
+ <view class="quiz-mask" v-if="showQuiz" @click="closeQuiz">
|
|
|
<view class="quiz-dialog" @click.stop>
|
|
<view class="quiz-dialog" @click.stop>
|
|
|
<view class="quiz-mascot">
|
|
<view class="quiz-mascot">
|
|
|
<text class="mascot-icon">{{ mascotIcon }}</text>
|
|
<text class="mascot-icon">{{ mascotIcon }}</text>
|
|
@@ -115,7 +115,7 @@
|
|
|
<view class="quiz-question" v-for="(q, qi) in quizQuestions" :key="qi">
|
|
<view class="quiz-question" v-for="(q, qi) in quizQuestions" :key="qi">
|
|
|
<text class="q-title">问题{{ qi+1 }}: {{ q.question }}</text>
|
|
<text class="q-title">问题{{ qi+1 }}: {{ q.question }}</text>
|
|
|
<view class="q-options">
|
|
<view class="q-options">
|
|
|
- <text v-for="(opt, oi) in q.options" :key="oi" class="q-option" :class="{ selected: quizAnswers[qi] === String.fromCharCode(65 + oi) }" @click="quizAnswers[qi] = String.fromCharCode(65 + oi)">{{ opt }}</text>
|
|
|
|
|
|
|
+ <text v-for="(opt, oi) in q.options" :key="oi" class="q-option" :class="{ selected: quizAnswers[qi] === String.fromCharCode(65 + oi) }" @click="selectQuizAnswer(qi, oi)">{{ opt }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<button class="quiz-submit" @click="submitQuiz">提交答案</button>
|
|
<button class="quiz-submit" @click="submitQuiz">提交答案</button>
|
|
@@ -128,7 +128,7 @@
|
|
|
<text class="result-icon">{{ resultIcon }}</text>
|
|
<text class="result-icon">{{ resultIcon }}</text>
|
|
|
<text class="result-text">答对 {{ quizResult.correctCount }}/{{ quizResult.totalQuestions }} 题</text>
|
|
<text class="result-text">答对 {{ quizResult.correctCount }}/{{ quizResult.totalQuestions }} 题</text>
|
|
|
<text class="result-energy">获得 {{ quizResult.earnedEnergy }} 能量 ⚡</text>
|
|
<text class="result-energy">获得 {{ quizResult.earnedEnergy }} 能量 ⚡</text>
|
|
|
- <button class="result-btn" @click="showResult = false">知道了</button>
|
|
|
|
|
|
|
+ <button class="result-btn" @click="closeResult">知道了</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -336,6 +336,24 @@ export default {
|
|
|
this.showResult = true
|
|
this.showResult = true
|
|
|
}
|
|
}
|
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
|
|
|
+ },
|
|
|
|
|
+ getCommentKey: function(c, i) {
|
|
|
|
|
+ return c.id || i
|
|
|
|
|
+ },
|
|
|
|
|
+ getPendingKey: function(i) {
|
|
|
|
|
+ return 'p' + i
|
|
|
|
|
+ },
|
|
|
|
|
+ closePoster: function() {
|
|
|
|
|
+ this.showPoster = false
|
|
|
|
|
+ },
|
|
|
|
|
+ closeQuiz: function() {
|
|
|
|
|
+ this.showQuiz = false
|
|
|
|
|
+ },
|
|
|
|
|
+ closeResult: function() {
|
|
|
|
|
+ this.showResult = false
|
|
|
|
|
+ },
|
|
|
|
|
+ selectQuizAnswer: function(qi, oi) {
|
|
|
|
|
+ this.quizAnswers[qi] = String.fromCharCode(65 + oi)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|