|
@@ -1,9 +1,10 @@
|
|
|
<template>
|
|
|
<div class="gesture">
|
|
|
<Header :showTool="false" @confirmExit="getLogout"></Header>
|
|
|
- <div class="menu" v-if="projectList.length">
|
|
|
- <swiper :slides-per-view="5" :space-between="0" :loop="true" :observeParents="true" :observer="true"
|
|
|
- :centeredSlides="true" dir="rtl" :modules="[Navigation]" @swiper="onSwiper">
|
|
|
+ <div class="menu" v-if="projectList.length" :key="projectList.length">
|
|
|
+ <swiper :slides-per-view="5" :space-between="0" :loop="true" :observe-parents="true" :observer="true"
|
|
|
+ :centered-slides="true" :initial-slide="2" :dir="projectList.length <= 3 ? 'rtl' : 'ltr'" :modules="[Navigation]"
|
|
|
+ @swiper="onSwiper">
|
|
|
<swiper-slide v-for="(item, index) in projectList" :key="index" @click="getOption(item)">
|
|
|
<div class="li">
|
|
|
<div class="pic"><img :src="'static/images/train/' + item.key + '.png'"></div>
|
|
@@ -87,6 +88,7 @@ const getExam = async () => {
|
|
|
projectList.value = proxy?.$utils.getProject(res.exams).filter((item: any) => {
|
|
|
//只显示能开的
|
|
|
return item.area.length > 0 && examList.includes(item.key);
|
|
|
+ //return item.area.length > 0;
|
|
|
});
|
|
|
// console.log("projectList.value", projectList.value)
|
|
|
});
|
|
@@ -98,6 +100,7 @@ const getExam = async () => {
|
|
|
const onSwiper = ($ev: any) => {
|
|
|
console.log("1111111", $ev)
|
|
|
mySwiper.value = $ev;
|
|
|
+ slidePrev()
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -114,6 +117,18 @@ const slideNext = () => {
|
|
|
mySwiper.value.slideNext();
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 启动切换
|
|
|
+*/
|
|
|
+const slideChange = () => {
|
|
|
+ if (projectList.value.length <= 3) {
|
|
|
+ slidePrev()
|
|
|
+ } else {
|
|
|
+ slideNext();
|
|
|
+ }
|
|
|
+ //slidePrev()
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* 进入项目
|
|
|
*/
|
|
@@ -196,13 +211,15 @@ const getLogout = async () => {
|
|
|
* 提示语
|
|
|
*/
|
|
|
const getTips = () => {
|
|
|
- getClearTimer('nextItem');
|
|
|
+ if(timerManager.value?.nextItem){
|
|
|
+ return false
|
|
|
+ }
|
|
|
let myTime = 7000;
|
|
|
let num = 0;
|
|
|
timerManager.value.nextItem = setInterval(() => {
|
|
|
if (router.currentRoute.value.path == '/gesture') {
|
|
|
if (num % 2 == 0) {
|
|
|
- proxy?.$modal.msgWarning({
|
|
|
+ proxy?.$modal.msgWarning({
|
|
|
message: `手向左滑切换项目`,
|
|
|
duration: 5000
|
|
|
})
|
|
@@ -298,12 +315,7 @@ onBeforeMount(() => {
|
|
|
if (projectList.value.length == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
- // if (projectList.value.length < 5) {
|
|
|
- // slidePrev()
|
|
|
- // } else {
|
|
|
- // slideNext();
|
|
|
- // }
|
|
|
- slidePrev()
|
|
|
+ slideChange();
|
|
|
}
|
|
|
//举左手
|
|
|
if (e?.data?.result == "left_hand") {
|