-
mentioned in commit 80a321757e2b60d26faa4797370504cd23be29d8
-
Status changed to merged
Showing
2 changed files
packageD/pages/AI-test-skin/analyse/analyse.js
... | ... | @@ -557,6 +557,61 @@ Page({ |
557 | 557 | detectjson: JSON.stringify(th.data.check_data), |
558 | 558 | skin_type: 0, |
559 | 559 | } |
560 | + | |
561 | + var txt=[]; | |
562 | + var face_data = res.data.data.face_list[0]; | |
563 | + //痤疮数 | |
564 | + var acne_num = face_data.acnespotmole.acne_num; | |
565 | + //色斑数 | |
566 | + var speckle_num = face_data.acnespotmole.speckle_num; | |
567 | + //皱纹数 | |
568 | + var wrinkle_num = face_data.wrinkle.wrinkle_num; | |
569 | + //黑头数 | |
570 | + var blackhead_num = face_data.blackheadpore.blackhead_num; | |
571 | + //毛孔数 | |
572 | + var pore_num = face_data.blackheadpore.pore_num; | |
573 | + //黑眼圈的严重程度 | |
574 | + var dark_type = face_data.eyesattr.dark_circle_left_type.length > 0 ? face_data.eyesattr.dark_circle_left_type[0] : -1; | |
575 | + var dark_type1 = face_data.eyesattr.dark_circle_right_type.length > 0 ? face_data.eyesattr.dark_circle_right_type[0] : -1; | |
576 | + | |
577 | + var skin_dryoil_check = face_data.skinquality.skin_dryoil_check; | |
578 | + var skin_dryoil_check_type = 0;//干性 | |
579 | + var skin_dryoil_check_arr = [] | |
580 | + for (let i in skin_dryoil_check) { | |
581 | + let item = skin_dryoil_check[i]; | |
582 | + if (item != '1' && skin_dryoil_check_arr.indexOf(item) == -1) { | |
583 | + skin_dryoil_check_arr.push(item); | |
584 | + } | |
585 | + } | |
586 | + //皮肤干油性的判断 | |
587 | + if (skin_dryoil_check_arr.length == 0) skin_dryoil_check_type = 1; | |
588 | + else if (skin_dryoil_check_arr.length == 1) skin_dryoil_check_type = parseInt(skin_dryoil_check_arr[0]); | |
589 | + else skin_dryoil_check_type = 3; | |
590 | + | |
591 | + switch (skin_dryoil_check_type) { | |
592 | + case 0: | |
593 | + txt.push('干性'); | |
594 | + break; | |
595 | + case 1: | |
596 | + txt.push('中性'); | |
597 | + break; | |
598 | + case 2: | |
599 | + txt.push('油性'); | |
600 | + break; | |
601 | + case 3: | |
602 | + txt.push('混合性'); | |
603 | + break; | |
604 | + } | |
605 | + | |
606 | + if (acne_num) txt.push('痤疮'); | |
607 | + if (speckle_num) txt.push('色斑'); | |
608 | + if (wrinkle_num) txt.push('皱纹'); | |
609 | + if (blackhead_num) txt.push('黑头'); | |
610 | + if (pore_num) txt.push('毛孔'); | |
611 | + if (dark_type > -1 || dark_type1 > -1) txt.push('黑眼圈'); | |
612 | + //-- 内容传值 -- | |
613 | + req_data.resulttext= txt.join('/'); | |
614 | + | |
560 | 615 | //要保存一下分析的结果 |
561 | 616 | th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) { |
562 | 617 | if (res.data.code == 0) { | ... | ... |
packageD/pages/AI-test-skin/index/aiskin.js
... | ... | @@ -63,14 +63,13 @@ Page({ |
63 | 63 | }, |
64 | 64 | |
65 | 65 | goto(e) { |
66 | - | |
66 | + var that=this; | |
67 | 67 | var need=e.currentTarget.dataset.need; |
68 | 68 | |
69 | 69 | let url = e.currentTarget.dataset.url; |
70 | 70 | if(this.data.ce_user_id){ |
71 | 71 | url+="?ce_user_id="+this.data.ce_user_id; |
72 | 72 | } |
73 | - | |
74 | 73 | if(!need){ |
75 | 74 | |
76 | 75 | app.goto(url); |
... | ... | @@ -78,7 +77,7 @@ Page({ |
78 | 77 | } |
79 | 78 | |
80 | 79 | this.check_num(function () { |
81 | - var user = getApp().globalData.userInfo || this.ce_user_id | |
80 | + var user = getApp().globalData.userInfo || that.data.ce_user_id | |
82 | 81 | if (!user) { |
83 | 82 | wx.showToast({ |
84 | 83 | title: "请先授权登陆", |
... | ... | @@ -153,7 +152,7 @@ Page({ |
153 | 152 | |
154 | 153 | check_num:function (func) { |
155 | 154 | |
156 | - var user_id=this.ce_user_id || getApp().globalData.user_id; | |
155 | + var user_id=this.data.ce_user_id || getApp().globalData.user_id; | |
157 | 156 | if (!user_id) return false; |
158 | 157 | |
159 | 158 | //判断右没有开AI测肤 | ... | ... |