1 Star 1 Fork 1

UPman24 / uniappX-短视频前端模版

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
App.uvue 861 Bytes
一键复制 编辑 原始数据 按行查看 历史
UPman24 提交于 2023-11-02 21:15 . 初始代码提交
<script lang="uts">
let firstBackTime = 0
export default {
onLaunch: function () {
console.log('App Launch')
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
onLastPageBackPress: function () {
console.log('App LastPageBackPress')
if (firstBackTime == 0) {
uni.showToast({
title: '再按一次退出应用',
position: 'bottom',
})
firstBackTime = Date.now()
setTimeout(() => {
firstBackTime = 0
}, 2000)
} else if (Date.now() - firstBackTime < 2000) {
firstBackTime = Date.now()
uni.exit()
}
},
onExit: function () {
console.log('App Exit')
},
}
</script>
<style>
/*每个页面公共css */
.uni-row {
flex-direction: row;
}
.uni-column {
flex-direction: column;
}
</style>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ZhenYJ/uniappxfandouyin.git
git@gitee.com:ZhenYJ/uniappxfandouyin.git
ZhenYJ
uniappxfandouyin
uniappX-短视频前端模版
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891