| @@ -191,20 +191,14 @@ Page({ | |||||
| //适用门店字体的排列 | //适用门店字体的排列 | ||||
| for (let i = 0; i < that.data.data.merchantVoList.length;i++){ | for (let i = 0; i < that.data.data.merchantVoList.length;i++){ | ||||
| let metrics; | |||||
| let width0=ctx.measureText(that.data.data.merchantVoList[0].merchantName).width | |||||
| let width1=ctx.measureText(that.data.data.merchantVoList[1].merchantName).width | |||||
| if(i==0){ | if(i==0){ | ||||
| metrics = 30; | |||||
| that.drawNormalText(ctx, that.data.data.merchantVoList[i].merchantName+"、", metrics, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| }else if(i<=2){ | |||||
| let word = that.data.data.merchantVoList[i - 1].merchantName; | |||||
| let metrics = (ctx.measureText(word).width) * scale; | |||||
| metrics += metrics; | |||||
| if(i==2){ | |||||
| that.drawNormalText(ctx,''+that.data.data.merchantVoList[i].merchantName+"..", metrics, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| }else{ | |||||
| that.drawNormalText(ctx,''+that.data.data.merchantVoList[i].merchantName+"、", metrics+20, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| } | |||||
| that.drawNormalText(ctx, that.data.data.merchantVoList[i].merchantName+"、", 30, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| }else if(i==1){ | |||||
| that.drawNormalText(ctx, that.data.data.merchantVoList[i].merchantName+"、", (width0+35)*scale, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| }else if(i==2){ | |||||
| that.drawNormalText(ctx, that.data.data.merchantVoList[i].merchantName+"..", (width1+width0+40)*scale, 375 * scale, 14 * scale, "#000", "left", "middle", scale); | |||||
| } | } | ||||
| } | } | ||||
| ctx.draw(true); | ctx.draw(true); | ||||