Commit e248ed77a7c23bfdb1536b3cef2b09013c0289ce
Merge branch 'qa' into 'master'
Qa See merge request !1088
Showing
8 changed files
with
143 additions
and
20 deletions
packageA/pages/distribution/myteam/myteam.js
| ... | ... | @@ -32,7 +32,7 @@ Page({ |
| 32 | 32 | }); |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | - app.request.promiseGet('/api/weshop/storeDistribut/get/1',{ | |
| 35 | + app.request.promiseGet('/api/weshop/storeDistribut/get/'+app.globalData.setting.stoid,{ | |
| 36 | 36 | }).then(res=>{ |
| 37 | 37 | if(res.data.code==0 && res.data.data){ |
| 38 | 38 | if(res.data.data.firstName) self.data.tabArr[0]=res.data.data.firstName; | ... | ... |
packageD/pages/AI-test-skin/analyse/analyse.js
| ... | ... | @@ -25,6 +25,7 @@ Page({ |
| 25 | 25 | sourceimg: null, |
| 26 | 26 | err_map: null, |
| 27 | 27 | skin_type: 0, |
| 28 | + ce_user_id:0, | |
| 28 | 29 | }, |
| 29 | 30 | |
| 30 | 31 | /** |
| ... | ... | @@ -35,6 +36,10 @@ Page({ |
| 35 | 36 | var plugin = requirePlugin('mtSkinSdk') |
| 36 | 37 | plugin.setConfig(pluginGD) |
| 37 | 38 | } |
| 39 | + | |
| 40 | + if(options.ce_user_id) | |
| 41 | + this.data.ce_user_id=options.ce_user_id; | |
| 42 | + | |
| 38 | 43 | var th = this; |
| 39 | 44 | //设置错误码分析 |
| 40 | 45 | this.set_err_map(); |
| ... | ... | @@ -212,13 +217,14 @@ Page({ |
| 212 | 217 | //检查图片有没有OK 百度 |
| 213 | 218 | img_check_bd: function (func) { |
| 214 | 219 | var th = this; |
| 220 | + var user_id=this.data.ce_user_id || getApp().globalData.user_id; | |
| 215 | 221 | var data = { |
| 216 | 222 | "appid": "25521854", |
| 217 | 223 | "image": getApp().globalData.face_SourceImg, |
| 218 | 224 | "face_field": "age,expression,face_shape,gender,glasses,landmark,landmark150,quality,eye_status,emotion,face_type,mask,spoofing", |
| 219 | 225 | "image_type": "URL", |
| 220 | 226 | "store_id":setting.stoid, |
| 221 | - "user_id":getApp().globalData.user_id | |
| 227 | + "user_id":user_id | |
| 222 | 228 | } |
| 223 | 229 | //开始调用百度接口,进行对图片进行判断是否符合标准 |
| 224 | 230 | this.json_post("/api/weshop/baidubce/face/skindetect", data, function (res) { |
| ... | ... | @@ -536,13 +542,14 @@ Page({ |
| 536 | 542 | //百度测肤接口 |
| 537 | 543 | analyse_by_bd: function (data) { |
| 538 | 544 | var th = this; |
| 545 | + var user_id=this.data.ce_user_id || getApp().globalData.user_id; | |
| 539 | 546 | //开始调用接口,进行分析 |
| 540 | 547 | this.json_post("/api/weshop/baidubce/face/skinAnalyze", data, function (res) { |
| 541 | 548 | if (res.data.code == 0) { |
| 542 | 549 | getApp().globalData.face_result = res.data.data; |
| 543 | 550 | var req_data = { |
| 544 | 551 | store_id: setting.stoid, |
| 545 | - user_id: getApp().globalData.user_id, | |
| 552 | + user_id: user_id, | |
| 546 | 553 | img: getApp().globalData.face_img, |
| 547 | 554 | sourceimg: getApp().globalData.face_SourceImg, |
| 548 | 555 | addtime: ut.gettimestamp(), |
| ... | ... | @@ -550,10 +557,70 @@ Page({ |
| 550 | 557 | detectjson: JSON.stringify(th.data.check_data), |
| 551 | 558 | skin_type: 0, |
| 552 | 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 | + | |
| 553 | 615 | //要保存一下分析的结果 |
| 554 | 616 | th.json_post("/api/weshop/face/storeSkinface/save", req_data, function (res) { |
| 555 | 617 | if (res.data.code == 0) { |
| 618 | + console.log('---ce_id----'); | |
| 619 | + console.log(res.data.data.id); | |
| 556 | 620 | let url = "/packageD/pages/AI-test-skin/success_result/success_result?id=" + res.data.data.id; //跳到分析页 |
| 621 | + if(th.data.ce_user_id) | |
| 622 | + url+="&ce_user_id="+th.data.ce_user_id; | |
| 623 | + | |
| 557 | 624 | wx.redirectTo({ |
| 558 | 625 | url: url |
| 559 | 626 | }) |
| ... | ... | @@ -564,6 +631,9 @@ Page({ |
| 564 | 631 | } else { |
| 565 | 632 | var msg = th.data.err_map[res.data.code + ""]; |
| 566 | 633 | let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页 |
| 634 | + if(this.data.ce_user_id) | |
| 635 | + url+="&ce_user_id="+this.data.ce_user_id; | |
| 636 | + | |
| 567 | 637 | wx.redirectTo({ |
| 568 | 638 | url: url |
| 569 | 639 | }) |
| ... | ... | @@ -573,6 +643,9 @@ Page({ |
| 573 | 643 | //跳转到错误页面 美图 |
| 574 | 644 | go_error: function (fail_result) { |
| 575 | 645 | let url = `/packageD/pages/AI-test-skin/fail_result/fail_result?fail_result=${fail_result}`; //跳到分析页 |
| 646 | + if(this.data.ce_user_id) | |
| 647 | + url+="&ce_user_id="+this.data.ce_user_id; | |
| 648 | + | |
| 576 | 649 | wx.redirectTo({ |
| 577 | 650 | url: url |
| 578 | 651 | }); |
| ... | ... | @@ -580,6 +653,8 @@ Page({ |
| 580 | 653 | //跳转到错误页面 |
| 581 | 654 | go_error1: function (msg) { |
| 582 | 655 | let url = "/packageD/pages/AI-test-skin/fail_result/fail_result?msg=" + msg; //跳到分析页 |
| 656 | + if(this.data.ce_user_id) | |
| 657 | + url+="&ce_user_id="+this.data.ce_user_id; | |
| 583 | 658 | wx.redirectTo({ |
| 584 | 659 | url: url |
| 585 | 660 | }); | ... | ... |
packageD/pages/AI-test-skin/fail_result/fail_result.js
| ... | ... | @@ -21,6 +21,7 @@ Page({ |
| 21 | 21 | iurl: setting.imghost, |
| 22 | 22 | msg:null, |
| 23 | 23 | fail_result:new Array(), //失败原因 |
| 24 | + ce_user_id:0 | |
| 24 | 25 | }, |
| 25 | 26 | |
| 26 | 27 | /** |
| ... | ... | @@ -38,6 +39,9 @@ Page({ |
| 38 | 39 | msg:options.msg |
| 39 | 40 | }) |
| 40 | 41 | } |
| 42 | + | |
| 43 | + if(options.ce_user_id) this.data.ce_user_id=options.ce_user_id; | |
| 44 | + | |
| 41 | 45 | // msg=decodeURIComponent(msg); |
| 42 | 46 | // this.setData({msg:msg}); |
| 43 | 47 | }, |
| ... | ... | @@ -65,6 +69,7 @@ Page({ |
| 65 | 69 | //从相册中选择图片 |
| 66 | 70 | back_to:function () { |
| 67 | 71 | let url = "/packageD/pages/AI-test-skin/shoot_notice/shoot_notice"; |
| 72 | + if(this.data.ce_user_id) url+="?ce_user_id="+this.data.ce_user_id; | |
| 68 | 73 | app.goto(url); |
| 69 | 74 | }, |
| 70 | 75 | ... | ... |
packageD/pages/AI-test-skin/index/aiskin.js
| ... | ... | @@ -19,20 +19,24 @@ Page({ |
| 19 | 19 | */ |
| 20 | 20 | data: { |
| 21 | 21 | iurl: setting.imghost, |
| 22 | + ce_user_id:0, | |
| 22 | 23 | }, |
| 23 | 24 | |
| 24 | 25 | /** |
| 25 | 26 | * 生命周期函数--监听页面加载 |
| 26 | 27 | */ |
| 27 | 28 | onLoad: function (options) { |
| 28 | - let user_id = options.user_id || getApp().globalData.user_id; | |
| 29 | + let user_id = options.user_id; | |
| 29 | 30 | if (user_id) { |
| 30 | - getApp().getUserFir(); | |
| 31 | + this.data.ce_user_id=user_id; | |
| 31 | 32 | } else { |
| 32 | - setTimeout(function () { | |
| 33 | - let url = "/pages/togoin/togoin"; | |
| 34 | - app.goto(url); | |
| 35 | - }, 1000) | |
| 33 | + let user_id=getApp().globalData.user_id; | |
| 34 | + if(!user_id) { | |
| 35 | + setTimeout(function () { | |
| 36 | + let url = "/pages/togoin/togoin"; | |
| 37 | + app.goto(url); | |
| 38 | + }, 1000) | |
| 39 | + } | |
| 36 | 40 | } |
| 37 | 41 | }, |
| 38 | 42 | |
| ... | ... | @@ -59,16 +63,21 @@ Page({ |
| 59 | 63 | }, |
| 60 | 64 | |
| 61 | 65 | goto(e) { |
| 62 | - | |
| 66 | + var that=this; | |
| 63 | 67 | var need=e.currentTarget.dataset.need; |
| 68 | + | |
| 69 | + let url = e.currentTarget.dataset.url; | |
| 70 | + if(this.data.ce_user_id){ | |
| 71 | + url+="?ce_user_id="+this.data.ce_user_id; | |
| 72 | + } | |
| 64 | 73 | if(!need){ |
| 65 | - let url = e.currentTarget.dataset.url; | |
| 74 | + | |
| 66 | 75 | app.goto(url); |
| 67 | 76 | return false; |
| 68 | 77 | } |
| 69 | 78 | |
| 70 | 79 | this.check_num(function () { |
| 71 | - var user = getApp().globalData.userInfo; | |
| 80 | + var user = getApp().globalData.userInfo || that.data.ce_user_id | |
| 72 | 81 | if (!user) { |
| 73 | 82 | wx.showToast({ |
| 74 | 83 | title: "请先授权登陆", |
| ... | ... | @@ -83,7 +92,6 @@ Page({ |
| 83 | 92 | return false; |
| 84 | 93 | } |
| 85 | 94 | |
| 86 | - let url = e.currentTarget.dataset.url; | |
| 87 | 95 | app.goto(url); |
| 88 | 96 | }) |
| 89 | 97 | |
| ... | ... | @@ -120,7 +128,9 @@ Page({ |
| 120 | 128 | |
| 121 | 129 | |
| 122 | 130 | async getHistoryData() { |
| 123 | - if (!getApp().globalData.user_id) return false; | |
| 131 | + | |
| 132 | + var user_id=getApp().globalData.user_id || getApp().globalData.ce_user_id; | |
| 133 | + if (!user_id) return false; | |
| 124 | 134 | if (this.data.show_his) return false; |
| 125 | 135 | |
| 126 | 136 | let history = this.data.history; |
| ... | ... | @@ -129,7 +139,7 @@ Page({ |
| 129 | 139 | isShowLoading: true, |
| 130 | 140 | data: { |
| 131 | 141 | store_id: setting.stoid, |
| 132 | - user_id: os.user_id, | |
| 142 | + user_id: user_id, | |
| 133 | 143 | page: 1, |
| 134 | 144 | pageSize: 1, |
| 135 | 145 | } |
| ... | ... | @@ -141,6 +151,10 @@ Page({ |
| 141 | 151 | }, |
| 142 | 152 | |
| 143 | 153 | check_num:function (func) { |
| 154 | + | |
| 155 | + var user_id=this.data.ce_user_id || getApp().globalData.user_id; | |
| 156 | + if (!user_id) return false; | |
| 157 | + | |
| 144 | 158 | //判断右没有开AI测肤 |
| 145 | 159 | getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+setting.stoid,{}).then(rs=>{ |
| 146 | 160 | if(rs.data.code!=0 || !rs.data.data){ |
| ... | ... | @@ -158,7 +172,7 @@ Page({ |
| 158 | 172 | }else{ |
| 159 | 173 | var rdata={ |
| 160 | 174 | store_id:setting.stoid, |
| 161 | - user_id:getApp().globalData.user_id | |
| 175 | + user_id:user_id | |
| 162 | 176 | } |
| 163 | 177 | this.json_post("/api/weshop/baidubce/face/skinvip",rdata,res=>{ |
| 164 | 178 | if(res.data.code==0){ | ... | ... |
packageD/pages/AI-test-skin/select_photo/select_photo.js
| ... | ... | @@ -13,6 +13,7 @@ Page({ |
| 13 | 13 | iurl: setting.imghost, |
| 14 | 14 | gl_skin_img: null, |
| 15 | 15 | skin_type: 0, |
| 16 | + ce_user_id:0 | |
| 16 | 17 | }, |
| 17 | 18 | |
| 18 | 19 | /** |
| ... | ... | @@ -21,10 +22,14 @@ Page({ |
| 21 | 22 | onLoad: function (options) { |
| 22 | 23 | var img = getApp().globalData.skin_img_info; |
| 23 | 24 | this.setData({ gl_skin_img: img }) |
| 25 | + | |
| 26 | + var ce_user_id=options.ce_user_id; | |
| 27 | + if(ce_user_id) this.data.ce_user_id=ce_user_id; | |
| 24 | 28 | }, |
| 25 | 29 | |
| 26 | 30 | //-- 完成选择 -- |
| 27 | 31 | ok_select: function () { |
| 32 | + | |
| 28 | 33 | const th = this; |
| 29 | 34 | this.check_num(function () { |
| 30 | 35 | let filePath = th.data.gl_skin_img['path']; |
| ... | ... | @@ -36,6 +41,12 @@ Page({ |
| 36 | 41 | getApp().globalData.face_img = e.data.data.img; |
| 37 | 42 | getApp().globalData.face_SourceImg = e.data.data.SourceImg; |
| 38 | 43 | let url = "/packageD/pages/AI-test-skin/analyse/analyse"; //跳到分析页 |
| 44 | + if(th.data.ce_user_id) | |
| 45 | + url+="?ce_user_id="+th.data.ce_user_id; | |
| 46 | + | |
| 47 | + console.log("select_ph"); | |
| 48 | + console.log(url); | |
| 49 | + | |
| 39 | 50 | app.goto(url); |
| 40 | 51 | } else { |
| 41 | 52 | wx.showToast({ |
| ... | ... | @@ -105,6 +116,9 @@ Page({ |
| 105 | 116 | size, |
| 106 | 117 | } |
| 107 | 118 | let url = "/packageD/pages/AI-test-skin/select_photo/select_photo"; |
| 119 | + if(th.data.ce_user_id) | |
| 120 | + url+="?ce_user_id="+th.data.ce_user_id; | |
| 121 | + | |
| 108 | 122 | app.goto(url); |
| 109 | 123 | // that.base64(img,"jpg"); |
| 110 | 124 | return; |
| ... | ... | @@ -147,6 +161,8 @@ Page({ |
| 147 | 161 | size: size1 |
| 148 | 162 | }; |
| 149 | 163 | let url = "/packageD/pages/AI-test-skin/select_photo/select_photo"; |
| 164 | + if(th.data.ce_user_id) | |
| 165 | + url+="?ce_user_id="+th.data.ce_user_id; | |
| 150 | 166 | app.goto(url); |
| 151 | 167 | }, |
| 152 | 168 | fail: function (res) { |
| ... | ... | @@ -182,6 +198,7 @@ Page({ |
| 182 | 198 | }, |
| 183 | 199 | |
| 184 | 200 | check_num:function (func) { |
| 201 | + var th=this; | |
| 185 | 202 | //判断右没有开AI测肤 |
| 186 | 203 | getApp().promiseGet("/api/weshop/wx/weappSkin/get/"+setting.stoid,{}).then(rs=>{ |
| 187 | 204 | if(rs.data.code!=0 || !rs.data.data){ |
| ... | ... | @@ -197,9 +214,11 @@ Page({ |
| 197 | 214 | duration: 3000 |
| 198 | 215 | }) |
| 199 | 216 | }else{ |
| 217 | + | |
| 218 | + var user_id= th.data.ce_user_id || getApp().globalData.user_id; | |
| 200 | 219 | var rdata={ |
| 201 | 220 | store_id:setting.stoid, |
| 202 | - user_id:getApp().globalData.user_id | |
| 221 | + user_id:user_id | |
| 203 | 222 | } |
| 204 | 223 | this.json_post("/api/weshop/baidubce/face/skinvip",rdata,res=>{ |
| 205 | 224 | if(res.data.code==0){ | ... | ... |
packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js
| ... | ... | @@ -23,13 +23,15 @@ Page({ |
| 23 | 23 | skin_type: 0, |
| 24 | 24 | cWidth: 0, |
| 25 | 25 | cHeight: 0, |
| 26 | + ce_user_id: 0 | |
| 26 | 27 | }, |
| 27 | 28 | |
| 28 | 29 | /** |
| 29 | 30 | * 生命周期函数--监听页面加载 |
| 30 | 31 | */ |
| 31 | 32 | onLoad: function (options) { |
| 32 | - | |
| 33 | + var ce_user_id=options.ce_user_id; | |
| 34 | + if(ce_user_id) this.data.ce_user_id=ce_user_id; | |
| 33 | 35 | }, |
| 34 | 36 | |
| 35 | 37 | /** |
| ... | ... | @@ -91,6 +93,8 @@ Page({ |
| 91 | 93 | console.log(imgArr); |
| 92 | 94 | getApp().globalData.skin_img_info = imgArr[0]; |
| 93 | 95 | let url = "/packageD/pages/AI-test-skin/select_photo/select_photo"; |
| 96 | + if(th.data.ce_user_id) | |
| 97 | + url+="?ce_user_id="+th.data.ce_user_id; | |
| 94 | 98 | app.goto(url); |
| 95 | 99 | } |
| 96 | 100 | }) |
| ... | ... | @@ -158,6 +162,9 @@ Page({ |
| 158 | 162 | size, |
| 159 | 163 | } |
| 160 | 164 | let url = "/packageD/pages/AI-test-skin/select_photo/select_photo"; |
| 165 | + if(this.data.ce_user_id){ | |
| 166 | + url+="?ce_user_id="+this.data.ce_user_id; | |
| 167 | + } | |
| 161 | 168 | app.goto(url); |
| 162 | 169 | // that.base64(img,"jpg"); |
| 163 | 170 | return; |
| ... | ... | @@ -205,6 +212,9 @@ Page({ |
| 205 | 212 | size:size1 |
| 206 | 213 | }; |
| 207 | 214 | let url = "/packageD/pages/AI-test-skin/select_photo/select_photo"; |
| 215 | + if(that.data.ce_user_id) | |
| 216 | + url+="?ce_user_id="+that.data.ce_user_id; | |
| 217 | + | |
| 208 | 218 | app.goto(url); |
| 209 | 219 | }, |
| 210 | 220 | fail: function (res) { | ... | ... |
packageD/pages/AI-test-skin/success_result/success_result.wxml
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | </scroll-view> --> |
| 9 | 9 | <view style="height: 100rpx;"> |
| 10 | 10 | <scroll-view enable-flex scroll-into-view="{{tab_id}}" scroll-with-animation scroll-x> |
| 11 | - <view class="flex" style="height: 100%;"> | |
| 11 | + <view class="flex" style="height: 100%; background-color:#fff"> | |
| 12 | 12 | <view wx:for="{{tab}}" wx:key="id" id="{{item.id}}" bindtap="clickTab" data-tab_id="{{item.id}}" data-index="{{index}}" class="tab_scroll_item {{currentIndex==index?'active':''}}"> |
| 13 | 13 | {{item.name}} |
| 14 | 14 | </view> | ... | ... |
pages/user/my_service/i_service.wxml
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | |
| 40 | 40 | <view class="flex-center fs24 itemCount"> |
| 41 | 41 | <view>剩余次数:</view> |
| 42 | - <view wx:if="{{item.DisplayQty==true || DisplayQty==1}}">无限次</view> | |
| 42 | + <view wx:if="{{item.DisplayQty=='不限次' || item.DisplayQty==1}}">无限次</view> | |
| 43 | 43 | <view wx:else>{{item.ObtainTimes}}</view> |
| 44 | 44 | </view> |
| 45 | 45 | ... | ... |