index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div class="introduce">
  3. <div class="header">
  4. <img :src="back" alt="" @click="onClickLeft">
  5. </div>
  6. <div class="list" v-if="showList&&showList.length>0">
  7. <img v-for="(img,index) in showList" :key="img+index" :src="img" alt="">
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import resToken from "@/mixins/resToken";
  13. export default {
  14. mixins: [resToken],
  15. data() {
  16. return {
  17. title: null,
  18. back:require(`@/assets/images/introduce/back@2x.png`),
  19. showList: [],
  20. list: [
  21. {
  22. index: 1,
  23. total: 5,
  24. },
  25. {
  26. index: 2,
  27. total: 3,
  28. },
  29. {
  30. index: 3,
  31. total: 5,
  32. },
  33. {
  34. index: 4,
  35. total: 3,
  36. },
  37. {
  38. index: 5,
  39. total: 5,
  40. },
  41. {
  42. index: 6,
  43. total: 7,
  44. },
  45. {
  46. index: 7,
  47. total: 6,
  48. },
  49. ],
  50. loading: false,
  51. };
  52. },
  53. async created() {
  54. this.showList = [];
  55. let index = this.$route.query.index;
  56. this.getImgList(index ? index : 0);
  57. },
  58. methods: {
  59. onClickLeft() {
  60. window.history.back(-1);
  61. },
  62. getImgList(index) {
  63. let total = 0;
  64. let findi = this.list.findIndex((v) => v.index === Number(index) );
  65. console.log(index,findi);
  66. if (findi !== -1) {
  67. total = this.list[findi].total;
  68. }
  69. for(let i=0;i<total;i++){
  70. this.showList.push(require(`@/assets/images/introduce/${index}/${i+1}.0@2x.png`))
  71. }
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="scss" scoped>
  77. .introduce {
  78. background: #e6e6dc;
  79. position:fixed;
  80. width: 100%;
  81. height: 100%;
  82. .list{
  83. position: relative;
  84. width: 100%;
  85. height: 100%;
  86. overflow-y:scroll;
  87. img{
  88. display: inline-block;
  89. width: 100%;
  90. margin:-5px 0 0 0;
  91. }}
  92. .header{
  93. position: absolute;
  94. height: 46px;
  95. width: 100%;
  96. top:0;
  97. left:0;
  98. z-index:2;
  99. img{
  100. width: 8px;
  101. margin: 17px 0 0 16px;
  102. }
  103. }
  104. }
  105. </style>