Commit cf9d491b3d7e78518f8c515ee829c7e25573e8ce
1 parent
f552f303
[年会抽奖]调试头像尺寸
Showing
2 changed files
with
9 additions
and
2 deletions
mobile.html
@@ -63,7 +63,7 @@ | @@ -63,7 +63,7 @@ | ||
63 | .pic-img-wrap {position: relative;width: 4.78rem;height: 4.78rem;margin: .5rem auto 0;box-sizing: border-box;padding: .96rem .92rem .98rem 1.02rem;} | 63 | .pic-img-wrap {position: relative;width: 4.78rem;height: 4.78rem;margin: .5rem auto 0;box-sizing: border-box;padding: .96rem .92rem .98rem 1.02rem;} |
64 | .pic-img-bg {position: absolute;top: 0;left: 0;z-index: 1;width: 100%;height: 100%;background: url('./img/mobile/pic_avatar_bg.png') no-repeat;background-size: 100% 100%;} | 64 | .pic-img-bg {position: absolute;top: 0;left: 0;z-index: 1;width: 100%;height: 100%;background: url('./img/mobile/pic_avatar_bg.png') no-repeat;background-size: 100% 100%;} |
65 | .pic-avatar-wrap {width: 2.84rem;height: 2.84rem;border-radius: 50%;overflow: hidden;} | 65 | .pic-avatar-wrap {width: 2.84rem;height: 2.84rem;border-radius: 50%;overflow: hidden;} |
66 | - .pic-avatar {width: 2.84rem;} | 66 | + .pic-avatar {} |
67 | .pic-btn-wrap {position: absolute;bottom: 1.2rem;left: 50%;transform: translateX(-50%);width: 6.82rem;padding-bottom: .72rem;} | 67 | .pic-btn-wrap {position: absolute;bottom: 1.2rem;left: 50%;transform: translateX(-50%);width: 6.82rem;padding-bottom: .72rem;} |
68 | .pic-btn-album {position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);width: 3rem;display: flex;align-items: center;justify-content: center;} | 68 | .pic-btn-album {position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);width: 3rem;display: flex;align-items: center;justify-content: center;} |
69 | .pic-btn-album .album-text {font-size: .28rem;color: #fff;margin-right: .1rem;} | 69 | .pic-btn-album .album-text {font-size: .28rem;color: #fff;margin-right: .1rem;} |
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
76 | .info-center {position: absolute;top: .4rem;left: 50%;transform: translateX(-50%);} | 76 | .info-center {position: absolute;top: .4rem;left: 50%;transform: translateX(-50%);} |
77 | .user-avatar {position: relative;width: 1.34rem;height: 1.4rem;box-sizing: border-box;padding-top: .24rem;padding-left: .18rem;margin: 0 auto;overflow: hidden;} | 77 | .user-avatar {position: relative;width: 1.34rem;height: 1.4rem;box-sizing: border-box;padding-top: .24rem;padding-left: .18rem;margin: 0 auto;overflow: hidden;} |
78 | .user-avatar .avatar-img-wrap {width: 1.14rem;height: 1.14rem;border-radius: 50%;overflow: hidden;} | 78 | .user-avatar .avatar-img-wrap {width: 1.14rem;height: 1.14rem;border-radius: 50%;overflow: hidden;} |
79 | - .user-avatar .avatar-img {width: 1.14rem;} | 79 | + .user-avatar .avatar-img {} |
80 | .user-avatar .avatar-border {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url('./img/mobile/home_avatar.png') no-repeat;background-size: 100% 100%;} | 80 | .user-avatar .avatar-border {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url('./img/mobile/home_avatar.png') no-repeat;background-size: 100% 100%;} |
81 | .info-center .user-name {text-align: center;font-size: .36rem;font-weight: 500;color: #C93120;margin-top: .1rem;} | 81 | .info-center .user-name {text-align: center;font-size: .36rem;font-weight: 500;color: #C93120;margin-top: .1rem;} |
82 | .info-main {position: absolute;bottom: .8rem;left: 50%;transform: translateX(-50%); width: 6.3rem; height: .82rem;display: flex;align-items: center;} | 82 | .info-main {position: absolute;bottom: .8rem;left: 50%;transform: translateX(-50%); width: 6.3rem; height: .82rem;display: flex;align-items: center;} |
mobile.js
@@ -145,6 +145,12 @@ var action = { | @@ -145,6 +145,12 @@ var action = { | ||
145 | isShowProgressTips: 1, // 进度提示 | 145 | isShowProgressTips: 1, // 进度提示 |
146 | success: function(res) { | 146 | success: function(res) { |
147 | $('.pic-avatar').attr('src', localIds); | 147 | $('.pic-avatar').attr('src', localIds); |
148 | + $('.pic-avatar').css({ | ||
149 | + width: '', | ||
150 | + height: '', | ||
151 | + 'margin-left': '', | ||
152 | + 'margin-top': '' | ||
153 | + }); | ||
148 | action.loadImage('.pic-avatar', '.pic-avatar-wrap'); | 154 | action.loadImage('.pic-avatar', '.pic-avatar-wrap'); |
149 | action.mediaId = res.serverId; // 返回图片的服务器端ID,即 mediaId | 155 | action.mediaId = res.serverId; // 返回图片的服务器端ID,即 mediaId |
150 | console.log('action.mediaId: ', action.mediaId); | 156 | console.log('action.mediaId: ', action.mediaId); |
@@ -167,6 +173,7 @@ var action = { | @@ -167,6 +173,7 @@ var action = { | ||
167 | }, | 173 | }, |
168 | loadImage: function(dom, parent) { | 174 | loadImage: function(dom, parent) { |
169 | var width = $(parent).width(); | 175 | var width = $(parent).width(); |
176 | + console.log('parent: ', width); | ||
170 | $(dom).on('load', function() { | 177 | $(dom).on('load', function() { |
171 | var imgWidth = $(dom).width(); | 178 | var imgWidth = $(dom).width(); |
172 | var imgHeight = $(dom).height(); | 179 | var imgHeight = $(dom).height(); |