feat: add avatar modification limit display
This commit is contained in:
@@ -93,6 +93,15 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 没有修改次数时点击头像
|
||||
onAvatarNoCount() {
|
||||
wx.showToast({
|
||||
title: '本年度修改头像次数已用完',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
},
|
||||
|
||||
// 修改昵称
|
||||
onNicknameChange(e) {
|
||||
let newName = e.detail.value;
|
||||
|
||||
@@ -3,8 +3,23 @@
|
||||
<view class='container' wx:if="{{members.nickname}}">
|
||||
<!-- 昵称信息 -->
|
||||
<view class='list'>
|
||||
<button class='cell avatar cell-btn' open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
|
||||
<!-- 如果还有修改次数 -->
|
||||
<button wx:if="{{members.avatarModifyRemainCount > 0}}" class='cell avatar cell-btn' open-type="chooseAvatar" bindchooseavatar="onChooseAvatar">
|
||||
<view class='title-box'>
|
||||
<text class='title'>头像</text>
|
||||
<text class='sub-title'>本年还可修改{{members.avatarModifyRemainCount}}次</text>
|
||||
</view>
|
||||
<view class='right-cell'>
|
||||
<image class='avatar-img' src='{{members.avatar ? members.avatar : "../../images/avatar.png"}}' mode='aspectFill'></image>
|
||||
<image class='right-arrow' src='../../images/46@3x.png'></image>
|
||||
</view>
|
||||
</button>
|
||||
<!-- 如果没有修改次数了 -->
|
||||
<button wx:else class='cell avatar cell-btn' bindtap="onAvatarNoCount">
|
||||
<view class='title-box'>
|
||||
<text class='title'>头像</text>
|
||||
<text class='sub-title error-text'>本年修改次数已用完</text>
|
||||
</view>
|
||||
<view class='right-cell'>
|
||||
<image class='avatar-img' src='{{members.avatar ? members.avatar : "../../images/avatar.png"}}' mode='aspectFill'></image>
|
||||
<image class='right-arrow' src='../../images/46@3x.png'></image>
|
||||
|
||||
@@ -41,11 +41,27 @@
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.list .cell .title-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.list .cell .title {
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.list .cell .sub-title {
|
||||
font-size: 18rpx;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.list .cell .error-text {
|
||||
color: #ffda2e;
|
||||
}
|
||||
|
||||
.list .cell .right-cell {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
Reference in New Issue
Block a user