微信开发,chooseImage接口问题

移动开发 码拜 9年前 (2016-04-14) 1636次浏览
 function chooseImg_Opinion() {
                wx.chooseImage({
                    success: function (res) {
                        showImgs_Opinion(res.localIds);
                    }
                });
            }
 function showImgs_Opinion(idArr) {
                if (idArr.length > 0) {
                    var count = OpinionLocalIds.length;
                    if (count <= 3) {
                        OpinionLocalIds = OpinionLocalIds.concat(idArr);
                        count = OpinionLocalIds.length;
                        var html = "";
                        if (count >= 3) {
                            OpinionLocalIds.splice(3, count);
                            count = 3;
                        }
                        var i = 0;
                        $(".OpinionImg").each(function () {
                            if (count > i) {
                                $(this).empty();
                                alert(OpinionLocalIds[i]);
                                var html = "<img style="width: 1em; position: absolute;" src="" + imgurl1 + "">";
                                html += "<img style="width: 80%;float: left;height: 4em;border-radius: 5px;" src="" + OpinionLocalIds[i] + "">";
                              
                                i++;
                                $(this).append(html);
                                $(this).unbind("click");
                            }
                        });
                        delImg_Opinion();
                    }
                }
            };

alert(OpinionLocalIds[i]);   已经得到:weixin://resourceid/******** 格式的值,无奈img标签就是没有显示图像!!!
还请各位大牛赐教….

解决方案

20

也遇到了这个问题,还是最近出现的,img设置src后显示一片白。假如你解决了麻烦share一下,谢谢啦。

20

换台手机就OK了,应该是客户端的问题。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明微信开发,chooseImage接口问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)