Coupon pages
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-label class="color_text">Price: {{jobData.price*0.01}} {{jobData.currency}}</ion-label>
|
||||
<ion-label class="color_text">Price: {{jobData.price*0.01| number : '1.2-2'}} {{jobData.currency}}</ion-label>
|
||||
|
||||
<div class="items">
|
||||
<div class="stud">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-label class="color_text">Price: {{jobData.price*0.01}} {{jobData.currency}}</ion-label>
|
||||
<ion-label class="color_text">Price: {{jobData.price*0.01| number : '1.2-2'}} {{jobData.currency}}</ion-label>
|
||||
|
||||
<div class="items">
|
||||
<div class="stud">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="flex">
|
||||
<div class="text">
|
||||
<ion-label class="bold_text">{{item.title}}</ion-label>
|
||||
<ion-label class="price_line"> {{item.price*0.01}} {{item.currency}} </ion-label>
|
||||
<ion-label class="price_line"> {{item.price*0.01| number : '1.2-2'}} {{item.currency}} </ion-label>
|
||||
<ion-label class="due_date">Timeline: {{item.timeline_days}} days</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,12 +56,12 @@
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>
|
||||
|
||||
<div class="text">
|
||||
<ion-label class="bold_text">{{item.amount*0.01}} {{item.currency}} </ion-label>
|
||||
<ion-label class="bold_text">{{item.amount*0.01| number : '1.2-2'}} {{item.currency}} </ion-label>
|
||||
<ion-label class="grey_text">{{item.code}} - {{item.added}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-button color="secondary">Redeem</ion-button>
|
||||
<ion-button color="secondary" (click)="startRedeem(item)">Redeem</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url(assets/images/line.png)'"></div>
|
||||
|
||||
<div class="text">
|
||||
<ion-label class="bold_text">{{item.amount*0.01}} {{item.currency}} </ion-label>
|
||||
<ion-label class="bold_text">{{item.amount*0.01| number : '1.2-2'}} {{item.currency}} </ion-label>
|
||||
<ion-label class="grey_text">{{item.code}} - {{item.added}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {NavController} from "@ionic/angular";
|
||||
import {AlertController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
@@ -16,6 +16,7 @@ export class MycouponsPage implements OnInit {
|
||||
constructor(
|
||||
private navctr: NavController,
|
||||
private router: Router,
|
||||
private alertController:AlertController,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
) { }
|
||||
@@ -81,4 +82,52 @@ export class MycouponsPage implements OnInit {
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
redeemData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
code:string,
|
||||
code_id: number
|
||||
};
|
||||
async startRedeem(item){
|
||||
|
||||
const redMsg = "Confirm you are ready to redeem " + item.amount*0.01 + " " + item.currency;
|
||||
const alert = await this.alertController.create({
|
||||
header: "Redeem Coupon",
|
||||
message: redMsg,
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
role: "cancel",
|
||||
handler: () => {
|
||||
// this.getMyOffersData();
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "Redeem",
|
||||
handler: () => {
|
||||
this.redeemData = {
|
||||
action:85020,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
code:item.code,
|
||||
code_id: item.code_id
|
||||
};
|
||||
debugger;
|
||||
/*
|
||||
redeemCoupon(redeemData){
|
||||
return this.getPostData("couponredeem", redeemData);
|
||||
}
|
||||
*/
|
||||
this.getMyCouponHxData();
|
||||
this.getMyCouponPendData();
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
await alert.present();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +184,9 @@ export class WrenchService {
|
||||
getCouponPending(usrData){
|
||||
return this.getPostData("couponpending", usrData);
|
||||
}
|
||||
redeemCoupon(redeemData){
|
||||
return this.getPostData("couponredeem", redeemData);
|
||||
}
|
||||
sendMoneyAction(sendmoneyData){
|
||||
return this.getPostData("sendmoney", sendmoneyData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user