<template>
  <div class="pinBottom-container">
    <div class="pinBottom center">
      <div id="view-controllers"></div>
    </div>
    <div class="pinBottom left">
      <div>
        <div class="viewContainer">
          <div
            id="previous"
            class="previous desktop-only ui-icon"
            style="display: none"
          >
            <a>
              <img
                rel="tooltip"
                title=""
                :src="require('@/assets/images/play.png')"
                width="24"
                height="24"
                data-original-title="播放"
              />
            </a>
          </div>
          <div
            id="play"
            class="ui-icon"
            rel="tooltip"
            data-original-title="播放"
          >
            <a>
              <img
                title=""
                :src="require('@/assets/images/icon/play.png')"
                width="24"
                height="24"
              />
            </a>
          </div>
          <div id="pause" class="ui-icon" style="display: none">
            <a>
              <img
                rel="tooltip"
                title=""
                :src="require('@/assets/images/icon/pause.png')"
                width="24"
                height="24"
                data-original-title="暂停"
              />
            </a>
          </div>
          <div
            id="next"
            class="next desktop-only ui-icon wide"
            style="display: none"
          >
            <a>
              <i
                rel="tooltip"
                title=""
                class="icon icon-dpad-right"
                data-original-title="下一个"
              ></i>
            </a>
          </div>
          <div id="gui-modes-map" class="ui-icon double active">
            <div
              data-original-title="导览"
              @click="isGuide = !isGuide"
              id="pullTab"
              rel="tooltip"
              title=""
            >
              <img
                class="icon icon-inside"
                :src="
                  require(`@/assets/images/icon/auto${
                    !isGuide ? '_active' : ''
                  }.png`)
                "
                title="navigation icon"
              />
            </div>

            <div
              data-original-title="全景漫游"
              id="gui-modes-inside"
              rel="tooltip"
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/icon/inside.png')"
                title="navigation icon"
              />
              <img
                class="icon icon-inside active"
                :src="require('@/assets/images/icon/inside_active.png')"
                title="navigation icon"
              />
            </div>
            <div
              data-original-title="迷你模型"
              id="gui-modes-dollhouse"
              rel="tooltip"
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/icon/dollhouse.png')"
                title="navigation icon"
              />
              <img
                class="icon icon-inside active"
                :src="require('@/assets/images/icon/dollhouse_active.png')"
                title="navigation icon "
              />
            </div>
            <div
              data-original-title="俯视图"
              id="gui-modes-floorplan"
              rel="tooltip"
              title=""
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/icon/floor.png')"
                title="navigation icon"
              />
              <img
                class="active icon icon-inside active"
                :src="require('@/assets/images/icon/floor_active.png')"
                title="navigation icon"
              />
            </div>
            <div
              data-original-title="VR"
              id="vr"
              rel="tooltip"
              title=""
              style="display: none"
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/VR.png')"
                title="navigation icon"
              />
            </div>
            <!-- <div
              data-original-title="热点列表"
              id="hotList"
              rel="tooltip"
              title=""
              style="display: none"
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/hotlist.png')"
                title="navigation icon"
              />
              <img
                class="icon icon-inside active"
                :src="require('@/assets/images/hotlist.png')"
                title="navigation icon"
              />
            </div> -->
            <div
              data-original-title="消除外壳"
              id="gui-remove-face"
              rel="tooltip"
              title=""
              style="display: none; float: left"
            >
              <img
                class="icon icon-inside"
                :src="require('@/assets/images/face.jpg')"
                title="navigation icon"
              />
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="pinBottom right hideTarget">
      <div class="rightViewContainer clearfix">
        <div class="gui-floor">
          <div class="gui-floor-title"></div>
          <div class="gui-floor-icon">
            <span class="gui-floor-number"></span>
          </div>
          <div class="container"></div>
        </div>
        <div class="bgandshare">
          <div id="volume" @click="switchBGM" class="ui-icon wide">
            <div>
              <img :src="require('@/assets/images/icon/musicon.png')" />
            </div>
          </div>

          <div @click="isShare = !isShare">
            <div>
              <img
                :src="
                  require(`@/assets/images/icon/share${
                    !isShare ? 'on' : 'off'
                  }.png`)
                "
              />
            </div>
          </div>
        </div>
        <div id="vr" class="ui-icon wide hidden" style="display: none">
          <a>
            <i
              rel="tooltip"
              title="{[{ VIEW_IN_VR }]}"
              class="icon icon-webvr"
            ></i>
          </a>
        </div>
        <div id="sharing" class="ui-icon wide hidden" style="display: none">
          <a>
            <i
              rel="tooltip"
              title="{[{ SOCIAL_SHARING }]}"
              class="icon icon-share"
            ></i>
          </a>
        </div>
        <div
          id="gui-fullscreen"
          class="ui-icon wide"
          data-placement="top"
          rel="tooltip"
          title="{[{ VIEW_FULLSCREEN }]}"
        >
          <a>
            <i class="icon icon-fullscreen"></i>
          </a>
        </div>
        <div
          id="gui-fullscreen-exit"
          class="ui-icon wide"
          data-placement="top"
          rel="tooltip"
          title="{[{ EXIT_FULLSCREEN }]}"
          style="display: none"
        >
          <a>
            <i class="icon icon-fullscreen-exit"></i>
          </a>
        </div>
        <div class="pull-right terms terms2">
          <a>{[{ TERMS }]}</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      isGuide: true,
      isShare: false,
    };
  },
  computed: {},
  watch:{
    isShare(newVal){
      if (newVal) {
        this.$showShare()
      }
    }
  },
  mounted(){
      this.$bus.$on('closeShare',()=>{
        this.isShare = false
      })
  },
  methods: {
    switchBGM() {
      if ($("#volume img")[0].src.indexOf("on.png") > -1) {
        window.manage.switchBgmState(true);
      } else if ($("#volume img")[0].src.indexOf("off.png") > -1) {
        window.manage.switchBgmState(false);
      }
    },
  },
};
</script>

<style lang="less" scoped>
@wh: 90px;
@margin: 10px;
#play,
#pause {
  margin-right: @margin;
  img {
    width: @wh;
    height: @wh;
  }
}
#gui-modes-map {
  > div {
    margin-right: @margin;
    > img {
      width: @wh;
      height: @wh;
      display: block;
    }
    .active {
      display: none;
    }
  }
  .active {
    > img {
      display: none;
    }
    .active {
      display: block;
    }
  }
}

.bgandshare {
  display: flex;
  justify-content: center;
  align-items: center;
  > div {
    background: none !important;
    width: @wh!important;
    cursor: pointer;
    img {
      width: 100%;
    }
  }
}

@media only screen and (max-width: 487px) {
  @wh: 70px;
  #play,
  #pause {
    margin-right: @margin;
    img {
      width: @wh;
      height: @wh;
    }
  }
  #gui-modes-map {
    > div {
      margin-right: @margin;
      > img {
        width: @wh;
        height: @wh;
        display: block;
      }
      .active {
        display: none;
      }
    }
    .active {
      > img {
        display: none;
      }
      .active {
        display: block;
      }
    }
  }

  .bgandshare {
    display: flex;
    position: fixed;
    top: 12%;
    right: 6px;
    flex-direction: column;
    > div {
      width: @wh!important;
      img {
        width: 100%;
      }
    }
  }
}
</style>
