wesmiler 6 年之前
父節點
當前提交
df2d0cf1e4
共有 1 個文件被更改,包括 1 次插入8 次删除
  1. 1 8
      public/static/weixin/js/photo.js

+ 1 - 8
public/static/weixin/js/photo.js

@@ -113,22 +113,15 @@ var app = new Vue({
                 var $previewImg = document.getElementById("pic_preview_" + k);
                 var id = $(this).attr('data-id');
 
-                var canvas = document.createElement("canvas");
+                // var canvas = document.createElement("canvas");
                 var scale = 12;
-
-                canvas.width = 119 * scale;
-                canvas.height = 169 * scale;
-                canvas.getContext("2d").scale(scale, scale);
-
                 var opts = {
-                    canvas: canvas,
                     scale: scale, // 添加的scale 参数
                     width: 119,
                     height: 169,
                     background: '#fff',
                 };
 
-                console.log($("#pic_preview_" + k).html());
                 html2canvas($previewImg, opts).then(function (canvas) {
                         const context = canvas.getContext('2d');
                         context.translate(0.5, 0.5);