Commit ce258554 by Alen Jose

ridenow

parent de5bc74c
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.techware.cmc" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.techware.cmc" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CMC</name> <name>CMC</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" /> <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform> </platform>
<engine name="android" spec="^7.1.0" />
<plugin name="cordova-plugin-datepicker" spec="^0.9.3" /> <plugin name="cordova-plugin-datepicker" spec="^0.9.3" />
<plugin name="cordova-plugin-device" spec="^1.1.4" /> <plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-facebook4" spec="^1.9.1"> <plugin name="cordova-plugin-facebook4" spec="^1.9.1">
...@@ -103,4 +102,5 @@ ...@@ -103,4 +102,5 @@
<plugin name="cordova-plugin-x-toast" spec="^2.6.2" /> <plugin name="cordova-plugin-x-toast" spec="^2.6.2" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" /> <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="mx.ferreyra.callnumber" spec="~0.0.2" /> <plugin name="mx.ferreyra.callnumber" spec="~0.0.2" />
<engine name="android" spec="latest" />
</widget> </widget>
{
"project_info": {
"project_number": "151146703576",
"firebase_url": "https://callmycab-205809.firebaseio.com",
"project_id": "callmycab-205809",
"storage_bucket": "callmycab-205809.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:151146703576:android:9f9d46cae351b483",
"android_client_info": {
"package_name": "com.techware.cmc"
}
},
"oauth_client": [
{
"client_id": "151146703576-dr7il48km7elnm2f8cfj6ru8g0adpgi6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.techware.cmc",
"certificate_hash": "8a2d0dbcb9a25ca28f72bba94cc3e8228c704744"
}
},
{
"client_id": "151146703576-j57hrjmu7vr9tcrtkh7lccld8s7h27fv.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "151146703576-j57hrjmu7vr9tcrtkh7lccld8s7h27fv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCk1_NXO6fDntAzKEl7sO-z6Ut5evHLsKQ"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "151146703576-j57hrjmu7vr9tcrtkh7lccld8s7h27fv.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -28,13 +28,15 @@ ...@@ -28,13 +28,15 @@
"@ionic-native/google-plus": "^4.7.0", "@ionic-native/google-plus": "^4.7.0",
"@ionic-native/location-accuracy": "^4.7.0", "@ionic-native/location-accuracy": "^4.7.0",
"@ionic-native/network": "^4.7.0", "@ionic-native/network": "^4.7.0",
"@ionic-native/onesignal": "^4.7.0",
"@ionic-native/splash-screen": "3.12.1", "@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "3.12.1", "@ionic-native/status-bar": "3.12.1",
"@ionic-native/toast": "^4.7.0", "@ionic-native/toast": "^4.7.0",
"@ionic/storage": "2.0.1", "@ionic/storage": "2.0.1",
"angularfire2": "^5.0.0-rc.10", "angularfire2": "^5.0.0-rc.10",
"call-number": "^1.0.1", "call-number": "^1.0.1",
"cordova-android": "^7.1.0", "cordova": "^8.0.0",
"cordova-android": "7.1.0",
"cordova-plugin-datepicker": "^0.9.3", "cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^1.1.4", "cordova-plugin-device": "^1.1.4",
"cordova-plugin-facebook4": "^1.9.1", "cordova-plugin-facebook4": "^1.9.1",
...@@ -50,6 +52,7 @@ ...@@ -50,6 +52,7 @@
"ionic-angular": "3.7.0", "ionic-angular": "3.7.0",
"ionic-plugin-keyboard": "^2.2.1", "ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0", "ionicons": "3.0.0",
"mx.ferreyra.callnumber": "~0.0.2",
"promise-polyfill": "^8.0.0", "promise-polyfill": "^8.0.0",
"rxjs": "^5.5.11", "rxjs": "^5.5.11",
"sw-toolbox": "3.6.0", "sw-toolbox": "3.6.0",
......
...@@ -7,6 +7,7 @@ import { user } from '../models/mymodel' ...@@ -7,6 +7,7 @@ import { user } from '../models/mymodel'
import { Myservice } from "../providers/myservice"; import { Myservice } from "../providers/myservice";
import { LocationAccuracy } from '@ionic-native/location-accuracy'; import { LocationAccuracy } from '@ionic-native/location-accuracy';
import { Network } from '@ionic-native/network'; import { Network } from '@ionic-native/network';
import { OneSignal } from '@ionic-native/onesignal';
@Component({ @Component({
templateUrl: 'app.html' templateUrl: 'app.html'
...@@ -17,7 +18,7 @@ export class MyApp { ...@@ -17,7 +18,7 @@ export class MyApp {
rootPage: string ; rootPage: string ;
local:user; local:user;
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public storage: Storage, public events: Events, private myservice: Myservice, private locationAccuracy: LocationAccuracy, private network: Network, public alertCtrl: AlertController) { constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public storage: Storage, public events: Events, private myservice: Myservice, private locationAccuracy: LocationAccuracy, private network: Network, public alertCtrl: AlertController, private oneSignal: OneSignal) {
this.initializeApp(); this.initializeApp();
} }
...@@ -46,6 +47,7 @@ export class MyApp { ...@@ -46,6 +47,7 @@ export class MyApp {
this.statusBar.styleDefault(); this.statusBar.styleDefault();
this.splashScreen.hide(); this.splashScreen.hide();
// this.enableLoc(); // this.enableLoc();
// this.initOnesignal()
this.network.onDisconnect().subscribe(() => { this.network.onDisconnect().subscribe(() => {
...@@ -71,6 +73,21 @@ export class MyApp { ...@@ -71,6 +73,21 @@ export class MyApp {
}); });
} }
initOnesignal() {
this.oneSignal.startInit('', '');
this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
this.oneSignal.handleNotificationReceived().subscribe(() => {
// do something when notification is received
});
this.oneSignal.handleNotificationOpened().subscribe(() => {
// do something when a notification is opened
});
this.oneSignal.endInit();}
enableLoc(){ enableLoc(){
this.locationAccuracy.canRequest().then((canRequest: boolean) => { this.locationAccuracy.canRequest().then((canRequest: boolean) => {
......
...@@ -22,6 +22,7 @@ import { SubjectService } from "../providers/subject.service"; ...@@ -22,6 +22,7 @@ import { SubjectService } from "../providers/subject.service";
import { dataService } from "../providers/common.service"; import { dataService } from "../providers/common.service";
import { Network } from '@ionic-native/network'; import { Network } from '@ionic-native/network';
import { CallNumber } from '@ionic-native/call-number'; import { CallNumber } from '@ionic-native/call-number';
import { OneSignal } from '@ionic-native/onesignal';
export const firebaseConfig = { export const firebaseConfig = {
apiKey: "AIzaSyDLrbLd4RCCh86xuTVu7-cfJ28We_cG1sU", apiKey: "AIzaSyDLrbLd4RCCh86xuTVu7-cfJ28We_cG1sU",
...@@ -64,6 +65,7 @@ export const firebaseConfig = { ...@@ -64,6 +65,7 @@ export const firebaseConfig = {
dataService, dataService,
Network, Network,
CallNumber, CallNumber,
OneSignal,
] ]
}) })
export class AppModule {} export class AppModule {}
...@@ -193,4 +193,23 @@ ...@@ -193,4 +193,23 @@
.estim_li{padding-top: 5px !important;} .estim_li{padding-top: 5px !important;}
.button-md:hover:not(.disable-hover) { .button-md:hover:not(.disable-hover) {
background: #f7941e; background: #f7941e;
}
.loader {
border: 7px solid #fff;
border-radius: 50%;
border-top: 10px solid #ff9000;
width: 50px;
height: 50px;
-webkit-animation: spin 2s linear infinite; /* Safari */
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
} }
\ No newline at end of file
...@@ -50,7 +50,7 @@ export class AddcouponPage { ...@@ -50,7 +50,7 @@ export class AddcouponPage {
this.navCtrl.push('ConfirmridePage'); this.navCtrl.push('ConfirmridePage');
} }
else else
this.navCtrl.push(''); this.navCtrl.push('RidedetailPage');
} }
checkCode() { checkCode() {
......
...@@ -23,9 +23,12 @@ export class ConfirmridePage { ...@@ -23,9 +23,12 @@ export class ConfirmridePage {
this.storage.get('user_data').then(data => { this.storage.get('user_data').then(data => {
if (data) { if (data) {
this.local = data; this.local = data;
this.book = this.data.getbookingData() this.book = this.data.getbookingData()
console.log(this.book) console.log(this.book)
var bdata = { 'book_date': this.book.date, 'drop_area': this.book.dropArea, 'pickup_area': this.book.pickArea, 'taxi_type': this.book.carDetails.car_type, 'amount': '', 'km': '', 'promocode': this.book.promocode, 'token': this.local.token, 'userid': this.local.id }
var bdata = { 'book_date': this.book.date, 'drop_area': this.book.dropArea, 'pickup_area': this.book.pickArea, 'taxi_type': this.book.carDetails.car_type, 'amount': '', 'km': '', 'promocode': this.book.promocode, 'token': this.local.token, 'userid': this.local.id, 'type': 'later' }
this.myservice.load_post(bdata, 'book_cab').subscribe(response => { this.myservice.load_post(bdata, 'book_cab').subscribe(response => {
this.myservice.hide_loader() this.myservice.hide_loader()
if (response.status == 'success') { if (response.status == 'success') {
......
...@@ -40,6 +40,9 @@ export class HomePage { ...@@ -40,6 +40,9 @@ export class HomePage {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.myservice.load_post({},'test').subscribe(response=>{
})
this.data.setbookingData('') this.data.setbookingData('')
this.storage.get('user_data').then(data=>{ this.storage.get('user_data').then(data=>{
......
<ion-header class="jr_theme_color jr_header">
<button ion-button class="jr_left jr_header_btn jr_back_icon" (click)="goBack()"></button>
<div class="jr_header_title">
<h4>Map</h4>
</div>
<button ion-button class="jr_right jr_header_btn"></button>
<div class="jr_clear"></div>
</ion-header>
<ion-content>
<div #map id="map"></div>
<div class="jr_bottom_distance_card">
<div class="jr_bottom_inside">
<input class="jr_dest_input from" placeholder="HSR Layout, Kormangala,Bengalure">
<input class="jr_dest_input to" placeholder="Jalihalli, Outercity, Bengaluru">
</div>
</div>
</ion-content>
<ion-footer>
<div class="jr_bottom_button_bay">
<button ion-button class="jr_offer_ride2">Cancel</button>
</div>
</ion-footer>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { MapPage } from './map';
@NgModule({
declarations: [
MapPage,
],
imports: [
IonicPageModule.forChild(MapPage),
],
exports: [
MapPage
]
})
export class MapPageModule {}
import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
declare var google;
@IonicPage()
@Component({
selector: 'page-map',
templateUrl: 'map.html',
})
export class MapPage {
@ViewChild('map') mapElement: ElementRef;
map: any;
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
this.loadMap();
}
loadMap(){
let latLng = new google.maps.LatLng(-34.9290, 138.6010);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
}
}
<style>
.left{
text-align: left !important;
}
.right{
text-align: right !important;
}
</style>
<ion-header class="jr_theme_color jr_header">
<button ion-button class="jr_left jr_header_btn jr_back_icon" (click)="goBack()"></button>
<div class="jr_header_title">
<h4>Quickride Details</h4>
</div>
<button ion-button class="jr_right jr_header_btn"></button>
<div class="jr_clear"></div>
</ion-header>
<ion-content padding>
<div class="jr_profile_content1">
<div class="jr_from_to">
<li>
<div class="child1 from">From<div class="jr_box1"></div></div>
<div class="child2"><strong>{{loc.from}}</strong>
<p>{{loc.fromAd}}</p></div>
<div class="jr_clear"></div>
</li>
<li>
<div class="child1 to">To</div>
<div class="child2"><strong>{{loc.to}}</strong>
<p>{{loc.toAd}}</p></div>
<div class="jr_clear"></div>
</li>
</div>
<hr>
<br>
<!-- <div class="jr_search_bottom_bay jr_padding0">
<div class="loader"></div>
</div> -->
<!-- <div class="jr_search_bottom_bay jr_padding0">
<div class="jr_search_profile">
<img src="assets/img/e_img14.png">
</div>
<div class="jr_search_profile_detail">
<br>
<h6>MARIA LORENZA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;37 Y/O</h6>
<span class="jr_star_ratting"><img src="assets/img/jr_star.png"><strong>3/5</strong>1 Rattings</span><br>
</div>
<div class="jr_clear"></div>
</div>
<br>
<hr>
<div class="jr_car_info">
<div class="">
<ion-grid class="jr_padding0">
<ion-row>
<ion-col col-2 class="jr_padding0">
<div class="jr_car_info_photo"><img src="assets/img/jr_car_img.png"></div>
</ion-col>
<ion-col col-4 class="">
<div class="jr_car_info_detail jr_padding0">
<h6>Audi A8</h6>
<p>Blue
Luxury</p>
</div>
<div class="jr_clear"></div>
</ion-col>
<ion-col col-3 class="jr_padding0">
<div class="jr_car_info_detail jr_padding0">
<p>Total</p>
<h6>300 km</h6>
</div>
<div class="jr_clear"></div>
</ion-col>
<ion-col col-3 class="jr_padding0 right">
<div class="jr_car_info_detail jr_padding0">
<p>Total Price</p>
<h6>300 km</h6>
</div>
<div class="jr_clear"></div>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div class="jr_clear"></div>
</div> -->
<div class="jr_bottom_button_bay">
<button ion-button class="jr_offer_ride2">Track Driver</button>
</div>
</div>
</ion-content>
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { RidedetailPage } from './ridedetail';
@NgModule({
declarations: [
RidedetailPage,
],
imports: [
IonicPageModule.forChild(RidedetailPage),
],
exports: [
RidedetailPage
]
})
export class RidedetailPageModule {}
import { Component, NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams, Platform } from 'ionic-angular';
import { dataService } from "../../providers/common.service";
import { Myservice } from "../../providers/myservice";
import { Storage } from "@ionic/storage";
import { user } from "../../models/mymodel";
declare var google;
@IonicPage()
@Component({
selector: 'page-ridedetail',
templateUrl: 'ridedetail.html',
})
export class RidedetailPage {
book: any;
geocoder: any;
loc = { from: '', to: '', fromAd: '', toAd: '' }
local: user
public unregisterBackButtonAction: any;
constructor(public navCtrl: NavController, public navParams: NavParams, private data: dataService, private zone: NgZone, private myservice: Myservice, private storage: Storage, public platform: Platform) {
}
ionViewDidEnter() {
// this.myservice.show_loader()
this.initializeBackButtonCustomHandler();
this.storage.get('user_data').then(data => {
if (data) {
this.local = data
this.book = this.data.getbookingData()
console.log(this.book)
var bdata = { 'book_date': this.book.date, 'drop_area': this.book.dropArea, 'pickup_area': this.book.pickArea, 'taxi_type': this.book.carDetails.car_type, 'amount': '', 'km': '', 'promocode': this.book.promocode, 'token': this.local.token, 'userid': this.local.id, 'type':'now' }
this.myservice.load_post(bdata, 'book_cab').subscribe(response => {
this.myservice.hide_loader()
if (response.status == 'success') {
this.myservice.load_post({},'checkBookingStatus')
}
else {
this.myservice.show_alert('Failed', 'Please try again')
this.navCtrl.pop()
}
})
this.geocoder = new google.maps.Geocoder();
for (let i = 0; i < 2; i++) {
if (i == 0) {
var lat = this.book.pickLat
var lng = this.book.pickLng
}
else {
var lat = this.book.dropLat
var lng = this.book.dropLng
}
var latlng = new google.maps.LatLng(lat, lng);
var This = this;
This.geocoder.geocode({ 'latLng': latlng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
if (i == 0) {
This.loc.from = results[0].address_components[0].short_name
This.loc.fromAd = results[0].formatted_address
}
else {
This.loc.to = results[0].address_components[0].short_name
This.loc.toAd = results[0].formatted_address
This.zone.run(() => { });
}
}
}
else {
console.log("Geocoder failed due to: " + status);
}
});
}
}
})
}
public initializeBackButtonCustomHandler(): void {
this.unregisterBackButtonAction = this.platform.registerBackButtonAction(() => {
// this.customHandleBackButton();
}, 10);
}
ionViewWillLeave() {
this.unregisterBackButtonAction && this.unregisterBackButtonAction();
}
}
...@@ -47,9 +47,6 @@ export class Myservice { ...@@ -47,9 +47,6 @@ export class Myservice {
post_data.secret_key = 'My_key'; post_data.secret_key = 'My_key';
post_data = JSON.stringify(post_data); post_data = JSON.stringify(post_data);
this.post_url = this.webservice_url + fn_name; this.post_url = this.webservice_url + fn_name;
// let headers = new Headers();
// headers.append('X-API-KEY', 'key_test');
// let options = new RequestOptions({ headers });
return this.http.post(`${this.post_url}`, `${post_data}`).map(res => res.json()); return this.http.post(`${this.post_url}`, `${post_data}`).map(res => res.json());
} }
......
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