Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序设置背景图片无效 #267

Closed
zhiouv opened this issue May 19, 2022 · 9 comments
Closed

小程序设置背景图片无效 #267

zhiouv opened this issue May 19, 2022 · 9 comments

Comments

@zhiouv
Copy link

zhiouv commented May 19, 2022

微信小程序原生设置背景图片无效
1,原生微信小程序
2,"@lucky-canvas/mini": "^0.0.6"
3,使用的是十二宫格
4,设置了背景图片,但是页面上不出来。图片路径没问题,奖品的图片都可以访问

 blocks: [{
      padding: '10px',
      imgs: [{ src: '/images/turntable/a.png', width: '100%', height: '100%' }],
      background: '#ac0d27',
      borderRadius: '20rpx',
    }]
@buuing
Copy link
Owner

buuing commented May 19, 2022

把提问模板补充上 #177

@buuing
Copy link
Owner

buuing commented May 19, 2022

啥时候安装的, 你看一下node_modules里的依赖是什么版本 => lucky-canvas

@buuing
Copy link
Owner

buuing commented May 19, 2022

之前的版本里, 九宫格抽奖的blocks确实没加imgs选项, 但是最新版已经补充了背景图, 如果你的依赖是[email protected], 那就要排除你的图片是不是太大了, 才导致绘制失败?

@buuing
Copy link
Owner

buuing commented May 20, 2022

不是这个, 我都说了, 你去node_modules里看, lucky-canvas@lucky-canvas/mini的依赖包!!!

@zhiouv
Copy link
Author

zhiouv commented May 20, 2022

不是这个, 我都说了, 你去node_modules里看, lucky-canvas@lucky-canvas/mini的依赖包!!!

是1.7.23版本的,图片大小限制是多少?这个图片是40多k
1653014327(1)

我写了一个微信小程序的代码片段,帮我看一下,谢谢。
https://developers.weixin.qq.com/s/eZfVnom972zM

@buuing
Copy link
Owner

buuing commented May 20, 2022

好, 晚上我看看

@buuing
Copy link
Owner

buuing commented May 20, 2022

我知道咋回事了, 我的锅, 微信小程序这个包, 我忘记更新了

最新版@lucky-canvas/[email protected]已修复该问题

@zhiouv
Copy link
Author

zhiouv commented May 23, 2022

我知道咋回事了, 我的锅, 微信小程序这个包, 我忘记更新了

最新版@lucky-canvas/[email protected]已修复该问题

现在背景图是可以了,又出现新的问题了,无法play了

1653270019(1)
1653270027(1)

@buuing
Copy link
Owner

buuing commented May 23, 2022

child.$lucky => child.lucky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants