App.vue 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script setup>
  2. import { onLaunch, onShow, onError,onHide } from '@dcloudio/uni-app';
  3. import { ShoproInit } from './sheep';
  4. import { autoSign,cancelAutoSign,resetSignStatusIfNeeded } from './sheep/hooks/useModal';
  5. onShow((options) => {
  6. autoSign()
  7. // #ifdef APP-PLUS
  8. // 获取urlSchemes参数
  9. const args = plus.runtime.arguments;
  10. if (args) {
  11. }
  12. // 获取剪贴板
  13. uni.getClipboardData({
  14. success: (res) => { },
  15. });
  16. // #endif
  17. // #ifdef MP-WEIXIN
  18. // 确认收货回调结果
  19. // console.log(options, 'options');
  20. // #endif
  21. });
  22. onHide(()=>{
  23. // console.log("页面隐藏了,取消自动签到");
  24. cancelAutoSign()
  25. });
  26. onLaunch(() => {
  27. // 隐藏原生导航栏 使用自定义底部导航
  28. uni.hideTabBar();
  29. // 加载Shopro底层依赖
  30. ShoproInit();
  31. // 每天凌晨重置签到状态
  32. resetSignStatusIfNeeded();
  33. });
  34. onError((err) => {
  35. console.log('AppOnError:', err);
  36. });
  37. </script>
  38. <style lang="scss">
  39. @import '@/sheep/scss/index.scss';
  40. </style>