App.vue 4.6 KB

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