Commit 8b06b756 authored by 伊藤雄大's avatar 伊藤雄大

2024/07/10

データアクセス用Service追加(内部はダミー)
parent 6b3dff08
{ {
"typescript.preferences.autoImportFileExcludePatterns": ["@ionic/angular/common", "@ionic/angular/standalone"] "files.exclude": {
} "amplify/.config": true,
"amplify/**/*-parameters.json": true,
"amplify/**/amplify.state": true,
"amplify/**/transform.conf.json": true,
"amplify/#current-cloud-backend": true,
"amplify/backend/amplify-meta.json": true,
"amplify/backend/awscloudformation": true
},
"typescript.preferences.autoImportFileExcludePatterns": [
"@ionic/angular/common",
"@ionic/angular/standalone"
]
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
"@angular/platform-browser": "^18.0.0", "@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0", "@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0", "@angular/router": "^18.0.0",
"@aws-amplify/ui-angular": "^5.0.16",
"@capacitor/app": "6.0.0", "@capacitor/app": "6.0.0",
"@capacitor/core": "6.1.0", "@capacitor/core": "6.1.0",
"@capacitor/haptics": "6.0.0", "@capacitor/haptics": "6.0.0",
"@capacitor/keyboard": "6.0.1", "@capacitor/keyboard": "6.0.1",
"@capacitor/status-bar": "6.0.0", "@capacitor/status-bar": "6.0.0",
"@ionic/angular": "^8.0.0", "@ionic/angular": "^8.0.0",
"aws-amplify": "^6.4.0",
"bootstrap": "^5.3.3", "bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3", "bootstrap-icons": "^1.11.3",
"ionicons": "^7.0.0", "ionicons": "^7.0.0",
......
...@@ -9,7 +9,11 @@ import { AppRoutingModule } from './app-routing.module'; ...@@ -9,7 +9,11 @@ import { AppRoutingModule } from './app-routing.module';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule], imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule
],
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }], providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { CardService } from '../services/card.service';
import { CreditCardModel } from '../model/credit-card.model';
/** /**
* クレジットカード登録画面 * クレジットカード登録画面
...@@ -36,8 +38,9 @@ export class CardRegistPage { ...@@ -36,8 +38,9 @@ export class CardRegistPage {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param cardService クレジットカードサービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private cardService: CardService) { }
/** /**
* 閉じる * 閉じる
...@@ -51,6 +54,15 @@ export class CardRegistPage { ...@@ -51,6 +54,15 @@ export class CardRegistPage {
* @param event イベント * @param event イベント
*/ */
onClickAddCard(event: any): void { onClickAddCard(event: any): void {
//クレジットカード登録
let model: CreditCardModel = new CreditCardModel();
model.cardNumber = this.cardMonth ? this.cardMonth : "";
model.cardOwner = this.cardOwner ? this.cardOwner : "";
model.cardMonth = this.cardMonth ? this.cardMonth : "";
model.cardYear = this.cardYear ? this.cardYear : "";
model.cvc = this.cvc ? this.cvc : "";
this.cardService.regist(this.routeService.customerId, model);
this.routeService.navigateCardSelect(); this.routeService.navigateCardSelect();
} }
} }
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
<td style="width:75%;padding-top:10px;padding-left:10px;"> <td style="width:75%;padding-top:10px;padding-left:10px;">
<span>クレジットカード</span> <span>クレジットカード</span>
</td> </td>
<!-- td style="padding-top:10px;"> <td style="padding-top:10px;">
<div class="common-link" (click)="onClickPass()">定期券</div> <div class="common-link" (click)="onClickPass()">定期券</div>
</td --> </td>
<td align="right" style="padding-top:10px;padding-right:10px;"> <td align="right" style="padding-top:10px;padding-right:10px;">
<i class="bi bi-trash3" (click)="onClickTrash()"></i> <i class="bi bi-trash3" (click)="onClickTrash()"></i>
</td> </td>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { CreditCardModel } from '../model/credit-card.model'; import { CreditCardModel } from '../model/credit-card.model';
import { CardService } from '../services/card.service';
/** /**
* クレジットカード選択 * クレジットカード選択
...@@ -15,30 +16,25 @@ export class CardSelectPage implements OnInit { ...@@ -15,30 +16,25 @@ export class CardSelectPage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス
* @param cardService クレジットカードサービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private cardService: CardService) { }
/** /**
* 初期化 * 初期化
*/ */
ngOnInit(): void { ngOnInit(): void {
this.cardList = new Array(); this.cardList = this.cardService.getList(this.routeService.customerId);
for (let i = 0; i < 2; i++) {
let model: CreditCardModel = new CreditCardModel();
let value = 1234 + i;
model.cardNumber = String(value);
model.cardOwner = "TARO YAMADA";
model.cardYear = "2023";
model.cardMonth = "02";
this.cardList.push(model);
}
} }
/** /**
* 戻る * 戻る
*/ */
onClickBack(): void { onClickBack(): void {
this.routeService.navigateMenu(); if (this.routeService.customerId) {
this.routeService.navigateMenu(this.routeService.customerId);
}
} }
/** /**
...@@ -53,7 +49,7 @@ export class CardSelectPage implements OnInit { ...@@ -53,7 +49,7 @@ export class CardSelectPage implements OnInit {
* @param model クレジットカード情報 * @param model クレジットカード情報
*/ */
onClickPass(model: CreditCardModel): void { onClickPass(model: CreditCardModel): void {
this.routeService.navigatePassSelect(model.cardNumber); this.routeService.navigatePassSelect(model.tokenId, model.cardNumber);
} }
/** /**
...@@ -61,6 +57,6 @@ export class CardSelectPage implements OnInit { ...@@ -61,6 +57,6 @@ export class CardSelectPage implements OnInit {
* @param model クレジットカード情報 * @param model クレジットカード情報
*/ */
onClickTrash(model: CreditCardModel): void { onClickTrash(model: CreditCardModel): void {
this.cardService.delete(model.tokenId);
} }
} }
...@@ -46,6 +46,8 @@ export class HeaderComponent { ...@@ -46,6 +46,8 @@ export class HeaderComponent {
* 利用者情報更新 * 利用者情報更新
*/ */
onClickSetting(): void { onClickSetting(): void {
this.routeService.navigateUserRegist(); if (this.routeService.customerId) {
this.routeService.navigateUserRegist(1, this.routeService.customerId);
}
} }
} }
...@@ -2,6 +2,7 @@ import { Component, OnInit, QueryList, ViewChildren } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
import { DenyListModel } from '../model/deny-list.model'; import { DenyListModel } from '../model/deny-list.model';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { DenyInfoComponent } from './component/deny-info/deny-info.component'; import { DenyInfoComponent } from './component/deny-info/deny-info.component';
import { DenylistService } from '../services/denylist.service';
@Component({ @Component({
selector: 'app-deny-list', selector: 'app-deny-list',
...@@ -28,24 +29,16 @@ export class DenyListPage implements OnInit { ...@@ -28,24 +29,16 @@ export class DenyListPage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param denyListService 拒否リストサービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private denyListService: DenylistService) { }
/** /**
* 初期化 * 初期化
*/ */
ngOnInit() { ngOnInit() {
this.denyList = new Array(); if (this.routeService.customerId) {
for (let i = 0; i < 4; i++) { this.denyList = this.denyListService.getList(this.routeService.customerId);
let denyListModel = new DenyListModel();
let str = String(i);
denyListModel.getonStopId = str;
denyListModel.getonStopName = "XXXX停留所";
denyListModel.getoffStopName = "YYYYY停留所";
denyListModel.getonDt = "2024/06/20 10:00:01";
denyListModel.getoffDt = "2024/06/20 10:30:02";
denyListModel.amount = 1000;
this.denyList.push(denyListModel);
} }
} }
...@@ -53,7 +46,9 @@ export class DenyListPage implements OnInit { ...@@ -53,7 +46,9 @@ export class DenyListPage implements OnInit {
* 戻る * 戻る
*/ */
onClickBack(): void { onClickBack(): void {
this.routeService.navigateMenu(); if (this.routeService.customerId) {
this.routeService.navigateMenu(this.routeService.customerId);
}
} }
/** /**
...@@ -61,14 +56,19 @@ export class DenyListPage implements OnInit { ...@@ -61,14 +56,19 @@ export class DenyListPage implements OnInit {
*/ */
onClickDelreq(event: any): void { onClickDelreq(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
let req: DenyListModel[] = [];
this.denyInfoList?.forEach(child => { this.denyInfoList?.forEach(child => {
let model = child.getModel(); let model = child.getModel();
if (model.select) { if (model.select) {
//拒否リスト削除依頼 //拒否リスト削除依頼
req.push(model);
} }
}); });
this.denyListService.reqDelete(req);
}
if (this.routeService.customerId) {
this.routeService.navigateMenu(this.routeService.customerId);
} }
this.routeService.navigateMenu();
} }
} }
...@@ -3,16 +3,6 @@ ...@@ -3,16 +3,6 @@
</ion-header> </ion-header>
<ion-content [fullscreen]="true"> <ion-content [fullscreen]="true">
<ion-grid>
<ion-row>
<ion-col>
<div class="common-link" (click)="onClickPrev()"><前の10件</div>
</ion-col>
<ion-col class="ion-text-right">
<div class="common-link" (click)="onClickNext()">次の10件></div>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid style="margin-top:20px;"> <ion-grid style="margin-top:20px;">
@for (history of historyList;track history.getonoffDt) { @for (history of historyList;track history.getonoffDt) {
<ion-row> <ion-row>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { HistoryModel } from '../model/history.model'; import { HistoryModel } from '../model/history.model';
import { HistoryService } from '../services/history.service';
/** /**
* 乗車履歴閲覧画面 * 乗車履歴閲覧画面
...@@ -18,57 +19,25 @@ export class HistoryPage implements OnInit { ...@@ -18,57 +19,25 @@ export class HistoryPage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @parma historyService 乗降履歴サービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private historyService: HistoryService) { }
/** /**
* 初期化 * 初期化
*/ */
ngOnInit() { ngOnInit() {
this.historyList = new Array(); if (this.routeService.customerId) {
for (let i = 0; i < 10; i++) { this.historyList = this.historyService.getHistoryList(this.routeService.customerId);
let historyModel: HistoryModel = new HistoryModel();
let str = String(i);
historyModel.getonoffDt = "2024/06/19 17:08:1" + str;
historyModel.stopId = str;
if (i % 2 == 0) {
historyModel.kind = "1";
historyModel.stopName = "XXXX停留所";
historyModel.status = 1;
} else {
historyModel.kind = "2";
historyModel.stopName = "YYYY停留所";
historyModel.fare = 200;
historyModel.status = 1;
}
this.historyList.push(historyModel);
} }
let historyModel: HistoryModel = new HistoryModel();
historyModel.getonoffDt = "2024/06/19 17:10:10";
historyModel.kind = "1";
historyModel.stopName = "XXXX停留所";
historyModel.status = 0;
this.historyList.push(historyModel);
} }
/** /**
* 戻る * 戻る
*/ */
onClickBack(): void { onClickBack(): void {
this.routeService.navigateMenu(); if (this.routeService.customerId) {
} this.routeService.navigateMenu(this.routeService.customerId);
}
/**
* 前の10件
*/
onClickPrev(): void {
}
/**
* 次の10件
*/
onClickNext(): void {
} }
} }
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input label="メールアドレス" [value]="email"></ion-input> <ion-input type="email" label="メールアドレス" [(ngModel)]="email" [maxlength]="50"></ion-input>
</ion-item> </ion-item>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input type="password" label="パスワード" [value]="password"> <ion-input type="password" label="パスワード" [(ngModel)]="password" [maxlength]="20">
<ion-input-password-toggle slot="end"></ion-input-password-toggle> <ion-input-password-toggle slot="end"></ion-input-password-toggle>
</ion-input> </ion-input>
</ion-item> </ion-item>
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { LoginService } from '../services/login.service';
/** /**
* ログイン画面 * ログイン画面
...@@ -18,21 +19,35 @@ export class HomePage { ...@@ -18,21 +19,35 @@ export class HomePage {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param loginService ログイン処理サービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private loginService: LoginService) { }
/** /**
* ログイン * ログイン
*/ */
onClickLogin(): void { onClickLogin(): void {
this.routeService.navigateMenu(); if (!this.email) {
alert("メールアドレスが入力されていません")
return;
}
if (!this.password) {
alert("パスワードが入力されていません");
return;
}
if (this.loginService.login(this.email, this.password)) {
//TODO
this.routeService.navigateMenu("0000");
}
} }
/** /**
* 利用者登録 * 利用者登録
*/ */
onClickRegist(): void { onClickRegist(): void {
this.routeService.navigateUserRegist(); this.routeService.navigateUserRegist(0, "");
} }
/** /**
......
export class CommuterPassModel { export class CommuterPassModel {
//トークンID
tokenId?: string;
//事業者ID
agencyId: string = "";
//経路ID //経路ID
routeId: string = ""; routeId: string = "";
//経路名 //経路名
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
* クレジットカード情報 * クレジットカード情報
*/ */
export class CreditCardModel { export class CreditCardModel {
//カード番号(下4桁) //トークンID
tokenId?: string;
//カード番号(登録時全番号、それ以外下4桁)
cardNumber: string = ""; cardNumber: string = "";
//カード名義人 //カード名義人
...@@ -13,4 +16,7 @@ export class CreditCardModel { ...@@ -13,4 +16,7 @@ export class CreditCardModel {
//有効期限-月 //有効期限-月
cardMonth: string = ""; cardMonth: string = "";
//CVC
cvc: string = "";
} }
\ No newline at end of file
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { CommuterPassModel } from '../model/commuter-pass.model'; import { CommuterPassModel } from '../model/commuter-pass.model';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { PassService } from '../services/pass.service';
/** /**
* 定期券区間変更画面 * 定期券区間変更画面
...@@ -39,8 +40,9 @@ export class PassChangePage implements OnInit { ...@@ -39,8 +40,9 @@ export class PassChangePage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param passService 定期券サービス
*/ */
constructor(private routeService: RouteService) { constructor(private routeService: RouteService, private passService: PassService) {
this.cardNumber = routeService.cardNumber; this.cardNumber = routeService.cardNumber;
this.commuterPassModel = routeService.commuterPassModel; this.commuterPassModel = routeService.commuterPassModel;
} }
...@@ -50,10 +52,8 @@ export class PassChangePage implements OnInit { ...@@ -50,10 +52,8 @@ export class PassChangePage implements OnInit {
*/ */
ngOnInit(): void { ngOnInit(): void {
//停留所一覧 //停留所一覧
this.stopList = new Map(); if (this.commuterPassModel) {
for (let i = 0; i < 5; i++) { this.stopList = this.passService.getStopList(this.commuterPassModel?.agencyId, this.commuterPassModel?.routeId);
let str = String(i + 1);
this.stopList.set(str, "停留所" + str);
} }
} }
...@@ -70,6 +70,11 @@ export class PassChangePage implements OnInit { ...@@ -70,6 +70,11 @@ export class PassChangePage implements OnInit {
onClickChange(event: any): void { onClickChange(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//定期券区間変更 //定期券区間変更
if (this.commuterPassModel) {
this.commuterPassModel.getonStopId = this.getonStopId ? this.getonStopId : "";
this.commuterPassModel.getoffStopId = this.getoffStopId ? this.getoffStopId : "";
this.passService.change(this.commuterPassModel);
}
} }
this.routeService.navigatePassSelect(this.cardNumber); this.routeService.navigatePassSelect(this.cardNumber);
} }
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { CommuterPassModel } from '../model/commuter-pass.model'; import { CommuterPassModel } from '../model/commuter-pass.model';
import { PassService } from '../services/pass.service';
/** /**
* 定期券継続画面 * 定期券継続画面
...@@ -37,8 +38,9 @@ export class PassContinuePage implements OnInit { ...@@ -37,8 +38,9 @@ export class PassContinuePage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param passService 定期券サービス
*/ */
constructor(private routeService: RouteService) { constructor(private routeService: RouteService, private passService: PassService) {
this.cardNumber = routeService.cardNumber; this.cardNumber = routeService.cardNumber;
this.commuterPassModel = routeService.commuterPassModel; this.commuterPassModel = routeService.commuterPassModel;
} }
...@@ -48,10 +50,9 @@ export class PassContinuePage implements OnInit { ...@@ -48,10 +50,9 @@ export class PassContinuePage implements OnInit {
*/ */
ngOnInit(): void { ngOnInit(): void {
//使用期間一覧 //使用期間一覧
this.useTermList = new Map(); if (this.commuterPassModel) {
this.useTermList.set("1", "1ヶ月"); this.useTermList = this.passService.getUseTermList(this.commuterPassModel?.agencyId);
this.useTermList.set("2", "3ヶ月"); }
this.useTermList.set("6", "6ヶ月");
} }
/** /**
...@@ -67,6 +68,11 @@ export class PassContinuePage implements OnInit { ...@@ -67,6 +68,11 @@ export class PassContinuePage implements OnInit {
onClickContinue(event: any): void { onClickContinue(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//定期券継続 //定期券継続
if (this.commuterPassModel) {
this.commuterPassModel.useTermId = this.useTermId ? this.useTermId : "";
this.commuterPassModel.startDate = this.startDate ? this.startDate : "";
this.passService.continue(this.commuterPassModel);
}
} }
this.routeService.navigatePassSelect(this.cardNumber); this.routeService.navigatePassSelect(this.cardNumber);
} }
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CommuterPassModel } from '../model/commuter-pass.model'; import { CommuterPassModel } from '../model/commuter-pass.model';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { PassService } from '../services/pass.service';
/** /**
* 定期券払戻画面 * 定期券払戻画面
...@@ -39,8 +40,9 @@ export class PassRefundPage implements OnInit { ...@@ -39,8 +40,9 @@ export class PassRefundPage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param passService 定期券サービス
*/ */
constructor(private routeService: RouteService) { constructor(private routeService: RouteService, private passService: PassService) {
this.cardNumber = routeService.cardNumber; this.cardNumber = routeService.cardNumber;
this.commuterPassModel = routeService.commuterPassModel; this.commuterPassModel = routeService.commuterPassModel;
} }
...@@ -68,7 +70,10 @@ export class PassRefundPage implements OnInit { ...@@ -68,7 +70,10 @@ export class PassRefundPage implements OnInit {
*/ */
onClickRefund(event: any): void { onClickRefund(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//定期券継続 //定期券払戻
if (this.commuterPassModel) {
this.passService.refund(this.commuterPassModel);
}
} }
this.routeService.navigatePassSelect(this.cardNumber); this.routeService.navigatePassSelect(this.cardNumber);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-select label="路線" [value]="routeId"> <ion-select label="路線" [value]="routeId" (change)="onChangeRoute($event)">
@for (kv of routeList|keyvalue;track kv.key) { @for (kv of routeList|keyvalue;track kv.key) {
<ion-select-option value="kv.key">{{kv.value}}</ion-select-option> <ion-select-option value="kv.key">{{kv.value}}</ion-select-option>
} }
......
import { KeyValue } from '@angular/common'; import { KeyValue } from '@angular/common';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { CommuterPassModel } from '../model/commuter-pass.model';
import { PassService } from '../services/pass.service';
/** /**
* 定期券登録画面 * 定期券登録画面
...@@ -46,42 +48,41 @@ export class PassRegistPage implements OnInit { ...@@ -46,42 +48,41 @@ export class PassRegistPage implements OnInit {
getoffStopId?: string; getoffStopId?: string;
//支払金額 //支払金額
price: number = 0; price: number = 0;
//事業者ID
agencyId: string = "";
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param passService 定期券サービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private passService: PassService) { }
/** /**
* 初期化 * 初期化
*/ */
ngOnInit(): void { ngOnInit(): void {
//路線一覧 //路線一覧
this.routeList = new Map(); //TODO 事業者IDはどうやって決める?
for (let i = 0; i < 5; i++) { this.routeList = this.passService.getRouteList(this.agencyId);
let str = String(i + 1);
this.routeList.set(str, "路線" + str);
}
//使用期間一覧 //使用期間一覧
this.useTermList = new Map(); this.useTermList = this.passService.getUseTermList(this.agencyId);
this.useTermList.set("1", "1ヶ月");
this.useTermList.set("2", "3ヶ月");
this.useTermList.set("6", "6ヶ月");
//料金区分一覧 //料金区分一覧
this.priceRangeList = new Map(); this.priceRangeList = this.passService.getPriceRangeList(this.agencyId);
this.priceRangeList.set("1", "大人");
this.priceRangeList.set("2", "小児");
this.priceRangeList.set("3", "学生");
//停留所一覧 //停留所一覧
this.stopList = new Map(); this.stopList = this.passService.getStopList(this.agencyId, this.routeList.values().next().value);
for (let i = 0; i < 5; i++) { }
let str = String(i + 1);
this.stopList.set(str, "停留所" + str); /**
} * 路線選択
* @param event イベント情報
*/
onChangeRoute(event: any): void {
this.stopList = this.passService.getStopList(this.agencyId, event.target.value);
} }
/** /**
...@@ -97,6 +98,15 @@ export class PassRegistPage implements OnInit { ...@@ -97,6 +98,15 @@ export class PassRegistPage implements OnInit {
onClickAdd(event: any): void { onClickAdd(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//定期券登録 //定期券登録
let model: CommuterPassModel = new CommuterPassModel();
model.tokenId = this.routeService.tokenId;
model.routeId = this.routeId ? this.routeId : "";
model.startDate = this.startDate ? this.startDate : "";
model.useTermId = this.useTermId ? this.useTermId : "";
model.priceRangeId = this.priceRangeId ? this.priceRangeId : "";
model.getonStopId = this.getonStopId ? this.getonStopId : "";
model.getoffStopId = this.getoffStopId ? this.getoffStopId : "";
this.passService.regist(model);
} }
this.routeService.navigatePassSelect(this.routeService.cardNumber); this.routeService.navigatePassSelect(this.routeService.cardNumber);
} }
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CommuterPassModel } from '../model/commuter-pass.model'; import { CommuterPassModel } from '../model/commuter-pass.model';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { PassService } from '../services/pass.service';
/** /**
* 定期券選択画面 * 定期券選択画面
...@@ -19,8 +20,9 @@ export class PassSelectPage implements OnInit { ...@@ -19,8 +20,9 @@ export class PassSelectPage implements OnInit {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param passServiec 定期券サービス
*/ */
constructor(private routeService: RouteService) { constructor(private routeService: RouteService, private passService: PassService) {
this.cardNumber = routeService.cardNumber; this.cardNumber = routeService.cardNumber;
} }
...@@ -28,19 +30,8 @@ export class PassSelectPage implements OnInit { ...@@ -28,19 +30,8 @@ export class PassSelectPage implements OnInit {
* 初期化 * 初期化
*/ */
ngOnInit() { ngOnInit() {
this.commuterPassList = new Array(); if (this.routeService.tokenId) {
for (let i = 0; i < 2; i++) { this.commuterPassList = this.passService.getList(this.routeService.tokenId);
let model: CommuterPassModel = new CommuterPassModel();
model.routeId = "00000" + String(i);
model.routeName = "【◯◯◯系統】XXXXX→XXXXX行き";
model.startDate = "2024/07/01";
model.useTermId = "2";
model.useTermName = "3ヶ月";
model.priceRangeId = "0";
model.privateRangeName = "大人";
model.getonStopName = "XXXXX";
model.getoffStopName = "XXXXX";
this.commuterPassList.push(model);
} }
} }
......
...@@ -15,6 +15,15 @@ export class RouteService { ...@@ -15,6 +15,15 @@ export class RouteService {
//定期券情報 //定期券情報
commuterPassModel?: CommuterPassModel; commuterPassModel?: CommuterPassModel;
//モード
mode: number = 0;
//利用者ID
customerId?: string;
//トークンID
tokenId?: string;
/** /**
* コンストラクタ * コンストラクタ
* @param router Router * @param router Router
...@@ -30,8 +39,11 @@ export class RouteService { ...@@ -30,8 +39,11 @@ export class RouteService {
/** /**
* 利用者登録画面へ遷移 * 利用者登録画面へ遷移
* @param mode 0:登録、1:更新
*/ */
navigateUserRegist() { navigateUserRegist(mode: number, customerId: string) {
this.mode = mode;
this.customerId = customerId;
this.router.navigate(['user-regist']); this.router.navigate(['user-regist']);
} }
...@@ -45,7 +57,8 @@ export class RouteService { ...@@ -45,7 +57,8 @@ export class RouteService {
/** /**
* メニュー画面へ遷移 * メニュー画面へ遷移
*/ */
navigateMenu() { navigateMenu(customerId: string) {
this.customerId = customerId;
this.router.navigate(['menu']); this.router.navigate(['menu']);
} }
...@@ -67,7 +80,8 @@ export class RouteService { ...@@ -67,7 +80,8 @@ export class RouteService {
* 定期券選択画面へ遷移 * 定期券選択画面へ遷移
* @param cardNumber カード番号 * @param cardNumber カード番号
*/ */
navigatePassSelect(cardNumber?: string) { navigatePassSelect(tokenId?: string, cardNumber?: string) {
this.tokenId = tokenId;
this.cardNumber = cardNumber; this.cardNumber = cardNumber;
this.router.navigate(['pass-select']); this.router.navigate(['pass-select']);
} }
......
...@@ -7,21 +7,21 @@ ...@@ -7,21 +7,21 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input label="氏名" [value]="name"></ion-input> <ion-input type="text" label="氏名" [value]="name" [maxlength]="30"></ion-input>
</ion-item> </ion-item>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input label="フリガナ" [value]="nameKana"></ion-input> <ion-input type="text" label="フリガナ" [value]="nameKana" [maxlength]="30"></ion-input>
</ion-item> </ion-item>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input type="tel" label="電話番号" [value]="phoneNumber"></ion-input> <ion-input type="tel" label="電話番号" [value]="phoneNumber" [maxlength]="20"></ion-input>
</ion-item> </ion-item>
</ion-col> </ion-col>
</ion-row> </ion-row>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<ion-col> <ion-col>
@if (mode === 0) { @if (mode === 0) {
<ion-item> <ion-item>
<ion-input type="email" label="メールアドレス" [value]="email"></ion-input> <ion-input type="email" label="メールアドレス" [value]="email" [maxlength]="50"></ion-input>
</ion-item> </ion-item>
} @else { } @else {
<ion-label>メールアドレス</ion-label><ion-label>{{email}}</ion-label> <ion-label>メールアドレス</ion-label><ion-label>{{email}}</ion-label>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<ion-item> <ion-item>
<ion-input type="password" label="パスワード" [value]="password"> <ion-input type="password" label="パスワード" [value]="password" [maxlength]="20">
<ion-input-password-toggle slot="end"></ion-input-password-toggle> <ion-input-password-toggle slot="end"></ion-input-password-toggle>
</ion-input> </ion-input>
</ion-item> </ion-item>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { RouteService } from '../services/route.service'; import { RouteService } from '../services/route.service';
import { UserService } from '../services/user.service';
import { UserInfoModel } from '../model/user-info.model';
/** /**
* 利用者登録画面 * 利用者登録画面
...@@ -9,7 +11,7 @@ import { RouteService } from '../services/route.service'; ...@@ -9,7 +11,7 @@ import { RouteService } from '../services/route.service';
templateUrl: './user-regist.page.html', templateUrl: './user-regist.page.html',
styleUrls: ['./user-regist.page.scss'], styleUrls: ['./user-regist.page.scss'],
}) })
export class UserRegistPage { export class UserRegistPage implements OnInit {
//モード(0:登録、1:更新) //モード(0:登録、1:更新)
mode: number = 0; mode: number = 0;
//氏名 //氏名
...@@ -22,6 +24,8 @@ export class UserRegistPage { ...@@ -22,6 +24,8 @@ export class UserRegistPage {
email?: string; email?: string;
//パスワード //パスワード
password?: string; password?: string;
//利用者ID
customerId?: string;
public confirmButtons = [ public confirmButtons = [
{ {
...@@ -37,8 +41,26 @@ export class UserRegistPage { ...@@ -37,8 +41,26 @@ export class UserRegistPage {
/** /**
* コンストラクタ * コンストラクタ
* @param routeService 画面遷移サービス * @param routeService 画面遷移サービス
* @param userService 利用者情報サービス
*/ */
constructor(private routeService: RouteService) { } constructor(private routeService: RouteService, private userService: UserService) {
this.mode = routeService.mode;
this.customerId = routeService.customerId;
}
/**
* 初期処理
*/
ngOnInit(): void {
if (this.customerId) {
let model: UserInfoModel = this.userService.getInfo(this.customerId);
this.name = model.name;
this.nameKana = model.nameKana;
this.phoneNumber = model.phoneNumber;
this.email = model.email;
this.password = model.password;
}
}
/** /**
* 閉じる * 閉じる
...@@ -54,6 +76,13 @@ export class UserRegistPage { ...@@ -54,6 +76,13 @@ export class UserRegistPage {
onClickRegist(event: any): void { onClickRegist(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//利用者情報登録 //利用者情報登録
let model: UserInfoModel = new UserInfoModel();
model.name = this.name;
model.nameKana = this.nameKana;
model.phoneNumber = this.phoneNumber;
model.email = this.email;
model.password = this.password;
this.userService.regist(model);
} }
this.routeService.navigateHome(); this.routeService.navigateHome();
} }
...@@ -65,6 +94,14 @@ export class UserRegistPage { ...@@ -65,6 +94,14 @@ export class UserRegistPage {
onClickUpdate(event: any): void { onClickUpdate(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//利用者情報更新 //利用者情報更新
let model: UserInfoModel = new UserInfoModel();
model.customerId = this.customerId;
model.name = this.name;
model.nameKana = this.nameKana;
model.phoneNumber = this.phoneNumber;
model.email = this.email;
model.password = this.password;
this.userService.update(model);
} }
this.routeService.navigateHome(); this.routeService.navigateHome();
} }
...@@ -76,8 +113,10 @@ export class UserRegistPage { ...@@ -76,8 +113,10 @@ export class UserRegistPage {
onClickWithdraw(event: any): void { onClickWithdraw(event: any): void {
if (event.detail.role === 'confirm') { if (event.detail.role === 'confirm') {
//退会 //退会
if (this.customerId) {
this.userService.withdraw(this.customerId);
}
} }
this.routeService.navigateHome(); this.routeService.navigateHome();
} }
} }
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* (window as any).__Zone_enable_cross_context_check = true; * (window as any).__Zone_enable_cross_context_check = true;
* *
*/ */
import './zone-flags'; import './zone-flags';
/*************************************************************************************************** /***************************************************************************************************
...@@ -53,3 +53,8 @@ import 'zone.js'; // Included with Angular CLI. ...@@ -53,3 +53,8 @@ import 'zone.js'; // Included with Angular CLI.
/*************************************************************************************************** /***************************************************************************************************
* APPLICATION IMPORTS * APPLICATION IMPORTS
*/ */
(window as any).global = window;
(window as any).process = {
env: { DEBUG: undefined },
};
\ No newline at end of file
/* To learn more about this file see: https://angular.io/config/tsconfig. */ /* To learn more about this file see: https://angular.io/config/tsconfig. */
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"baseUrl": "./",
"outDir": "./out-tsc/app", "outDir": "./out-tsc/app",
"types": [] "sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"types": [
"node"
],
"module": "es2020",
"lib": [
"es2018",
"dom"
]
}, },
"files": [ "files": [
"src/main.ts", "src/main.ts",
...@@ -11,5 +27,11 @@ ...@@ -11,5 +27,11 @@
], ],
"include": [ "include": [
"src/**/*.d.ts" "src/**/*.d.ts"
] ],
} "angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment