|
@@ -1,43 +1,150 @@
|
|
<template>
|
|
<template>
|
|
-<div class='PuCatalogues'>PuCatalogues</div>
|
|
|
|
|
|
+ <div class="PuCatalogues">
|
|
|
|
+ <div class="card">
|
|
|
|
+ <span class="page">{{ infoInd + 1 }} / {{ imgList.length }}</span>
|
|
|
|
+ <div
|
|
|
|
+ class="row"
|
|
|
|
+ v-for="(item, index) in imgList"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :style="`left:${index * 15}px;height:${100 - index * 5}%;opacity:${
|
|
|
|
+ 1 - index * 0.2 <= 0 ? 0.1 : 1 - index * 0.2
|
|
|
|
+ }; z-index: ${imgList.length - index};`"
|
|
|
|
+ >
|
|
|
|
+ <v-touch
|
|
|
|
+ @click.native="toPdf(info.id)"
|
|
|
|
+ v-if="index === 0"
|
|
|
|
+ tag="img"
|
|
|
|
+ @swipeleft="moveSwiper(1)"
|
|
|
|
+ @swiperight="moveSwiper(0)"
|
|
|
|
+ :src="info.imgUrl"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
-name:'PuCatalogues',
|
|
|
|
-components: {},
|
|
|
|
-data() {
|
|
|
|
-//这里存放数据
|
|
|
|
-return {
|
|
|
|
-
|
|
|
|
|
|
+ name: "PuCatalogues",
|
|
|
|
+ components: {},
|
|
|
|
+ data() {
|
|
|
|
+ //这里存放数据
|
|
|
|
+ return {
|
|
|
|
+ imgList: [
|
|
|
|
+ {
|
|
|
|
+ id: 1,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/1.jpg",
|
|
|
|
+ name: "A_brief_history_of_Beijing.pdf",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 2,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/2.jpg",
|
|
|
|
+ name: "Geneva.pdf",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 3,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/3.jpg",
|
|
|
|
+ name: "Renaissance.pdf",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 4,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/4.jpg",
|
|
|
|
+ name: "TheMetropolisesandtheProsperities.pdf",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 5,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/5.jpg",
|
|
|
|
+ name: "Andes.pdf",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 6,
|
|
|
|
+ imgUrl: "/data/Publications/Exhibition/6.jpg",
|
|
|
|
+ name: "smileofkhmer.pdf",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ info: {},
|
|
|
|
+ infoInd: 0,
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ //监听属性 类似于data概念
|
|
|
|
+ computed: {},
|
|
|
|
+ //监控data中的数据变化
|
|
|
|
+ watch: {},
|
|
|
|
+ //方法集合
|
|
|
|
+ methods: {
|
|
|
|
+ toPdf(id) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "PublicationsPdf",
|
|
|
|
+ query: { id },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 封装一个滑动的方法
|
|
|
|
+ moveSwiper(val) {
|
|
|
|
+ let dom = document.querySelector(".card");
|
|
|
|
+ dom.style.opacity = 0;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if (val === 0) {
|
|
|
|
+ // 右滑减小
|
|
|
|
+ if (this.infoInd === 0) this.infoInd = this.imgList.length - 1;
|
|
|
|
+ else this.infoInd--;
|
|
|
|
+ } else {
|
|
|
|
+ //左滑增加
|
|
|
|
+ if (this.infoInd < this.imgList.length - 1) this.infoInd++;
|
|
|
|
+ else this.infoInd = 0;
|
|
|
|
+ }
|
|
|
|
+ this.info = this.imgList[this.infoInd];
|
|
|
|
+ dom.style.opacity = 1;
|
|
|
|
+ }, 300);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
|
+ created() {
|
|
|
|
+ this.info = this.imgList[this.infoInd];
|
|
|
|
+ },
|
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
|
+ mounted() {},
|
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
};
|
|
};
|
|
-},
|
|
|
|
-//监听属性 类似于data概念
|
|
|
|
-computed: {},
|
|
|
|
-//监控data中的数据变化
|
|
|
|
-watch: {},
|
|
|
|
-//方法集合
|
|
|
|
-methods: {
|
|
|
|
-
|
|
|
|
-},
|
|
|
|
-//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
|
-created() {
|
|
|
|
-
|
|
|
|
-},
|
|
|
|
-//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
|
-mounted() {
|
|
|
|
-
|
|
|
|
-},
|
|
|
|
-beforeCreate() {}, //生命周期 - 创建之前
|
|
|
|
-beforeMount() {}, //生命周期 - 挂载之前
|
|
|
|
-beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
|
-updated() {}, //生命周期 - 更新之后
|
|
|
|
-beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
|
-destroyed() {}, //生命周期 - 销毁完成
|
|
|
|
-activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
|
-}
|
|
|
|
</script>
|
|
</script>
|
|
<style lang='less' scoped>
|
|
<style lang='less' scoped>
|
|
-//@import url(); 引入公共css类
|
|
|
|
-
|
|
|
|
|
|
+.PuCatalogues {
|
|
|
|
+ background-color: #f7f6f3;
|
|
|
|
+ padding: 20px 20px 40px;
|
|
|
|
+ .card {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 400px;
|
|
|
|
+ position: relative;
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
+ .page {
|
|
|
|
+ position: absolute;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ right: 0px;
|
|
|
|
+ bottom: 0px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+ .row {
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
+ width: 80%;
|
|
|
|
+ height: 400px;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ box-shadow: 0px 1px 4px 3px #ccc;
|
|
|
|
+ & > img {
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|