修改页面

This commit is contained in:
2025-08-11 14:06:42 +08:00
parent 462073058e
commit 9c0be00fbd
31 changed files with 1180 additions and 309 deletions

View File

@ -80,7 +80,7 @@
<view class="nr bold-600">服务功能</view>
<view>
<u-grid :col="4" :border="false">
<u-grid-item v-for="(item, index) in menuList[1]['content']['data']" :key="index" @click="tapMenu(item.link.path)">
<u-grid-item v-for="(item, index) in menuList" :key="index" @click="tapMenu(item.link)">
<u-image :src="item.image" width="64" height="64"></u-image>
<view class="grid-text mt10">{{item.name}}</view>
</u-grid-item>
@ -127,9 +127,7 @@
type: 2
})
if (code == 1) {
this.menuList = data
console.log("this.menuList>>>", this.menuList);
return false;
this.menuList = data[1].content.data
}
},
@ -137,7 +135,7 @@
tapMenu(path) {
if (!this.isLogin) return toLogin()
uni.navigateTo({
url: path
url: path.path
})
// menuJump(item)
},

View File

@ -2,7 +2,8 @@
<view>
<view class="u-m-t-34" @tap="chooseAvatar">
<view class="row-center">
<u-avatar :src="userInfo.avatar ? userInfo.avatar : cloudPath + 'img/icon_avatar_empty2.png'" size="142"></u-avatar>
<u-avatar v-if="userInfo.avatar" :src="userInfo.avatar" size="142"></u-avatar>
<u-icon v-if="!userInfo.avatar" name="account-fill" size="142"></u-icon>
</view>
<view class="nr text-default u-text-center u-m-t-16">
点击更换头像
@ -20,7 +21,7 @@
</view>
</view>
<view class="nr row-between u-col-center u-m-t-48" @tap="changeMobile">
<!-- <view class="nr row-between u-col-center u-m-t-48" @tap="changeMobile">
<view style="width: 100rpx;">手机号</view>
<view class="flex1 u-m-l-80 row u-row-between u-col-center">
<view>{{formatPhone(userInfo.mobile)}}</view>
@ -28,7 +29,7 @@
<u-image :src="cloudPath + 'img/icon_arrow_right.png'" width="44" height="44"></u-image>
</view>
</view>
</view>
</view> -->
</view>
<view class="fixed left-0 right-0 save">
@ -56,6 +57,7 @@
</view>
</u-popup>
<mplogin v-model="mp.showPopup" :info-type="mp.type" @close="mp.showPopup = false" @update="handleSubmitInfo"/>
<mobile-login v-model="mobile.showPopup" @close="mobile.showPopup = false" :hideCancleBtn="false" @update="updateMobile"/>
</view>
</template>
@ -82,6 +84,10 @@
},
mobile: {
showPopup: false,
},
mp: {
showPopup: false,
type: ''
}
}
},
@ -94,32 +100,42 @@
uni.$on('uAvatarCropper', (path) => {
this.uploadImage(path)
})
console.log("🚀 ~ onLoad ~ userInfo:", this.userInfo)
},
methods: {
// 修改头像
chooseAvatar() {
this.fieldType = FieldType.AVATAR
uni.$u.route({
// 关于此路径,请见下方"注意事项"
url: '/components/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
// 内部已设置以下默认参数值,可不传这些参数
params: {
// 输出图片宽度高等于宽单位px
destWidth: 300,
// 裁剪框宽度高等于宽单位px
rectWidth: 300,
// 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
fileType: 'jpg'
}
})
// uni.$u.route({
// // 关于此路径,请见下方"注意事项"
// url: '/components/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
// // 内部已设置以下默认参数值,可不传这些参数
// params: {
// // 输出图片宽度高等于宽单位px
// destWidth: 300,
// // 裁剪框宽度高等于宽单位px
// rectWidth: 300,
// // 输出的图片类型,如果'png'类型发现裁剪的图片太大,改成"jpg"即可
// fileType: 'jpg'
// }
// })
// 选择头像
this.mp.showPopup = true
this.mp.type = 'avatar'
},
// 修改昵称
changeName() {
this.fieldType = FieldType.NICKNAME
this.nickname.value = ''
this.nickname.showPopup = true
// this.nickname.value = ''
// this.nickname.showPopup = true
// 选择昵称
this.mp.showPopup = true
this.mp.type = 'nickname'
},
// 确认修改昵称
@ -196,15 +212,22 @@
if (p) {
return p.substring(0, 3) + '****' + p.substring(7)
}
return ''
},
handleSubmitInfo(e) {
if (this.mp.type === 'avatar') {
this.setUserInfo(e.avatar)
} else if (this.mp.type === 'nickname') {
this.setUserInfo(e.nickname)
}
},
save() {
uni.switchTab({
url: '/pages/my/my'
})
}
},
},
computed: {
...mapState(['token']),