合同小程序前端代码仓库
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.

34 lines
1.1 KiB

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. }
  24. else if (Date.now() - firstBackTime < 2000) {
  25. firstBackTime = Date.now();
  26. uni.exit();
  27. }
  28. },
  29. onExit: function () {
  30. console.log('App Exit', " at App.uvue:32");
  31. },
  32. });
  33. export default __sfc__;
  34. const GenAppStyles = [utsMapOf([["uni-row", padStyleMapOf(utsMapOf([["flexDirection", "row"]]))], ["uni-column", padStyleMapOf(utsMapOf([["flexDirection", "column"]]))]])];
  35. //# sourceMappingURL=App.uvue.map