合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
971 B

3 months ago
  1. let firstBackTime = 0
  2. const __sfc__ = defineApp({
  3. onLaunch: function () {
  4. console.log('App Launch', " at App.uvue:5")
  5. },
  6. onShow: function () {
  7. console.log('App Show', " at App.uvue:8")
  8. },
  9. onHide: function () {
  10. console.log('App Hide', " at App.uvue:11")
  11. },
  12. onLastPageBackPress: function () {
  13. console.log('App LastPageBackPress', " at App.uvue:15")
  14. if (firstBackTime == 0) {
  15. uni.showToast({
  16. title: '再按一次退出应用',
  17. position: 'bottom',
  18. })
  19. firstBackTime = Date.now()
  20. setTimeout(() => {
  21. firstBackTime = 0
  22. }, 2000)
  23. } else if (Date.now() - firstBackTime < 2000) {
  24. firstBackTime = Date.now()
  25. uni.exit()
  26. }
  27. },
  28. onExit: function () {
  29. console.log('App Exit', " at App.uvue:32")
  30. },
  31. })
  32. export default __sfc__
  33. const GenAppStyles = [utsMapOf([["uni-row", padStyleMapOf(utsMapOf([["flexDirection", "row"]]))], ["uni-column", padStyleMapOf(utsMapOf([["flexDirection", "column"]]))]])]