Commit 8861b78c by Arjun

conflict fix

parents ca594c95 f16fa4a5
...@@ -84,11 +84,11 @@ ...@@ -84,11 +84,11 @@
<div class="common-pop-wrapper" *ngIf="isShow" [@slideInOut]> <div class="common-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="pop_inner"> <div class="pop_inner">
<div class="img-wrapper"> <div class="img-wrapper">
<img src="../assets/model1_2.png" alt="Product"> <img src="../assets/basket.png" alt="Product">
</div> </div>
<div class="content"> <div class="content">
<h1>Order Placed Successfully</h1> <h1>Order Placed Successfully</h1>
<p>Order ID 123456 , Green Churidhar has been successfully orderd. </p> <p *ngIf="orderId">Order ID {{orderId}} , New Order has been successfully Placed. </p>
</div> </div>
<span (click)="istoggle();"><img src="../assets/close.png" alt="Close"></span> <span (click)="istoggle();"><img src="../assets/close.png" alt="Close"></span>
......
...@@ -51,6 +51,7 @@ export class AppComponent { ...@@ -51,6 +51,7 @@ export class AppComponent {
tabData = true; tabData = true;
isShow = false; isShow = false;
orderId: any;
constructor( constructor(
private platform: Platform, private platform: Platform,
...@@ -139,6 +140,27 @@ export class AppComponent { ...@@ -139,6 +140,27 @@ export class AppComponent {
'review' 'review'
]; ];
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
if (currentUrl[1] === 'home') {
this.setActive1();
}
if (currentUrl[1] === 'catagory') {
this.setActive2();
}
if (currentUrl[1] === 'searchmodal') {
this.setActive3();
}
if (currentUrl[1] === 'cart') {
this.setActive4();
}
if (currentUrl[1] === 'cart') {
this.setActive4();
}
if (currentUrl[1] === 'myorder') {
this.setActive5();
}
if (currentUrl[1] === 'profile') {
this.setActive6();
}
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
if (index > -1 || this.tabData === false) { if (index > -1 || this.tabData === false) {
return true; return true;
...@@ -216,6 +238,9 @@ export class AppComponent { ...@@ -216,6 +238,9 @@ export class AppComponent {
const data = change.doc.data(); const data = change.doc.data();
if (data.orderStatus === 7) { if (data.orderStatus === 7) {
this.finishpop(data); this.finishpop(data);
} else {
this.orderId = data.orderCode;
this.isShow = true;
} }
} }
}); });
......
...@@ -189,13 +189,22 @@ export class ProductdetailPage implements OnInit { ...@@ -189,13 +189,22 @@ export class ProductdetailPage implements OnInit {
} }
socialShare(prodName, category, subCate, price, image) { socialShare(prodName, category, subCate, price, image) {
const desc = prodName + ', ' + category + ', ' + subCate + ', ' + price; const desc = this.unEscape(prodName) + ', ' + category + ', ' + subCate + ', ' + 'AU$' + price;
console.log(image);
this.service.getBase64ImageFromUrl(image)
.then((result: any) => {
const content = { const content = {
message: desc, // not supported on some apps (Facebook, Instagram) message: desc, // not supported on some apps (Facebook, Instagram)
subject: prodName, // fi. for email subject: this.unEscape(prodName), // fi. for email
files: [image], files: [result],
chooserTitle: 'GetMi' chooserTitle: 'GetMi'
}; };
console.log(content);
this.socialSharing.shareWithOptions(content); this.socialSharing.shareWithOptions(content);
}).catch(err => console.error(err));
} }
} }
...@@ -8,6 +8,7 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -8,6 +8,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Order, CartProd } from './services/order'; import { Order, CartProd } from './services/order';
import { Products } from './services/product'; import { Products } from './services/product';
import { ServiceService } from './service.service'; import { ServiceService } from './service.service';
import { SubjectService } from './subject.service';
import * as firebase from 'firebase'; import * as firebase from 'firebase';
import { CartItem } from './services/cart'; import { CartItem } from './services/cart';
import { BehaviorSubject } from 'rxjs'; import { BehaviorSubject } from 'rxjs';
...@@ -30,7 +31,8 @@ export class OrdersService { ...@@ -30,7 +31,8 @@ export class OrdersService {
constructor( constructor(
public afs: AngularFirestore, public afs: AngularFirestore,
public router: Router, public router: Router,
public service: ServiceService public service: ServiceService,
public subject: SubjectService
) { ) {
this.size = 'small'; this.size = 'small';
this.color = 'Blue'; this.color = 'Blue';
......
...@@ -106,4 +106,22 @@ export class ServiceService { ...@@ -106,4 +106,22 @@ export class ServiceService {
}); });
return promise; return promise;
} }
async getBase64ImageFromUrl(imageUrl) {
const proxyUrl = 'https://cors-anywhere.herokuapp.com/'
const res = await fetch(proxyUrl + imageUrl);
const blob = await res.blob();
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.addEventListener('load', () => {
resolve(reader.result);
}, false);
reader.onerror = () => {
return reject(this);
};
reader.readAsDataURL(blob);
});
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment