App.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <script>
  2. import Vue from 'vue'
  3. export default {
  4. onLaunch: function() {
  5. uni.getSystemInfo({
  6. success: function(e) {
  7. // #ifndef MP
  8. Vue.prototype.StatusBar = e.statusBarHeight;
  9. if (e.platform == 'android') {
  10. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  11. } else {
  12. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  13. };
  14. // #endif
  15. // #ifdef MP-WEIXIN
  16. Vue.prototype.StatusBar = e.statusBarHeight;
  17. let custom = wx.getMenuButtonBoundingClientRect();
  18. Vue.prototype.Custom = custom;
  19. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  20. // #endif
  21. // #ifdef MP-ALIPAY
  22. Vue.prototype.StatusBar = e.statusBarHeight;
  23. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  24. // #endif
  25. }
  26. })
  27. Vue.prototype.ColorList = [{
  28. title: '嫣红',
  29. name: 'red',
  30. color: '#e54d42'
  31. },
  32. {
  33. title: '桔橙',
  34. name: 'orange',
  35. color: '#f37b1d'
  36. },
  37. {
  38. title: '明黄',
  39. name: 'yellow',
  40. color: '#fbbd08'
  41. },
  42. {
  43. title: '橄榄',
  44. name: 'olive',
  45. color: '#8dc63f'
  46. },
  47. {
  48. title: '森绿',
  49. name: 'green',
  50. color: '#39b54a'
  51. },
  52. {
  53. title: '天青',
  54. name: 'cyan',
  55. color: '#1cbbb4'
  56. },
  57. {
  58. title: '海蓝',
  59. name: 'blue',
  60. color: '#0081ff'
  61. },
  62. {
  63. title: '姹紫',
  64. name: 'purple',
  65. color: '#6739b6'
  66. },
  67. {
  68. title: '木槿',
  69. name: 'mauve',
  70. color: '#9c26b0'
  71. },
  72. {
  73. title: '桃粉',
  74. name: 'pink',
  75. color: '#e03997'
  76. },
  77. {
  78. title: '棕褐',
  79. name: 'brown',
  80. color: '#a5673f'
  81. },
  82. {
  83. title: '玄灰',
  84. name: 'grey',
  85. color: '#8799a3'
  86. },
  87. {
  88. title: '草灰',
  89. name: 'gray',
  90. color: '#aaaaaa'
  91. },
  92. {
  93. title: '墨黑',
  94. name: 'black',
  95. color: '#333333'
  96. },
  97. {
  98. title: '雅白',
  99. name: 'white',
  100. color: '#ffffff'
  101. },
  102. ]
  103. },
  104. onShow: function() {
  105. //console.log('App Show')
  106. },
  107. onHide: function() {
  108. //console.log('App Hide')
  109. }
  110. }
  111. </script>
  112. <style>
  113. /*每个页面公共css */
  114. @import "static/colorui/main.css";
  115. @import "static/colorui/icon.css";
  116. .nav-list {
  117. display: flex;
  118. flex-wrap: wrap;
  119. padding: 0px 40upx 0px;
  120. justify-content: space-between;
  121. }
  122. .nav-li {
  123. padding: 30upx;
  124. border-radius: 12upx;
  125. width: 45%;
  126. margin: 0 2.5% 40upx;
  127. background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  128. background-size: cover;
  129. background-position: center;
  130. position: relative;
  131. z-index: 1;
  132. }
  133. .nav-li::after {
  134. content: "";
  135. position: absolute;
  136. z-index: -1;
  137. background-color: inherit;
  138. width: 100%;
  139. height: 100%;
  140. left: 0;
  141. bottom: -10%;
  142. border-radius: 10upx;
  143. opacity: 0.2;
  144. transform: scale(0.9, 0.9);
  145. }
  146. .nav-li.cur {
  147. color: #fff;
  148. background: rgb(94, 185, 94);
  149. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  150. }
  151. .nav-title {
  152. font-size: 32upx;
  153. font-weight: 300;
  154. }
  155. .nav-title::first-letter {
  156. font-size: 40upx;
  157. margin-right: 4upx;
  158. }
  159. .nav-name {
  160. font-size: 28upx;
  161. text-transform: Capitalize;
  162. margin-top: 20upx;
  163. position: relative;
  164. }
  165. .nav-name::before {
  166. content: "";
  167. position: absolute;
  168. display: block;
  169. width: 40upx;
  170. height: 6upx;
  171. background: #fff;
  172. bottom: 0;
  173. right: 0;
  174. opacity: 0.5;
  175. }
  176. .nav-name::after {
  177. content: "";
  178. position: absolute;
  179. display: block;
  180. width: 100upx;
  181. height: 1px;
  182. background: #fff;
  183. bottom: 0;
  184. right: 40upx;
  185. opacity: 0.3;
  186. }
  187. .nav-name::first-letter {
  188. font-weight: bold;
  189. font-size: 36upx;
  190. margin-right: 1px;
  191. }
  192. .nav-li text {
  193. position: absolute;
  194. right: 30upx;
  195. top: 30upx;
  196. font-size: 52upx;
  197. width: 60upx;
  198. height: 60upx;
  199. text-align: center;
  200. line-height: 60upx;
  201. }
  202. .text-light {
  203. font-weight: 300;
  204. }
  205. @keyframes show {
  206. 0% {
  207. transform: translateY(-50px);
  208. }
  209. 60% {
  210. transform: translateY(40upx);
  211. }
  212. 100% {
  213. transform: translateY(0px);
  214. }
  215. }
  216. @-webkit-keyframes show {
  217. 0% {
  218. transform: translateY(-50px);
  219. }
  220. 60% {
  221. transform: translateY(40upx);
  222. }
  223. 100% {
  224. transform: translateY(0px);
  225. }
  226. }
  227. </style>