From cff379c2766f1eabe9c9f4586f0470d684f71df9 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Fri, 11 Mar 2022 09:28:36 +0800 Subject: [PATCH] 选择图片,避免重复点击 --- packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js | 8 ++++++-- packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxml | 2 +- packageD/pages/AI-test-skin/shoot_notice/shoot_notice.wxss | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) 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..5aec0f9 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, @@ -185,6 +188,7 @@ Page({ fileType: 'jpg', success: function (res) { console.log(res.tempFilePath)//最终图片路径 + that.setData({selecting:0}) that.setData({ canvasImgUrl: res.tempFilePath }); @@ -196,9 +200,9 @@ Page({ app.goto(url); }, fail: function (res) { + that.setData({selecting:0}) console.log("缩放图片失败"); console.log(res.errMsg) - wx.hideLoading(); wx.showToast({ title: '识别图片失败', image: '../../utils/img/wrong.png', @@ -214,7 +218,7 @@ Page({ 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 { -- libgit2 0.21.4