1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <script>
- const NET = require('@/utils/request')
- const API = require('@/config/api')
- export default {
- onLaunch: function() {
- console.log('App Launch');
- // #ifdef APP-PLUS
- var isIos = (plus.os.name == "iOS")
- var version = plus.runtime.versionCode
- console.log('版本号',version,isIos)
- if (!isIos) {
- NET.request(API.getAppVersion, {}, 'GET').then(res => {
- console.log('获取res')
- try {
- console.log('进入try',res)
- if (version != res.data.version) {
- console.log('判断版本号')
- plus.runtime.openURL( res.data.url)
- }
- } catch (e) {
- console.log('版本号错误', e)
- }
- })
- }
- // #endif
- },
- onShow: function() {
- console.log('App Show');
- },
- onHide: function() {
- console.log('App Hide');
- }
- };
- </script>
- <style lang="scss">
- @import "uview-ui/index.scss";
- @import './iconFont/iconfont.css';
- /* 解决头条小程序组件内引入字体不生效的问题 */
- /* #ifdef MP-TOUTIAO */
- @font-face {
- font-family: uniicons;
- src: url('/iconFont/uni.ttf');
- }
- /* #endif */
- ::-webkit-scrollbar {
- display: none;
- width: 0 !important;
- height: 0 !important;
- -webkit-appearance: none;
- background: transparent;
- }
- page {
- width: 100%;
- height: 100%;
- }
- </style>
|