diff --git a/packageB/pages/AI-test-skin/select_photo/select_photo.js b/packageB/pages/AI-test-skin/select_photo/select_photo.js index 0d8f7e3..1abde09 100644 --- a/packageB/pages/AI-test-skin/select_photo/select_photo.js +++ b/packageB/pages/AI-test-skin/select_photo/select_photo.js @@ -19,33 +19,21 @@ Page({ */ data: { iurl: setting.imghost, + gl_skin_img: null, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - + var img=getApp().globalData.skin_img; + this.setData({gl_skin_img:img}) }, /** * 生命周期函数--监听页面显示 */ - onShow: function () { - - }, - - goto(){ - let url = "/packageB/pages/AI-test-skin/analyse/analyse"; //跳到分析页 - app.goto(url); - }, + onShow: function () {}, /** * 生命周期函数--监听页面隐藏 @@ -53,32 +41,63 @@ Page({ onHide: function () { }, - /** - * 生命周期函数--监听页面卸载 + * 页面上拉触底事件的处理函数 */ - onUnload: function () { + onReachBottom: function () { }, /** - * 页面相关事件处理函数--监听用户下拉动作 + * 用户点击右上角分享 */ - onPullDownRefresh: function () { + onShareAppMessage: function () { }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { + //-- 完成选择 -- + ok_select:function () { + var th=this; + app.request.uploadFile("/api/weshop/baidubce/face/uploadImg?uploadPath=faceimg&storeId="+setting.stoid, { + filePath: th.data.gl_skin_img, + name: "file", + success: function (e) { + if(e.data.code==0) { + getApp().globalData.face_img=e.data.data.img; + getApp().globalData.face_SourceImg=e.data.data.SourceImg; + + let url = "/packageB/pages/AI-test-skin/analyse/analyse"; //跳到分析页 + app.goto(url); + + } else { + wx.showToast({ + title: e.data.msg, + icon: 'success', + duration: 2000 + }); + }; + } + }); + }, + + //-- 重新从相册中选择图片 -- + show_pai_pop:function () { + var th=this; + //选择和拍照一张图片 + wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success (res) { + let imgArr = res.tempFilePaths; + getApp().globalData.skin_img=imgArr[0]; + th.setData({gl_skin_img:imgArr[0]}) + } + }) }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - } + + }) \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/select_photo/select_photo.json b/packageB/pages/AI-test-skin/select_photo/select_photo.json index 8835af0..64a8e6e 100644 --- a/packageB/pages/AI-test-skin/select_photo/select_photo.json +++ b/packageB/pages/AI-test-skin/select_photo/select_photo.json @@ -1,3 +1,4 @@ { - "usingComponents": {} + "usingComponents": {}, + "navigationBarTitleText": "确认图片" } \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/select_photo/select_photo.wxml b/packageB/pages/AI-test-skin/select_photo/select_photo.wxml index 4eef5e5..b9fd5d9 100644 --- a/packageB/pages/AI-test-skin/select_photo/select_photo.wxml +++ b/packageB/pages/AI-test-skin/select_photo/select_photo.wxml @@ -1,13 +1,13 @@ - + - - - 重拍 + + + 重拍 - + 完成 diff --git a/packageB/pages/AI-test-skin/select_photo/select_photo.wxss b/packageB/pages/AI-test-skin/select_photo/select_photo.wxss index 22c7e8a..cc1af5f 100644 --- a/packageB/pages/AI-test-skin/select_photo/select_photo.wxss +++ b/packageB/pages/AI-test-skin/select_photo/select_photo.wxss @@ -13,6 +13,7 @@ page { margin-top: 80rpx; display: flex; justify-content: space-between; + align-items: center; } .foot_btn .reset_select { diff --git a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.js b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.js index 9d3a9ef..18d429a 100644 --- a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.js +++ b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.js @@ -29,22 +29,11 @@ Page({ }, /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** * 生命周期函数--监听页面显示 */ onShow: function () { }, - goto(){ - let url = "/packageB/pages/AI-test-skin/select_photo/select_photo"; - app.goto(url); - }, /** * 生命周期函数--监听页面隐藏 @@ -54,13 +43,6 @@ Page({ }, /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { @@ -79,5 +61,26 @@ Page({ */ onShareAppMessage: function () { - } + }, + + //从相册中选择图片 + show_pai_pop:function () { + //选择和拍照一张图片 + wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success (res) { + let imgArr = res.tempFilePaths; + getApp().globalData.skin_img=imgArr[0]; + let url = "/packageB/pages/AI-test-skin/select_photo/select_photo"; + app.goto(url); + } + }) + + }, + + + + }) \ No newline at end of file diff --git a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml index 2391057..4c2e7e7 100644 --- a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml +++ b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxml @@ -51,9 +51,7 @@ - - 准备闭眼拍摄 - + 准备闭眼拍摄 如无闭眼,将导致图片分析失败 diff --git a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxss b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxss index 3a5ae21..5199c48 100644 --- a/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxss +++ b/packageB/pages/AI-test-skin/shoot_notice/shoot_notice.wxss @@ -2,11 +2,11 @@ page { width: 100vw; height: 100%; - padding: 40rpx 30rpx 0 30rpx; + /*padding: 40rpx 30rpx 0 30rpx;*/ box-sizing: border-box; background-color: #e7f5fb; } - +.page_set{padding: 40rpx 30rpx 0 30rpx;} .content { width: 100%; /* height: 100%; */ @@ -90,4 +90,45 @@ page { text-align: center; color: red; font-size: 28rpx; -} \ No newline at end of file +} + +.cover-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; +} + +.flex{display: flex} +.jc-center{ + justify-content: center; +} +.ac{align-items: center} +.pai_content{ + position: fixed;z-index: 100;bottom: 0;background: #FFFFFF;width: 100%; + border-top-left-radius:30rpx; + border-top-right-radius:30rpx; +} +.p_item{ height: 100rpx; line-height: 100rpx;text-align: center; border-bottom: 1rpx solid #eee} +.p_cancle{height: 100rpx; line-height: 100rpx;text-align: center; border-top:20rpx solid #f8f8f8;} + +@keyframes p_up +{ + from {transform:translateY(100%);} + to {transform:translateY(0);} +} + +@keyframes p_down +{ + from {transform:translateY(0);} + to {transform:translateY(100%);} +} +.p_to_up{animation:p_up 1s;} +.p_to_down{animation:p_down 0.5s;} + +