home.nvue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="app-main fadeIn" >
  3. <view class="app-top">
  4. <image class='logo' src="/static/img/logo.png"></image>
  5. </view>
  6. <view class="app-foot">
  7. <text class='footer-text'>中国长城计算机进出口公司</text>
  8. <text class='footer-text2'>京ICP备2024043848号-3A</text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {
  14. mapState,
  15. mapMutations
  16. } from 'vuex';
  17. import global from '@/config/global.js'
  18. export default {
  19. data() {
  20. return {
  21. fadeIn: "fadeIn",
  22. netIndex: 0,
  23. }
  24. },
  25. onLoad(options) {
  26. this.getNetWord();
  27. this.$store.commit("init",this);
  28. },
  29. methods: {
  30. ...mapMutations(['setHttp']),
  31. getNetWord: function() {
  32. let httpAr = global.apiHttps;
  33. // console.log(this.setHttp,'2333')
  34. if (this.netIndex >= httpAr.length) {
  35. this.setHttp(httpAr[this.netIndex - 1]);
  36. this.getHome();
  37. return;
  38. }
  39. let url = httpAr[this.netIndex];
  40. uni.request({
  41. url: url + "sign",
  42. timeout: 800,
  43. success: (res) => {
  44. if (res.data.code == 200) {
  45. this.setHttp(url);
  46. this.getHome();
  47. } else {
  48. this.netIndex++;
  49. this.getNetWord();
  50. }
  51. },
  52. fail: () => {
  53. this.netIndex++;
  54. this.getNetWord();
  55. }
  56. });
  57. },
  58. getHome: function() {
  59. uni.preloadPage({
  60. url: "/pages/index/index"
  61. });
  62. setTimeout(() => {
  63. uni.switchTab({
  64. url: "index"
  65. });
  66. }, 2000);
  67. }
  68. }
  69. }
  70. </script>
  71. <style>
  72. .app-main {
  73. background: #FFF;
  74. position: fixed;
  75. opacity: 0;
  76. left: 0;
  77. top: 0;
  78. bottom: 0;
  79. right: 0;
  80. border: 1px solid #000;
  81. transition: opacity 3s;
  82. }
  83. .logo {
  84. width: 162rpx;
  85. height: 162rpx;
  86. border-radius: 50%;
  87. }
  88. .app-top {
  89. text-align: center;
  90. padding-top: 375rpx;
  91. align-items: center;
  92. justify-content: center;
  93. }
  94. .app-foot {
  95. position: absolute;
  96. bottom: 40px;
  97. width: 750rpx;
  98. justify-content: center;
  99. align-items: center;
  100. }
  101. .footer-text{
  102. font-size: 24px;
  103. }
  104. .footer-text2{
  105. color: #333;
  106. font-size: 14px;
  107. }
  108. .fadeIn{
  109. opacity: 1;
  110. }
  111. </style>