myInfo.vue 2.84 KB
<template>
	<view class="fixedbody">
		<uni-forms ref="baseForm" :modelValue="form" :rules="rules" label-width="80">
			<uni-group mode="card" title="个人信息" top="20">
				<view class="wBox">
<!-- 						<uni-forms-item label="照片" required name="picUrl">
							<view class="avatarUrl">
								<button type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
									<image mode="aspectFill" :src="baseFormData.picUrl" class="refreshIcon"></image>
								</button>
							</view>
						</uni-forms-item> -->
						<uni-forms-item label="姓名"  name="realName">
							<uni-easyinput  v-model="form.nickName" :clearable="false" placeholder="请输入姓名" />
						</uni-forms-item>
				
						<uni-forms-item label="手机号码" name="phone">
							<uni-easyinput v-model="form.phonenumber" :clearable="false" placeholder="请输入联系方式" />
						</uni-forms-item>
											
				</view>
			</uni-group>
		</uni-forms>
		<view class="fixedBottom"><button class="btn btn1" @click="save">保存</button></view>
	</view>
</template>

<script setup>
import { ref } from 'vue';
import { onLoad ,onShow,onPullDownRefresh} from '@dcloudio/uni-app'
import * as api from '@/common/api.js';
import * as loginServer from '@/common/login.js';
const imageStyles=ref({
				width:'500rpx',
				height:'300rpx',
				border:{radius:'2px'}
				});
const countryList = ref([]);
const regionsList = ref([]);
const groupList = ref([]);
const form = ref({});
const current = ref(0);
onLoad(()=>{
	
})
onShow(()=>{
	getData()
})
onPullDownRefresh(() => {
	getData()
})


function getData(){
	form.value = uni.getStorageSync('currUser')
}
function save() {
	api.updateUserInfo(form.value).then(res=>{
		uni.showToast({
			title:`保存成功`
		})
		loginServer.getCurrUser()
	})
}



</script>

<style scope lang="scss">
.wBox {    position: relative;
	background: #ffffff;
	border-radius: 15px;
	box-sizing: border-box;
}
 :deep(.fixedbody .uni-group.uni-group--card){overflow:visible;}
 :deep(.uni-tag){
 	padding: 4rpx 6rpx!important;font-size: 20rpx!important;
 }
.avatarUrl{width: 200rpx;height:200rpx;}
.avatarUrl button{padding: 0;display: block;line-height: 1;}
.refreshIcon{width: 200rpx;height:200rpx;}
.matchItem{background: #FBFCFD; margin: 30rpx 0 90rpx;padding:20rpx;border: #eee solid 1rpx;
	.bottomFunc{background: #FBFCFD;border: #eee solid 1rpx;}
}
.poKxBtn{position: absolute;    top: -100rpx;
    right: 0;
    font-size: 24rpx;
    line-height: 2;
}
.pp{display: flex;
	.uni-data-tree{font-size: 24rpx;
		.selected-list{padding: 0;}
		.input-value{line-height:normal;padding: 0;}
	}
}
.ttt{color: #2B3133;font-size: 30rpx;margin: 0 0 10rpx;
	text{font-size: 24rpx;color: #DC0032;margin-left:10rpx;}
}
.idImgUrl{width: 500rpx;height: 300rpx;margin:20rpx auto 40rpx;
	 button {padding: 0;display: block;line-height: 1;}
	.idImg{width: 500rpx;height: 300rpx;}
}
</style>