@rolatech/angular-account 17.2.4 → 17.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/avatar-update-dialog/avatar-update-dialog.component.mjs +3 -3
- package/esm2022/lib/components/forgot-password/forgot-password.component.mjs +3 -3
- package/esm2022/lib/components/login/login-wechat/login-wechat.component.mjs +4 -8
- package/esm2022/lib/components/logout/logout.component.mjs +3 -3
- package/esm2022/lib/components/passwordreset/passwordreset.component.mjs +3 -3
- package/esm2022/lib/components/topbar-login/topbar-login.component.mjs +3 -3
- package/esm2022/lib/components/user-item/user-item.component.mjs +7 -5
- package/esm2022/lib/pages/accounts/signin/signin.component.mjs +21 -9
- package/esm2022/lib/pages/accounts/signup/signup.component.mjs +5 -5
- package/esm2022/lib/pages/myaccount/email/email.component.mjs +14 -14
- package/esm2022/lib/pages/myaccount/email-verification/email-verification.component.mjs +3 -3
- package/esm2022/lib/pages/myaccount/gender/gender.component.mjs +15 -16
- package/esm2022/lib/pages/myaccount/home/home.component.mjs +42 -84
- package/esm2022/lib/pages/myaccount/personal-info/info.component.mjs +10 -17
- package/esm2022/lib/pages/myaccount/personal-info/profile/profile.component.mjs +22 -16
- package/esm2022/lib/pages/myaccount/personal-info/username/username.component.mjs +12 -14
- package/esm2022/lib/pages/myaccount/phone/phone.component.mjs +19 -24
- package/esm2022/lib/pages/myaccount/security/security-faceid/security-faceid.component.mjs +3 -3
- package/esm2022/lib/pages/myaccount/security/security-index/security-index.component.mjs +3 -3
- package/esm2022/lib/pages/myaccount/security/security-password/security-password.component.mjs +8 -11
- package/esm2022/lib/pages/myaccount/security/security-verification/security-verification.component.mjs +6 -6
- package/esm2022/lib/services/wechat-login.service.mjs +9 -6
- package/fesm2022/{rolatech-angular-account-email-verification.component-D9e--XMc.mjs → rolatech-angular-account-email-verification.component-Wgkfs9Lk.mjs} +4 -4
- package/fesm2022/{rolatech-angular-account-email-verification.component-D9e--XMc.mjs.map → rolatech-angular-account-email-verification.component-Wgkfs9Lk.mjs.map} +1 -1
- package/fesm2022/{rolatech-angular-account-email.component-DC8qYVOJ.mjs → rolatech-angular-account-email.component-OZQWgvRq.mjs} +14 -14
- package/fesm2022/rolatech-angular-account-email.component-OZQWgvRq.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-account-gender.component-DWdWJiQW.mjs → rolatech-angular-account-gender.component-et-tBTIn.mjs} +15 -16
- package/fesm2022/rolatech-angular-account-gender.component-et-tBTIn.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account-home.component-CLpbrgbY.mjs +77 -0
- package/fesm2022/rolatech-angular-account-home.component-CLpbrgbY.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account-info.component-BylW4MU8.mjs +98 -0
- package/fesm2022/rolatech-angular-account-info.component-BylW4MU8.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-account-login.routes-DjxoOzuE.mjs → rolatech-angular-account-login.routes-Ck2VnoP1.mjs} +6 -10
- package/fesm2022/rolatech-angular-account-login.routes-Ck2VnoP1.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account-phone.component-Y1-PQ88s.mjs +68 -0
- package/fesm2022/rolatech-angular-account-phone.component-Y1-PQ88s.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account-profile.component-qPo6AqKP.mjs +50 -0
- package/fesm2022/rolatech-angular-account-profile.component-qPo6AqKP.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account-rolatech-angular-account-OPsV8YM0.mjs +444 -0
- package/fesm2022/rolatech-angular-account-rolatech-angular-account-OPsV8YM0.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-account-security.routes-Dag8RZ38.mjs → rolatech-angular-account-security.routes-oSrz_UlJ.mjs} +14 -15
- package/fesm2022/rolatech-angular-account-security.routes-oSrz_UlJ.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-account-username.component-BL2F5fnx.mjs → rolatech-angular-account-username.component-aqWzvFh7.mjs} +12 -14
- package/fesm2022/rolatech-angular-account-username.component-aqWzvFh7.mjs.map +1 -0
- package/fesm2022/rolatech-angular-account.mjs +2 -2
- package/lib/pages/myaccount/email/email.component.d.ts +5 -4
- package/lib/pages/myaccount/gender/gender.component.d.ts +4 -1
- package/lib/pages/myaccount/home/home.component.d.ts +8 -15
- package/lib/pages/myaccount/personal-info/info.component.d.ts +2 -4
- package/lib/pages/myaccount/personal-info/profile/profile.component.d.ts +2 -2
- package/lib/pages/myaccount/personal-info/username/username.component.d.ts +2 -2
- package/lib/pages/myaccount/phone/phone.component.d.ts +2 -2
- package/lib/pages/myaccount/security/security-verification/security-verification.component.d.ts +1 -1
- package/lib/services/wechat-login.service.d.ts +3 -1
- package/package.json +5 -5
- package/themes/_default.scss +1 -1
- package/fesm2022/rolatech-angular-account-email.component-DC8qYVOJ.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-gender.component-DWdWJiQW.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-home.component-B28zyXQ7.mjs +0 -117
- package/fesm2022/rolatech-angular-account-home.component-B28zyXQ7.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-info.component-DNi4eTxV.mjs +0 -105
- package/fesm2022/rolatech-angular-account-info.component-DNi4eTxV.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-login.routes-DjxoOzuE.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-phone.component-r9dWPfEL.mjs +0 -73
- package/fesm2022/rolatech-angular-account-phone.component-r9dWPfEL.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-profile.component-CJfmQ3Ba.mjs +0 -44
- package/fesm2022/rolatech-angular-account-profile.component-CJfmQ3Ba.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-rolatech-angular-account-P3NArisC.mjs +0 -429
- package/fesm2022/rolatech-angular-account-rolatech-angular-account-P3NArisC.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-security.routes-Dag8RZ38.mjs.map +0 -1
- package/fesm2022/rolatech-angular-account-username.component-BL2F5fnx.mjs.map +0 -1
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, effect, Component } from '@angular/core';
|
|
3
|
-
import { AuthUserService } from '@rolatech/angular-auth';
|
|
4
|
-
import { BaseComponent, AngularComponentsModule, TabsComponent, TabComponent, ToolbarComponent, SpinnerComponent } from '@rolatech/angular-components';
|
|
5
|
-
import { AngularCommonModule } from '@rolatech/angular-common';
|
|
6
|
-
import { U as UserItemComponent } from './rolatech-angular-account-rolatech-angular-account-P3NArisC.mjs';
|
|
7
|
-
import { map } from 'lodash';
|
|
8
|
-
import * as i1 from '@angular/common';
|
|
9
|
-
import * as i1$1 from '@angular/router';
|
|
10
|
-
import '@angular/material/snack-bar';
|
|
11
|
-
import '@angular/forms';
|
|
12
|
-
import '@angular/platform-browser';
|
|
13
|
-
import '@angular/material/form-field';
|
|
14
|
-
import '@angular/material/input';
|
|
15
|
-
import '@angular/material/button';
|
|
16
|
-
|
|
17
|
-
class HomeComponent extends BaseComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
this.authUserService = inject(AuthUserService);
|
|
21
|
-
this.users = [];
|
|
22
|
-
this.selectIndex = signal(0);
|
|
23
|
-
effect(() => {
|
|
24
|
-
const index = this.selectIndex();
|
|
25
|
-
if (index === 0) {
|
|
26
|
-
this.listFollowingByUsername();
|
|
27
|
-
}
|
|
28
|
-
if (index === 1) {
|
|
29
|
-
this.listFollowersByUsername();
|
|
30
|
-
}
|
|
31
|
-
if (index === 2) {
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
ngOnInit() {
|
|
36
|
-
this.user$ = this.authUserService.me();
|
|
37
|
-
}
|
|
38
|
-
friendships(ids) {
|
|
39
|
-
//user-ew57mn7wqzs4
|
|
40
|
-
// user-lnerfootihvy
|
|
41
|
-
// ['20672315197100032', '15679392466472960', '156793924664'];
|
|
42
|
-
this.authUserService.friendships(ids).subscribe({
|
|
43
|
-
next: (res) => {
|
|
44
|
-
this.format(res.data);
|
|
45
|
-
this.friendshipsData = res.data;
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
stats() {
|
|
50
|
-
this.authUserService.followersStats('pinxiaoke').subscribe({
|
|
51
|
-
next: (res) => {
|
|
52
|
-
console.log(res);
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
follow(user) {
|
|
57
|
-
//user-ew57mn7wqzs4
|
|
58
|
-
// user-lnerfootihvy
|
|
59
|
-
this.authUserService.follow(user.username).subscribe({
|
|
60
|
-
next: (res) => {
|
|
61
|
-
console.log(res);
|
|
62
|
-
user.isFollowing = true;
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
unfollow(user) {
|
|
67
|
-
this.authUserService.unfollow(user.username).subscribe({
|
|
68
|
-
next: (res) => {
|
|
69
|
-
user.isFollowing = false;
|
|
70
|
-
console.log(res);
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
listFollowingByUsername() {
|
|
75
|
-
this.authUserService.listFollowingByUsername('pinxiaoke').subscribe({
|
|
76
|
-
next: (res) => {
|
|
77
|
-
this.users = map(res.data, 'user');
|
|
78
|
-
const ids = map(res.data, 'user.id');
|
|
79
|
-
this.friendships(ids);
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
listFollowersByUsername() {
|
|
84
|
-
this.authUserService.listFollowersByUsername('pinxiaoke').subscribe({
|
|
85
|
-
next: (res) => {
|
|
86
|
-
this.users = map(res.data, 'follower');
|
|
87
|
-
const ids = map(res.data, 'follower.id');
|
|
88
|
-
this.friendships(ids);
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
format(friendships) {
|
|
93
|
-
this.users.map((item) => {
|
|
94
|
-
item.isFollowing = friendships[item.id].following;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
onClick(event) {
|
|
98
|
-
console.log(event);
|
|
99
|
-
}
|
|
100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: HomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: HomeComponent, isStandalone: true, selector: "rolatech-account-home", usesInheritance: true, ngImport: i0, template: "@if (user$ | async; as user) {\n <div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <!-- <rolatech-spinner></rolatech-spinner> -->\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <div class=\"p-3 mb-3\">\n <div class=\"w-20 h-20 rounded-full bg-orange-600\">\n @if (user.avatar) {\n <img class=\"w-20 h-20 rounded-full object-cover\" [src]=\"user.avatar\" />\n }\n </div>\n </div>\n <p class=\"text-3xl\">\u6B22\u8FCE\u56DE\u6765, {{ user.name }}</p>\n <p class=\"text-md\">\u7528\u6237\u4E2D\u5FC3, \u65B9\u4FBF\u60A8\u7EF4\u62A4\u4E2A\u4EBA\u4FE1\u606F, \u8FD9\u4F1A\u6709\u4E00\u4E2A\u5F88\u597D\u7684\u4F53\u9A8C</p>\n <!-- <button (click)=\"follow()\">Follow</button>\n <button (click)=\"unfollow()\">UnFollow</button> -->\n <button (click)=\"listFollowingByUsername()\">listFollowingByUsername</button>\n <button (click)=\"listFollowersByUsername()\">List Followers</button>\n <button (click)=\"stats()\">Stats</button>\n\n <!-- <button (click)=\"friendships()\">friendships</button> -->\n </div>\n </div>\n </div>\n}\n<rolatech-toolbar title=\"\u5BA2\u6237\u7AEF\u521B\u5EFA\" subtitle=\"\u5BA2\u6237\u7AEF\u521B\u5EFA\u7684\u63CF\u8FF0\" link=\"/\"></rolatech-toolbar>\n\n<rolatech-tabs [(select)]=\"selectIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\"></rolatech-tab>\n</rolatech-tabs>\n@for (item of users; track $index) {\n <rolatech-account-user-item\n [user]=\"item\"\n [isFollowing]=\"item.isFollowing\"\n (follow)=\"follow(item)\"\n (unfollow)=\"unfollow(item)\"\n [routerLink]=\"'/' + item.username\"\n ></rolatech-account-user-item>\n}\n<!-- @for (number of [0, 1, 2, 3, 4, 5]; track number) {\n <rolatech-account-user-item></rolatech-account-user-item>\n} -->\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: UserItemComponent, selector: "rolatech-account-user-item", inputs: ["user", "isFollowing", "own"], outputs: ["follow", "unfollow"] }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link"] }] }); }
|
|
102
|
-
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: HomeComponent, decorators: [{
|
|
104
|
-
type: Component,
|
|
105
|
-
args: [{ standalone: true, imports: [
|
|
106
|
-
AngularCommonModule,
|
|
107
|
-
AngularComponentsModule,
|
|
108
|
-
SpinnerComponent,
|
|
109
|
-
UserItemComponent,
|
|
110
|
-
TabsComponent,
|
|
111
|
-
TabComponent,
|
|
112
|
-
ToolbarComponent,
|
|
113
|
-
], selector: 'rolatech-account-home', template: "@if (user$ | async; as user) {\n <div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <!-- <rolatech-spinner></rolatech-spinner> -->\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <div class=\"p-3 mb-3\">\n <div class=\"w-20 h-20 rounded-full bg-orange-600\">\n @if (user.avatar) {\n <img class=\"w-20 h-20 rounded-full object-cover\" [src]=\"user.avatar\" />\n }\n </div>\n </div>\n <p class=\"text-3xl\">\u6B22\u8FCE\u56DE\u6765, {{ user.name }}</p>\n <p class=\"text-md\">\u7528\u6237\u4E2D\u5FC3, \u65B9\u4FBF\u60A8\u7EF4\u62A4\u4E2A\u4EBA\u4FE1\u606F, \u8FD9\u4F1A\u6709\u4E00\u4E2A\u5F88\u597D\u7684\u4F53\u9A8C</p>\n <!-- <button (click)=\"follow()\">Follow</button>\n <button (click)=\"unfollow()\">UnFollow</button> -->\n <button (click)=\"listFollowingByUsername()\">listFollowingByUsername</button>\n <button (click)=\"listFollowersByUsername()\">List Followers</button>\n <button (click)=\"stats()\">Stats</button>\n\n <!-- <button (click)=\"friendships()\">friendships</button> -->\n </div>\n </div>\n </div>\n}\n<rolatech-toolbar title=\"\u5BA2\u6237\u7AEF\u521B\u5EFA\" subtitle=\"\u5BA2\u6237\u7AEF\u521B\u5EFA\u7684\u63CF\u8FF0\" link=\"/\"></rolatech-toolbar>\n\n<rolatech-tabs [(select)]=\"selectIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\"></rolatech-tab>\n</rolatech-tabs>\n@for (item of users; track $index) {\n <rolatech-account-user-item\n [user]=\"item\"\n [isFollowing]=\"item.isFollowing\"\n (follow)=\"follow(item)\"\n (unfollow)=\"unfollow(item)\"\n [routerLink]=\"'/' + item.username\"\n ></rolatech-account-user-item>\n}\n<!-- @for (number of [0, 1, 2, 3, 4, 5]; track number) {\n <rolatech-account-user-item></rolatech-account-user-item>\n} -->\n" }]
|
|
114
|
-
}], ctorParameters: () => [] });
|
|
115
|
-
|
|
116
|
-
export { HomeComponent };
|
|
117
|
-
//# sourceMappingURL=rolatech-angular-account-home.component-B28zyXQ7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolatech-angular-account-home.component-B28zyXQ7.mjs","sources":["../../../../libs/angular-account/src/lib/pages/myaccount/home/home.component.ts","../../../../libs/angular-account/src/lib/pages/myaccount/home/home.component.html"],"sourcesContent":["import { Observable } from 'rxjs';\nimport { Component, effect, inject, OnInit, signal } from '@angular/core';\nimport { AuthUserService } from '@rolatech/angular-auth';\nimport {\n AngularComponentsModule,\n BaseComponent,\n SpinnerComponent,\n TabComponent,\n TabsComponent,\n ToolbarComponent,\n} from '@rolatech/angular-components';\nimport { AngularCommonModule } from '@rolatech/angular-common';\nimport { UserItemComponent } from '../../../components';\nimport { map } from 'lodash';\n\n@Component({\n standalone: true,\n imports: [\n AngularCommonModule,\n AngularComponentsModule,\n SpinnerComponent,\n UserItemComponent,\n TabsComponent,\n TabComponent,\n ToolbarComponent,\n ],\n selector: 'rolatech-account-home',\n templateUrl: './home.component.html',\n styleUrls: ['./home.component.scss'],\n})\nexport class HomeComponent extends BaseComponent implements OnInit {\n user$!: Observable<any>;\n authUserService = inject(AuthUserService);\n users: any = [];\n selectIndex = signal(0);\n friendshipsData: any;\n constructor() {\n super();\n effect(() => {\n const index = this.selectIndex();\n if (index === 0) {\n this.listFollowingByUsername();\n }\n if (index === 1) {\n this.listFollowersByUsername();\n }\n if (index === 2) {\n }\n });\n }\n ngOnInit(): void {\n this.user$ = this.authUserService.me();\n }\n friendships(ids: string[]) {\n //user-ew57mn7wqzs4\n // user-lnerfootihvy\n // ['20672315197100032', '15679392466472960', '156793924664'];\n this.authUserService.friendships(ids).subscribe({\n next: (res) => {\n this.format(res.data);\n this.friendshipsData = res.data;\n },\n });\n }\n stats() {\n this.authUserService.followersStats('pinxiaoke').subscribe({\n next: (res) => {\n console.log(res);\n },\n });\n }\n follow(user: any) {\n //user-ew57mn7wqzs4\n // user-lnerfootihvy\n this.authUserService.follow(user.username).subscribe({\n next: (res) => {\n console.log(res);\n user.isFollowing = true;\n },\n });\n }\n unfollow(user: any) {\n this.authUserService.unfollow(user.username).subscribe({\n next: (res) => {\n user.isFollowing = false;\n console.log(res);\n },\n });\n }\n listFollowingByUsername() {\n this.authUserService.listFollowingByUsername('pinxiaoke').subscribe({\n next: (res) => {\n this.users = map(res.data, 'user');\n const ids = map(res.data, 'user.id');\n this.friendships(ids);\n },\n });\n }\n listFollowersByUsername() {\n this.authUserService.listFollowersByUsername('pinxiaoke').subscribe({\n next: (res) => {\n this.users = map(res.data, 'follower');\n const ids = map(res.data, 'follower.id');\n this.friendships(ids);\n },\n });\n }\n format(friendships: any) {\n this.users.map((item) => {\n item.isFollowing = friendships[item.id].following;\n });\n }\n onClick(event) {\n console.log(event);\n }\n}\n","@if (user$ | async; as user) {\n <div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <!-- <rolatech-spinner></rolatech-spinner> -->\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <div class=\"p-3 mb-3\">\n <div class=\"w-20 h-20 rounded-full bg-orange-600\">\n @if (user.avatar) {\n <img class=\"w-20 h-20 rounded-full object-cover\" [src]=\"user.avatar\" />\n }\n </div>\n </div>\n <p class=\"text-3xl\">欢迎回来, {{ user.name }}</p>\n <p class=\"text-md\">用户中心, 方便您维护个人信息, 这会有一个很好的体验</p>\n <!-- <button (click)=\"follow()\">Follow</button>\n <button (click)=\"unfollow()\">UnFollow</button> -->\n <button (click)=\"listFollowingByUsername()\">listFollowingByUsername</button>\n <button (click)=\"listFollowersByUsername()\">List Followers</button>\n <button (click)=\"stats()\">Stats</button>\n\n <!-- <button (click)=\"friendships()\">friendships</button> -->\n </div>\n </div>\n </div>\n}\n<rolatech-toolbar title=\"客户端创建\" subtitle=\"客户端创建的描述\" link=\"/\"></rolatech-toolbar>\n\n<rolatech-tabs [(select)]=\"selectIndex\">\n <rolatech-tab label=\"关注\"></rolatech-tab>\n <rolatech-tab label=\"粉丝\"></rolatech-tab>\n</rolatech-tabs>\n@for (item of users; track $index) {\n <rolatech-account-user-item\n [user]=\"item\"\n [isFollowing]=\"item.isFollowing\"\n (follow)=\"follow(item)\"\n (unfollow)=\"unfollow(item)\"\n [routerLink]=\"'/' + item.username\"\n ></rolatech-account-user-item>\n}\n<!-- @for (number of [0, 1, 2, 3, 4, 5]; track number) {\n <rolatech-account-user-item></rolatech-account-user-item>\n} -->\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;;;;AA8BM,MAAO,aAAc,SAAQ,aAAa,CAAA;AAM9C,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;AALV,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;QAC1C,IAAK,CAAA,KAAA,GAAQ,EAAE,CAAC;AAChB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAItB,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AACjC,YAAA,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,IAAI,CAAC,uBAAuB,EAAE,CAAC;aAChC;AACD,YAAA,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,IAAI,CAAC,uBAAuB,EAAE,CAAC;aAChC;AACD,YAAA,IAAI,KAAK,KAAK,CAAC,EAAE;aAChB;AACH,SAAC,CAAC,CAAC;KACJ;IACD,QAAQ,GAAA;QACN,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC;KACxC;AACD,IAAA,WAAW,CAAC,GAAa,EAAA;;;;QAIvB,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC;AAC9C,YAAA,IAAI,EAAE,CAAC,GAAG,KAAI;AACZ,gBAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;A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AAgB;AACjB,qBAAA,EAAA,QAAA,EACS,uBAAuB,EAAA,QAAA,EAAA,g6DAAA,EAAA,CAAA;;;;;"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, output, Component, Inject } from '@angular/core';
|
|
3
|
-
import { AuthUserService } from '@rolatech/angular-auth';
|
|
4
|
-
import { AngularCommonModule } from '@rolatech/angular-common';
|
|
5
|
-
import { AngularComponentsModule, SpinnerComponent } from '@rolatech/angular-components';
|
|
6
|
-
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
|
|
7
|
-
import { U as UserGender } from './rolatech-angular-account-user-CK_zEFn_.mjs';
|
|
8
|
-
import { CommonModule } from '@angular/common';
|
|
9
|
-
import * as i2 from '@angular/material/button';
|
|
10
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
-
import * as i3 from '@angular/material/icon';
|
|
12
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
13
|
-
import { SnackBarService } from '@rolatech/angular-services';
|
|
14
|
-
import * as i1 from '@angular/router';
|
|
15
|
-
import * as i2$1 from '@angular/material/divider';
|
|
16
|
-
import * as i4 from '@angular/material/list';
|
|
17
|
-
|
|
18
|
-
class AvatarUpdateDialogComponent {
|
|
19
|
-
constructor(data) {
|
|
20
|
-
this.data = data;
|
|
21
|
-
this.dialogRef = inject(MatDialogRef);
|
|
22
|
-
this.authUserService = inject(AuthUserService);
|
|
23
|
-
this.snackBarService = inject(SnackBarService);
|
|
24
|
-
this.avatar = '';
|
|
25
|
-
this.save = output();
|
|
26
|
-
this.avatar = data.avatar;
|
|
27
|
-
}
|
|
28
|
-
cancel() {
|
|
29
|
-
this.dialogRef.close();
|
|
30
|
-
}
|
|
31
|
-
onSave() {
|
|
32
|
-
this.save.emit(this.avatar);
|
|
33
|
-
}
|
|
34
|
-
onUpload(event) {
|
|
35
|
-
const file = event.target.files[0];
|
|
36
|
-
if (file) {
|
|
37
|
-
const reader = new FileReader();
|
|
38
|
-
reader.readAsDataURL(file);
|
|
39
|
-
reader.onload = () => {
|
|
40
|
-
this.avatar = reader.result;
|
|
41
|
-
// this.isUploading = true;
|
|
42
|
-
const formData = new FormData();
|
|
43
|
-
formData.append('file', file);
|
|
44
|
-
this.authUserService.uploadAvatar(formData).subscribe({
|
|
45
|
-
next: (res) => {
|
|
46
|
-
this.snackBarService.open('更新成功');
|
|
47
|
-
// this.isUploading = false;
|
|
48
|
-
},
|
|
49
|
-
error: (e) => {
|
|
50
|
-
// this.isUploading = false;
|
|
51
|
-
// this.snackBar.open('上传失败: ' + e.message);
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
reader.onerror = (error) => {
|
|
56
|
-
// this.isUploading = false;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AvatarUpdateDialogComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: AvatarUpdateDialogComponent, isStandalone: true, selector: "rolatech-account-avatar-update-dialog", outputs: { save: "save" }, ngImport: i0, template: "<div class=\"flex flex-col p-3 max-w-[500px] mx-auto\">\n <div class=\"text-xl font-bold p-3\">\u4FEE\u6539\u5934\u50CF</div>\n <!-- <div class=\"w-[256px] h-[256px] mx-auto flex justify-center items-center\">\n <img [src]=\"avatar\" />\n </div> -->\n <div class=\"px-3 py-8\">\n <div\n class=\"bg-orange-600 w-[256px] h-[256px] rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (avatar) {\n <div class=\"w-[256px] h-[256px]\">\n <img [src]=\"avatar\" class=\"w-[256px] h-[256px] rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n\n <!-- <div class=\"p-3 flex justify-end items-center gap-3\">\n <button mat-button (click)=\"cancel()\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave()\">\u4FDD\u5B58</button>\n </div> -->\n <div class=\"py-3\">\n <input style=\"display: none\" type=\"file\" accept=\"image/*\" (change)=\"onUpload($event)\" #fileInput />\n <button mat-flat-button (click)=\"fileInput.click()\">\n <mat-icon>edit</mat-icon>\n <span>\u66F4\u6362\u5934\u50CF</span>\n </button>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
62
|
-
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: AvatarUpdateDialogComponent, decorators: [{
|
|
64
|
-
type: Component,
|
|
65
|
-
args: [{ selector: 'rolatech-account-avatar-update-dialog', standalone: true, imports: [CommonModule, MatButtonModule, MatIconModule], template: "<div class=\"flex flex-col p-3 max-w-[500px] mx-auto\">\n <div class=\"text-xl font-bold p-3\">\u4FEE\u6539\u5934\u50CF</div>\n <!-- <div class=\"w-[256px] h-[256px] mx-auto flex justify-center items-center\">\n <img [src]=\"avatar\" />\n </div> -->\n <div class=\"px-3 py-8\">\n <div\n class=\"bg-orange-600 w-[256px] h-[256px] rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (avatar) {\n <div class=\"w-[256px] h-[256px]\">\n <img [src]=\"avatar\" class=\"w-[256px] h-[256px] rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n\n <!-- <div class=\"p-3 flex justify-end items-center gap-3\">\n <button mat-button (click)=\"cancel()\">\u53D6\u6D88</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave()\">\u4FDD\u5B58</button>\n </div> -->\n <div class=\"py-3\">\n <input style=\"display: none\" type=\"file\" accept=\"image/*\" (change)=\"onUpload($event)\" #fileInput />\n <button mat-flat-button (click)=\"fileInput.click()\">\n <mat-icon>edit</mat-icon>\n <span>\u66F4\u6362\u5934\u50CF</span>\n </button>\n </div>\n</div>\n" }]
|
|
66
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
67
|
-
type: Inject,
|
|
68
|
-
args: [MAT_DIALOG_DATA]
|
|
69
|
-
}] }] });
|
|
70
|
-
|
|
71
|
-
class InfoComponent {
|
|
72
|
-
constructor() {
|
|
73
|
-
this.authUserService = inject(AuthUserService);
|
|
74
|
-
this.dialog = inject(MatDialog);
|
|
75
|
-
this.gender = UserGender;
|
|
76
|
-
}
|
|
77
|
-
ngOnInit() {
|
|
78
|
-
this.user$ = this.authUserService.me();
|
|
79
|
-
this.user$.subscribe({
|
|
80
|
-
next: (user) => {
|
|
81
|
-
this.user = user;
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
updateAvatar() {
|
|
86
|
-
const dialogRef = this.dialog.open(AvatarUpdateDialogComponent, {
|
|
87
|
-
data: {
|
|
88
|
-
avatar: this.user.avatar,
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
dialogRef.afterClosed().subscribe((result) => {
|
|
92
|
-
console.log(result);
|
|
93
|
-
location.reload();
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: InfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
97
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: InfoComponent, isStandalone: true, selector: "rolatech-account-info", ngImport: i0, template: "<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <rolatech-spinner></rolatech-spinner>\n @if (user) {\n <div>\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">\u4E2A\u4EBA\u4FE1\u606F</p>\n <p class=\"text-md\">\u7528\u6237\u4FE1\u606F\u7684\u5168\u90E8\u5185\u5BB9</p>\n </div>\n <div class=\"border border-grap-400 rounded px-3 pt-3 mb-14\">\n <div class=\"p-3 text-xl\">\u57FA\u672C\u8BBE\u7F6E</div>\n <mat-nav-list>\n <mat-list-item (click)=\"updateAvatar()\" class=\"h-16\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u5934\u50CF</span>\n <span class=\"w-24 text-sm\">\u8D26\u6237\u7684\u5934\u50CF</span>\n </div>\n <div\n class=\"mr-6 bg-orange-600 w-9 h-9 rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (user.avatar) {\n <div class=\"w-9 h-9\">\n <img [src]=\"user.avatar\" class=\"w-9 h-9 rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../profile\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u59D3\u540D</span>\n <span>{{ user?.name }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../gender\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u6027\u522B</span>\n <span>{{ gender[user.gender] || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../username\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u7528\u6237\u540D</span>\n <span>{{ user.username }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n <!-- contact -->\n <div class=\"border border-grap-400 rounded px-3 pt-3\">\n <div class=\"p-3 text-xl\">\u8054\u7CFB\u65B9\u5F0F</div>\n <mat-nav-list>\n <mat-list-item routerLink=\"../email\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u90AE\u7BB1</span>\n <span>{{ user.email || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../phone\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u7535\u8BDD</span>\n <span>{{ user.phone || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: SpinnerComponent, selector: "rolatech-spinner", inputs: ["title"] }] }); }
|
|
98
|
-
}
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: InfoComponent, decorators: [{
|
|
100
|
-
type: Component,
|
|
101
|
-
args: [{ standalone: true, imports: [AngularCommonModule, AngularComponentsModule, SpinnerComponent], selector: 'rolatech-account-info', template: "<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <rolatech-spinner></rolatech-spinner>\n @if (user) {\n <div>\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">\u4E2A\u4EBA\u4FE1\u606F</p>\n <p class=\"text-md\">\u7528\u6237\u4FE1\u606F\u7684\u5168\u90E8\u5185\u5BB9</p>\n </div>\n <div class=\"border border-grap-400 rounded px-3 pt-3 mb-14\">\n <div class=\"p-3 text-xl\">\u57FA\u672C\u8BBE\u7F6E</div>\n <mat-nav-list>\n <mat-list-item (click)=\"updateAvatar()\" class=\"h-16\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u5934\u50CF</span>\n <span class=\"w-24 text-sm\">\u8D26\u6237\u7684\u5934\u50CF</span>\n </div>\n <div\n class=\"mr-6 bg-orange-600 w-9 h-9 rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (user.avatar) {\n <div class=\"w-9 h-9\">\n <img [src]=\"user.avatar\" class=\"w-9 h-9 rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../profile\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u59D3\u540D</span>\n <span>{{ user?.name }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../gender\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u6027\u522B</span>\n <span>{{ gender[user.gender] || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../username\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u7528\u6237\u540D</span>\n <span>{{ user.username }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n <!-- contact -->\n <div class=\"border border-grap-400 rounded px-3 pt-3\">\n <div class=\"p-3 text-xl\">\u8054\u7CFB\u65B9\u5F0F</div>\n <mat-nav-list>\n <mat-list-item routerLink=\"../email\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u90AE\u7BB1</span>\n <span>{{ user.email || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../phone\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">\u7535\u8BDD</span>\n <span>{{ user.phone || '\u672A\u8BBE\u7F6E' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n </div>\n }\n </div>\n</div>\n" }]
|
|
102
|
-
}] });
|
|
103
|
-
|
|
104
|
-
export { InfoComponent };
|
|
105
|
-
//# sourceMappingURL=rolatech-angular-account-info.component-DNi4eTxV.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolatech-angular-account-info.component-DNi4eTxV.mjs","sources":["../../../../libs/angular-account/src/lib/components/avatar-update-dialog/avatar-update-dialog.component.ts","../../../../libs/angular-account/src/lib/components/avatar-update-dialog/avatar-update-dialog.component.html","../../../../libs/angular-account/src/lib/pages/myaccount/personal-info/info.component.ts","../../../../libs/angular-account/src/lib/pages/myaccount/personal-info/info.component.html"],"sourcesContent":["import { Component, Inject, inject, input, output } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { MatButtonModule } from '@angular/material/button';\nimport { AuthUserService } from '@rolatech/angular-auth';\nimport { MatIconModule } from '@angular/material/icon';\nimport { SnackBarService } from '@rolatech/angular-services';\n\n@Component({\n selector: 'rolatech-account-avatar-update-dialog',\n standalone: true,\n imports: [CommonModule, MatButtonModule, MatIconModule],\n templateUrl: './avatar-update-dialog.component.html',\n styleUrl: './avatar-update-dialog.component.scss',\n})\nexport class AvatarUpdateDialogComponent {\n dialogRef = inject(MatDialogRef);\n authUserService = inject(AuthUserService);\n snackBarService = inject(SnackBarService);\n avatar: any = '';\n save = output<any>();\n\n constructor(@Inject(MAT_DIALOG_DATA) public data: { avatar: string }) {\n this.avatar = data.avatar;\n }\n\n cancel() {\n this.dialogRef.close();\n }\n onSave() {\n this.save.emit(this.avatar);\n }\n onUpload(event: any) {\n const file = event.target.files[0];\n if (file) {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n this.avatar = reader.result;\n // this.isUploading = true;\n const formData = new FormData();\n formData.append('file', file);\n\n this.authUserService.uploadAvatar(formData).subscribe({\n next: (res: any) => {\n this.snackBarService.open('更新成功');\n // this.isUploading = false;\n },\n error: (e) => {\n // this.isUploading = false;\n // this.snackBar.open('上传失败: ' + e.message);\n },\n });\n };\n reader.onerror = (error) => {\n // this.isUploading = false;\n };\n }\n }\n}\n","<div class=\"flex flex-col p-3 max-w-[500px] mx-auto\">\n <div class=\"text-xl font-bold p-3\">修改头像</div>\n <!-- <div class=\"w-[256px] h-[256px] mx-auto flex justify-center items-center\">\n <img [src]=\"avatar\" />\n </div> -->\n <div class=\"px-3 py-8\">\n <div\n class=\"bg-orange-600 w-[256px] h-[256px] rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (avatar) {\n <div class=\"w-[256px] h-[256px]\">\n <img [src]=\"avatar\" class=\"w-[256px] h-[256px] rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n\n <!-- <div class=\"p-3 flex justify-end items-center gap-3\">\n <button mat-button (click)=\"cancel()\">取消</button>\n <button mat-flat-button color=\"primary\" (click)=\"onSave()\">保存</button>\n </div> -->\n <div class=\"py-3\">\n <input style=\"display: none\" type=\"file\" accept=\"image/*\" (change)=\"onUpload($event)\" #fileInput />\n <button mat-flat-button (click)=\"fileInput.click()\">\n <mat-icon>edit</mat-icon>\n <span>更换头像</span>\n </button>\n </div>\n</div>\n","import { Component, inject, OnInit } from '@angular/core';\nimport { AuthUserService } from '@rolatech/angular-auth';\nimport { AngularCommonModule } from '@rolatech/angular-common';\nimport { AngularComponentsModule, SpinnerComponent } from '@rolatech/angular-components';\nimport { Observable } from 'rxjs';\nimport { MatDialog } from '@angular/material/dialog';\nimport { UserGender } from '../../../contant/user';\nimport { AvatarUpdateDialogComponent } from '../../../components/avatar-update-dialog/avatar-update-dialog.component';\n\n@Component({\n standalone: true,\n imports: [AngularCommonModule, AngularComponentsModule, SpinnerComponent],\n selector: 'rolatech-account-info',\n templateUrl: './info.component.html',\n styleUrls: ['./info.component.scss'],\n})\nexport class InfoComponent implements OnInit {\n user$!: Observable<any>;\n authUserService = inject(AuthUserService);\n dialog = inject(MatDialog);\n user: any;\n gender: any = UserGender;\n\n ngOnInit(): void {\n this.user$ = this.authUserService.me();\n this.user$.subscribe({\n next: (user) => {\n this.user = user;\n },\n });\n }\n updateAvatar() {\n const dialogRef = this.dialog.open(AvatarUpdateDialogComponent, {\n data: {\n avatar: this.user.avatar,\n },\n });\n dialogRef.afterClosed().subscribe((result) => {\n console.log(result);\n location.reload();\n });\n }\n}\n","<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] m-3\">\n <rolatech-spinner></rolatech-spinner>\n @if (user) {\n <div>\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">个人信息</p>\n <p class=\"text-md\">用户信息的全部内容</p>\n </div>\n <div class=\"border border-grap-400 rounded px-3 pt-3 mb-14\">\n <div class=\"p-3 text-xl\">基本设置</div>\n <mat-nav-list>\n <mat-list-item (click)=\"updateAvatar()\" class=\"h-16\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">头像</span>\n <span class=\"w-24 text-sm\">账户的头像</span>\n </div>\n <div\n class=\"mr-6 bg-orange-600 w-9 h-9 rounded-full cursor-pointer hover:outline-gray-200 outline outline-transparent outline-4\"\n >\n @if (user.avatar) {\n <div class=\"w-9 h-9\">\n <img [src]=\"user.avatar\" class=\"w-9 h-9 rounded-full object-cover\" />\n </div>\n }\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../profile\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">姓名</span>\n <span>{{ user?.name }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../gender\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">性别</span>\n <span>{{ gender[user.gender] || '未设置' }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../username\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">用户名</span>\n <span>{{ user.username }}</span>\n </div>\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n <!-- contact -->\n <div class=\"border border-grap-400 rounded px-3 pt-3\">\n <div class=\"p-3 text-xl\">联系方式</div>\n <mat-nav-list>\n <mat-list-item routerLink=\"../email\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">邮箱</span>\n <span>{{ user.email || '未设置' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item routerLink=\"../phone\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm font-thin\">电话</span>\n <span>{{ user.phone || '未设置' }}</span>\n </div>\n <!-- <mat-icon mat-list-icon>arrow_drop_down</mat-icon> -->\n <span>\n <mat-icon> navigate_next </mat-icon>\n </span>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n </div>\n }\n </div>\n</div>\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;;;;;MAea,2BAA2B,CAAA;AAOtC,IAAA,WAAA,CAA4C,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sGA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED3FY,mBAAmB,EAAE,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,uBAAuB,6hBAAE,gBAAgB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAK7D,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;iCACI,IAAI,EAAA,OAAA,EACP,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAC/D,uBAAuB,EAAA,QAAA,EAAA,qiJAAA,EAAA,CAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolatech-angular-account-login.routes-DjxoOzuE.mjs","sources":["../../../../libs/angular-account/src/lib/components/login/login-wechat/login-wechat.component.ts","../../../../libs/angular-account/src/lib/components/login/login-wechat/login-wechat.component.html","../../../../libs/angular-account/src/lib/components/login/login.routes.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Component, OnInit, PLATFORM_ID, inject } from '@angular/core';\nimport { AuthService } from '@rolatech/angular-auth';\nimport { APP_CONFIG, AngularCommonModule } from '@rolatech/angular-common';\nimport { AngularComponentsModule, BaseComponent } from '@rolatech/angular-components';\nimport { WeChatLoginService } from '../../../services/wechat-login.service';\n\n@Component({\n standalone: true,\n imports: [AngularCommonModule, AngularComponentsModule],\n selector: 'rolatech-account-login-wechat',\n templateUrl: './login-wechat.component.html',\n styleUrls: ['./login-wechat.component.scss'],\n})\nexport class LoginWechatComponent extends BaseComponent implements OnInit {\n authService = inject(AuthService);\n environment = inject(APP_CONFIG);\n platformId = inject(PLATFORM_ID);\n wechtLoginService = inject(WeChatLoginService);\n\n ngOnInit(): void {\n this.route.queryParams.subscribe({\n next: (params: any) => {\n this.wechatLogin(params.code, params.state);\n },\n });\n }\n wechatLogin(code: string, state: string) {\n window.parent.postMessage({ code: 23 }, this.environment.accountsUrl);\n\n this.authService.wechatLogin(code, state).subscribe({\n next: (res) => {\n if (res.name) {\n window.parent.postMessage({ code: 200 }, this.environment.accountsUrl);\n }\n // if (isPlatformBrowser(this.platformId) && res.code === 200) {\n // window.parent.postMessage({ code: res.code }, this.environment.myaccountUrl);\n // }\n },\n });\n }\n}\n","<div>loading...</div>\n","import { Routes } from '@angular/router';\nimport { LoginWechatComponent } from './login-wechat/login-wechat.component';\n\nconst loginRoutes: Routes = [{ path: '', component: LoginWechatComponent }];\nexport default loginRoutes;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAcM,MAAO,oBAAqB,SAAQ,aAAa,CAAA;AAPvD,IAAA,WAAA,GAAA;;AAQE,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAClC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACjC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACjC,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAuBhD,KAAA;IArBC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC;AAC/B,YAAA,IAAI,EAAE,CAAC,MAAW,KAAI;gBACpB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,E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WACP,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,YAC7C,+BAA+B,EAAA,QAAA,EAAA,yBAAA,EAAA,CAAA;;;AEP3C,MAAM,WAAW,GAAW,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE;;;;"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component } from '@angular/core';
|
|
3
|
-
import { AuthUserService } from '@rolatech/angular-auth';
|
|
4
|
-
import { AngularCommonModule } from '@rolatech/angular-common';
|
|
5
|
-
import { BaseComponent, AngularComponentsModule } from '@rolatech/angular-components';
|
|
6
|
-
import { BackButtonDirective } from '@rolatech/angular-services';
|
|
7
|
-
import * as i1 from '@angular/common';
|
|
8
|
-
import * as i1$1 from '@angular/forms';
|
|
9
|
-
import * as i2 from '@angular/material/button';
|
|
10
|
-
import * as i2$1 from '@angular/material/divider';
|
|
11
|
-
import * as i3 from '@angular/material/icon';
|
|
12
|
-
import * as i3$1 from '@angular/material/form-field';
|
|
13
|
-
import * as i4 from '@angular/material/input';
|
|
14
|
-
|
|
15
|
-
class PhoneComponent extends BaseComponent {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.authUserService = inject(AuthUserService);
|
|
19
|
-
this.phone = '';
|
|
20
|
-
this.code = '';
|
|
21
|
-
this.countDown = false;
|
|
22
|
-
this.countDownTime = 60;
|
|
23
|
-
this.showButtonText = '发送验证码';
|
|
24
|
-
}
|
|
25
|
-
ngOnInit() {
|
|
26
|
-
this.authUserService.me().subscribe({
|
|
27
|
-
next: (res) => {
|
|
28
|
-
this.phone = res.phone;
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
sendSMSCode() {
|
|
33
|
-
this.countDown = true;
|
|
34
|
-
const start = setInterval(() => {
|
|
35
|
-
if (this.countDownTime >= 0) {
|
|
36
|
-
this.showButtonText = `${this.countDownTime--}秒重发`;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
clearInterval(start);
|
|
40
|
-
this.showButtonText = '重新发送';
|
|
41
|
-
this.countDown = false;
|
|
42
|
-
this.countDownTime = 60;
|
|
43
|
-
}
|
|
44
|
-
}, 1000);
|
|
45
|
-
this.authUserService.sendSMSCode('+86', this.phone).subscribe({
|
|
46
|
-
next: (res) => {
|
|
47
|
-
this.snackBarService.open('发送成功');
|
|
48
|
-
},
|
|
49
|
-
error: (error) => {
|
|
50
|
-
this.snackBarService.open(error.message);
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
save() {
|
|
55
|
-
this.authUserService.changePhone(this.phone, this.code).subscribe({
|
|
56
|
-
next: (res) => {
|
|
57
|
-
this.snackBarService.open('修改成功');
|
|
58
|
-
},
|
|
59
|
-
error: (error) => {
|
|
60
|
-
this.snackBarService.open(error.message);
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PhoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: PhoneComponent, isStandalone: true, selector: "rolatech-account-phone", usesInheritance: true, ngImport: i0, template: "<div>\n <div class=\"px-3 max-w-[1120px] m-auto\">\n <div class=\"flex items-center\">\n <div class=\"flex items-center justify-center w-11 h-11 cursor-pointer\" rolatechBackButton>\n <mat-icon>arrow_back</mat-icon>\n </div>\n <span class=\"text-xl font-medium\">\u4FEE\u6539\u624B\u673A\u53F7</span>\n </div>\n </div>\n <div class=\"px-4\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"max-w-[1120px] m-auto px-6\">\n <p class=\"text-md my-3\">\u624B\u673A\u53F7\u662F\u60A8\u5728\u672C\u7AD9\u7684\u552F\u4E00\u6807\u8BC6, \u66F4\u6539\u540E\u5C06\u540C\u65F6\u66F4\u6539\u7B2C\u4E09\u65B9\u7ED1\u5B9A\u7684\u624B\u673A\u53F7</p>\n <div class=\"flex flex-col mt-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u624B\u673A\u53F7 </mat-label>\n <input matInput [(ngModel)]=\"phone\" required />\n </mat-form-field>\n <div class=\"flex justify-between items-start gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u9A8C\u8BC1\u7801 </mat-label>\n <input matInput [(ngModel)]=\"code\" required />\n </mat-form-field>\n <button\n (click)=\"sendSMSCode()\"\n [disabled]=\"countDown\"\n [ngClass]=\"countDown ? 'bg-orange-300' : 'bg-orange-600 shadow shadow-gray-300 cursor-pointer'\"\n class=\"w-[128px] p-2 mt-2 text-white rounded text-center\"\n >\n <span class=\"text-sm\">{{ showButtonText }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>\u53D6\u6D88</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-[128px] p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n \u4FDD\u5B58\n </button>\n </div>\n </div>\n</div>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: BackButtonDirective, selector: "[rolatechBackButton]" }] }); }
|
|
66
|
-
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: PhoneComponent, decorators: [{
|
|
68
|
-
type: Component,
|
|
69
|
-
args: [{ standalone: true, imports: [AngularCommonModule, AngularComponentsModule, BackButtonDirective], selector: 'rolatech-account-phone', template: "<div>\n <div class=\"px-3 max-w-[1120px] m-auto\">\n <div class=\"flex items-center\">\n <div class=\"flex items-center justify-center w-11 h-11 cursor-pointer\" rolatechBackButton>\n <mat-icon>arrow_back</mat-icon>\n </div>\n <span class=\"text-xl font-medium\">\u4FEE\u6539\u624B\u673A\u53F7</span>\n </div>\n </div>\n <div class=\"px-4\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"max-w-[1120px] m-auto px-6\">\n <p class=\"text-md my-3\">\u624B\u673A\u53F7\u662F\u60A8\u5728\u672C\u7AD9\u7684\u552F\u4E00\u6807\u8BC6, \u66F4\u6539\u540E\u5C06\u540C\u65F6\u66F4\u6539\u7B2C\u4E09\u65B9\u7ED1\u5B9A\u7684\u624B\u673A\u53F7</p>\n <div class=\"flex flex-col mt-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u624B\u673A\u53F7 </mat-label>\n <input matInput [(ngModel)]=\"phone\" required />\n </mat-form-field>\n <div class=\"flex justify-between items-start gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> \u9A8C\u8BC1\u7801 </mat-label>\n <input matInput [(ngModel)]=\"code\" required />\n </mat-form-field>\n <button\n (click)=\"sendSMSCode()\"\n [disabled]=\"countDown\"\n [ngClass]=\"countDown ? 'bg-orange-300' : 'bg-orange-600 shadow shadow-gray-300 cursor-pointer'\"\n class=\"w-[128px] p-2 mt-2 text-white rounded text-center\"\n >\n <span class=\"text-sm\">{{ showButtonText }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>\u53D6\u6D88</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-[128px] p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n \u4FDD\u5B58\n </button>\n </div>\n </div>\n</div>\n", styles: ["mat-form-field{width:100%}\n"] }]
|
|
70
|
-
}] });
|
|
71
|
-
|
|
72
|
-
export { PhoneComponent };
|
|
73
|
-
//# sourceMappingURL=rolatech-angular-account-phone.component-r9dWPfEL.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolatech-angular-account-phone.component-r9dWPfEL.mjs","sources":["../../../../libs/angular-account/src/lib/pages/myaccount/phone/phone.component.ts","../../../../libs/angular-account/src/lib/pages/myaccount/phone/phone.component.html"],"sourcesContent":["import { Component, OnInit, inject } from '@angular/core';\nimport { AuthUserService } from '@rolatech/angular-auth';\nimport { AngularCommonModule } from '@rolatech/angular-common';\nimport { AngularComponentsModule, BaseComponent } from '@rolatech/angular-components';\nimport { BackButtonDirective } from '@rolatech/angular-services';\nimport { Observable } from 'rxjs';\n\n@Component({\n standalone: true,\n imports: [AngularCommonModule, AngularComponentsModule, BackButtonDirective],\n selector: 'rolatech-account-phone',\n templateUrl: './phone.component.html',\n styleUrls: ['./phone.component.scss'],\n})\nexport class PhoneComponent extends BaseComponent implements OnInit {\n authUserService = inject(AuthUserService);\n user$!: Observable<any>;\n phone = '';\n code = '';\n countDown = false;\n countDownTime = 60;\n showButtonText = '发送验证码';\n\n ngOnInit(): void {\n this.authUserService.me().subscribe({\n next: (res) => {\n this.phone = res.phone;\n },\n });\n }\n\n sendSMSCode() {\n this.countDown = true;\n const start = setInterval(() => {\n if (this.countDownTime >= 0) {\n this.showButtonText = `${this.countDownTime--}秒重发`;\n } else {\n clearInterval(start);\n this.showButtonText = '重新发送';\n this.countDown = false;\n this.countDownTime = 60;\n }\n }, 1000);\n\n this.authUserService.sendSMSCode('+86', this.phone).subscribe({\n next: (res) => {\n this.snackBarService.open('发送成功');\n },\n error: (error) => {\n this.snackBarService.open(error.message);\n },\n });\n }\n save() {\n this.authUserService.changePhone(this.phone, this.code).subscribe({\n next: (res) => {\n this.snackBarService.open('修改成功');\n },\n error: (error) => {\n this.snackBarService.open(error.message);\n },\n });\n }\n}\n","<div>\n <div class=\"px-3 max-w-[1120px] m-auto\">\n <div class=\"flex items-center\">\n <div class=\"flex items-center justify-center w-11 h-11 cursor-pointer\" rolatechBackButton>\n <mat-icon>arrow_back</mat-icon>\n </div>\n <span class=\"text-xl font-medium\">修改手机号</span>\n </div>\n </div>\n <div class=\"px-4\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"max-w-[1120px] m-auto px-6\">\n <p class=\"text-md my-3\">手机号是您在本站的唯一标识, 更改后将同时更改第三方绑定的手机号</p>\n <div class=\"flex flex-col mt-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> 手机号 </mat-label>\n <input matInput [(ngModel)]=\"phone\" required />\n </mat-form-field>\n <div class=\"flex justify-between items-start gap-3\">\n <mat-form-field appearance=\"fill\">\n <mat-label> 验证码 </mat-label>\n <input matInput [(ngModel)]=\"code\" required />\n </mat-form-field>\n <button\n (click)=\"sendSMSCode()\"\n [disabled]=\"countDown\"\n [ngClass]=\"countDown ? 'bg-orange-300' : 'bg-orange-600 shadow shadow-gray-300 cursor-pointer'\"\n class=\"w-[128px] p-2 mt-2 text-white rounded text-center\"\n >\n <span class=\"text-sm\">{{ showButtonText }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>取消</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-[128px] p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n 保存\n </button>\n </div>\n </div>\n</div>\n"],"names":["i2"],"mappings":";;;;;;;;;;;;;;AAcM,MAAO,cAAe,SAAQ,aAAa,CAAA;AAPjD,IAAA,WAAA,GAAA;;AAQE,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;QAE1C,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;QACX,IAAI,CAAA,IAAA,GAAG,EAAE,CAAC;QACV,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;QAClB,IAAa,CAAA,aAAA,GAAG,EAAE,CAAC;QACnB,IAAc,CAAA,cAAA,GAAG,OAAO,CAAC;AA0C1B,KAAA;IAxCC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC;AAClC,YAAA,IAAI,EAAE,CAAC,GAAG,KAAI;AACZ,gBAAA,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;aACxB;AACF,SAAA,CAAC,CAAC;KACJ;IAED,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;AACtB,QAAA,MAAM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1B,SAAS;iCACI,IAAI,EAAA,OAAA,EACP,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,mBAAmB,CAAC,EAAA,QAAA,EAClE,wBAAwB,EAAA,QAAA,EAAA,w3DAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,CAAA;;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Component } from '@angular/core';
|
|
3
|
-
import { AuthUserService } from '@rolatech/angular-auth';
|
|
4
|
-
import { AngularCommonModule } from '@rolatech/angular-common';
|
|
5
|
-
import { BaseComponent, AngularComponentsModule } from '@rolatech/angular-components';
|
|
6
|
-
import { BackButtonDirective } from '@rolatech/angular-services';
|
|
7
|
-
import * as i1 from '@angular/forms';
|
|
8
|
-
import * as i2 from '@angular/material/button';
|
|
9
|
-
import * as i3 from '@angular/material/form-field';
|
|
10
|
-
import * as i4 from '@angular/material/input';
|
|
11
|
-
|
|
12
|
-
class ProfileComponent extends BaseComponent {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.authUserService = inject(AuthUserService);
|
|
16
|
-
this.name = '';
|
|
17
|
-
}
|
|
18
|
-
ngOnInit() {
|
|
19
|
-
this.authUserService.me().subscribe({
|
|
20
|
-
next: (res) => {
|
|
21
|
-
this.name = res.name;
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
save() {
|
|
26
|
-
this.authUserService.changeName(this.name).subscribe({
|
|
27
|
-
next: (res) => {
|
|
28
|
-
this.snackBarService.open('修改成功');
|
|
29
|
-
},
|
|
30
|
-
error: (error) => {
|
|
31
|
-
this.snackBarService.open(error.message);
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.3", type: ProfileComponent, isStandalone: true, selector: "rolatech-account-profile", usesInheritance: true, ngImport: i0, template: "<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] p-4\">\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">\u4FEE\u6539\u59D3\u540D</p>\n <p class=\"text-md\">\u7528\u6237\u540D\u662F\u60A8\u5728\u672C\u7AD9\u7684\u7B80\u79F0, \u53EF\u4EE5\u662F\u771F\u5B9E\u59D3\u540D, \u4E5F\u53EF\u4EE5\u662F\u6635\u79F0</p>\n </div>\n <div class=\"flex flex-col\">\n <mat-form-field appearance=\"fill\">\n <input matInput [(ngModel)]=\"name\" />\n </mat-form-field>\n </div>\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>\u53D6\u6D88</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-20 p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n \u4FDD\u5B58\n </button>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: BackButtonDirective, selector: "[rolatechBackButton]" }] }); }
|
|
37
|
-
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: ProfileComponent, decorators: [{
|
|
39
|
-
type: Component,
|
|
40
|
-
args: [{ standalone: true, imports: [AngularCommonModule, AngularComponentsModule, BackButtonDirective], selector: 'rolatech-account-profile', template: "<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] p-4\">\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">\u4FEE\u6539\u59D3\u540D</p>\n <p class=\"text-md\">\u7528\u6237\u540D\u662F\u60A8\u5728\u672C\u7AD9\u7684\u7B80\u79F0, \u53EF\u4EE5\u662F\u771F\u5B9E\u59D3\u540D, \u4E5F\u53EF\u4EE5\u662F\u6635\u79F0</p>\n </div>\n <div class=\"flex flex-col\">\n <mat-form-field appearance=\"fill\">\n <input matInput [(ngModel)]=\"name\" />\n </mat-form-field>\n </div>\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>\u53D6\u6D88</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-20 p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n \u4FDD\u5B58\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
41
|
-
}] });
|
|
42
|
-
|
|
43
|
-
export { ProfileComponent };
|
|
44
|
-
//# sourceMappingURL=rolatech-angular-account-profile.component-CJfmQ3Ba.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolatech-angular-account-profile.component-CJfmQ3Ba.mjs","sources":["../../../../libs/angular-account/src/lib/pages/myaccount/personal-info/profile/profile.component.ts","../../../../libs/angular-account/src/lib/pages/myaccount/personal-info/profile/profile.component.html"],"sourcesContent":["import { Component, OnInit, inject } from '@angular/core';\nimport { AuthUserService } from '@rolatech/angular-auth';\nimport { AngularCommonModule } from '@rolatech/angular-common';\nimport { AngularComponentsModule, BaseComponent } from '@rolatech/angular-components';\nimport { BackButtonDirective } from '@rolatech/angular-services';\nimport { Observable } from 'rxjs';\n\n@Component({\n standalone: true,\n imports: [AngularCommonModule, AngularComponentsModule, BackButtonDirective],\n selector: 'rolatech-account-profile',\n templateUrl: './profile.component.html',\n styleUrls: ['./profile.component.scss'],\n})\nexport class ProfileComponent extends BaseComponent implements OnInit {\n authUserService = inject(AuthUserService);\n user$!: Observable<any>;\n name = '';\n\n ngOnInit(): void {\n this.authUserService.me().subscribe({\n next: (res) => {\n this.name = res.name;\n },\n });\n }\n\n save() {\n this.authUserService.changeName(this.name).subscribe({\n next: (res) => {\n this.snackBarService.open('修改成功');\n },\n error: (error) => {\n this.snackBarService.open(error.message);\n },\n });\n }\n}\n","<div class=\"max-w-[1120px] m-auto\">\n <div class=\"max-w-[820px] p-4\">\n <div class=\"flex flex-col justify-center items-center p-3 mb-12\">\n <p class=\"text-3xl\">修改姓名</p>\n <p class=\"text-md\">用户名是您在本站的简称, 可以是真实姓名, 也可以是昵称</p>\n </div>\n <div class=\"flex flex-col\">\n <mat-form-field appearance=\"fill\">\n <input matInput [(ngModel)]=\"name\" />\n </mat-form-field>\n </div>\n <div class=\"flex justify-end items-center mt-3\">\n <button mat-button rolatechBackButton>取消</button>\n <button\n class=\"bg-orange-600 shadow shadow-gray-300 cursor-pointer w-20 p-2 text-white rounded text-center ml-3\"\n (click)=\"save()\"\n >\n 保存\n </button>\n </div>\n </div>\n</div>\n"],"names":[],"mappings":";;;;;;;;;;;AAcM,MAAO,gBAAiB,S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