优化展示图片

hn2.0
fanluyan 2 years ago
parent de0bcfd8a0
commit b038c3bdde

@ -329,7 +329,7 @@ export default {
methods: { methods: {
imgOnload() { imgOnload() {
console.log("加载完成"); console.log("加载完成");
this.alarmLoading = false; //this.alarmLoading = false;
this.canvasloading = false; this.canvasloading = false;
}, },
handleBigPicbox(val) { handleBigPicbox(val) {
@ -504,7 +504,7 @@ export default {
// //
handleRowClick(row) { handleRowClick(row) {
//this.$refs.multipleTable.toggleRowSelection(row); //this.$refs.multipleTable.toggleRowSelection(row);
this.alarmLoading = true; //this.alarmLoading = true;
console.log(row); console.log(row);
this.photoPic = row.path; this.photoPic = row.path;
console.log(this.photoPic); console.log(this.photoPic);
@ -525,6 +525,10 @@ export default {
}); });
}, 300); }, 300);
} }
setTimeout(function () {
console.log("关闭遮罩");
this.alarmLoading = false;
}, 1000);
this.$nextTick(() => { this.$nextTick(() => {
this.drawline(row); this.drawline(row);

@ -1,45 +1,34 @@
<template> <template>
<div class="thumb-example"> <div class="thumb-example">
<div class="picTop"> <div class="picTop">
<div class="bigimg nopic" v-if="bigPicPath.indexOf('nopic') !== -1"> <!-- 判断是否是图片并且不为空 -->
<img class="animImg" :src="bigPicPath" />
</div>
<div <div
class="bigimg" class="bigimg"
v-else-if=" v-if="
bigPicPath.indexOf('nopic') == -1 && bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1 bigPicPath.indexOf('videos') == -1
" "
:style=" :style="bigPicPath ? 'backgroundImage:url(' + bigPicPath + ')' : ''"
bigPicPath ? 'backgroundImage:url(' + bigPicPath + '!260x160)' : ''
"
> >
<!-- @click="handleBigPicbox(bigPicPath)" --> <!-- @click="handleBigPicbox(bigPicPath)" -->
<div <div
class="nosee" class="nosee"
:style="'backgroundImage:url(' + bigPicPath + '!1280x720)'" :style="'backgroundImage:url(' + bigPicPath + ')'"
></div> ></div>
<viewer :options="OptionssalseImg" class="bigimgView"> <viewer :options="OptionssalseImg" class="bigimgView">
<img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" /> <img ref="picJpg" class="animImg" :src="bigPicPath + ''" />
</viewer> </viewer>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas> <canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>
<!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" /> --> <!-- <img ref="picJpg" class="animImg" :src="bigPicPath + '!1280x720'" /> -->
</div> </div>
<div <div class="bigimg nopic" v-if="bigPicPath.indexOf('nopic') !== -1">
v-if=" <img
showBigpic && class="animImg"
bigPicPath.indexOf('nopic') == -1 && :src="bigPicPath.substring(0, bigPicPath.length - 9)"
bigPicPath.indexOf('videos') == -1 />
"
class="showPic"
@click="closePic"
>
<div class="picboxI">
<img class="maskPic" :src="bigPicPath" />
<i @click="closePic" class="el-icon-circle-close"></i>
</div>
</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%"
@ -51,6 +40,20 @@
></video> ></video>
</div> </div>
<!-- <div
v-if="
showBigpic &&
bigPicPath.indexOf('nopic') == -1 &&
bigPicPath.indexOf('videos') == -1
"
class="showPic"
@click="closePic"
>
<div class="picboxI">
<img class="maskPic" :src="bigPicPath" />
<i @click="closePic" class="el-icon-circle-close"></i>
</div>
</div> -->
<div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick"> <div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
</div> </div>
@ -215,7 +218,7 @@ export default {
}, },
mounted() { mounted() {
console.log(this.terminalPhoto); console.log(this.terminalPhoto);
this.bigPicPath = this.terminalPhoto[0].path; this.bigPicPath = this.terminalPhoto[0].path + "!1280x720";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize); this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize; this.total = this.terminalPhoto.length / this.pagesize;
console.log(this.fiveList); console.log(this.fiveList);
@ -240,7 +243,7 @@ export default {
}, },
watch: { watch: {
terminalPhoto: function (newVal, oldVal) { terminalPhoto: function (newVal, oldVal) {
this.bigPicPath = this.terminalPhoto[0].path; this.bigPicPath = this.terminalPhoto[0].path + "!1280x720";
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize); this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize; this.total = this.terminalPhoto.length / this.pagesize;
}, },
@ -312,13 +315,13 @@ export default {
(this.page - 1) * this.pagesize, (this.page - 1) * this.pagesize,
this.page * this.pagesize this.page * this.pagesize
); );
this.bigPicPath = this.fiveList[this.activeSmall].path; this.bigPicPath = this.fiveList[this.activeSmall].path + "!1280x720";
this.videopath = this.fiveList[this.activeSmall].thumb; this.videopath = this.fiveList[this.activeSmall].thumb;
}, },
// //
leftClick() { leftClick() {
this.bigNum--; // this.bigNum--; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path; this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1280x720";
this.activeSmall--; this.activeSmall--;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum); console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
console.log(this.page); console.log(this.page);
@ -344,7 +347,7 @@ export default {
// //
rightClick() { rightClick() {
this.bigNum++; // this.bigNum++; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path; this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1280x720";
this.activeSmall++; this.activeSmall++;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum); console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
if (this.activeSmall > 4) { if (this.activeSmall > 4) {
@ -371,7 +374,7 @@ export default {
console.log(row); console.log(row);
console.log(); console.log();
this.activeSmall = index; this.activeSmall = index;
this.bigPicPath = row.path; this.bigPicPath = row.path + "!1280x720";
getCoordinate({ getCoordinate({
channelId: row.channelId, channelId: row.channelId,
needPic: "1", needPic: "1",

Loading…
Cancel
Save