Fairoj : send link via sms using external sms app and copy link with text and capture btn is disabled for tele pd

This commit is contained in:
venbatechnologies@gmail.com 2020-06-16 12:00:52 +05:30
parent 8ffe857115
commit 919b6284ae
12 changed files with 93 additions and 25 deletions

View File

@ -99,6 +99,9 @@
</plugin>
<plugin name="cordova-plugin-android-permissions" spec="1.0.2" />
<plugin name="cordova-plugin-network-information" spec="2.0.2" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.6.8">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
</plugin>
<engine name="browser" spec="5.0.4" />
<engine name="android" spec="^8.1.0" />
</widget>

15
package-lock.json generated
View File

@ -191,6 +191,11 @@
"resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-4.10.1.tgz",
"integrity": "sha512-hAyJDce6mcs+Mo7xiVyDvo+5+AiyQ39IPoSdmqEdrq6FChjgtVN13UlC9RbMS1Y95Iq3h5rrXHx9RmHd5jHF1Q=="
},
"@ionic-native/social-sharing": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@ionic-native/social-sharing/-/social-sharing-4.20.0.tgz",
"integrity": "sha512-mUCjozvaMp09UU2L9qTabw6JgVcvSxGVMJq069Oh66llgCiiGUbsKyqtbU7RIRMp74lJLZVZvxFlvfUP8hZ/Jw=="
},
"@ionic-native/splash-screen": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@ionic-native/splash-screen/-/splash-screen-4.4.0.tgz",
@ -2365,6 +2370,11 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz",
"integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q="
},
"cordova-plugin-x-socialsharing": {
"version": "5.6.8",
"resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-5.6.8.tgz",
"integrity": "sha512-R31ZQq00YNzLBwUM4VTE/uKhh/T0GEMuz/MZOw/Pu5AYIAAQkd7EMqFVhMtKs7wfHl1koiRz8+6nLDb19r2tBQ=="
},
"cordova-sqlite-storage": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-3.4.0.tgz",
@ -2803,6 +2813,11 @@
"event-emitter": "~0.3.5"
}
},
"es6-promise-plugin": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz",
"integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA=="
},
"es6-set": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",

View File

@ -33,6 +33,7 @@
"@ionic-native/launch-navigator": "^4.16.0",
"@ionic-native/location-accuracy": "^4.20.0",
"@ionic-native/network": "4.10.1",
"@ionic-native/social-sharing": "^4.20.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "^4.16.0",
"@ionic/storage": "^2.2.0",
@ -56,7 +57,9 @@
"cordova-plugin-splashscreen": "5.0.2",
"cordova-plugin-statusbar": "2.4.2",
"cordova-plugin-whitelist": "1.3.3",
"cordova-plugin-x-socialsharing": "^5.6.8",
"cordova-sqlite-storage": "3.4.0",
"es6-promise-plugin": "^4.2.2",
"hammerjs": "^2.0.8",
"ionic-angular": "3.9.2",
"ionic-img-viewer": "^2.9.0",
@ -101,7 +104,10 @@
"PLAY_SERVICES_LOCATION_VERSION": "16.+"
},
"cordova-plugin-android-permissions": {},
"cordova-plugin-network-information": {}
"cordova-plugin-network-information": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
}
},
"platforms": [
"browser",

View File

@ -54,6 +54,10 @@
},
"cordova-plugin-network-information": {
"PACKAGE_NAME": "com.sineedge.pdglender"
},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
"PACKAGE_NAME": "com.sineedge.pdglender"
}
},
"dependent_plugins": {
@ -62,6 +66,9 @@
},
"cordova-plugin-dialogs": {
"PACKAGE_NAME": "com.sineedge.pdglender"
},
"es6-promise-plugin": {
"PACKAGE_NAME": "com.sineedge.pdglender"
}
}
}

View File

@ -51,6 +51,9 @@
},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {
"PACKAGE_NAME": "com.sineedge.pdglender"
},
"cordova-plugin-x-socialsharing": {
"PACKAGE_NAME": "com.sineedge.pdglender"
}
},
"dependent_plugins": {
@ -62,6 +65,9 @@
},
"cordova-plugin-dialogs": {
"PACKAGE_NAME": "com.sineedge.pdglender"
},
"es6-promise-plugin": {
"PACKAGE_NAME": "com.sineedge.pdglender"
}
}
}

View File

@ -146,5 +146,23 @@
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-x-socialsharing": {
"source": {
"type": "registry",
"id": "cordova-plugin-x-socialsharing"
},
"is_top_level": true,
"variables": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
}
},
"es6-promise-plugin": {
"source": {
"type": "registry",
"id": "es6-promise-plugin@^4.1.0"
},
"is_top_level": false,
"variables": {}
}
}

View File

@ -90,6 +90,7 @@ import { NetworkDetectionProvider } from '../providers/network-detection/network
import { OfflineManagerProvider } from '../pages/sales_pd/providers/offline-manager/offline-manager';
import { IonicStorageProvider } from '../providers/ionic-storage/ionic-storage';
import { Network } from '@ionic-native/network';
import {SocialSharing} from '@ionic-native/social-sharing'
// need the hammerConnfig
export class HammerConfig extends HammerGestureConfig {
overrides = {
@ -194,6 +195,7 @@ export class HammerConfig extends HammerGestureConfig {
AwsServiceProvider,
QuestionCategoryProvider,
CameraProvider,Camera,LocationAccuracy,
SocialSharing,
LoadingProvider,Geolocation,AppVersion,
CameraProvider,
{

View File

@ -75,7 +75,7 @@
</div>
<ion-row style="justify-content: center">
<ion-col col-8>
<button ion-button clear color="optblue" (click)="captureImg(p_i,parent_ques)"><ion-icon style="font-size: 30px" name="md-camera"></ion-icon></button>
<button ion-button clear color="optblue" [disabled]="sales_pd_type == '2'" (click)="captureImg(p_i,parent_ques)"><ion-icon style="font-size: 30px" name="md-camera"></ion-icon></button>
</ion-col>
<!-- IMAGE STATUS ICON FOR INPROGRESS, COMPLETED AND FAILED -->
<ion-col col-4 *ngIf="parent_ques.get('is_image_status').value == true">
@ -341,7 +341,7 @@
<!-- {{single_ques.value | json}} -->
<div class="add-more-image" *ngIf="g_l">
<button ion-button clear style="color: black" (click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event,'camera',single_ques)"><ion-icon style="font-size:35px" name="md-camera"></ion-icon>+</button>
<button ion-button clear style="color: black" [disabled]="sales_pd_type == '2'" (click)="addData(g_i,parent_ques,group_ques.get('questions').value,$event,'camera',single_ques)"><ion-icon style="font-size:35px" name="md-camera"></ion-icon>+</button>
</div>
</ion-col>

View File

@ -122,8 +122,9 @@ this.sales_pd_type = localStorage.getItem('sales_pd_type')
this.sendAutomaticallyToApi()
// FOR DISPLAYING THE CUSTOMER CAPTURED IMAGE (STRUCTURED DYNAMICALLY CREATED IN FRONTEND) (***TELE PD ONLY***)
if(sales_pd_id && this.sales_pd_type && this.sales_pd_type == '2' && this.local_ques_JSON.section_id == '9' && this.networkDetection.getCurrentNetworkStatus() == ConnectionStatus.online) {
let params = {"sales_pd_id":sales_pd_id}
if(sales_pd_id && this.sales_pd_type && this.sales_pd_type == '2' && this.local_ques_JSON.section_id == '9' && !this. sales_pd_id.includes('local') &&this.networkDetection.getCurrentNetworkStatus() == ConnectionStatus.online) {
this.salesPDProvider.getData_fromLocal('sales_rand_string').then((sales_rand_string)=>{
let params = {"rand_string":sales_rand_string}
this.salesPDProvider.getSalesPDImgDataCusLink(params).subscribe(result=>{
if(result['dataStatus']){
this.updateCustomerImages(result['records'])
@ -132,8 +133,9 @@ this.sales_pd_type = localStorage.getItem('sales_pd_type')
this.loadingProvider.dismissLoader()
},err=>{
this.loadingProvider.dismissLoader()
})
}
})
})
}
else{
this.loadingProvider.dismissLoader()
}
@ -1299,10 +1301,12 @@ this.proceedonChangeProperty(modified)
if(apiresult['dataStatus']){
if(apiresult['records'] != true && typeof(apiresult['records']) != 'object'){
this.salesPDProvider.insertData_Replace('sales_pd_id_PRIMARYKEY',String(apiresult['records'])).then(local_result=>{
this.salesPDProvider.insertData_Replace('sales_rand_string',String(apiresult['rand_string'])).then(()=>{
if(!this.submit_btn){
this.sendSectiontoApi(section_data)
}
})
})
}
else
if(!this.submit_btn){

View File

@ -168,6 +168,7 @@ export class SalesPDlistPage {
primary_key = 'local_pd_id'
}
this.salesPDService.insertData_Replace('sales_pd_id_PRIMARYKEY',value_obj[primary_key]).then(()=>{
this.salesPDService.insertData_Replace('sales_rand_string',value_obj['rand_string']).then(()=>{
localStorage.setItem('product_id_salesPD',value_obj.product_id)
if(!value_obj.hasOwnProperty('sales_pd_type')&& !value_obj.sales_pd_type) {
value_obj.sales_pd_type = '1'
@ -176,6 +177,7 @@ export class SalesPDlistPage {
localStorage.setItem('sales_pd_type',value_obj.sales_pd_type)
this.navCtrl.push(SectionListPage,{product_id:value_obj.product_id,sales_pd_type:value_obj.sales_pd_type})
})
})
}
salesPDpdf(pdfdetail){
this.loaderProvider.pdloader("Processing..")

View File

@ -56,12 +56,12 @@ pd_completed.pd_complete_request_items != null">
<ion-fab bottom right #fab color="optblue" *ngIf="customer_link != '' && sales_pd_type == '2'">
<button clear ion-fab mini color="mickyColor"><ion-icon name="link"></ion-icon></button>
<ion-fab-list side="top">
<button color="mickyColor" ion-fab (click)="copyToClipBoard(customer_link, 'Customer Link is copied');fab.close();"><ion-icon name="copy"></ion-icon>
<button color="mickyColor" ion-fab (click)="copyToClipBoard(customer_link_with_text, 'Customer Link is copied');fab.close();"><ion-icon name="copy"></ion-icon>
<ion-label>Copy Link</ion-label>
</button>
<button color="disabledColor" ion-fab (click)="sendSmsViaLink();fab.close();" ><ion-icon name="mail"></ion-icon>
<ion-label style="color: #dddd">Send Link via SMS</ion-label>
<button color="mickyColor" ion-fab (click)="shareViaSMS();fab.close();" ><ion-icon name="mail"></ion-icon>
<ion-label >Send Link via SMS</ion-label>
</button>
</ion-fab-list>
</ion-fab>

View File

@ -5,7 +5,7 @@ import { Section9 } from '../home/home';
import { ToastProvider } from '../../../../providers/common-provider/toast';
import { OfflineManagerProvider } from '../../providers/offline-manager/offline-manager';
import { ConstantsProvider } from '../../../../providers/constants/constants';
import { SocialSharing } from '@ionic-native/social-sharing';
/**
* Generated class for the SectionListPage page.
*
@ -28,8 +28,10 @@ export class SectionListPage {
pd_completed: any = {};
customer_link:string=''
sales_pd_type: string;
customer_link_with_text: string;
constructor(public navCtrl: NavController, public navParams: NavParams,private SalesPDService:SalesPdProvider,private toastProvider:ToastProvider,
private offlineManager:OfflineManagerProvider,private constantProvider:ConstantsProvider) {
private offlineManager:OfflineManagerProvider,private constantProvider:ConstantsProvider,
private socialSharing:SocialSharing) {
if(this.navParams.get('product_id')){
this.product_id=this.navParams.get('product_id')
@ -51,8 +53,15 @@ export class SectionListPage {
getSectionStats() {
this.SalesPDService.getData_fromLocal('sales_pd_id_PRIMARYKEY').then((key_value)=>{
if(key_value && key_value != null && key_value != '' && key_value != undefined){
this.customer_link = this.constantProvider.environment().app_origin+'/customer/#/salespd-images/'+key_value;
this.sales_pd_id=key_value
if(!this.sales_pd_id.includes('local')) {
this.SalesPDService.getData_fromLocal('sales_rand_string').then((rand_string_sales)=>{
if(rand_string_sales) {
this.customer_link = this.constantProvider.environment().app_origin+'/customer/#/salespd-images/'+rand_string_sales;
this.customer_link_with_text = 'Dear applicant, please click the link to upload the photographs. '+this.customer_link
}
})
}
let params={sales_pd_id:this.sales_pd_id,section_id:'all'}
this.SalesPDService.getSalesPDSectionData(params).subscribe(res=>{
// console.log(this.section_template,res);
@ -204,18 +213,14 @@ export class SectionListPage {
}
this.toastProvider.lenderappmessage(user_msg)
}
sendSmsViaLink(){
this.toastProvider.lenderappmessage('Send link via SMS is disabled')
let param={
// pd_id: this.pdMaster.pd_id,
// mobile_no: this.mainApplicant.mobile_no,
// random_string: this.pdMaster.random_string,
shareViaSMS() {
this.socialSharing.shareViaSMS(this.customer_link_with_text,'').then(result=>{
console.log(result)
},err=>{
console.log(err);
alert("SMS Error "+JSON.stringify(err));
})
}
// this.pdDetails.smsLink(param).subscribe(res=>{
// if(res['dataStatus']){
// this.toast.pdTriggerappmessage('SMS Sent Successfully','primary');
// }
// })
}
}