|
@@ -5,59 +5,173 @@
|
|
|
</view>
|
|
|
<view class="choose">
|
|
|
<view
|
|
|
+ v-if="type == 'wrong'"
|
|
|
class="choose-img"
|
|
|
- style="
|
|
|
- background-image: url('https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg1.png');
|
|
|
- "
|
|
|
- @tap.stop="goExercise('wrong')"
|
|
|
+ style="overflow: hidden; border-radius: 40rpx"
|
|
|
>
|
|
|
- <span class="choose-text1"> 做错题 </span>
|
|
|
- <view class="choose-text2"> 共 {{ wrongListCount }} 题 </view>
|
|
|
-
|
|
|
- <image mode="widthFix" class="goArrow" :src="goArrow" />
|
|
|
+ <image
|
|
|
+ style="width: 100%"
|
|
|
+ mode="widthFix"
|
|
|
+ src="https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg3.png"
|
|
|
+ ></image>
|
|
|
+ <view class="choose-text1"> 做错题 </view>
|
|
|
<view
|
|
|
- :hover-stop-propagation="true"
|
|
|
- data-type="wrong"
|
|
|
- @tap.stop="clearTopics('wrong')"
|
|
|
- style="color: #498ef5"
|
|
|
- class="clear"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ type = 'collect';
|
|
|
+ }
|
|
|
+ "
|
|
|
+ class="choose-text1"
|
|
|
+ style="right: 0; color: #8a9099; background: #f2f3f5"
|
|
|
>
|
|
|
- 清空错题
|
|
|
+ 收藏题
|
|
|
+ </view>
|
|
|
+ <view class="choose-text2" style="display: flex">
|
|
|
+ <view class=""> 共 {{ wrongListCount }} 题 </view>
|
|
|
+ <image
|
|
|
+ @tap.stop="goExercise('wrong')"
|
|
|
+ mode="widthFix"
|
|
|
+ class="goArrow"
|
|
|
+ :src="goArrow"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <view class="choose-tool">
|
|
|
+ <view
|
|
|
+ :hover-stop-propagation="true"
|
|
|
+ data-type="wrong"
|
|
|
+ @tap.stop="clearTopics('wrong')"
|
|
|
+ style="color: #498ef5"
|
|
|
+ class="clear"
|
|
|
+ >
|
|
|
+ 清空错题
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ :hover-stop-propagation="true"
|
|
|
+ data-type="wrong"
|
|
|
+ @tap.stop="
|
|
|
+ () => {
|
|
|
+ wrongSyncShow = true;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="color: #498ef5"
|
|
|
+ class="sync"
|
|
|
+ >
|
|
|
+ 同步错题
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|
|
|
+ v-if="type == 'collect'"
|
|
|
class="choose-img"
|
|
|
- style="
|
|
|
- background-image: url('https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBg1.png');
|
|
|
- "
|
|
|
- @tap.stop="goExercise('collect')"
|
|
|
+ style="overflow: hidden; border-radius: 40rpx"
|
|
|
>
|
|
|
- <span class="choose-text1">收藏题</span>
|
|
|
- <span class="choose-text2"> 共 {{ collectionListCount }} 题 </span>
|
|
|
-
|
|
|
- <image mode="widthFix" class="goArrow" :src="goArrow" />
|
|
|
- <view
|
|
|
- :hover-stop-propagation="true"
|
|
|
- data-type="collect"
|
|
|
- @tap.stop="clearTopics('collect')"
|
|
|
- style="color: #01c18d"
|
|
|
- class="clear"
|
|
|
- >
|
|
|
- 清空收藏
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view style="padding-bottom: 20rpx">
|
|
|
- <view @click="syncWrongQuestion" class="sync">
|
|
|
<image
|
|
|
- style="width: 36rpx;margin-right:15rpx"
|
|
|
+ style="width: 100%"
|
|
|
mode="widthFix"
|
|
|
- src="https://ct.zzxcx.net/ctjk/mp-wx/collection/syncIcon.png"
|
|
|
+ src="https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBg3.png"
|
|
|
></image>
|
|
|
- <text>同步收藏错题</text>
|
|
|
+ <view
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ type = 'wrong';
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="color: #8a9099; background: #f2f3f5"
|
|
|
+ class="choose-text1"
|
|
|
+ >
|
|
|
+ 做错题
|
|
|
+ </view>
|
|
|
+ <view style="right: 0" class="choose-text1"> 收藏题 </view>
|
|
|
+
|
|
|
+ <view class="choose-text2" style="display: flex">
|
|
|
+ <view class=""> 共 {{ collectionListCount }} 题 </view>
|
|
|
+ <image
|
|
|
+ @tap.stop="goExercise('collect')"
|
|
|
+ mode="widthFix"
|
|
|
+ class="goArrow"
|
|
|
+ :src="goArrow"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
+ <view class="choose-tool">
|
|
|
+ <view
|
|
|
+ :hover-stop-propagation="true"
|
|
|
+ data-type="collect"
|
|
|
+ @tap.stop="clearTopics('collect')"
|
|
|
+ style="color: #498ef5"
|
|
|
+ class="clear"
|
|
|
+ >
|
|
|
+ 清空收藏
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ :hover-stop-propagation="true"
|
|
|
+ data-type="collect"
|
|
|
+ @tap.stop="
|
|
|
+ () => {
|
|
|
+ collectSyncShow = true;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="color: #498ef5"
|
|
|
+ class="sync"
|
|
|
+ >
|
|
|
+ 同步收藏
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="wxad">
|
|
|
+
|
|
|
+ <van-popup
|
|
|
+ @close="
|
|
|
+ () => {
|
|
|
+ wrongSyncShow = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ zIndex="1000"
|
|
|
+ position="bottom"
|
|
|
+ :show="wrongSyncShow"
|
|
|
+ >
|
|
|
+ <van-picker
|
|
|
+ @cancel="
|
|
|
+ () => {
|
|
|
+ wrongSyncShow = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ @confirm="syncWrongQuestion"
|
|
|
+ :columns="[
|
|
|
+ { text: '合并本机和云端收藏', type: 'wrong', value: 0 },
|
|
|
+ { text: '备份本机收藏到云端', type: 'wrong', value: 1 },
|
|
|
+ { text: '恢复云端收藏到本机', type: 'wrong', value: 2 },
|
|
|
+ ]"
|
|
|
+ show-toolbar
|
|
|
+ title="同步错题"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-popup
|
|
|
+ @close="
|
|
|
+ () => {
|
|
|
+ collectSyncShow = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ zIndex="1000"
|
|
|
+ position="bottom"
|
|
|
+ :show="collectSyncShow"
|
|
|
+ >
|
|
|
+ <van-picker
|
|
|
+ @cancel="
|
|
|
+ () => {
|
|
|
+ collectSyncShow = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ @confirm="syncCollectQuestion"
|
|
|
+ :columns="[
|
|
|
+ { text: '合并本机和云端收藏', type: 'collect', value: 0 },
|
|
|
+ { text: '备份本机收藏到云端', type: 'collect', value: 1 },
|
|
|
+ { text: '恢复云端收藏到本机', type: 'collect', value: 2 },
|
|
|
+ ]"
|
|
|
+ show-toolbar
|
|
|
+ title="同步收藏"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <view v-show="!wrongSyncShow && !collectSyncShow" class="wxad">
|
|
|
<ad
|
|
|
:ad-intervals="100"
|
|
|
ad-type="video"
|
|
@@ -80,12 +194,12 @@ import utils from "@/utils/index";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- wrongBg: "https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg.png",
|
|
|
- collectionBottomBg:
|
|
|
- "https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBottomBg.png",
|
|
|
+ chooseBg: "https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg3.png",
|
|
|
+ type: "wrong",
|
|
|
+ wrongBg: "https://ct.zzxcx.net/ctjk/mp-wx/collection/wrongBg3.png",
|
|
|
goArrow: "https://ct.zzxcx.net/ctjk/mp-wx/collection/right_arrow.png",
|
|
|
collectionBg:
|
|
|
- "https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBg.png",
|
|
|
+ "https://ct.zzxcx.net/ctjk/mp-wx/collection/collectionBg3.png",
|
|
|
collectionHeader: "https://ct.zzxcx.net/ctjk/mp-wx/carVideo/banner.png",
|
|
|
query: {
|
|
|
questionIds: "",
|
|
@@ -96,16 +210,23 @@ export default {
|
|
|
mtc: "摩托车",
|
|
|
kc: "客车",
|
|
|
},
|
|
|
+ wrongSyncShow: false,
|
|
|
+ collectSyncShow: false,
|
|
|
wrongList: [],
|
|
|
- wrongListCount: 1,
|
|
|
+ wrongListCount: uni.getStorageSync("userWrongIds")
|
|
|
+ ? uni.getStorageSync("userWrongIds").length
|
|
|
+ : 0,
|
|
|
+
|
|
|
collectionList: [],
|
|
|
- collectionListCount: 1,
|
|
|
+ collectionListCount: uni.getStorageSync("userCollectionIds")
|
|
|
+ ? uni.getStorageSync("userCollectionIds").length
|
|
|
+ : 0,
|
|
|
};
|
|
|
},
|
|
|
onLoad(query) {
|
|
|
this.query = query;
|
|
|
- let userWrongIds = uni.getStorageSync("userWrongIds") || [];
|
|
|
- this.wrongListCount = userWrongIds.length;
|
|
|
+ this.user;
|
|
|
+
|
|
|
// api.exam
|
|
|
// .studentQuestionWrongWrongCountByUser({
|
|
|
// carType: this.gsMap[query.gs],
|
|
@@ -116,23 +237,114 @@ export default {
|
|
|
// .then((res) => {
|
|
|
// this.wrongListCount = res.data;
|
|
|
// });
|
|
|
- api.exam
|
|
|
- .studentQuestionCollectionCollectionCountByUser({
|
|
|
- carType: this.gsMap[query.gs],
|
|
|
- km: query.subject === "1" ? "科目一" : "科目四",
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10000,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.collectionListCount = res.data;
|
|
|
- });
|
|
|
},
|
|
|
methods: {
|
|
|
- syncWrongQuestion(){
|
|
|
- api.exam.studentQuestionWrongWrongByUser().then(res=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
-
|
|
|
+ syncCollectQuestion(e) {
|
|
|
+ let select = e.detail.value;
|
|
|
+ switch (select.value) {
|
|
|
+ case 0:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionCollectionBakCollections({
|
|
|
+ km: Number(this.query.subject),
|
|
|
+ questionIds: uni
|
|
|
+ .getStorageSync("userCollectionIds")
|
|
|
+ .map((item) => item),
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ api.exam.studentQuestionCollectionCollectionByUser().then((result) => {
|
|
|
+ let userCollectionIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userCollectionIds", userCollectionIds);
|
|
|
+ this.collectionListCount = userCollectionIds.length;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionWrongBakWrongs({
|
|
|
+ km: Number(this.query.subject),
|
|
|
+ questionIds: uni
|
|
|
+ .getStorageSync("userCollectionIds")
|
|
|
+ .map((item) => item),
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ api.exam.studentQuestionWrongWrongByUser().then((result) => {
|
|
|
+ let userCollectionIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userCollectionIds", userCollectionIds);
|
|
|
+ this.collectionListCount = userCollectionIds.length;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ api.exam.studentQuestionWrongWrongByUser().then((result) => {
|
|
|
+ let userCollectionIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userCollectionIds", userCollectionIds);
|
|
|
+ this.collectionListCount = userCollectionIds.length;
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.collectSyncShow = false;
|
|
|
+ },
|
|
|
+ syncWrongQuestion(e) {
|
|
|
+ let select = e.detail.value;
|
|
|
+ console.log(e);
|
|
|
+ switch (select.value) {
|
|
|
+ case 0:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionWrongWrongs({
|
|
|
+ km: Number(this.query.subject),
|
|
|
+ questionIds: uni
|
|
|
+ .getStorageSync("userWrongIds")
|
|
|
+ .map((item) => item),
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ api.exam.studentQuestionWrongWrongByUser().then((result) => {
|
|
|
+ let userWrongIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userWrongIds", userWrongIds);
|
|
|
+ this.wrongListCount = userWrongIds.length;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionWrongBakWrongs({
|
|
|
+ km: Number(this.query.subject),
|
|
|
+ questionIds: uni
|
|
|
+ .getStorageSync("userWrongIds")
|
|
|
+ .map((item) => item),
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ api.exam.studentQuestionWrongWrongByUser().then((result) => {
|
|
|
+ let userWrongIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userWrongIds", userWrongIds);
|
|
|
+ this.wrongListCount = userWrongIds.length;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ api.exam.studentQuestionWrongWrongByUser().then((result) => {
|
|
|
+ let userWrongIds = result.data.map((item) => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ uni.setStorageSync("userWrongIds", userWrongIds);
|
|
|
+ this.wrongListCount = userWrongIds.length;
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ this.wrongSyncShow = false;
|
|
|
},
|
|
|
goExercise(type) {
|
|
|
let query = Object.assign({}, this.query);
|
|
@@ -176,6 +388,7 @@ export default {
|
|
|
km: that.query.subject === "1" ? "科目一" : "科目四",
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ uni.setStorageSync("userWrongIds", []);
|
|
|
api.exam
|
|
|
.studentQuestionWrongWrongCountByUser({
|
|
|
carType: that.gsMap[that.query.gs],
|
|
@@ -201,6 +414,7 @@ export default {
|
|
|
km: that.query.subject === "1" ? "科目一" : "科目四",
|
|
|
})
|
|
|
.then((res) => {
|
|
|
+ uni.setStorageSync("userCollectionIds", []);
|
|
|
api.exam
|
|
|
.studentQuestionCollectionCollectionCountByUser({
|
|
|
carType: that.gsMap[that.query.gs],
|
|
@@ -247,53 +461,83 @@ export default {
|
|
|
align-content: space-between;
|
|
|
align-items: space-between;
|
|
|
flex-wrap: wrap;
|
|
|
- margin-top: 70rpx;
|
|
|
-
|
|
|
+ margin-top: 40rpx;
|
|
|
+ .choose-bg {
|
|
|
+ position: absolute;
|
|
|
+ top: 142rpx;
|
|
|
+ left: 424rpx;
|
|
|
+ width: 212rpx;
|
|
|
+ }
|
|
|
.choose-img {
|
|
|
- width: 334rpx;
|
|
|
+ width: 690rpx;
|
|
|
position: relative;
|
|
|
margin-bottom: 25rpx;
|
|
|
height: 548rpx;
|
|
|
- background-size: 100%;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-attachment: fixed;
|
|
|
.bg {
|
|
|
width: 690rpx;
|
|
|
}
|
|
|
- .clear {
|
|
|
- background: #fff;
|
|
|
- border-radius: 30rpx;
|
|
|
- position: absolute;
|
|
|
- bottom: 40rpx;
|
|
|
- width: 200rpx;
|
|
|
- height: 60rpx;
|
|
|
- left: 40rpx;
|
|
|
- bottom: 40rpx;
|
|
|
- border: 0;
|
|
|
- font-size: 26rpx;
|
|
|
- line-height: 60rpx;
|
|
|
- text-align: center;
|
|
|
+ .choose-tool {
|
|
|
+ .clear {
|
|
|
+ background: #ccedff;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 40rpx;
|
|
|
+ width: 200rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ left: 54rpx;
|
|
|
+ bottom: 40rpx;
|
|
|
+ border: 0;
|
|
|
+ font-size: 26rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ text-align: center;
|
|
|
+ color: #0067a7;
|
|
|
+ }
|
|
|
+ .sync {
|
|
|
+ background: #ccedff;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 40rpx;
|
|
|
+ width: 200rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ left: 422rpx;
|
|
|
+ bottom: 40rpx;
|
|
|
+ border: 0;
|
|
|
+ font-size: 26rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ text-align: center;
|
|
|
+ color: #0067a7;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.goArrow {
|
|
|
- position: absolute;
|
|
|
- top: 44rpx;
|
|
|
- right: 40rpx;
|
|
|
+ margin-left: 40rpx;
|
|
|
width: 56rpx;
|
|
|
height: 56rpx;
|
|
|
}
|
|
|
.choose-text1 {
|
|
|
position: absolute;
|
|
|
- font-size: 50rpx;
|
|
|
+ top: 0;
|
|
|
+ font-size: 34rpx;
|
|
|
+ line-height: 90rpx;
|
|
|
+ height: 90rpx;
|
|
|
color: #fff;
|
|
|
- left: 40rpx;
|
|
|
- top: 40rpx;
|
|
|
+
|
|
|
+ top: 0rpx;
|
|
|
color: #004e81;
|
|
|
+ width: 50%;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
.choose-text2 {
|
|
|
position: absolute;
|
|
|
- top: 112rpx;
|
|
|
- left: 44rpx;
|
|
|
+ top: 212rpx;
|
|
|
+ left: 46rpx;
|
|
|
color: #1477b4;
|
|
|
width: 100%;
|
|
|
font-size: 38rpx;
|
|
|
+ display: flex;
|
|
|
}
|
|
|
img {
|
|
|
width: 100%;
|
|
@@ -308,5 +552,6 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
padding: 0 30rpx;
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
</style>
|