index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="body">
  3. <van-swipe class="my-swipe" :autoplay="3000" :height="200" indicator-color="white">
  4. <van-swipe-item v-for="(item, index) in images" :key="index" class="swipe-img">
  5. <img :src="item"/>
  6. </van-swipe-item>
  7. </van-swipe>
  8. </div>
  9. </template>
  10. <script>
  11. import Footer from "@/components/Footer";
  12. export default {
  13. data() {
  14. return {
  15. isCorpWX:false,
  16. isWX:false,
  17. user: JSON.parse(localStorage.userInfo),
  18. unreadNum:0,
  19. images: [
  20. // require('../../assets/img/index/banner_1.png'),
  21. require('../../assets/img/index/banner4.jpeg'),
  22. // require('../../assets/img/index/banner_3.png'),
  23. ],
  24. routers: [
  25. {
  26. name: '查看日报',
  27. url: '/calendar',
  28. icon: 'description'
  29. },
  30. {
  31. name: '填写日报',
  32. url: '/edit',
  33. icon: 'edit'
  34. },
  35. ],
  36. };
  37. },
  38. created() {
  39. let index = this.active + 1;
  40. this.list = this[`list${index}`]; // this.list1
  41. },
  42. mounted() {
  43. var ua = navigator.userAgent.toLowerCase();
  44. if (ua.indexOf("wxwork") > 0) {
  45. this.isCorpWX = true;
  46. } else if (ua.indexOf("micromessenger") > 0) {
  47. this.isWX = true;
  48. }
  49. this.test();
  50. },
  51. components: {
  52. Footer
  53. },
  54. methods: {
  55. //获取账户信息
  56. test() {
  57. var array = ["111", "222", "333"];
  58. var ret = array.splice(1,1);
  59. alert(ret);
  60. // this.$axios.get('/user/loginByUserId', {params:{userId: this.user.id}})
  61. // .then(res => {
  62. // console.log(res);
  63. // if (res.code == 'error') {
  64. // localStorage.errorMsg = res.msg;
  65. // //账号信息有问题,不能使用。
  66. // this.$router.push("/error");
  67. // } else {
  68. // localStorage.userInfo = JSON.stringify(res.data);
  69. // this.user = res.data;
  70. // }
  71. // }).catch(err=> {
  72. // alert('err=' + err);
  73. // });
  74. },
  75. },
  76. activated(){
  77. }
  78. };
  79. </script>
  80. <style lang="less" scoped>
  81. .swipe-img {
  82. img {
  83. width: 100%;
  84. height: 100%;
  85. }
  86. }
  87. .body {
  88. height: calc(100vh - 50px);
  89. position: relative;
  90. }
  91. .tip {
  92. position: absolute;
  93. width: 100%;
  94. bottom: 5px;
  95. font-size: 14px;
  96. color: #8f8f8f;
  97. margin-top: 20px;
  98. text-align: center;
  99. line-height: 20px;
  100. }
  101. </style>