home.nvue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. <view class='footer-text'>中国长城计算机进出口公司</view>
  8. <view>京ICP备2024043848号-3A</view>
  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. },
  28. methods: {
  29. ...mapMutations(['setHttp']),
  30. getNetWord: function() {
  31. let httpAr = global.apiHttps;
  32. console.log(this.setHttp,'2333')
  33. if (this.netIndex >= httpAr.length) {
  34. this.setHttp(httpAr[this.netIndex - 1]);
  35. this.getHome();
  36. return;
  37. }
  38. let url = httpAr[this.netIndex];
  39. uni.request({
  40. url: url + "sign",
  41. timeout: 800,
  42. success: (res) => {
  43. if (res.data.code == 200) {
  44. this.setHttp(url);
  45. this.getHome();
  46. } else {
  47. this.netIndex++;
  48. this.getNetWord();
  49. }
  50. },
  51. fail: () => {
  52. this.netIndex++;
  53. this.getNetWord();
  54. }
  55. });
  56. },
  57. getHome: function() {
  58. uni.preloadPage({
  59. url: "/pages/index/index"
  60. });
  61. setTimeout(() => {
  62. uni.switchTab({
  63. url: "index"
  64. });
  65. }, 2000);
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. .app-main {
  72. background: #FFF;
  73. position: fixed;
  74. opacity: 0;
  75. left: 0;
  76. top: 0;
  77. bottom: 0;
  78. right: 0;
  79. border: 1px solid #000;
  80. transition: opacity 3s;
  81. }
  82. .logo {
  83. width: 162rpx;
  84. height: 162rpx;
  85. border-radius: 50%;
  86. }
  87. .app-top {
  88. text-align: center;
  89. padding-top: 375rpx;
  90. align-items: center;
  91. justify-content: center;
  92. }
  93. .app-foot {
  94. position: absolute;
  95. bottom: 40px;
  96. width: 750rpx;
  97. color: #333;
  98. font-size: 14px;
  99. justify-content: center;
  100. align-items: center;
  101. }
  102. .footer-text{
  103. font-size: 24rpx;
  104. }
  105. .fadeIn{
  106. opacity: 1;
  107. }
  108. </style>