| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <script>
- export default {
- onLaunch: function() {
- console.log('App Launch');
- // #ifdef APP-NVUE
- plus.screen.lockOrientation('portrait-primary');
- let appid = plus.runtime.appid;
- if (appid && appid.toLocaleLowerCase() != "hbuilder") {
- uni.request({
- url: 'https://uniapp.dcloud.io/update', //检查更新的服务器地址
- data: {
- appid: plus.runtime.appid,
- version: plus.runtime.version
- },
- success: (res) => {
- console.log('success', res);
- if (res.statusCode == 200 && res.data.isUpdate) {
- let openUrl = plus.os.name === 'iOS' ? res.data.iOS : res.data.Android;
- // 提醒用户更新
- uni.showModal({
- title: '更新提示',
- content: res.data.note ? res.data.note : '是否选择更新',
- success: (showResult) => {
- if (showResult.confirm) {
- plus.runtime.openURL(openUrl);
- }
- }
- })
- }
- }
- })
- }
- var domModule = weex.requireModule('dom');
- domModule.addRule('fontFace', {
- 'fontFamily': "texticons",
- 'src': "url('./static/text-icon.ttf')"
- });
- // #endif
- },
- onShow: function() {
- console.log('App Show')
- },
- onHide: function() {
- console.log('App Hide')
- }
- }
- </script>
- <style lang="less">
- /*每个页面公共css */
- .u-tabbar--fixed {
- padding: 19rpx 0;
- }
- .u-tabbar__content__item-wrapper {
- height: auto !important;
- // padding: 10rpx 0;
- }
- .u-tabbar-item__text {
- font-size: 32rpx;
- padding: 12rpx 0;
- }
- </style>
|