App.vue 4.3 KB

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