三个初始页加点击返回首页操作

This commit is contained in:
jxg 2024-05-17 13:37:11 +08:00
commit 92df11e6f8
7 changed files with 130 additions and 1 deletions

View File

@ -6,6 +6,32 @@ page {
.pageBox {
padding: 40px;
position: relative;
overflow: hidden;
.homeHide{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 340px;
right: -40px;
image{
width: $wh;
height: $wh;
}
}
.homeShow{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 340px;
right: 20px;
image{
width: $wh;
height: $wh;
}
}
.bestFoodBg {
width: 100%;

View File

@ -65,6 +65,12 @@
</swiper-item>
</block>
</swiper>
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
<image src="../../static/images/homeHide.png"></image>
</view>
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
<image src="../../static/images/homeShow.png"></image>
</view>
</view>
</template>
@ -111,6 +117,7 @@
userId: '29',
},
total: 0, //
isHome: false, //
}
},
onLoad() {
@ -187,6 +194,16 @@
this.query.pageNum += 1
this.getPageData()
},
//
backTap(e) {
if (e == 0) {
this.isHome = true
} else {
this.oneIndex = null
this.name = null
this.isHome = false
}
},
}
}
</script>

View File

@ -123,7 +123,7 @@ page {
flex-direction: row;
align-items: center;
justify-content: center;
font-size: 30px;
font-size: 40px;
color: #51CED5;
font-weight: 500;
}

View File

@ -6,6 +6,32 @@ page {
.pageBox {
padding: 40px;
position: relative;
overflow: hidden;
.homeHide{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 300px;
right: -40px;
image{
width: $wh;
height: $wh;
}
}
.homeShow{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 300px;
right: 20px;
image{
width: $wh;
height: $wh;
}
}
.bestFoodBg {
width: 100%;

View File

@ -63,6 +63,12 @@
</view>
</view>
</view>
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
<image src="../../static/images/homeHide.png"></image>
</view>
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
<image src="../../static/images/homeShow.png"></image>
</view>
</view>
</template>
@ -91,6 +97,7 @@
isPage: false,
total: 0, //
isPageShow: false, //
isHome: false, //
}
},
onLoad() {
@ -155,6 +162,16 @@
this.pageNum += 1
this.getPageData()
},
//
backTap(e) {
if (e == 0) {
this.isHome = true
} else {
this.isPage = false
this.selectIndex = null
this.isHome = false
}
},
}
}
</script>

View File

@ -6,6 +6,32 @@ page {
.pageBox {
padding: 40px;
position: relative;
overflow: hidden;
.homeHide{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 300px;
right: -40px;
image{
width: $wh;
height: $wh;
}
}
.homeShow{
$wh:80px;
width: $wh;
height: $wh;
position: absolute;
bottom: 300px;
right: 20px;
image{
width: $wh;
height: $wh;
}
}
.bestFoodBg {
width: 100%;

View File

@ -70,6 +70,12 @@
</swiper-item>
</block>
</swiper>
<view class="homeHide" v-show="!isHome" @tap="backTap(0)">
<image src="../../static/images/homeHide.png"></image>
</view>
<view class="homeShow" v-show="isHome" @tap="backTap(1)">
<image src="../../static/images/homeShow.png"></image>
</view>
</view>
</template>
@ -98,6 +104,7 @@
isPage: false,
total: 0, //
isPageShow: false, //
isHome: false, //
}
},
onLoad() {
@ -171,6 +178,16 @@
this.pageNum += 1
this.getPageData()
},
//
backTap(e) {
if (e == 0) {
this.isHome = true
} else {
this.isPage = false
this.name = null
this.isHome = false
}
},
}
}
</script>