wx.showLoading({ title: '请稍等...', mask: true }) //开始上传 if (length == 0) { //无图片的上传 // 上传参数 var params = { coach_code: that.data.coach_code, uc_code: uc_code, tag_codes: that.data.tag_codes, content: content, imgs: [], avatar:avatar, name:name }; that.onSending(params); }else{ this.data.filePaths.forEach(function (value, index){ wx.uploadFile({ url: config.upload_url, filePath: value, name: config.upload_name, sizeType: "compressed", success: function (res) { count++; clouds.push(JSON.parse(res.data).response.cloud); if (count == length) { // 上传参数 var params = { coach_code: that.data.coach_code, uc_code: uc_code, tag_codes: that.data.tag_codes, content: content, imgs: clouds, avatar:avatar, name:name }; that.onSending(params); } }, fail:function(fail){ wx.hideLoading(); wx.showModal({ title: '提示', content: '图片上传出错', showCancel:true }) that.setData({ can_sub: true }); } }); }); } }, 上传图片也是,还没hideing 闪一下就没了
wx.showLoading一闪就没了iO当前最新版本编辑器 调用wx.showLoading方法:模拟器没问题 不调用去除方法一直在,但是在真机 我没有调用去除loading方法一闪就没了,真机调试模式并没有报错,我给所有去除loading方法加了输出,也没有调用去除loading方法,那loading怎么就一闪就没了啊 求大佬指点迷津
2018-09-21解决了,是因为我要绘制两张图片,有一种图片没有返回 https
getImageInfo 关闭调试不执行,设置了downloadFile 合法域wx.getImageInfo({ src: tool_img, success:function(res){ ctx.drawImage(res.path, 0, 0, that.data.img_info.width, that.data.img_info.hight); wx.getImageInfo({ src: coach_qr_code, success:function(res1){ //绘制一个 文字背景 ctx.setFillStyle('rgba(255, 255, 255, 0.8)'); ctx.fillRect(coach_x, coach_y, 180, 160); //二维码 ctx.drawImage(res1.path, qrcode_x, qrcode_y, 165, 165); //驾校名称 ctx.setFontSize(26); ctx.setFillStyle('#2C2C2C'); ctx.fillText(shool_name, coach_x + 20, coach_y + 50); //教练名称 ctx.setFontSize(24); ctx.setFillStyle('#2C2C2C'); ctx.fillText(coach_name, coach_x + 20, coach_y + 90); //电话 ctx.setFontSize(24); ctx.setFillStyle('#2C2C2C'); ctx.fillText(mobile, coach_x + 20, coach_y + 130); //绘制不显示 ctx.draw(true, setTimeout(function () { wx.canvasToTempFilePath({ canvasId: 'down_canvas', destWidth: that.data.img_info.width, destHeight: that.data.img_info.hight, success: function (res) { //隐藏 loading 页 wx.hideLoading(); that.setData({ tempFilePath: res.tempFilePath, }); //回调 callBack(); } }, this); }, 100)); }, fail:function(msg){ wx.showToast({ icon: "none", title: '图片绘制出错', }) wx.hideLoading(); } }) }, fail:function(msg){ wx.showToast({ icon: "none", title: '图片绘制出错', }) wx.hideLoading(); } })
2018-09-11