rounting issue fixed

This commit is contained in:
bitbucket 2023-06-01 18:20:30 +05:30
parent 34146c7a71
commit f1a72f8182
6 changed files with 72 additions and 19 deletions

View File

@ -28,6 +28,20 @@ export class BookingSummaryComponent implements OnInit {
constructor(public end_user:EndUserService,private router:Router,) {
this.logo = localStorage.getItem('logo')
this.busName = localStorage.getItem('busName')
this.end_user.bookedDetails_observable$.subscribe((res) => {
console.log('booked2', res);
if(res instanceof Array){
if(res.length == 0){
this.backRedireact()
}
}
})
this.end_user.summmarylist_observable$.subscribe((res) => {
console.log('booked', res);
if(res.length>0){

View File

@ -239,7 +239,7 @@
</mat-form-field>
<!-- </div> -->
<!-- <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="p-gap" fxLayoutAlign="center center"> -->
<mat-form-field style="width: 80%; ">
<mat-form-field style="width: 80%;display:none; ">
<input matInput placeholder="udf3" type="text" name="udf3" formControlName="udf3" >
</mat-form-field>

View File

@ -40,6 +40,7 @@ export class CustomerInfoComponent implements OnInit {
currency:any=[];
noChangeNo: any = 0;
private apiUrl = environment.apiEndpoint;
private apiUrlkey = environment;
logo: any;
formData:any =[];
url ="https://api.payaidpayments.com/v2/paymentrequest";
@ -50,6 +51,14 @@ export class CustomerInfoComponent implements OnInit {
constructor(private _location: Location,public dialog: MatDialog,private router: Router,private formBuilder: FormBuilder,public _cus:EndUserService, private ngZone: NgZone) {
this._cus.bookedDetails_observable$.subscribe((res) => {
console.log('booked2', res);
if(res instanceof Array){
if(res.length == 0){
this.backRedireact()
}
}
this.bookedDetails = res
console.log(this.bookedDetails)
@ -59,6 +68,16 @@ export class CustomerInfoComponent implements OnInit {
}
ngOnInit() {
if (performance.navigation.type === 1) {
console.log(0)
// This condition checks if the page is refreshed
// Type 1 represents a page reload event
// Redirect to another page using the Router navigate method
// this.router.navigate(['/booking/practitioner/lytv3lm']);
}
let URL = this.router.url;
console.log(URL)
let URL_AS_LIST = URL.split('/');
@ -109,13 +128,13 @@ export class CustomerInfoComponent implements OnInit {
return prefix + randomNum;
}
let payment = {
api_key: '4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
api_key: ''+this.apiUrlkey.payment_api_key+'',
hash: '',
amount: ""+this.bookedDetails.amount+"",
order_id: generateRandomString(),
description: 'testing',
mode: 'TEST',
return_url: 'http://localhost:8080/api/paymentResponse',
mode: ''+this.apiUrlkey.payment_mode+'',
return_url: this.apiUrl+'paymentResponse',
currency: 'INR',
country: 'IND',
udf1: ''+busId+'',
@ -325,10 +344,10 @@ export class CustomerInfoComponent implements OnInit {
console.log(URL_AS_LIST);
if(URL_AS_LIST[2] == 'practitioner'){
this.router.navigate(['booking/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]])
this.router.navigate(['/booking/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]])
console.log('practitioner')
}else{
this.router.navigate(['booking/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]])
this.router.navigate(['/booking/'+URL_AS_LIST[2]+'/'+URL_AS_LIST[3]])
console.log('Business')
}
}
@ -371,7 +390,8 @@ export class CustomerInfoComponent implements OnInit {
}else {
if(this.verifyOTP == 1){
let payment = {
api_key: "4cb964d4-9ef4-4a25-8f85-a2a13f43cbba",
// api_key: "4cb964d4-9ef4-4a25-8f85-a2a13f43cbba",
api_key: ''+this.apiUrlkey.payment_api_key+'',
hash: '',
amount: this.bookedDetails.amount,
name: row_obj.cusName,
@ -381,8 +401,8 @@ export class CustomerInfoComponent implements OnInit {
address_line_2: row_obj.address_1,
order_id: generateRandomString(),
description: 'testing',
mode: 'TEST',
return_url: 'http://localhost:8080/api/paymentResponse',
mode: ''+this.apiUrlkey.payment_mode+'',
return_url: this.apiUrl+'paymentResponse',
currency: 'INR',
country: 'IND',
zip_code: row_obj.pincode,
@ -455,6 +475,18 @@ this.paymentform = payment;
onclickfun(){
if(this.verifyOTP == 0){
this.getOTP(1)
}
if(!this.form.valid ){
return
}else {
if(this.verifyOTP == 1){
let URL = this.router.url;
let busId = localStorage.getItem('busId')
@ -471,11 +503,7 @@ onclickfun(){
console.log(addFormData)
function generateRandomString() {
const prefix = "ORD-";
const randomNum = (Math.random() + 1).toString(36).substring(7);
return prefix + randomNum;
}
this._cus.addCusDetails(addFormData).subscribe(async (res1) => {
if (res1.status == 200) {
@ -486,6 +514,9 @@ if (res1.status == 200) {
}
})
}
}
}
@ -550,13 +581,14 @@ let paramsmap= {
let appointmentId = res[0].id
let payment = {
api_key: '4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
// api_key: '4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
api_key: ''+this.apiUrlkey.payment_api_key+'',
hash: '',
amount: ""+this.bookedDetails.amount+"",
order_id: ''+bookingId+'',
description: 'testing',
mode: 'TEST',
return_url: 'http://localhost:8080/api/paymentResponse',
mode: ''+this.apiUrlkey.payment_mode+'',
return_url: this.apiUrl+'paymentResponse',
currency: 'INR',
country: 'IND',
udf1: ''+busId+'',

View File

@ -42,6 +42,7 @@
</div>
</div>
</div> -->
<div *ngIf="bookedAppointment.userName != null">
<mat-toolbar>
<div fxLayout="row wrap" style="padding:15px 0px;">
<div fxFlex.xs="10" fxFlex.sm="10" fxFlex.md="10" fxFlex.lg="10" fxFlex.xl="10" fxLayoutAlign="start center">
@ -168,4 +169,5 @@
</div>
</div>
</div> -->
</div>
<ngx-spinner bdColor = "rgba(0, 0, 0, 0.8)" size = "medium" color = "#178a78" type = "square-jelly-box" [fullScreen] = "true"><p style="color: white" > Please Wait...... </p></ngx-spinner>

View File

@ -8,7 +8,8 @@ export const environment = {
//EndUser URL
endUserUrl: window.location.origin+'/#/booking/',
mailUrl:window.location.origin,
payment_api_key :'4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
payment_mode:'LIVE',
firebase: {
apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw",

View File

@ -13,7 +13,9 @@ export const environment = {
//EndUser URL
endUserUrl: window.location.origin+'/#/booking/',
mailUrl:window.location.origin,
payment_api_key :'4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
payment_mode:'TEST',
firebase: {
apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw",
authDomain: "venba-appointment.firebaseapp.com",
@ -24,6 +26,8 @@ export const environment = {
measurementId: "G-48RM8BFRFK"
},
// web:{
// client_id:"1070360493694-f47l99s7bjqf7of1n7amgkg3mfk7l425.apps.googleusercontent.com",
// project_id:"neon-nexus-386307",