Commit 9cc2e6de authored by nature's avatar nature

图片预览原图

parent 082b57f9
......@@ -26,7 +26,7 @@
</swipe>
</div>
<div v-if="imgList.length" class="indicators">{{ startPosition + 1 }}/{{ imgList.length }}</div>
<div v-show="imgOriginalUrl && percent!=100" class="img-origin" @click="showOriginPic(imgOriginalUrl,startPosition)">
<div v-show="showDownload" class="img-origin" @click="showOriginPic(imgOriginalUrl,startPosition)">
<div class="word">{{ word }}</div>
<div v-show="percent" :style="{width:percent+'%'}" class="progress"/>
</div>
......@@ -189,7 +189,7 @@
</style>
<script>
import {isFunction} from '../../common/utils'
import {isFunction, isDef} from '../../common/utils'
import assign from 'object-assign'
import SwipeItem from '../Swipe/SwipeItem'
import Swipe from '../Swipe/index'
......@@ -222,8 +222,11 @@ export default {
percent: 0,
original: '查看原图',
word: '',
showDownload: false,
}
},
computed: {
},
mounted () {
this.$el.setAttribute('vum-show-picture', '')
......@@ -246,7 +249,7 @@ export default {
this.width = _options.width
this.imgList = _options.imgList || []
this.startPosition = _options.startPosition || 0
this.percent = _options.percent
// this.percent = _options.percent
this.imgOriginalUrl = _options.imgOriginalUrl
this.loadSuccess = _options.loadSuccess
this.state = 1
......@@ -267,6 +270,9 @@ export default {
vm.imgOriginalUrl = vm.imgList[vm.startPosition].imgOriginalUrl
vm.percent = vm.imgList[vm.startPosition].percent
}
if (isDef(vm.imgOriginalUrl)) {
vm.showDownload = vm.imgOriginalUrl.indexOf('blob') === -1
}
},
hide () {
......@@ -349,6 +355,10 @@ export default {
vm.imgOriginalUrl = vm.imgList[index].imgOriginalUrl
vm.percent = vm.imgList[index].percent
vm.word = vm.imgList[index].word
vm.showDownload = false
if (isDef(vm.imgOriginalUrl)) {
vm.showDownload = vm.imgOriginalUrl.indexOf('blob') === -1
}
},
sharePicture () {
......
......@@ -298,19 +298,16 @@ export default {
imgList: [
{imgUrl: 'http://hlsapp.hand-china.com/hls_file/2018/05/F1B6D85E409A4714A8540504B2D133AD',
imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
imgSize: 2982604,
percent: 0,
// imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
// imgSize: 2982604,
},
{imgUrl: 'http://hlsapp.hand-china.com/hls_file/2018/05/F1B6D85E409A4714A8540504B2D133AD',
imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
imgSize: 2282604,
percent: 0,
// imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
// imgSize: 2282604,
},
{imgUrl: 'http://hlsapp.hand-china.com/hls_file/2018/05/F1B6D85E409A4714A8540504B2D133AD',
imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
imgSize: 3282604,
percent: 0,
// imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
// imgSize: 3282604,
},
],
}
......@@ -458,10 +455,10 @@ export default {
imgOriginalUrl: 'http://hlsapp.hand-china.com/file/orign.png',
imgSize: 2882604, */
imgList: vm.imgList,
loadSuccess: (src) => {
/* loadSuccess: (src) => {
vm.imgList[src.index]['percent'] = src.percent
vm.imgList[src.index]['imgOriginalUrl'] = src.localUrl
},
}, */
})
},
selectListMultiple () {
......
......@@ -252,7 +252,6 @@ export default {
ShowPicturePlugin.show({
imgUrl: imgObject.imgUrl,
imgOriginalUrl: imgObject.imgOriginalUrl,
percent: imgObject.imgOriginalUrl || 0,
imgSize: imgObject.imgSize,
width: imgObject.width,
imgList: imgObject.imgList || [],
......
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