App.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script>
  2. const NET = require('@/utils/request')
  3. const API = require('@/config/api')
  4. export default {
  5. onLaunch: function() {
  6. console.log('App Launch');
  7. // #ifdef APP-PLUS
  8. var isIos = (plus.os.name == "iOS")
  9. var version = plus.runtime.versionCode
  10. console.log('版本号',version,isIos)
  11. if (!isIos) {
  12. NET.request(API.getAppVersion, {}, 'GET').then(res => {
  13. console.log('获取res')
  14. try {
  15. console.log('进入try',res)
  16. if (version != res.data.version) {
  17. console.log('判断版本号')
  18. plus.runtime.openURL( res.data.url)
  19. }
  20. } catch (e) {
  21. console.log('版本号错误', e)
  22. }
  23. })
  24. }
  25. // #endif
  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. @import "uview-ui/index.scss";
  37. @import './iconFont/iconfont.css';
  38. /* 解决头条小程序组件内引入字体不生效的问题 */
  39. /* #ifdef MP-TOUTIAO */
  40. @font-face {
  41. font-family: uniicons;
  42. src: url('/iconFont/uni.ttf');
  43. }
  44. /* #endif */
  45. ::-webkit-scrollbar {
  46. display: none;
  47. width: 0 !important;
  48. height: 0 !important;
  49. -webkit-appearance: none;
  50. background: transparent;
  51. }
  52. page {
  53. width: 100%;
  54. height: 100%;
  55. }
  56. </style>