App.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <style lang="scss">
  2. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  3. @import "@/uni_modules/uview-ui/index.scss";
  4. </style>
  5. <script>
  6. import Vue from "vue";
  7. import appUpdate from "common/util/appUpdate.js";
  8. export default {
  9. onLaunch: function () {
  10. const savedIP = uni.getStorageSync("selectedIP");
  11. if (!savedIP) {
  12. uni.reLaunch({ url: "/pages/ipConfig/ipConfig" });
  13. return;
  14. } else {
  15. uni.getSystemInfo({
  16. success: function (e) {
  17. // #ifdef APP-PLUS
  18. // 检测升级
  19. appUpdate();
  20. // #endif
  21. // #ifndef MP
  22. Vue.prototype.StatusBar = e.statusBarHeight;
  23. if (e.platform == "android") {
  24. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  25. } else {
  26. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  27. }
  28. // #endif
  29. // #ifdef MP-WEIXIN
  30. Vue.prototype.StatusBar = e.statusBarHeight;
  31. let custom = wx.getMenuButtonBoundingClientRect();
  32. Vue.prototype.Custom = custom;
  33. Vue.prototype.CustomBar =
  34. custom.bottom + custom.top - e.statusBarHeight;
  35. // #endif
  36. // #ifdef MP-ALIPAY
  37. Vue.prototype.StatusBar = e.statusBarHeight;
  38. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  39. // #endif
  40. // #ifdef APP-PLUS
  41. //Vue.prototype.$api.listenTranMsg()
  42. // var info = plus.push.getClientInfo();
  43. // /* 5+ push 消息推送 ps:使用:H5+的方式监听,实现推送*/
  44. // plus.push.addEventListener("click", function(msg) {
  45. // console.log("click:" + JSON.stringify(msg));
  46. // console.log(msg.payload);
  47. // console.log(JSON.stringify(msg));
  48. // //这里可以写跳转业务代码
  49. // }, false);
  50. // // 监听在线消息事件
  51. // plus.push.addEventListener("receive", function(msg) {
  52. // // plus.ui.alert(2);
  53. // //这里可以写跳转业务代码
  54. // console.log("recevice:" + JSON.stringify(msg))
  55. // }, false);
  56. // #endif
  57. //Vue.prototype.$api.initLogin()
  58. },
  59. });
  60. Vue.prototype.NavBarColor = "bg-gradual-blue";
  61. Vue.prototype.Radio_Check_Size = "scale(0.7)";
  62. Vue.prototype.ColorList = [
  63. {
  64. title: "嫣红",
  65. name: "red",
  66. color: "#e54d42",
  67. },
  68. {
  69. title: "桔橙",
  70. name: "orange",
  71. color: "#f37b1d",
  72. },
  73. {
  74. title: "明黄",
  75. name: "yellow",
  76. color: "#fbbd08",
  77. },
  78. {
  79. title: "橄榄",
  80. name: "olive",
  81. color: "#8dc63f",
  82. },
  83. {
  84. title: "森绿",
  85. name: "green",
  86. color: "#39b54a",
  87. },
  88. {
  89. title: "天青",
  90. name: "cyan",
  91. color: "#1cbbb4",
  92. },
  93. {
  94. title: "海蓝",
  95. name: "blue",
  96. color: "#0081ff",
  97. },
  98. {
  99. title: "姹紫",
  100. name: "purple",
  101. color: "#6739b6",
  102. },
  103. {
  104. title: "木槿",
  105. name: "mauve",
  106. color: "#9c26b0",
  107. },
  108. {
  109. title: "桃粉",
  110. name: "pink",
  111. color: "#e03997",
  112. },
  113. {
  114. title: "棕褐",
  115. name: "brown",
  116. color: "#a5673f",
  117. },
  118. {
  119. title: "玄灰",
  120. name: "grey",
  121. color: "#8799a3",
  122. },
  123. {
  124. title: "草灰",
  125. name: "gray",
  126. color: "#aaaaaa",
  127. },
  128. {
  129. title: "墨黑",
  130. name: "black",
  131. color: "#333333",
  132. },
  133. {
  134. title: "雅白",
  135. name: "white",
  136. color: "#ffffff",
  137. },
  138. ];
  139. }
  140. },
  141. onShow: function () {
  142. console.log("App Show");
  143. },
  144. onHide: function () {
  145. console.log("App Hide");
  146. clearInterval(this.$store.state.timer); // 假设定时器存储在 Vuex 的状态管理中
  147. },
  148. };
  149. </script>
  150. <style>
  151. @import "plugin/colorui/main.css";
  152. @import "plugin/colorui/icon.css";
  153. @import "plugin/colorui/animation.css";
  154. .nav-list {
  155. display: flex;
  156. flex-wrap: wrap;
  157. padding: 0px 40upx 0px;
  158. justify-content: space-between;
  159. }
  160. .nav-li {
  161. padding: 30upx;
  162. border-radius: 12upx;
  163. width: 45%;
  164. margin: 0 2.5% 40upx;
  165. background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  166. background-size: cover;
  167. background-position: center;
  168. position: relative;
  169. z-index: 1;
  170. }
  171. .nav-li::after {
  172. content: "";
  173. position: absolute;
  174. z-index: -1;
  175. background-color: inherit;
  176. width: 100%;
  177. height: 100%;
  178. left: 0;
  179. bottom: -10%;
  180. border-radius: 10upx;
  181. opacity: 0.2;
  182. transform: scale(0.9, 0.9);
  183. }
  184. .nav-li.cur {
  185. color: #fff;
  186. background: rgb(94, 185, 94);
  187. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  188. }
  189. .nav-title {
  190. font-size: 32upx;
  191. font-weight: 300;
  192. }
  193. .nav-title::first-letter {
  194. font-size: 40upx;
  195. margin-right: 4upx;
  196. }
  197. .nav-name {
  198. font-size: 28upx;
  199. text-transform: Capitalize;
  200. margin-top: 20upx;
  201. position: relative;
  202. }
  203. .nav-name::before {
  204. content: "";
  205. position: absolute;
  206. display: block;
  207. width: 40upx;
  208. height: 6upx;
  209. background: #fff;
  210. bottom: 0;
  211. right: 0;
  212. opacity: 0.5;
  213. }
  214. .nav-name::after {
  215. content: "";
  216. position: absolute;
  217. display: block;
  218. width: 100upx;
  219. height: 1px;
  220. background: #fff;
  221. bottom: 0;
  222. right: 40upx;
  223. opacity: 0.3;
  224. }
  225. .nav-name::first-letter {
  226. font-weight: bold;
  227. font-size: 36upx;
  228. margin-right: 1px;
  229. }
  230. .nav-li text {
  231. position: absolute;
  232. right: 30upx;
  233. top: 30upx;
  234. font-size: 52upx;
  235. width: 60upx;
  236. height: 60upx;
  237. text-align: center;
  238. line-height: 60upx;
  239. }
  240. .text-light {
  241. font-weight: 300;
  242. }
  243. @keyframes show {
  244. 0% {
  245. transform: translateY(-50px);
  246. }
  247. 60% {
  248. transform: translateY(40upx);
  249. }
  250. 100% {
  251. transform: translateY(0px);
  252. }
  253. }
  254. @-webkit-keyframes show {
  255. 0% {
  256. transform: translateY(-50px);
  257. }
  258. 60% {
  259. transform: translateY(40upx);
  260. }
  261. 100% {
  262. transform: translateY(0px);
  263. }
  264. }
  265. </style>