canvas生成海报真机上不显示,打开调试模式显示?
发布于 4 年前 作者 xiazhang 13234 次浏览 来自 问答

canvas生成海报真机上不显示,打开调试模式显示

有大佬知道怎么解决嘛,想知道具体点的解决方法

这里直接用的插件,直接渲染数据的

return {

		message:'',

		code:'',

		lists: \[

					{

						type: 'image',

						content: '<a href="https://dahuangliangpin.oss-cn-beijing.aliyuncs.com/wx/images/inviteFriends.png" rel="noopener noreferrer" target="_blank">https://dahuangliangpin.oss-cn-beijing.aliyuncs.com/wx/images/inviteFriends.png</a>',&nbsp;

						width: 620,&nbsp;

						height: 1000,&nbsp;

						x: 0,&nbsp;

						y: 0,&nbsp;

					},

					{

						type: 'image',

						content: '',&nbsp;

						width: 200,&nbsp;

						height: 200,&nbsp;

						x: 215,&nbsp;

						y: 680,&nbsp;

						arc: false,&nbsp;

						arcX: 0,&nbsp;

						arcY: 0,&nbsp;

						arcR: 500&nbsp;

					},

					{

						type: 'text',

						content: '',&nbsp;

						x: 215,&nbsp;

						y: 920,&nbsp;

						color: '\#FFF',&nbsp;

						size: 30,&nbsp;

						// maxWidth: 100,&nbsp;

						// align: 'left',&nbsp;

					},

					{

						type: 'rect',

						width: 1,

						height: 100,

						x: 0,

						y: 10,

						color: '\#ff0000',

					},

					{

						type: 'image',

						content: '<a href="https://img1.baidu.com/it/u=686675228,2481849275&amp;fm=26&amp;fmt=auto&amp;gp=0.jpg" rel="noopener noreferrer" target="_blank">https://img1.baidu.com/it/u=686675228,2481849275&amp;fm=26&amp;fmt=auto&amp;gp=0.jpg</a>',&nbsp;

						width: 100,&nbsp;

						height: 100,&nbsp;

						x: 200,&nbsp;

						y: 200,&nbsp;

						arc: true,&nbsp;

						arcX: 250,&nbsp;

						arcY: 250,&nbsp;

						arcR: 50&nbsp;

					},

				\]

	};
8 回复

第一直觉域名绑定问题

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

你具体的问题都说不清楚,哪有人能给你具体的解决方法

调试模式相当于开启不校验合法域名,看看海报引用的地址

canvas里面用到的图片域名没有加入白名单

开发工具取消勾选不校验合法域名试下

代码片段贴一下可以吗,球球你们了,贴一下代码片段才知道你们是怎么回事啊

海报发出来看看

回到顶部