|
@@ -195,15 +195,20 @@ Page({ |
|
|
this.drawNormalText(ctx, "适用门店:", 30 * scale, 348 * scale, 16 * scale, "#000", "left", "middle", scale); |
|
|
this.drawNormalText(ctx, "适用门店:", 30 * scale, 348 * scale, 16 * scale, "#000", "left", "middle", scale); |
|
|
|
|
|
|
|
|
//适用门店字体的排列 |
|
|
//适用门店字体的排列 |
|
|
this.data.data.merchantVoList.map(function (file, index) { |
|
|
|
|
|
let word = file.merchantName; |
|
|
|
|
|
let metrics = ctx.measureText(word).width; |
|
|
|
|
|
metrics += metrics; |
|
|
|
|
|
that.drawNormalText(ctx, that.data.data.merchantVoList[index].merchantName,metrics, 375 * scale, 14 * scale, "#000", "left", "middle", scale); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
for (let i = 0; i < that.data.data.merchantVoList.length;i++){ |
|
|
|
|
|
let metrics; |
|
|
|
|
|
if(i==0){ |
|
|
|
|
|
metrics = 35; |
|
|
|
|
|
that.drawNormalText(ctx, that.data.data.merchantVoList[i].merchantName, metrics, 375 * scale, 14 * scale, "#000", "left", "middle", scale); |
|
|
|
|
|
}else{ |
|
|
|
|
|
let word = that.data.data.merchantVoList[i - 1].merchantName; |
|
|
|
|
|
let metrics = (ctx.measureText(word).width) * scale; |
|
|
|
|
|
metrics += metrics; |
|
|
|
|
|
that.drawNormalText(ctx,'、'+that.data.data.merchantVoList[i].merchantName, metrics, 375 * scale, 14 * scale, "#000", "left", "middle", scale); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
ctx.draw(true); |
|
|
ctx.draw(true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ctx.draw(true); |
|
|
ctx.draw(true); |
|
|
}, |
|
|
}, |
|
|
//绘制小程序码 |
|
|
//绘制小程序码 |
|
|