|
|
@@ -0,0 +1,267 @@
|
|
|
+<template>
|
|
|
+ <div class="stair">
|
|
|
+ <!-- 左上浏览量 -->
|
|
|
+ <div class="upleft">
|
|
|
+ <div class="el-icon-arrow-left" @click="$router.push('/')">返回</div>
|
|
|
+ <div class="eye">浏览量:1235</div>
|
|
|
+ </div>
|
|
|
+ <!-- 右边村名 -->
|
|
|
+ <div class="rightCM">
|
|
|
+ <img class="name" src="../../assets/img/cunName/1001.png" alt="" />
|
|
|
+ <img class="bs" src="../../assets/img/cunName/bs.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <!-- 中间选项 -->
|
|
|
+ <div class="conMain">
|
|
|
+ <div class="row" v-for="item in data" :key="item.id">{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ <!-- 底部功能 -->
|
|
|
+ <div class="botBtn">
|
|
|
+ <div
|
|
|
+ @click="cutPage(item.id)"
|
|
|
+ class="btnRow"
|
|
|
+ v-for="item in btnData"
|
|
|
+ :key="item.id"
|
|
|
+ @mouseenter="btnDataInd = item.id"
|
|
|
+ @mouseleave="btnDataInd = null"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="
|
|
|
+ require(`@/assets/img/${item.inco}${
|
|
|
+ (btnDataInd === item.id && item.id !== 4) ||
|
|
|
+ (item.id === 4) & isShowGood ||
|
|
|
+ (btnDataAc===item.id)
|
|
|
+ ? '_active'
|
|
|
+ : ''
|
|
|
+ }.png`)
|
|
|
+ "
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <!-- 点赞的数字 -->
|
|
|
+ <p v-if="item.id === 4">{{ likeNum }}</p>
|
|
|
+ <transition v-if="item.id === 4" name="likeAddAnimate">
|
|
|
+ <div class="good" v-show="isShowGood">
|
|
|
+ <div class="pic">
|
|
|
+ <img :src="require(`@/assets/img/like_active.png`)" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="num">+1</div>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+ <!-- 鼠标移入的显示 -->
|
|
|
+ <div
|
|
|
+ class="hoverInco"
|
|
|
+ :class="{ hovAc: btnDataInd === item.id && !isShowGood }"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 简介组件 -->
|
|
|
+ <StairIntro v-if="btnDataAc===1" @close='btnDataAc=null'/>
|
|
|
+ <!-- 打卡组件 -->
|
|
|
+ <StairCard v-if="btnDataAc===2" @close='btnDataAc=null'/>
|
|
|
+ <!-- 分享组件 -->
|
|
|
+ <StairShare v-if="btnDataAc===3" @close='btnDataAc=null'/>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import StairIntro from './component/intro.vue'
|
|
|
+import StairCard from './component/card.vue'
|
|
|
+import StairShare from './component/share.vue'
|
|
|
+export default {
|
|
|
+ name: "stair",
|
|
|
+ components: {StairIntro,StairCard,StairShare},
|
|
|
+ data() {
|
|
|
+ //这里存放数据
|
|
|
+ return {
|
|
|
+ data: [
|
|
|
+ { id: 1, name: "寅宇卢公祠" },
|
|
|
+ { id: 2, name: "寅宇卢公祠" },
|
|
|
+ { id: 3, name: "寅宇卢公祠" },
|
|
|
+ { id: 4, name: "寅宇卢公祠" },
|
|
|
+ ],
|
|
|
+ btnData: [
|
|
|
+ { id: 1, name: "简介", inco: "introduction" },
|
|
|
+ { id: 2, name: "打卡", inco: "daily" },
|
|
|
+ { id: 3, name: "分享", inco: "share" },
|
|
|
+ { id: 4, name: "点赞", inco: "like" },
|
|
|
+ { id: 5, name: "资料", inco: "data" },
|
|
|
+ ],
|
|
|
+ btnDataInd: null,
|
|
|
+ btnDataAc: null,
|
|
|
+ likeNum: 0,
|
|
|
+ isShowGood: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ //监控data中的数据变化
|
|
|
+ watch: {},
|
|
|
+ //方法集合
|
|
|
+ methods: {
|
|
|
+ cutPage(id) {
|
|
|
+ // 点赞
|
|
|
+ if (id === 4) {
|
|
|
+ if (this.isShowGood) return;
|
|
|
+ this.isShowGood = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.likeNum++;
|
|
|
+ this.isShowGood = false;
|
|
|
+ }, 1800);
|
|
|
+ return;
|
|
|
+ }else {
|
|
|
+ this.btnDataAc=id
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+.stair {
|
|
|
+ position: relative;
|
|
|
+ padding: 20px 0 0 15px;
|
|
|
+ color: #fff;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: url("../../assets/img/bgs.jpg");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ .upleft {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .el-icon-arrow-left {
|
|
|
+ cursor: pointer;
|
|
|
+ border-right: 1px solid #fff;
|
|
|
+ padding-right: 15px;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+ .eye {
|
|
|
+ background: url("../../assets/img/number.png") left center no-repeat;
|
|
|
+ padding-left: 50px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .rightCM {
|
|
|
+ position: absolute;
|
|
|
+ top: 50px;
|
|
|
+ right: 20px;
|
|
|
+ .name {
|
|
|
+ width: 50px;
|
|
|
+ height: 316px;
|
|
|
+ }
|
|
|
+ .bs {
|
|
|
+ width: 42px;
|
|
|
+ height: 67px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .conMain {
|
|
|
+ height: 400px;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 170px;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ .row {
|
|
|
+ padding-top: 30px;
|
|
|
+ text-align: right;
|
|
|
+ line-height: 34px;
|
|
|
+ cursor: pointer;
|
|
|
+ width: 54px;
|
|
|
+ height: 303px;
|
|
|
+ background: url("../../assets/img/normal.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ word-wrap: break-word;
|
|
|
+ letter-spacing: 20px;
|
|
|
+ margin-top: 100px;
|
|
|
+ &:nth-of-type(2n) {
|
|
|
+ margin-top: 0;
|
|
|
+ }
|
|
|
+ &:hover {
|
|
|
+ background: url("../../assets/img/hover.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .likeAddAnimate-enter-active,
|
|
|
+ .likeAddAnimate-leave-active {
|
|
|
+ transition: all 2s ease;
|
|
|
+ }
|
|
|
+ .likeAddAnimate-enter,
|
|
|
+ .likeAddAnimate-leave {
|
|
|
+ transform: translateY(0) scale(0);
|
|
|
+ opacity: 0;
|
|
|
+ }
|
|
|
+ .likeAddAnimate-enter-to,
|
|
|
+ .likeAddAnimate-leave-to {
|
|
|
+ transform: translateY(-50px) scale(1.2);
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ .good {
|
|
|
+ position: absolute;
|
|
|
+ top: -10px;
|
|
|
+ right: 0px;
|
|
|
+ display: flex;
|
|
|
+ .pic {
|
|
|
+ width: 35px;
|
|
|
+ > img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-left: 10px;
|
|
|
+ color: #fff;
|
|
|
+ text-shadow: 0 0 10px rgba(0, 0, 0, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .botBtn {
|
|
|
+ display: flex;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 35px;
|
|
|
+ left: 30px;
|
|
|
+ .btnRow {
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ text-align: center;
|
|
|
+ width: 87px;
|
|
|
+ height: 51px;
|
|
|
+ & > img {
|
|
|
+ width: 52px;
|
|
|
+ height: 51px;
|
|
|
+ }
|
|
|
+ .hoverInco {
|
|
|
+ opacity: 0;
|
|
|
+ transform: translateY(10px);
|
|
|
+ transition: all 0.5s;
|
|
|
+ line-height: 34px;
|
|
|
+ position: absolute;
|
|
|
+ top: -45px;
|
|
|
+ left: 0;
|
|
|
+ width: 87px;
|
|
|
+ height: 41px;
|
|
|
+ background: url("../../assets/img/msg.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ }
|
|
|
+ .hovAc {
|
|
|
+ transform: translateY(0px);
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+ & > p {
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|