修改页面
This commit is contained in:
@ -4,11 +4,12 @@
|
||||
:maskCloseAble="false">
|
||||
<view class="popup-content">
|
||||
<view class="u-font-xl bold-600">
|
||||
获取您的昵称和头像
|
||||
<!-- 获取您的昵称和头像 -->
|
||||
获取您的信息
|
||||
</view>
|
||||
<view class="popup-form">
|
||||
<form @submit="handleSubmit">
|
||||
<view class="u-flex u-row-between avatar u-m-t-80">
|
||||
<view class="u-flex u-row-between avatar u-m-t-80" v-if="infoType === 'all' || infoType === 'avatar'">
|
||||
<text>头像</text>
|
||||
<view class="u-flex u-row-between flex1 u-m-l-30">
|
||||
<button style="border: none;" class="u-flex u-row-between w-full" hover-class="none"
|
||||
@ -19,7 +20,7 @@
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between avatar u-m-t-60">
|
||||
<view class="u-flex u-row-between avatar u-m-t-60" v-if="infoType === 'all' || infoType === 'nickname'">
|
||||
<text>昵称</text>
|
||||
<view class="u-flex u-row-between flex1 u-m-l-30">
|
||||
<input
|
||||
@ -55,6 +56,10 @@
|
||||
value: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
infoType: {
|
||||
type: String,
|
||||
default: 'all'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -66,6 +71,8 @@
|
||||
methods: {
|
||||
// 头像选择
|
||||
onChooseAvatar(e) {
|
||||
console.log("🚀 ~ onChooseAvatar ~ e:", e)
|
||||
|
||||
const avatarUrl = e.detail.avatarUrl;
|
||||
if (!avatarUrl) {
|
||||
return;
|
||||
@ -78,6 +85,8 @@
|
||||
uploadFile(avatarUrl).then((res) => {
|
||||
uni.hideLoading();
|
||||
this.avatar = res.url;
|
||||
console.log("🚀 ~ onChooseAvatar ~ this.avatar:", this.avatar)
|
||||
|
||||
}).catch(() => {
|
||||
uni.hideLoading();
|
||||
this.$toast({title: "上传失败"});
|
||||
@ -88,13 +97,13 @@
|
||||
handleSubmit(e) {
|
||||
const {nickname} = e.detail.value
|
||||
const {avatar} = this
|
||||
if (!avatar) return this.$toast({
|
||||
title: '请添加头像'
|
||||
})
|
||||
// if (!avatar) return this.$toast({
|
||||
// title: '请添加头像'
|
||||
// })
|
||||
|
||||
if (!nickname) return this.$toast({
|
||||
title: '请输入昵称'
|
||||
})
|
||||
// if (!nickname) return this.$toast({
|
||||
// title: '请输入昵称'
|
||||
// })
|
||||
|
||||
this.$emit('update', {
|
||||
avatar,
|
||||
|
||||
Reference in New Issue
Block a user