Commit 2a2fd1c9c32d1dd572291d0a961ac44f44fc5f97

Authored by zouyang0921
1 parent 65a7de25

[年会抽奖]修复上传头像变形

Showing 1 changed file with 3 additions and 3 deletions
mobile.js
@@ -169,13 +169,13 @@ var action = { @@ -169,13 +169,13 @@ var action = {
169 var img = new Image(); 169 var img = new Image();
170 img.src = src; // 改变图片的src 170 img.src = src; // 改变图片的src
171 if (img.complete) { // 判断是否有缓存 171 if (img.complete) { // 判断是否有缓存
172 - action.adjustImageSize(dom); 172 + action.adjustImageSize(dom, img);
173 } else { // 加载完成执行 173 } else { // 加载完成执行
174 - action.adjustImageSize(dom); 174 + action.adjustImageSize(dom, img);
175 } 175 }
176 }, 176 },
177 // 调整头像尺寸 177 // 调整头像尺寸
178 - adjustImageSize: function(dom) { 178 + adjustImageSize: function(dom, img) {
179 var width = parseInt($(dom).css('width')); 179 var width = parseInt($(dom).css('width'));
180 console.log('dom-width: ', width); 180 console.log('dom-width: ', width);
181 console.log('img-width: ' + img.width, 'img-height: ' + img.height); 181 console.log('img-width: ' + img.width, 'img-height: ' + img.height);