coupon page

This commit is contained in:
CHIEFSOFT\ameye
2023-10-21 15:27:50 -04:00
parent 2f27f8f55e
commit 5eb5c65128
6 changed files with 70 additions and 24 deletions
+15 -4
View File
@@ -1,5 +1,5 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {AlertController, NavController} from "@ionic/angular";
import {AlertController, NavController, ToastController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -23,7 +23,9 @@ export class AddbankPage implements OnInit {
private router: Router,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService,
private alertController: AlertController)
private alertController: AlertController,
private toastController: ToastController
)
{
}
@@ -137,14 +139,23 @@ export class AddbankPage implements OnInit {
this.accountAddResult = accountAddResult;
console.log("accountAddResult RETURN->", this.accountAddResult);
if ( this.accountAddResult.internal_return != undefined && this.accountAddResult.internal_return > 0 ){
this.presentToast("Recipient Accound Added",'middle');
setTimeout(() => {
this.onBack();
}, 4000);
}, 3000);
}
}
);
}
async presentToast(message, position: 'top' | 'middle' | 'bottom') {
const toast = await this.toastController.create({
message: message,
duration: 1500,
position: position,
});
await toast.present();
}
}
+24 -12
View File
@@ -3,6 +3,7 @@ import {Component, OnInit, ViewChild} from '@angular/core';
import { WrenchService } from 'src/app/services/wrench.service';
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
import { BlogDataService } from 'src/app/store/blog-data.service';
import {AlertController} from "@ionic/angular";
@Component({
selector: 'app-forgot',
@@ -22,7 +23,8 @@ export class ForgotPage implements OnInit {
private router: Router,
private wrenchService: WrenchService,
public sessionDataProviderService:SessionDataProviderService,
public blogDataService:BlogDataService
public blogDataService:BlogDataService,
public alertController: AlertController
) {
}
@@ -39,7 +41,7 @@ export class ForgotPage implements OnInit {
this.reset_uid = '';
this.m_uid = '';
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false) {
this.showAlert('Invalid Login', 'Enter username(email) to continue');
this.showAlert('Error', 'Enter username(email) to continue');
return;
}
@@ -105,7 +107,7 @@ export class ForgotPage implements OnInit {
onCompleteReset(){
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false) {
this.showAlert('Invalid Login', 'Enter username(email) to continue');
this.showAlert('Error', 'Enter username(email) to continue');
return;
}
@@ -161,13 +163,23 @@ export class ForgotPage implements OnInit {
return re.test(email);
}
showAlert(mtitle: string, amessage: string) {
/* let alert = this.alertCtrl.create({
title: mtitle,
subTitle: amessage,
buttons: ['OK']
});
alert.present();*/
alert(amessage);
}
async showAlert(mtitle: string, amessage: string) {
const alert = await this.alertController.create({
header: 'WrenchBoard',
subHeader: mtitle,
message: amessage,
buttons: ['OK'],
});
await alert.present();
//
// let alert = this.alertCtrl.create({
// title: mtitle,
// subTitle: amessage,
// buttons: ['OK']
// });
// alert.present();
// // alert(amessage);
}
}
+6 -3
View File
@@ -43,12 +43,12 @@
<ion-label class="simp_lbl_tx">Login to continue</ion-label>
<ion-item lines="none">
<ion-icon slot="start" name="mail-outline"></ion-icon>
<ion-input type="email" placeholder="Email" [(ngModel)]='username'></ion-input>
<ion-input (ionChange)="refreshBut()" type="email" placeholder="Email" [(ngModel)]='username'></ion-input>
</ion-item>
<ion-item lines="none">
<ion-icon slot="start" name="lock-closed-outline"></ion-icon>
<ion-input type="password" placeholder="Password" [(ngModel)]='password'></ion-input>
<ion-input (ionChange)="refreshBut()" type="password" placeholder="Password" [(ngModel)]='password'></ion-input>
</ion-item>
<div class="check">
@@ -56,7 +56,10 @@
<ion-label>Remember me</ion-label>
</div>
<ion-button shape="round" expand="block" (click)="startLogin()">
<ion-button shape="round" expand="block"
(click)="startLogin()"
[disabled]="isDisabled"
>
Login
</ion-button>
<!-- <ion-button shape="round">Round</ion-button>-->
+12
View File
@@ -35,6 +35,7 @@ export class LoginPage implements OnInit {
state: any;
ios: boolean;
android: boolean;
isDisabled:boolean=true;
constructor(
private router: Router,
@@ -86,6 +87,17 @@ getBlogData(){
);
}
refreshBut(){
this.isDisabled = true;
if (
this.username != undefined
&& this.password !=undefined
&& String(this.username).length > 5
&& String(this.password).length > 5
){
this.isDisabled = false;
}
}
loginData: {
username: string, password: string, sessionid: string
};
+8 -5
View File
@@ -69,15 +69,16 @@
<div class="video" *ngFor="let item of myCouponPend">
<div class="left">
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/cert.png)'"></div>
<div class="text">
<ion-label class="bold_text">{{item.amount*0.01| number : '1.2-2'}} {{item.currency}} </ion-label>
<ion-label class="grey_text">{{item.code}} - {{item.added}}</ion-label>
<ion-label class="grey_text"><span class="lbc">ID:</span> {{item.code}}</ion-label>
<ion-label class="grey_text"><span class="lbc">Added:</span>{{item.added}}</ion-label>
</div>
</div>
<div class="right">
<ion-button color="secondary" (click)="startRedeem(item)">Redeem</ion-button>
<ion-button shape="round" size="small" color="secondary" (click)="startRedeem(item)">Redeem</ion-button>
</div>
</div>
@@ -97,11 +98,13 @@
<div class="video" *ngFor="let item of myCouponHx">
<div class="left">
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/cert.png)'"></div>
<div class="text">
<ion-label class="bold_text">{{item.amount*0.01| number : '1.2-2'}} {{item.currency}} </ion-label>
<ion-label class="grey_text">{{item.code}} - {{item.added}}</ion-label>
<ion-label class="grey_text"><span class="lbc">ID:</span> {{item.code}}</ion-label>
<ion-label class="grey_text"><span class="lbc">Added:</span>{{item.added |date}}</ion-label>
<ion-label class="grey_text"><span class="lbc">Redeemed:</span>{{item.active | date}}</ion-label>
</div>
</div>
<div class="right">
@@ -174,6 +174,11 @@ ion-card{
.grey_text {
font-size: 14px;
color: grey;
.lbc{
font-weight: bolder;
color: #4e4e89;
margin-right: 5px;
}
}
}
}