Commit 5ef7866a by Adarsh K

codes-changes

parent e14d56c1
...@@ -30,6 +30,8 @@ import { FormsModule } from '@angular/forms'; ...@@ -30,6 +30,8 @@ import { FormsModule } from '@angular/forms';
import { SearchmodalPageModule } from './searchmodal/searchmodal.module'; import { SearchmodalPageModule } from './searchmodal/searchmodal.module';
import { SocialSharing } from '@ionic-native/social-sharing/ngx'; import { SocialSharing } from '@ionic-native/social-sharing/ngx';
import { CallNumber } from '@ionic-native/call-number/ngx'; import { CallNumber } from '@ionic-native/call-number/ngx';
import { sanitizeHtmlPipe } from './../config/safehtml';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
entryComponents: [], entryComponents: [],
...@@ -57,7 +59,8 @@ import { CallNumber } from '@ionic-native/call-number/ngx'; ...@@ -57,7 +59,8 @@ import { CallNumber } from '@ionic-native/call-number/ngx';
ServiceService, ServiceService,
AuthService, AuthService,
GooglePlus, GooglePlus,
SocialSharing SocialSharing,
sanitizeHtmlPipe
], ],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
......
...@@ -3,6 +3,10 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -3,6 +3,10 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { CategoriesService } from './../../config/category.service'; import { CategoriesService } from './../../config/category.service';
import { ServiceService } from './../../config/service.service'; import { ServiceService } from './../../config/service.service';
import { SearchmodalPage } from '../searchmodal/searchmodal.page';
import { SubjectService } from './../../config/subject.service';
import { ModalController } from '@ionic/angular';
@Component({ @Component({
selector: 'app-catagory', selector: 'app-catagory',
...@@ -15,7 +19,9 @@ export class CatagoryPage implements OnInit { ...@@ -15,7 +19,9 @@ export class CatagoryPage implements OnInit {
public router: Router, public router: Router,
public location: Location, public location: Location,
public categoriesService: CategoriesService, public categoriesService: CategoriesService,
public service: ServiceService public service: ServiceService,
private subjectService: SubjectService,
public modalController: ModalController
) { ) {
this.service.get('params').then((val) => { this.service.get('params').then((val) => {
this.data = val; this.data = val;
...@@ -35,4 +41,15 @@ export class CatagoryPage implements OnInit { ...@@ -35,4 +41,15 @@ export class CatagoryPage implements OnInit {
this.location.back(); this.location.back();
} }
async searchModal() {
this.subjectService.setTabData(false);
const modal = await this.modalController.create({
component: SearchmodalPage
});
modal.onDidDismiss().then(dataReturned => {
this.subjectService.setTabData(true);
});
return await modal.present();
}
} }
...@@ -77,10 +77,12 @@ export class HomePage implements OnInit { ...@@ -77,10 +77,12 @@ export class HomePage implements OnInit {
} }
private setCurrentLocation() { private setCurrentLocation() {
const This = this;
if ('geolocation' in navigator) { if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(position => { navigator.geolocation.getCurrentPosition(position => {
this.lat = position.coords.latitude; this.lat = position.coords.latitude;
this.lng = position.coords.longitude; this.lng = position.coords.longitude;
this.centerService.getNearBy(this.lat, this.lng, 10);
this.getAddress(this.lat, this.lng); this.getAddress(this.lat, this.lng);
}); });
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<div class="product_header"> <div class="product_header">
<ion-row> <ion-row>
<ion-col size="8"> <ion-col size="8">
<h3>{{product.prodName}}</h3> <h3 [innerHTML]="product.prodName"></h3>
<p> <p>
<strong <strong
><span><img src="../assets/Path61_2.png"/></span ><span><img src="../assets/Path61_2.png"/></span
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
</ul> </ul>
</div> --> </div> -->
<h5>Description</h5> <h5>Description</h5>
<p>{{product.prodDesc}}</p> <p [innerHTML]="product.prodDesc"></p>
<!--<h5> <!--<h5>
<span class="floatLeft">Reviews</span><span class="floatRight" (click)="goToPage('reviewlist')">MORE</span> <span class="floatLeft">Reviews</span><span class="floatRight" (click)="goToPage('reviewlist')">MORE</span>
<div class="clear"></div> <div class="clear"></div>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
(click)="changeFav(similar.prodId)" (click)="changeFav(similar.prodId)"
></div> ></div>
</div> </div>
<h5>{{similar.prodName}}</h5> <h5 [innerHTML]="similar.prodName"></h5>
<p>{{similar.price}}</p> <p>{{similar.price}}</p>
</li> </li>
</ion-slide> </ion-slide>
......
...@@ -11,6 +11,7 @@ import { ServiceService } from "./../../config/service.service"; ...@@ -11,6 +11,7 @@ import { ServiceService } from "./../../config/service.service";
import { SocialSharing } from "@ionic-native/social-sharing/ngx"; import { SocialSharing } from "@ionic-native/social-sharing/ngx";
import { map } from "rxjs/operators"; import { map } from "rxjs/operators";
@Component({ @Component({
selector: "app-productdetail", selector: "app-productdetail",
templateUrl: "./productdetail.page.html", templateUrl: "./productdetail.page.html",
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
></div> ></div>
<div class="featured_badge" *ngIf="product.featured">Featured</div> <div class="featured_badge" *ngIf="product.featured">Featured</div>
</div> </div>
<h5 class="ellipse" (click)="prodDetails(i)">{{product.prodName}}</h5> <h5 class="ellipse" (click)="prodDetails(i)" [innerHTML]="product.prodName"></h5>
<p (click)="prodDetails(i)"> <p (click)="prodDetails(i)">
A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0" A$ {{product.price}}<span class="offer" *ngIf="product.discount > 0"
>-{{product.discount}}%</span >-{{product.discount}}%</span
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
<li <li
*ngFor="let search of searchService.searchList" *ngFor="let search of searchService.searchList"
(click)="viewPage(search)" (click)="viewPage(search)"
> [innerHTML]="search.text">
{{search.text}}
</li> </li>
</ul> </ul>
</div> </div>
...@@ -70,4 +70,6 @@ export class SearchmodalPage implements OnInit { ...@@ -70,4 +70,6 @@ export class SearchmodalPage implements OnInit {
} }
} }
...@@ -32,7 +32,7 @@ export class OrdersService { ...@@ -32,7 +32,7 @@ export class OrdersService {
this.size = 'small'; this.size = 'small';
this.color = 'Blue'; this.color = 'Blue';
this.custId = ''; this.custId = '';
this.service.get('user').then(data => { this.service.get('userData').then(data => {
if (data) { if (data) {
data = JSON.parse(data); data = JSON.parse(data);
this.users = data; this.users = data;
...@@ -132,15 +132,15 @@ export class OrdersService { ...@@ -132,15 +132,15 @@ export class OrdersService {
// console.log(cartCount); // console.log(cartCount);
const promise = new Promise(resolve => { const promise = new Promise(resolve => {
distinctShops.forEach(item => { distinctShops.forEach(item => {
// console.log(item); console.log(item);
this.afs this.afs
.collection('orders') .collection('orders')
.add({ .add({
shopper: firebase.firestore().doc('/shoppers/' + item),
bookDate: firebase.firestore.FieldValue.serverTimestamp() bookDate: firebase.firestore.FieldValue.serverTimestamp()
}) })
.then(docRef => { .then(docRef => {
const neworderId = docRef.id; const neworderId = docRef.id;
const delivery = new firebase.firestore.GeoPoint(10.0237, 76.3116);
const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234); const pickup = new firebase.firestore.GeoPoint(10.7231, 76.1234);
const products = {}; const products = {};
const cartItem = cartGroup[item]; const cartItem = cartGroup[item];
...@@ -168,13 +168,13 @@ export class OrdersService { ...@@ -168,13 +168,13 @@ export class OrdersService {
shopper: product.shopper, shopper: product.shopper,
deliveryAddress: otherCharge.custAddress, deliveryAddress: otherCharge.custAddress,
deliveryCharge: 'A$ ' + otherCharge.deliveryCharge, deliveryCharge: 'A$ ' + otherCharge.deliveryCharge,
deliveryLocation: delivery, deliveryLocation: otherCharge.custAddress.latLng,
bookDate: firebase.firestore.FieldValue.serverTimestamp(), bookDate: firebase.firestore.FieldValue.serverTimestamp(),
orderDate: Math.floor(Date.now() / 1000), orderDate: Math.floor(Date.now() / 1000),
orderCode: this.orderCode(), orderCode: this.orderCode(),
orderId: neworderId, orderId: neworderId,
orderStatus: 1, orderStatus: 1,
pickupAddress: 'GetMi, Canberra, AUS', pickupAddress: '',
pickupLocation: pickup, pickupLocation: pickup,
promoId: null, promoId: null,
rider: firebase rider: firebase
...@@ -184,10 +184,10 @@ export class OrdersService { ...@@ -184,10 +184,10 @@ export class OrdersService {
custId: this.custId, custId: this.custId,
riderId: 'qbTKza18mWVzYG9NLIbmjMbrYjG2', riderId: 'qbTKza18mWVzYG9NLIbmjMbrYjG2',
shopperId: product.shopperId, shopperId: product.shopperId,
custName: 'Jone Doe', custName: this.users.name,
riderName: 'John', riderName: 'John',
shopperState: 0, shopperState: 0,
shopperName: 'Witchery', shopperName: '',
product: products, product: products,
discount: 'A$ ' + otherCharge.discount, discount: 'A$ ' + otherCharge.discount,
promoApplied: otherCharge.discountApplied, promoApplied: otherCharge.discountApplied,
......
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({ name: 'sanitizeHtml'})
export class sanitizeHtmlPipe implements PipeTransform {
constructor(private _sanitizer:DomSanitizer) { }
transform(value:string):SafeHtml {
value = value.replace("�", "'");
console.log(value);
return this._sanitizer.bypassSecurityTrustHtml(value);
}
}
\ No newline at end of file
...@@ -4,6 +4,7 @@ export interface Shopper { ...@@ -4,6 +4,7 @@ export interface Shopper {
phone: string; phone: string;
caption: string; caption: string;
profilePhoto: string; profilePhoto: string;
location: any;
status: boolean; status: boolean;
uid: string; uid: string;
shopName: string; shopName: string;
......
...@@ -48,6 +48,7 @@ export class ShoppersService { ...@@ -48,6 +48,7 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
location: item.location,
rate: item.rate, rate: item.rate,
centerId: item.centerId centerId: item.centerId
}; };
...@@ -88,6 +89,7 @@ export class ShoppersService { ...@@ -88,6 +89,7 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
location: item.location,
rate: item.rate, rate: item.rate,
centerId: item.centerId centerId: item.centerId
}; };
...@@ -147,6 +149,7 @@ export class ShoppersService { ...@@ -147,6 +149,7 @@ export class ShoppersService {
workingHours: item.workingHours, workingHours: item.workingHours,
caption: item.caption, caption: item.caption,
centre: item.centre, centre: item.centre,
location: item.location,
rate: item.rate, rate: item.rate,
centerId: item.centerId centerId: item.centerId
}; };
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<title>Ionic App</title> <title>Ionic App</title>
<base href="/" /> <base href="/" />
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" /> <meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" /> <meta name="msapplication-tap-highlight" content="no" />
......
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