Browse Source

个人信息

pengjing 9 months ago
parent
commit
ecb83d17c7

+ 0 - 24
parth5/parth5/src/app/views/tapp/tab-main/tab-main.page.spec.ts

@@ -1,24 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { TabMainPage } from './tab-main.page';
-
-describe('TabMainPage', () => {
-  let component: TabMainPage;
-  let fixture: ComponentFixture<TabMainPage>;
-
-  beforeEach(waitForAsync(() => {
-    TestBed.configureTestingModule({
-      declarations: [ TabMainPage ],
-      imports: [IonicModule.forRoot()]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(TabMainPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  }));
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 2 - 10
parth5/parth5/src/app/views/tapp/tab-user/tab-user-routing.module.ts

@@ -1,14 +1,6 @@
 import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { TabUserPage } from './tab-user.page';
-
-const routes: Routes = [
-  {
-    path: '',
-    component: TabUserPage
-  }
-];
+import { RouterModule } from '@angular/router';
+import { routes } from './tab-user.routes'
 
 @NgModule({
   imports: [RouterModule.forChild(routes)],

+ 6 - 2
parth5/parth5/src/app/views/tapp/tab-user/tab-user.module.ts

@@ -6,7 +6,11 @@ import { IonicModule } from '@ionic/angular';
 
 import { TabUserPageRoutingModule } from './tab-user-routing.module';
 
-import { TabUserPage } from './tab-user.page';
+import { routes } from "./tab-user.routes";
+
+const pubComponents = [
+
+];
 
 @NgModule({
   imports: [
@@ -15,6 +19,6 @@ import { TabUserPage } from './tab-user.page';
     IonicModule,
     TabUserPageRoutingModule
   ],
-  declarations: [TabUserPage]
+  declarations: [...routes.map(e => e.component), ...pubComponents]
 })
 export class TabUserPageModule {}

+ 109 - 7
parth5/parth5/src/app/views/tapp/tab-user/tab-user.page.html

@@ -1,9 +1,111 @@
-<ion-header>
-  <ion-toolbar>
-    <ion-title>tab_User</ion-title>
-  </ion-toolbar>
-</ion-header>
-
 <ion-content>
-
+  <div class="mine-toolbar">
+    <div class="info-img">
+      <img class="img-user" src="{{webServerHost}}/appApi/home/showDbImg/{{user.userid}}" onerror="this.src='assets/icon/icon-user-2x.png'"/>
+    </div>
+    <div class="info-text">
+      <div class="info-text-name">{{user?.username}}</div>
+      <div class="info-text-dp">{{roleName}}</div>
+      <div class="info-text-pt">积分 {{userPoints?.GETPOINT}}</div>
+    </div>
+    <div class="btn-role" (click)="btnRoles(selectRoles)">
+      <img src="assets/icon/icon-change.png"/>
+      切换角色
+    </div>
+  </div>
+  <div class="panel">
+    <div class="panel-title">
+      我的组织
+    </div>
+    <div class="panel-content user-panel">
+      <ion-label class="user-panel-item">
+        <div class="font-color item-label">
+          <div class="item-flag"></div>
+          所在党委
+        </div>
+        <ion-text class="item-text"><h3>{{dataModel.dwname}}</h3></ion-text>
+      </ion-label>
+      <ion-label class="user-panel-item">
+        <div class="font-color item-label">
+          <div class="item-flag"></div>
+          所在支部
+        </div>
+        <ion-text class="item-text"><h3>{{dataModel.dzzmc}}</h3></ion-text>
+      </ion-label>
+    </div>
+    <div class="panel-content user-panel">
+      <ion-label class="user-panel-item">
+        <div class="font-color item-label">
+          <div class="item-flag"></div>
+          入党时间
+        </div>
+        <ion-text class="item-text"><h3>{{dataModel.rdsj}}</h3></ion-text>
+      </ion-label>
+      <ion-label class="user-panel-item">
+        <div class="font-color item-label">
+          <div class="item-flag"></div>
+          政治面貌
+        </div>
+        <ion-text class="item-text"><h3>{{dataModel.ryztmc}}</h3></ion-text>
+      </ion-label>
+    </div>
+    <div *ngIf="dataModel.contactpoint != '' && dataModel.contactpoint != null" class="panel-content user-panel">
+      <ion-label class="user-panel-item" style="flex: 0 0 100%;">
+        <div class="font-color item-label">
+          <div class="item-flag"></div>
+          领导班子成员联系点
+        </div>
+        <ion-text class="item-text"><h3>{{dataModel.contactpoint}}</h3></ion-text>
+      </ion-label>
+    </div>
+  </div>
+  <div class="panel">
+    <div class="panel-title">
+      <div>
+        我的党费
+        <span class="sub-title">({{duesInfo.year}}年缴费记录,每月应缴{{duesInfo.money==null?0:duesInfo.money}}元)</span>
+      </div>
+    </div>
+    <div class="panel-content fee-panel">
+      <div class="fee-box">
+        <div class="box-item" *ngFor="let item of duesList">
+          <img *ngIf="item.ISHAV>0" class="box-item-flag" src="assets/icon/icon-feeflag.svg">
+          <span [ngClass]="item.ISHAV>0?'box-item-text':''" >{{item.MONTH}}月</span>
+        </div>
+      </div>
+    </div>
+  </div>
+  <ion-list>
+    <ion-item class="item-menu" routerLink="./partyUser/detail" [queryParams]="{rybm:dataModel.rybm}" detail>
+      <img src="assets/icon/icon-mine-userinfo.png" slot="start">
+      <ion-label>个人信息</ion-label>
+    </ion-item>
+    <ion-item class="item-menu" detail>
+      <img src="assets/icon/icon-mine-democracy.png" slot="start">
+      <ion-label>民主评议</ion-label>
+    </ion-item>
+    <ion-item class="item-menu" detail>
+      <img src="assets/icon/icon-mine-train.png" slot="start">
+      <ion-label>培训情况</ion-label>
+    </ion-item>
+    <ion-item class="item-menu" detail>
+      <img src="assets/icon/icon-mine-reward.png" slot="start">
+      <ion-label>评先情况</ion-label>
+    </ion-item>
+    <ion-item class="item-menu" detail>
+      <img src="assets/icon/icon-mine-punish.png" slot="start">
+      <ion-label>纪律处分情况</ion-label>
+    </ion-item>
+    <ion-item class="item-menu" detail>
+      <img src="assets/icon/icon-mine-help.png" slot="start">
+      <ion-label>党内关怀帮扶信息</ion-label>
+    </ion-item>
+    <ion-item [hidden]="true" class="item-menu">
+      <img src="assets/icon/change-role.svg" slot="start">
+      <ion-label>切换角色</ion-label>
+      <ion-select slot="end" #selectRoles class="roles-select" [value]="curRoleId" okText="确定" cancelText="取消" (ionChange)="RoleChange($event)">
+        <ion-select-option [value]="r.roleid" *ngFor="let r of userRoles">{{r.rolename}}</ion-select-option>
+      </ion-select>
+    </ion-item>
+  </ion-list>
 </ion-content>

+ 162 - 0
parth5/parth5/src/app/views/tapp/tab-user/tab-user.page.scss

@@ -0,0 +1,162 @@
+.mine-toolbar{
+  background-image: url("../../../../assets/icon/user-bg.png");
+  background-repeat:no-repeat;
+  background-size: 100% 100%;
+  height: 130px;
+  display: flex;
+  align-items: center;
+  .info-img{
+    flex: 0 0 25%;
+    text-align: center;
+    margin-left: 30px;
+    margin-top: 3px;
+    img{
+      height: 100px;
+      width: 80px;
+      border-radius: 10px;
+      margin-top: 10px;
+    }
+  }
+  .info-text{
+    flex: 1;
+    flex-direction: column;
+    margin-top: 10px;
+    color:var(--ion-color-primary-contrast);
+    .info-text-name{
+      font-size:20px;
+
+    }
+    .info-text-dp{
+      font-size: 16px;
+      opacity: 0.5;
+
+      color: white !important;
+    }
+    .info-text-pt{
+      font-size: 16px;
+
+      color: white !important;
+    }
+    div {
+      padding-left: 5px;
+      margin-top: 5px;
+    }
+  }
+  .btn-role{
+    img{
+      height: 11px;
+    }
+    margin-right: 20px;
+    /*margin-bottom: 20px;*/
+    color: white;
+    border-radius: 20px;
+    background-color: rgba(255, 255, 255, 0.2);
+    padding: 2px 10px 3px 10px;
+    font-size: 14px;
+    margin-top: 10px;
+  }
+}
+
+ion-content {
+  --background: white !important;
+}
+
+.item-menu{
+  img{
+    width: 24px;
+    height: 24px;
+  }
+}
+
+.fee-panel {
+  overflow: hidden;
+  background-color: #DB4E3E;
+  padding: 10px 5px;
+  background: linear-gradient(to right,#DB4E3E 80%,#8d8181);
+
+  .fee-box {
+    white-space: nowrap; /*文本不会换行,文本会在在同一行上继续*/
+    overflow-y: auto; /*可滑动*/
+
+    .box-item {
+      width: 50px;
+      height: 50px;
+      background: #fff;
+      display: inline-block;
+      border-radius: 8px;
+      line-height: 60px;
+      text-align: center;
+      font-size: 18px;
+      margin: 0 7px;
+
+      .box-item-flag{
+        float: right;
+        height: 20px;
+        border-top-right-radius: 8px;
+      }
+
+      .box-item-text{
+        position: relative;
+        right: -9px;
+      }
+    }
+  }
+
+  /*自定义滚动条的伪对象选择器, CSS 可以隐藏滚动条*/
+  .fee-box::-webkit-scrollbar {
+    display: none;
+  }
+}
+
+.user-panel {
+  display: flex;
+  /*background-color: #FAFAFA;*/
+  padding: 0px;
+  margin-top: 5px;
+  justify-content: space-between;
+
+  .user-panel-item {
+    flex: 0 0 49%;
+    background-color: #FAFAFA;
+    border-radius: 10px;
+    padding: 5px;
+
+
+    .item-label{
+      display: flex;
+      margin-bottom: 6px;
+      .item-flag{
+        height: 15px;
+        width: 4px;
+        border-radius: 8px;
+        margin-top: 4px;
+        margin-right: 7px;
+        background: linear-gradient(to bottom,#fdfde8,#DE4F3F);
+      }
+    }
+
+    .item-text{
+      color: #998989;
+      margin-top: 10px;
+    }
+  }
+
+}
+
+.roles-select{
+  max-width: 60%;
+}
+
+ion-list{
+  padding: 0px;
+  ion-item{
+    --min-height: 42px;
+    ion-label{
+      margin: 0px;
+    }
+  }
+}
+.img-points {
+  width: 22px;height: 22px;
+  vertical-align: middle;
+}

+ 0 - 24
parth5/parth5/src/app/views/tapp/tab-user/tab-user.page.spec.ts

@@ -1,24 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { TabUserPage } from './tab-user.page';
-
-describe('TabUserPage', () => {
-  let component: TabUserPage;
-  let fixture: ComponentFixture<TabUserPage>;
-
-  beforeEach(waitForAsync(() => {
-    TestBed.configureTestingModule({
-      declarations: [ TabUserPage ],
-      imports: [IonicModule.forRoot()]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(TabUserPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  }));
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 79 - 2
parth5/parth5/src/app/views/tapp/tab-user/tab-user.page.ts

@@ -1,4 +1,9 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+import {ConfigService, RequsetData} from "../../../service/config.service";
+import {UserService} from "../../../service/user.service";
+import {WorkService} from "../../../service/work.service";
+import {UsemodularService} from "../../../service/usemodular.service";
+import {Router} from "@angular/router";
 
 @Component({
   selector: 'app-tab-user',
@@ -7,9 +12,81 @@ import { Component, OnInit } from '@angular/core';
 })
 export class TabUserPage implements OnInit {
 
-  constructor() { }
+  getDataUrl: string = '/appApi/party/getUserInfo';
+  getUserduesUrl: string = '/appApi/party/getUserDuesInfo';
+  dataModel: any = {};
+  user: any = {};
+  duesInfo: any = {};
+  userPoints: any = {GETPOINT: 0};
+  duesList: any = [];
+  userRoles: any[] = [];
+  curRoleId: string = '';
+  roleName: string = '';
+  webServerHost: string = '';
+
+  constructor(private router: Router, private configService: ConfigService, private userService: UserService, private usemodularService: UsemodularService, private workService: WorkService) {
+
+  }
 
   ngOnInit() {
+    this.configService.GetConfig().subscribe((config) => {
+      this.webServerHost = config.webServerHost;
+    });
+    this.user = this.userService.GetUser();
+    this.userRoles = this.userService.GetExt().userRoles;
+    this.curRoleId = this.user.curRoleId;
+    this.getRoleName();
+    this.getData();
+    this.getUserdues();
+  }
+
+  ionViewWillEnter(): void {
+
+  }
+
+  getData() {
+    this.configService.HttpGetRomote(this.getDataUrl, {
+      rybm: this.userService.GetUser().userid
+    }).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.dataModel = data.item;
+      }
+    });
+  }
+
+  getUserdues() {
+    this.configService.HttpGetRomote(this.getUserduesUrl, {
+      rybm: this.userService.GetUser().userid,
+      year: new Date().getFullYear()
+    }).subscribe((data: RequsetData) => {
+      if (data.success) {
+        this.duesInfo = data.item;
+        this.duesList = data.extdata.userMonthList;
+      }
+    });
+  }
+
+  RoleChange(e) {
+    this.user.curRoleId = e.detail.value;
+    this.userService.SetUser(this.user);
+    this.getRoleName();
+    this.userService.ReadUserDataScope(this.user.curRoleId, this.configService).then((data) => {
+      this.workService.getWorkSettingList();
+    });
+    this.usemodularService.getUseModularList();
+    this.usemodularService.getModularDataList();
+    this.usemodularService.getButtonList();
+    console.log("RoleChange,value:" + e.detail.value);
+    //this.router.navigateByUrl('/main/tabs/tab1');
+  }
+
+  btnRoles(e) {
+    e.el.open().then(a => {
+    });
+  }
+
+  getRoleName() {
+    this.roleName = this.userRoles.filter(it => it.roleid == this.user.curRoleId)[0].rolename;
   }
 
 }

+ 11 - 0
parth5/parth5/src/app/views/tapp/tab-user/tab-user.routes.ts

@@ -0,0 +1,11 @@
+import {Routes} from "@angular/router";
+import {TabUserPage} from "./tab-user.page";
+import partyUserRoutes from "../../../routes/partyUser";
+
+export const routes: Routes = [
+  {
+    path: '',
+    component: TabUserPage
+  },
+  ...partyUserRoutes,
+];