Change session payment options
This commit is contained in:
parent
f7749cb2f7
commit
59847096d0
1 changed files with 18 additions and 11 deletions
|
@ -1,10 +1,9 @@
|
||||||
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { UntypedFormBuilder, Validators, UntypedFormGroup, FormControl } from '@angular/forms';
|
import { UntypedFormBuilder, Validators, UntypedFormGroup } from '@angular/forms';
|
||||||
import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
|
import { MatDialog, MatDialogConfig} from '@angular/material/dialog';
|
||||||
import { ProgressBarMode } from '@angular/material/progress-bar';
|
import { ProgressBarMode } from '@angular/material/progress-bar';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { filter, startWith, map, switchMap } from 'rxjs/operators';
|
|
||||||
import { MatStepper } from '@angular/material/stepper';
|
import { MatStepper } from '@angular/material/stepper';
|
||||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||||
import { Country } from '../country.model';
|
import { Country } from '../country.model';
|
||||||
|
@ -12,7 +11,6 @@ import { Owner } from '../owner.model';
|
||||||
import { User } from '../user.model';
|
import { User } from '../user.model';
|
||||||
import { UserService } from '../user.service';
|
import { UserService } from '../user.service';
|
||||||
import { FullnodeService } from '../fullnode.service';
|
import { FullnodeService } from '../fullnode.service';
|
||||||
import { SearchOptionsPipe } from '../searchoptions.pipe';
|
|
||||||
import { ScanComponent } from '../scan/scan.component';
|
import { ScanComponent } from '../scan/scan.component';
|
||||||
import { TermsComponent } from '../terms/terms.component';
|
import { TermsComponent } from '../terms/terms.component';
|
||||||
|
|
||||||
|
@ -26,16 +24,20 @@ export class BusinessComponent implements OnInit {
|
||||||
@ViewChild('stepper', { static: false}) stepper: MatStepper|undefined;
|
@ViewChild('stepper', { static: false}) stepper: MatStepper|undefined;
|
||||||
intervalHolder: any;
|
intervalHolder: any;
|
||||||
nodeAddress: string = '';
|
nodeAddress: string = '';
|
||||||
|
zecPrice: number = 1;
|
||||||
tickets = [
|
tickets = [
|
||||||
{
|
{
|
||||||
value: 0.005,
|
value: 1,
|
||||||
viewValue: '1 day: 0.005 ZEC'
|
viewValue: '1 day: USD $1'
|
||||||
},{
|
},{
|
||||||
value: 0.025,
|
value: 6,
|
||||||
viewValue: '1 week: 0.025 ZEC'
|
viewValue: '1 week: USD $6'
|
||||||
},{
|
},{
|
||||||
value: 0.1,
|
value: 22,
|
||||||
viewValue: '1 month: 0.1 ZEC'
|
viewValue: '1 month: USD $22'
|
||||||
|
},{
|
||||||
|
value: 30,
|
||||||
|
viewValue: '1 month Pro: USD $30'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
bizForm: UntypedFormGroup;
|
bizForm: UntypedFormGroup;
|
||||||
|
@ -73,6 +75,7 @@ export class BusinessComponent implements OnInit {
|
||||||
public ownerUpdate: Observable<Owner>;
|
public ownerUpdate: Observable<Owner>;
|
||||||
public addrUpdate: Observable<string>;
|
public addrUpdate: Observable<string>;
|
||||||
public userUpdate: Observable<User>;
|
public userUpdate: Observable<User>;
|
||||||
|
public priceUpdate: Observable<number>;
|
||||||
sessionId = '';
|
sessionId = '';
|
||||||
ownerKnown = false;
|
ownerKnown = false;
|
||||||
termsChecked = false;
|
termsChecked = false;
|
||||||
|
@ -84,6 +87,10 @@ export class BusinessComponent implements OnInit {
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private router: Router
|
private router: Router
|
||||||
) {
|
) {
|
||||||
|
this.priceUpdate = fullnodeService.priceUpdate;
|
||||||
|
this.priceUpdate.subscribe(priceInfo => {
|
||||||
|
this.zecPrice = priceInfo;
|
||||||
|
});
|
||||||
this.countriesUpdate = userService.countriesUpdate;
|
this.countriesUpdate = userService.countriesUpdate;
|
||||||
this.ownerUpdate = userService.ownerUpdate;
|
this.ownerUpdate = userService.ownerUpdate;
|
||||||
this.userUpdate = userService.userUpdate;
|
this.userUpdate = userService.userUpdate;
|
||||||
|
@ -187,7 +194,7 @@ export class BusinessComponent implements OnInit {
|
||||||
dialogConfig.disableClose = true;
|
dialogConfig.disableClose = true;
|
||||||
dialogConfig.autoFocus = true;
|
dialogConfig.autoFocus = true;
|
||||||
dialogConfig.data = {
|
dialogConfig.data = {
|
||||||
totalZec: this.payForm.get('session')!.value,
|
totalZec: (this.payForm.get('session')!.value)/this.zecPrice,
|
||||||
addr: this.nodeAddress,
|
addr: this.nodeAddress,
|
||||||
session: this.sessionId,
|
session: this.sessionId,
|
||||||
pay: true
|
pay: true
|
||||||
|
|
Loading…
Reference in a new issue