App.vue 4.2 KB

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