美化了样式
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
// pages/personCenter/mine/mine.js
|
||||
const { baseUrl } = require("../../../request");
|
||||
const { globalImgUrl } = require("../../../request")
|
||||
const { notLogin } = require('../../../utils/util')
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
@ -20,7 +22,8 @@ Page({
|
||||
userRole: "",
|
||||
title: '查看绩效',
|
||||
id: 0,
|
||||
globalImgUrl
|
||||
globalImgUrl,
|
||||
showNicknamePopup: false
|
||||
},
|
||||
// 跳转课程订单页面
|
||||
courseOrder() {
|
||||
@ -170,10 +173,7 @@ Page({
|
||||
qrcode: globalImgUrl + result.inviteQrCode
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '获取个人信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
@ -297,6 +297,41 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
openNicknamePopup() {
|
||||
this.setData({ showNicknamePopup: true });
|
||||
},
|
||||
closeNicknamePopup() {
|
||||
this.setData({ showNicknamePopup: false });
|
||||
},
|
||||
updateNickname(e) {
|
||||
const { nickname } = e.detail;
|
||||
const token = wx.getStorageSync('token');
|
||||
wx.request({
|
||||
url: baseUrl + '/userInfo/modify/nickname',
|
||||
method: 'POST',
|
||||
header: {
|
||||
Authorization: token
|
||||
},
|
||||
data: { templateString: nickname },
|
||||
success: res => {
|
||||
if (res.data.code === 1) {
|
||||
wx.showToast({ title: '修改成功', icon: 'success' });
|
||||
this.setData({
|
||||
nickName: nickname,
|
||||
showNicknamePopup: false
|
||||
});
|
||||
} else {
|
||||
wx.showToast({ title: res.data.message || '修改失败', icon: 'none' });
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({ title: '网络错误', icon: 'none' });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"InvitationCodePop": "/pages/personCenter/component/InvitationCodePop/InvitationCodePop"
|
||||
"InvitationCodePop": "/pages/personCenter/component/InvitationCodePop/InvitationCodePop",
|
||||
"EditNicknamePopup": "/pages/personCenter/component/modifyNamePop/modifyNamePop"
|
||||
}
|
||||
}
|
||||
|
@ -219,8 +219,11 @@
|
||||
mode="aspectFill"
|
||||
/>
|
||||
</button>
|
||||
<view class="flex-col ml-6">
|
||||
<text class="self-start font text">{{ nickName }}</text>
|
||||
<view class="flex-col ml-6">
|
||||
<view class="flex-row items-center justify-between" style="width: 250rpx;">
|
||||
<text class="self-start font text nickname-wrap">{{ nickName }}</text>
|
||||
<text class="self-start font text_2 ml-16" bindtap="openNicknamePopup">修改</text>
|
||||
</view>
|
||||
<view class="flex-row items-center self-stretch group_2 mt-9" bindtap="gotoCall">
|
||||
<image
|
||||
class="image_3"
|
||||
@ -318,4 +321,11 @@
|
||||
</view>
|
||||
|
||||
<!-- 调用弹窗组件 -->
|
||||
<InvitationCodePop show="{{showPopup}}" bind:close="closePopup" qrcode="{{qrcode}}"/>
|
||||
<InvitationCodePop show="{{showPopup}}" bind:close="closePopup" qrcode="{{qrcode}}"/>
|
||||
|
||||
<EditNicknamePopup
|
||||
show="{{showNicknamePopup}}"
|
||||
nickname="{{nickName}}"
|
||||
bind:cancel="closeNicknamePopup"
|
||||
bind:confirm="updateNickname"
|
||||
/>
|
||||
|
@ -64,9 +64,10 @@ button {
|
||||
}
|
||||
.text_2 {
|
||||
color: #808080;
|
||||
line-height: 17.08rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.section_2 {
|
||||
width: 230rpx;
|
||||
padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx;
|
||||
background-color: #fff6de;
|
||||
border-radius: 31.26rpx;
|
||||
@ -136,7 +137,7 @@ button {
|
||||
width: 224.59rpx;
|
||||
}
|
||||
.list {
|
||||
padding-top: 39.38rpx;
|
||||
padding-top: 19.38rpx;
|
||||
}
|
||||
.section_4 {
|
||||
padding: 31.88rpx 31.88rpx 30rpx 33.75rpx;
|
||||
@ -157,4 +158,11 @@ button {
|
||||
}
|
||||
.text_8 {
|
||||
line-height: 23.81rpx;
|
||||
}
|
||||
.nickname-wrap {
|
||||
display: block; /* 让它单独占一行 */
|
||||
max-width: 250rpx; /* 不超过容器宽度 */
|
||||
white-space: normal; /* 允许正常换行 */
|
||||
word-break: break-all; /* 长字符串也能断行 */
|
||||
line-height: 1.4;
|
||||
}
|
Reference in New Issue
Block a user