yuminge-app/yun-min-program-plugin-master/packageH/newDraw/components/draw_qrcode/draw_qrcode.js

76 lines
1.5 KiB
JavaScript

// packageE/community_buying/components/buying_qrcode/buying_qrcode.js
var posterBehavior = require('../../../../poster/poster.js');
var app = getApp();
Component({
behaviors: [posterBehavior],
/**
* 组件的属性列表
*/
properties: {
activeid:{
value:0,
type:null
}
},
/**
* 组件的初始数据
*/
data: {
listData:{}
},
observers:{
// 'isshow':function(isshow){
// console.log(this.data.listData[0]);
// if(isshow && !this.data.listData[0] && this.data.getFlag){
// this.data.getFlag=false;
// this.getPosterPic();
// }else if(this.data.listData[0] !='' ){
// this.setData({
// poster: this.data.listData[0],
// })
// }
// }
},
/**
* 组件的方法列表
*/
methods: {
async getPosterPic(){
var urlStr = app.getNetAddresss("plugin.luck-draw.frontend.index.getPoster");
this.setData({
poster: "",
});
app._getNetWork({
showToastIn: false,
url: urlStr,
data:{
id:this.data.activeid
},
success: (resdata)=> {
let res = resdata.data;
if(res.result != 1) {
wx.showToast({
title: res.msg,
});
return;
}
// this.data.listData = res.data.mini.poster;
this.setData({
poster: res.data.mini.poster,
});
},
complete:()=>{
this.data.getFlag=true;
}
});
}
}
});