From ebf92f4fd0b2744e9540c132d53b03c0868684e2 Mon Sep 17 00:00:00 2001
From: zhaofang <752743406@qq.com>
Date: Thu, 22 Sep 2022 17:25:01 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=96=99=E7=BC=96=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/HomePage/homePage.vue | 45 +++-
src/components/UcHeader/Index.vue | 2 +-
src/icons/svg/passWard-edit.svg | 13 ++
src/views/homepage/leavingMessage.vue | 4 +-
src/views/user/Setting.vue | 299 ++++++++++++++++----------
5 files changed, 242 insertions(+), 121 deletions(-)
create mode 100644 src/icons/svg/passWard-edit.svg
diff --git a/src/components/HomePage/homePage.vue b/src/components/HomePage/homePage.vue
index 433d6d82..dbb0b27d 100644
--- a/src/components/HomePage/homePage.vue
+++ b/src/components/HomePage/homePage.vue
@@ -6,27 +6,27 @@
-->
-
![]()
+
-
{{userInfo.name}}
+ {{userData.data.name}}
-
LV.1
-
经验值:367
+
{{userData.level}}
+
经验值:{{userData.evalue}}
关注TA
已关注
去留言
-
你必须非常努力才能看起来毫不费力
+
{{userData.data.sign}}
@@ -67,6 +67,7 @@
import { mapGetters } from 'vuex'
import apiStart from '@/api/phase2/stat.js';
import apiFollow from "@/api/phase2/userfollow.js"
+ import apiUser from "@/api/system/user.js";
export default {
name: 'UcHeader',
computed:{
@@ -89,6 +90,20 @@
sex:'',
pageId:'',
isFollowHas:false,
+ userData:{
+ evalue: 0,
+ level: "",
+ data:{
+ aid: "",
+ avatar: "",
+ code: "",
+ name: "",
+ orgInfo: "",
+ sex: 2,
+ sign: "",
+ }
+
+ }
}
},
mounted() {
@@ -100,12 +115,28 @@
}
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
this.getInfo();
+ this.getLevel();
if(this.pageId !== this.userInfo.aid) {
this.followHas();
}
},
methods:{
- followHas() {
+ getLevel(){//获取经验值和等级
+ apiStart.getUserEValueAndLevel(this.pageId).then(res=>{
+ if(res.status == 200) {
+ this.userData.evalue = res.result.evalue;
+ this.userData.level = res.result.level;
+ }
+ });
+ apiUser.getByIds([this.pageId]).then(res => {
+ if (res.status == 200) {
+ this.userData.data = res.result[0];
+ } else {
+ this.$message.error(res.message);
+ }
+ });
+ },
+ followHas() {//他人主页,判断关注状态
apiFollow.has(this.pageId).then(res=>{
if(res.status == 200) {
this.isFollowHas = res.result;
diff --git a/src/components/UcHeader/Index.vue b/src/components/UcHeader/Index.vue
index 3e1bc21d..c0b6e183 100644
--- a/src/components/UcHeader/Index.vue
+++ b/src/components/UcHeader/Index.vue
@@ -179,7 +179,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
this.$store.dispatch('SetCurIdentity',iden);
},
jumrank(){
- this.$router.push({ path: '/user/ranking' });
+ this.$router.push('/user/ranking');
},
toPage(url){
diff --git a/src/icons/svg/passWard-edit.svg b/src/icons/svg/passWard-edit.svg
new file mode 100644
index 00000000..3dbe390d
--- /dev/null
+++ b/src/icons/svg/passWard-edit.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/views/homepage/leavingMessage.vue b/src/views/homepage/leavingMessage.vue
index ac9e9f56..35879ed1 100644
--- a/src/views/homepage/leavingMessage.vue
+++ b/src/views/homepage/leavingMessage.vue
@@ -146,6 +146,7 @@
apiGuestbook.answer(this.replysData).then(res=>{
if(res.status == 200) {
this.$message.success('留言发布成功');
+ // this.leavingList.push()
this.leavingList.forEach(item=>{
item.isReplys = false;
})
@@ -178,7 +179,8 @@
apiGuestbook.save(data).then(res=>{
if(res.status == 200) {
this.textarea = '';
- this.leavingList.push(res.result);
+ // this.leavingList.push(res.result);
+ this.getList();
this.$message.success('留言发布成功');
} else {
this.$message.error(res.message);
diff --git a/src/views/user/Setting.vue b/src/views/user/Setting.vue
index e8d20b77..c0f72532 100644
--- a/src/views/user/Setting.vue
+++ b/src/views/user/Setting.vue
@@ -1,65 +1,77 @@
-
-
+ 修改密码
+
+
+
+
+
+
-
+
+
+
兴趣爱好
+
+
+
+
{{sys.name}}
+
+
+ {{ch.name}}
+
+
+
+
+
+
+ 取消
+ 保存
+ 编辑
+
+
+
{
+ if(res.status == 200) {
+ this.$message.success('修改动态可见范围成功');
+ }
+ })
+ },
+ saveSign() {
+ userApi.updateSign(this.signData.sign).then(res=>{
+ if(res.status == 200){
+ this.$message.success('我的签名修改成功');
+ this.form.sign = this.signData.sign;
+ this.signData.isEdit = false;
+ }
+ })
+ },
getInfo() { //获取用户兴趣关联的id
- // apiUserhobby.info().then(res=>{
- // if(res.status == 200) {
- // let data = res.result.map(item => item.refId);
- // this.checkboxGroup = data;
- // }
- // })
+ this.checkboxGroup = [];
+ apiUserhobby.info(this.userInfo.aid).then(res=>{
+ if(res.status == 200) {
+ res.result.forEach(item=>{
+ this.checkboxGroup.push(item.refId);
+ item.name = this.sysTypeName(item.refId)
+ })
+ this.interestList = res.result;
+ }
+ })
+ },
+ sysTypeName(code){
+ if(code==''){return '';}
+ return this.sysTypeMap.get(code);
},
saveHobby(){
let data = []
@@ -234,13 +276,15 @@
refId:item
})
})
- // apiUserhobby.update(data).then(res=>{
- // if(res.status == 200) {
- // this.$message.success('更改成功!')
- // } else {
- // this.$message.error("更改失败!")
- // }
- // })
+ apiUserhobby.update(data).then(res=>{
+ if(res.status == 200) {
+ this.interestIsEdit = false;
+ this.getInfo();
+ this.$message.success('更改成功!')
+ } else {
+ this.$message.error("更改失败!")
+ }
+ })
},
...mapActions({
getResOwnerTree: 'resOwner/getResOwnerTree',
@@ -251,7 +295,11 @@
load(){
userApi.detail(this.userInfo.aid).then(res=>{
if(res.status==200){
- this.form=res.result
+ this.form=res.result;
+ this.signData.sign = res.result.sign;
+ if(res.result.dynamic == '') {
+ this.form.dynamic = 0;
+ }
}
});
},
@@ -332,40 +380,51 @@
border-radius: 4px;
box-shadow: none;
border-left: 1px solid rgba(151,151,151,0.3);
- box-shadow: 1px 0 0 0 #fff;
+ box-shadow: 1px 0 0 0 #fff;
}
.interest{
display: flex;
padding-left: 20px;
- .interest-index{
- flex: 84%;
+ .interest-ul{
display: flex;
- li{
+ flex-wrap: wrap;
+ .interest-li{
width: 146px;
height: 44px;
- background: #FFFFFF;
- border-radius: 4px;
- border: 1px solid rgba(151,151,151,0.3);
- margin-bottom: 20px;
+ text-align: center;
line-height: 44px;
+ font-size: 14px;
+ color: #333333;
+ border: 1px solid rgba($color: #979797, $alpha: 0.3);
+ border-radius: 4px;
+ margin-right: 44px;
+ margin-bottom: 22px;
}
-
}
-
- span{
- // width: 80px;
- // flex: 1;
+
+ .interest-title{
+ width: 70px;
margin-right: 17px;
color: #333333;
font-size: 14px;
margin-bottom: 20px;
}
- .el-checkbox-group{
- flex: 84%;
- .el-checkbox-button{
- margin-bottom: 20px;
- }
+ ::v-deep .el-checkbox__input{
+ display: none;
}
+ ::v-deep .el-checkbox{
+ width: 146px;
+ height: 44px;
+ margin-bottom: 22px;
+ text-align: center;
+ line-height: 26px;
+ margin-left: 0px;
+ margin-right: 48px;
+ }
+ ::v-deep .el-checkbox.is-bordered+.el-checkbox.is-bordered{
+ margin-left: 0px;
+ }
+
}
.dynamic-range{
span{
@@ -384,7 +443,21 @@
.personSetting{
background-color: #fff;
box-sizing: border-box;
- padding: 60px 0px 0px 205px;
+ padding: 30px 0px 0px 247px;
+ // margin: 0 auto;
+ position: relative;
+ .avatar{
+ position: absolute;
+ left: 86px;
+ top:56px;
+ }
+ .passWard-btn{
+ position: absolute;
+ font-size: 16px;
+ top:45px;
+ right:45px;
+ }
+
::v-deep .el-radio-button__inner{
background: #F4F4F4 !important;
border-radius: 4px !important;
@@ -396,34 +469,36 @@
box-shadow: -1px 0 0 0 #387DF7;
}
.informationItem{
- // &:first-of-type{
- // margin-top: 10px;
- // }
+ margin-bottom: 82px;
.information-header{
// display: flex;
// justify-content: space-between;
// align-items: center;
// padding: 10px 0;
- margin-bottom: 22px;
+ margin-bottom: 35px;
}
- ::v-deep .el-form-item{
- font-size: 12px;
- .el-form-item__label{
- color: #333333;
- font-weight: 400;
+ .base-info{
+ margin: 0;
+ display: flex;
+ margin-bottom: 46px;
+ // flex-direction: row;
+ // flex-wrap: nowrap;
+ li{
+ width: 260px;
+ // flex-grow: 2;
}
- .el-form-item__content{
- .el-input__inner{
- background: #ffffff;
- width: 336px;
- height: 34px;
- cursor: text;
- color:#343434;
- border-radius:6px;
- }
- .el-input__suffix{
- display: none;
- }
+ .label{
+ display: inline-block;
+ font-size: 16px;
+ font-weight: 400;
+ color: #333333;
+ width: 64px;
+ margin-right: 20px;
+ text-align: right;
+ }
+ .info-text{
+ font-size: 14px;
+ color: #999999;
}
}
}