pictures.vue 3.99 KB
Newer Older
葛齐林's avatar
葛齐林 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
<template lang='pug'>
    div.infopage()
        div.content()
            div.left()
                div.spBox()
                    img(:src="picUrl")
                    div.Licon(@click="changePic(1)")
                      img(src="@/assets/images/left.png")
                    div.Ricon(@click="changePic(2)")
                      img(src="@/assets/images/right.png")
            div.right()
                div.itemBox()
                    div.picItem(:class="[picUrl==e.url?'active':'']" v-for="(e,i) in PicData" :key="i" @click="cliPic(e,i)")
                        div.picBox()
                            img(:src="e.url")
                            p 第{{i+1}}

</template>
<script>
export default {
  data() {
    return {
      flag: 0,
      PicData: [],
      picUrl: '',
      picIdex: 0
    }
  },
  methods: {
    init(val) {
      let path = 'http://10.20.2.210:8089'
      this.PicData.push({ 'url': path + val.byx2 })
      this.PicData.push({ 'url': path + val.byx3 })
      this.PicData.push({ 'url': path + val.byx4 })
      this.PicData.push({ 'url': path + val.byx5 })
      this.picUrl = this.PicData[0].url
      console.log(this.picUrl)
    },
    cliPic(val, i) {
      this.picUrl = val.url
      this.picIdex = i
    },
    changePic(n) {
      let len = this.PicData.length - 1
      if (n == 1) {
        this.picIdex = this.picIdex <= 0 ? len : this.picIdex - 1
      } else {
        this.picIdex = this.picIdex >= len ? 0 : this.picIdex + 1
      }
      this.picUrl = this.PicData[this.picIdex].url
    }
  }
}
</script>
<style scoped lang="scss">
.infopage {
  margin: 0 20px 0 24px;
  img {
    width: 100%;
    height: 100%;
  }
  .content {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    .left {
      box-sizing: border-box;
      width: 70%;
      height: 750px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      border: 2px solid rgba(47, 141, 199, 0.5);
      background-color: rgba(1, 26, 66, 0.5);
      border-radius: 4px;
      overflow: hidden;
      .spBox {
        width: 95%;
        height: 93%;
        border: 2px solid rgba(47, 141, 199, 0.5);
        border-radius: 4px;
        overflow: hidden;
        position: relative;
        .Licon{
          width:60px;
          height:60px;
          position: absolute;
          left: 30px;
          top:50%;
          transform: translateY(-50%);
          z-index: 5;
          cursor:pointer;
        }
        .Ricon{
          width:60px;
          height:60px;
          position: absolute;
          top:50%;
          transform: translateY(-50%);
          z-index: 5;
          right: 30px;
          cursor:pointer;
        }
      }
    }
    .right {
      width: 30%;
      height: 750px;
      margin-left: 24px;
      padding: 0 20px 0 24px;
      color: #fff;
      box-sizing: border-box;
      background-color: rgba(1, 26, 66, 0.5);
      border: 2px solid rgba(47, 141, 199, 0.5);
      border-radius: 4px;
      display: flex;
      justify-content: space-around;
      align-items: center;
      .itemBox{
        width: 95%;
        height: 93%;
        overflow: auto;
        .active {
            opacity: 1 !important;
        }
        .picItem {
            display: flex;
            justify-content: start;

            height: 140px;
            opacity: 0.5;
            margin-bottom: 20px;
            .picBox {
                cursor:pointer;
                width: 60%;
                height: 142px;
                border:2px solid rgba(23, 94, 204, 0.3);
                position: relative;

                p {
                    position: absolute;
                    bottom: -18px;
                    right: -60px;
                    font-size: 14px;
                }
            }
        }
      }
      .itemBox::-webkit-scrollbar {
        display: none;
      }
    }
  }
}
</style>