已确认是写法问题,如果是以前那我不清楚。 请在获取参数以后,不要使用this.info,this在这里是有问题的,拿不到。需要先将this托管,然后拿数据。
channel-live 不显示问题?channel-live 组件不显示,小程序 与视频号 确认是一个主体,开发工具 基础库 2.29.2,feed-id,finder-user-name 都正确,为什么不显示呢?也没有错误提示。
2023-11-30我检查了一下,这个组没有问题,在VUE里面也正常。我是VUE3,也是不显示,但是后来我检查发现,宣染中,没有参数。于是我写了死参数进去,又看到正常,最后总结,这是data里面的传参问题。也就是this的锅,我把this出来就接管了。然后重新跑了一下,正常跑起来啦。
视频号嵌套小程序 channel-live不显示?确认小程序和视频号 主体是一致的 feed-id和finder-user-name也是正确的 feed-id是从wx.getChannelsLiveInfo回调获取的 <view style="width: 375px; height: 500px"> <channel-live :feed-id="state.feedId" finder-user-name="xxxxxxxxxxxxx"></channel-live> </view> 写了channel-live标签 就是不显示内容 很奇怪
2023-11-30到底是为啥
异步加载图片出现Failed to load image无法加载图片问题,请问怎么解决?相关帖无法解图片链接复制到浏览器正常显示,直接卸载src标签里面也可以正常显示,求指教! 服务器自己的,没开防盗链!!! 报错提示 Failed to load image https://www.kjch.xyz/update2/images/wx90694dade63fe709.o6zAJs6GT7ALFlx70UXyHFtL_xuU.lkPgh3cgzSpG2f3d906f016e21895d4ade0976ff6d5c.png the server responded with a status of 404 (HTTP/1.1 404) From server 120.79.54.134 完整代码 [代码]<!--index.wxml-->[代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"container"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]button[代码] [代码]bindtap[代码][代码]=[代码][代码]'chooseImageTap'[代码][代码]>上传图片</[代码][代码]button[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{xyz!=null}}"[代码][代码]>[代码][代码] [代码][代码]<!--<image src="{{(xyz)?xyz:'640.jpg;'}}"></image>-->[代码][代码] [代码][代码]<[代码][代码]image[代码] [代码]src[代码][代码]=[代码][代码]"{{xyz}}"[代码][代码]></[代码][代码]image[代码][代码]>[代码][代码] [代码][代码]{{xyz}}[代码][代码] [代码][代码]</[代码][代码]view[代码][代码]>[代码] [代码]</[代码][代码]view[代码][代码]>[代码]JS代码 [代码]//index.js[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]imgs: [],[代码][代码]//本地图片地址数组[代码][代码] [代码][代码]picPaths: [],[代码][代码]//网络路径[代码][代码] [代码][代码]xyz: [代码][代码]"null"[代码][代码],[代码][代码] [代码][代码]abc: [代码][代码]null[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]//添加上传图片[代码][代码] [代码][代码]chooseImageTap: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.showActionSheet({[代码][代码] [代码][代码]itemList: [[代码][代码]'从相册中选择'[代码][代码], [代码][代码]'拍照'[代码][代码]],[代码][代码] [代码][代码]itemColor: [代码][代码]"#00000"[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]if[代码] [代码](!res.cancel) {[代码][代码] [代码][代码]if[代码] [代码](res.tapIndex == 0) {[代码][代码] [代码][代码]that.chooseWxImage([代码][代码]'album'[代码][代码])[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]if[代码] [代码](res.tapIndex == 1) {[代码][代码] [代码][代码]that.chooseWxImage([代码][代码]'camera'[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]// 图片本地路径[代码][代码] [代码][代码]chooseWxImage: [代码][代码]function[代码] [代码](type) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]var[代码] [代码]imgsPaths = that.data.imgs;[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]],[代码][代码] [代码][代码]sourceType: [type],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log(res.tempFilePaths[0]);[代码][代码] [代码][代码]that.upImgs(res.tempFilePaths[0], 0) [代码][代码]//调用上传方法[代码][代码] [代码][代码]console.log(res.tempFilePaths[0])[代码][代码] [代码][代码]that.abc(res.tempFilePaths[0])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]//上传服务器[代码][代码] [代码][代码]upImgs: [代码][代码]function[代码] [代码](imgurl, index) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.uploadFile({[代码][代码] [代码][代码]url: [代码][代码]'https://www.kjch.xyz/update2/uploadFile.do'[代码][代码],//[代码][代码] [代码][代码]filePath: imgurl,[代码][代码] [代码][代码]name: [代码][代码]'file'[代码][代码],[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type'[代码][代码]: [代码][代码]'multipart/form-data'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]formData: [代码][代码]null[代码][代码],[代码][代码] [代码][代码]success: [代码][代码]function[代码] [代码](res) {[代码][代码] [代码][代码]console.log([代码][代码]"返回值:"[代码] [代码]+ res) [代码][代码]//接口返回网络路径[代码][代码] [代码][代码]var[代码] [代码]data = JSON.parse(res.data)[代码][代码] [代码][代码]that.data.picPaths.push(data[[代码][代码]'msg'[代码][代码]])[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]picPaths: that.data.picPaths,[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(that.data.picPaths)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]abc: [代码][代码]function[代码] [代码](e) {[代码][代码]//该函数用于和后台交互[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: [代码][代码]'https://www.kjch.xyz/update2/url'[代码][代码], //仅为示例,并非真实的接口地址[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]URL: e,[代码][代码] [代码][代码]},[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type'[代码][代码]: [代码][代码]'application/json'[代码] [代码]// 默认值[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]"abc返回值:"[代码] [代码]+ res.data);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]xyz: res.data[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log(that.xyz)[代码][代码] [代码][代码]}[代码] [代码]})[代码] 报错提示: [图片]
2023-06-06这问题不是问了个寂莫吗,到底也没有解决啊。几年了啊
已确认图片存在 报错Failed to load image 且图片不显示 请问是为什么呀?image 标签 调试基础库为2.2.0 Failed to load image 正确链接(浏览器可打开,点击大图也可查看) net::ERR_EMPTY_RESPONSE
2023-06-06