complete task
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {NavController} from "@ionic/angular";
|
||||
import {AlertController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||
@@ -21,6 +21,7 @@ export class ActivetaskPage implements OnInit {
|
||||
private navctr: NavController,
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private alertController:AlertController,
|
||||
private wrenchService: WrenchService,
|
||||
public blogDataService: BlogDataService
|
||||
) {
|
||||
@@ -136,10 +137,51 @@ export class ActivetaskPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
taskCompleted(){
|
||||
async taskCompleted(){
|
||||
// alert(100);
|
||||
let reqData = {
|
||||
contract: this.jobData.contract,
|
||||
contract_uid: this.jobData.contract_uid,
|
||||
job_action: 'NOTIFY_COMPLETE',
|
||||
}
|
||||
|
||||
const alert = await this.alertController.create({
|
||||
header: "Confirm the task is completed.",
|
||||
message: "The task owner will confirm the completion acceptance or rejection soon.",
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
// this.getMyOffersData();
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Confirm Completed ?",
|
||||
handler: () => {
|
||||
// start
|
||||
// API CALL TO MARK TASK AS COMPLETED BY WORKER
|
||||
this.wrenchService.workerJobAction(reqData).subscribe((res)=> {
|
||||
if (res.status != 200 || res.data.internal_return < 0) {
|
||||
// setReqStatus({loading:false, status: false, message: 'unable to complete request. Try again'})
|
||||
// Alert("Unable to set task as completed, try again soon");
|
||||
} else {
|
||||
this.router.navigate(['mytasks']);
|
||||
}
|
||||
}
|
||||
);
|
||||
// this.router.navigate(['mytasks']);
|
||||
// end
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
await alert.present();
|
||||
}
|
||||
taskCancel(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import {AlertController} from "@ionic/angular";
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -16,6 +17,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private alertController:AlertController,
|
||||
public sessionDataProviderService:SessionDataProviderService
|
||||
) {
|
||||
this.accountType = sessionDataProviderService.account_type;
|
||||
@@ -61,9 +63,55 @@ export class ProfilePage implements OnInit {
|
||||
onMyFiles() {
|
||||
this.router.navigate(['myfiles']);
|
||||
}
|
||||
onLogout() {
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.router.navigate(['login']);
|
||||
async onLogout() {
|
||||
// this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
// this.router.navigate(['login']);
|
||||
//this.requestLogout();
|
||||
|
||||
const alert = await this.alertController.create({
|
||||
header: "Log out",
|
||||
message: "Confirm you are ready to log out now.",
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
// this.getMyOffersData();
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Log out",
|
||||
handler: () => {
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.router.navigate(['login']);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
async requestLogout() {
|
||||
const alert = await this.alertController.create({
|
||||
header: "Log out",
|
||||
message: "Confirm you are ready to log out now.",
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
// this.getMyOffersData();
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Log out",
|
||||
handler: () => {
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.router.navigate(['login']);
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
await alert.present();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,55 +11,42 @@
|
||||
<ion-label class="bold_text">Redeem</ion-label>
|
||||
<!-- <ion-icon slot="end" name="bookmark-outline" color="primary"></ion-icon>-->
|
||||
</div>
|
||||
<ion-label class="color_text">Balance: $40</ion-label>
|
||||
|
||||
|
||||
<ion-segment [(ngModel)]="tabs">
|
||||
<ion-segment-button value="bank_redeem">
|
||||
<ion-label>To Bank</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="lesson">
|
||||
<ion-label>Others</ion-label>
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="reports">
|
||||
<ion-label>Reports</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
|
||||
<!-- <ion-segment [(ngModel)]="tabs">-->
|
||||
<!-- <ion-segment-button value="about">-->
|
||||
<!-- <ion-label>About</ion-label>-->
|
||||
<!-- </ion-segment-button>-->
|
||||
<!-- <ion-segment-button value="lesson">-->
|
||||
<!-- <ion-label>Lessons</ion-label>-->
|
||||
<!-- </ion-segment-button>-->
|
||||
<!-- <ion-segment-button value="review">-->
|
||||
<!-- <ion-label>Reviews</ion-label>-->
|
||||
<!-- </ion-segment-button>-->
|
||||
<!-- </ion-segment>-->
|
||||
|
||||
<!-- <div *ngIf="tabs =='about'" class="about">-->
|
||||
<div *ngIf="tabs =='bank_redeem'" class="about">
|
||||
<!-- <ion-label class="head_text">Mentor</ion-label>-->
|
||||
|
||||
<!-- <div class="mentor" (click)="onMentor()">-->
|
||||
</div>
|
||||
|
||||
<div *ngIf="tabs =='lesson'" class="lesson">
|
||||
|
||||
<!-- <div class="video" *ngFor="let item of [1,2]">-->
|
||||
<!-- <div class="left">-->
|
||||
<!-- <div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/p3.jpg)'"></div>-->
|
||||
<!-- <div style="margin-left: 10px;">-->
|
||||
<!-- <ion-label class="bold">Jonathon Williams</ion-label>-->
|
||||
<!-- <ion-label class="grey">Senier UI/UX designer at google</ion-label>-->
|
||||
<!-- <div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>-->
|
||||
|
||||
<!-- <div class="text">-->
|
||||
<!-- <ion-label class="bold_text">Why Using Figma ?</ion-label>-->
|
||||
<!-- <ion-label class="grey_text">10 mins</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <ion-icon name="chatbubble-ellipses-outline" color="primary"></ion-icon>-->
|
||||
<!-- <div class="right">-->
|
||||
<!-- <ion-icon name="lock-closed-outline"></ion-icon>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <ion-label class="head_text">About Course</ion-label>-->
|
||||
|
||||
<!-- <ion-label class="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, dolor, quasi-->
|
||||
<!-- commodi-->
|
||||
<!-- </ion-label>-->
|
||||
|
||||
<!-- <ion-label class="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, dolor, quasi-->
|
||||
<!-- commodi-->
|
||||
<!-- </ion-label>-->
|
||||
|
||||
<!-- <ion-label class="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, dolor, quasi-->
|
||||
<!-- commodi-->
|
||||
<!-- </ion-label>-->
|
||||
|
||||
<!-- <ion-label class="head_text">Tools</ion-label>-->
|
||||
|
||||
<!-- <ion-label>Figma</ion-label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div *ngIf="tabs =='lesson'" class="lesson">-->
|
||||
<!-- <div class="flex">-->
|
||||
<!-- <ion-label class="bold">Most Popular Courses</ion-label>-->
|
||||
<!-- <ion-label class="color">See all</ion-label>-->
|
||||
@@ -123,9 +110,27 @@
|
||||
<!-- <ion-icon name="lock-closed-outline"></ion-icon>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div *ngIf="tabs =='reports'" class="lesson">
|
||||
|
||||
<div class="video" *ngFor="let item of paymentData">
|
||||
<div class="left">
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>
|
||||
|
||||
<div class="text">
|
||||
<!-- <ion-label class="bold_text">Why Using Figma ?</ion-label>-->
|
||||
<!-- <ion-label class="grey_text">10 mins</ion-label>-->
|
||||
|
||||
<div [innerHTML]="item.recipient"></div>
|
||||
<ion-label class="grey_text">{{item.confirmation}}- {{item.amount}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-icon name="lock-closed-outline"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="tabs =='review'" class="review_tab">-->
|
||||
<!-- <div class="total">-->
|
||||
<!-- <div class="star-rate">-->
|
||||
<!-- <ion-icon name="star-half-outline" color="warning"></ion-icon>-->
|
||||
@@ -134,63 +139,7 @@
|
||||
<!-- <ion-label class="color">See all</ion-label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="story-item">-->
|
||||
<!-- <div class="menu">-->
|
||||
<!-- <div class="text">-->
|
||||
<!-- <div class="select show">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="light" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num white">All</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">1</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">2</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">3</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">4</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">5</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="reviw_list" *ngFor="let item of [1,2,3,4,5]">-->
|
||||
<!-- <div class="profile">-->
|
||||
<!-- <div class="left">-->
|
||||
<!-- <div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/p2.jpg)'"></div>-->
|
||||
<!-- <div style="margin-left: 10px;">-->
|
||||
<!-- <ion-label class="bold">Jonathon Williams</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="right">-->
|
||||
<!-- <div class="select">-->
|
||||
<!-- <ion-icon slot="start" name="star" color="primary" class="star_icon"></ion-icon>-->
|
||||
<!-- <ion-label class="rate_num">5</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- <ion-icon name="ellipsis-horizontal-circle-outline"></ion-icon>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <ion-label>The course is very good. the experience of the menter is very clear and easy to understand-->
|
||||
<!-- </ion-label>-->
|
||||
|
||||
<!-- <div class="like">-->
|
||||
<!-- <ion-icon slot="start" name="heart" color="danger" class="heart"></ion-icon>-->
|
||||
<!-- <ion-label class="count">330</ion-label>-->
|
||||
<!-- <ion-label class="time">2 Days ago</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ion-content {
|
||||
.back_image {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
height: 130px;
|
||||
|
||||
.back {
|
||||
font-size: 25px;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-redeem',
|
||||
@@ -10,26 +12,41 @@ import {Router} from "@angular/router";
|
||||
export class RedeemPage implements OnInit {
|
||||
|
||||
|
||||
tabs = 'about';
|
||||
tabs = 'bank_redeem';
|
||||
|
||||
constructor(
|
||||
private navctr: NavController,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.getPaymentHxData();
|
||||
}
|
||||
|
||||
onBack() {
|
||||
this.navctr.back();
|
||||
}
|
||||
|
||||
onMentor() {
|
||||
this.router.navigate(['mentor']);
|
||||
}
|
||||
usrData: {
|
||||
action:number, member_id: number, uid: string, sessionid: string, limit:20, page:1
|
||||
};
|
||||
paymentHxData:any;
|
||||
paymentData: [];
|
||||
getPaymentHxData(){
|
||||
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.getPaymentHx(this.usrData).subscribe(
|
||||
paymentHxData => {
|
||||
this.paymentHxData = paymentHxData;
|
||||
console.log("PAH HX RETURN->", this.paymentHxData);
|
||||
this.paymentData = this.paymentHxData.result_list;
|
||||
// debugger;
|
||||
console.log("BANNERS RETURN DATA->", this.paymentData);
|
||||
// this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
}
|
||||
);
|
||||
|
||||
onEnroll() {
|
||||
this.router.navigate(['enroll']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
<ion-card-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col> <ion-button size="small" color="success" expand="block" (click)="startRedeem(item)">Redeem</ion-button></ion-col>
|
||||
<ion-col></ion-col>
|
||||
<ion-col>
|
||||
<!-- <ion-button size="small" expand="block">Add Credit</ion-button>-->
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div *ngIf="item.action_type == 'AC_AD_WR_FUND' " >
|
||||
<ion-button size="small" color="success" expand="block" (click)="startRedeem(item)">Redeem</ion-button>
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col></ion-col>
|
||||
<ion-col>
|
||||
<!-- <ion-button size="small" expand="block">Add Credit</ion-button>-->
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-card-content>
|
||||
|
||||
@@ -29,9 +29,14 @@ export class WrenchService {
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
}
|
||||
return this.http.post(
|
||||
const apiReturn = this.http.post(
|
||||
`${environment.baseUrl}/${reqPath}`,reqData
|
||||
);
|
||||
/*
|
||||
We have to check if this sessio
|
||||
*/
|
||||
|
||||
return apiReturn;
|
||||
}
|
||||
|
||||
startPassReset(reqData){
|
||||
@@ -162,6 +167,18 @@ export class WrenchService {
|
||||
jobmanageroffers(usrData){
|
||||
return this.getPostData("jobmanageroffers", usrData);
|
||||
}
|
||||
|
||||
// END POINT FOR WORKER TO MARK TASK AS COMPLETED
|
||||
workerJobAction(reqData) {
|
||||
var postData = {
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
action: 14015,
|
||||
...reqData,
|
||||
};
|
||||
return this.getPostData("/activetaskstatus", postData);
|
||||
}
|
||||
/*
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user