问题模块 框架类型 问题类型 操作系统 操作系统版本 手机型号 微信版本
客户端 微信小程序 Bug iOS iPhone; CPU iPhone OS 12_0_1 like Mac OS X IPhone 6 6.7.3
- 当前 Bug 的表现(可附上截图)
- 预期表现
产品轮播图正常显示
问题说明:
微信小程序体验版本,在IOS真机上部分网络图片不显示,安卓系统和开发模拟器上正常,从未出现过该问题。
两个不同的IPhone手机,图片在另一个IOS手机上正常显示,但又会丢失其他图片,丢失图片完全是随机的(图片格式是jpg和png),在图片上绑定了预览图片方法,执行wx.previewImage方法传入不显示的图片地址,可正常预览
和swiper标签没有任何关系,在page中直接一个image标签也会随机图片不显示。
在后台查看nginx日志发现 访问图片的时候会在 jpg或者png后面加上/ 导致404,
日志详情:
2018/11/06 17:33:16 [error] 4776#5532: *417 "E:/card/shop/tab6_icon.png/index.html" is not found (3: The system cannot find the path specified), client: 115.60.16.122, server: www.m.baidu.com, request: "GET /card/shop/tab6_icon.png/ HTTP/1.1", host: "www.m.baidu.com", referrer: "https://servicewechat.com/wx9fcadf2030746bd2/0/page-frame.html"
2018/11/06 17:33:16 [error] 4776#5532: *422 "E:/card/shop/product/show/liaoyiliao_icon.png/index.html" is not found (3: The system cannot find the path specified), client: 115.60.16.122, server: www.m.baidu.com, request: "GET /card/shop/product/show/liaoyiliao_icon.png/ HTTP/1.1", host: "www.m.baidu.com", referrer: "https://servicewechat.com/wx9fcadf2030746bd2/0/page-frame.html"
2018/11/06 17:33:16 [error] 4776#5532: *420 "E:/card/shop/product/show/fenxiang.png/index.html" is not found (3: The system cannot find the path specified), client: 115.60.16.122, server: www.m.baidu.com, request: "GET /card/shop/product/show/fenxiang.png/ HTTP/1.1", host: "www.m.baidu.com", referrer: "https://servicewechat.com/wx9fcadf2030746bd2/0/page-frame.html"
2018/11/06 17:33:16 [error] 4776#5532: *424 "E:/card/shop/product/show/shoucang.png/index.html" is not found (3: The system cannot find the path specified), client: 115.60.16.122, server: www.m.baidu.com, request: "GET /card/shop/product/show/shoucang.png/ HTTP/1.1", host: "www.m.baidu.com", referrer: "https://servicewechat.com/wx9fcadf2030746bd2/0/page-frame.html"
2018/11/06 17:33:16 [error] 4776#5532: *424 "E:/files/20181017/0a73f4e7-14b8-4ea6-8a67-ad71f6fd83ba.jpg/index.html" is not found (3: The system cannot find the path specified), client: 115.60.16.122, server: www.m.baidu.com, request: "GET /files/20181017/0a73f4e7-14b8-4ea6-8a67-ad71f6fd83ba.jpg/ HTTP/1.1", host: "www.m.baidu.com", referrer: "https://servicewechat.com/wx9fcadf2030746bd2/0/page-frame.html"
4. nginx配置
listen 443 ssl;
server_name www.baidu.com baidu.com;
if ($http_user_agent ~* "(Android|iPhone|Windows Phone|UC|Kindle)"){
return 301 https://www.m.baidu.com$request_uri;
}
日志和nginx配置信息中我个域名替换成baidu.com,能说明问题就行,在配置中判断如果是手机端访问,则return 301
配置二
listen 443 ssl;
server_name www.m.baidu.com m.baidu.com;
location ~/weixin/(card|files|wxxiaochengxuimgs) {
root E:\images;
}
微信小程序访问图片服务器,从baidu.com 301到m.baidu.com,然后直接读取硬盘图片资源
循环imagesList数组,image标签直接指向网络图片地址,网络协议是https,
- 复现路径
疑问:
1. IOS部分网络图片随机不显示,是服务器并发到最到拒绝?但我nginx设置的是
worker_rlimit_nofile 65535;
events {
worker_connections 65535;
}
2. nginx配置问题
但安卓和模拟器可以正常访问到图片
3. 404?
真机调试,console栏里什么都没输出,没任何错误
5. 图片路径在IOS上没赋值成功
打开Wxml查看好好的啊
已经查阅N多资料,折腾了两周,问题还没解决,或许就差那一点点,大神们和腾讯官方给协助一下,谢谢~~
微信小程序开发问题解答
本文网址:http://www.91bianli.com/weixinxiaochengxu/36933.html