|
@@ -20,17 +20,18 @@ const toBack = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// 第三屏
|
|
|
-const curPart = ref(0)
|
|
|
|
|
|
const data1 = configZhuPu['杆']
|
|
|
const data2 = configZhuPu['枝']
|
|
|
const data3 = configZhuPu['叶']
|
|
|
|
|
|
const curList = ref([])
|
|
|
+const isStart = ref(true)
|
|
|
+const isBack = ref(false)
|
|
|
|
|
|
const NextPage = (curPart) => {
|
|
|
- curIndex.value = 2
|
|
|
+ // curIndex.value = 2
|
|
|
+ isShowIndex3.value = true
|
|
|
switch (curPart) {
|
|
|
case 1:
|
|
|
curList.value = data1
|
|
@@ -43,6 +44,20 @@ const NextPage = (curPart) => {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+const isChange = ref(false)
|
|
|
+const onSlideRight = () => {
|
|
|
+ curIndex.value = 1
|
|
|
+ isChange.value = true
|
|
|
+ console.log('滑动变化了,通知第二个页面开始倒计时', isChange.value)
|
|
|
+}
|
|
|
+const onSlideLeft = () => {
|
|
|
+ isStart.value = false
|
|
|
+ curIndex.value = 0
|
|
|
+}
|
|
|
+
|
|
|
+const isShowIndex3 = ref(false)
|
|
|
+// :class="{ 'onRight1':curIndex == 0, 'onLeft1':curIndex == 1,'goLeft1': curIndex === 1, 'goRight1': curIndex === 0 }"
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
|
|
@@ -50,26 +65,34 @@ const NextPage = (curPart) => {
|
|
|
<div class="home">
|
|
|
<!-- 第一屏 -->
|
|
|
<Transition name="fade-in-out">
|
|
|
- <BambooBookScene1
|
|
|
- v-if="curIndex === 0"
|
|
|
- @slide="() => {curIndex = 1}"
|
|
|
- @close="toBack"
|
|
|
- />
|
|
|
+ <div class="page1">
|
|
|
+ <BambooBookScene1
|
|
|
+ v-if="curIndex !== 2"
|
|
|
+ :class="{ 'goLeft1':curIndex === 1,'goRight1':curIndex === 0 && !isStart }"
|
|
|
+ @slide-right="onSlideRight"
|
|
|
+ @close="toBack"
|
|
|
+ />
|
|
|
+ <BambooBookScene2
|
|
|
+ v-if="curIndex == 1 || curIndex == 0 && !isStart"
|
|
|
+ :class="{ 'goLeft2':curIndex === 1 ,'goRight2':curIndex === 0 && !isStart && !isBack}"
|
|
|
+ class="onRight2"
|
|
|
+ :ischange="isChange"
|
|
|
+ @slide-left="onSlideLeft"
|
|
|
+ @next="NextPage"
|
|
|
+ @close="onSlideLeft"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</Transition>
|
|
|
<!-- 第二屏 -->
|
|
|
- <Transition name="fade-in-out">
|
|
|
- <BambooBookScene2
|
|
|
- v-if="curIndex === 1"
|
|
|
- @next="NextPage"
|
|
|
- @close="() => {curIndex = 0}"
|
|
|
- />
|
|
|
- </Transition>
|
|
|
+ <!-- <Transition name="fade-in-out">
|
|
|
+
|
|
|
+ </Transition> -->
|
|
|
<!-- 第三屏 -->
|
|
|
<Transition name="fade-in-out">
|
|
|
<BambooBookScene3
|
|
|
- v-if="curIndex === 2"
|
|
|
+ v-if="isShowIndex3"
|
|
|
:list="curList"
|
|
|
- @close="() => {curIndex = 1}"
|
|
|
+ @close="() => { isShowIndex3 = false }"
|
|
|
/>
|
|
|
</Transition>
|
|
|
</div>
|
|
@@ -79,5 +102,85 @@ const NextPage = (curPart) => {
|
|
|
.home {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ // .onRight1{
|
|
|
+
|
|
|
+ // }
|
|
|
+ .page1 {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .onLeft1{
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+ .onLeft2{
|
|
|
+ transform: translateX(0%);
|
|
|
+ }
|
|
|
+
|
|
|
+ .onRight1{
|
|
|
+ transform: translateX(0%);
|
|
|
+ }
|
|
|
+
|
|
|
+ .onRight2 {
|
|
|
+ transform: translateX(100%)
|
|
|
+ }
|
|
|
+
|
|
|
+ .goLeft1 {
|
|
|
+ animation: on-left1 2s forwards;
|
|
|
+
|
|
|
+ @keyframes on-left1 {
|
|
|
+ 0% {
|
|
|
+ transform: translateX(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .goLeft2 {
|
|
|
+ animation: on-left2 2s forwards;
|
|
|
+
|
|
|
+ @keyframes on-left2 {
|
|
|
+ 0% {
|
|
|
+ transform: translateX(100%);
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ transform: translateX(0%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .goRight1 {
|
|
|
+ animation: on-right1 2s forwards;
|
|
|
+
|
|
|
+ @keyframes on-right1 {
|
|
|
+ 0% {
|
|
|
+ transform: translateX(-100%);
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ transform: translateX(0%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .goRight2 {
|
|
|
+ animation: on-right2 2s forwards;
|
|
|
+
|
|
|
+ @keyframes on-right2 {
|
|
|
+ 0% {
|
|
|
+ transform: translateX(0%);
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ transform: translateX(100%);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
</style>
|