Skip to content

Commit

Permalink
适配1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelyelfpop committed Apr 17, 2019
1 parent c0b72de commit 9f9025d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.pushsoft.imagepicker" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.pushsoft.imagepicker" version="1.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>ImagePicker</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
Expand All @@ -23,8 +23,8 @@
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-android-support-gradle-release" spec="^1.4.2">
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
<plugin name="cordova-android-support-gradle-release" spec="^3.0.0">
<variable name="ANDROID_SUPPORT_VERSION" value="28.+" />
</plugin>
<plugin name="cordova-plugin-imagepicker" spec="https://github.com/giantss/cordova-plugin-ImagePicker" />
</widget>
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.pushsoft.imagepicker",
"displayName": "ImagePicker",
"version": "1.1.0",
"version": "1.2.0",
"description": "A sample Apache Cordova application that responds to the deviceready event.",
"main": "index.js",
"scripts": {
Expand All @@ -10,15 +10,15 @@
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
"cordova-android-support-gradle-release": "^1.4.2",
"cordova-android-support-gradle-release": "^3.0.0",
"cordova-plugin-imagepicker": "git+https://github.com/giantss/cordova-plugin-ImagePicker.git",
"cordova-plugin-whitelist": "^1.3.3"
},
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
"ANDROID_SUPPORT_VERSION": "28.+"
},
"cordova-plugin-imagepicker": {}
},
Expand Down
26 changes: 25 additions & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<body>

<button id="btn1">选择图片(最大1920*1440)</button>
<button id="btn2">选择图片(自动宽高)</button>
<button id="btn2">选择图片(自动宽高)</button><br><br>
<button id="btn3">拍照(最大1920*1440)</button>
<button id="btn4">拍照(自动宽高)</button>

<div id="img_list"></div>

Expand All @@ -29,6 +31,8 @@
onDeviceReady: function () {
document.getElementById('btn1').onclick = Demo.getImage1;
document.getElementById('btn2').onclick = Demo.getImage2;
document.getElementById('btn3').onclick = Demo.getImage3;
document.getElementById('btn4').onclick = Demo.getImage4;
},

getImage1: function () {
Expand Down Expand Up @@ -57,6 +61,26 @@
});
},

getImage3: function () {
ImagePicker.takePhoto(function (result) {
Demo.showImage(result);
}, function (err) {
alert(err);
}, {
width: 1920,
height: 1440,
quality: 50
});
},

getImage4: function () {
ImagePicker.takePhoto(function (result) {
Demo.showImage(result);
}, function (err) {
alert(err);
}, {});
},

showImage: function (result) {
var list = result.images;
var imgContainer = document.getElementById("img_list");
Expand Down

0 comments on commit 9f9025d

Please sign in to comment.