Commit 4ae30353 authored by 罗林杰's avatar 罗林杰

修改动态图片显示

parent db441034
...@@ -32,8 +32,14 @@ ...@@ -32,8 +32,14 @@
imgDisplay: 'flex', imgDisplay: 'flex',
} }
}, },
mounted() { watch: {
imgList: {
handler() {
this.judgeImg(); this.judgeImg();
},
deep: true,
immediate: true
}
}, },
methods: { methods: {
// 预览图片 // 预览图片
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
</template> </template>
</view> </view>
<view class="contentImg"> <view class="contentImg">
<imageAdaptation :imgList="imgs" :imgLayout1="imgLayout1" :imgLayout2="imgLayout2" <imageAdaptation :imgList="info.url" :imgLayout1="imgLayout1" :imgLayout2="imgLayout2"
:imgLayout3="imgLayout3" @previewImg="preview"></imageAdaptation> :imgLayout3="imgLayout3" @previewImg="preview"></imageAdaptation>
<q-previewImage ref="previewImage" :urls="imgs" @onLongpress="onLongpress" @open="open" <q-previewImage ref="previewImage" :urls="info.url" @onLongpress="onLongpress" @open="open"
@close="close"></q-previewImage> @close="close"></q-previewImage>
</view> </view>
<view class="time"> <view class="time">
...@@ -120,17 +120,6 @@ ...@@ -120,17 +120,6 @@
default: () => {} default: () => {}
} }
}, },
watch: {
info: {
handler(newValue) {
if (newValue?.url?.length) {
this.imgs = newValue.url
}
},
deep: true,
immediate: true
}
},
mounted() { mounted() {
if (this.$refs.uReadMore) { if (this.$refs.uReadMore) {
setTimeout(() => { setTimeout(() => {
...@@ -228,7 +217,7 @@ ...@@ -228,7 +217,7 @@
}) { }) {
uni.previewImage({ uni.previewImage({
current: index, current: index,
urls: this.imgs, urls: this.info.url,
longPressActions: { longPressActions: {
// itemList: ['发送给朋友', '保存图片', '收藏'], // itemList: ['发送给朋友', '保存图片', '收藏'],
success: function(data) { success: function(data) {
......
...@@ -183,6 +183,9 @@ ...@@ -183,6 +183,9 @@
//处理动态照片 //处理动态照片
if (item.pictureId != null){ if (item.pictureId != null){
const urlArray = JSON.parse(item.pictureId) const urlArray = JSON.parse(item.pictureId)
console.log('urlArray.id:',urlArray.id)
if (urlArray.id.length>0){
console.log('11111111111111')
let arr = [] let arr = []
urlArray.id.forEach(item => { urlArray.id.forEach(item => {
getOssUrl(item).then(imgRes => { getOssUrl(item).then(imgRes => {
...@@ -194,6 +197,7 @@ ...@@ -194,6 +197,7 @@
}) })
item.url = arr item.url = arr
} }
}
//处理性别 //处理性别
if (item.memSex != null && item.memSex !== ''){ if (item.memSex != null && item.memSex !== ''){
item.memSex = getValue('sex',item.memSex) item.memSex = getValue('sex',item.memSex)
...@@ -213,6 +217,7 @@ ...@@ -213,6 +217,7 @@
} }
}) })
this.$refs.paging.completeByTotal(list,res.data.total); this.$refs.paging.completeByTotal(list,res.data.total);
console.log('22222222',this.dataList)
}) })
// 组件加载时会自动触发此方法,因此默认页面加载时会自动触发,无需手动调用 // 组件加载时会自动触发此方法,因此默认页面加载时会自动触发,无需手动调用
......
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