This commit is contained in:
wangshiming
2021-12-13 20:42:59 +08:00
parent a77b5f8c01
commit 44a391667e
17 changed files with 1257 additions and 260 deletions

View File

@ -76,12 +76,10 @@
</div>
<div nz-col [nzSpan]="10">{{ infoData.phone }}</div>
<div nz-col [nzSpan]="10">
<span *ngIf="infoData.phone; else elsePhone"
><i nz-icon [nzType]="'check-circle'" [nzTheme]="'fill'" style="color: #52c41a"></i> 已绑定</span
>
<ng-template #elsePhone
><i nz-icon [nzType]="'question-circle'" [nzTheme]="'fill'" style="color: #ccc"></i> 未绑定</ng-template
>
<span *ngIf="infoData.phone; else elsePhone"><i nz-icon [nzType]="'check-circle'" [nzTheme]="'fill'"
style="color: #52c41a"></i> 已绑定</span>
<ng-template #elsePhone><i nz-icon [nzType]="'question-circle'" [nzTheme]="'fill'"
style="color: #ccc"></i> 未绑定</ng-template>
</div>
</div>
</nz-list-item-meta-title>
@ -110,22 +108,6 @@
<div class="item-btn"><a (click)="edit('password')">修改</a></div>
</nz-list-item>
</nz-list>
<!-- <div class="info">
<nz-card style="width: 100%; margin-top: 16px" [nzBordered]="false">
<nz-card-meta [nzAvatar]="avatarTemplate" [nzTitle]="infoData.nickName" [nzDescription]="content"></nz-card-meta>
<ng-template #avatarTemplate>
<nz-avatar
style="width: 80px; height: 80px; border: 1px solid #979797; border-radius: 100%"
[nzSrc]="infoData.avatar"
></nz-avatar>
</ng-template>
<ng-template #content>
<div>用户名:{{ infoData.name }} | 手机号:{{ infoData.phone }}</div>
<div>性别:{{ infoData.sexName }} | 生日:{{ infoData.birthday }}</div>
<div>真实姓名:{{ infoData.realName }} | 身份证号码:{{ infoData.certificateNumber }}</div>
</ng-template>
</nz-card>
<a (click)="edit('info')" class="info-btn">修改</a>
</div> -->
</nz-card>
</div>

View File

@ -134,23 +134,21 @@ export class AccountComponentsCenterComponent implements OnInit {
};
}
getInfo() {
const params = {
// id: this.i.id,
};
// this.service.http.post(this.service.$api_getUserInfo, params).subscribe((res) => {
// this.infoData = res.data;
// this.infoData.avatar = [
// {
// uid: -1,
// name: 'LOGO',
// status: 'done',
// url: res.data.avatar,
// response: {
// url: res.data.avatar,
// },
// },
// ];
// });
this.service.http.post(this.service.$api_get_current_user_info).subscribe((res) => {
console.log(res)
this.infoData = res.data;
// this.infoData.avatar = [
// {
// uid: -1,
// name: 'LOGO',
// status: 'done',
// url: res.data.avatar,
// response: {
// url: res.data.avatar,
// },
// },
// ];
});
}
edit(tpye: string) {
@ -200,7 +198,7 @@ export class AccountComponentsCenterComponent implements OnInit {
formSubmit(value: any): void {
const params = { ...value };
this.service.request(`${this.service.$api_updateUserInfo}`, params).subscribe((res) => {
this.service.request(`${this.service.$api_get_current_user_info}`, params).subscribe((res) => {
if (res === true) {
this.service.msgSrv.success('保存成功');
this.getInfo();