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.

45 lines
869 B

10 months ago
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. console.log('App Launch')
  5. // window.$messageMap = {
  6. // '500' : this.$t('message.500'),
  7. // '512' : this.$t('message.512'),
  8. // '511' : this.$t('message.511'),
  9. // }
  10. if(!uni.getStorageSync('language')){
  11. this.$i18n.locale = 'en'
  12. //#ifdef H5
  13. this.$router.go(0);
  14. //#endif
  15. //#ifdef APP-PLUS
  16. // uni.navigateTo({
  17. // url: '/pages/home/home' // 要刷新的页面路径
  18. // });
  19. //#endif
  20. uni.setStorage({
  21. key: 'language',
  22. data: 'en'
  23. })
  24. uni.setLocale('en')
  25. }
  26. },
  27. onShow: function() {
  28. console.log('App Show')
  29. },
  30. onHide: function() {
  31. console.log('App Hide')
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. /*每个页面公共css */
  37. @import '@/uni_modules/uview-ui/theme.scss';
  38. body{
  39. background-color: #f3f3f3;
  40. }
  41. </style>