wallet clean up for teh kids
This commit is contained in:
@@ -13,6 +13,7 @@ import {BannersDataService} from "../../store/banners-data.service";
|
||||
import {UserWalletService} from "../../store/user-wallet.service";
|
||||
import {IntervalRefreshService} from "../../store/interval-refresh.service";
|
||||
import {FamilyDataService} from "../../store/family-data.service";
|
||||
import {SocketToolsService} from "../../services/socket-tools.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-familylogin',
|
||||
@@ -43,19 +44,27 @@ export class FamilyloginPage implements OnInit {
|
||||
public intervalRefreshService: IntervalRefreshService,
|
||||
public familyDataService:FamilyDataService,
|
||||
private loadingCtrl: LoadingController,
|
||||
public socketToolsService:SocketToolsService
|
||||
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const checkName = async () => {
|
||||
const checkName = async () => {
|
||||
const { value } = await Preferences.get({ key: 'family_username' });
|
||||
this.username=value;
|
||||
|
||||
//console.log(`Hello ${value}!`);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
async joinLoginSockets(){
|
||||
this.socketToolsService.stop();
|
||||
setTimeout(()=>{
|
||||
this.socketToolsService.setupSocket("NO-NEED-SEND");
|
||||
this.socketToolsService.joinSocketRoom("full-market-jobs" );
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
loginData: {
|
||||
username: string, pin: string, sessionid: string, action: '11025',login_mode: '1105'
|
||||
};
|
||||
@@ -101,12 +110,13 @@ export class FamilyloginPage implements OnInit {
|
||||
}
|
||||
|
||||
async startUpCalls(){
|
||||
this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
await this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
await this.joinLoginSockets();
|
||||
this.getBlogData();
|
||||
this.tasksDataService.getJobsData();
|
||||
this.userWalletService.getWalletData();
|
||||
this.bannersDataService.getBannersData();
|
||||
this.familyDataService.getFamilySuggestList();
|
||||
await this.tasksDataService.getJobsData();
|
||||
await this.userWalletService.getWalletData();
|
||||
await this.bannersDataService.getBannersData();
|
||||
await this.familyDataService.getFamilySuggestList();
|
||||
}
|
||||
|
||||
async showAlert(mtitle: string, amessage: string) {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<!-- <ion-buttons slot="end">-->
|
||||
<!-- <ion-button>-->
|
||||
<!-- <ion-icon name="search-outline"></ion-icon>-->
|
||||
<!-- </ion-button>-->
|
||||
<!-- </ion-buttons>-->
|
||||
<ion-title>Find Task</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
@@ -14,7 +9,7 @@
|
||||
|
||||
<ion-segment class="common_segment" [(ngModel)]="tabs">
|
||||
<ion-segment-button value="on">
|
||||
<ion-label>Available</ion-label>
|
||||
<ion-label>Available ({{job_count}})</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="done">
|
||||
<ion-label>Pending</ion-label>
|
||||
@@ -47,17 +42,7 @@
|
||||
|
||||
<div *ngIf="tabs =='done'">
|
||||
<app-waitinterest></app-waitinterest>
|
||||
<!-- <div class="content" *ngFor="let item of jobsData;" (click)="onCourseDetail()">-->
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <div class="text">-->
|
||||
<!-- <ion-label class="bold_text">{{item.title}}</ion-label>-->
|
||||
<!-- <ion-label class="due_date">available till : {{item.expire}}</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -14,7 +14,7 @@ export class MyCoursePage implements OnInit {
|
||||
tabs: any = 'on';
|
||||
session_image_server:string='';
|
||||
curr_session:string='';
|
||||
|
||||
job_count:number =0;
|
||||
constructor(
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
@@ -33,10 +33,6 @@ export class MyCoursePage implements OnInit {
|
||||
this.getJobsData();
|
||||
}
|
||||
|
||||
onCourseDetail() {
|
||||
this.router.navigate(['course-detail']);
|
||||
}
|
||||
|
||||
viewMarketItem(item) {
|
||||
this.router.navigate(['marketdetail'],{state: item});
|
||||
}
|
||||
@@ -47,34 +43,17 @@ export class MyCoursePage implements OnInit {
|
||||
this.jobsData = this.marketDataService.jobsData;
|
||||
}
|
||||
|
||||
usrData: {
|
||||
action:11200, member_id: number, uid: string, sessionid: string, limit:20, page:1
|
||||
};
|
||||
|
||||
/*
|
||||
getJobsData - refresh from central call - not direct call to API
|
||||
*/
|
||||
jobsTotalData:any;
|
||||
jobsData: [];
|
||||
async getJobsData(){
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
var interval = setInterval( ()=> {
|
||||
this.jobsData = this.marketDataService.jobsData;
|
||||
this.job_count = this.marketDataService.jobsData.length;
|
||||
this.session_image_server = this.marketDataService.session_image_server;
|
||||
}, 5000);
|
||||
|
||||
|
||||
// this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , limit:20, page:1}
|
||||
// this.wrenchService.getJobsData(this.usrData).subscribe(
|
||||
// jobsTotalData => {
|
||||
// this.jobsTotalData = jobsTotalData;
|
||||
// console.log("PAH HX RETURN->", this.jobsTotalData);
|
||||
// this.jobsData = this.jobsTotalData.result_list;
|
||||
// this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
//
|
||||
// // debugger;
|
||||
// console.log("JOBS RETURN DATA->", this.jobsData);
|
||||
// // this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
// }
|
||||
// );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,16 +26,16 @@
|
||||
</ion-segment>
|
||||
|
||||
|
||||
<div *ngIf="tabs =='tasks'" class="lesson">
|
||||
<div class="flex">
|
||||
<ion-label class="bold">Available Task(s)</ion-label>
|
||||
</div>
|
||||
<!-- <div *ngIf="tabs =='tasks'" class="lesson">-->
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <ion-label class="bold">Available Task(s)</ion-label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
|
||||
<div *ngIf="tabs =='tasks'" class="lesson">
|
||||
<div *ngIf="active_job_count == 0 && active_offers_count == 0 ">
|
||||
<ion-card style="background-color: #f4f1f0;">
|
||||
<ion-card style="background-color: #ffffff;">
|
||||
<img alt="WrenchBoard Tasks" src="https://www.wrenchboard.com/assets/images/apps/current-tasks.png" />
|
||||
<ion-card-header>
|
||||
<ion-card-title>Current Tasks</ion-card-title>
|
||||
@@ -114,14 +114,15 @@
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</div>
|
||||
<div class="video" *ngFor="let item of jobsPastDueData;" (click)="activeSeleted(item)">
|
||||
<div class="video" style="background-color: #f8f2f2" *ngFor="let item of jobsPastDueData;" (click)="activeSeleted(item)">
|
||||
<div class="left">
|
||||
<div class="bg_image back_image" [style.backgroundImage]="'url('+session_image_server+'/'+curr_session+'/job/'+item.job_uid+')'"></div>
|
||||
|
||||
<div class="text">
|
||||
<div class="bold_text" [innerHTML]="item.title"></div>
|
||||
<ion-label class="bold_text">{{(item.title.length > 30) ? item.title.substring(0,29)+"...": item.title }}</ion-label>
|
||||
<!-- <div class="bold_text" [innerHTML]="item.title"></div>-->
|
||||
<ion-label class="price_line"> Reward : {{item.price*0.01| number : '1.2-2'}} {{item.currency_code}} </ion-label>
|
||||
<ion-label class="due_date">Timeline: {{item.timeline_days}} days</ion-label>
|
||||
<ion-label class="due_date">Due : {{item.delivery_date | date}} Timeline: {{item.timeline_days}} days</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
@@ -129,27 +130,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <div class="bg_image back_image" [style.backgroundImage]="'url('+session_image_server+'/'+curr_session+'/job/'+item.job_uid+')'"></div>-->
|
||||
<!-- <div style="margin-left: 10px;">-->
|
||||
<!-- <ion-label class="bold_text"> {{item.title}}</ion-label>-->
|
||||
<!-- <div style="display: flex;">-->
|
||||
<!-- <div class="grey_text" [innerHTML]="item.job_description"></div>-->
|
||||
<!--<!– <ion-label class="grey_text"> {{item.job_description}} </ion-label>–>-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!--<!– <hr />–>-->
|
||||
<!-- <ion-label class="due_date">Due : {{item.delivery_date |date}}</ion-label>-->
|
||||
<!-- <ion-label *ngIf="item.ext_request !=''; " class="due_date"> Extension Request: {{item.ext_request | date}}</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="column">-->
|
||||
<!-- <ion-icon name="chevron-forward-outline"></ion-icon>-->
|
||||
<!-- <!– <ion-label class="small_text"> 11:30 PM</ion-label>–>-->
|
||||
<!-- <!– <ion-label class="color_text"> 10</ion-label>–>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,6 +17,33 @@
|
||||
<!-- </div>-->
|
||||
<div class="boxed_contents">
|
||||
|
||||
<div *ngIf="account_type=='FAMILY';">
|
||||
<ion-card *ngFor="let item of walletData; let i = index">
|
||||
<ion-card-header>
|
||||
<ion-card-title>{{item.description}}</ion-card-title>
|
||||
<ion-card-subtitle> <span class="balance_line">Balance {{item.amount*0.01 | number : '1.2-2'}} </span></ion-card-subtitle>
|
||||
</ion-card-header>
|
||||
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
|
||||
</ion-col>
|
||||
<ion-col style="text-align: right;">
|
||||
<!-- <ion-button size="small" expand="block">Add Credit</ion-button>-->
|
||||
<div *ngIf="item.action_type == 'AC_AD_WR_FUND' " >
|
||||
<ion-button color="secondary" expand="block" (click)="startFamilyRedeem(item)">Redeem</ion-button>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</div>
|
||||
<!-- <ion-card *ngFor="let item of walletData; let i = index">-->
|
||||
<!-- <ion-card-header>-->
|
||||
<!-- <ion-card-title>{{item.description}}</ion-card-title>-->
|
||||
@@ -39,7 +66,7 @@
|
||||
<!-- </ion-grid>-->
|
||||
<!-- </ion-card-content>-->
|
||||
<!-- </ion-card>-->
|
||||
<div class="ion-padding">
|
||||
<div class="ion-padding" *ngIf="account_type=='FULL';">
|
||||
<div class="lesson">
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <ion-label class="bold">Wallet(s)</ion-label>-->
|
||||
|
||||
@@ -11,6 +11,7 @@ import {RecipientsService} from "../../store/recipients.service";
|
||||
styleUrls: ['./transaction.page.scss'],
|
||||
})
|
||||
export class TransactionPage implements OnInit {
|
||||
account_type:string = '';
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -19,15 +20,14 @@ export class TransactionPage implements OnInit {
|
||||
private wrenchService: WrenchService,
|
||||
public recipientsService: RecipientsService
|
||||
) {
|
||||
|
||||
addEventListener('app-wallet-refresh', () => {
|
||||
this.account_type = this.sessionDataProviderService.account_type;
|
||||
// debugger;
|
||||
addEventListener('app-wallet-refresh', () => {
|
||||
this.getWalletData();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.getWalletData();
|
||||
// this.getPaymentHxData();
|
||||
}
|
||||
|
||||
onBack() {
|
||||
@@ -40,7 +40,6 @@ export class TransactionPage implements OnInit {
|
||||
}
|
||||
|
||||
addCredit(item){
|
||||
// debugger;
|
||||
this.router.navigate(['addcredit'],{state: item});
|
||||
}
|
||||
onReceipt(item) {
|
||||
@@ -53,20 +52,28 @@ export class TransactionPage implements OnInit {
|
||||
};
|
||||
getWalletData(){
|
||||
this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session, limit:20, page:1 }
|
||||
this.wrenchService.getUserWallets(this.usrData).subscribe(
|
||||
walletResult => {
|
||||
this.walletResult = walletResult;
|
||||
console.log("BANNERS RETURN->", this.walletResult);
|
||||
this.walletData = this.walletResult.result_list;
|
||||
// debugger;
|
||||
console.log("BANNERS RETURN DATA->", this.walletData);
|
||||
// this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
}
|
||||
);
|
||||
|
||||
if (this.sessionDataProviderService.account_type == 'FAMILY'){
|
||||
//wallet for kids
|
||||
this.wrenchService.getFamilyUserWallets(this.usrData).subscribe(
|
||||
walletResult => {
|
||||
this.walletResult = walletResult;
|
||||
console.log("KIDS BANNERS RETURN->", this.walletResult);
|
||||
this.walletData = this.walletResult.result_list;
|
||||
}
|
||||
);
|
||||
}else {
|
||||
// wallet for full account
|
||||
this.wrenchService.getUserWallets(this.usrData).subscribe(
|
||||
walletResult => {
|
||||
this.walletResult = walletResult;
|
||||
console.log("BANNERS RETURN->", this.walletResult);
|
||||
this.walletData = this.walletResult.result_list;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
paymentHxData:any;
|
||||
paymentData: [];
|
||||
getPaymentHxData(){
|
||||
@@ -87,6 +94,9 @@ export class TransactionPage implements OnInit {
|
||||
startRedeem(item){
|
||||
this.router.navigate(['redeem'],{state: item} );
|
||||
}
|
||||
startFamilyRedeem(item){
|
||||
// this.router.navigate(['redeem'],{state: item} );
|
||||
}
|
||||
}
|
||||
/*
|
||||
'limit' => int 20
|
||||
|
||||
@@ -37,11 +37,13 @@ export class SocketToolsService {
|
||||
this.socket.on('receive_message', () => {
|
||||
console.log("app-taskactivities-refresh 001");
|
||||
const event = new Event("app-taskactivities-refresh");
|
||||
alert("app-taskactivities-refresh 000");
|
||||
dispatchEvent(event);
|
||||
});
|
||||
|
||||
this.socket.on('received_refreshmarket_jobs', (data) => {
|
||||
console.log("received_refreshmarket_jobs 002");
|
||||
alert("received_refreshmarket_jobs 002");
|
||||
debugger
|
||||
});
|
||||
|
||||
|
||||
@@ -207,6 +207,10 @@ export class WrenchService {
|
||||
return this.getPostData("getwallets", usrData);
|
||||
}
|
||||
|
||||
getFamilyUserWallets(usrData) {
|
||||
return this.getPostData("familywallet", usrData);
|
||||
}
|
||||
|
||||
pendingJobExtend(reqData){
|
||||
return this.getPostData("pendingjobextend", reqData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user