diff --git a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js index 8dc2547..2472a3b 100644 --- a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js +++ b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js @@ -100,6 +100,7 @@ Page({ takePhoto() { var that = this; getApp().globalData.no_clear=1; + that.setData({selecting:1}); wx.chooseImage({ count: 1, sizeType: ['compressed'], @@ -119,6 +120,7 @@ Page({ }, fail(err) { + that.setData({selecting:0}) console.log(err); } }) @@ -144,6 +146,7 @@ Page({ var that = this; //size小于100kb 时 直接转码识别 if (size < 1024) { + that.setData({selecting:0}) getApp().globalData.skin_img_info = { path:img, size, @@ -154,12 +157,15 @@ Page({ return; } + wx.showLoading({ + title:'处理中', + mask: true + }); //先获取图片 然后根据长宽 缩小 之后获取图片 wx.getImageInfo({ src: img, success(res) { - console.log(res.width) - console.log(res.height) + var ratio = size / 1024; size1 = size1 / ratio; var canvasWidth = res.width //图片原始长宽 @@ -184,7 +190,7 @@ Page({ destHeight: canvasHeight, fileType: 'jpg', success: function (res) { - console.log(res.tempFilePath)//最终图片路径 + wx.hideLoading(); that.setData({ canvasImgUrl: res.tempFilePath }); @@ -196,9 +202,8 @@ Page({ app.goto(url); }, fail: function (res) { - console.log("缩放图片失败"); - console.log(res.errMsg) wx.hideLoading(); + that.setData({selecting:0}) wx.showToast({ title: '识别图片失败', image: '../../utils/img/wrong.png', @@ -212,9 +217,8 @@ Page({ }, 1000)) //留一定的时间绘制canvas 否则会报错fail canvas is empty }, fail: function (res) { - console.log("获取图片失败"); - console.log(res.errMsg) wx.hideLoading(); + that.setData({selecting:0}) wx.showToast({ title: '识别图片失败', image: '../../utils/img/wrong.png', diff --git a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml index bf3b8e6..c0f41f1 100644 --- a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml +++ b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml @@ -55,7 +55,7 @@ - 准备闭眼拍摄 + 准备闭眼拍摄 如无闭眼,将导致图片分析失败 diff --git a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss index 3b40331..a1ab4ed 100644 --- a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss +++ b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss @@ -103,6 +103,7 @@ page { text-align: center; border-radius: 50rpx; color: #fff; + display: block; } .btn_fixed {