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.
44 lines
975 B
44 lines
975 B
3 years ago
|
const app = getApp();
|
||
|
Component({
|
||
|
properties: {
|
||
|
list: {
|
||
|
type: Object,
|
||
|
value: {},
|
||
|
},
|
||
|
height: {
|
||
|
type: Number,
|
||
|
value: 484
|
||
|
},
|
||
|
},
|
||
|
data: {
|
||
|
wdUrl: '',
|
||
|
},
|
||
|
lifetimes: {
|
||
|
attached: function () {
|
||
|
|
||
|
},
|
||
|
},
|
||
|
methods: {
|
||
|
|
||
|
},
|
||
|
observers: {
|
||
|
list(newVal) {
|
||
|
if (!newVal || newVal == {}) return
|
||
|
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)
|
||
|
}
|
||
|
},
|
||
|
})
|