沈丘营商办后台前端项目
wangyuhang
5 天以前 8d27f95cf6e3b3289e90828ecef72e0c74f804b0
src/views/infomanger/companymanger/components/createQrcode.vue
@@ -2,6 +2,7 @@
  <el-dialog title="二维码"  v-model="dialogVisible" width="300px" @close="closeDialog"> 
    <div class="text-center">
      <vueQr ref="query" background="#fff" :text="info.companyCode"></vueQr>
      <div style="font-weight: bold;margin-bottom: 10px;">察县扫码入企监督平台</div>
      <div>{{ info.companyName }}</div>
      <div style="margin-top: 10px;">
        <el-link @click="downImage" type="primary">下载企业码</el-link>
@@ -41,9 +42,9 @@
function drawText() {
      const canvas = canvasRef.value;
      canvas.width = 350;
      canvas.height = 350;
      canvas.height = 380;
      canvas.style.width = '350px';
      canvas.style.height = '350px';
      canvas.style.height = '380px';
      const ctx = canvas.getContext('2d');
      ctx.fillStyle  = "#fff"
      ctx.fillRect(0, 0, canvas.width, canvas.height);
@@ -52,10 +53,15 @@
      const text = info.value.companyName;
      
      ctx.drawImage(img, 10, 0, 320, 320);
      ctx.font = '20px Arial';
      // ctx.font = '20px Arial';
      ctx.textAlign = 'center';
      ctx.fillStyle = '#000';
      wrapText(ctx, text, 180, 320, 350, 20)
      // ctx.setFontWeight('bold')
      ctx.font ='bold 20px Arial'
      wrapText(ctx, "察县扫码入企监督平台", 180, 320, 350, 40)
      // ctx.setFontWeight('normal')
      ctx.font ="20px Arial"
      wrapText(ctx, text, 180, 350, 350, 20)
    }
    function wrapText(context, text, x, y, maxWidth, lineHeight) {
    var words = text.split('');