App.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <script>
  2. export default {
  3. globalData: {
  4. baseUrl: '',
  5. token: '',
  6. changeOrg:'',
  7. version: '', // 当前版本号
  8. buildType: 'dev', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
  9. envTips: '', // 环境文字提示
  10. theme: 'default', // 主题,default
  11. isIphoneXup: false //是否iphonex以及以上的版本
  12. },
  13. mounted() {
  14. // 非V3模式
  15. if (this.$scope) {
  16. this.$scope.globalData.token = this.$store.state.vuex_token;
  17. this.$scope.globalData.changeOrg = this.$store.state.vuex_changeOrg;
  18. } else {
  19. // V3模式
  20. getApp({ allowDefault: true }).globalData.token = this.$store.state.vuex_token;
  21. getApp({ allowDefault: true }).globalData.changeOrg = this.$store.state.vuex_changeOrg;
  22. }
  23. this.$config('init');
  24. },
  25. onLaunch: function() {
  26. console.log('App launch')
  27. },
  28. onShow: function() {
  29. console.log('App Show')
  30. },
  31. onHide: function() {
  32. console.log('App Hide')
  33. },
  34. }
  35. </script>
  36. <style lang="scss">
  37. @import "./static/iconfont/iconfont.css";
  38. @import "uview-ui/index.scss";
  39. /*每个页面公共css */
  40. page {
  41. width: 100%;
  42. min-height: 100%;
  43. display: flex;
  44. background-color: #F8F8F8;
  45. }
  46. /* 登录页是否记住密码多选框样式 */
  47. uni-checkbox.login-form-checkbox .uni-checkbox-input{
  48. width: 24upx !important;
  49. height: 24upx !important;
  50. }
  51. .status_bar {
  52. height: var(--status-bar-height);
  53. width: 100%;
  54. }
  55. .isIPXup{
  56. padding-bottom: 64rpx !important;
  57. }
  58. /* form表单样式 */
  59. .form-box{
  60. background-color: #fff;
  61. padding: 0 30rpx;
  62. }
  63. .form-input {
  64. font-size: 28rpx;
  65. color: #333;
  66. text-align: right;
  67. width: 95%;
  68. box-sizing: border-box;
  69. height: 60rpx;
  70. line-height: 60rpx;
  71. &.textarea{
  72. height: 240rpx;
  73. padding: 24rpx 0;
  74. text-align: left;
  75. }
  76. }
  77. .form-input-placeholder {
  78. font-size: 28rpx;
  79. color: #999;
  80. }
  81. .form-textarea{
  82. height: 240rpx;
  83. padding: 24rpx 0;
  84. text-align: left;
  85. }
  86. .form-number-input{
  87. margin: 0 auto;
  88. }
  89. .u-required{
  90. position: relative;
  91. }
  92. .u-required:before{
  93. content: '*';
  94. position: absolute;
  95. left: -8px;
  96. top: 10upx;
  97. font-size: 14px;
  98. color: #fa3534;
  99. height: 9px;
  100. line-height: 1;
  101. }
  102. /* 元素宽度 百分比 */
  103. .uni-col-1{
  104. box-sizing: border-box;
  105. width: 10%;
  106. }
  107. .uni-col-2{
  108. box-sizing: border-box;
  109. width: 20%;
  110. }
  111. .uni-col-3{
  112. box-sizing: border-box;
  113. width: 30%;
  114. }
  115. .uni-col-4{
  116. box-sizing: border-box;
  117. width: 40%;
  118. }
  119. .uni-col-5{
  120. box-sizing: border-box;
  121. width: 50%;
  122. }
  123. .uni-col-6{
  124. box-sizing: border-box;
  125. width: 60%;
  126. }
  127. .uni-col-7{
  128. box-sizing: border-box;
  129. width: 70%;
  130. }
  131. .uni-col-8{
  132. box-sizing: border-box;
  133. width: 80%;
  134. }
  135. .uni-col-9{
  136. box-sizing: border-box;
  137. width: 90%;
  138. }
  139. .uni-col-10{
  140. box-sizing: border-box;
  141. width: 100%;
  142. }
  143. /* felx布局 */
  144. .flex{
  145. display: -webkit-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
  146. display: -moz-flex; /* Firefox 18+ */
  147. display: -ms-flexbox; /* IE 10 */
  148. display: flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
  149. }
  150. /*伸缩流方向*/
  151. .flex_column{
  152. -webkit-box-orient: vertical;
  153. -ms-flex-direction: column;
  154. -webkit-flex-direction: column;
  155. flex-direction: column;
  156. }
  157. /*主轴对齐*/
  158. .justify_center{
  159. -webkit-box-pack: center;
  160. -ms-flex-pack: center;
  161. -webkit-justify-content: center;
  162. justify-content: center;
  163. }
  164. .justify_end{
  165. -webkit-box-pack: end;
  166. -ms-flex-pack: end;
  167. -webkit-justify-content: flex-end;
  168. justify-content: flex-end;
  169. }
  170. .justify_between{
  171. -webkit-box-pack: justify;
  172. -ms-flex-pack: justify;
  173. -webkit-justify-content: space-between;
  174. justify-content: space-between;
  175. }
  176. /*侧轴对齐*/
  177. .align_start{
  178. -webkit-box-align: start;
  179. -ms-flex-align: start;
  180. -webkit-align-items: flex-start;
  181. align-items: flex-start;
  182. }
  183. .align_end{
  184. -webkit-box-align: end;
  185. -ms-flex-align: end;
  186. -webkit-align-items: flex-end;
  187. align-items: flex-end;
  188. }
  189. .align_center{
  190. -webkit-box-align: center;
  191. -ms-flex-align: center;
  192. -webkit-align-items: center;
  193. align-items: center;
  194. }
  195. .align_baseline{
  196. -webkit-box-align: baseline;
  197. -ms-flex-align: baseline;
  198. -webkit-align-items: baseline;
  199. align-items: baseline;
  200. }
  201. /*伸缩性*/
  202. .flex_auto{
  203. -webkit-box-flex: 1;
  204. -ms-flex: auto;
  205. -webkit-flex: auto;
  206. flex: auto;
  207. }
  208. .flex_1{
  209. -webkit-box-flex: 1;
  210. -ms-flex: 1;
  211. -webkit-flex: 1;
  212. flex: 1;
  213. }
  214. // ios15原生input的type=search时会默认自带搜索图标。
  215. // 在全局的公共样式隐藏ios自带搜索图标即可
  216. [type="search"]::-webkit-search-decoration {
  217. display: none;
  218. }
  219. uni-toast {
  220. z-index: 1000000;
  221. }
  222. </style>