You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
777 B
49 lines
777 B
<template>
|
|
<view class="xiangce">
|
|
<image v-for="(a,i) in list" :key="i" :src="a" @click="previewImage(i)"></image>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
list: [],
|
|
};
|
|
},
|
|
onLoad(o) {
|
|
this.id = o.id;
|
|
this.getList();
|
|
},
|
|
methods: {
|
|
async getList() {
|
|
const { code, data, msg } = await this.$api.myAlbums({
|
|
userId: this.id
|
|
})
|
|
if(code == 200){
|
|
this.list = data.split(",")
|
|
}
|
|
},
|
|
previewImage(id) {
|
|
uni.previewImage({
|
|
urls: this.list,
|
|
count: id
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.xiangce{
|
|
padding: 0 25rpx 0 5rpx;
|
|
overflow: hidden;
|
|
image{
|
|
width: 220rpx;
|
|
height: 220rpx;
|
|
border-radius: 10rpx;
|
|
margin-left: 20rpx;
|
|
margin-top: 20rpx;
|
|
}
|
|
}
|
|
</style>
|
|
|