|
@@ -28,22 +28,42 @@
|
|
|
</div>
|
|
|
</div> -->
|
|
|
<div class="content-scroll swiper">
|
|
|
- <div class="swiper-wrapper">
|
|
|
- <div class="swiper-slide scroll-item list" v-for="(item,index) in list" :key="index" :class="
|
|
|
+ <!-- 使用swiper -->
|
|
|
+ <div class="swiper-wrapper">
|
|
|
+ <swiper :options="swiperoption" ref="mySwiper">
|
|
|
+ <swiper-slide class="swiper-slide scroll-item list active" v-for="(item,index) in list" :key="item.id" :class="
|
|
|
current == index
|
|
|
? `active index${index} ${curIndex == index ? 'fang' : ''}`
|
|
|
- : `index${index}`" @click="changeTitle(index)">
|
|
|
- <div class="activeItem" v-if="curIndex == index">
|
|
|
- <div class="activetext" v-for="(items, a) in item.list" :key="a">
|
|
|
- {{ items }}
|
|
|
+ : `index${index}`">
|
|
|
+ <div @click="changeTitle(index)">
|
|
|
+ <div class="activeItem" v-if="curIndex == index" >
|
|
|
+ <div class="activetext">
|
|
|
+ {{ item.content }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item-text item" v-else>{{ item.name }}</div>
|
|
|
+ <div class="source">
|
|
|
+ <span style="color: #9c9590;margin-bottom: 10px">来源</span>
|
|
|
+ <span>{{item.creatorName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </swiper-slide>
|
|
|
+ </swiper>
|
|
|
+ <!-- <div class="swiper-slide scroll-item list" v-for="(item,index) in list" :key="item.id" @click="changeTitle(index)" :class="
|
|
|
+ current == index
|
|
|
+ ? `active index${index} ${curIndex == index ? 'fang' : ''}`
|
|
|
+ : `index${index}`" >
|
|
|
+ <div class="activeItem" v-if="curIndex == index" >
|
|
|
+ <div class="activetext">
|
|
|
+ {{ item.content }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item-text item" v-else>{{ item.name }}</div>
|
|
|
<div class="source">
|
|
|
<text style="color: #9c9590">来源</text>
|
|
|
- <text>小阿飞</text>
|
|
|
+ <text>{{item.creatorName}}</text>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
|
|
|
<!-- <div class="swiper-button-next"></div>
|
|
@@ -57,7 +77,7 @@
|
|
|
<div class="downButtomItem">返回我的祈愿</div>
|
|
|
</div>
|
|
|
<div v-else class="downButtom flex justify-center">
|
|
|
- <div class="downButtomItem">祈愿地图</div>
|
|
|
+ <div class="downButtomItem" @click="$router.push('/map')">祈愿地图</div>
|
|
|
<div class="downButtomItem" @click="handleShare">分享</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -70,16 +90,15 @@
|
|
|
style="background: transparent"
|
|
|
@close="close"
|
|
|
>
|
|
|
- <div class="popItme">
|
|
|
- <div class="mySharepopup planel" ref="addImage" id="capture">
|
|
|
+ <div class="popItme" ref="downDiv">
|
|
|
+ <div class="mySharepopup planel" id="capture">
|
|
|
+ <img v-if="img" :src="img" class="showImgbase64" alt="">
|
|
|
<div class="shareItem answer_draw_canvas">
|
|
|
<div class="activeItem answer_draw_canvas">
|
|
|
<div
|
|
|
class="activetext answer_draw_canvas"
|
|
|
- v-for="(items, a) in shareData.list"
|
|
|
- :key="a"
|
|
|
>
|
|
|
- {{ items }}
|
|
|
+ {{ shareData.content }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -104,11 +123,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="downText" @click="handleDown">下载图片</div>
|
|
|
+ <div class="downText" @click="dowmImg">{{img?'长按保存':'下载图片'}}</div>
|
|
|
</div>
|
|
|
<div class="qrcodeDiv">
|
|
|
- <div class="codeImg1 qrcode" ref="qrCodeUrl1"></div>
|
|
|
- <div class="codeImg2 qrcode" ref="qrCodeUrl2"></div>
|
|
|
+ <div class="codeImg1 qrcode" ref="qrCodeUrl1">
|
|
|
+ <img src="https://4dscene.4dage.com/new4dkk/deng/static/img/code/gzhcode.png" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="codeImg2 qrcode" ref="qrCodeUrl2">
|
|
|
+ <img src="https://4dscene.4dage.com/new4dkk/deng/static/img/code/xcxcode.png" alt="">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -118,11 +141,15 @@
|
|
|
|
|
|
<script>
|
|
|
import html2canvas from 'html2canvas'
|
|
|
-import Swiper from 'swiper'
|
|
|
+// import { Swiper, SwiperSlide } from 'vue-awesome-swiper';
|
|
|
+// import 'swiper/dist/css/swiper.css'
|
|
|
+// import Swiper from 'swiper'
|
|
|
+import { mapState } from 'vuex'
|
|
|
import QRCode from 'qrcodejs2'
|
|
|
export default {
|
|
|
components: {
|
|
|
- // uNavbar
|
|
|
+ // Swiper,
|
|
|
+ // SwiperSlide
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -131,39 +158,14 @@ export default {
|
|
|
show: false,
|
|
|
shareShow: false,
|
|
|
scrollLeft: 0, // 横向滚动条位置
|
|
|
- current: 2,
|
|
|
+ current: 0,
|
|
|
curIndex: null,
|
|
|
qrcode1: null,
|
|
|
qrcode2: null,
|
|
|
province: '请选择',
|
|
|
provinceShow: false,
|
|
|
shareData: {},
|
|
|
- list: [
|
|
|
- {
|
|
|
- name: '学业祈愿1',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- },
|
|
|
- {
|
|
|
- name: '学业祈愿2',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- },
|
|
|
- {
|
|
|
- name: '学业祈愿3',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- },
|
|
|
- {
|
|
|
- name: '学业祈愿4',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- },
|
|
|
- {
|
|
|
- name: '学业祈愿5',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- },
|
|
|
- {
|
|
|
- name: '学业祈愿6',
|
|
|
- list: ['知识的殿堂中闪耀属于你的光芒。', '愿你学业精进,成绩辉煌,']
|
|
|
- }
|
|
|
- ],
|
|
|
+ list: [],
|
|
|
canvasWidth: 180, // 默认canvas宽高
|
|
|
canvasHeight: 700,
|
|
|
screenWidth: null, // 设备宽度
|
|
@@ -173,26 +175,71 @@ export default {
|
|
|
// chapter1: '',
|
|
|
// chapter2: '',
|
|
|
widget: null,
|
|
|
+ swiperoption: {
|
|
|
+ pagination: {
|
|
|
+ el: '.swiper-pagination', //与slot="pagination"处 class 一致
|
|
|
+ clickable: true //轮播按钮支持点击
|
|
|
+ },
|
|
|
+ //自动播放
|
|
|
+ autoplay: false,
|
|
|
+ spaceBetween: 0, // 模块之间的间隔
|
|
|
+ slidesPerView: 1,
|
|
|
+ //更改后自动刷新
|
|
|
+ observer: true,
|
|
|
+ observeParents: true,
|
|
|
+ //循环
|
|
|
+ loop: false
|
|
|
+ },
|
|
|
msg: '加载中,请稍等...' // 提示语
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState('home', ['img']),
|
|
|
+ swiper() {
|
|
|
+ return this.$refs.mySwiper.swiper
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- // 下面是普通swiper模板
|
|
|
- new Swiper('.content-scroll', {
|
|
|
- loop: true,
|
|
|
- mousewheel: true,
|
|
|
- keyboard: true,
|
|
|
- navigation: {
|
|
|
- nextEl: '.swiper-button-next',
|
|
|
- prevEl: '.swiper-button-prev'
|
|
|
- },
|
|
|
-
|
|
|
- pagination: {
|
|
|
- el: '.swiper-pagination'
|
|
|
- }
|
|
|
+ this.$store.commit('home/setImg', null)
|
|
|
+ this.getRequest('/api/show/pray/getList').then(res => {
|
|
|
+ console.log(res, 'getList')
|
|
|
+ this.list = res.data
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ swiperOption() {
|
|
|
+ let that = this
|
|
|
+ return {
|
|
|
+ loop: true,
|
|
|
+ autoplay: {
|
|
|
+ //swiper手动滑动之后自动轮播失效的解决方法,包括触碰,拖动,点击pagination,重新启动自动播放
|
|
|
+ disableOnInteraction: false,
|
|
|
+ // 自动播放时间:毫秒
|
|
|
+ delay: 2000
|
|
|
+ },
|
|
|
+ touchRatio: 1, // 触摸滑动的顺畅度
|
|
|
+ initialSlide: 1, // 默认展示页
|
|
|
+ width: '100vw', // 默认canvas宽高
|
|
|
+ autoplay: true, // 是否自动播放
|
|
|
+ speed: 1000, // 播放速度
|
|
|
+ slidesPerView: 1,
|
|
|
+ centeredSlides: true,
|
|
|
+ paginationClickable: true,
|
|
|
+ observeParents: true,
|
|
|
+ observer: true,
|
|
|
+ spaceBetween: 0, // 模块之间的间隔
|
|
|
+ on: {
|
|
|
+ slideChangeTransitionEnd: function () {
|
|
|
+ // 处理手动操作轮播图后后不再自动轮播
|
|
|
+ this.autoplay.start()
|
|
|
+ },
|
|
|
+ click(e) {
|
|
|
+ console.log('点击', e)
|
|
|
+ // that.changeTitle(e,);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
renderInit() {
|
|
|
// 获取设备信息
|
|
|
wx.getSystemInfo({
|
|
@@ -258,13 +305,23 @@ export default {
|
|
|
this.show = true
|
|
|
},
|
|
|
handleShare() {
|
|
|
- console.log('handleShare')
|
|
|
+ this.current = this.swiper.activeIndex
|
|
|
this.shareShow = true
|
|
|
this.shareData = this.list[this.current]
|
|
|
+ console.log('handleShare', this.swiper.activeIndex, this.shareData)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.dowmImg()
|
|
|
+ })
|
|
|
setTimeout(() => {
|
|
|
- this.creatQrCode()
|
|
|
+ // this.creatQrCode()
|
|
|
}, 500)
|
|
|
},
|
|
|
+ dowmImg() {
|
|
|
+ setTimeout(() => {
|
|
|
+ console.log('dowmImg', this.$refs.downDiv)
|
|
|
+ this.$store.dispatch('home/saveImage', this.$refs.downDiv)
|
|
|
+ }, 100)
|
|
|
+ },
|
|
|
close() {
|
|
|
this.shareShow = false
|
|
|
console.log('handleShare', this.shareShow)
|
|
@@ -315,8 +372,8 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.prayers-list {
|
|
|
background: url('https://4dscene.4dage.com/new4dkk/deng/static/img/bg02@2x(2).png') 100% 100%
|
|
|
- no-repeat;
|
|
|
- background-size: cover;
|
|
|
+ no-repeat;
|
|
|
+ background-size: cover;
|
|
|
// background: rgba(32, 21, 10, 0.7);
|
|
|
border-radius: 0px 0px 0px 0px;
|
|
|
height: 100vh;
|
|
@@ -340,6 +397,7 @@ export default {
|
|
|
position: absolute;
|
|
|
right: 65px;
|
|
|
top: 40%;
|
|
|
+ z-index: 11;
|
|
|
.shareRight {
|
|
|
position: relative;
|
|
|
}
|
|
@@ -351,6 +409,11 @@ export default {
|
|
|
padding: 5px;
|
|
|
margin: 0 5px;
|
|
|
background: #fff;
|
|
|
+ img {
|
|
|
+ width: 72px;
|
|
|
+ height: 72px;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.close {
|
|
@@ -403,7 +466,19 @@ export default {
|
|
|
// width: 330px;
|
|
|
// height: 537px;
|
|
|
padding: 19px 17px 0px 17px;
|
|
|
+ position: relative;
|
|
|
|
|
|
+ .showImgbase64 {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ border: 0;
|
|
|
+ z-index: 10;
|
|
|
+ }
|
|
|
.shareItem {
|
|
|
width: 150px;
|
|
|
height: calc(100% - 512px);
|
|
@@ -493,7 +568,7 @@ export default {
|
|
|
writing-mode: vertical-lr;
|
|
|
position: absolute;
|
|
|
bottom: 23%;
|
|
|
- right: -10px;
|
|
|
+ left: calc(50% - 70px);
|
|
|
}
|
|
|
.item-text {
|
|
|
// transform: rotateY(180deg);
|
|
@@ -523,7 +598,8 @@ export default {
|
|
|
transform: rotateY(180deg);
|
|
|
}
|
|
|
}
|
|
|
- .active, .swiper-slide-active {
|
|
|
+ .active,
|
|
|
+ .swiper-slide-active {
|
|
|
.item-text {
|
|
|
top: calc(50% - 226px);
|
|
|
left: calc(50% - 50px);
|
|
@@ -548,7 +624,7 @@ export default {
|
|
|
line-height: 18px;
|
|
|
display: flex;
|
|
|
writing-mode: vertical-lr;
|
|
|
- text-align: left;
|
|
|
+ text-align: center;
|
|
|
justify-content: center;
|
|
|
flex-direction: column;
|
|
|
background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/img_label@2x.png) 100%
|
|
@@ -599,6 +675,15 @@ export default {
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
+ .activetext {
|
|
|
+ display: inline-block;
|
|
|
+ height: 100%;
|
|
|
+ /*文字居中*/
|
|
|
+ /*文字竖排*/
|
|
|
+ white-space: break-spaces;
|
|
|
+ writing-mode: vertical-lr; /*从左向右 从右向左是 writing-mode: vertical-rl;*/
|
|
|
+ writing-mode: tb-lr; /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@keyframes handleAni {
|