| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <script>
- export default {
- onLaunch: function() {
- // console.log('App Launch')
- this.checkUpdate()
- },
- onShow: function() {
- // console.log('App Show')
- },
- onHide: function() {
- // console.log('App Hide')
- },
- methods: {
- checkUpdate() {
- const updateManager = uni.getUpdateManager();
- updateManager.onCheckForUpdate(function(res) {
- // 请求完新版本信息的回调
- console.log('是否有新版本:', res.hasUpdate);
- });
-
- updateManager.onUpdateReady(function() {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,是否重启小程序?',
- confirmText: '立即重启',
- confirmColor: '#2179f5',
- showCancel: false,
- success(res) {
- if (res.confirm) {
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
- updateManager.applyUpdate();
- }
- }
- });
- });
-
- updateManager.onUpdateFailed(function() {
- // 新的版本下载失败
- uni.showModal({
- title: '更新提示',
- content: '新版本下载失败,请检查网络后重试。',
- showCancel: false
- });
- });
- },
- }
- }
- </script>
- <style lang="less">
- @import '@/assets/css/common.less';
- @import './assets/css/tool.css';
- </style>
- <style lang="scss">
- @import "@/uni_modules/uview-ui/index.scss";
- @import '@/assets/css/common.scss';
- @import '@/assets/css/commonTheme.css';
- page{
- background-color: #f5f5f5;
- }
- ::-webkit-scrollbar{
- width: 0 !important;
- height: 0 !important;
-
- }
-
- /*每个页面公共css */
- .base-color {
- color: #1773ff;
- }
- .colorf{
- color: #fff;
- }
- .bgf{
- background-color: #fff;
- }
- .base-color-2 {
- color: #e7f1fe;
- }
-
- .base-color-3 {
- color: #425034;
- }
- .base-color-9 {
- color: #999;
- }
- .base-color-8 {
- color: #f8f8f8;
- }
- .base-color-6 {
- color: #666;
- }
- .base-color-gray {
- color: #DEDFE4;
- }
- .base-color-red{
- color:#ee0a25;
- }
- .base-color-dark {
- color: #313131;
- }
-
- .base-color-dark2 {
- color: #3E3E3E;
- }
-
- .base-price {
- color: #FF1212;
- }
-
- .base-success {
- color: #a3db42;
- }
-
- .base-bg {
- background: #1773ff;
- }
-
- .base-bg-2 {
- background: #e7f1fe;
- }
- .base-bg-red{
- background: #ee0a25;
- }
- .base-bg-f{
- background-color:#fff;
- }
- .base-bg-f8{
- background-color:#f8f8f8;
- }
- .base-bg-f5{
- background-color: #f5f5f5;
- }
- .base-bg-9{
- background-color: #f9f9f9;
- }
- .base-bg-blue{
- background:#1677ff;
- }
- .base-bg-sure{
- background:#e7f2fe;
- }
- .base-bg-orange{
- background:#FF7F00;
- }
- .base-bg-false{
- background:#fae7e7;
- }
- .bor-blue{
- border: 2rpx solid #c9e1fb;
- }
- .bor-red{
- border: 2rpx solid #f7a1a1;
- }
- </style>
|