Commit 0d0b154b4cfb474db6f8364593f9b2693b050df2

Authored by yvan.ni
1 parent f836d06f

测肤问题的细节调整

packageD/pages/AI-test-skin/success_result/acne/acne.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 11:03:07  
4 - * @LastEditTime: 2022-02-21 17:50:35  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\acne\acne.js  
8 - */  
9 module.exports = { 1 module.exports = {
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function(th,stoid) { 3 + get_goods: function(th,stoid,sort) {
  4 + th.setData({acne_sort:sort});
12 var r_code='03'; 5 var r_code='03';
13 //获取痘痘的类型 6 //获取痘痘的类型
14 var list=th.data.face_data.acnespotmole.acne_list; 7 var list=th.data.face_data.acnespotmole.acne_list;
@@ -42,9 +35,16 @@ module.exports = { @@ -42,9 +35,16 @@ module.exports = {
42 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 35 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
43 getApp().request.promiseGet(url, {}).then(res=>{ 36 getApp().request.promiseGet(url, {}).then(res=>{
44 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 37 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
45 - th.setData({acne_quan_list:res.data.data.pageData}); 38 + var arr=res.data.data.pageData;
  39 + arr.map(function (e) {
  40 + e.q_word='acne_quan_list';
  41 + return e;
  42 + })
  43 + th.setData({acne_quan_list:arr});
46 } 44 }
47 }) 45 })
48 46
  47 +
  48 +
49 }, 49 },
50 } 50 }
packageD/pages/AI-test-skin/success_result/acne/acne.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#06</view> 5 + <view style="color: #45d4eb;">#0{{acne_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">痤疮</text> 7 <text style="font-size: 42rpx;" class="bold">痤疮</text>
8 <view class="fs26" catchtap="show_dailog" data-type="6" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="6" style="display: flex;align-items: center;">
@@ -18,10 +18,10 @@ @@ -18,10 +18,10 @@
18 </view> 18 </view>
19 <view style="line-height:60rpx;margin-left:20rpx"> 19 <view style="line-height:60rpx;margin-left:20rpx">
20 <view class="fs28">程度情况</view> 20 <view class="fs28">程度情况</view>
21 - <view class="bold">I级</view> 21 + <view class="bold">痤疮数{{acne_num}}个</view>
22 </view> 22 </view>
23 </view> 23 </view>
24 - <view class="analyse_classify_header_item" style="margin-top:5%"> 24 + <view class="analyse_classify_header_item" style="margin-top:5%;display: none">
25 <view class="analyse_classify_header_img"> 25 <view class="analyse_classify_header_img">
26 <image src="{{iurl}}/miniapp/images/skinimg/cuochuang_icon.jpg"></image> 26 <image src="{{iurl}}/miniapp/images/skinimg/cuochuang_icon.jpg"></image>
27 </view> 27 </view>
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 <!-- 优惠券 --> 125 <!-- 优惠券 -->
126 <view wx:if="{{acne_quan_list}}"> 126 <view wx:if="{{acne_quan_list}}">
127 <view style="margin:5% 0">适合痤疮商品的优惠券</view> 127 <view style="margin:5% 0">适合痤疮商品的优惠券</view>
128 - <view class="xc-coupon-frame rel"> 128 + <view class="xc-coupon-frame">
129 <block wx:for="{{acne_quan_list}}"> 129 <block wx:for="{{acne_quan_list}}">
130 <include src="../coupon.wxml" /> 130 <include src="../coupon.wxml" />
131 </block> 131 </block>
packageD/pages/AI-test-skin/success_result/blackhead/blackhead.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 11:03:07  
4 - * @LastEditTime: 2022-02-21 17:48:28  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\blackhead\blackhead.js  
8 - */  
9 module.exports = { 1 module.exports = {
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function(th,stoid) { 3 + get_goods: function(th,stoid,sort) {
  4 + th.setData({backhead_sort:sort});
12 var r_code='10'; 5 var r_code='10';
13 //获取黑头的类型 6 //获取黑头的类型
14 var blackhead_segs_type=th.data.face_data.blackheadpore.blackhead_segs_type; 7 var blackhead_segs_type=th.data.face_data.blackheadpore.blackhead_segs_type;
@@ -37,7 +30,12 @@ module.exports = { @@ -37,7 +30,12 @@ module.exports = {
37 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 30 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
38 getApp().request.promiseGet(url, {}).then(res=>{ 31 getApp().request.promiseGet(url, {}).then(res=>{
39 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 32 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
40 - th.setData({blackhead_quan_list:res.data.data.pageData}); 33 + var arr=res.data.data.pageData;
  34 + arr.map(function (e) {
  35 + e.q_word='blackhead_quan_list';
  36 + return e;
  37 + })
  38 + th.setData({blackhead_quan_list:arr});
41 } 39 }
42 }) 40 })
43 41
packageD/pages/AI-test-skin/success_result/blackhead/blackhead.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#01</view> 5 + <view style="color: #45d4eb;">#0{{backhead_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">黑头</text> 7 <text style="font-size: 42rpx;" class="bold">黑头</text>
8 <view class="fs26" catchtap="show_dailog" data-type="4" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="4" style="display: flex;align-items: center;">
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 </view> 17 </view>
18 <view style="line-height:60rpx;margin-left:20rpx"> 18 <view style="line-height:60rpx;margin-left:20rpx">
19 <view class="fs28">程度情况</view> 19 <view class="fs28">程度情况</view>
20 - <view class="bold">待确定</view> 20 + <view class="bold">黑头数{{blackhead_num}}个</view>
21 </view> 21 </view>
22 </view> 22 </view>
23 - <view class="analyse_classify_header_item mt_b5"> 23 + <view class="analyse_classify_header_item mt_b5" style="display: none">
24 <view class="analyse_classify_header_img"> 24 <view class="analyse_classify_header_img">
25 <image src="{{iurl}}/miniapp/images/skinimg/heitou_icon.jpg"></image> 25 <image src="{{iurl}}/miniapp/images/skinimg/heitou_icon.jpg"></image>
26 </view> 26 </view>
@@ -95,7 +95,7 @@ @@ -95,7 +95,7 @@
95 <!-- 优惠券 --> 95 <!-- 优惠券 -->
96 <view wx:if="{{blackhead_quan_list}}"> 96 <view wx:if="{{blackhead_quan_list}}">
97 <view style="margin:5% 0">适合黑头商品的优惠券</view> 97 <view style="margin:5% 0">适合黑头商品的优惠券</view>
98 - <view class="xc-coupon-frame rel"> 98 + <view class="xc-coupon-frame">
99 <block wx:for="{{blackhead_quan_list}}"> 99 <block wx:for="{{blackhead_quan_list}}">
100 <include src="../coupon.wxml" /> 100 <include src="../coupon.wxml" />
101 </block> 101 </block>
packageD/pages/AI-test-skin/success_result/coupon.wxml
1 <!-- -单张的券- --> 1 <!-- -单张的券- -->
  2 +<view class="rel">
2 <view class="coupon flex"> 3 <view class="coupon flex">
3 <view class="circle xc-circular-one"></view> 4 <view class="circle xc-circular-one"></view>
4 <view class="xc-coupon-left "> 5 <view class="xc-coupon-left ">
@@ -16,10 +17,12 @@ @@ -16,10 +17,12 @@
16 </view> 17 </view>
17 </view> 18 </view>
18 <view class="flex-vertical"> 19 <view class="flex-vertical">
19 - <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}" data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan"> 20 + <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}"
  21 + data-ind="{{index}}" data-cid="{{item.id}}" data-word="{{item.q_word}}" bindtap="get_quan">
20 {{ item.linging==1?'领取中':'领取'}} 22 {{ item.linging==1?'领取中':'领取'}}
21 </view> 23 </view>
22 </view> 24 </view>
23 </view> 25 </view>
24 <view class="circle xc-circular-two"></view> 26 <view class="circle xc-circular-two"></view>
  27 +</view>
25 </view> 28 </view>
26 \ No newline at end of file 29 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/dark/dark.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 11:03:07  
4 - * @LastEditTime: 2022-02-21 17:50:16  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\dark\dark.js  
8 - */  
9 module.exports = { 1 module.exports = {
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function(th,stoid) {  
12 - var r_code='08'; 3 + get_goods: function(th,stoid,sort) {
  4 +
  5 + th.setData({dark_sort:sort});
13 6
  7 + var r_code='08';
14 var arr1=th.data.face_data.eyesattr.dark_circle_left_type; 8 var arr1=th.data.face_data.eyesattr.dark_circle_left_type;
15 var arr2=th.data.face_data.eyesattr.dark_circle_right_type; 9 var arr2=th.data.face_data.eyesattr.dark_circle_right_type;
16 var arr=[...arr1,...arr2]; 10 var arr=[...arr1,...arr2];
@@ -40,7 +34,12 @@ module.exports = { @@ -40,7 +34,12 @@ module.exports = {
40 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 34 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
41 getApp().request.promiseGet(url, {}).then(res=>{ 35 getApp().request.promiseGet(url, {}).then(res=>{
42 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 36 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
43 - th.setData({dark_quan_list:res.data.data.pageData}); 37 + var arr=res.data.data.pageData;
  38 + arr.map(function (e) {
  39 + e.q_word='dark_quan_list';
  40 + return e;
  41 + })
  42 + th.setData({dark_quan_list:arr});
44 } 43 }
45 }) 44 })
46 }, 45 },
packageD/pages/AI-test-skin/success_result/dark/dark.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#05</view> 5 + <view style="color: #45d4eb;">#0{{dark_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">黑眼圈</text> 7 <text style="font-size: 42rpx;" class="bold">黑眼圈</text>
8 <view class="fs26" catchtap="show_dailog" data-type="5" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="5" style="display: flex;align-items: center;">
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 </block> 72 </block>
73 </view> 73 </view>
74 <view class="fs28 mt_b10"> 74 <view class="fs28 mt_b10">
75 - <text>明显可见毛孔或内含小于毛孔大小角栓</text> 75 + <text>隐约可见黑眼圈</text>
76 </view> 76 </view>
77 </view> 77 </view>
78 <view class="analyse_classify_body"> 78 <view class="analyse_classify_body">
@@ -131,7 +131,7 @@ @@ -131,7 +131,7 @@
131 <!-- 优惠券 --> 131 <!-- 优惠券 -->
132 <view wx:if="{{dark_quan_list}}"> 132 <view wx:if="{{dark_quan_list}}">
133 <view style="margin:5% 0">适合黑眼圈商品的优惠券</view> 133 <view style="margin:5% 0">适合黑眼圈商品的优惠券</view>
134 - <view class="xc-coupon-frame rel"> 134 + <view class="xc-coupon-frame">
135 <block wx:for="{{dark_quan_list}}"> 135 <block wx:for="{{dark_quan_list}}">
136 <include src="../coupon.wxml" /> 136 <include src="../coupon.wxml" />
137 </block> 137 </block>
packageD/pages/AI-test-skin/success_result/pore/pore.js
1 module.exports = { 1 module.exports = {
2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
3 - get_goods: function(th,stoid) { 3 + get_goods: function(th,stoid,sort) {
  4 +
  5 + th.setData({port_sort:sort})
  6 +
4 var r_code='11'; 7 var r_code='11';
5 //获取毛孔的类型 8 //获取毛孔的类型
6 var pore_segs_type=th.data.face_data.blackheadpore.pore_segs_type; 9 var pore_segs_type=th.data.face_data.blackheadpore.pore_segs_type;
@@ -29,7 +32,12 @@ module.exports = { @@ -29,7 +32,12 @@ module.exports = {
29 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 32 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
30 getApp().request.promiseGet(url, {}).then(res=>{ 33 getApp().request.promiseGet(url, {}).then(res=>{
31 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 34 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
32 - th.setData({pore_quan_list:res.data.data.pageData}); 35 + var arr=res.data.data.pageData;
  36 + arr.map(function (e) {
  37 + e.q_word='pore_quan_list';
  38 + return e;
  39 + })
  40 + th.setData({pore_quan_list:arr});
33 } 41 }
34 }) 42 })
35 }, 43 },
packageD/pages/AI-test-skin/success_result/pore/pore.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#01</view> 5 + <view style="color: #45d4eb;">#0{{port_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">毛孔</text> 7 <text style="font-size: 42rpx;" class="bold">毛孔</text>
8 <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;">
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 </view> 17 </view>
18 <view style="line-height:60rpx;margin-left:20rpx"> 18 <view style="line-height:60rpx;margin-left:20rpx">
19 <view class="fs28">程度情况</view> 19 <view class="fs28">程度情况</view>
20 - <view class="bold">待确定</view> 20 + <view class="bold">毛孔粗大数{{pore_num}}个</view>
21 </view> 21 </view>
22 </view> 22 </view>
23 - <view class="analyse_classify_header_item mt_b5"> 23 + <view class="analyse_classify_header_item mt_b5" style="display: none">
24 <view class="analyse_classify_header_img"> 24 <view class="analyse_classify_header_img">
25 <image src="{{iurl}}/miniapp/images/skinimg/maokong_icon.jpg"></image> 25 <image src="{{iurl}}/miniapp/images/skinimg/maokong_icon.jpg"></image>
26 </view> 26 </view>
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
96 <!-- 优惠券 --> 96 <!-- 优惠券 -->
97 <view wx:if="{{pore_quan_list}}"> 97 <view wx:if="{{pore_quan_list}}">
98 <view style="margin:5% 0">适合毛孔商品的优惠券</view> 98 <view style="margin:5% 0">适合毛孔商品的优惠券</view>
99 - <view class="xc-coupon-frame rel"> 99 + <view class="xc-coupon-frame">
100 <block wx:for="{{pore_quan_list}}"> 100 <block wx:for="{{pore_quan_list}}">
101 <include src="../coupon.wxml" /> 101 <include src="../coupon.wxml" />
102 </block> 102 </block>
packageD/pages/AI-test-skin/success_result/sensitive/sensitive.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 17:42:05  
4 - * @LastEditTime: 2022-02-21 17:50:54  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\sensitive\sensitive.js  
8 - */  
9 module.exports = { 1 module.exports = {
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function (th, stoid) { 3 + get_goods: function (th, stoid,sort) {
  4 + th.setData({sensitive_sort:sort});
  5 +
12 var r_code = '12'; 6 var r_code = '12';
13 //获取毛孔的类型 7 //获取毛孔的类型
14 var arr = th.data.face_data.skinquality.skin_sensitive_check; 8 var arr = th.data.face_data.skinquality.skin_sensitive_check;
@@ -36,7 +30,12 @@ module.exports = { @@ -36,7 +30,12 @@ module.exports = {
36 var url = "/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"; 30 var url = "/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2";
37 getApp().request.promiseGet(url, {}).then(res => { 31 getApp().request.promiseGet(url, {}).then(res => {
38 if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { 32 if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) {
39 - th.setData({sensitive_quan_list: res.data.data.pageData }); 33 + var arr=res.data.data.pageData;
  34 + arr.map(function (e) {
  35 + e.q_word='sensitive_quan_list';
  36 + return e;
  37 + })
  38 + th.setData({sensitive_quan_list: arr});
40 } 39 }
41 }) 40 })
42 }, 41 },
packageD/pages/AI-test-skin/success_result/sensitive/sensitive.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#07</view> 5 + <view style="color: #45d4eb;">#0{{sensitive_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">敏感度</text> 7 <text style="font-size: 42rpx;" class="bold">敏感度</text>
8 <view class="fs26" catchtap="show_dailog" data-type="7" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="7" style="display: flex;align-items: center;">
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 <view class="bold">{{s_filter.get_nai_shou(skin_sensitive_check)}}</view> 20 <view class="bold">{{s_filter.get_nai_shou(skin_sensitive_check)}}</view>
21 </view> 21 </view>
22 </view> 22 </view>
23 - <view class="analyse_classify_header_item mt_b5"> 23 + <view class="analyse_classify_header_item mt_b5" style="display: none">
24 <view class="analyse_classify_header_img"> 24 <view class="analyse_classify_header_img">
25 <image src="{{iurl}}/miniapp/images/skinimg/mingandu_icon.jpg"></image> 25 <image src="{{iurl}}/miniapp/images/skinimg/mingandu_icon.jpg"></image>
26 </view> 26 </view>
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 <view class="bold">待确定</view> 29 <view class="bold">待确定</view>
30 </view> 30 </view>
31 </view> 31 </view>
32 - <view class="fs28 mt_b10"> 32 + <view class="fs28 mt_b10" style="display: none">
33 <text>明显可见毛孔或内含小于毛孔大小角栓</text> 33 <text>明显可见毛孔或内含小于毛孔大小角栓</text>
34 </view> 34 </view>
35 </view> 35 </view>
@@ -56,16 +56,16 @@ @@ -56,16 +56,16 @@
56 <view class="fenxi mgb10">护理建议</view> 56 <view class="fenxi mgb10">护理建议</view>
57 <view class=""> 57 <view class="">
58 <view class="mgb30"> 58 <view class="mgb30">
59 - <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">01</text> 日常防晒</text>  
60 - <view class="fs26 c_666">用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根使用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根大股东是公司山豆根山豆根收到二十个的山豆根山豆根</view> 59 + <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">01</text>做好防晒</text>
  60 + <view class="fs26 c_666">采用打伞、戴帽等物理防晒措施,肌肤稳定后再适当使用轻薄的无机防晒霜,并使用温和的卸妆产品后再进行洁面。</view>
61 </view> 61 </view>
62 <view class="mgb30"> 62 <view class="mgb30">
63 - <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">02</text> 补水保湿</text>  
64 - <view class="fs26 c_666">用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根使用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根大股东是公司山豆根山豆根收到二十个的山豆根山豆根</view> 63 + <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">02</text>抗敏护肤</text>
  64 + <view class="fs26 c_666">护肤品越简单越好,选择不含香精、酒精、防腐剂或具有修复皮肤屏障功能的产品,并减少化妆次数。</view>
65 </view> 65 </view>
66 <view class="mgb30"> 66 <view class="mgb30">
67 - <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">03</text> 早晚清洁</text>  
68 - <view class="fs26 c_666">用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根使用的公司大股东是公司山豆根山豆根收到二十个的山豆根山豆根大股东是公司山豆根山豆根收到二十个的山豆根山豆根</view> 67 + <text style="font-size: 28rpx;margin-right: 10rpx;"><text class="bold">03</text>温和清洁</text>
  68 + <view class="fs26 c_666">尽量使用清水进行洁面,温水尤佳。或使用温和洗面奶在T区进行局部洁面,严禁深度清洁或去角质。</view>
69 </view> 69 </view>
70 </view> 70 </view>
71 </view> 71 </view>
@@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
92 <!-- 优惠券 --> 92 <!-- 优惠券 -->
93 <view wx:if="{{sensitive_quan_list}}"> 93 <view wx:if="{{sensitive_quan_list}}">
94 <view style="margin:5% 0">适合敏感度商品的优惠券</view> 94 <view style="margin:5% 0">适合敏感度商品的优惠券</view>
95 - <view class="xc-coupon-frame rel"> 95 + <view class="xc-coupon-frame">
96 <block wx:for="{{sensitive_quan_list}}"> 96 <block wx:for="{{sensitive_quan_list}}">
97 <include src="../coupon.wxml" /> 97 <include src="../coupon.wxml" />
98 </block> 98 </block>
packageD/pages/AI-test-skin/success_result/speckle/speckle.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 11:03:07  
4 - * @LastEditTime: 2022-02-21 17:48:51  
5 - * @LastEditors: Please set LastEditors  
6 - * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE  
7 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\speckle\speckle.js  
8 - */  
9 module.exports = { 1 module.exports = {
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 2 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function(th,stoid) { 3 + get_goods: function(th,stoid,sort) {
  4 + th.setData({speckle_sort:sort});
  5 +
12 var r_code='07'; 6 var r_code='07';
13 //获取斑的类型 7 //获取斑的类型
14 var list=th.data.face_data.acnespotmole.speckle_list; 8 var list=th.data.face_data.acnespotmole.speckle_list;
@@ -42,7 +36,12 @@ module.exports = { @@ -42,7 +36,12 @@ module.exports = {
42 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 36 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
43 getApp().request.promiseGet(url, {}).then(res=>{ 37 getApp().request.promiseGet(url, {}).then(res=>{
44 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 38 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
45 - th.setData({speckle_quan_list:res.data.data.pageData}); 39 + var arr=res.data.data.pageData;
  40 + arr.map(function (e) {
  41 + e.q_word='speckle_quan_list';
  42 + return e;
  43 + })
  44 + th.setData({speckle_quan_list:arr});
46 } 45 }
47 }) 46 })
48 47
packageD/pages/AI-test-skin/success_result/speckle/speckle.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#02</view> 5 + <view style="color: #45d4eb;">#0{{speckle_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">色斑</text> 7 <text style="font-size: 42rpx;" class="bold">色斑</text>
8 <view class="fs26" catchtap="show_dailog" data-type="2" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="2" style="display: flex;align-items: center;">
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 </view> 17 </view>
18 <view style="line-height:60rpx;margin-left:20rpx"> 18 <view style="line-height:60rpx;margin-left:20rpx">
19 <view class="fs28">程度情况</view> 19 <view class="fs28">程度情况</view>
20 - <view class="bold">待确定</view> 20 + <view class="bold">色斑数{{speckle_num}}个</view>
21 </view> 21 </view>
22 </view> 22 </view>
23 - <view class="analyse_classify_header_item mt_b5"> 23 + <view class="analyse_classify_header_item mt_b5" style="display: none">
24 <view class="analyse_classify_header_img"> 24 <view class="analyse_classify_header_img">
25 <image src="{{iurl}}/miniapp/images/skinimg/seban_icon.jpg"></image> 25 <image src="{{iurl}}/miniapp/images/skinimg/seban_icon.jpg"></image>
26 </view> 26 </view>
@@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
92 <!-- 优惠券 --> 92 <!-- 优惠券 -->
93 <view wx:if="{{speckle_quan_list}}"> 93 <view wx:if="{{speckle_quan_list}}">
94 <view style="margin:5% 0">适合色斑商品的优惠券</view> 94 <view style="margin:5% 0">适合色斑商品的优惠券</view>
95 - <view class="xc-coupon-frame rel"> 95 + <view class="xc-coupon-frame">
96 <block wx:for="{{speckle_quan_list}}"> 96 <block wx:for="{{speckle_quan_list}}">
97 <include src="../coupon.wxml" /> 97 <include src="../coupon.wxml" />
98 </block> 98 </block>
packageD/pages/AI-test-skin/success_result/success_result.js
@@ -34,13 +34,14 @@ Page({ @@ -34,13 +34,14 @@ Page({
34 34
35 img_scale_icon:true, 35 img_scale_icon:true,
36 show_problem:1, //问题标注显示问题 36 show_problem:1, //问题标注显示问题
37 - img_scale:1, //缩放问题 37 + ig_scale:1, //缩放问题
38 }, 38 },
39 39
40 /** 40 /**
41 * 生命周期函数--监听页面加载 41 * 生命周期函数--监听页面加载
42 */ 42 */
43 onLoad: function (options) { 43 onLoad: function (options) {
  44 +
44 var th = this; 45 var th = this;
45 //初始化一下,获取商品的价格 46 //初始化一下,获取商品的价格
46 this.init(); 47 this.init();
@@ -91,26 +92,32 @@ Page({ @@ -91,26 +92,32 @@ Page({
91 face_img: img, 92 face_img: img,
92 m_top: (location.top - location.height / 2.5) * th.data.bili, 93 m_top: (location.top - location.height / 2.5) * th.data.bili,
93 m_left: (location.left - location.width / 7) * th.data.bili, 94 m_left: (location.left - location.width / 7) * th.data.bili,
94 - bili: th.data.bili 95 + bili: th.data.bili,
  96 + sex:sex
95 }) 97 })
  98 + var sort=1;
96 //-- 调用毛孔的推荐函数 -- 99 //-- 调用毛孔的推荐函数 --
97 if (pore_num > 0) 100 if (pore_num > 0)
98 - pore.get_goods(th, setting.stoid); 101 + pore.get_goods(th, setting.stoid,sort++);
99 //-- 调用黑头的推荐函数 -- 102 //-- 调用黑头的推荐函数 --
100 if (blackhead_num > 0) 103 if (blackhead_num > 0)
101 - blackhead.get_goods(th, setting.stoid); 104 + blackhead.get_goods(th, setting.stoid,sort++);
102 //-- 调用色斑的推荐函数 -- 105 //-- 调用色斑的推荐函数 --
103 if (speckle_num > 0) 106 if (speckle_num > 0)
104 - speckle.get_goods(th, setting.stoid); 107 + speckle.get_goods(th, setting.stoid,sort++);
105 //-- 调用皱纹的推荐函数 -- 108 //-- 调用皱纹的推荐函数 --
106 if (wrinkle_num > 0) 109 if (wrinkle_num > 0)
107 - wrinkle.get_goods(th, setting.stoid); 110 + wrinkle.get_goods(th, setting.stoid,sort++);
108 //-- 黑眼圈 -- 111 //-- 黑眼圈 --
109 if (dark_type > -1) 112 if (dark_type > -1)
110 - dark.get_goods(th, setting.stoid); 113 + dark.get_goods(th, setting.stoid,sort++);
111 //-- 黑眼圈 -- 114 //-- 黑眼圈 --
112 if (acne_num > -0) 115 if (acne_num > -0)
113 - acne.get_goods(th, setting.stoid); 116 + acne.get_goods(th, setting.stoid,sort++);
  117 +
  118 + //获取一下分享要用的图片
  119 + th.set_share_img();
  120 +
114 }) 121 })
115 }, 122 },
116 123
@@ -183,24 +190,23 @@ Page({ @@ -183,24 +190,23 @@ Page({
183 /** 190 /**
184 * 生命周期函数--监听页面初次渲染完成 191 * 生命周期函数--监听页面初次渲染完成
185 */ 192 */
186 - onReady: function () {  
187 - // let heightRecords = [];  
188 - // setTimeout(() => {  
189 - // for (let i = 0; i < this.data.tab.length; i++) {  
190 - // let item = this.data.tab[i];  
191 - // let id = `#${item.id}`;  
192 - // let query = wx.createSelectorQuery();  
193 - // query.select(id).boundingClientRect(rect => {  
194 - // console.log(rect, i);  
195 - // heightRecords[i] = rect.height;  
196 - // }).exec()  
197 - // }  
198 - // this.setData({  
199 - // heightRecords,  
200 - // })  
201 - // }, 1000) 193 + onReady: function () {},
  194 + set_share_img:function () {
  195 + var th=this;
  196 + var path3=th.data.iurl+"/miniapp/images/skinimg/nan.png";
  197 + if(this.data.sex=='female')
  198 + path3=th.data.iurl+"/miniapp/images/skinimg/nv.png";
  199 + // 读取文件成功则OK--
  200 + wx.getImageInfo({
  201 + src: path3,
  202 + success: function (res) {
  203 + //获取到二维码的图片
  204 + th.data.share_head=res.path;
  205 + }
  206 + })
202 207
203 }, 208 },
  209 +
204 binddragend(e) { 210 binddragend(e) {
205 console.log(e); 211 console.log(e);
206 this.setData({ 212 this.setData({
@@ -364,14 +370,6 @@ Page({ @@ -364,14 +370,6 @@ Page({
364 }) 370 })
365 }, 371 },
366 372
367 - click_share(){  
368 - this.setData({  
369 - share_flag:true,  
370 - img_scale:false,  
371 - showDialog:true,  
372 - })  
373 - },  
374 -  
375 //图片加载的时候,计算图片的像素大小 373 //图片加载的时候,计算图片的像素大小
376 face_img_load: function (e) { 374 face_img_load: function (e) {
377 var th = this; 375 var th = this;
@@ -389,6 +387,7 @@ Page({ @@ -389,6 +387,7 @@ Page({
389 387
390 //-- 图片的拖拽缩放的功能 -- 388 //-- 图片的拖拽缩放的功能 --
391 touchstartCallback: function(e) { 389 touchstartCallback: function(e) {
  390 + this.data.tc_end=0;
392 // 单手指缩放开始,也不做任何处理 391 // 单手指缩放开始,也不做任何处理
393 if(e.touches.length>1) { 392 if(e.touches.length>1) {
394 // 一开始我并没有这个回调函数,会出现缩小的时候有瞬间被放大过程的bug 393 // 一开始我并没有这个回调函数,会出现缩小的时候有瞬间被放大过程的bug
@@ -404,6 +403,7 @@ Page({ @@ -404,6 +403,7 @@ Page({
404 403
405 }, 404 },
406 touchmoveCallback: function(e) { 405 touchmoveCallback: function(e) {
  406 + if(this.data.tc_end) return false;
407 // 单手指缩放我们不做任何操作 407 // 单手指缩放我们不做任何操作
408 if(e.touches.length > 1){ 408 if(e.touches.length > 1){
409 let xMove = e.touches[1].clientX - e.touches[0].clientX; 409 let xMove = e.touches[1].clientX - e.touches[0].clientX;
@@ -412,7 +412,7 @@ Page({ @@ -412,7 +412,7 @@ Page({
412 let distance = Math.sqrt(xMove * xMove + yMove * yMove); 412 let distance = Math.sqrt(xMove * xMove + yMove * yMove);
413 let distanceDiff = distance - this.data.img_distance; 413 let distanceDiff = distance - this.data.img_distance;
414 414
415 - let newScale = this.data.img_scale + 0.005 * distanceDiff 415 + let newScale = this.data.ig_scale + 0.005 * distanceDiff
416 // 为了防止缩放得太大,所以scale需要限制,同理最小值也是 416 // 为了防止缩放得太大,所以scale需要限制,同理最小值也是
417 if(newScale >= 2) { 417 if(newScale >= 2) {
418 newScale = 2 418 newScale = 2
@@ -424,21 +424,386 @@ Page({ @@ -424,21 +424,386 @@ Page({
424 this.data.img_distance=distance; 424 this.data.img_distance=distance;
425 // 赋值 新的 => 旧的 425 // 赋值 新的 => 旧的
426 this.setData({ 426 this.setData({
427 - 'img_scale': newScale, 427 + 'ig_scale': newScale,
428 }) 428 })
429 }else if(e.touches.length==1){ 429 }else if(e.touches.length==1){
430 let xMove= e.touches[0].clientX- this.data.img_x; 430 let xMove= e.touches[0].clientX- this.data.img_x;
431 let yMove= e.touches[0].clientY- this.data.img_y; 431 let yMove= e.touches[0].clientY- this.data.img_y;
432 this.setData({ 432 this.setData({
433 - 'img_top': yMove,  
434 - 'img_left': xMove, 433 + 'img_top': yMove*0.8,
  434 + 'img_left': xMove*0.8,
435 }); 435 });
436 - this.data.img_x=e.touches[0].clientX;  
437 - this.data.img_y=e.touches[0].clientY;  
438 } 436 }
439 437
440 438
441 }, 439 },
442 440
  441 + touchendCallback:function (e) {
  442 + this.data.tc_end=1;
  443 + },
  444 +
  445 +
  446 + //--定义的保存图片方法,分享团---
  447 + saveImageToPhotosAlbum: function () {
  448 + var th=this;
  449 + var rpx = this.data.cWidth / 750 * 1.35; //基础单位,
  450 + //--先判断会员状态--
  451 + var user_info = getApp().globalData.userInfo;
  452 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  453 + wx.navigateTo({url: '/pages/togoin/togoin',})
  454 + return false;
  455 + }
  456 + if (this.data.share_hidden) {
  457 + this.setData({share_hidden: false,});
  458 + }
  459 + ;
  460 +
  461 + wx.showLoading({title: '生成中...',})
  462 + var that = this, th = that;
  463 + //设置画板显示,才能开始绘图
  464 + that.setData({canvasHidden: false })
  465 +
  466 + var app = getApp();
  467 + var scene = this.data.id + "";
  468 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  469 + if (user_id > 0) {
  470 + scene += "_" + user_id;
  471 + }
  472 + ///二微码
  473 + var path3 = setting.url + "/api/wx/open/app/user/getWeAppEwm/" +
  474 + setting.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
  475 +
  476 + // 读取文件成功则OK--
  477 + wx.getImageInfo({
  478 + src: path3,
  479 + success: function (res) {
  480 + var b=1.1;
  481 + //获取到二维码的图片
  482 + var vpath = res.path;
  483 + var context = wx.createCanvasContext('share');
  484 + // 先画背景
  485 + context.fillStyle = '#ebf6f8';
  486 + // 灰色实心矩形
  487 + // 1. 语法: x坐标, y坐标, 宽度, 高度
  488 + context.fillRect(0,0,750 * rpx,1338 * rpx);
  489 +
  490 + context.setFontSize(20* rpx)
  491 + context.setFillStyle("#00d8e9")
  492 + context.fillText("官方检测认证", 28*b* rpx, 80*b* rpx);
  493 +
  494 + //两个底部颜色
  495 + context.fillStyle = '#a7ecf5';
  496 + context.fillRect(28 *b* rpx,136 *b* rpx,262 *b* rpx,18 *b* rpx);
  497 + context.fillRect(28 *b* rpx,194 *b* rpx,262 *b* rpx,18 *b* rpx);
  498 +
  499 + context.setFontSize(42*b*rpx)
  500 + context.setFillStyle("#070609")
  501 + context.fillText("我的肌底强韧", 30*b* rpx, 140*b* rpx);
  502 + context.fillText("肌肤鲜活润泽", 30*b* rpx, 196*b* rpx);
  503 +
  504 + //先画一个圆形
  505 + th.circle(context,110*b*rpx, 280*b*rpx,140*b*rpx,"#e7f3f8");
  506 + th.circle(context,130*b*rpx, 300*b*rpx,120*b*rpx,"#c8f2fa");
  507 + //绘制人脸
  508 + context.drawImage(th.data.share_head, 132*b*rpx, 310*b*rpx, 230*b* rpx, 230 *b* rpx);
  509 +
  510 + //左右俩个框并填充文字
  511 + th.darwRoundRect(38 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context);
  512 + th.darwRoundRect(324 *b* rpx,340*b*rpx,140*b*rpx,40*b*rpx,20*b*rpx,context);
  513 + context.setFontSize(20*b*rpx)
  514 + context.setFillStyle("black")
  515 + context.fillText("黑眼圈 重度", 50*b* rpx, 368*b* rpx);
  516 + context.fillText("毛孔 较粗大", 336*b* rpx, 368*b* rpx);
  517 +
  518 + //左右俩个框并填充文字
  519 + th.darwRoundRect(40 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);
  520 + th.darwRoundRect(348 *b* rpx,412*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);
  521 + context.setFillStyle("black")
  522 + context.fillText("黑头 重度", 52*b* rpx, 440*b* rpx);
  523 + context.fillText("色斑 轻度", 354*b* rpx, 440*b* rpx);
  524 +
  525 + //左右俩个框并填充文字
  526 + th.darwRoundRect(60 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);
  527 + th.darwRoundRect(328 *b* rpx,484*b*rpx,116*b*rpx,40*b*rpx,20*b*rpx,context);
  528 + context.setFillStyle("black")
  529 + context.fillText("皱纹 重度", 74*b* rpx, 510*b* rpx);
  530 + context.fillText("痤疮 轻度", 344*b* rpx, 510*b* rpx);
  531 +
  532 + //底部的绘制
  533 + th.darwRoundRect(38 *b* rpx,650*b*rpx,430*b*rpx,160*b*rpx,10*b*rpx,context);
  534 + //绘制二维码
  535 + context.drawImage(vpath, 60*b*rpx, 672*b*rpx, 120 *b* rpx, 120 *b* rpx);
  536 + context.setFillStyle("black")
  537 + context.setFontSize(32*b*rpx)
  538 + context.fillText("美肤管家AI测肤", 200*b* rpx, 726*b* rpx);
  539 + context.setFontSize(22*b*rpx)
  540 + context.fillText("科学了解皮肤的真实状态", 200*b* rpx, 766*b* rpx);
  541 +
  542 + //把画板内容绘制成图片,并回调 画板图片路径
  543 + context.draw(false, function () {
  544 + setTimeout(function () {
  545 + wx.canvasToTempFilePath({
  546 + x: 0,
  547 + y: 0,
  548 + width: 750,
  549 + height: 1338,
  550 + destWidth: 1.4 * 750 * 750 / th.data.screenWidth,
  551 + destHeight: 1.4 * 750 * 750 / th.data.screenWidth,
  552 + canvasId: 'share',
  553 + success: function (res) {
  554 + that.setData({
  555 + shareImgPath: res.tempFilePath,
  556 + canvasHidden: true,
  557 + share_show:1
  558 + })
  559 +
  560 + if (!res.tempFilePath) {
  561 + wx.showModal({
  562 + title: '提示',
  563 + content: '图片绘制中,请稍后重试',
  564 + showCancel: false
  565 + })
  566 + return false;
  567 + }
  568 +
  569 + /*--
  570 + wx.previewImage({
  571 + //将图片预览出来
  572 + ur--*/
  573 +
  574 + wx.hideLoading();
  575 + }
  576 + })
  577 + }, 500)
  578 +
  579 + });
  580 +
  581 + },
  582 + fail: function (res) {
  583 + console.log(res);
  584 + wx.hideLoading();
  585 + }
  586 + });
  587 + },
  588 +
  589 +
  590 + // 圆形图片
  591 + circle: function (ctx, x, y, r,color){
  592 + ctx.save()
  593 + ctx.beginPath();
  594 + var cx = x + r;
  595 + var cy = y + r;
  596 + ctx.arc(cx, cy, r, 0, 2 * Math.PI);
  597 + ctx.clip();
  598 + ctx.fillStyle = color;
  599 + ctx.fillRect(x,y,2 * r,2 * r);
  600 + ctx.restore()
  601 + ctx.closePath();
  602 + },
  603 +
  604 + /**
  605 + * 绘制圆角矩形
  606 + * @param {*} x 起始点x坐标
  607 + * @param {*} y 起始点y坐标
  608 + * @param {*} w 矩形宽
  609 + * @param {*} h 矩形高
  610 + * @param {*} r 圆角半径
  611 + * @param {*} ctx 画板上下文
  612 + */
  613 + darwRoundRect(x, y, w, h, r, ctx) {
  614 + ctx.save()
  615 + ctx.beginPath()
  616 +
  617 + // 左上弧线
  618 + ctx.arc(x + r, y + r, r, 1 * Math.PI, 1.5 * Math.PI)
  619 + // 左直线
  620 + ctx.moveTo(x, y + r)
  621 + ctx.lineTo(x, y + h - r)
  622 + // 左下弧线
  623 + ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, 1 * Math.PI)
  624 + // 下直线
  625 + ctx.lineTo(x + r, y + h)
  626 + ctx.lineTo(x + w - r, y + h)
  627 + // 右下弧线
  628 + ctx.arc(x + w - r, y + h - r, r, 0 * Math.PI, 0.5 * Math.PI)
  629 + // 右直线
  630 + ctx.lineTo(x + w, y + h - r)
  631 + ctx.lineTo(x + w, y + r)
  632 + // 右上弧线
  633 + ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI)
  634 + // 上直线
  635 + ctx.lineTo(x + w - r, y)
  636 + ctx.lineTo(x + r, y)
  637 +
  638 + ctx.setFillStyle('white')
  639 + ctx.fill()
  640 + },
  641 + close_share:function () {
  642 + this.setData({share_show:0})
  643 + },
  644 +
  645 +
  646 + // 保存图片到手机
  647 + savePic() {
  648 + var self = this;
  649 + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限
  650 + this.getSetting().then((res) => {
  651 + // 判断用户是否授权了保存到相册的权限,如果没有发起授权
  652 + if (!res.authSetting['scope.writePhotosAlbum']) {
  653 + this.authorize().then(() => {
  654 + // 同意授权后保存下载文件
  655 + this.saveImage(self.data.shareImgPath)
  656 + .then(() => {
  657 + self.setData({
  658 + share_show: false
  659 + });
  660 + });
  661 + })
  662 + } else {
  663 + // 如果已经授权,保存下载文件
  664 + this.saveImage(self.data.shareImgPath)
  665 + .then(() => {
  666 + self.setData({
  667 + share_show: false
  668 + });
  669 + });
  670 + }
  671 +
  672 + })
  673 + },
  674 + // 获取用户已经授予了哪些权限
  675 + getSetting() {
  676 + return new Promise((resolve, reject) => {
  677 + wx.getSetting({
  678 + success: res => {
  679 + resolve(res)
  680 + }
  681 + })
  682 + })
  683 + },
  684 + // 发起首次授权请求
  685 + authorize() {
  686 + // isFirst 用来记录是否为首次发起授权,
  687 + // 如果首次授权拒绝后,isFirst赋值为1
  688 + let isFirst = wx.getStorageSync('isFirst') || 0;
  689 + return new Promise((resolve, reject) => {
  690 + wx.authorize({
  691 + scope: 'scope.writePhotosAlbum',
  692 + // 同意授权
  693 + success: () => {
  694 + resolve();
  695 + },
  696 + // 拒绝授权,这里是用户拒绝授权后的回调
  697 + fail: res => {
  698 + if (isFirst === 0) {
  699 + wx.setStorageSync('isFirst', 1);
  700 + wx.showToast({
  701 + title: '保存失败',
  702 + icon: 'none',
  703 + duration: 1000
  704 + })
  705 + } else {
  706 + this.showModal();
  707 + }
  708 + console.log('拒绝授权');
  709 + reject();
  710 + }
  711 + })
  712 + })
  713 + },
  714 + // 保存图片到系统相册
  715 + saveImage(saveUrl) {
  716 + var self = this;
  717 + return new Promise((resolve, reject) => {
  718 + wx.saveImageToPhotosAlbum({
  719 + filePath: saveUrl,
  720 + success: (res) => {
  721 + wx.showToast({
  722 + title: '保存成功',
  723 + duration: 1000,
  724 + });
  725 + resolve();
  726 + },
  727 + fail: () => {
  728 + wx.showToast({
  729 + title: '保存失败',
  730 + duration: 1000,
  731 + });
  732 + }
  733 + })
  734 + })
  735 + },
  736 +
  737 + //-----领取券-----
  738 + get_quan: function (e) {
  739 +
  740 + var cid = e.currentTarget.dataset.cid;
  741 + var index = e.currentTarget.dataset.ind;
  742 + var q_word = e.currentTarget.dataset.word;
  743 + var item = this.data[q_word][index];
  744 +
  745 + //--先判断会员状态--
  746 + var user_info = getApp().globalData.userInfo;
  747 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  748 + wx.navigateTo({
  749 + url: '/pages/togoin/togoin',
  750 + })
  751 + return false;
  752 + }
  753 +
  754 +
  755 + //如果券还在领取中,不能再点
  756 + if (item.linging == 1) {
  757 + getApp().my_warnning('领取中..', 0, this);
  758 + return false;
  759 + }
  760 +
  761 + //如果领取的次数到了
  762 + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) {
  763 + getApp().my_warnning('领取失败,您已领完该券', 0, this);
  764 + return false;
  765 + }
  766 +
  767 + var lq_num = item.lqnum;
  768 +
  769 + var pdata = {
  770 + 'uid': getApp().globalData.user_id,
  771 + 'cid': cid,
  772 + 'store_id': setting.stoid,
  773 + 'type': 5
  774 + };
  775 +
  776 + //-- 导购ID --
  777 + if (getApp().globalData.guide_id) {
  778 + pdata.guide_id = getApp().globalData.guide_id;
  779 + }
  780 +
  781 + var app = getApp(),th = this;
  782 + wx.showLoading();
  783 + app.request.post("/api/weshop/couponList/saveCouponList", {
  784 + data: pdata,
  785 + success: function (res) {
  786 + wx.hideLoading();
  787 + if (res.data.code == 0) {
  788 + app.my_warnning("领取成功", 1, th);
  789 + lq_num++;
  790 + var text = q_word+"[" + index + "].lqnum";
  791 + var text2 = q_word+"[" + index + "].linging";
  792 + var obj = {};
  793 + obj[text] = lq_num;
  794 + obj[text2] = 0;
  795 + th.setData(obj);
  796 + } else {
  797 + app.confirmBox(res.data.msg);
  798 + var text2 = q_word+"[" + index + "].linging";
  799 + var obj = {};
  800 + obj[text2] = 0;
  801 + th.setData(obj);
  802 + }
  803 + }
  804 + })
  805 + },
  806 +
  807 +
443 808
444 }) 809 })
445 \ No newline at end of file 810 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/success_result.json
1 { 1 {
2 "usingComponents": { 2 "usingComponents": {
  3 + "warn": "/components/long_warn/long_warn"
3 }, 4 },
  5 + "disableScroll": true,
4 "navigationBarTitleText": "测肤报告" 6 "navigationBarTitleText": "测肤报告"
5 } 7 }
6 \ No newline at end of file 8 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/success_result.wxml
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 <view class="mark">痤疮 {{acne_num}}</view> 28 <view class="mark">痤疮 {{acne_num}}</view>
29 </view> 29 </view>
30 </view> 30 </view>
31 - <view class="score"> 31 + <view class="score" style="display: none">
32 <view> 32 <view>
33 <view class="fs28">综合得分</view> 33 <view class="fs28">综合得分</view>
34 <view class="t-c mt10"> 34 <view class="t-c mt10">
@@ -97,12 +97,12 @@ @@ -97,12 +97,12 @@
97 97
98 98
99 <view class="mask" catchtap="close_mask" wx:if="{{showDialog}}"></view> 99 <view class="mask" catchtap="close_mask" wx:if="{{showDialog}}"></view>
100 -<cover-view bindtap="click_share" class="share fs28"> 100 +<cover-view bindtap="saveImageToPhotosAlbum" class="share fs28">
101 <cover-view class="iconfont icon-zhuanfa1" style="padding: 0 10rpx;"></cover-view> 101 <cover-view class="iconfont icon-zhuanfa1" style="padding: 0 10rpx;"></cover-view>
102 <cover-view>分享</cover-view> 102 <cover-view>分享</cover-view>
103 </cover-view> 103 </cover-view>
104 104
105 - 105 +<!-- 问题标注 -->
106 <view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}"> 106 <view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}">
107 <!-- 局部放大的 --> 107 <!-- 局部放大的 -->
108 <block wx:if="{{img_scale}}"> 108 <block wx:if="{{img_scale}}">
@@ -193,47 +193,12 @@ @@ -193,47 +193,12 @@
193 </view> 193 </view>
194 </view> 194 </view>
195 </block> 195 </block>
196 - <block wx:elif="{{share_flag}}">  
197 - <view class="dialog_icon" catchtap="close_dialog" style="justify-content: flex-start;">  
198 - <text class="iconfont icon-guan mt20" style="z-index: 999;font-size: 20rpx;"></text>  
199 - </view>  
200 - <view class="share_dialog">  
201 - <view class="fs24" style="width: 50%;">  
202 - <view style="color: #6adaec;margin-bottom:20rpx;">官方检测认证</view>  
203 - <view class="renzheng">我的肌底强韧肌肤鲜活润泽</view>  
204 - </view>  
205 - <view class="analyse1">  
206 - <view class="analyse_left1">  
207 - <view class="mark1">毛孔 {{pore_num}}</view>  
208 - <view class="mark1" style="margin: 40rpx 0;">色斑 {{speckle_num}}</view>  
209 - <view class="mark1">黑眼圈 {{s_filter.get_dark_type(dark_type)}}</view>  
210 - </view>  
211 - <view class="analyse_center1">  
212 - <image style="width: 100%;height: 100%;" wx:if="{{sex === 'female'}}" src="{{iurl}}/miniapp/images/skinimg/nv.png"></image>  
213 - <image style="width: 100%;height: 100%;" wx:else src="{{iurl}}/miniapp/images/skinimg/nan.png"></image>  
214 - </view>  
215 - <view class="analyse_right1">  
216 - <view class="mark1">黑头 {{blackhead_num}}</view>  
217 - <view class="mark1" style="margin: 40rpx 0;">皱纹 {{wrinkle_num}}</view>  
218 - <view class="mark1">痤疮 {{acne_num}}</view>  
219 - </view>  
220 - </view>  
221 -  
222 - <view class="share_dialog_bottom">  
223 - <image style="width: 80rpx;height: 80rpx;margin:0 20rpx 0 10rpx" src="{{iurl}}/miniapp/images/skinimg/heiyanquan.png"></image>  
224 - <view style="font-size: 24rpx;">  
225 - <view>美肤管家AI测肤</view>  
226 - <view>科学了解皮肤的真实状态</view>  
227 - </view>  
228 - </view>  
229 - </view>  
230 - </block>  
231 <!-- 全图的,能够自由拖拽和放大 --> 196 <!-- 全图的,能够自由拖拽和放大 -->
232 197
233 <!-- 缩小 --> 198 <!-- 缩小 -->
234 <block wx:else> 199 <block wx:else>
235 - <view bindtouchstart='touchstartCallback' bindtouchmove='touchmoveCallback'  
236 - style="position: relative;transform: scale(img_scale);top: {{img_top}}px; left: {{img_left}}px;"> 200 + <view bindtouchstart='touchstartCallback' bindtouchmove='touchmoveCallback' bindtouchEnd='touchendCallback'
  201 + style="position: relative;transform: scale({{ig_scale}});top: {{img_top}}px; left: {{img_left}}px;">
237 <image style="width: 100%;" src="{{iurl}}{{face_img}}" mode="widthFix" ></image> 202 <image style="width: 100%;" src="{{iurl}}{{face_img}}" mode="widthFix" ></image>
238 203
239 <block wx:if="{{yanjing}}"> 204 <block wx:if="{{yanjing}}">
@@ -291,4 +256,20 @@ @@ -291,4 +256,20 @@
291 <text catchtap="click_fangda" class="iconfont icon-suoxiao mgb20"></text> 256 <text catchtap="click_fangda" class="iconfont icon-suoxiao mgb20"></text>
292 </view> 257 </view>
293 </block> 258 </block>
294 -</view>  
295 \ No newline at end of file 259 \ No newline at end of file
  260 +</view>
  261 +
  262 +
  263 +<!-- 二维码显示页面 -->
  264 +<canvas canvas-id='share' style='width:750rpx;height:1338rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas>
  265 +
  266 +<!-- 展示分享图 -->
  267 +<view id="share_show" wx:if="{{share_show}}">
  268 + <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view>
  269 + <view class="share_content">
  270 + <view class="sh_close" bindtap="close_share"><text class="iconfont icon-close"></text></view>
  271 + <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image>
  272 + <view class="share_save_btn" bindtap="savePic">保存到相册</view>
  273 + </view>
  274 +</view>
  275 +
  276 +<warn id="warn"></warn>
296 \ No newline at end of file 277 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/success_result.wxss
@@ -529,7 +529,7 @@ page { @@ -529,7 +529,7 @@ page {
529 left: 205rpx; 529 left: 205rpx;
530 width: 30rpx; 530 width: 30rpx;
531 height: 30rpx; 531 height: 30rpx;
532 - background: #fff; 532 + background: #e6f4fa;
533 overflow: hidden; 533 overflow: hidden;
534 } 534 }
535 535
@@ -568,7 +568,7 @@ page { @@ -568,7 +568,7 @@ page {
568 } 568 }
569 569
570 .background { 570 .background {
571 - background: #f40028; 571 + background: #45d4eb;
572 } 572 }
573 573
574 .xc-get { 574 .xc-get {
@@ -589,7 +589,7 @@ page { @@ -589,7 +589,7 @@ page {
589 left: 205rpx; 589 left: 205rpx;
590 width: 30rpx; 590 width: 30rpx;
591 height: 30rpx; 591 height: 30rpx;
592 - background: #fff; 592 + background: #e6f4fa;
593 } 593 }
594 594
595 .abs { 595 .abs {
@@ -613,7 +613,8 @@ page { @@ -613,7 +613,8 @@ page {
613 613
614 .share_dialog { 614 .share_dialog {
615 background: #e8f5fd; 615 background: #e8f5fd;
616 - height: 100%; 616 + width: 600rpx;
  617 + height: 700rpx;
617 padding: 40rpx; 618 padding: 40rpx;
618 display: flex; 619 display: flex;
619 flex-direction: column; 620 flex-direction: column;
@@ -632,4 +633,19 @@ page { @@ -632,4 +633,19 @@ page {
632 display: flex; 633 display: flex;
633 padding: 30rpx; 634 padding: 30rpx;
634 border-radius: 20rpx; 635 border-radius: 20rpx;
  636 +}
  637 +
  638 +.share_content{position: fixed;z-index: 999999;top: 50%; left: 50%; width: 70%;transform: translate(-50%, -50%);}
  639 +.share_save_btn{width: 100%; height: 80rpx;line-height: 80rpx; text-align: center;color: #fff;background-color:#c3172d }
  640 +.sh_close{ position: absolute; right: 20rpx;top: 20rpx;width: 70rpx; height: 70rpx;
  641 + display: flex;justify-content: center;align-items: center;font-size: 26rpx;
  642 + border-radius: 50%; background-color: grey;color: #fff}
  643 +
  644 +@font-face {
  645 + font-family: "iconfont"; /* Project id */
  646 + src: url('iconfont.ttf?t=1645607343376') format('truetype');
  647 +}
  648 +
  649 +.icon-close:before {
  650 + content: "\e668";
635 } 651 }
636 \ No newline at end of file 652 \ No newline at end of file
packageD/pages/AI-test-skin/success_result/wrinkle/wrinkle.js
1 -/*  
2 - * @Author: abson  
3 - * @Date: 2022-02-21 11:03:07  
4 - * @LastEditTime: 2022-02-21 17:50:01  
5 - * @LastEditors: Please set LastEditors  
6 - * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\wrinkle\wrinkle.js  
7 - */  
8 module.exports = { 1 module.exports = {
9 2
10 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件 3 //把组合购的商品价格计算出来,同时每个会员都有购买组合商品的上限!ladder_b_num是已经购买了多少件
11 - get_goods: function(th,stoid) {  
12 - var r_code='02'; 4 + get_goods: function(th,stoid,sort) {
  5 + th.setData({wrinkle_sort:sort});
  6 + var r_code='02';
13 //获取痘痘的类型 7 //获取痘痘的类型
14 var list=th.data.face_data.wrinkle.wrinkle_types; 8 var list=th.data.face_data.wrinkle.wrinkle_types;
15 //把所有的斑的类型拿出来 9 //把所有的斑的类型拿出来
@@ -42,7 +36,12 @@ module.exports = { @@ -42,7 +36,12 @@ module.exports = {
42 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; 36 var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2";
43 getApp().request.promiseGet(url, {}).then(res=>{ 37 getApp().request.promiseGet(url, {}).then(res=>{
44 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ 38 if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
45 - th.setData({wrinkle_quan_list:res.data.data.pageData}); 39 + var arr=res.data.data.pageData;
  40 + arr.map(function (e) {
  41 + e.q_word='wrinkle_quan_list';
  42 + return e;
  43 + })
  44 + th.setData({wrinkle_quan_list:arr});
46 } 45 }
47 }) 46 })
48 }, 47 },
packageD/pages/AI-test-skin/success_result/wrinkle/wrinkle.wxml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="analyse_classify bg_white"> 2 <view class="analyse_classify bg_white">
3 <view class="analyse_classify_header"> 3 <view class="analyse_classify_header">
4 <view> 4 <view>
5 - <view style="color: #45d4eb;">#03</view> 5 + <view style="color: #45d4eb;">#0{{wrinkle_sort}}</view>
6 <view class="flex-space-between"> 6 <view class="flex-space-between">
7 <text style="font-size: 42rpx;" class="bold">皱纹</text> 7 <text style="font-size: 42rpx;" class="bold">皱纹</text>
8 <view class="fs26" catchtap="show_dailog" data-type="3" style="display: flex;align-items: center;"> 8 <view class="fs26" catchtap="show_dailog" data-type="3" style="display: flex;align-items: center;">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 </view> 17 </view>
18 <view style="line-height:60rpx;margin-left:20rpx"> 18 <view style="line-height:60rpx;margin-left:20rpx">
19 <view class="fs28">程度情况</view> 19 <view class="fs28">程度情况</view>
20 - <view class="bold">较粗大</view> 20 + <view class="bold">皱纹数{{wrinkle_num}}条</view>
21 </view> 21 </view>
22 </view> 22 </view>
23 <view class="analyse" style="height:400rpx;"> 23 <view class="analyse" style="height:400rpx;">
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 </view> 50 </view>
51 </view> 51 </view>
52 <view class="fs28 mt_b10"> 52 <view class="fs28 mt_b10">
53 - <text>明显可见毛孔或内含小于毛孔大小角栓</text> 53 + <text>隐约可见皱纹</text>
54 </view> 54 </view>
55 </view> 55 </view>
56 <view class="analyse_classify_body"> 56 <view class="analyse_classify_body">
@@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
116 <!-- 优惠券 --> 116 <!-- 优惠券 -->
117 <view wx:if="{{wrinkle_quan_list}}"> 117 <view wx:if="{{wrinkle_quan_list}}">
118 <view style="margin:5% 0">适合皱纹商品的优惠券</view> 118 <view style="margin:5% 0">适合皱纹商品的优惠券</view>
119 - <view class="xc-coupon-frame rel"> 119 + <view class="xc-coupon-frame">
120 <block wx:for="{{wrinkle_quan_list}}"> 120 <block wx:for="{{wrinkle_quan_list}}">
121 <include src="../coupon.wxml" /> 121 <include src="../coupon.wxml" />
122 </block> 122 </block>