App.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <script>
  2. const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
  3. // const uat_domain = 'http://192.168.16.213:8308' // 本地
  4. const pro_domain = 'https://cust.sxzxyj.net' // 生产
  5. const uat_URL = uat_domain+'/gc-cust/' // 预发布
  6. const pro_URL = pro_domain+'/gc-cust/' // 生产
  7. const buildType = 1 // 打包环境对应类型,1 生产 0 预发布
  8. const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
  9. const envText = ['预发布环境','生产环境']
  10. const envTips = process.env.NODE_ENV == 'development' ? envText[0] : envText[buildType]
  11. console.log(process.env.NODE_ENV)
  12. export default {
  13. globalData: {
  14. baseDomain: process.env.NODE_ENV == 'development' ? uat_domain : pro_domain,
  15. baseUrl: process.env.NODE_ENV == 'development' ? uat_URL : buildURL,
  16. token: '',
  17. version: '', // 当前版本号
  18. buildType: buildType,
  19. envTips: envTips,
  20. },
  21. mounted() {
  22. // 非V3模式
  23. if(this.$scope){
  24. this.$scope.globalData.token = this.$store.state.vuex_token
  25. }else{
  26. // V3模式
  27. getApp({allowDefault: true}).globalData.token = this.$store.state.vuex_token
  28. }
  29. },
  30. onLaunch: function() {
  31. console.log('App onLaunch')
  32. },
  33. onShow: function() {
  34. console.log('App Show')
  35. },
  36. onHide: function() {
  37. console.log('App Hide')
  38. },
  39. }
  40. </script>
  41. <style lang="scss">
  42. @import "uview-ui/index.scss";
  43. // @import "/static/iconfont-weapp-icon.css";
  44. @import "/static/iconfont/iconfont.css";
  45. /*每个页面公共css */
  46. page {
  47. min-height: 100%;
  48. display: flex;
  49. background-color: #F8F8F8;
  50. }
  51. .content {
  52. padding: 20upx;
  53. }
  54. .form-input {
  55. font-size: 28rpx;
  56. color: #333;
  57. // text-align: right;
  58. width: 95%;
  59. box-sizing: border-box;
  60. height: 60rpx;
  61. line-height: 60rpx;
  62. &.textarea{
  63. height: 240rpx;
  64. padding: 24rpx 0;
  65. text-align: left;
  66. }
  67. }
  68. .form-input-placeholder {
  69. font-size: 28rpx;
  70. color: #999;
  71. }
  72. /* 显示一行省略号 */
  73. .ellipsis-one{
  74. white-space: nowrap;
  75. text-overflow: ellipsis;
  76. overflow: hidden;
  77. word-break: break-all;
  78. }
  79. /* 显示两行,省略号 */
  80. .ellipsis-two{
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. display: -webkit-box;
  84. -webkit-line-clamp: 2;
  85. line-clamp: 2;
  86. -webkit-box-orient: vertical;
  87. }
  88. /* felx布局 */
  89. .flex{
  90. display: -webkit-flex; /* Chrome 21+, Safari 6.1+, iOS Safari 7+, Opera 15/16 */
  91. display: -moz-flex; /* Firefox 18+ */
  92. display: -ms-flexbox; /* IE 10 */
  93. display: flex; /* Chrome 29+, Firefox 22+, IE 11+, Opera 12.1/17/18, Android 4.4+ */
  94. }
  95. /*伸缩流方向*/
  96. .flex_column{
  97. -webkit-box-orient: vertical;
  98. -ms-flex-direction: column;
  99. -webkit-flex-direction: column;
  100. flex-direction: column;
  101. }
  102. /*主轴对齐*/
  103. .justify_center{
  104. -webkit-box-pack: center;
  105. -ms-flex-pack: center;
  106. -webkit-justify-content: center;
  107. justify-content: center;
  108. }
  109. .justify_end{
  110. -webkit-box-pack: end;
  111. -ms-flex-pack: end;
  112. -webkit-justify-content: flex-end;
  113. justify-content: flex-end;
  114. }
  115. .justify_between{
  116. -webkit-box-pack: justify;
  117. -ms-flex-pack: justify;
  118. -webkit-justify-content: space-between;
  119. justify-content: space-between;
  120. }
  121. /*侧轴对齐*/
  122. .align_start{
  123. -webkit-box-align: start;
  124. -ms-flex-align: start;
  125. -webkit-align-items: flex-start;
  126. align-items: flex-start;
  127. }
  128. .align_end{
  129. -webkit-box-align: end;
  130. -ms-flex-align: end;
  131. -webkit-align-items: flex-end;
  132. align-items: flex-end;
  133. }
  134. .align_center{
  135. -webkit-box-align: center;
  136. -ms-flex-align: center;
  137. -webkit-align-items: center;
  138. align-items: center;
  139. }
  140. .align_baseline{
  141. -webkit-box-align: baseline;
  142. -ms-flex-align: baseline;
  143. -webkit-align-items: baseline;
  144. align-items: baseline;
  145. }
  146. /*伸缩性*/
  147. .flex_auto{
  148. -webkit-box-flex: 1;
  149. -ms-flex: auto;
  150. -webkit-flex: auto;
  151. flex: auto;
  152. }
  153. .flex_1{
  154. -webkit-box-flex: 1;
  155. -ms-flex: 1;
  156. -webkit-flex: 1;
  157. flex: 1;
  158. }
  159. </style>