bookborrowtuijianreaderguashi4/WebRoot/client/cordovatool/cordovatools.js
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
function exitApp(){
navigator.app.exitApp();
}
/****************文件上传****************/
//cordovaFlag是否有phonegap环境,从而决定是否调用本地方法
var cordovaFlag = false;
var uploadFileUrl = null;
document.addEventListener("deviceready", onDeviceReady, false);
var pictureSource; // getPicture:数据来源参数的一个常量
var destinationType; // getPicture中:设置getPicture的结果类型
function onDeviceReady() {
pictureSource = navigator.camera.PictureSourceType;
destinationType = navigator.camera.DestinationType;
cordovaFlag = true;
//getContacts();
//showComfire("提示!","测试对话框",function(index){
// alert(index);
//});
}
/**
* 读取联系人
*/
function getContacts(){
// find all contacts
var options = new ContactFindOptions();
options.filter = "";//搜索条件
options.multiple = true;
var filter = ["displayName", "phoneNumbers"];
navigator.contacts.find(filter, function(contacts){
for (var i = 0; i < contacts.length; i++) {
//for (var j = 0; j < contacts[i].phoneNumbers.length; j++) {
// alert(contacts[i].displayName+":"+contacts[i].phoneNumbers[j]);
//}
alert(contacts.length+":"+JSON.stringify(contacts[i]));
}
}, function(contactError){
alert('onError!');
}, options);
}
function getMsgs(){
}
function showComfire(title,msg,callback){
navigator.notification.confirm(
msg,
function(buttonIndex){
callback && callback(buttonIndex);
},
title,
['确定','取消']
);
}
function getFilePic(source, element) {
navigator.camera.getPicture(function (imageURI) {
uploadFileUrl = imageURI;
if(element){
$("#" + element).attr("src", imageURI);
后面还有 226 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
