fix page
This commit is contained in:
@@ -1,45 +1,79 @@
|
||||
<div *ngFor="let item of myOffersData">
|
||||
<div class="offers_div">
|
||||
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<img class="offer_banner" alt="{{item.title}}" src="{{session_image_server+'/'+curr_session+'/job/'+item.job_uid}}" />
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div>
|
||||
<div class="offer_title">{{item.title}}</div>
|
||||
<div class="expire">Expiration : {{item.expire | date}}</div>
|
||||
<div class="price">Price : {{item.price*0.01| number : '1.2-2'}} {{item.currency}}</div>
|
||||
<div *ngFor="let item of offerData">
|
||||
<div class="offerBanner">
|
||||
<div style="display: flex;">
|
||||
<div style="min-width: 120px; padding: 10px;" ><img
|
||||
class="bg_image back_image banner_image"
|
||||
alt="{{item.title}}" src="{{session_image_server+'/'+curr_session+'/job/'+item.job_uid}}" />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div class="offer_title">{{item.title}}</div>
|
||||
<div class="price">Reward : {{item.price*0.01| number : '1.2-2'}} {{item.currency}}</div>
|
||||
<div style="display: flex; width: 100%;">
|
||||
<div class="expire" style="width: 70%;">Expires : {{item.expire | date}}</div>
|
||||
<div style="text-align: right; width: 30%; padding-right: 10px;">
|
||||
<ion-button size="small" (click)="openOfferDetail(item)" color="success" fill="solid" shape="round">View</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail_txt">
|
||||
{{(item.job_description.length<95)? item.job_description :item.job_description.substring(0,95)+'...' }}
|
||||
</div>
|
||||
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-grid class="action_area">
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-button size="small" (click)="requestReject(item)" color="danger" fill="solid" shape="round">Reject</ion-button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<ion-button size="small" (click)="requestStart(item)" color="success" fill="solid" shape="round">Start Now</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background-color: white; border-radius: 10px; margin: 15px; min-height: 180px; max-height: 220px;">
|
||||
<div class="detail_txt">
|
||||
{{(item.job_description.length<95)? item.job_description :item.job_description.substring(0,95)+'...' }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; padding: 5px; width: 100%;">
|
||||
<div style="50%;">
|
||||
<ion-button size="small" (click)="requestReject(item)" color="danger" fill="solid" shape="round">Reject</ion-button>
|
||||
</div>
|
||||
<div style="width: 50%; text-align: right;">
|
||||
<ion-button size="small" (click)="requestStart(item)" color="success" fill="solid" shape="round">Start Now</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="offers_div">-->
|
||||
|
||||
<!-- <ion-grid>-->
|
||||
<!-- <ion-row>-->
|
||||
<!-- <ion-col>-->
|
||||
<!-- <img class="offer_banner" alt="{{item.title}}" src="{{session_image_server+'/'+curr_session+'/job/'+item.job_uid}}" />-->
|
||||
<!-- </ion-col>-->
|
||||
<!-- <ion-col>-->
|
||||
<!-- <div>-->
|
||||
<!-- <div class="offer_title">{{item.title}}</div>-->
|
||||
<!-- <div class="expire">Expiration : {{item.expire | date}}</div>-->
|
||||
<!-- <div class="price">Reward : {{item.price*0.01| number : '1.2-2'}} {{item.currency}}</div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="detail_txt">-->
|
||||
<!-- {{(item.job_description.length<95)? item.job_description :item.job_description.substring(0,95)+'...' }}-->
|
||||
<!-- </div>-->
|
||||
|
||||
|
||||
<!-- </ion-col>-->
|
||||
<!-- </ion-row>-->
|
||||
<!-- <ion-row>-->
|
||||
<!-- <ion-col>-->
|
||||
<!-- <ion-grid class="action_area">-->
|
||||
<!-- <ion-row>-->
|
||||
<!-- <ion-col>-->
|
||||
<!-- <ion-button size="small" (click)="requestReject(item)" color="danger" fill="solid" shape="round">Reject</ion-button>-->
|
||||
<!-- </ion-col>-->
|
||||
<!-- <ion-col>-->
|
||||
|
||||
<!-- </ion-col>-->
|
||||
<!-- <ion-col>-->
|
||||
<!-- <ion-button size="small" (click)="requestStart(item)" color="success" fill="solid" shape="round">Start Now</ion-button>-->
|
||||
<!-- </ion-col>-->
|
||||
<!-- </ion-row>-->
|
||||
<!-- </ion-grid>-->
|
||||
|
||||
<!-- </ion-col>-->
|
||||
<!-- </ion-row>-->
|
||||
<!-- </ion-grid>-->
|
||||
|
||||
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
.offerBanner{
|
||||
box-shadow: 3px 2px 2px #bbadad;
|
||||
background-color: aliceblue;
|
||||
border-radius: 10px;
|
||||
border-color: #383a3e;
|
||||
//display: flex;
|
||||
.offer_title{
|
||||
font-size: 18px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
.price{
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
color:green;
|
||||
font-size: 14px;
|
||||
}
|
||||
.expire{
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.offers_div{
|
||||
background-color: aliceblue;
|
||||
border-radius: 10px;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {AlertController, LoadingController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import { BannersDataService } from "../../store/banners-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-offers-received',
|
||||
@@ -10,6 +11,7 @@ import {WrenchService} from "../../services/wrench.service";
|
||||
styleUrls: ['./offers-received.component.scss'],
|
||||
})
|
||||
export class OffersReceivedComponent implements OnInit {
|
||||
@ViewChild('offerData') offerData: [];
|
||||
|
||||
constructor(
|
||||
private navctrl: NavController,
|
||||
@@ -17,9 +19,15 @@ export class OffersReceivedComponent implements OnInit {
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private alertController:AlertController,
|
||||
private wrenchService: WrenchService,
|
||||
private loadingCtrl: LoadingController
|
||||
private loadingCtrl: LoadingController,
|
||||
public bannersDataService: BannersDataService
|
||||
) {
|
||||
this.getMyOffersData();
|
||||
// this.getMyOffersData();
|
||||
this.session_image_server = this.sessionDataProviderService.session_image_server;
|
||||
setInterval(()=>{
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
this.session_image_server = this.sessionDataProviderService.session_image_server;
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -35,31 +43,34 @@ export class OffersReceivedComponent implements OnInit {
|
||||
limit:20,
|
||||
page:1, offset:number
|
||||
};
|
||||
total_offers:number = 0;
|
||||
myOffersTotalData:any;
|
||||
myOffersData: [];
|
||||
getMyOffersData(){
|
||||
this.usrData = {action:15010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
limit:20, page:1,offset: 0}
|
||||
// total_offers:number = 0;
|
||||
// myOffersTotalData:any;
|
||||
// myOffersData: [];
|
||||
// getMyOffersData(){
|
||||
// this.usrData = {action:15010,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session ,
|
||||
// limit:20, page:1,offset: 0}
|
||||
//
|
||||
// this.curr_session = this.sessionDataProviderService.session;
|
||||
// this.wrenchService.getMyOffers(this.usrData).subscribe(
|
||||
// myOffersTotalData => {
|
||||
// this.myOffersTotalData = myOffersTotalData;
|
||||
// this.session_image_server = this.myOffersTotalData.session_image_server;
|
||||
// console.log("myOffersTotalData RETURN->", this.myOffersTotalData);
|
||||
// this.myOffersData = this.myOffersTotalData.result_list;
|
||||
// console.log("myOffersData RETURN DATA->", this.myOffersData);
|
||||
// this.total_offers = this.myOffersData?.length;
|
||||
// }
|
||||
// );
|
||||
//
|
||||
// }
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
this.wrenchService.getMyOffers(this.usrData).subscribe(
|
||||
myOffersTotalData => {
|
||||
this.myOffersTotalData = myOffersTotalData;
|
||||
this.session_image_server = this.myOffersTotalData.session_image_server;
|
||||
console.log("myOffersTotalData RETURN->", this.myOffersTotalData);
|
||||
this.myOffersData = this.myOffersTotalData.result_list;
|
||||
console.log("myOffersData RETURN DATA->", this.myOffersData);
|
||||
this.total_offers = this.myOffersData?.length;
|
||||
}
|
||||
);
|
||||
openOfferDetail(item){
|
||||
|
||||
}
|
||||
|
||||
|
||||
async requestStart(item) {
|
||||
const alert = await this.alertController.create({
|
||||
header: "Ready to start",
|
||||
@@ -69,14 +80,16 @@ export class OffersReceivedComponent implements OnInit {
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
this.getMyOffersData();
|
||||
// this.getMyOffersData();
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Start Now",
|
||||
handler: () => {
|
||||
this.sendOfferResponse(item, 100);
|
||||
this.getMyOffersData();
|
||||
// this.getMyOffersData();
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -93,14 +106,16 @@ export class OffersReceivedComponent implements OnInit {
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
this.getMyOffersData();
|
||||
//this.getMyOffersData();
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Reject",
|
||||
handler: () => {
|
||||
this.sendOfferResponse(item, 333);
|
||||
this.getMyOffersData();
|
||||
//this.getMyOffersData();
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -139,7 +154,8 @@ export class OffersReceivedComponent implements OnInit {
|
||||
offerRespData => {
|
||||
this.offerRespData = offerRespData;
|
||||
console.log("offerRespData RETURN->", this.offerRespData);
|
||||
this.getMyOffersData();
|
||||
// this.getMyOffersData();
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
</ion-grid>
|
||||
</div>
|
||||
<ng-template #elseFulltag>
|
||||
<app-offers-received></app-offers-received>
|
||||
<app-offers-received [offerData]="offerData"></app-offers-received>
|
||||
<div *ngIf="home_dash_type=='DEFAULT_HOME_DASH'; ">
|
||||
<app-latest-market></app-latest-market>
|
||||
<ion-card class="map-sec" *ngIf="enableTracking > 0">
|
||||
|
||||
@@ -162,6 +162,7 @@ export class HomePage implements OnInit {
|
||||
|
||||
async refreshBannersData() {
|
||||
// debugger;
|
||||
this.home_dash_type = this.sessionDataProviderService.home_dash_type;
|
||||
this.bannerData = this.bannersDataService.bannerData;
|
||||
this.homebannerCount = this.bannersDataService.homebannerCount;
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
@@ -177,9 +178,7 @@ export class HomePage implements OnInit {
|
||||
};
|
||||
async getBannersData() {
|
||||
this.refreshBannersData();
|
||||
|
||||
var interval = setInterval(() => {
|
||||
this.home_dash_type = this.sessionDataProviderService.home_dash_type;
|
||||
this.refreshBannersData();
|
||||
console.log("******* IN THE HOME " + this.home_dash_type);
|
||||
}, 5000);
|
||||
|
||||
Reference in New Issue
Block a user