launch.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. animationType: 'none',
  23. animationDuration: 2000
  24. })
  25. },200);
  26. // #ifdef APP-PLUS
  27. plus.navigator.closeSplashscreen();
  28. // #endif
  29. } else {
  30. if(uni.getStorageSync("openUrl")) {
  31. return
  32. }
  33. uni.reLaunch({
  34. url: '/pages_im/pages/conversation/conversationList/index',
  35. //url: '../course/video/living-app',
  36. animationType: 'none',
  37. animationDuration: 2000
  38. })
  39. }
  40. },
  41. getDicts:function(){
  42. getDicts().then(
  43. res => {
  44. if(res.code==200){
  45. uni.setStorageSync('dicts',JSON.stringify(res.data));
  46. }
  47. },
  48. rej => {}
  49. );
  50. },
  51. },
  52. };
  53. </script>
  54. <style>
  55. page{
  56. background-color: #fff;
  57. }
  58. .content {
  59. background-color: #fff;
  60. height: 100%;
  61. width: 100%;
  62. position: relative;
  63. padding-top: 0;
  64. }
  65. </style>