From e88d3aff0947f82682c212a5a8b8113eb013a930 Mon Sep 17 00:00:00 2001 From: abson Date: Wed, 23 Feb 2022 10:20:49 +0800 Subject: [PATCH] 测肤报告分享海报 --- packageD/pages/AI-test-skin/history_record/history_record.js | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- packageD/pages/AI-test-skin/history_record/history_record.wxml | 56 +++++--------------------------------------------------- packageD/pages/AI-test-skin/success_result/success_result.js | 12 +++++++++++- packageD/pages/AI-test-skin/success_result/success_result.wxml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- packageD/pages/AI-test-skin/success_result/success_result.wxss | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 211 insertions(+), 79 deletions(-) diff --git a/packageD/pages/AI-test-skin/history_record/history_record.js b/packageD/pages/AI-test-skin/history_record/history_record.js index 60e8503..dac750e 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.js +++ b/packageD/pages/AI-test-skin/history_record/history_record.js @@ -10,15 +10,15 @@ let initChart = null; const option = { backgroundColor: 'white', tooltip: {}, - grid:{ + grid: { // left:'20%', - top:'30%', + top: '30%', // right:'10%' }, legend: { icon: 'circle', - itemWidth: 5, - itemHeight: 5, + itemWidth: 5, + itemHeight: 5, selected: { '综合': true, '毛孔': false, @@ -29,7 +29,7 @@ const option = { '敏感度': false, '黑眼圈': false, }, - padding:[20,50], + padding: [20, 50], data: [ { name: '综合', @@ -183,7 +183,57 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + let url = `/api/weshop/face/storeSkinface/page`; + app.request.promiseGet(url, { + isShowLoading: true, + data: { + store_id: setting.stoid, + user_id: os.user_id, + } + }).then(res => { + console.log('111111111', res); + if (ut.ajax_ok(res)) { + let data = res.data.data.pageData; + let arr = []; + for (let i = 0; i < data.length; i++) { + let history = data[i]; + let id = history.id; + let now = new Date(history['addtime'] * 1000); + let year = now.getFullYear(); //年 + let month = (now.getMonth() + 1).toString().padStart(2, 0); //月 + let day = (now.getDate()).toString().padStart(2, 0); //日 + let hour = (now.getHours()).toString().padStart(2, 0); //时 + let minute = (now.getMinutes()).toString().padStart(2, 0); //分 + let history_time = `${year}年${month}月`; + let time = `${year}/${month}/${day} ${hour}:${minute}`; + let time_obj = { + history_time, + time_arr: new Array(), + }; + if (arr.length > 0) { + let index = arr.findIndex(item => { + return item['history_time'] === history_time; + }) + if (index > -1) { + let obj = { + time, + id, + }; + arr[index]['time_arr'].push(obj); + } else { + arr.push(time_obj); + } + } else { + arr.push(time_obj); + } + } + this.setData({ + history: arr, + }) + initChart.setOption(option); + } + }) }, /** @@ -192,17 +242,18 @@ Page({ onReady: function () { }, - initChartOption() { - initChart.setOption(option); - }, + /** * 生命周期函数--监听页面显示 */ onShow: function () { setTimeout(() => { - initChart.setOption(option); + }, 1000); }, + go_result(e) { + + }, /** * 生命周期函数--监听页面隐藏 diff --git a/packageD/pages/AI-test-skin/history_record/history_record.wxml b/packageD/pages/AI-test-skin/history_record/history_record.wxml index 3faa719..c0211fa 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.wxml +++ b/packageD/pages/AI-test-skin/history_record/history_record.wxml @@ -11,57 +11,11 @@ 历史报告 - - 2022年02月 - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - 2022/02/19 15:35 - 73分 - - - - 2022年02月 - - 2022/02/19 15:35 - 73分 - - - - 2022年02月 - - 2022/02/19 15:35 - 73分 + + {{item.time}} + + {{subitem}} + 去查看 diff --git a/packageD/pages/AI-test-skin/success_result/success_result.js b/packageD/pages/AI-test-skin/success_result/success_result.js index 92ed3f3..8d68cfd 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.js +++ b/packageD/pages/AI-test-skin/success_result/success_result.js @@ -1,7 +1,7 @@ /* * @Author: abson * @Date: 2022-02-16 15:36:47 - * @LastEditTime: 2022-02-22 16:16:59 + * @LastEditTime: 2022-02-22 20:52:12 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js @@ -285,6 +285,8 @@ Page({ close_dialog() { this.setData({ showDialog: false, + share_flag:false, + img_scale:true, }) }, @@ -362,6 +364,14 @@ Page({ }) }, + click_share(){ + this.setData({ + share_flag:true, + img_scale:false, + showDialog:true, + }) + }, + //图片加载的时候,计算图片的像素大小 face_img_load: function (e) { var th = this; diff --git a/packageD/pages/AI-test-skin/success_result/success_result.wxml b/packageD/pages/AI-test-skin/success_result/success_result.wxml index ebffcb0..1462986 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.wxml +++ b/packageD/pages/AI-test-skin/success_result/success_result.wxml @@ -97,11 +97,12 @@ - + + + + + + + + @@ -207,7 +245,7 @@ - + @@ -215,7 +253,7 @@ - + @@ -224,7 +262,7 @@ - + diff --git a/packageD/pages/AI-test-skin/success_result/success_result.wxss b/packageD/pages/AI-test-skin/success_result/success_result.wxss index b54eff4..c204f36 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.wxss +++ b/packageD/pages/AI-test-skin/success_result/success_result.wxss @@ -51,6 +51,13 @@ page { justify-content: center; /* justify-content: space-evenly; */ } +.analyse1 { + display: flex; + align-items: center; + margin: 50rpx 0 100rpx 0; + justify-content: center; + /* justify-content: space-evenly; */ +} .analyse .mark { padding: 4rpx 12rpx; @@ -58,6 +65,12 @@ page { background: #fff; border-radius: 20rpx; } +.analyse1 .mark1 { + padding: 3rpx; + font-size: 24rpx; + background: #fff; + border-radius: 20rpx; +} .analyse .analyse_left { position: relative; @@ -72,6 +85,23 @@ page { width: 400rpx; height: 400rpx; } +.analyse1 .analyse_center1 { + position: relative; + background: #c9f0f9; + border-radius: 50%; + width: 300rpx; + height: 300rpx; +} +.analyse1 .analyse_left1 { + position: relative; + right: -25rpx; + z-index: 2; +} +.analyse1 .analyse_right1 { + position: relative; + right: 25rpx; + z-index: 2; +} .analyse_center .lianxian { position: absolute; @@ -303,6 +333,21 @@ page { background-color: rgb(193 235 241 / 50%) } +.renzheng { + position: relative; + font-size: 38rpx; + font-weight: 600; +} +.renzheng::after { + position: absolute; + content: ""; + bottom: 0; + display: block; + width: 100%; + height: 20rpx; + background-color: rgb(193 235 241 / 50%) +} + .analyse_classify_foot .shoushu { padding: 5%; display: flex; @@ -418,7 +463,7 @@ page { justify-content: center; align-items: center; color: #fff; - background-color: #1f1919; + background-color: #333; border-radius: 50%; width: 50rpx; height: 50rpx; @@ -547,10 +592,44 @@ page { background: #fff; } -.abs{position: absolute} -.p_circle{ border: 1rpx solid #c8162c;border-radius: 50%} -.p_point{background-color:#c8162c;height:2px;width:2px} +.abs { + position: absolute +} + +.p_circle { + border: 1rpx solid #c8162c; + border-radius: 50% +} + +.p_point { + background-color: #c8162c; + height: 2px; + width: 2px +} .xc-spacing { letter-spacing: 4rpx; +} + +.share_dialog { + background: #e8f5fd; + height: 100%; + padding: 40rpx; + display: flex; + flex-direction: column; + justify-content: space-around; +} + +.share_dialog .share_dialog_center { + width: 400rpx; + height: 400rpx; + margin: 30rpx 0; + align-self: center; +} + +.share_dialog .share_dialog_bottom { + background: #fff; + display: flex; + padding: 30rpx; + border-radius: 20rpx; } \ No newline at end of file -- libgit2 0.21.4