user
This commit is contained in:
72
pages/account/index.vue
Normal file
72
pages/account/index.vue
Normal file
@@ -0,0 +1,72 @@
|
||||
<template lang="pug">
|
||||
.account
|
||||
.main-width
|
||||
img.avatar(:src="account.avatar")
|
||||
span.name {{ account.name }}
|
||||
//input.upload(type="file", name="photos", multiple, @change="setAvatar()")
|
||||
.banner_item.add
|
||||
label.img_add(for="img_add") +
|
||||
input#img_add(
|
||||
type="file",
|
||||
accept="image/*",
|
||||
multiple="multiple",
|
||||
@change="upload($event)"
|
||||
)
|
||||
p account
|
||||
NuxtLink.button(to="/account/setting") 账户设置
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
computed: {
|
||||
account() {
|
||||
return this.$store.state.account;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
upload(event) {
|
||||
let data = new FormData();
|
||||
data.append("img", event.target.files[0]);
|
||||
this.$axios
|
||||
.post("/api/account", data, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res.data);
|
||||
//res.data.forEach((item) => this.list.push(item));
|
||||
});
|
||||
},
|
||||
//setAvatar() {
|
||||
// let myForm = new FormData();
|
||||
// let files = document.querySelector("[type=file]").files;
|
||||
// for (var i = 0; i < files.length; i++) {
|
||||
// myForm.append("photos", files[i]);
|
||||
// }
|
||||
// //this.$axios.post("/api/account", myForm).then((res) => {
|
||||
// // console.log(res.data);
|
||||
// //});
|
||||
// console.log(myForm);
|
||||
// fetch("/api/account", {
|
||||
// method: "POST",
|
||||
// //headers: { "Content-Type": "multipart/form-data" },
|
||||
// body: myForm,
|
||||
// })
|
||||
// .then((Response) => Response.json())
|
||||
// .then((data) => {
|
||||
// console.log(data);
|
||||
// });
|
||||
//},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.account
|
||||
.avatar
|
||||
height: 64px
|
||||
width: 64px
|
||||
border: none
|
||||
border-radius: 50%
|
||||
background: #ff1414
|
||||
overflow: hidden
|
||||
</style>
|
4
pages/account/message.vue
Normal file
4
pages/account/message.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<template lang="pug">
|
||||
.account-message
|
||||
p 消息盒子
|
||||
</template>
|
8
pages/account/setting.vue
Normal file
8
pages/account/setting.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<template lang="pug">
|
||||
.account-setting
|
||||
p setting
|
||||
p 1. 消息设置
|
||||
p 2. 订阅设置
|
||||
p 3. 通信设置
|
||||
p 4. 数据管理
|
||||
</template>
|
Reference in New Issue
Block a user