Browse Source

0613效果图

master
xuhuajiao 8 months ago
parent
commit
ddb14b1bd7
  1. BIN
      src/assets/images/location.png
  2. 108
      src/assets/json/lib.json
  3. 23
      src/assets/json/lib2.json
  4. 12
      src/assets/styles/index.scss
  5. 16
      src/main.js
  6. 1
      src/views/header/index.vue
  7. 415
      src/views/index.vue
  8. 977
      src/views/map/index.vue
  9. 795
      src/views/map/index2.vue
  10. 210
      src/views/pageOne/index.vue

BIN
src/assets/images/location.png

After

Width: 64  |  Height: 64  |  Size: 2.6 KiB

108
src/assets/json/lib.json

@ -0,0 +1,108 @@
[
{
"name": "陶铸图书馆",
"value": [111.848657, 26.588519],
"place": "祁阳县茅竹镇"
},
{
"name": "龙山街道分馆",
"value": [111.86478,26.599231],
"place": "祁阳县茅竹镇"
},
{
"name": "黎家坪分馆",
"value": [111.823424,26.693962],
"place": "祁阳县茅竹镇"
},
{
"name": "大村甸分馆",
"value": [111.77655,26.663866],
"place": "祁阳县茅竹镇"
},
{
"name": "邵家岭自助馆",
"value": [111.856979,26.59469],
"place": "祁阳县茅竹镇"
},
{
"name": "下马渡分馆",
"value": [111.895584,26.611702],
"place": "祁阳县茅竹镇"
},
{
"name": "复兴路自助馆",
"value": [111.843102,26.57896],
"place": "祁阳县茅竹镇"
},
{
"name": "七里桥分馆",
"value": [111.902703,26.571593],
"place": "祁阳县茅竹镇"
},
{
"name": "少儿馆",
"value": [111.842537,26.58196],
"place": "祁阳县茅竹镇"
},
{
"name": "茅竹镇分馆",
"value": [111.796508,26.510589],
"place": "祁阳县茅竹镇"
},
{
"name": "观音滩镇分馆",
"value": [111.897118,26.48444],
"place": "祁阳县茅竹镇"
},
{
"name": "凯俊盛科城分馆",
"value": [111.851548,26.550191],
"place": "祁阳县茅竹镇"
},
{
"name": "进宝塘镇分馆",
"value": [112.085297,26.436849],
"place": "祁阳县茅竹镇"
},
{
"name": "三口塘镇分馆",
"value": [111.819018,26.412155],
"place": "祁阳县茅竹镇"
},
{
"name": "肖家镇分馆",
"value": [112.009764,26.355137],
"place": "祁阳县茅竹镇"
},
{
"name": "潘市镇分馆",
"value": [112.051186,26.489878],
"place": "祁阳县茅竹镇"
},
{
"name": "大忠桥镇分馆",
"value": [111.873254,26.369761],
"place": "祁阳县茅竹镇"
},
{
"name": "浯溪街道分馆",
"value": [111.855175,26.574414],
"place": "祁阳县茅竹镇"
},
{
"name": "长虹街道分馆",
"value": [111.850902,26.586461],
"place": "长虹街道"
},
{
"name": "白水镇分馆",
"value": [111.989802,26.421353],
"place": "白水镇"
},
{
"name": "白竹湖自助馆",
"value": [111.862001,26.580311],
"place": "白竹湖"
}
]

23
src/assets/json/lib2.json

@ -0,0 +1,23 @@
{
"陶铸图书馆":[111.848657, 26.588519],
"龙山街道分馆":[111.86478,26.599231],
"黎家坪分馆": [111.823424,26.693962],
"大村甸分馆": [111.77655,26.663866],
"邵家岭自助馆":[111.856979,26.59469],
"下马渡分馆":[111.895584,26.611702],
"复兴路自助馆":[111.843102,26.57896],
"七里桥分馆": [111.902703,26.571593],
"少儿馆":[111.842537,26.58196],
"茅竹镇分馆":[111.796508,26.510589],
"观音滩镇分馆":[111.897118,26.48444],
"凯俊盛科城分馆":[111.851548,26.550191],
"进宝塘镇分馆":[112.085297,26.436849],
"三口塘镇分馆":[111.819018,26.412155],
"肖家镇分馆":[112.009764,26.355137],
"潘市镇分馆": [112.051186,26.489878],
"大忠桥镇分馆":[111.873254,26.369761],
"浯溪街道分馆":[111.855175,26.574414],
"长虹街道分馆":[111.850902,26.586461],
"白水镇分馆": [111.989802,26.421353],
"白竹湖自助馆":[111.862001,26.580311]
}

12
src/assets/styles/index.scss

@ -9,6 +9,18 @@
overflow: hidden;
}
.loading{
position: fixed;
top: 1.125rem;
width: 100%;
height:100%;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0,0,0,0.9);
z-index: 99999999;
}
// 头部主题标题
.header-container{
position: relative;

16
src/main.js

@ -38,6 +38,22 @@ Vue.prototype.$echarts = echarts
import scroll from 'vue-seamless-scroll'
Vue.use(scroll)
import {
loading,
borderBox8,
decoration3,
decoration5,
decoration10,
activeRingChart
} from '@jiaminghi/data-view'
Vue.use(loading)
Vue.use(borderBox8)
Vue.use(decoration3)
Vue.use(decoration5)
Vue.use(decoration10)
Vue.use(activeRingChart)
Vue.config.productionTip = false
Vue.component(Message.name, Message)
new Vue({

1
src/views/header/index.vue

@ -26,6 +26,7 @@
<iframe id="weather" width="400" scrolling="no" height="30" frameborder="0" allowtransparency="true" src="https://i.tianqi.com?c=code&id=34&color=%23FFFFFF&icon=1&py=wuhan&site=18" />
</div>
<div class="header-text header-date">{{ nowDate }}</div>
</div>
</template>

415
src/views/index.vue

@ -1,308 +1,205 @@
<template>
<div id="screen-container">
<div v-if="isLoading" class="loading">
<dv-loading>Loading...</dv-loading>
</div>
<Header :header-title="headerTitle" />
<swiper ref="mySwiperHome" class="swiper" :options="swiperOption">
<!-- <swiper-slide v-for="(item,index) in displayedImages" :key="index" /> -->
<swiper-slide class="slide">
<div id="tagcloud1" class="tagcloud">
<div>自动驾驶</div>
<a href="##">辅助驾驶</a>
<div>AEB</div>
<div href="##"><p>路测</p></div>
<div href="##">量子芯片</div>
<i>光速</i>
<div href="##">激光雷达</div>
<b>纳米科技</b>
<a href="##">电子信息</a>
<a href="##">超级计算机</a>
<div>自动驾驶</div>
<a href="##">辅助驾驶</a>
<div>AEB</div>
<div href="##"><p>路测</p></div>
<div href="##">量子芯片</div>
<i>光速</i>
<div href="##">激光雷达</div>
<b>纳米科技</b>
<a href="##">电子信息</a>
<a href="##">超级计算机</a>
</div>
<div class="container">
<p>第一行书</p>
<!-- <div id="e" class="roll-wrap roll_row">
<ul class="roll__list" style="position: absolute; left: 0; top: 0;">
<li v-for="(item,index) in list" :key="index">{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</li>
</ul>
</div> -->
<div class="swiper-container seamless01-swiper">
<div class="swiper-wrapper">
<div v-for="(item,index) in list" :key="index" class="swiper-slide">{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</div>
</div>
</div>
<p>第二行书</p>
<!-- <div id="f" class="roll-wrap roll_row">
<ul class="roll__list" :style="{'position': 'absolute', 'right': 0,'top': 0, 'width': list.length*60 + 'px'} ">
<li v-for="(item,index) in list" :key="index">
{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</li>
</ul>
</div> -->
<div class="swiper-container seamless02-swiper">
<div class="swiper-wrapper">
<div v-for="(item,index) in list" :key="index" class="swiper-slide">{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</div>
</div>
</div>
</div>
</swiper-slide>
<swiper-slide class="slide">
<Map ref="mapRefs" />
</swiper-slide>
<swiper-slide class="slide">
<div>第三屏</div>
<div style="position: fixed; right: 40px; top: 10px; font-size: .4rem;">{{ active +' / '+ pageData.length }}</div>
<!-- <swiper ref="mySwiperHome" class="swiper-home" :options="swiperOption">
<swiper-slide v-for="(item,index) in pageData" :key="index" class="slide">
<PageOne v-if="item.name==='page1'" />
<Map v-if="item.name==='page2'" ref="mapRefs" />
<div v-if="item.name==='page3'">第三屏</div>
</swiper-slide>
<div slot="pagination" class="swiper-pagination-home" />
</swiper>
</swiper> -->
<section ref="sectionRef">
<!-- <keep-alive> -->
<PageOne
v-if="active === 1"
ref="user"
:height="height"
:fullscreen="fullscreen"
/>
<Map
v-if="active === 2"
:height="height"
:fullscreen="fullscreen"
/>
<div v-if="active === 3">第三屏</div>
<div v-if="active === 4">第四屏</div>
<!-- </keep-alive> -->
</section>
</div>
</template>
<script>
import Header from '@/views/header/index.vue'
import PageOne from '@/views/pageOne/index.vue'
import Map from '@/views/map/index.vue'
import data from '../views/newBookRecommend/data.json'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
export default {
name: 'Home',
components: {
Header,
Map,
swiper,
swiperSlide
PageOne,
Map
},
data() {
const _self = this
return {
active: 2,
isLoading: false,
fullscreen: false,
height: '',
headerTitle: '祁阳图书馆',
list: [],
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
swiperOption: {
loop: true,
initialSlide: 0,
notNextTick: false,
observer: true, //
speed: 2000,
autoplay: {
delay: 10000, // ms
stopOnLastSlide: true, // slide
disableOnInteraction: false // swiperautoplay
// reverseDirection: true //
// waitForTransition: true, //slide
pageData: [
{
id: 1, title: 'page1', delayed: 10
},
direction: 'vertical',
//
pagination: {
el: '.swiper-pagination-home',
type: 'fraction'
{
id: 2, title: 'page2', delayed: 0
},
on: {
slideChangeTransitionEnd() {
console.log(' this.activeIndex-index', this.activeIndex)
$('#e').rollNoInterval().left()
$('#f').rollNoInterval().right()
_self.addAnimationClass(this.activeIndex)
}
{
id: 3, title: 'page3', delayed: 10
},
{
id: 4, title: 'page4', delayed: 0
}
},
mySwipera1: null,
mySwipera2: null
],
swiperOption: null,
pageIndex: 0,
timer: null,
timer2: null
}
},
computed: {
swiper() {
return this.$refs.mySwiperHome.swiper
}
},
created() {
this.list = data
const METAWA = require('../assets/js/META.common.min.js')
const meta = new METAWA('665e845538d68')
meta.callback = (r) => {
console.log(r, '回调')
}
// const METAWA = require('../assets/js/META.common.min.js')
// const meta = new METAWA('665e845538d68')
// meta.callback = (r) => {
// console.log(r, '')
// }
},
beforeDestroy() {
clearInterval(this.timer2)
window.removeEventListener('resize', this.setElementHeight)
},
mounted() {
tagCloud({
selector: '#tagcloud1', // id class
fontsize: 26, // , 16px
radius: 260, // /, 60px60[60][60, 60]
mspeed: 'normal', // , : slow, normal(), fast
ispeed: 'normal', // , : slow, normal(), fast
direction: 135, // , (360): 0top, 90left, 135right-bottom()...
keep: false, // , : false, true() ,
multicolour: true // true(),false
this.showLoading()
this.setElementHeight()
window.addEventListener('resize', this.setElementHeight)
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer2)
window.removeEventListener('resize', this.setElementHeight)
})
// $('#e').rollNoInterval().left()
// $('#f').rollNoInterval().right()
// this.mySwipera1 = new Swiper('.seamless01-swiper', {
// observer: true, // swiperslide
// observeParents: true, // Swiper /
// speed: 4000, //
// loop: true, //
// slidesPerView: 4, //
// spaceBetween: 10, //
// freeMode: true, //
// autoplay: { //
// delay: 0, //
// stopOnLastSlide: false, // slide
// disableOnInteraction: false//
// },
// breakpoints: {
// 750: { // 320
// slidesPerView: 3
// }
// }
// })
// this.mySwipera2 = new Swiper('.seamless02-swiper', {
// observer: true, // swiperslide
// observeParents: true, // Swiper /
// speed: 4000, //
// loop: true, //
// slidesPerView: 4, //
// spaceBetween: 10, //
// freeMode: true, //
// autoplay: { //
// delay: 0, //
// stopOnLastSlide: false, // slide
// disableOnInteraction: false, //
// reverseDirection: true//
// },
// breakpoints: {
// 750: { // 320
// slidesPerView: 3
// }
// }
// })
// this.autoPagination()
},
methods: {
addAnimationClass(activeIndex) {
this.$nextTick(() => {
const swiper = this.$refs.mySwiperHome.swiper
if (swiper) {
const slides = swiper.slides
const nextSlide = slides.eq(2)
if (activeIndex === 2) {
nextSlide.find('.place-point').children().addClass('bouncePoint')
this.$refs.mapRefs.isPage2 = true
this.$refs.mapRefs.libIndex = 0
this.$refs.mapRefs.libCurrent = this.$refs.mapRefs.libInfoData[this.$refs.mapRefs.libIndex]
this.$refs.mapRefs.init()
this.$refs.mapRefs.updatePageWithData()
autoPagination() {
this.timer2 = setInterval(() => {
setTimeout(() => {
if (this.active >= this.pageData.length) {
this.active = 1
} else {
this.$refs.mapRefs.isPage2 = false
nextSlide.find('.place-point').children().removeClass('bouncePoint')
this.active++
}
}
// this.showLoading()
}, 0)
}, 6000)
this.$once('hook:beforeDestroy', () => {
clearInterval(this.timer2)
})
},
showLoading() {
this.isLoading = true
this.timer = setTimeout(() => {
this.isLoading = false
window.clearTimeout(this.timer)
}, 1500)
},
// DOM
setElementHeight() {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.showLoading()
this.height = `${(this.$refs.sectionRef.offsetHeight - 30) / 3}px`
}, 100)
}
// init() {
// const _self = this
// this.swiperOption = {
// loop: false,
// initialSlide: _self.pageIndex,
// observer: true, // swiperswiper
// observeParents: true, // swiperswiper
// notNextTick: false,
// speed: 1500,
// autoplay: {
// delay: 10000, // ms
// stopOnLastSlide: false, // slide
// disableOnInteraction: false // swiperautoplay
// // reverseDirection: true //
// // waitForTransition: true, //slide
// },
// direction: 'vertical',
// //
// pagination: {
// el: '.swiper-pagination-home',
// type: 'fraction'
// },
// on: {
// slideChangeTransitionEnd() {
// console.log(' this.activeIndex-index', this.realIndex)
// _self.pageIndex = this.realIndex
// _self.addAnimationClass(this.realIndex)
// }
// }
// }
// },
// addAnimationClass(realIndex) {
// this.$nextTick(() => {
// const swiper = this.$refs.mySwiperHome.swiper
// if (swiper) {
// const slides = swiper.slides
// const nextSlide = slides.eq(2)
// if (realIndex === 1) {
// // nextSlide.find('.place-point').children().addClass('bouncePoint')
// this.$nextTick(() => {
// console.log(this.$refs.mapRefs.initChart)
// this.$refs.mapRefs.isPage2 = true
// this.$refs.mapRefs.count = 0
// this.$refs.mapRefs.initChart()
// this.$refs.mapRefs.updateChart()
// })
// } else {
// this.$refs.mapRefs.isPage2 = false
// nextSlide.find('.place-point').children().removeClass('bouncePoint')
// }
// }
// })
// }
}
}
</script>
<style lang="scss">
@import "~@/assets/styles/index.scss";
::v-deep .swiper-wrapper{
transition-timing-function: ease-in-out !important;
}
.tagcloud {
width: 5.5rem;
height: 5rem;
margin: .2rem;
margin-left: .3rem;
overflow: hidden;
}
a {
text-decoration: none;
cursor: pointer;
}
// .tagcloud>* {
// display: inline;
// white-space: nowrap;
// }
.container{
margin-left: .3rem;
width: 5.5rem;
p{
margin-top: .2rem;
.swiper-home{
.swiper-wrapper{
transition-timing-function: ease-in-out !important;
}
}
/* seamlesswrap */
.seamlesswrap{width: 100%;box-sizing: border-box;padding: 200px;}
.seamlesswrap img{width: 100%;display: block;}
.seamlesswrap .swiper-container-free-mode>.swiper-wrapper{
-webkit-transition-timing-function:linear!important;
-o-transition-timing-function:linear!important;
transition-timing-function:linear!important; }
.seamlesswrap .swiper-container{margin: 10px 0;}
.roll-wrap{
.swiper-slide{
position: relative;
width: 100%;
height: 100px;
// height: calc(100vh - 1.125rem) !important;
overflow: hidden;
}
.roll_row .roll__list{
display: flex;
flex-wrap: nowrap;
border: 1px solid red;
}
.roll_row .roll__list li{
display: block;
margin-right: 20px;
width: .5rem;
font-weight: bold;
font-size: .3rem;
text-align: center;
}
.book-img{
width: .5rem;
height: .5rem;
background: url('~@/assets/images/default-img.png') no-repeat center center;
background-size: contain;
display: flex;
align-items: center;
overflow: hidden;
img{
display: block;
width: 100%;
}
.swiper-pagination-home{
position: fixed;
top: .2rem;
left: calc( 100% - 2rem);
font-size: .4rem;
}
}
.swiper-slide{
width: 100%;
height: calc(100vh - 1.125rem);
overflow: hidden;
}
.swiper-pagination-home{
position: fixed;
top: .2rem;
left: calc( 100% - 2rem);
font-size: .4rem;
}
</style>

977
src/views/map/index.vue
File diff suppressed because it is too large
View File

795
src/views/map/index2.vue

@ -1,226 +1,194 @@
<template>
<div id="screen-container">
<Header :header-title="headerTitle" />
<div style="width:100%; height:calc( 100vh - 1.125rem); overflow: hidden;">
<!-- <svg-icon icon-class="map" style="width: 100%; height: 100%; " /> -->
<div ref="chart" class="content" style="width: 100%; height: 100%; " />
<div style="position: relative;">
<!-- <Header :header-title="headerTitle" /> -->
<div style="display: flex; justify-content: center; align-items: center; width: 100%; height:calc(100vh - 1.125rem); border: 1px solid red; overflow: hidden;">
<div style="width:6.21rem; height:8.61rem; position: relative; overflow: hidden;">
<!-- <svg-icon icon-class="map" style="width: 100%; height: 100%; " /> -->
<img class="map_img" src="@/assets/images/map.png" alt="">
<div class="place-point">
<div v-for="(item,index) in libInfoData" v-show="libIndex===index" :key="index" :class="['point'+ parseInt(index+1)]" style="position: absolute">
<p style="font-size: .14rem; ">{{ item.name }}</p>
<span class="iconfont icon-weizhi" />
<div class="pulse" />
</div>
</div>
</div>
</div>
<div class="lib-info">
<div class="lib-title">{{ libCurrent && libCurrent.name }}</div>
图片切换{{ currentIndex+1 }}
<swiper v-if="swiperOption" :key="swiperKey" ref="mySwiper" class="swiperLib" :options="swiperOption">
<swiper-slide v-for="(item,index) in displayedImages" :key="index">
<div class="book-img" style="width: 100%; height: 3rem;">
<img :src="item.cover" :onerror="defaultImg" style="width: 100%;">
</div>
</swiper-slide>
<!-- 标页码 -->
<div slot="pagination" class="swiper-pagination" />
</swiper>
<div class="lib-content">
<span>藏书量4787</span>
<span>办证量74</span>
<span>占地面积40平方米</span>
<p>关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知关于XXX的通知</p>
</div>
</div>
<div class="read-num">
<div class="lib-title">{{ libCurrent && libCurrent.name }}</div>
<h6>读者数量</h6>
<h6>借阅TOP10</h6>
</div>
</div>
</template>
<script>
import Header from '@/views/header/index.vue'
import mapJson from '@/assets/json/qy.json'
import { debounce } from 'lodash' // js,
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
export default {
components: {
Header
swiper,
swiperSlide
},
data() {
return {
isPage2: false,
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
timeTicket: null,
count: 0,
len: 0, // count % len [0, len-1]
headerTitle: '祁阳图书馆'
headerTitle: '祁阳图书馆',
libInfoData: [
{ 'id': '1', 'name': '龙山街道分管' }, { 'id': '2', 'name': '黎家坪分馆' }, { 'id': '3', 'name': '大村甸分馆' }, { 'id': '4', 'name': '陶铸图书馆' }, { 'id': '5', 'name': '邵家岭自助馆' }, { 'id': '6', 'name': '下马渡分馆' }, { 'id': '7', 'name': '复兴路自助馆' }, { 'id': '8', 'name': '七里桥分馆' }, { 'id': '9', 'name': '少儿馆' }, { 'id': '10', 'name': '茅竹镇分馆' }, { 'id': '11', 'name': '观音滩镇分馆' },
{ 'id': '12', 'name': '凯俊盛科城分馆' }, { 'id': '13', 'name': '进宝塘镇分馆' }, { 'id': '14', 'name': '三口塘镇分馆' }, { 'id': '15', 'name': '肖家镇分馆' }, { 'id': '16', 'name': '潘市镇分馆' }, { 'id': '17', 'name': '大忠桥镇分馆' }, { 'id': '18', 'name': '浯溪街道分馆' }, { 'id': '19', 'name': '长虹街道分馆' }, { 'id': '20', 'name': '白水镇分馆' }, { 'id': '21', 'name': '白竹湖自助馆' }
],
libImg: [
{
'id': 1,
'cover': require('../../assets/images/lib.jpg')
},
{
'id': 2,
'cover': require('../../assets/images/lib2.jpg')
},
{
'id': 3,
'cover': require('../../assets/images/lib3.jpg')
},
{
'id': 4,
'cover': require('../../assets/images/lib4.jpg')
},
{
'id': 5,
'cover': require('../../assets/images/lib5.jpg')
}
],
libIndex: 0,
libCurrent: null,
swiperKey: 1,
currentIndex: 0,
displayedImages: [],
swiperOption: null
}
},
computed: {
swiper() {
return this.$refs.mySwiper.swiper
}
},
beforeDestroy() {
clearTimeout(this.timeTicket)
window.removeEventListener('resize', this.resize)
},
mounted() {
this.initChart() //
this.updateChart() //
this.mouseMove() //
window.addEventListener('resize', debounce(this.resize, 2000)) // 使
// this.libCurrent = this.libInfoData[this.libIndex]
this.init()
},
methods: {
initChart() {
this.$echarts.registerMap('qiyang', mapJson) // map
this.myChart = this.$echarts.init(this.$refs.chart) // echarts
updatePageWithData() {
console.log('update')
console.log('_self.isPage22222', this.isPage2)
if (!this.isPage2) {
return false
}
//
const displayCountOptions = [1, 2, 3, 5]
const displayCount = displayCountOptions[Math.floor(Math.random() * displayCountOptions.length)]
const initOption = {
backgroundColor: '#fff',
geo: { // 2D
show: false, // 2D
map: 'centerMap',
roam: false, //
layoutCenter: ['50%', '47%'], //
layoutSize: '90%', //
aspectScale: 0.78, //
zlevel: 1
// libImg
const shuffledLibImg = this.libImg.slice().sort(() => Math.random() - 0.5) //
this.displayedImages = shuffledLibImg.slice(0, displayCount)
this.currentIndex = 0
this.swiperKey += 1
console.log(this.displayedImages)
if (this.displayedImages.length === 1) {
setTimeout(() => {
this.libIndex++
this.libCurrent = this.libInfoData[this.libIndex]
this.updatePageWithData()
}, 3000)
}
},
init() {
const _self = this
this.swiperOption = {
// loop: true,
// initialSlide: 0,
notNextTick: false, // notNextTicknotNextTicktrueNextTickswiperswiper使swipertrue
// slidesPerView: 3, //
// spaceBetween: 30, //
// slidesPerGroup: 1, //
//
noSwiping: true,
observer: true, //
direction: 'horizontal', // vertical
// grabCursor: true, //
// setWrapperSize: true,
// autoHeight: true,
// centeredSlides: true,
// paginationClickable: true,
// keyboard: true, //
// mousewheelControl: true, //
autoplay: {
delay: 3000, // ms
stopOnLastSlide: false, // slide
disableOnInteraction: false // swiperautoplay
// reverseDirection: false, //
// waitForTransition: true, //slide
},
geo3D: { // 3D
show: true, // 3D
map: 'centerMap',
top: '-20',
regionHeight: 16, //
label: {
show: true,
borderRadius: 0,
distanca: 0,
textStyle: {
fontSize: 14,
color: '#C23531', //
borderWidth: 1,
borderColor: '#FFFF10'
}
},
itemStyle: {
//
color: 'rgba(252,85,49, 0.5)', //
opacity: 1, // [ default: 1 ]
borderWidth: 2, // (线) [ default: 0 ]
borderColor: '#FFF500' // [ default: #333 ]
},
emphasis: {
label: {
show: true,
color: '#fff000'
},
itemStyle: {
color: '#ff0',
opacity: 0.5
//
pagination: {
el: '.swiper-pagination',
type: 'progressbar'
// progressbarOpposite: true,
// clickable: true //
},
on: {
slideChangeTransitionEnd() {
if (_self.isPage2) {
_self.$refs.mySwiper.swiper.update()
_self.$refs.mySwiper.swiper.autoplay.start()
} else {
_self.$refs.mySwiper.swiper.autoplay.stop()
}
},
light: {
//
main: {
color: '#FFFFFF', //
intensity: 2, //
shadowQuality: 'light', //
shadow: true, //
alpha: 50,
beta: 10
console.log(' this.activeIndex', this.activeIndex)
console.log('_self.libIndex', _self.libIndex)
_self.currentIndex = this.activeIndex
if (_self.currentIndex === _self.displayedImages.length - 1) {
setTimeout(() => {
if (_self.libIndex === _self.libInfoData.length - 1) {
_self.libIndex = 0
} else {
_self.libIndex++
}
_self.libCurrent = _self.libInfoData[_self.libIndex]
_self.updatePageWithData()
_self.currentIndex = 0
}, 3000)
}
},
viewControl: {
'projection': 'perspective',
'autoRotate': false,
'distance': 208, //
'alpha': 72, //
'beta': 2, //
rotateSensitivity: 0, //
panSensitivity: 0, //
zoomSensitivity: 0 //
},
zlevel: 2
},
series: [
{ // 使2D
type: 'effectScatter',
coordinateSystem: 'geo',
zlevel: 3,
rippleEffect: { //
period: 4, //
brushType: 'fill', // stroke, fill
scale: 10 //
},
symbol: 'circle',
symbolSize: function(val) {
return (5 + val[2] * 5) / 150 //
},
itemStyle: {
normal: {
show: true,
color: '#F41C19'
}
},
data: []
}
]
}
this.myChart.setOption(initOption)
},
updateChart() {
//
const mapData = mapJson.features.map((item) => {
return {
name: item.properties.name,
value: Math.round(Math.random() * 100),
centroid: item.properties.centroid,
adcode: item.properties.adcode
}
})
//
const scatterData = mapData.map((item) => {
return {
name: item.name,
value: item.centroid
? item.centroid.concat(item.value)
: item.centroid, // [, , ]
itemStyle: {
color: 'red'
}
// adcode: item.adcode,
}
})
const updateOption = {
series: [
{
data: mapData // type: 'map'
},
{
data: scatterData // type: 'effectScatter'
}
]
}
this.len = updateOption.series[1].data.length //
this.myChart.setOption(updateOption)
this.autohover()
},
mouseMove() {
//
this.myChart.on('mouseover', (params) => {
clearInterval(this.timeTicket)
this.myChart.dispatchAction({
type: 'downplay',
seriesIndex: 1
})
this.myChart.dispatchAction({
type: 'highlight',
seriesIndex: 1,
dataIndex: params.dataIndex
})
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: params.dataIndex
})
})
//
this.myChart.on('mouseout', this.autohover)
},
autohover() {
clearInterval(this.timeTicket)
this.timeTicket = setInterval(() => {
// 1.
this.myChart.dispatchAction({
type: 'downplay',
seriesIndex: 1
})
// 2.
this.myChart.dispatchAction({
type: 'highlight',
seriesIndex: 1,
dataIndex: this.count % this.len
})
// 3.
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: this.count % this.len
})
this.count++
}, 2000)
},
resize() {
this.myChart.resize()
}
}
}
@ -229,4 +197,441 @@ export default {
<style lang="scss">
@import "~@/assets/styles/index.scss";
.map_img{
display: block;
width: 100%;
height: 100%;
margin: 0 auto;
}
.place-point{
position: relative;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
.iconfont{
font-size: .3rem;
color: yellow;
}
.bouncePoint{
-webkit-animation-name: bounce;
-moz-animation-name: bounce;
-o-animation-name: bounce;
-ms-animation-name: bounce;
animation-name: bounce;
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
-o-animation-fill-mode: both;
-ms-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-o-animation-duration: 1s;
-ms-animation-duration: 1s;
animation-duration: 1s;
}
.point1{
left: 10px;
top: 40px;
}
.point2{
left: 90px;
top: 80px;
}
.point3{
left: 133px;
top: 138px;
}
.point4{
left: 127px;
top: 206px;
}
.point5{
left: 171px;
top: 277px;
}
.point6{
left: 176px;
top: 370px;
}
.point7{
left: 297px;
top: 424px;
}
.point8{
left: 264px;
top: 485px;
}
.point9{
left: 374px;
top: 624px;
}
.point10{
right: 49px;
bottom: 133px;
}
.point11{
right: 86px;
bottom: 251px;
}
.point12{
right: 66px;
bottom: 304px;
}
.point13{
right: 16px;
top: 254px;
}
.point14{
right: 124px;
top: 220px;
}
.point15{
right: 124px;
top: 174px;
}
.point16{
right: 169px;
top: 264px;
}
.point17{
right: 239px;
top: 170px;
}
.point18{
right: 229px;
top: 120px;
}
.point19{
right: 280px;
top: 80px;
}
.point20{
right: 289px;
top:40px;
}
.point21{
right: 380px;
top:10px;
}
}
.lib-info{
position: absolute;
left: 1rem;
top: 2rem;
width: 400px;
border: 1px solid #fff;
.lib-content{
font-size: .2rem;
}
}
.lib-title{
line-height: .45rem;
text-align: center;
}
.read-num{
position: absolute;
right: 1rem;
top: 2rem;
width: 200px;
height: 600px;
border: 1px solid #fff;
}
.pulse {
background: rgba(0,0,0,0.2);
border-radius: 50%;
height: 14px;
width: 14px;
margin: -9px 0 0 5px;
-webkit-transform: rotateX(55deg);
-moz-transform: rotateX(55deg);
-o-transform: rotateX(55deg);
-ms-transform: rotateX(55deg);
transform: rotateX(55deg);
z-index: -2;
}
.pulse:after {
content: "";
border-radius: 50%;
height: 40px;
width: 40px;
position: absolute;
margin: -13px 0 0 -13px;
-webkit-animation: pulsate 1s ease-out;
-moz-animation: pulsate 1s ease-out;
-o-animation: pulsate 1s ease-out;
-ms-animation: pulsate 1s ease-out;
animation: pulsate 1s ease-out;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
-ms-animation-iteration-count: infinite;
animation-iteration-count: infinite;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-box-shadow: 0 0 1px 2px #89849b;
box-shadow: 0 0 1px 2px #89849b;
-webkit-animation-delay: 1.1s;
-moz-animation-delay: 1.1s;
-o-animation-delay: 1.1s;
-ms-animation-delay: 1.1s;
animation-delay: 1.1s;
}
@-moz-keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
-moz-transform: scale(0.1, 0.1);
-o-transform: scale(0.1, 0.1);
-ms-transform: scale(0.1, 0.1);
transform: scale(0.1, 0.1);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
50% {
opacity: 1;
-ms-filter: none;
filter: none;
}
100% {
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
}
@-webkit-keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
-moz-transform: scale(0.1, 0.1);
-o-transform: scale(0.1, 0.1);
-ms-transform: scale(0.1, 0.1);
transform: scale(0.1, 0.1);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
50% {
opacity: 1;
-ms-filter: none;
filter: none;
}
100% {
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
}
@-o-keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
-moz-transform: scale(0.1, 0.1);
-o-transform: scale(0.1, 0.1);
-ms-transform: scale(0.1, 0.1);
transform: scale(0.1, 0.1);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
50% {
opacity: 1;
-ms-filter: none;
filter: none;
}
100% {
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
}
@keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
-moz-transform: scale(0.1, 0.1);
-o-transform: scale(0.1, 0.1);
-ms-transform: scale(0.1, 0.1);
transform: scale(0.1, 0.1);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
50% {
opacity: 1;
-ms-filter: none;
filter: none;
}
100% {
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
}
@-moz-keyframes bounce {
0% {
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transform: translateY(-2000px) rotate(0);
-moz-transform: translateY(-2000px) rotate(0);
-o-transform: translateY(-2000px) rotate(0);
-ms-transform: translateY(-2000px) rotate(0);
transform: translateY(-2000px) rotate(0);
}
60% {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transform: translateY(30px) rotate(0);
-moz-transform: translateY(30px) rotate(0);
-o-transform: translateY(30px) rotate(0);
-ms-transform: translateY(30px) rotate(0);
transform: translateY(30px) rotate(0);
}
80% {
-webkit-transform: translateY(-10px) rotate(0);
-moz-transform: translateY(-10px) rotate(0);
-o-transform: translateY(-10px) rotate(0);
-ms-transform: translateY(-10px) rotate(0);
transform: translateY(-10px) rotate(0);
}
100% {
-webkit-transform: translateY(0) rotate(0);
-moz-transform: translateY(0) rotate(0);
-o-transform: translateY(0) rotate(0);
-ms-transform: translateY(0) rotate(0);
transform: translateY(0) rotate(0);
}
}
@-webkit-keyframes bounce {
0% {
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transform: translateY(-2000px) rotate(0);
-moz-transform: translateY(-2000px) rotate(0);
-o-transform: translateY(-2000px) rotate(0);
-ms-transform: translateY(-2000px) rotate(0);
transform: translateY(-2000px) rotate(0);
}
60% {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transform: translateY(30px) rotate(0);
-moz-transform: translateY(30px) rotate(0);
-o-transform: translateY(30px) rotate(0);
-ms-transform: translateY(30px) rotate(0);
transform: translateY(30px) rotate(0);
}
80% {
-webkit-transform: translateY(-10px) rotate(0);
-moz-transform: translateY(-10px) rotate(0);
-o-transform: translateY(-10px) rotate(0);
-ms-transform: translateY(-10px) rotate(0);
transform: translateY(-10px) rotate(0);
}
100% {
-webkit-transform: translateY(0) rotate(0);
-moz-transform: translateY(0) rotate(0);
-o-transform: translateY(0) rotate(0);
-ms-transform: translateY(0) rotate(0);
transform: translateY(0) rotate(0);
}
}
@-o-keyframes bounce {
0% {
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transform: translateY(-2000px) rotate(0);
-moz-transform: translateY(-2000px) rotate(0);
-o-transform: translateY(-2000px) rotate(0);
-ms-transform: translateY(-2000px) rotate(0);
transform: translateY(-2000px) rotate(0);
}
60% {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transform: translateY(30px) rotate(0);
-moz-transform: translateY(30px) rotate(0);
-o-transform: translateY(30px) rotate(0);
-ms-transform: translateY(30px) rotate(0);
transform: translateY(30px) rotate(0);
}
80% {
-webkit-transform: translateY(-10px) rotate(0);
-moz-transform: translateY(-10px) rotate(0);
-o-transform: translateY(-10px) rotate(0);
-ms-transform: translateY(-10px) rotate(0);
transform: translateY(-10px) rotate(0);
}
100% {
-webkit-transform: translateY(0) rotate(0);
-moz-transform: translateY(0) rotate(0);
-o-transform: translateY(0) rotate(0);
-ms-transform: translateY(0) rotate(0);
transform: translateY(0) rotate(0);
}
}
@keyframes bounce {
0% {
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transform: translateY(-2000px) rotate(0);
-moz-transform: translateY(-2000px) rotate(0);
-o-transform: translateY(-2000px) rotate(0);
-ms-transform: translateY(-2000px) rotate(0);
transform: translateY(-2000px) rotate(0);
}
60% {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transform: translateY(30px) rotate(0);
-moz-transform: translateY(30px) rotate(0);
-o-transform: translateY(30px) rotate(0);
-ms-transform: translateY(30px) rotate(0);
transform: translateY(30px) rotate(0);
}
80% {
-webkit-transform: translateY(-10px) rotate(0);
-moz-transform: translateY(-10px) rotate(0);
-o-transform: translateY(-10px) rotate(0);
-ms-transform: translateY(-10px) rotate(0);
transform: translateY(-10px) rotate(0);
}
100% {
-webkit-transform: translateY(0) rotate(0);
-moz-transform: translateY(0) rotate(0);
-o-transform: translateY(0) rotate(0);
-ms-transform: translateY(0) rotate(0);
transform: translateY(0) rotate(0);
}
}
.swiperLib{
height: 3rem;
}
</style>

210
src/views/pageOne/index.vue

@ -0,0 +1,210 @@
<template>
<div>
<div id="tagcloud1" class="tagcloud">
<div>自动驾驶</div>
<a href="##">辅助驾驶</a>
<div>AEB</div>
<div href="##"><p>路测</p></div>
<div href="##">量子芯片</div>
<i>光速</i>
<div href="##">激光雷达</div>
<b>纳米科技</b>
<a href="##">电子信息</a>
<a href="##">超级计算机</a>
<div>自动驾驶</div>
<a href="##">辅助驾驶</a>
<div>AEB</div>
<div href="##"><p>路测</p></div>
<div href="##">量子芯片</div>
<i>光速</i>
<div href="##">激光雷达</div>
<b>纳米科技</b>
<a href="##">电子信息</a>
<a href="##">超级计算机</a>
</div>
<div class="scrollBox">
<p>第一行书</p>
<vue-seamless-scroll
ref="listData"
:data="list"
:class-option="defaultOption"
style="height: 100px; overflow: hidden"
>
<ul>
<li v-for="(item, index) in list" :key="index">
<div class="bord">
{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</div>
</li>
</ul>
</vue-seamless-scroll>
<p>第二行书</p>
<vue-seamless-scroll
ref="listData2"
:data="list"
:class-option="default2Option"
style="height: 100px; overflow: hidden"
>
<ul>
<li v-for="(item, index) in list" :key="index">
<div class="bord">
{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
</div>
</li>
</ul>
</vue-seamless-scroll>
</div>
</div>
</template>
<script>
import data from '@/views/newBookRecommend/data.json'
export default {
components: {
},
data() {
return {
list: [],
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
mySwipera1: {
notNextTick: true,
noSwiping: true,
observer: true, // swiperslide
observeParents: true, // Swiper /
speed: 4000, //
loop: true, //
slidesPerView: 6, //
spaceBetween: 10, //
freeMode: true, //
autoplay: { //
delay: 0, //
stopOnLastSlide: false, // slide
disableOnInteraction: false//
}
},
mySwipera2: {
notNextTick: true,
observer: true, // swiperslide
observeParents: true, // Swiper /
speed: 4000, //
loop: true, //
slidesPerView: 6, //
spaceBetween: 10, //
freeMode: true, //
autoplay: { //
delay: 0, //
stopOnLastSlide: false, // slide
disableOnInteraction: false, //
reverseDirection: true//
}
}
}
},
computed: {
defaultOption() {
return {
step: 1.5, //
limitMoveNum: 4, // this.dataList.length
hoverStop: true, // stop
direction: 2, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0) direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 1000 // (1000ms)
}
},
default2Option() {
return {
step: 1.5, //
limitMoveNum: 4, // this.dataList.length
hoverStop: true, // stop
direction: 3, // 0 1 2 3
openWatch: true, // dom
singleHeight: 0, // (0) direction => 0/1
singleWidth: 0, // (0) direction => 2/3
waitTime: 1000 // (1000ms)
}
}
},
created() {
this.list = data
},
beforeDestroy() {
clearTimeout(this.timer2)
},
mounted() {
this.tagAnimation()
},
methods: {
tagAnimation() {
tagCloud({
selector: '#tagcloud1', // id class
fontsize: 26, // , 16px
radius: 260, // /, 60px60[60][60, 60]
mspeed: 'normal', // , : slow, normal(), fast
ispeed: 'normal', // , : slow, normal(), fast
direction: 135, // , (360): 0top, 90left, 135right-bottom()...
keep: false, // , : false, true() ,
multicolour: true // true(),false
})
}
}
}
</script>
<style lang="scss">
@import "~@/assets/styles/index.scss";
.tagcloud {
width: 5.5rem;
height: 5rem;
margin: .2rem;
margin-left: .3rem;
overflow: hidden;
a {
text-decoration: none;
cursor: pointer;
}
}
.scrollBox{
width: 100%;
height: 96px;
box-sizing: border-box;
ul{
height: 96px;
display: flex;
li{
width: 240px;
margin-right: 10px;
border: solid 2px #f7f7f9;
cursor: pointer;
.bord{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
.book-img{
width: .5rem;
height: .5rem;
background: url('~@/assets/images/default-img.png') no-repeat center center;
background-size: contain;
display: flex;
align-items: center;
overflow: hidden;
img{
display: block;
width: 100%;
}
}
}
}
}
}
</style>
Loading…
Cancel
Save