prevention/components/ImageInfo/index.js

50 lines
1.1 KiB
JavaScript

// components/ImageInfo/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
data: {
type: Object,
value: {}
}
},
observers: {
data(value) {
if(Object.keys(this.properties.data).length) {
this.setData({dataSource: this.properties.data})
let list = this.properties.data.registerFlowmanVoList || []
let arr = []
if(this.properties.data.carUrl) {
arr.push(this.properties.data.carUrl)
}
if(list.length > 0) {
list.forEach(item=> {
if(arr.length < 3) {
if(item.imageUrl) {
arr.push(item.imageUrl)
}
}
})
}
this.setData({imageList: arr})
}
}
},
/**
* 组件的初始数据
*/
data: {
dataSource: {},
imageList: []
},
/**
* 组件的方法列表
*/
methods: {
}
})