App.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. @import "colorui/main.css";
  114. @import "colorui/icon.css";
  115. @import "colorui/uni.css";
  116. @import "colorui/uni-nvue.css";
  117. .nav-list {
  118. display: flex;
  119. flex-wrap: wrap;
  120. padding: 0px 40upx 0px;
  121. justify-content: space-between;
  122. }
  123. .nav-li {
  124. padding: 30upx;
  125. border-radius: 12upx;
  126. width: 45%;
  127. margin: 0 2.5% 40upx;
  128. background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  129. background-size: cover;
  130. background-position: center;
  131. position: relative;
  132. z-index: 1;
  133. }
  134. .nav-li::after {
  135. content: "";
  136. position: absolute;
  137. z-index: -1;
  138. background-color: inherit;
  139. width: 100%;
  140. height: 100%;
  141. left: 0;
  142. bottom: -10%;
  143. border-radius: 10upx;
  144. opacity: 0.2;
  145. transform: scale(0.9, 0.9);
  146. }
  147. .nav-li.cur {
  148. color: #fff;
  149. background: rgb(94, 185, 94);
  150. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  151. }
  152. .nav-title {
  153. font-size: 32upx;
  154. font-weight: 300;
  155. }
  156. .nav-title::first-letter {
  157. font-size: 40upx;
  158. margin-right: 4upx;
  159. }
  160. .nav-name {
  161. font-size: 28upx;
  162. text-transform: Capitalize;
  163. margin-top: 20upx;
  164. position: relative;
  165. }
  166. .nav-name::before {
  167. content: "";
  168. position: absolute;
  169. display: block;
  170. width: 40upx;
  171. height: 6upx;
  172. background: #fff;
  173. bottom: 0;
  174. right: 0;
  175. opacity: 0.5;
  176. }
  177. .nav-name::after {
  178. content: "";
  179. position: absolute;
  180. display: block;
  181. width: 100upx;
  182. height: 1px;
  183. background: #fff;
  184. bottom: 0;
  185. right: 40upx;
  186. opacity: 0.3;
  187. }
  188. .nav-name::first-letter {
  189. font-weight: bold;
  190. font-size: 36upx;
  191. margin-right: 1px;
  192. }
  193. .nav-li text {
  194. position: absolute;
  195. right: 30upx;
  196. top: 30upx;
  197. font-size: 52upx;
  198. width: 60upx;
  199. height: 60upx;
  200. text-align: center;
  201. line-height: 60upx;
  202. }
  203. .text-light {
  204. font-weight: 300;
  205. }
  206. @keyframes show {
  207. 0% {
  208. transform: translateY(-50px);
  209. }
  210. 60% {
  211. transform: translateY(40upx);
  212. }
  213. 100% {
  214. transform: translateY(0px);
  215. }
  216. }
  217. @-webkit-keyframes show {
  218. 0% {
  219. transform: translateY(-50px);
  220. }
  221. 60% {
  222. transform: translateY(40upx);
  223. }
  224. 100% {
  225. transform: translateY(0px);
  226. }
  227. }
  228. </style>