App.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <script>
  2. export default {
  3. globalData: {
  4. // baseUrl: 'http://192.168.2.103: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. /*每个页面公共css */
  44. page {
  45. width: 100%;
  46. min-height: 100%;
  47. display: flex;
  48. background: #f8f8f8;
  49. > view{
  50. width: 100%;
  51. }
  52. }
  53. /* #ifdef MP-BAIDU */
  54. page {
  55. width: 100%;
  56. height: 100%;
  57. display: block;
  58. }
  59. swan-template {
  60. width: 100%;
  61. min-height: 100%;
  62. display: flex;
  63. }
  64. /* 原生组件模式下需要注意组件外部样式 */
  65. custom-component {
  66. width: 100%;
  67. min-height: 100%;
  68. display: flex;
  69. }
  70. /* #endif */
  71. /* #ifdef MP-ALIPAY */
  72. page {
  73. min-height: 100vh;
  74. }
  75. /* #endif */
  76. /* 原生组件模式下需要注意组件外部样式 */
  77. m-input {
  78. width: 100%;
  79. min-height: 100%;
  80. display: flex;
  81. }
  82. .content {
  83. display: flex;
  84. flex: 1;
  85. flex-direction: column;
  86. background-color: #fff;
  87. padding: 20upx;
  88. }
  89. // 带圆角的区域块
  90. .cont-item{
  91. background: #ffffff;
  92. margin: 20upx 32upx;
  93. padding: 0 32rpx;
  94. border-radius: 24upx;
  95. box-shadow: 1px 1px 3px #EEEEEE;
  96. font-size: 28upx;
  97. }
  98. /* 显示一行省略号 */
  99. .ellipsis-one{
  100. white-space: nowrap;
  101. text-overflow: ellipsis;
  102. overflow: hidden;
  103. word-break: break-all;
  104. }
  105. /* 显示两行,省略号 */
  106. .ellipsis-two{
  107. overflow: hidden;
  108. text-overflow: ellipsis;
  109. display: -webkit-box;
  110. -webkit-line-clamp: 2;
  111. line-clamp: 2;
  112. -webkit-box-orient: vertical;
  113. }
  114. /* felx布局 */
  115. .flex{
  116. display: -webkit-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
  117. display: -moz-flex; /* Firefox 18+ */
  118. display: -ms-flexbox; /* IE 10 */
  119. display: flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
  120. }
  121. /*伸缩流方向*/
  122. .flex_column{
  123. -webkit-box-orient: vertical;
  124. -ms-flex-direction: column;
  125. -webkit-flex-direction: column;
  126. flex-direction: column;
  127. }
  128. /*主轴对齐*/
  129. .justify_center{
  130. -webkit-box-pack: center;
  131. -ms-flex-pack: center;
  132. -webkit-justify-content: center;
  133. justify-content: center;
  134. }
  135. .justify_end{
  136. -webkit-box-pack: end;
  137. -ms-flex-pack: end;
  138. -webkit-justify-content: flex-end;
  139. justify-content: flex-end;
  140. }
  141. .justify_between{
  142. -webkit-box-pack: justify;
  143. -ms-flex-pack: justify;
  144. -webkit-justify-content: space-between;
  145. justify-content: space-between;
  146. }
  147. /*侧轴对齐*/
  148. .align_start{
  149. -webkit-box-align: start;
  150. -ms-flex-align: start;
  151. -webkit-align-items: flex-start;
  152. align-items: flex-start;
  153. }
  154. .align_end{
  155. -webkit-box-align: end;
  156. -ms-flex-align: end;
  157. -webkit-align-items: flex-end;
  158. align-items: flex-end;
  159. }
  160. .align_center{
  161. -webkit-box-align: center;
  162. -ms-flex-align: center;
  163. -webkit-align-items: center;
  164. align-items: center;
  165. }
  166. .align_baseline{
  167. -webkit-box-align: baseline;
  168. -ms-flex-align: baseline;
  169. -webkit-align-items: baseline;
  170. align-items: baseline;
  171. }
  172. /*伸缩性*/
  173. .flex_auto{
  174. -webkit-box-flex: 1;
  175. -ms-flex: auto;
  176. -webkit-flex: auto;
  177. flex: auto;
  178. }
  179. .flex_1{
  180. -webkit-box-flex: 1;
  181. -ms-flex: 1;
  182. -webkit-flex: 1;
  183. flex: 1;
  184. }
  185. </style>