|
@@ -22,24 +22,27 @@
|
|
|
</div>
|
|
|
<!-- 答题页面 -->
|
|
|
<div class="topic" v-if="flag === 'tow'">
|
|
|
- <p class="topicTxt">
|
|
|
- {{ topicInd + 1 }}.{{ topic[topicInd].title }}---{{
|
|
|
- topic[topicInd].correct
|
|
|
- }}
|
|
|
- </p>
|
|
|
- <ul class="topic_con">
|
|
|
- <li v-for="(item, index) in topic[topicInd].answer" :key="index">
|
|
|
- <div class="case" @click="select(index, item.id)">
|
|
|
- <!-- 选中了之后的显示 -->
|
|
|
- <div v-show="caseInd === index"></div>
|
|
|
- </div>
|
|
|
- <span :class="{ active: caseInd === index }">{{
|
|
|
- item.id + "、" + item.txt
|
|
|
- }}</span>
|
|
|
- </li>
|
|
|
- <!-- 下面的按钮 -->
|
|
|
- <div class="topic_btn" @click="btnOk">确 定</div>
|
|
|
- </ul>
|
|
|
+ <div class="conBox">
|
|
|
+ <p class="topicTxt">
|
|
|
+ {{ topicInd + 1 }}.{{ topic[topicInd].title }}---{{
|
|
|
+ topic[topicInd].correct
|
|
|
+ }}
|
|
|
+ </p>
|
|
|
+ <ul class="topic_con">
|
|
|
+ <li v-for="(item, index) in topic[topicInd].answer" :key="index">
|
|
|
+ <div class="case" @click="select(index, item.id)">
|
|
|
+ <!-- 选中了之后的显示 -->
|
|
|
+ <div v-show="caseInd === index"></div>
|
|
|
+ </div>
|
|
|
+ <span :class="{ active: caseInd === index }">{{
|
|
|
+ item.id + "、" + item.txt
|
|
|
+ }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <!-- 下面的按钮 -->
|
|
|
+ <div class="topic_btn" @click="btnOk">确 定</div>
|
|
|
+
|
|
|
<!-- 答错之后的提示 -->
|
|
|
<div class="error" v-if="caseErr">
|
|
|
<p>对不起,您答错了</p>
|
|
@@ -48,6 +51,7 @@
|
|
|
<div class="errBtn" @click="nextTi">下一题</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<!-- 答对通关 -->
|
|
|
<div class="topicDui" v-if="flag === 'three'">
|
|
|
<img class="tini" src="@/assets/img/win.png" alt="" />
|
|
@@ -55,7 +59,7 @@
|
|
|
<p>您的得分:{{ cunot + "0" }}</p>
|
|
|
<p>分享海报,传播洱海的美丽文化!</p>
|
|
|
<img src="../../../assets/images/project/hotspot_bg.jpg" alt="" />
|
|
|
- <div class="btnn">保存海报</div>
|
|
|
+ <div class="btnn" @click="saveImg">保存海报</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 答错失败 -->
|
|
@@ -95,6 +99,10 @@ export default {
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ // 答题成功点击保存海报
|
|
|
+ saveImg() {
|
|
|
+ console.log("答题成功点击保存海报");
|
|
|
+ },
|
|
|
//点击答错里面的下一题
|
|
|
nextTi() {
|
|
|
// 最后一题
|
|
@@ -121,7 +129,6 @@ export default {
|
|
|
},
|
|
|
//点击确定
|
|
|
btnOk() {
|
|
|
- if (this.caseInd === null) return this.$message.warning("未选择答案");
|
|
|
// 最后一题
|
|
|
if (this.topicInd === 9 && this.cunot >= 6) {
|
|
|
this.flag = "three";
|
|
@@ -132,9 +139,14 @@ export default {
|
|
|
});
|
|
|
v.title += "---" + temp;
|
|
|
});
|
|
|
+ return;
|
|
|
} else if (this.topicInd === 9 && this.cunot < 6) {
|
|
|
this.flag = "four";
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+ if (this.caseInd === null) return this.$message.warning("未选择答案");
|
|
|
+
|
|
|
if (this.topic[this.topicInd].correct === this.caseABC) {
|
|
|
// console.log('答对了');
|
|
|
this.caseInd = null;
|
|
@@ -160,6 +172,7 @@ export default {
|
|
|
},
|
|
|
// 封装随机获取10道题目
|
|
|
getTopic() {
|
|
|
+ this.topic = [];
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < 200; i++) {
|
|
|
//一个从0到100的数组
|
|
@@ -173,7 +186,7 @@ export default {
|
|
|
arr.forEach((v) => {
|
|
|
this.topic.push(questions[v]);
|
|
|
});
|
|
|
- console.log(999, this.topic); //控制台会输出10个不同的数
|
|
|
+ // console.log(999, this.topic); //控制台会输出10个不同的数
|
|
|
},
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
@@ -190,6 +203,9 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
+::-webkit-scrollbar-thumb {
|
|
|
+ outline: 2px solid #165491;
|
|
|
+}
|
|
|
.issue {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
@@ -309,18 +325,18 @@ export default {
|
|
|
color: #50ffa2;
|
|
|
}
|
|
|
}
|
|
|
- .topic_btn {
|
|
|
- cursor: pointer;
|
|
|
- margin: 10px auto 0;
|
|
|
- width: 257px;
|
|
|
- height: 75px;
|
|
|
- background: url("../../../assets/img/btn.png");
|
|
|
- background-size: 100% 100%;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- align-items: center;
|
|
|
- font-size: 24px;
|
|
|
- }
|
|
|
+ }
|
|
|
+ .topic_btn {
|
|
|
+ cursor: pointer;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ width: 257px;
|
|
|
+ height: 75px;
|
|
|
+ background: url("../../../assets/img/btn.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 24px;
|
|
|
}
|
|
|
.error {
|
|
|
position: absolute;
|
|
@@ -409,4 +425,134 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+@media only screen and (max-width: 800px) {
|
|
|
+ .issue {
|
|
|
+ .main {
|
|
|
+ top: auto;
|
|
|
+ bottom: 5px;
|
|
|
+ transform: translate(-50%, 0);
|
|
|
+ width: 100%;
|
|
|
+ max-width: 350px;
|
|
|
+ height: calc(100vh - 40px);
|
|
|
+ background: url("../../../assets/imgM/bg.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ padding-top: 70px;
|
|
|
+ .top {
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ .begin {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: block;
|
|
|
+ .begin_left {
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 130px;
|
|
|
+ height: 240px;
|
|
|
+ .renwen {
|
|
|
+ left: -15px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .begin_right {
|
|
|
+ padding-top: 10px;
|
|
|
+ & > p {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .btnn {
|
|
|
+ width: 140px;
|
|
|
+ height: 42px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .topic {
|
|
|
+ padding: 10px;
|
|
|
+ height: calc(100% - 35px);
|
|
|
+ .topicTxt {
|
|
|
+ font-size: 18px;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .topic_con {
|
|
|
+ & > li {
|
|
|
+ height: auto;
|
|
|
+ padding: 10px 0;
|
|
|
+ font-size: 16px;
|
|
|
+ .case {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ margin-right: 15px;
|
|
|
+ min-width: 20px;
|
|
|
+ & > div {
|
|
|
+ width: 10px;
|
|
|
+ height: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .conBox {
|
|
|
+ height: calc(100% - 60px);
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ .topic_btn {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ bottom: 20px;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ width: 140px;
|
|
|
+ height: 42px;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .error {
|
|
|
+ & > p {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ .errBtn {
|
|
|
+ width: 140px;
|
|
|
+ height: 42px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .topicCuo {
|
|
|
+ & > img {
|
|
|
+ width: 200px;
|
|
|
+ height: 200px;
|
|
|
+ }
|
|
|
+ & > div {
|
|
|
+ width: 140px;
|
|
|
+ height: 42px;
|
|
|
+ margin: 50px auto 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .topicDui {
|
|
|
+ padding-top: 60px;
|
|
|
+ .tini {
|
|
|
+ width: 120px;
|
|
|
+ height: 120px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ top: 55px;
|
|
|
+ }
|
|
|
+ & > div {
|
|
|
+ & > p {
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ & > img {
|
|
|
+ width: 80%;
|
|
|
+ height: 280px;
|
|
|
+ margin: 10 auto;
|
|
|
+ }
|
|
|
+ .btnn {
|
|
|
+ width: 140px;
|
|
|
+ height: 42px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|