Commit f16fa4a5 by Adarsh K

Merge branch 'adarsh' into 'master'

new changes See merge request !87
parents 9c39a2ca 0e5d75cc
......@@ -85,11 +85,11 @@
<div class="common-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="pop_inner">
<div class="img-wrapper">
<img src="../assets/model1_2.png" alt="Product">
<img src="../assets/basket.png" alt="Product">
</div>
<div class="content">
<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>
<span (click)="istoggle();"><img src="../assets/close.png" alt="Close"></span>
......
......@@ -54,6 +54,7 @@ export class AppComponent {
tabData = true;
isShow = false;
orderId: any;
constructor(
private platform: Platform,
......@@ -144,7 +145,27 @@ export class AppComponent {
'review'
];
const currentUrl = this.router.url.split('/');
console.log(currentUrl);
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]);
// console.log(currentUrl[1], index, this.state);
if (index > -1 || this.tabData === false) {
......@@ -223,6 +244,9 @@ export class AppComponent {
const data = change.doc.data();
if (data.orderStatus === 7) {
this.finishpop(data);
} else {
this.orderId = data.orderCode;
this.isShow = true;
}
}
});
......
......@@ -189,13 +189,22 @@ export class ProductdetailPage implements OnInit {
}
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 = {
message: desc, // not supported on some apps (Facebook, Instagram)
subject: prodName, // fi. for email
files: [image],
subject: this.unEscape(prodName), // fi. for email
files: [result],
chooserTitle: 'GetMi'
};
console.log(content);
this.socialSharing.shareWithOptions(content);
}).catch(err => console.error(err));
}
}
......@@ -8,6 +8,7 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Order, CartProd } from './services/order';
import { Products } from './services/product';
import { ServiceService } from './service.service';
import { SubjectService } from './subject.service';
import * as firebase from 'firebase';
import { CartItem } from './services/cart';
import { BehaviorSubject } from 'rxjs';
......@@ -30,7 +31,8 @@ export class OrdersService {
constructor(
public afs: AngularFirestore,
public router: Router,
public service: ServiceService
public service: ServiceService,
public subject: SubjectService
) {
this.size = 'small';
this.color = 'Blue';
......
......@@ -106,4 +106,22 @@ export class ServiceService {
});
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