|
|
|
|
@ -102,12 +102,13 @@
|
|
|
|
|
//文字描述
|
|
|
|
|
ctx.fillText("苏州河道管理处", 100, 30);
|
|
|
|
|
ctx.fillText("物资编码:" + zcbm, qrcodeleft + 120, 65);
|
|
|
|
|
ctx.fillText("物资类型:" + wzlx, qrcodeleft + 120, 155);
|
|
|
|
|
if(str.length<=4){
|
|
|
|
|
ctx.fillText("资产名称:"+str, qrcodeleft + 120, 95);
|
|
|
|
|
ctx.fillText("物资类型:" + wzlx, qrcodeleft + 120, 95);
|
|
|
|
|
ctx.fillText("资产名称:"+str, qrcodeleft + 120, 125);
|
|
|
|
|
}else{
|
|
|
|
|
ctx.fillText("资产名称:"+str.substring(0,4), qrcodeleft + 120, 95);
|
|
|
|
|
ctx.fillText(str.substring(4,str.length), qrcodeleft + 120, 125);
|
|
|
|
|
ctx.fillText("物资类型:" + wzlx, qrcodeleft + 120, 95);
|
|
|
|
|
ctx.fillText("资产名称:"+str.substring(0,4), qrcodeleft + 120, 125);
|
|
|
|
|
ctx.fillText(str.substring(4,str.length), qrcodeleft + 120, 155);
|
|
|
|
|
}
|
|
|
|
|
ctx.drawImage(img, qrcodeleft, qrcodetop);
|
|
|
|
|
var data = canvas.toDataURL('image/png', 1);
|
|
|
|
|
|