App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <script>
  2. /**
  3. * vuex管理登陆状态,具体可以参考官方登陆模板示例
  4. */
  5. export default {
  6. data() {
  7. return {
  8. /* 保存微信信息 */
  9. appData: {}
  10. };
  11. },
  12. methods: {},
  13. onLaunch: function(urlObj) {},
  14. onShow: function() {
  15. // 加载拦截
  16. // console.log('App Show');
  17. },
  18. onHide: function() {
  19. // console.log('App Hide');
  20. }
  21. };
  22. </script>
  23. <style lang="scss">
  24. /*全局公共样式和字体图标*/
  25. @import 'uview-ui/index.scss';
  26. @import '/static/css/cmy.css';
  27. .uni-tabbar__item {
  28. &.active {
  29. background: #127fd5 !important;
  30. }
  31. }
  32. view,
  33. scroll-view,
  34. swiper,
  35. swiper-item,
  36. cover-view,
  37. cover-image,
  38. icon,
  39. text,
  40. rich-text,
  41. progress,
  42. button,
  43. checkbox,
  44. form,
  45. input,
  46. label,
  47. radio,
  48. slider,
  49. switch,
  50. textarea,
  51. navigator,
  52. audio,
  53. camera,
  54. image,
  55. video {
  56. box-sizing: border-box;
  57. }
  58. /* 骨架屏替代方案 */
  59. .Skeleton {
  60. background: #f3f3f3;
  61. padding: 20rpx 0;
  62. border-radius: 8rpx;
  63. }
  64. .botton-box {
  65. height: 132rpx;
  66. }
  67. /* 图片载入替代方案 */
  68. .image-wrapper {
  69. font-size: 0;
  70. background: #f3f3f3;
  71. border-radius: 4px;
  72. image {
  73. width: 100%;
  74. height: 100%;
  75. transition: 0.6s;
  76. opacity: 0;
  77. &.loaded {
  78. opacity: 1;
  79. }
  80. }
  81. }
  82. // 设置富文本中图片最大宽度
  83. uni-rich-text img {
  84. max-width: 100% !important;
  85. }
  86. /*边框*/
  87. .b-b:after,
  88. .b-t:after {
  89. position: absolute;
  90. z-index: 3;
  91. left: 0;
  92. right: 0;
  93. height: 0;
  94. content: '';
  95. transform: scaleY(0.5);
  96. border-bottom: 1px solid $border-color-base;
  97. }
  98. .b-b:after {
  99. bottom: 0;
  100. }
  101. .b-t:after {
  102. top: 0;
  103. }
  104. /* button样式改写 */
  105. uni-button,
  106. button {
  107. height: 80rpx;
  108. line-height: 80rpx;
  109. font-size: $font-lg + 2rpx;
  110. font-weight: normal;
  111. &.no-border:before,
  112. &.no-border:after {
  113. border: 0;
  114. }
  115. }
  116. uni-button[type='default'],
  117. button[type='default'] {
  118. color: $font-color-dark;
  119. }
  120. /* input 样式 */
  121. .input-placeholder {
  122. color: #999999;
  123. }
  124. .placeholder {
  125. color: #999999;
  126. }
  127. // 边距样式
  128. @for $i from 1 to 4 {
  129. .margin-l-#{$i * 10} {
  130. margin-left: $i * 10rpx !important;
  131. }
  132. .margin-r-#{$i * 10} {
  133. margin-right: $i * 10rpx !important;
  134. }
  135. .margin-t-#{$i * 10} {
  136. margin-top: $i * 10rpx !important;
  137. }
  138. .margin-b-#{$i * 10} {
  139. margin-bottom: $i * 10rpx !important;
  140. }
  141. .margin-#{$i * 10} {
  142. margin: $i * 10rpx !important;
  143. }
  144. .margin-v-#{$i * 10} {
  145. margin-top: $i * 10rpx !important;
  146. margin-bottom: $i * 10rpx !important;
  147. }
  148. .margin-c-#{$i * 10} {
  149. margin-left: $i * 10rpx !important;
  150. margin-right: $i * 10rpx !important;
  151. }
  152. .padding-l-#{$i * 10} {
  153. padding-left: $i * 10rpx !important;
  154. }
  155. .padding-r-#{$i * 10} {
  156. padding-right: $i * 10rpx !important;
  157. }
  158. .padding-t-#{$i * 10} {
  159. padding-top: $i * 10rpx !important;
  160. }
  161. .padding-b-#{$i * 10} {
  162. padding-bottom: $i * 10rpx !important;
  163. }
  164. .padding-#{$i * 10} {
  165. padding: $i * 10rpx !important;
  166. }
  167. .padding-v-#{$i * 10} {
  168. padding-top: $i * 10rpx !important;
  169. padding-bottom: $i * 10rpx !important;
  170. }
  171. .padding-c-#{$i * 10} {
  172. padding-left: $i * 10rpx !important;
  173. padding-right: $i * 10rpx !important;
  174. }
  175. }
  176. // 字体大小
  177. .font-size-sm {
  178. font-size: $font-sm;
  179. }
  180. .font-size-base {
  181. font-size: $font-base;
  182. }
  183. .font-size-lg {
  184. font-size: $font-lg;
  185. }
  186. // 字体颜色
  187. .font-color-yellow {
  188. color: $color-yellow;
  189. }
  190. .font-color-gray {
  191. color: $color-gray;
  192. }
  193. .font-color-red {
  194. color: $color-red;
  195. }
  196. // 边框颜色
  197. .border-color-yellow {
  198. border: 1rpx solid $color-yellow;
  199. }
  200. // 修改默认背景颜色
  201. uni-page-wrapper {
  202. background-color: $page-color-base;
  203. }
  204. page {
  205. background-color: $page-color-base;
  206. // 设置默认字体
  207. font-family: PingFang SC, STHeitiSC-Light, Helvetica-Light, arial, sans-serif, Droid Sans Fallback;
  208. height: auto;
  209. min-height: 100%;
  210. }
  211. </style>