|
|
@@ -0,0 +1,291 @@
|
|
|
+<template>
|
|
|
+ <div class="Home">
|
|
|
+ <div class="map">地图页面,等待开发...</div>
|
|
|
+ <!-- 顶部 -->
|
|
|
+ <div class="top" :class="{ topOpen: cutArrows }">
|
|
|
+ <!-- 箭头 -->
|
|
|
+ <img
|
|
|
+ class="arrowsImg"
|
|
|
+ @click="cutArrows = !cutArrows"
|
|
|
+ src="../assets/img/arrows.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="arrows" @click="cutArrows = !cutArrows">
|
|
|
+ <div class="arrowsLeft"></div>
|
|
|
+ <div class="arrowsRight"></div>
|
|
|
+ </div>
|
|
|
+ <!-- 标题 -->
|
|
|
+ <div class="tit">
|
|
|
+ <h3>江门市中国传统村落一张图</h3>
|
|
|
+ <img src="../assets/img/search.png" alt="" @click="searchShow=true"/>
|
|
|
+ </div>
|
|
|
+ <!-- 展开后的内容 -->
|
|
|
+ <div class="main" v-show="cutArrows">
|
|
|
+ <div class="browse">浏览概况</div>
|
|
|
+ <div class="browseNum">
|
|
|
+ <div>
|
|
|
+ <p>累计浏览量</p>
|
|
|
+ <span>1000</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p>今日浏览量</p>
|
|
|
+ <span>500</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="browse browse2">详情统计</div>
|
|
|
+ <div class="detailsNum">
|
|
|
+ <div class="row" v-for="item in numData" :key="item.id">
|
|
|
+ <div class="rowLeft">{{ item.name }}</div>
|
|
|
+ <div class="rowRight">
|
|
|
+ <div class="plan">
|
|
|
+ <div :style="`width:${(item.num / maxNum) * 100}%`"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="rowNum">{{ item.num }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 点击搜索出来的页面 -->
|
|
|
+ <Search v-if="searchShow" @close='searchShow=false'/>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import Search from './Search.vue'
|
|
|
+export default {
|
|
|
+ components: {Search},
|
|
|
+ data() {
|
|
|
+ //这里存放数据
|
|
|
+ return {
|
|
|
+ cutArrows: false,
|
|
|
+ numData: [
|
|
|
+ { id: 1, name: "东宁村", num: 253 },
|
|
|
+ { id: 2, name: "东宁村", num: 353 },
|
|
|
+ { id: 3, name: "东宁村", num: 553 },
|
|
|
+ { id: 4, name: "东宁村", num: 153 },
|
|
|
+ { id: 5, name: "东宁村", num: 252 },
|
|
|
+ { id: 6, name: "东宁村", num: 212 },
|
|
|
+ { id: 7, name: "东宁村", num: 233 },
|
|
|
+ { id: 8, name: "东宁村", num: 298 },
|
|
|
+ { id: 9, name: "东宁村", num: 256 },
|
|
|
+ { id: 10, name: "东宁村", num: 353 },
|
|
|
+ { id: 11, name: "东宁村", num: 643 },
|
|
|
+ { id: 12, name: "马降龙村", num: 243 },
|
|
|
+ ],
|
|
|
+ // 数据最大值
|
|
|
+ maxNum: 0,
|
|
|
+ searchShow:true
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ //监控data中的数据变化
|
|
|
+ watch: {},
|
|
|
+ //方法集合
|
|
|
+ methods: {},
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {
|
|
|
+ let arr = [];
|
|
|
+ this.numData.forEach((v) => {
|
|
|
+ arr.push(v.num);
|
|
|
+ });
|
|
|
+ this.maxNum = arr.reduce((a, b) => (a > b ? a : b));
|
|
|
+ this.maxNum += 100;
|
|
|
+ },
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+.Home {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ max-width: 500px;
|
|
|
+ margin: 0 auto;
|
|
|
+ position: relative;
|
|
|
+ .map {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ background: url("../assets/img/homeBg.png");
|
|
|
+ }
|
|
|
+ .top {
|
|
|
+ transition: all 0.3s;
|
|
|
+ color: #fff;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ overflow: hidden;
|
|
|
+ &::before {
|
|
|
+ border-radius: 0 0 20px 20px;
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 10px);
|
|
|
+ background: rgba(202, 185, 153, 0.9);
|
|
|
+ backdrop-filter: blur(4px);
|
|
|
+ z-index: -2;
|
|
|
+ }
|
|
|
+ .arrows {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 5px;
|
|
|
+ left: 50%;
|
|
|
+ width: 70px;
|
|
|
+ height: 5px;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ &::before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: rgba(202, 185, 153, 0.9);
|
|
|
+ backdrop-filter: blur(4px);
|
|
|
+ z-index: -2;
|
|
|
+ }
|
|
|
+ & > div {
|
|
|
+ position: absolute;
|
|
|
+ right: -5px;
|
|
|
+ bottom: 0px;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border-color: transparent rgba(202, 185, 153, 0.9);
|
|
|
+ border-style: solid;
|
|
|
+ border-width: 0px 0px 5px 5px;
|
|
|
+ }
|
|
|
+ .arrowsLeft {
|
|
|
+ right: auto;
|
|
|
+ left: -5px;
|
|
|
+ border-color: rgba(202, 185, 153, 0.9) transparent;
|
|
|
+ border-width: 5px 0px 0px 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .arrowsImg {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 5px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ width: 20px;
|
|
|
+ }
|
|
|
+ .tit {
|
|
|
+ width: 100%;
|
|
|
+ height: 55px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ & > h3 {
|
|
|
+ font-size: 20px;
|
|
|
+ font-family: "SYST";
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ & > img {
|
|
|
+ width: 29px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .main {
|
|
|
+ padding-top: 15px;
|
|
|
+ width: calc(100% - 30px);
|
|
|
+ height: calc(100% - 55px);
|
|
|
+ margin: 10px auto 0;
|
|
|
+ border-top: 1px solid #fff;
|
|
|
+ .browse {
|
|
|
+ padding-left: 35px;
|
|
|
+ font-family: "SYST";
|
|
|
+ background: url("../assets/img/gaikuang.png") no-repeat left center;
|
|
|
+ background-size: 29px 29px;
|
|
|
+ }
|
|
|
+ .browse2 {
|
|
|
+ margin-top: 15px;
|
|
|
+ background: url("../assets/img/detail.png") no-repeat left center;
|
|
|
+ background-size: 29px 29px;
|
|
|
+ }
|
|
|
+ .browseNum {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 10px;
|
|
|
+ & > div {
|
|
|
+ padding-left: 35px;
|
|
|
+ width: 50%;
|
|
|
+ text-align: left;
|
|
|
+ & > p {
|
|
|
+ color: #e8e0d1;
|
|
|
+ text-align: left;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ & > span {
|
|
|
+ font-size: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .detailsNum {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 170px);
|
|
|
+ overflow-y: auto;
|
|
|
+ padding-top: 15px;
|
|
|
+ .row {
|
|
|
+ cursor: pointer;
|
|
|
+ height: 40px;
|
|
|
+ display: flex;
|
|
|
+ .rowLeft {
|
|
|
+ border-right: 1px solid #e8e0d1;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 40px;
|
|
|
+ width: 80px;
|
|
|
+ }
|
|
|
+ .rowRight {
|
|
|
+ width: calc(100% - 170px);
|
|
|
+ position: relative;
|
|
|
+ .plan {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 13px;
|
|
|
+ width: 100%;
|
|
|
+ height: 14px;
|
|
|
+ background-color: rgba(232, 224, 209, 0.8);
|
|
|
+ & > div {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .rowNum {
|
|
|
+ padding-left: 5px;
|
|
|
+ width: 90px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .topOpen {
|
|
|
+ height: 93vh;
|
|
|
+ .arrowsImg {
|
|
|
+ transform: translateX(-50%) rotate(180deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|