Commit 0e4483481803adefb0bdb019c3b2f13e3c4a9477

Authored by abson
2 parents b1acfdf2 b9314b65

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

packageB/pages/AI-test-skin/success_result/pore/pore.wxml
... ... @@ -5,7 +5,7 @@
5 5 <view style="color: #45d4eb;">#01</view>
6 6 <view class="flex-space-between">
7 7 <text style="font-size: 42rpx;" class="bold">毛孔</text>
8   - <view class="fs26" catchtap="show_dailog" style="display: flex;align-items: center;">
  8 + <view class="fs26" catchtap="show_dailog" data-type="1" style="display: flex;align-items: center;">
9 9 <text>问题标注</text>
10 10 <text class="iconfont icon-xia"></text>
11 11 </view>
... ...
packageB/pages/AI-test-skin/success_result/success_result.js
... ... @@ -29,9 +29,11 @@ Page({
29 29 tab_id: 'zong_he',
30 30 iurl: setting.imghost,
31 31 showDialog: false,
32   - yanjing: true,
  32 + yanjing: true, //显示皮肤问题
33 33 img_scale: true, //问题标注放大图片
34 34 img_scale_icon:true,
  35 + show_problem:1, //问题标注显示问题
  36 +
35 37 },
36 38  
37 39 /**
... ... @@ -44,7 +46,13 @@ Page({
44 46 //var face_result=getApp().globalData.face_result;
45 47 //var face_data=face_result.face_list[0];
46 48 this.data.id=options.id;
47   - this.get_data(function (json,img) {
  49 +
  50 + //计算图片要显示的大小
  51 + th.data.cWidth = wx.getSystemInfoSync().windowWidth;
  52 + th.data.cHeight = wx.getSystemInfoSync().windowHeight;
  53 + th.data.face_height=th.data.cHeight*0.8*0.8;
  54 +
  55 + this.get_data(function (json,img) {
48 56 //-- 数据先存着 --
49 57 var face_data=th.data.face_data=json.face_list[0];
50 58 //痤疮数
... ... @@ -66,6 +74,9 @@ Page({
66 74 var skin_sensitive_check=face_data.skinquality.skin_sensitive_check[0];
67 75 var skin_dryoil_check=face_data.skinquality.skin_dryoil_check;
68 76  
  77 + var location=face_data.location;
  78 + th.data.bili=th.data.face_height/(location.height+location.height/2.3);
  79 +
69 80 th.setData({
70 81 acne_num:acne_num,
71 82 speckle_num:speckle_num,
... ... @@ -75,7 +86,10 @@ Page({
75 86 dark_type:dark_type,
76 87 skin_sensitive_check:skin_sensitive_check,
77 88 skin_dryoil_check:skin_dryoil_check,
78   - face_img:img
  89 + face_img:img,
  90 + m_top:(location.top-location.height/2.5)*th.data.bili,
  91 + m_left:(location.left-location.width/7)*th.data.bili,
  92 + bili:th.data.bili
79 93 })
80 94 //-- 调用毛孔的推荐函数 --
81 95 if(pore_num>0)
... ... @@ -97,13 +111,12 @@ Page({
97 111 acne.get_goods(th,setting.stoid);
98 112 })
99 113 },
100   -
101 114  
102 115 //-- 初始等级卡 --
103 116 init: function () {
104 117 var th = this;
105 118 if (!getApp().globalData.user_id) return false;
106   - getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
  119 + getApp().request.get("/api/weshop/users/get/" + setting.stoid + "/" + getApp().globalData.user_id, {
107 120 isShowLoading: false,
108 121 success: function (e) {
109 122 if (e.data.code == 0 && e.data && e.data.data) {
... ... @@ -205,10 +218,22 @@ Page({
205 218 onUnload: function () {
206 219  
207 220 },
208   - show_dailog() {
  221 + show_dailog(e) {
209 222 this.setData({
210 223 showDialog: true,
211 224 })
  225 +
  226 + var type=parseInt(e.currentTarget.dataset.type);
  227 + switch (type){
  228 + case 1: //毛孔
  229 + var pore_list=this.data.face_data.blackheadpore.circles[0].pore;
  230 + this.setData({pore_list:pore_list,show_type:type});
  231 + break;
  232 + case 2:
  233 + break;
  234 + default:
  235 + break
  236 + }
212 237 },
213 238  
214 239 close_dialog() {
... ... @@ -253,7 +278,7 @@ Page({
253 278  
254 279 //--- 获取卡类列表 ---
255 280 getPlusCardType: function (func) {
256   - var storid = o.stoid;
  281 + var storid = setting.stoid;
257 282 var th = this;
258 283 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
259 284  
... ... @@ -290,4 +315,19 @@ Page({
290 315 func(ob);
291 316 })
292 317 },
  318 +
  319 + //图片加载的时候,计算图片的像素大小
  320 + face_img_load: function (e) {
  321 + var th=this;
  322 + var imgwidth = e.detail.width;
  323 + var imgheight = e.detail.height;
  324 +
  325 + var w= th.data.cWidth*0.8;
  326 +
  327 + this.setData({
  328 + iwidth:imgwidth*th.data.bili,
  329 + iheight:imgheight*th.data.bili,
  330 + bili1:w/imgwidth //图片放大时候的比例
  331 + })
  332 + },
293 333 })
294 334 \ No newline at end of file
... ...
packageB/pages/AI-test-skin/success_result/success_result.wxml
... ... @@ -102,11 +102,24 @@
102 102 <cover-view>分享</cover-view>
103 103 </cover-view>
104 104  
105   -<view class="dialog" wx:if="{{showDialog}}">
  105 +<view class="dialog {{img_scale?'scale':'fangda'}}" wx:if="{{showDialog}}">
  106 + <!-- 放大的 -->
106 107 <block wx:if="{{img_scale}}">
107 108 <view class="dialog_img">
108   - <view style="height: 100%; overflow: hidden">
109   - <image src="{{iurl}}{{face_img}}" style="width: 100%;height: 100%;"></image>
  109 + <view class="img_content">
  110 + <view class="face_show_view"
  111 + style="position: relative;width:{{iwidth}}px;height:{{iheight}}px;margin-top: -{{m_top}}px;margin-left: -{{m_left}}px">
  112 + <image src="{{iurl}}{{face_img}}" bindload="face_img_load" style="width: 100%;height: 100%;"></image>
  113 +
  114 + <block wx:if="{{yanjing}}">
  115 + <!-- 显示毛孔 -->
  116 + <block wx:if="{{show_type==1}}">
  117 + <block wx:for="{{pore_list}}">
  118 + <view class="abs p_circle" style="left:{{(item.x-item.r)*bili}}px; top:{{(item.y-item.r)*bili}}px; height:{{2*item.r*bili}}px;width: {{2*item.r*bili}}px"></view>
  119 + </block>
  120 + </block>
  121 + </block>
  122 + </view>
110 123 </view>
111 124 <view class="dialog_icon" catchtap="close_dialog" style="justify-content: flex-start;">
112 125 <text class="iconfont icon-guan mt20" style="z-index: 999;font-size: 20rpx;"></text>
... ... @@ -132,8 +145,20 @@
132 145 </view>
133 146 </view>
134 147 </block>
  148 + <!-- 缩小 -->
135 149 <block wx:else>
136   - <image style="width: 100%;height: 100%;" src="../../../images/1.jpg"></image>
  150 + <view style="position: relative">
  151 + <image style="width: 100%;" src="{{iurl}}{{face_img}}" mode="widthFix" ></image>
  152 + <block wx:if="{{yanjing}}">
  153 + <!-- 显示毛孔 -->
  154 + <block wx:if="{{show_type==1}}">
  155 + <block wx:for="{{pore_list}}">
  156 + <view class="abs p_circle" style="left:{{(item.x-item.r)*bili1}}px; top:{{(item.y-item.r)*bili1}}px; height:{{2*item.r*bili1}}px;width: {{2*item.r*bili1}}px"></view>
  157 + </block>
  158 + </block>
  159 + </block>
  160 + </view>
  161 +
137 162 <view class="dialog_icon">
138 163 <text catchtap="click_fangda" class="iconfont icon-suoxiao mgb20"></text>
139 164 </view>
... ...
packageB/pages/AI-test-skin/success_result/success_result.wxss
... ... @@ -117,6 +117,7 @@ page {
117 117 left: 0;
118 118 right: 0;
119 119 background-color: rgba(0, 0, 0, .6);
  120 + z-index: 999;
120 121 }
121 122  
122 123 .ll::after {
... ... @@ -382,10 +383,11 @@ page {
382 383 height: 70%;
383 384 width: 80%;
384 385 border-radius: 30rpx;
  386 + z-index: 99999999;
385 387 }
386 388  
387 389 .dialog .dialog_img {
388   - height: 80%;
  390 + height: 84%;
389 391 position: relative;
390 392 }
391 393  
... ... @@ -394,6 +396,7 @@ page {
394 396 align-items: center;
395 397 justify-content: center;
396 398 background-color: #fff;
  399 + min-height: 20%;
397 400 }
398 401  
399 402 .dialog .dialog_icon {
... ... @@ -424,3 +427,11 @@ page {
424 427 border-radius: 3rpx;
425 428 background: #2cb344;
426 429 }
  430 +
  431 +.img_content{
  432 + height: 100%;overflow: hidden;border-top-left-radius: 8px;border-top-right-radius: 8px;
  433 +}
  434 +.abs{position: absolute}
  435 +.p_circle{ border: 1rpx solid #c8162c;border-radius: 50%}
  436 +
  437 +.dialog.fangda{ height: auto}
... ...