Commit 7758cb01 authored by zhengke's avatar zhengke

预览图片的 不要删我的 改了N次了..

parent 60907082
......@@ -858,6 +858,7 @@
<img v-if="!item" src="../../assets/img/bg_c3@3x.png">
<img :src="item.ShowPath" :onerror='defaultImg' />
<div class="imgzhe">
<div class="re-delte" ><i @click.stop="showImg(item.ShowPath)" class="iconfont icon-img_cz"></i></div>
<div class="re-delte" @click="delImg(index)"><i class="iconfont icon-xingzhuang"></i></div>
<div class="re-delte" @click.stop="ExchangeImg(index,0)" v-if="index!=0&&item.ShowPath">
......@@ -899,6 +900,9 @@
<button class="save-Btn" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button>
<button class="cancel-Btn" @click="goUrl('restaurantList')">{{$t('pub.cancelBtn')}}</button>
</div>
<viewer :images="images" :options='imageOptions' @inited="inited" class="viewer" ref="viewer">
<img v-for="src in images" :src="src" :key="src">
</viewer>
</div>
</template>
<script>
......@@ -908,6 +912,11 @@
export default {
data() {
return {
imageOptions:{
navbar:false,
title:false
},
images: [],
selectAddress: false,
addimg: false,
//图片选取数组
......@@ -1082,6 +1091,24 @@
this.addimg = true;
this.initimgList();
},
inited (viewer){
this.$viewer = viewer
},
showImg: function (src) {
let srcArr = src.split('?')
src = srcArr[0]
let isExsit=false
this.images.forEach(x=>{
if(x===src)
isExsit=true
})
if(!isExsit) {
this.images.push(src)
} else {
this.$viewer.view(this.images.indexOf(src))
}
this.$viewer.show()
},
saveResource() {
//保存餐厅信息
if (this.isBook) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment