launch.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="content">
  3. </view>
  4. </template>
  5. <script>
  6. import { getDicts } from '@/api/common'
  7. export default {
  8. data() {
  9. return {
  10. };
  11. },
  12. onShow() {
  13. //this.getDicts()
  14. this.navigatHandler();
  15. },
  16. methods: {
  17. navigatHandler: function() {
  18. if (!this.$isLogin()) {
  19. setTimeout(()=>{
  20. uni.reLaunch({
  21. url: '../auth/loginIndex',
  22. //url: '../index/typulse',
  23. animationType: 'none',
  24. animationDuration: 2000
  25. })
  26. },200);
  27. // #ifdef APP-PLUS
  28. plus.navigator.closeSplashscreen();
  29. // #endif
  30. } else {
  31. if(uni.getStorageSync("openUrl")) {
  32. return
  33. }
  34. uni.reLaunch({
  35. url: '../index/index',
  36. // url: '../course/index',
  37. //url: '../course/video/living-app',
  38. animationType: 'none',
  39. animationDuration: 2000
  40. })
  41. }
  42. },
  43. getDicts:function(){
  44. getDicts().then(
  45. res => {
  46. if(res.code==200){
  47. uni.setStorageSync('dicts',JSON.stringify(res.data));
  48. }
  49. },
  50. rej => {}
  51. );
  52. },
  53. },
  54. };
  55. </script>
  56. <style>
  57. page{
  58. background-color: #fff;
  59. }
  60. .content {
  61. background-color: #fff;
  62. height: 100%;
  63. width: 100%;
  64. position: relative;
  65. padding-top: 0;
  66. }
  67. </style>