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.

42 lines
946 B

const app = getApp();
Component({
properties: {
list: {
type: [Object, Array]
},
height: {
type: Number,
value: 484
},
},
data: {
wdUrl: '',
},
lifetimes: {
attached: function () {
},
},
methods: {
},
observers: {
list(newVal) {
let arr = [];
newVal.forEach(ele => {
let obj = {
name: ele.key,
num: ele.value
};
arr.push(obj)
})
setTimeout(() => {
app.globalData.requestImg(arr).then(res => {
var imgData = res.data.replace(/[\r\n]/g, '')
var base64Img = 'data:image/png;base64,' + imgData;
this.setData({wdUrl: base64Img})
});
}, 500)
}
},
})