|
@@ -30,6 +30,9 @@
|
|
</template>
|
|
</template>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
|
|
+ <view @click="handleRight" :class="{disable: swiperDotIndex == 0}">shang</view>
|
|
|
|
+ <view @click="handleLeft" :class="{disable: swiperDotIndex == data.content.length-1}">xia</view>
|
|
|
|
+ <view v-if="showTishi">提示信息</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -37,13 +40,15 @@
|
|
import {
|
|
import {
|
|
reactive,
|
|
reactive,
|
|
watch,
|
|
watch,
|
|
- ref
|
|
|
|
|
|
+ ref,
|
|
|
|
+ computed
|
|
} from 'vue';
|
|
} from 'vue';
|
|
import danxuan from "@/components/questions/danxuan.vue";
|
|
import danxuan from "@/components/questions/danxuan.vue";
|
|
import duoxuan from "@/components/questions/duoxuan.vue";
|
|
import duoxuan from "@/components/questions/duoxuan.vue";
|
|
import tiankong from "@/components/questions/tiankong.vue";
|
|
import tiankong from "@/components/questions/tiankong.vue";
|
|
import panduan from "@/components/questions/panduan.vue";
|
|
import panduan from "@/components/questions/panduan.vue";
|
|
import jianda from "@/components/questions/jianda.vue";
|
|
import jianda from "@/components/questions/jianda.vue";
|
|
|
|
+import cacheManager from '../../utils/cacheManager';
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
question: {
|
|
question: {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -51,6 +56,10 @@
|
|
showError: {
|
|
showError: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
|
|
+ },
|
|
|
|
+ showTishixinxi: {
|
|
|
|
+ type:Boolean,
|
|
|
|
+ default: false,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const data = reactive({
|
|
const data = reactive({
|
|
@@ -59,6 +68,7 @@
|
|
const Emits = defineEmits(['yudu-change'])
|
|
const Emits = defineEmits(['yudu-change'])
|
|
|
|
|
|
const swiperDotIndex = ref(0);
|
|
const swiperDotIndex = ref(0);
|
|
|
|
+ const showTishi = ref(false);
|
|
|
|
|
|
watch(() => props.question, (question) => {
|
|
watch(() => props.question, (question) => {
|
|
const danxuanlist = question.danxuan.forEach(item => item.type = 'danxuan')
|
|
const danxuanlist = question.danxuan.forEach(item => item.type = 'danxuan')
|
|
@@ -80,8 +90,42 @@
|
|
immediate: true
|
|
immediate: true
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ watch(() => {
|
|
|
|
+ if (props.showTishixinxi) {
|
|
|
|
+ if (!cacheManager.get('exam-tishi')) {
|
|
|
|
+ // 首次考试打开提示信息
|
|
|
|
+ showTishi.value = true
|
|
|
|
+ } else {
|
|
|
|
+ showTishi.value = false
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showTishi.value = false
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
|
|
+ immediate: true
|
|
|
|
+ })
|
|
|
|
+
|
|
function onSwitchChange(e) {
|
|
function onSwitchChange(e) {
|
|
console.log('eeee', e.detail,data.content[e.detail.current])
|
|
console.log('eeee', e.detail,data.content[e.detail.current])
|
|
Emits('yudu-change', data.content[e.detail.current])
|
|
Emits('yudu-change', data.content[e.detail.current])
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function handleRight() {
|
|
|
|
+ if (swiperDotIndex.value > 0) {
|
|
|
|
+ swiperDotIndex.value = swiperDotIndex.value--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleLeft() {
|
|
|
|
+
|
|
|
|
+ if (props.showTishixinxi) {
|
|
|
|
+ // 阅读题提示
|
|
|
|
+ cacheManager.set('exam-tishi', 1)
|
|
|
|
+ showTishi.value = false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (swiperDotIndex.value < data.content.length-1) {
|
|
|
|
+ swiperDotIndex.value = swiperDotIndex.value++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|