Fix:3285 【商城小程序】用户昵称有两行时,部分机型的【设置中心】按钮超出了红色区域(机型:苹果12)
This commit is contained in:
+30
-13
@@ -39,18 +39,20 @@
|
|||||||
class="vip"
|
class="vip"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="qrcode" @click="getSpreadPoster">
|
<view :class="{'v12-align-center': !nowrap}">
|
||||||
<image :src="webUrl + '/icon/icon-qrcode.png'" class="code" />
|
<view class="qrcode" @click="getSpreadPoster">
|
||||||
<text class="code-txt">会员码</text>
|
<image :src="webUrl + '/icon/icon-qrcode.png'" class="code" />
|
||||||
</view>
|
<text class="code-txt">会员码</text>
|
||||||
<view class="v12-align-center v12-mt-2" @click="linkTo('/pkg_user/views/personalData')">
|
</view>
|
||||||
<image
|
<view class="v12-align-center" :class="{'v12-ml-2': !nowrap, 'v12-mt-2' : nowrap}" @click="linkTo('/pkg_user/views/personalData')">
|
||||||
:src="webUrl + '/icon/icon-setting.png'"
|
<image
|
||||||
class="settings-img v12-mr-1"
|
:src="webUrl + '/icon/icon-setting.png'"
|
||||||
/>
|
class="settings-img v12-mr-1"
|
||||||
<text class="v12-font-30">
|
/>
|
||||||
设置中心
|
<text class="v12-font-30">
|
||||||
</text>
|
设置中心
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="avatar-cont" @click="goPersonalData()">
|
<view class="avatar-cont" @click="goPersonalData()">
|
||||||
@@ -356,7 +358,8 @@ export default {
|
|||||||
],
|
],
|
||||||
bannerBgUrl: '',
|
bannerBgUrl: '',
|
||||||
userCenterBannerUrl: '',
|
userCenterBannerUrl: '',
|
||||||
pageKeyId: Object.freeze('userIndex')
|
pageKeyId: Object.freeze('userIndex'),
|
||||||
|
nowrap: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: mapGetters(['userInfo']),
|
computed: mapGetters(['userInfo']),
|
||||||
@@ -388,6 +391,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['updateAuthorizationPage']),
|
...mapMutations(['updateAuthorizationPage']),
|
||||||
|
// 新增方法:计算文本像素长度
|
||||||
|
getTextWidth() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query.select('.txt-cont').boundingClientRect(data => {
|
||||||
|
console.log(data, 'data');
|
||||||
|
if (data) {
|
||||||
|
this.nowrap = data.width < 200;
|
||||||
|
return data.width;
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
|
})
|
||||||
|
},
|
||||||
handleSwiper(e) {
|
handleSwiper(e) {
|
||||||
const url = this.userCenterCarousel[e].url
|
const url = this.userCenterCarousel[e].url
|
||||||
this.linkTo(url)
|
this.linkTo(url)
|
||||||
@@ -463,6 +479,7 @@ export default {
|
|||||||
const _this = this
|
const _this = this
|
||||||
getUserLevelInfo().then((res) => {
|
getUserLevelInfo().then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
|
_this.getTextWidth()
|
||||||
_this.userLevelInfo = res.data
|
_this.userLevelInfo = res.data
|
||||||
}
|
}
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|||||||
Reference in New Issue
Block a user