-
-
{{ item.name }}
-
{{ item.content }}
+
+
个人信息
+
+
+
+
diff --git a/src/views/home/components/Status.vue b/src/views/home/components/Status.vue
index 863458d..db53eda 100644
--- a/src/views/home/components/Status.vue
+++ b/src/views/home/components/Status.vue
@@ -3,17 +3,15 @@ import add from '@/assets/images/add.png'
// import { Plus } from '@element-plus/icons-vue'
import tool from '@/utils/oss.js'
import { userChangeService } from '@/api/user/user.js'
-const dialogFormVisible = ref(false)
-import { ref } from 'vue'
+import { ref, defineEmits } from 'vue'
+import { ElMessage } from 'element-plus'
const props = defineProps({
data: {
type: Object,
},
})
-// const data = ref(props.data, 'dsfd')
const imageUrl = ref('')
-//盒子隐藏
-const form = ref()
+const dialogFormVisible = ref(false)
//表单校验
// const rules = {
// username: [
@@ -37,7 +35,13 @@ const form = ref()
// ],
// code: [{ message: '验证码不能为空', trigger: 'blur' }],
// }
-form.value = props.data
+const form = ref()
+// {
+// username: '',
+// nickName: '',
+// phone: '',
+// }
+form.value = { ...props.data }
const formLabelWidth = '70px'
//设置头像显示
imageUrl.value = props.data.icon
@@ -48,7 +52,11 @@ const upload = async (option) => {
imageUrl.value = url
changeInfo()
}
+const openInfo = () => {
+ dialogFormVisible.value = true
+}
//修改用户信息
+const emit = defineEmits(['get-message'])
const changeInfo = async () => {
const userInfo = {
phone: form.value.phone,
@@ -57,8 +65,18 @@ const changeInfo = async () => {
icon: imageUrl.value,
}
const jsonData = JSON.stringify(userInfo)
- await userChangeService(jsonData)
+ await userChangeService(jsonData).then(() => {
+ ElMessage.success('修改成功')
+ console.log(form.value.nickName, 'nickN')
+ emit('get-message', form.value.nickName)
+ })
+ dialogFormVisible.value = false
+}
+const cancleInfo = () => {
dialogFormVisible.value = false
+ form.value = {
+ ...props.data,
+ }
}
@@ -70,11 +88,7 @@ const changeInfo = async () => {
-
+
{{ props.data.username }}
@@ -86,7 +100,7 @@ const changeInfo = async () => {
>
-
+
@@ -97,7 +111,7 @@ const changeInfo = async () => {
diff --git a/src/views/home/components/Welcome.vue b/src/views/home/components/Welcome.vue
index 0404e8b..d984815 100644
--- a/src/views/home/components/Welcome.vue
+++ b/src/views/home/components/Welcome.vue
@@ -1,17 +1,32 @@
+
+
diff --git a/src/views/home/components/myDrawer/index.vue b/src/views/home/components/myDrawer/index.vue
new file mode 100644
index 0000000..4f8cae9
--- /dev/null
+++ b/src/views/home/components/myDrawer/index.vue
@@ -0,0 +1,120 @@
+
+
+
+ 个人信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {}" size="medium">取消
+ {}">确认
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 2833a93..59116ea 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -19,7 +19,13 @@ const rightVisible = ref(false)
userStore.getUserInfo().catch((error) => {
console.log(error)
})
+
let sum: any = localStorage.getItem('sum') || '0'
+const name = ref()
+const getMessage = (msg) => {
+ name.value = msg
+ console.log(msg, 'msg')
+}
onMounted(() => {
// getData()
sum = parseInt(sum) + 1
@@ -44,7 +50,12 @@ onMounted(() => {
-
+
@@ -54,7 +65,7 @@ onMounted(() => {