home.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="app-main">
  3. <view class="app-top">
  4. <view class="logo-amin">
  5. <image src="/static/img/logo.png" style="width: 25vw;height: 25vw;border-radius: 50%;"></image>
  6. </view>
  7. </view>
  8. <view class="app-foot" :class="fadeIn">
  9. <view style="margin-bottom: 240px;font-size: 24px;">杭州尚视拍卖有限公司</view>
  10. <view>浙ICP备2022017146号-2</view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {mapState,mapMutations } from 'vuex';
  16. export default {
  17. data() {
  18. return {
  19. fadeIn:"",
  20. netIndex : 0
  21. }
  22. },
  23. onLoad(options) {
  24. setTimeout(()=>{
  25. this.fadeIn = "fadeIn";
  26. },1000);
  27. this.getNetWord();
  28. },
  29. methods: {
  30. ...mapMutations(['setHttp']),
  31. getNetWord:function(){
  32. let httpAr = this.global.apiHttps;
  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({url: "/pages/index/index"});
  59. setTimeout(()=>{
  60. uni.switchTab({
  61. url:"index"
  62. });
  63. },2000);
  64. }
  65. }
  66. }
  67. </script>
  68. <style>
  69. .app-main{background: #FFF;position: absolute;width: 100%;height: 100%;left: 0;top: 0;}
  70. .app-top{ text-align: center; padding-top: 50vw;}
  71. .app-foot{position: fixed;opacity: 0;bottom: 40px;text-align: center;width: 100%;color: #333;font-size: 14px;}
  72. .app-main .fadeIn {
  73. animation-name: fadeIn;
  74. opacity: 1;
  75. animation-duration: 3s;
  76. }
  77. .logo-amin{animation-name: fadeIn;animation-duration: 3s;animation-iteration-count: 1;animation-delay: 0s}
  78. @keyframes fadeIn {
  79. 0% { opacity: 0 }
  80. 100% { opacity: 1 }
  81. }
  82. </style>