Browse Source

bug 修复

lilei 4 years ago
parent
commit
8500a2fd51
3 changed files with 16 additions and 6 deletions
  1. 7 0
      html2canvas.js
  2. 8 6
      poster.html
  3. 1 0
      新模板/活动模板/tpl.html

File diff suppressed because it is too large
+ 7 - 0
html2canvas.js


+ 8 - 6
poster.html

@@ -142,7 +142,7 @@
 	<!-- 生成二维码 -->
 	<script src="https://cdn.bootcdn.net/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
 	<!-- html转canvas base64图片 -->
-	<script src="https://cdn.bootcdn.net/ajax/libs/html2canvas/0.5.0-beta3/html2canvas.min.js"></script>
+	<script src="http://static.chelingzhu.com/active/html2canvas.js"></script>
 	<script>
 		function getQueryVariable(variable)
 		{
@@ -253,15 +253,17 @@
 							
 							//  打开 海报弹框
 							document.getElementById("use-item").onclick = function(){
+								var dom = document.getElementById('poster-con' + swiperInd)
+								var width = dom.clientWidth
+								var height = dom.clientHeight
 								//  合并图片和二维码
-								html2canvas(document.getElementById('poster-con' + swiperInd), {
+								html2canvas(dom, {
+									width:width,
+									height:height,
 									backgroundColor: "#ffffff",
 									allowTaint: true,
 									useCORS: true,
-									scale: 2,
-									foreignObjectRendering: true,
-									async: false, // 是否异步解析和呈现元素
-									dpi: 300 // 处理模糊问题
+									scale: 2
 								}).then(canvas => {
 									let dataURL = canvas.toDataURL("image/png")
 									document.getElementById('poster-img').src = dataURL

+ 1 - 0
新模板/活动模板/tpl.html

@@ -216,6 +216,7 @@
 			position: relative;
 			padding-bottom: 1em;
 			background: #c01b39;
+			min-height: 400px;
 		}
 		.zy-h5-bgimg{
 			width: 100%;

Some files were not shown because too many files changed in this diff