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 0a97e34..1c1e44f 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.js +++ b/packageD/pages/AI-test-skin/history_record/history_record.js @@ -188,7 +188,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + this.getHistoryData(); }, /** @@ -215,20 +215,22 @@ Page({ history_time, time_arr: new Array(), }; + let obj = { + time, + id, + }; 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 { + time_obj['time_arr'].push(obj); arr.push(time_obj); } } else { + time_obj['time_arr'].push(obj); arr.push(time_obj); } } @@ -280,7 +282,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { - this.getHistoryData(); + }, go_result(e) { let id = e.currentTarget.dataset.id; diff --git a/packageD/pages/AI-test-skin/success_result/acne/acne.wxml b/packageD/pages/AI-test-skin/success_result/acne/acne.wxml index 9fa7938..d9f1a84 100644 --- a/packageD/pages/AI-test-skin/success_result/acne/acne.wxml +++ b/packageD/pages/AI-test-skin/success_result/acne/acne.wxml @@ -4,7 +4,11 @@ #0{{acne_sort}} - 痤疮 + + + 痤疮 + + 问题标注 diff --git a/packageD/pages/AI-test-skin/success_result/dark/dark.wxml b/packageD/pages/AI-test-skin/success_result/dark/dark.wxml index 3e92d71..96f6dcf 100644 --- a/packageD/pages/AI-test-skin/success_result/dark/dark.wxml +++ b/packageD/pages/AI-test-skin/success_result/dark/dark.wxml @@ -4,7 +4,11 @@ #0{{dark_sort}} - 黑眼圈 + + + 黑眼圈 + + 问题标注 diff --git a/packageD/pages/AI-test-skin/success_result/pore/pore.wxml b/packageD/pages/AI-test-skin/success_result/pore/pore.wxml index f5ead0d..6f23a75 100644 --- a/packageD/pages/AI-test-skin/success_result/pore/pore.wxml +++ b/packageD/pages/AI-test-skin/success_result/pore/pore.wxml @@ -4,7 +4,10 @@ #0{{port_sort}} - 毛孔 + + 毛孔 + + 问题标注 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 50720bc..b6c6691 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-24 14:16:37 + * @LastEditTime: 2022-02-25 11:10:36 * @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 @@ -26,11 +26,15 @@ Page({ data: { tab: [{ id: 'zong_he', name: '综合肤质' }, { id: 'mao_kong', name: '毛孔' }, { id: 'hei_tou', name: '黑头' }, { id: 'se_ban', name: '色斑' }, { id: 'zhou_wen', name: '皱纹' }, { id: 'hei_yan_quan', name: '黑眼圈' }, { id: 'cuo_chuang', name: '痤疮' }, { id: 'min_gan_du', name: '敏感度' }], zhouwen_arr: [{ id: 1, name: '全部皱纹' }, { id: 2, name: '抬头纹' }, { id: 3, name: '川字纹' }, { id: 4, name: '眼周细纹' }, { id: 5, name: '鱼尾纹' }, { id: 6, name: '法令纹' }, { id: 7, name: '口周纹' }], - cuochuang_arr: [{ id: 1, name: '全部痤疮' }, { id: 2, name: '粉刺 ' }, { id: 3, name: '痘印 ' }, { id: 4, name: '脓包' }, { id: 5, name: '结节'}], + cuochuang_arr: [{ id: 1, name: '全部痤疮' }, { id: 2, name: '粉刺 ' }, { id: 3, name: '痘印 ' }, { id: 4, name: '脓包' }, { id: 5, name: '结节' }], + zhouwen_arr1: [{ id: 1, name: '皱纹/细纹',des:'是指皮肤受到外界环境影响,形成游离自由基,自由基破坏正常细胞膜组织内的胶原蛋白、活性物质,氧化细胞,或缺水而形成的小细纹,继而严重形成皱纹',sign: 'zhou1',sign1: 'zhou2' }, { id: 2, name: '抬头皱纹/抬头细纹',des:'位于额头的皱纹、细纹。形成原因因人而异,后天因素是比较少的。-般多为横纹, 竖纹较少见。' ,sign: 'zhou3',sign1:'zhou4'}, { id: 3, name: '眼部皱纹/眼部细纹',des:'眼部皱纹、细纹一般位于下眼睑部位,多见于下脸内1/3处。',sign:'zhou5',sign1:'zhou6' }, { id: 4, name: '鱼尾纹',des:'眼部皱纹的一种,是在人两侧外眼角和登角之间出现的皱纹,其纹路与鱼尾巴上的纹路很相似,故被形象地称为鱼尾纹。',sign:'zhou7',sign1:'zhou8' }, { id: 5, name: '眉间纹',des:'又叫川字纹,皱眉纹,是面部的一种正常的表情纹,随着年龄的增长,面部的皱纹会逐渐加深,双眉之间逐渐形成了较深的皱折,会使人看起来总是愁眉不展。',sign:'zhou9',sign1:'zhou10'}, { id: 6, name: '泪沟',des:'泪沟是指由内眼角开始出现在下眼睑靠鼻侧的两条凹沟,是由于眼眶隔膜下缘的软组织萎缩、下垂而生成的。',sign:'zhou11',sign1:'zhou12' }, { id: 7, name: '法令纹',des:'法令纹是位于鼻翼边延伸而下的两道纹路,是典型的皮肤组织老化、造成肌肤表面凹陷的现象。',sign:'zhou15',sign1:'zhou16' }, { id: 8, name: '口角纹',des:'口角纹又称木偶纹、括号纹,位于嘴角延伸而下的两道纹路,是表情肌、重力和遗传基因等几方面因素综合形成的。',sign:'zhou13',sign1:'zhou14' }], + cuochuang_arr1: [{ id: 1, name: '痘印,痘坑',des:'痤疮消退后留下的痕迹,- 般包括黑色痘印,红色痘印,凹洞性痘坑,增生性凸疤。', sign: 'cuo1',sign1: 'cuo2'}, { id: 2, name: '粉刺',des:'粉刺也称为白头,是毛囊漏斗部被角质层细胞堆积、堵塞,角化物质和皮脂充塞其中,形成白色丘疹,表面有表皮覆盖,与外界不相通,成为封闭式粉刺。(痤疮I级)', sign: 'cuo3',sign1: 'cuo4' }, { id: 3, name: '丘疹',des:'丘疹性痤疮是由皮损导致炎性弓|起的小米至豌豆大的坚硬的小丘疹,呈淡红色至深红色。丘疹中央可有一个黑头粉刺或顶端未变黑的皮脂栓。(痤疮II级)', sign: 'cuo5',sign1: 'cuo6' }, { id: 4, name: '结节囊肿',des:'表现为蚕豆至指甲大的炎性结节或囊肿,为重度痤疮,严重者可继发化脓感染、破溃流出血脓,后形成窦道及瘢痕。触摸有波动感。若面部相邻长着多个囊肿,可能通过皮下的“窦道"“暗通,可能需要手术解决。(痤疮IV级)',sign:'cuo7',sign1:'cuo8' }], heitanquan_arr: [{ id: 1, name: '综合情况' }, { id: 2, name: '左眼' }, { id: 3, name: '右眼' }], + heitanquan_arr1: [{ id: 1, name: '色素性黑眼圈', des: '呈茶褐色,是因眼裂向外眼角的延伸段有色素沉着或因先天或外来刺激导致眼周肤色黯沉。', sign: 'hei1',sign1: 'hei2' }, { id: 2, name: '血管性黑眼圈', des: '呈青紫色,由于眼周血液循环不良,下眼脸处皮肤与皮下脂肪变薄,皮下血管透出颜色形成的。', sign: 'hei3',sign1: 'hei4' }, { id: 3, name: '阴影型黑眼圈', des: '表现为眼袋膨出、泪沟凹陷。由于年龄的增长,眼周皮肤肌肉都会变得松弛,脂肪量变化而引起。', sign: 'hei5',sign1: 'hei6' }], currentIndex: 0, scroll_index: 0, - sex:'female', //female女 male男 + yiwen_index:0, + sex: 'female', //female女 male男 tab_id: 'zong_he', iurl: setting.imghost, showDialog: false, @@ -40,21 +44,21 @@ Page({ img_scale_icon: true, show_problem: 1, //问题标注显示问题 img_scale: 1, //缩放问题 - sex:'', - is_esys_show:0, //是不是显示眼睛 - scroll_id:1, //初始为1 - - wrinkle_num1:0, //抬头纹 - wrinkle_num2:0, //川字纹 - wrinkle_num3:0, //眼周细纹 - wrinkle_num4:0, //鱼尾纹 - wrinkle_num5:0, //法令纹 - wrinkle_num6:0, //口周纹 - - acne_num1:0, //粉刺 - acne_num2:0, //痘印 - acne_num3:0, //脓包 - acne_num4:0, //结节 + sex: '', + is_esys_show: 0, //是不是显示眼睛 + scroll_id: 1, //初始为1 + + wrinkle_num1: 0, //抬头纹 + wrinkle_num2: 0, //川字纹 + wrinkle_num3: 0, //眼周细纹 + wrinkle_num4: 0, //鱼尾纹 + wrinkle_num5: 0, //法令纹 + wrinkle_num6: 0, //口周纹 + yiwen_type:0, //1皱纹 2黑眼圈 3痤疮 + acne_num1: 0, //粉刺 + acne_num2: 0, //痘印 + acne_num3: 0, //脓包 + acne_num4: 0, //结节 }, /** @@ -74,7 +78,7 @@ Page({ th.data.cHeight = wx.getSystemInfoSync().windowHeight; th.data.face_height = th.data.cHeight * 0.8 * 0.75; - var bi1= (th.data.cHeight * 0.8 * 0.8)/(th.data.cWidth*0.8); + var bi1 = (th.data.cHeight * 0.8 * 0.8) / (th.data.cWidth * 0.8); this.get_data(function (json, json1, img) { //-- 数据先存着 -- var face_data = th.data.face_data = json.face_list[0]; @@ -94,8 +98,8 @@ Page({ var dark_type = face_data.eyesattr.dark_circle_left_type.length > 0 ? face_data.eyesattr.dark_circle_left_type[0] : -1; var dark_type1 = face_data.eyesattr.dark_circle_right_type.length > 0 ? face_data.eyesattr.dark_circle_right_type[0] : -1; - var dk_type1=dark_type; - var dk_type2=dark_type1; + var dk_type1 = dark_type; + var dk_type2 = dark_type1; if (dark_type1 > dark_type) { dark_type = dark_type1; } @@ -106,81 +110,81 @@ Page({ var bili = th.data.face_height / (location.height + location.height / 2.3); //获取眼睛的画图比例 - var eye_data1=face_data1.landmark150.eye_left_corner_right; - var eye_data2=face_data1.landmark150.eye_left_corner_left; - var eye_data3=face_data1.landmark150.eye_right_corner_left; - - var hei1=Math.abs(eye_data1.x-eye_data2.x); - var bili_eye = th.data.face_height /(2*hei1*bi1); - var eye_top=eye_data1.y-hei1*3/4 - var eye_left1=eye_data1.x-hei1/2; - var eye_left2=eye_data3.x-hei1-hei1/2; - - var skin_dryoil_check_type=0;//干性 - var skin_dryoil_check_arr=[] - for(let i in skin_dryoil_check){ - let item=skin_dryoil_check[i]; - if(item!='1' && skin_dryoil_check_arr.indexOf(item)==-1){ + var eye_data1 = face_data1.landmark150.eye_left_corner_right; + var eye_data2 = face_data1.landmark150.eye_left_corner_left; + var eye_data3 = face_data1.landmark150.eye_right_corner_left; + + var hei1 = Math.abs(eye_data1.x - eye_data2.x); + var bili_eye = th.data.face_height / (2 * hei1 * bi1); + var eye_top = eye_data1.y - hei1 * 3 / 4 + var eye_left1 = eye_data1.x - hei1 / 2; + var eye_left2 = eye_data3.x - hei1 - hei1 / 2; + + var skin_dryoil_check_type = 0;//干性 + var skin_dryoil_check_arr = [] + for (let i in skin_dryoil_check) { + let item = skin_dryoil_check[i]; + if (item != '1' && skin_dryoil_check_arr.indexOf(item) == -1) { skin_dryoil_check_arr.push(item); } } //皮肤干油性的判断 - if(skin_dryoil_check_arr.length==0) skin_dryoil_check_type=1; - else if(skin_dryoil_check_arr.length==1) skin_dryoil_check_type=parseInt(skin_dryoil_check_arr[0]); - else skin_dryoil_check_type=3; + if (skin_dryoil_check_arr.length == 0) skin_dryoil_check_type = 1; + else if (skin_dryoil_check_arr.length == 1) skin_dryoil_check_type = parseInt(skin_dryoil_check_arr[0]); + else skin_dryoil_check_type = 3; - var wrinkle_types=face_data.wrinkle.wrinkle_types; - var w_arr=wrinkle_types.filter(function (e) { - return e==1; + var wrinkle_types = face_data.wrinkle.wrinkle_types; + var w_arr = wrinkle_types.filter(function (e) { + return e == 1; }) - th.data.wrinkle_num1=w_arr.length; + th.data.wrinkle_num1 = w_arr.length; //皱纹的数量的统计 - w_arr=wrinkle_types.filter(function (e) { - return e==2; + w_arr = wrinkle_types.filter(function (e) { + return e == 2; }) - th.data.wrinkle_num2=w_arr.length; - w_arr=wrinkle_types.filter(function (e) { - return e==3; + th.data.wrinkle_num2 = w_arr.length; + w_arr = wrinkle_types.filter(function (e) { + return e == 3; }) - th.data.wrinkle_num3=w_arr.length; - w_arr=wrinkle_types.filter(function (e) { - return e==4; + th.data.wrinkle_num3 = w_arr.length; + w_arr = wrinkle_types.filter(function (e) { + return e == 4; }) - th.data.wrinkle_num4=w_arr.length; - w_arr=wrinkle_types.filter(function (e) { - return e==5; + th.data.wrinkle_num4 = w_arr.length; + w_arr = wrinkle_types.filter(function (e) { + return e == 5; }) - th.data.wrinkle_num5=w_arr.length; - w_arr=wrinkle_types.filter(function (e) { - return e==6; + th.data.wrinkle_num5 = w_arr.length; + w_arr = wrinkle_types.filter(function (e) { + return e == 6; }) - th.data.wrinkle_num6=w_arr.length; + th.data.wrinkle_num6 = w_arr.length; //痘痘的不同的统计 var acne_list = face_data.acnespotmole.acne_list; - var a_arr=acne_list.filter(function (e) { - return e.type==0; + var a_arr = acne_list.filter(function (e) { + return e.type == 0; }) - th.data.acne_num1=a_arr.length; - a_arr=acne_list.filter(function (e) { - return e.type==1; + th.data.acne_num1 = a_arr.length; + a_arr = acne_list.filter(function (e) { + return e.type == 1; }) - th.data.acne_num2=a_arr.length; - a_arr=acne_list.filter(function (e) { - return e.type==2; + th.data.acne_num2 = a_arr.length; + a_arr = acne_list.filter(function (e) { + return e.type == 2; }) - th.data.acne_num3=a_arr.length; - a_arr=acne_list.filter(function (e) { - return e.type==3; + th.data.acne_num3 = a_arr.length; + a_arr = acne_list.filter(function (e) { + return e.type == 3; }) - th.data.acne_num4=a_arr.length; + th.data.acne_num4 = a_arr.length; th.setData({ acne_num: acne_num, speckle_num: speckle_num, wrinkle_num: wrinkle_num, - wrinkle_types:wrinkle_types, //皱纹类型 + wrinkle_types: wrinkle_types, //皱纹类型 blackhead_num: blackhead_num, pore_num: pore_num, dark_type: dark_type, @@ -188,29 +192,29 @@ Page({ dark_type2: dk_type2, skin_sensitive_check: skin_sensitive_check, skin_dryoil_check: skin_dryoil_check, - skin_dryoil_check_type:skin_dryoil_check_type, + skin_dryoil_check_type: skin_dryoil_check_type, face_img: img, m_top: (location.top - location.height / 2.5) * bili, m_left: (location.left - location.width / 7) * bili, bili: bili, - bili_eye:bili_eye, - sex:sex, - skin_dryoil_check_type:skin_dryoil_check_type, - eye_top:eye_top, - eye_left1:eye_left1* bili_eye, - eye_left2:eye_left2* bili_eye, - - wrinkle_num1:th.data.wrinkle_num1, //抬头纹 - wrinkle_num2:th.data.wrinkle_num2, //川字纹 - wrinkle_num3:th.data.wrinkle_num3, //眼周细纹 - wrinkle_num4:th.data.wrinkle_num4, //鱼尾纹 - wrinkle_num5:th.data.wrinkle_num5, //法令纹 - wrinkle_num6:th.data.wrinkle_num6, //口周纹 - - acne_num1:th.data.acne_num1, //粉刺 - acne_num2:th.data.acne_num2, //痘印 - acne_num3:th.data.acne_num3, //脓包 - acne_num4:th.data.acne_num4, //结节 + bili_eye: bili_eye, + sex: sex, + skin_dryoil_check_type: skin_dryoil_check_type, + eye_top: eye_top, + eye_left1: eye_left1 * bili_eye, + eye_left2: eye_left2 * bili_eye, + + wrinkle_num1: th.data.wrinkle_num1, //抬头纹 + wrinkle_num2: th.data.wrinkle_num2, //川字纹 + wrinkle_num3: th.data.wrinkle_num3, //眼周细纹 + wrinkle_num4: th.data.wrinkle_num4, //鱼尾纹 + wrinkle_num5: th.data.wrinkle_num5, //法令纹 + wrinkle_num6: th.data.wrinkle_num6, //口周纹 + + acne_num1: th.data.acne_num1, //粉刺 + acne_num2: th.data.acne_num2, //痘印 + acne_num3: th.data.acne_num3, //脓包 + acne_num4: th.data.acne_num4, //结节 }) var sort = 1; //-- 调用毛孔的推荐函数 -- @@ -235,24 +239,24 @@ Page({ //-- 获取一下分享要用的图片 -- th.set_share_img(); acne.get_goods(th, setting.stoid); - let { heightRecord, tab } = th.data; - tab.forEach(item => { - console.log(2); - var query = th.createSelectorQuery(); - let class_name = `.${item['id']}`; - query.select(class_name).boundingClientRect(function (rect) { - // let ratio = 750 / rect.width; - let height = parseInt(rect.height); //加上导航栏50px - heightRecord.push(height); - // item['top'] = top; - }).exec(); - }); - heightRecord.sort((a, b) => { - return a - b; - }); - th.setData({ - heightRecord, - }) + // let { heightRecord, tab } = th.data; + // tab.forEach(item => { + // console.log(2); + // var query = th.createSelectorQuery(); + // let class_name = `.${item['id']}`; + // query.select(class_name).boundingClientRect(function (rect) { + // // let ratio = 750 / rect.width; + // let height = parseInt(rect.height); //加上导航栏50px + // heightRecord.push(height); + // // item['top'] = top; + // }).exec(); + // }); + // heightRecord.sort((a, b) => { + // return a - b; + // }); + // th.setData({ + // heightRecord, + // }) // setTimeout(() => { // heightRecord.sort((a, b) => { // return a - b; @@ -384,25 +388,25 @@ Page({ }, click_scroll(e) { - let { index, scroll_id} = e.currentTarget.dataset; + let { index, scroll_id } = e.currentTarget.dataset; this.setData({ scroll_index: index, scroll_id, }) //-- 如果是黑眼圈的控制 -- - if(this.data.show_type==5){ - switch (scroll_id){ - case 1: - this.setData({is_esys_show:0}) - break; - case 2: - this.setData({is_esys_show:1}) - break; - default: - this.setData({is_esys_show:2}) - break - } + if (this.data.show_type == 5) { + switch (scroll_id) { + case 1: + this.setData({ is_esys_show: 0 }) + break; + case 2: + this.setData({ is_esys_show: 1 }) + break; + default: + this.setData({ is_esys_show: 2 }) + break + } } }, @@ -427,7 +431,22 @@ Page({ this.setData({ img_scale: !this.data.img_scale, img_scale_icon: !this.data.yanjing, - ig_scale:1,img_top:0,img_left:0 + ig_scale: 1, img_top: 0, img_left: 0 + }) + }, + + click_yiwen_scroll(e) { + let { index, yiwen_id } = e.currentTarget.dataset; + this.setData({ + yiwen_index: index, + yiwen_id, + }) + }, + + close_yiwen(){ + this.setData({ + question_dialog:false, + yiwen_index:0, }) }, @@ -445,10 +464,10 @@ Page({ }, show_dailog(e) { - var th=this; + var th = this; var type = parseInt(e.currentTarget.dataset.type); this.setData({ - showDialog: true, show_type: type,is_esys_show:0,ig_scale:1,img_top:0,img_left:0,scroll_index:0,scroll_id:1 + showDialog: true, show_type: type, is_esys_show: 0, ig_scale: 1, img_top: 0, img_left: 0, scroll_index: 0, scroll_id: 1 }) switch (type) { case 1: //毛孔 @@ -461,10 +480,10 @@ Page({ break; case 3://皱纹 var wrinkle_list = this.data.face_data.wrinkle.wrinkle_data; - for(let i in wrinkle_list){ - let item=wrinkle_list[i]; + for (let i in wrinkle_list) { + let item = wrinkle_list[i]; item.map(function (e) { - e.w_type=th.data.wrinkle_types[i]; + e.w_type = th.data.wrinkle_types[i]; return e; }) } @@ -589,8 +608,8 @@ Page({ this.setData({ iwidth: imgwidth * th.data.bili, iheight: imgheight * th.data.bili, - eye_w:imgwidth*th.data.bili_eye, - eye_h:imgheight*th.data.bili_eye, + eye_w: imgwidth * th.data.bili_eye, + eye_h: imgheight * th.data.bili_eye, bili1: w / imgwidth //图片放大时候的比例 }) }, @@ -650,7 +669,7 @@ Page({ touchendCallback: function (e) { this.data.tc_end = 1; - }, + }, //--定义的保存图片方法,分享团--- saveImageToPhotosAlbum: function () { @@ -686,93 +705,93 @@ Page({ wx.getImageInfo({ src: path3, success: function (res) { - var b=1.1; - //获取到二维码的图片 - var vpath = res.path; - var context = wx.createCanvasContext('share'); - // 先画背景 - context.fillStyle = '#ebf6f8'; - // 灰色实心矩形 - // 1. 语法: x坐标, y坐标, 宽度, 高度 - context.fillRect(0,0,750 * rpx,1338 * rpx); - - context.setFontSize(20* rpx) - context.setFillStyle("#00d8e9") - context.fillText("官方检测认证", 28*b* rpx, 80*b* rpx); - - //两个底部颜色 - context.fillStyle = '#a7ecf5'; - context.fillRect(28 *b* rpx,136 *b* rpx,262 *b* rpx,18 *b* rpx); - context.fillRect(28 *b* rpx,194 *b* rpx,262 *b* rpx,18 *b* rpx); - - context.setFontSize(42*b*rpx) - context.setFillStyle("#070609") - context.fillText("我的肌底强韧", 30*b* rpx, 140*b* rpx); - context.fillText("肌肤鲜活润泽", 30*b* rpx, 196*b* rpx); - - //先画一个圆形 - th.circle(context,110*b*rpx, 280*b*rpx,140*b*rpx,"#e7f3f8"); - th.circle(context,130*b*rpx, 300*b*rpx,120*b*rpx,"#c8f2fa"); - //绘制人脸 - context.drawImage(th.data.share_head, 132*b*rpx, 310*b*rpx, 230*b* rpx, 230 *b* rpx); - - //左右俩个框并填充文字 - th.darwRoundRect(38 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context); - th.darwRoundRect(324 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context); - context.setFontSize(20*b*rpx) - context.setFillStyle("black") - context.fillText("黑眼圈 重度", 50*b* rpx, 368*b* rpx); - context.fillText("毛孔 "+th.data.pore_num, 336*b* rpx, 368*b* rpx); - - //左右俩个框并填充文字 - th.darwRoundRect(40 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context); - th.darwRoundRect(348 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context); - context.setFillStyle("black") - context.fillText("黑头 "+th.data.blackhead_num, 52*b* rpx, 440*b* rpx); - context.fillText("色斑 "+th.data.speckle_num, 354*b* rpx, 440*b* rpx); - - //左右俩个框并填充文字 - th.darwRoundRect(60 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context); - th.darwRoundRect(328 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context); - context.setFillStyle("black") - context.fillText("皱纹 "+th.data.wrinkle_num, 74*b* rpx, 510*b* rpx); - context.fillText("痤疮 "+th.data.acne_num, 344*b* rpx, 510*b* rpx); - - //底部的绘制 - th.darwRoundRect(38 *b* rpx,650*b*rpx,430*b*rpx,160*b*rpx,10*b*rpx,context); - //绘制二维码 - context.drawImage(vpath, 60*b*rpx, 672*b*rpx, 120 *b* rpx, 120 *b* rpx); - context.setFillStyle("black") - context.setFontSize(32*b*rpx) - context.fillText("美肤管家AI测肤", 200*b* rpx, 726*b* rpx); - context.setFontSize(22*b*rpx) - context.fillText("科学了解皮肤的真实状态", 200*b* rpx, 766*b* rpx); - - //把画板内容绘制成图片,并回调 画板图片路径 - context.draw(false, function () { - setTimeout(function () { - wx.canvasToTempFilePath({ - x: 0, - y: 0, - width: 750, - height: 1338, - destWidth: 1.4 * 750 * 750 / th.data.screenWidth, - destHeight: 1.4 * 750 * 750 / th.data.screenWidth, - canvasId: 'share', - success: function (res) { - that.setData({ - shareImgPath: res.tempFilePath, - canvasHidden: true, - share_show:1 - }) - return false; - - /*-- - wx.previewImage({ - //将图片预览出来 - ur--*/ - - wx.hideLoading(); + var b = 1.1; + //获取到二维码的图片 + var vpath = res.path; + var context = wx.createCanvasContext('share'); + // 先画背景 + context.fillStyle = '#ebf6f8'; + // 灰色实心矩形 + // 1. 语法: x坐标, y坐标, 宽度, 高度 + context.fillRect(0, 0, 750 * rpx, 1338 * rpx); + + context.setFontSize(20 * rpx) + context.setFillStyle("#00d8e9") + context.fillText("官方检测认证", 28 * b * rpx, 80 * b * rpx); + + //两个底部颜色 + context.fillStyle = '#a7ecf5'; + context.fillRect(28 * b * rpx, 136 * b * rpx, 262 * b * rpx, 18 * b * rpx); + context.fillRect(28 * b * rpx, 194 * b * rpx, 262 * b * rpx, 18 * b * rpx); + + context.setFontSize(42 * b * rpx) + context.setFillStyle("#070609") + context.fillText("我的肌底强韧", 30 * b * rpx, 140 * b * rpx); + context.fillText("肌肤鲜活润泽", 30 * b * rpx, 196 * b * rpx); + + //先画一个圆形 + th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8"); + th.circle(context, 130 * b * rpx, 300 * b * rpx, 120 * b * rpx, "#c8f2fa"); + //绘制人脸 + context.drawImage(th.data.share_head, 132 * b * rpx, 310 * b * rpx, 230 * b * rpx, 230 * b * rpx); + + //左右俩个框并填充文字 + th.darwRoundRect(38 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + th.darwRoundRect(324 * b * rpx, 340 * b * rpx, 140 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + context.setFontSize(20 * b * rpx) + context.setFillStyle("black") + context.fillText("黑眼圈 重度", 50 * b * rpx, 368 * b * rpx); + context.fillText("毛孔 " + th.data.pore_num, 336 * b * rpx, 368 * b * rpx); + + //左右俩个框并填充文字 + th.darwRoundRect(40 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + th.darwRoundRect(348 * b * rpx, 412 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + context.setFillStyle("black") + context.fillText("黑头 " + th.data.blackhead_num, 52 * b * rpx, 440 * b * rpx); + context.fillText("色斑 " + th.data.speckle_num, 354 * b * rpx, 440 * b * rpx); + + //左右俩个框并填充文字 + th.darwRoundRect(60 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + th.darwRoundRect(328 * b * rpx, 484 * b * rpx, 116 * b * rpx, 40 * b * rpx, 20 * b * rpx, context); + context.setFillStyle("black") + context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 510 * b * rpx); + context.fillText("痤疮 " + th.data.acne_num, 344 * b * rpx, 510 * b * rpx); + + //底部的绘制 + th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context); + //绘制二维码 + context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx); + context.setFillStyle("black") + context.setFontSize(32 * b * rpx) + context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx); + context.setFontSize(22 * b * rpx) + context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx); + + //把画板内容绘制成图片,并回调 画板图片路径 + context.draw(false, function () { + setTimeout(function () { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: 750, + height: 1338, + destWidth: 1.4 * 750 * 750 / th.data.screenWidth, + destHeight: 1.4 * 750 * 750 / th.data.screenWidth, + canvasId: 'share', + success: function (res) { + that.setData({ + shareImgPath: res.tempFilePath, + canvasHidden: true, + share_show: 1 + }) + return false; + + /*-- + wx.previewImage({ + //将图片预览出来 + ur--*/ + + wx.hideLoading(); } }) }, 500) @@ -933,6 +952,14 @@ Page({ }) }, + show_yiwen_dialog(e) { + let yiwen_type = e.currentTarget.dataset.yiwen_type; + this.setData({ + question_dialog: true, + yiwen_type, + }) + }, + //-----领取券----- get_quan: function (e) { 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 3c7619d..d8946b6 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.wxml +++ b/packageD/pages/AI-test-skin/success_result/success_result.wxml @@ -70,8 +70,8 @@ {{s_filter.get_dryoil_check(skin_dryoil_check_type)}} - 干性区 - 油性区 + 干性区 + 油性区 你的皮肤油脂过剩,部分干燥,容易引发皮肤问题。日常可使用一些具有控油和补水功效产品,帮助调理肌肤 @@ -119,7 +119,7 @@ - +