|
|
@ -27,7 +27,7 @@ Page({ |
|
|
sysm:false, |
|
|
sysm:false, |
|
|
sysmText:'更多', |
|
|
sysmText:'更多', |
|
|
sysm2:false, |
|
|
sysm2:false, |
|
|
sysm2Text:'更多', |
|
|
sysm2Text:'更多' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@ -48,38 +48,46 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getCodeImg:function(){ |
|
|
getCodeImg:function(){ |
|
|
let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[]; |
|
|
let that = this,sys =wx.getSystemInfoSync(),radio = sys.screenWidth / 750,qrcode=this.data.info.order_product_list[0].qrcode,codeImgs=[],codeId=0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.data.info.order_product_list.forEach(qrcode=>{ |
|
|
this.data.info.order_product_list.forEach(qrcode=>{ |
|
|
qrcode.qrcode.map((item,index)=>{ |
|
|
qrcode.qrcode.map((item)=>{ |
|
|
if(item.use_url){ |
|
|
if(item.use_url&&item.use_code){ |
|
|
codeImgs.push(item.use_url); |
|
|
codeImgs.push({img:item.use_url,code:item.use_code,text:item.use_code_display_text,state:item.stateText}); |
|
|
if(codeImgs.length==qrcode.qrcode.length){ |
|
|
// if(codeImgs.length==qrcode.qrcode.length){
|
|
|
that.setData({ |
|
|
// that.setData({
|
|
|
codeImgs:codeImgs |
|
|
// codeImgs:codeImgs
|
|
|
}) |
|
|
// })
|
|
|
} |
|
|
// }
|
|
|
|
|
|
that.setData({ |
|
|
|
|
|
codeImgs:codeImgs |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
new QRCode('damocode'+index,{ |
|
|
console.log(1231231232131); |
|
|
|
|
|
console.log(codeId); |
|
|
|
|
|
new QRCode('damocode'+codeId,{ |
|
|
text: item.use_code, |
|
|
text: item.use_code, |
|
|
width: 300 * radio, |
|
|
width: 300 * radio, |
|
|
height: 300 * radio, |
|
|
height: 300 * radio, |
|
|
padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0
|
|
|
padding:10, // 生成二维码四周自动留边宽度,不传入默认为0
|
|
|
correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
|
|
|
correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度
|
|
|
callback: (res) => { |
|
|
callback: (res) => { |
|
|
codeImgs.push(res.path); |
|
|
codeImgs.push({img:res.path,code:item.use_code,text:item.use_code_display_text,state:item.stateText}); |
|
|
if(codeImgs.length==qrcode.qrcode.length){ |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
codeImgs:codeImgs |
|
|
codeImgs:codeImgs |
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
// if(codeImgs.length==qrcode.qrcode.length){
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
codeId = codeId + 1 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
prevCodeImg:function(){ |
|
|
prevCodeImg:function(){ |
|
|
let qrcode=this.data.info.order_product_list[0].qrcode,codeIndex = this.data.codeIndex; |
|
|
let qrcode=this.data.info.order_product_list[0].qrcode,codeIndex = this.data.codeIndex; |
|
|
@ -95,13 +103,15 @@ Page({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
nextCodeImg:function(){ |
|
|
nextCodeImg:function(){ |
|
|
let qrcode=this.data.info.order_product_list[0].qrcode,codeIndex = this.data.codeIndex; |
|
|
console.log(this.data.codeImgs); |
|
|
|
|
|
let qrcode=this.data.codeImgs,codeIndex = this.data.codeIndex; |
|
|
codeIndex = codeIndex + 1; |
|
|
codeIndex = codeIndex + 1; |
|
|
if(codeIndex==qrcode.length){ |
|
|
if(codeIndex==qrcode.length){ |
|
|
codeIndex = 0; |
|
|
codeIndex = 0; |
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
codeIndex:codeIndex |
|
|
codeIndex:codeIndex |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
showFeeInfo:function(){ |
|
|
showFeeInfo:function(){ |
|
|
|