Skip to content

Commit

Permalink
fix(SPA): 查看认证信息时可以查看大图了
Browse files Browse the repository at this point in the history
issue #537
  • Loading branch information
mutoe committed Dec 20, 2018
1 parent 1a43a45 commit e8f4db0
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions resources/spa/src/page/profile/Certification.vue
Expand Up @@ -40,9 +40,10 @@
<span class="label">认证资料</span>
<span class="value">
<img
v-for="imageId in verified.data.files"
:key="imageId"
:src="getImageSrc(imageId)"
v-for="(image, index) in images"
:key="image.id"
:src="`${getImageSrc(image.id)}?w=250&h=185`"
@click="viewImage(index)"
>
</span>
</div>
Expand Down Expand Up @@ -91,6 +92,15 @@ export default {
const { certification_name: type = 'user' } = this.verified
return type
},
images () {
const files = this.verified.data.files || []
return files.map((item, index) => ({
id: item,
src: this.getImageSrc(item),
w: 250,
h: 185,
}))
},
},
watch: {
verified (to) {
Expand All @@ -112,7 +122,10 @@ export default {
* @returns {string}
*/
getImageSrc (id) {
return `${this.$http.defaults.baseURL}/files/${id}?w=250&h=185`
return `${this.$http.defaults.baseURL}/files/${id}`
},
viewImage (index) {
this.$bus.$emit('mvGallery', { index, images: this.images })
},
},
}
Expand Down

0 comments on commit e8f4db0

Please sign in to comment.