| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <script>
- export default {
- globalData: {
- $t: ''
- },
- onLaunch: function() {
- let _this = this
- console.log('App Launch');
- this.globalData.$t = (val, arr = {}) => {
- return this.$t(val, arr);
- };
- // #ifdef APP-PLUS || APP-NVUE
- plus.screen.lockOrientation('portrait-primary');
- let appid = plus.runtime.appid;
- if (appid && appid.toLocaleLowerCase() != "hbuilder") {
- uni.request({
- url: baseUrl + '/api/v1/app/versionCheck', //检查更新的服务器地址
- 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: _this.$t('更新提示'),
- content: this.$t(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>
- /*每个页面公共css */
- .u-tabbar--fixed {
- padding: 19rpx 0;
- }
- .uni-swiper-slide-frame {
- width: 100% !important;
- flex: 1;
- }
- .u-tabbar-item__text {
- font-size: 32rpx;
- padding: 12rpx 0;
- }
- .u-tabbar__content {
- background: #303030 !important;
- }
- .u-popup__content {
- width: 100%;
- height: 100%;
- }
- .popup-box {
- width: 100%;
- }
- .popup-main {
- width: 100%;
- }
- .u-action-sheet__header {
- border-bottom: 2rpx solid #e4e4e4;
- }
- .u-action-sheet__header__title {
- color: #999;
- }
- .u-tabbar__content {
- background: #303030 !important;
- }
- .u-action-sheet__header__title {
- color: #999 !important;
- font-weight: normal !important;
- }
- .u-textarea__field {
- line-height: 56rpx;
- }
- </style>
|