|
|
@ -1,7 +1,7 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="thumb-example">
|
|
|
|
<div class="thumb-example">
|
|
|
|
<div class="picTop">
|
|
|
|
<div class="picTop">
|
|
|
|
<viewer
|
|
|
|
<div
|
|
|
|
class="bigimg"
|
|
|
|
class="bigimg"
|
|
|
|
:options="OptionssalseImg"
|
|
|
|
:options="OptionssalseImg"
|
|
|
|
v-if="
|
|
|
|
v-if="
|
|
|
@ -11,14 +11,29 @@
|
|
|
|
:style="
|
|
|
|
:style="
|
|
|
|
bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!128x72)' : ''
|
|
|
|
bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!128x72)' : ''
|
|
|
|
"
|
|
|
|
"
|
|
|
|
|
|
|
|
@click="handleBigPic(bigPicPath)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" />
|
|
|
|
<img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" />
|
|
|
|
|
|
|
|
|
|
|
|
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
|
|
|
|
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
|
|
|
|
<!-- <p class="mark">
|
|
|
|
<!-- <p class="mark">
|
|
|
|
{{ bigPicPath }}
|
|
|
|
{{ bigPicPath }}
|
|
|
|
<span>{{ this.activeSmall }}</span>
|
|
|
|
<span>{{ this.activeSmall }}</span>
|
|
|
|
</p> -->
|
|
|
|
</p> -->
|
|
|
|
</viewer>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="
|
|
|
|
|
|
|
|
showBigpic &&
|
|
|
|
|
|
|
|
bigPicPath.indexOf('nopic') == -1 &&
|
|
|
|
|
|
|
|
bigPicPath.indexOf('videos') == -1
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
class="showPic"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="picboxI">
|
|
|
|
|
|
|
|
<img class="maskPic" :src="bigPicPath" />
|
|
|
|
|
|
|
|
<i @click="closePic" class="el-icon-circle-close"></i>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="bigimg" v-else-if="bigPicPath.indexOf('videos') !== -1">
|
|
|
|
<div class="bigimg" v-else-if="bigPicPath.indexOf('videos') !== -1">
|
|
|
|
<video
|
|
|
|
<video
|
|
|
|
width="100%"
|
|
|
|
width="100%"
|
|
|
@ -176,6 +191,7 @@ export default {
|
|
|
|
imgpic: null,
|
|
|
|
imgpic: null,
|
|
|
|
color: "#FF0000",
|
|
|
|
color: "#FF0000",
|
|
|
|
num: 5,
|
|
|
|
num: 5,
|
|
|
|
|
|
|
|
showBigpic: false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -204,6 +220,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {},
|
|
|
|
created() {},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
handleBigPic() {
|
|
|
|
|
|
|
|
this.showBigpic = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
closePic() {
|
|
|
|
|
|
|
|
this.showBigpic = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
drawline() {
|
|
|
|
drawline() {
|
|
|
|
this.canvas = this.$refs.myCanvas;
|
|
|
|
this.canvas = this.$refs.myCanvas;
|
|
|
|
this.imgpic = this.$refs.picJpg;
|
|
|
|
this.imgpic = this.$refs.picJpg;
|
|
|
@ -220,8 +242,14 @@ export default {
|
|
|
|
// 线宽设置,必须放在绘制之前
|
|
|
|
// 线宽设置,必须放在绘制之前
|
|
|
|
this.ctx.lineWidth = this.num;
|
|
|
|
this.ctx.lineWidth = this.num;
|
|
|
|
for (var i = 0; i < this.localPoints.length; i++) {
|
|
|
|
for (var i = 0; i < this.localPoints.length; i++) {
|
|
|
|
this.ctx.moveTo(this.localPoints[i].x1, this.localPoints[i].y1);
|
|
|
|
this.ctx.moveTo(
|
|
|
|
this.ctx.lineTo(this.localPoints[i].x2, this.localPoints[i].y2);
|
|
|
|
this.localPoints[i].x1 * this.imgpic.width,
|
|
|
|
|
|
|
|
this.localPoints[i].y1 * this.imgpic.height
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
this.ctx.lineTo(
|
|
|
|
|
|
|
|
this.localPoints[i].x2 * this.imgpic.width,
|
|
|
|
|
|
|
|
this.localPoints[i].y2 * this.imgpic.height
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.ctx.closePath();
|
|
|
|
this.ctx.closePath();
|
|
|
@ -299,6 +327,44 @@ export default {
|
|
|
|
flex-direction: column;
|
|
|
|
flex-direction: column;
|
|
|
|
height: calc(100% - 0px);
|
|
|
|
height: calc(100% - 0px);
|
|
|
|
box-sizing: border-box;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
.showPic {
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
|
|
background-color: rgba(0, 0, 0, 50%);
|
|
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.picboxI {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
max-width: 1366px;
|
|
|
|
|
|
|
|
max-height: 768px;
|
|
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
|
|
animation-name: scaleDraw;
|
|
|
|
|
|
|
|
/*关键帧名称*/
|
|
|
|
|
|
|
|
animation-timing-function: ease;
|
|
|
|
|
|
|
|
/*动画的速度曲线*/
|
|
|
|
|
|
|
|
animation-iteration-count: 1;
|
|
|
|
|
|
|
|
/*动画播放的次数*/
|
|
|
|
|
|
|
|
animation-duration: 0.65s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
|
|
|
max-width: 1366px;
|
|
|
|
|
|
|
|
max-height: 768px;
|
|
|
|
|
|
|
|
margin: auto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-icon-circle-close {
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
right: -10px;
|
|
|
|
|
|
|
|
font-size: 48px;
|
|
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
top: -24px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
.picTop {
|
|
|
|
.picTop {
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 80%;
|
|
|
|
height: 80%;
|
|
|
@ -478,5 +544,16 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes scaleDraw {
|
|
|
|
|
|
|
|
/*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/
|
|
|
|
|
|
|
|
0% {
|
|
|
|
|
|
|
|
transform: scale(0);
|
|
|
|
|
|
|
|
/*开始为原始大小*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100% {
|
|
|
|
|
|
|
|
transform: scale(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// https://v1.github.surmon.me/vue-awesome-swiper/
|
|
|
|
// https://v1.github.surmon.me/vue-awesome-swiper/
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|