App.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <script>
  2. export default {
  3. globalData: {
  4. // baseUrl: 'http://192.168.2.113:9110/saas/clz/', // 本地
  5. baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
  6. // baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
  7. },
  8. onLaunch: function() {
  9. console.log('App Launch');
  10. },
  11. onShow: function() {
  12. console.log('App Show');
  13. const updateManager = uni.getUpdateManager();
  14. updateManager.onCheckForUpdate(function (res) {
  15. // 请求完新版本信息的回调
  16. console.log(res.hasUpdate,'updateManager');
  17. });
  18. updateManager.onUpdateReady(function (res) {
  19. uni.showModal({
  20. title: '更新提示',
  21. content: '新版本已经准备好,是否重启应用?',
  22. success(res) {
  23. if (res.confirm) {
  24. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  25. updateManager.applyUpdate();
  26. }
  27. }
  28. });
  29. });
  30. updateManager.onUpdateFailed(function (res) {
  31. // 新的版本下载失败
  32. console.log(res);
  33. });
  34. },
  35. onHide: function() {
  36. console.log('App Hide');
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. @import "uview-ui/index.scss";
  42. @import "/static/iconfont/iconfont.css";
  43. @import 'flex.css';
  44. /*每个页面公共css */
  45. page {
  46. width: 100%;
  47. min-height: 100%;
  48. display: flex;
  49. background: #f8f8f8;
  50. > view{
  51. width: 100%;
  52. }
  53. }
  54. /* #ifdef MP-BAIDU */
  55. page {
  56. width: 100%;
  57. height: 100%;
  58. display: block;
  59. }
  60. swan-template {
  61. width: 100%;
  62. min-height: 100%;
  63. display: flex;
  64. }
  65. /* 原生组件模式下需要注意组件外部样式 */
  66. custom-component {
  67. width: 100%;
  68. min-height: 100%;
  69. display: flex;
  70. }
  71. /* #endif */
  72. /* #ifdef MP-ALIPAY */
  73. page {
  74. min-height: 100vh;
  75. }
  76. /* #endif */
  77. /* 原生组件模式下需要注意组件外部样式 */
  78. m-input {
  79. width: 100%;
  80. min-height: 100%;
  81. display: flex;
  82. }
  83. .content {
  84. display: flex;
  85. flex: 1;
  86. flex-direction: column;
  87. background-color: #fff;
  88. padding: 20upx;
  89. }
  90. // 带圆角的区域块
  91. .cont-item{
  92. background: #ffffff;
  93. margin: 20upx 32upx;
  94. padding: 0 32rpx;
  95. border-radius: 24upx;
  96. box-shadow: 1px 1px 3px #EEEEEE;
  97. font-size: 28upx;
  98. }
  99. </style>