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

修改动态图片显示

parent db441034
...@@ -32,9 +32,15 @@ ...@@ -32,9 +32,15 @@
imgDisplay: 'flex', imgDisplay: 'flex',
} }
}, },
mounted() { watch: {
this.judgeImg(); imgList: {
}, handler() {
this.judgeImg();
},
deep: true,
immediate: true
}
},
methods: { methods: {
// 预览图片 // 预览图片
previewImg(url,index) { previewImg(url,index) {
......
...@@ -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,16 +183,20 @@ ...@@ -183,16 +183,20 @@
//处理动态照片 //处理动态照片
if (item.pictureId != null){ if (item.pictureId != null){
const urlArray = JSON.parse(item.pictureId) const urlArray = JSON.parse(item.pictureId)
let arr = [] console.log('urlArray.id:',urlArray.id)
urlArray.id.forEach(item => { if (urlArray.id.length>0){
getOssUrl(item).then(imgRes => { console.log('11111111111111')
if (imgRes.data.data != null) { let arr = []
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/"); urlArray.id.forEach(item => {
arr.push(imgRes.data.data) getOssUrl(item).then(imgRes => {
} if (imgRes.data.data != null) {
imgRes.data.data = imgRes.data.data.replace(/\\/g, "/");
arr.push(imgRes.data.data)
}
})
}) })
}) item.url = arr
item.url = arr }
} }
//处理性别 //处理性别
if (item.memSex != null && item.memSex !== ''){ if (item.memSex != null && 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