ufutx_love_mp/src/components/pageScroll.wpy
2024-08-16 09:14:13 +08:00

64 lines
1.2 KiB
Plaintext

<style lang="less">
.m_returnTop {
position: fixed;
right: 62rpx;
bottom: 200rpx;
z-index: 99;
-webkit-transition: opacity 1s;
transition: opacity 1s;
.u_returnTop_img {
width: 92rpx;
height: 92rpx;
border-radius: 50%;
box-shadow: 0 0 12rpx 6rpx rgba(0, 0, 0, .06);
}
}
@keyframes opacity{
0%{opacity: 0}
100%{
opacity: 1;
}
}
.hide{
opacity:0;
}
.show{
opacity:1;
}
</style>
<template>
<view class="m_returnTop {{ showBackTopBtn ? 'show' : 'hide'}}">
<image class="u_returnTop_img" @tap.stop="BackTop" src="https://images.ufutx.com/202106/23/f0d10551dc5d3399cc7f15805cf04f4f.png" mode="scaleToFill" lazy-load="false"></image>
</view>
</template>
<script>
import wepy from '@wepy/core'
import base from '../mixins/base'
import https from '../mixins/https'
wepy.component({
props: {
bgColor: {
type: String,
default: ''
}
},
data: {
showBackTopBtn: false // 显示置顶
},
mixins: [https, base],
methods: {
BackTop() {
let vm = this
vm.showBackTopBtn = false
wx.pageScrollTo({
scrollTop: 0,
duration: 400
})
}
},
created() {
}
})
</script>