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.

46 lines
1.0 KiB

const app = getApp();
Component({
properties: {
list: {
type: [Object, Array]
},
height: {
type: Number,
value: 350
},
},
data: {
wdUrl: '',
},
lifetimes: {
attached: function () {
},
},
methods: {
},
observers: {
list(newVal) {
if (typeof(newVal) == 'object') {
let arr = [];
for(let key in newVal) {
let obj = {
name: key,
num: newVal[key]
};
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)
} else {
return
}
}
},
})