App.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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. import configService from "@/common/service/config.service.js";
  9. export default {
  10. onLaunch: function () {
  11. const savedIP = uni.getStorageSync("selectedIP");
  12. if (configService.apiUrl !== "") {
  13. uni.getSystemInfo({
  14. success: function (e) {
  15. // #ifdef APP-PLUS
  16. // 检测升级
  17. appUpdate();
  18. // #endif
  19. // #ifndef MP
  20. Vue.prototype.StatusBar = e.statusBarHeight;
  21. if (e.platform == "android") {
  22. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  23. } else {
  24. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  25. }
  26. // #endif
  27. // #ifdef MP-WEIXIN
  28. Vue.prototype.StatusBar = e.statusBarHeight;
  29. let custom = wx.getMenuButtonBoundingClientRect();
  30. Vue.prototype.Custom = custom;
  31. Vue.prototype.CustomBar =
  32. custom.bottom + custom.top - e.statusBarHeight;
  33. // #endif
  34. // #ifdef MP-ALIPAY
  35. Vue.prototype.StatusBar = e.statusBarHeight;
  36. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  37. // #endif
  38. // #ifdef APP-PLUS
  39. //Vue.prototype.$api.listenTranMsg()
  40. // var info = plus.push.getClientInfo();
  41. // /* 5+ push 消息推送 ps:使用:H5+的方式监听,实现推送*/
  42. // plus.push.addEventListener("click", function(msg) {
  43. // console.log("click:" + JSON.stringify(msg));
  44. // console.log(msg.payload);
  45. // console.log(JSON.stringify(msg));
  46. // //这里可以写跳转业务代码
  47. // }, false);
  48. // // 监听在线消息事件
  49. // plus.push.addEventListener("receive", function(msg) {
  50. // // plus.ui.alert(2);
  51. // //这里可以写跳转业务代码
  52. // console.log("recevice:" + JSON.stringify(msg))
  53. // }, false);
  54. // #endif
  55. //Vue.prototype.$api.initLogin()
  56. },
  57. });
  58. Vue.prototype.NavBarColor = "bg-gradual-blue";
  59. Vue.prototype.Radio_Check_Size = "scale(0.7)";
  60. Vue.prototype.ColorList = [
  61. {
  62. title: "嫣红",
  63. name: "red",
  64. color: "#e54d42",
  65. },
  66. {
  67. title: "桔橙",
  68. name: "orange",
  69. color: "#f37b1d",
  70. },
  71. {
  72. title: "明黄",
  73. name: "yellow",
  74. color: "#fbbd08",
  75. },
  76. {
  77. title: "橄榄",
  78. name: "olive",
  79. color: "#8dc63f",
  80. },
  81. {
  82. title: "森绿",
  83. name: "green",
  84. color: "#39b54a",
  85. },
  86. {
  87. title: "天青",
  88. name: "cyan",
  89. color: "#1cbbb4",
  90. },
  91. {
  92. title: "海蓝",
  93. name: "blue",
  94. color: "#0081ff",
  95. },
  96. {
  97. title: "姹紫",
  98. name: "purple",
  99. color: "#6739b6",
  100. },
  101. {
  102. title: "木槿",
  103. name: "mauve",
  104. color: "#9c26b0",
  105. },
  106. {
  107. title: "桃粉",
  108. name: "pink",
  109. color: "#e03997",
  110. },
  111. {
  112. title: "棕褐",
  113. name: "brown",
  114. color: "#a5673f",
  115. },
  116. {
  117. title: "玄灰",
  118. name: "grey",
  119. color: "#8799a3",
  120. },
  121. {
  122. title: "草灰",
  123. name: "gray",
  124. color: "#aaaaaa",
  125. },
  126. {
  127. title: "墨黑",
  128. name: "black",
  129. color: "#333333",
  130. },
  131. {
  132. title: "雅白",
  133. name: "white",
  134. color: "#ffffff",
  135. },
  136. ];
  137. } else {
  138. if (!savedIP) {
  139. uni.reLaunch({ url: "/pages/ipConfig/ipConfig" });
  140. return;
  141. } else {
  142. uni.getSystemInfo({
  143. success: function (e) {
  144. // #ifdef APP-PLUS
  145. // 检测升级
  146. appUpdate();
  147. // #endif
  148. // #ifndef MP
  149. Vue.prototype.StatusBar = e.statusBarHeight;
  150. if (e.platform == "android") {
  151. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  152. } else {
  153. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  154. }
  155. // #endif
  156. // #ifdef MP-WEIXIN
  157. Vue.prototype.StatusBar = e.statusBarHeight;
  158. let custom = wx.getMenuButtonBoundingClientRect();
  159. Vue.prototype.Custom = custom;
  160. Vue.prototype.CustomBar =
  161. custom.bottom + custom.top - e.statusBarHeight;
  162. // #endif
  163. // #ifdef MP-ALIPAY
  164. Vue.prototype.StatusBar = e.statusBarHeight;
  165. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  166. // #endif
  167. // #ifdef APP-PLUS
  168. //Vue.prototype.$api.listenTranMsg()
  169. // var info = plus.push.getClientInfo();
  170. // /* 5+ push 消息推送 ps:使用:H5+的方式监听,实现推送*/
  171. // plus.push.addEventListener("click", function(msg) {
  172. // console.log("click:" + JSON.stringify(msg));
  173. // console.log(msg.payload);
  174. // console.log(JSON.stringify(msg));
  175. // //这里可以写跳转业务代码
  176. // }, false);
  177. // // 监听在线消息事件
  178. // plus.push.addEventListener("receive", function(msg) {
  179. // // plus.ui.alert(2);
  180. // //这里可以写跳转业务代码
  181. // console.log("recevice:" + JSON.stringify(msg))
  182. // }, false);
  183. // #endif
  184. //Vue.prototype.$api.initLogin()
  185. },
  186. });
  187. Vue.prototype.NavBarColor = "bg-gradual-blue";
  188. Vue.prototype.Radio_Check_Size = "scale(0.7)";
  189. Vue.prototype.ColorList = [
  190. {
  191. title: "嫣红",
  192. name: "red",
  193. color: "#e54d42",
  194. },
  195. {
  196. title: "桔橙",
  197. name: "orange",
  198. color: "#f37b1d",
  199. },
  200. {
  201. title: "明黄",
  202. name: "yellow",
  203. color: "#fbbd08",
  204. },
  205. {
  206. title: "橄榄",
  207. name: "olive",
  208. color: "#8dc63f",
  209. },
  210. {
  211. title: "森绿",
  212. name: "green",
  213. color: "#39b54a",
  214. },
  215. {
  216. title: "天青",
  217. name: "cyan",
  218. color: "#1cbbb4",
  219. },
  220. {
  221. title: "海蓝",
  222. name: "blue",
  223. color: "#0081ff",
  224. },
  225. {
  226. title: "姹紫",
  227. name: "purple",
  228. color: "#6739b6",
  229. },
  230. {
  231. title: "木槿",
  232. name: "mauve",
  233. color: "#9c26b0",
  234. },
  235. {
  236. title: "桃粉",
  237. name: "pink",
  238. color: "#e03997",
  239. },
  240. {
  241. title: "棕褐",
  242. name: "brown",
  243. color: "#a5673f",
  244. },
  245. {
  246. title: "玄灰",
  247. name: "grey",
  248. color: "#8799a3",
  249. },
  250. {
  251. title: "草灰",
  252. name: "gray",
  253. color: "#aaaaaa",
  254. },
  255. {
  256. title: "墨黑",
  257. name: "black",
  258. color: "#333333",
  259. },
  260. {
  261. title: "雅白",
  262. name: "white",
  263. color: "#ffffff",
  264. },
  265. ];
  266. }
  267. }
  268. },
  269. onShow: function () {
  270. console.log("App Show");
  271. },
  272. onHide: function () {
  273. console.log("App Hide");
  274. clearInterval(this.$store.state.timer); // 假设定时器存储在 Vuex 的状态管理中
  275. },
  276. };
  277. </script>
  278. <style>
  279. @import "plugin/colorui/main.css";
  280. @import "plugin/colorui/icon.css";
  281. @import "plugin/colorui/animation.css";
  282. .nav-list {
  283. display: flex;
  284. flex-wrap: wrap;
  285. padding: 0px 40upx 0px;
  286. justify-content: space-between;
  287. }
  288. .nav-li {
  289. padding: 30upx;
  290. border-radius: 12upx;
  291. width: 45%;
  292. margin: 0 2.5% 40upx;
  293. background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
  294. background-size: cover;
  295. background-position: center;
  296. position: relative;
  297. z-index: 1;
  298. }
  299. .nav-li::after {
  300. content: "";
  301. position: absolute;
  302. z-index: -1;
  303. background-color: inherit;
  304. width: 100%;
  305. height: 100%;
  306. left: 0;
  307. bottom: -10%;
  308. border-radius: 10upx;
  309. opacity: 0.2;
  310. transform: scale(0.9, 0.9);
  311. }
  312. .nav-li.cur {
  313. color: #fff;
  314. background: rgb(94, 185, 94);
  315. box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
  316. }
  317. .nav-title {
  318. font-size: 32upx;
  319. font-weight: 300;
  320. }
  321. .nav-title::first-letter {
  322. font-size: 40upx;
  323. margin-right: 4upx;
  324. }
  325. .nav-name {
  326. font-size: 28upx;
  327. text-transform: Capitalize;
  328. margin-top: 20upx;
  329. position: relative;
  330. }
  331. .nav-name::before {
  332. content: "";
  333. position: absolute;
  334. display: block;
  335. width: 40upx;
  336. height: 6upx;
  337. background: #fff;
  338. bottom: 0;
  339. right: 0;
  340. opacity: 0.5;
  341. }
  342. .nav-name::after {
  343. content: "";
  344. position: absolute;
  345. display: block;
  346. width: 100upx;
  347. height: 1px;
  348. background: #fff;
  349. bottom: 0;
  350. right: 40upx;
  351. opacity: 0.3;
  352. }
  353. .nav-name::first-letter {
  354. font-weight: bold;
  355. font-size: 36upx;
  356. margin-right: 1px;
  357. }
  358. .nav-li text {
  359. position: absolute;
  360. right: 30upx;
  361. top: 30upx;
  362. font-size: 52upx;
  363. width: 60upx;
  364. height: 60upx;
  365. text-align: center;
  366. line-height: 60upx;
  367. }
  368. .text-light {
  369. font-weight: 300;
  370. }
  371. @keyframes show {
  372. 0% {
  373. transform: translateY(-50px);
  374. }
  375. 60% {
  376. transform: translateY(40upx);
  377. }
  378. 100% {
  379. transform: translateY(0px);
  380. }
  381. }
  382. @-webkit-keyframes show {
  383. 0% {
  384. transform: translateY(-50px);
  385. }
  386. 60% {
  387. transform: translateY(40upx);
  388. }
  389. 100% {
  390. transform: translateY(0px);
  391. }
  392. }
  393. </style>