launch.vue 1.1 KB

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