Commit df58645c authored by westzmg's avatar westzmg

编译

parent 68cfcca0
......@@ -2,11 +2,11 @@
[
[
"@babel/env",
{
"modules": false,
"useBuiltIns": "usage"
}
], "@babel/react"] ,
{
"modules": false,
"useBuiltIns": "usage"
}
], "@babel/react"] ,
"plugins": [
[
"@babel/plugin-proposal-decorators",
......
# Created by .ignore support plugin (hsz.mobi)
node_modules
app/dist/
dist/
npm-debug.log
.idea/
workspace.xml
......
......@@ -167,5 +167,18 @@ export const EVENTS_TYPE = {
aliPushMessage: 'aliPushMessage', // 阿里云推送监听
};
export default {
isNative,
takePhoto,
recordVideo,
barCodeScan,
openWindow,
closeWindow,
getPosition,
launchCQDigitalSign,
launchFingerSign,
launchShare,
getToken,
}
export { default as _Bridge } from './_Bridge';
This diff is collapsed.
export { default as _Bridge } from './_Bridge';
\ No newline at end of file
module.exports = require('./dist');
......@@ -6,7 +6,7 @@
"scripts": {
"start": "PORT=15001 COMPILE_ON_DEMAND=none umi dev",
"build": "umi build",
"dist": "babel components -d libs",
"dist": "babel components -d dist",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "westzmg",
......@@ -28,6 +28,7 @@
"umi-plugin-react": "^1.14.5"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"babel-plugin-syntax-dynamic-import": "^6.18.0"
}
}
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile";
import {barCodeScan} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> {
this.setState({result: null}, async ()=>{
const result = await barCodeScan(options);
const result = await _Bridge.barCodeScan(options);
this.setState({result: result})
})
};
......
......@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button, Toast} from "antd-mobile";
import {getPosition} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -17,7 +17,7 @@ export default class extends React.Component {
Toast.loading("获取坐标");
this.setState({result: null}, async ()=>{
try {
const result = await getPosition(options);
const result = await _Bridge.getPosition(options);
this.setState({result: JSON.stringify(result)})
} catch (e) {
console.error(e)
......
......@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button} from "antd-mobile";
import {getToken} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> {
this.setState({result: null}, async ()=>{
const result = await getToken(options);
const result = await _Bridge.getToken(options);
this.setState({result: result})
})
};
......
......@@ -5,7 +5,7 @@ import {Link} from 'umi'
import 'antd-mobile/dist/antd-mobile.css'
import {Button} from "antd-mobile";
import {closeWindow} from "./_Bridge"
import {closeWindow} from "../components/_Bridge"
moment.locale("zh-CN");
......
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile";
import {launchCQDigitalSign} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> {
this.setState({result: null}, async ()=>{
const result = await launchCQDigitalSign(options);
const result = await _Bridge.launchCQDigitalSign(options);
this.setState({result: result})
})
};
......
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile";
import {launchFingerSign} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> {
this.setState({result: null}, async ()=>{
const result = await launchFingerSign(options);
const result = await _Bridge.launchFingerSign(options);
this.setState({result: result})
})
};
......
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile";
import {launchShare} from "./_Bridge"
import {_Bridge} from "../components"
import {InputItem} from "antd-mobile";
export default class extends React.Component {
......@@ -20,7 +20,7 @@ export default class extends React.Component {
const options = {
message: this.state.message
};
const result = await launchShare(options);
const result = await _Bridge.launchShare(options);
this.setState({result: result})
})
};
......
......@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button} from "antd-mobile";
import {openWindow} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -13,7 +13,7 @@ export default class extends React.Component {
}
doFunc = async (options)=> {
const result = await openWindow(options);
const result = await _Bridge.openWindow(options);
};
render() {
......
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button, Toast} from "antd-mobile";
import * as _Bridge from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......
......@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button, Toast} from "antd-mobile";
import {takePhoto} from "./_Bridge"
import {_Bridge} from "../components"
export default class extends React.Component {
constructor(props) {
......@@ -16,7 +16,7 @@ export default class extends React.Component {
doFunc = async (options)=> {
Toast.loading("正在装载");
this.setState({result: null}, async ()=>{
const result = await takePhoto(options);
const result = await _Bridge.takePhoto(options);
this.setState({result: result}, ()=>{
Toast.hide()
})
......
......@@ -43,6 +43,23 @@
resolved "https://registry.npm.taobao.org/@ant-design/icons/download/@ant-design/icons-2.1.1.tgz#7b9c08dffd4f5d41db667d9dbe5e0107d0bd9a4a"
integrity sha1-e5wI3/1PXUHbZn2dvl4BB9C9mko=
"@babel/cli@^7.8.4":
version "7.12.10"
resolved "https://registry.npm.taobao.org/@babel/cli/download/@babel/cli-7.12.10.tgz#67a1015b1cd505bde1696196febf910c4c339a48"
integrity sha1-Z6EBWxzVBb3haWGW/r+RDEwzmkg=
dependencies:
commander "^4.0.1"
convert-source-map "^1.1.0"
fs-readdir-recursive "^1.1.0"
glob "^7.0.0"
lodash "^4.17.19"
make-dir "^2.1.0"
slash "^2.0.0"
source-map "^0.5.0"
optionalDependencies:
"@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents"
chokidar "^3.4.0"
"@babel/code-frame@7.0.0":
version "7.0.0"
resolved "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0.tgz?cache=0&sync_timestamp=1608076956614&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8"
......@@ -1464,6 +1481,23 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"
"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents":
version "2.1.8-no-fsevents"
resolved "https://registry.npm.taobao.org/@nicolo-ribaudo/chokidar-2/download/@nicolo-ribaudo/chokidar-2-2.1.8-no-fsevents.tgz#da7c3996b8e6e19ebd14d82eaced2313e7769f9b"
integrity sha1-2nw5lrjm4Z69FNgurO0jE+d2n5s=
dependencies:
anymatch "^2.0.0"
async-each "^1.0.1"
braces "^2.3.2"
glob-parent "^3.1.0"
inherits "^2.0.3"
is-binary-path "^1.0.0"
is-glob "^4.0.0"
normalize-path "^3.0.0"
path-is-absolute "^1.0.0"
readdirp "^2.2.1"
upath "^1.1.1"
"@nodelib/fs.scandir@2.1.4":
version "2.1.4"
resolved "https://registry.npm.taobao.org/@nodelib/fs.scandir/download/@nodelib/fs.scandir-2.1.4.tgz?cache=0&sync_timestamp=1609074504323&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40nodelib%2Ffs.scandir%2Fdownload%2F%40nodelib%2Ffs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69"
......@@ -2937,6 +2971,11 @@ babel-plugin-react-require@3.0.0:
babel-plugin-syntax-jsx "^6.18.0"
lodash "^4.17.11"
babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0"
resolved "https://registry.npm.taobao.org/babel-plugin-syntax-dynamic-import/download/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
integrity sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=
babel-plugin-syntax-jsx@^6.18.0:
version "6.18.0"
resolved "https://registry.npm.taobao.org/babel-plugin-syntax-jsx/download/babel-plugin-syntax-jsx-6.18.0.tgz?cache=0&sync_timestamp=1593529657896&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-syntax-jsx%2Fdownload%2Fbabel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
......@@ -3705,6 +3744,21 @@ chokidar@^3.3.0, chokidar@^3.4.1:
optionalDependencies:
fsevents "~2.3.1"
chokidar@^3.4.0:
version "3.5.1"
resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-3.5.1.tgz?cache=0&sync_timestamp=1610719499558&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha1-7pznu+vSt59J8wR5nVRo4x4U5oo=
dependencies:
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.5.0"
optionalDependencies:
fsevents "~2.3.1"
chownr@^1.0.1, chownr@^1.1.1:
version "1.1.4"
resolved "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
......@@ -4025,6 +4079,11 @@ commander@^2.11.0, commander@^2.12.1, commander@^2.18.0, commander@^2.19.0, comm
resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1607931337320&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=
commander@^4.0.1:
version "4.1.1"
resolved "https://registry.npm.taobao.org/commander/download/commander-4.1.1.tgz?cache=0&sync_timestamp=1610702173050&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha1-n9YCvZNilOnp70aj9NaWQESxgGg=
commander@~2.13.0:
version "2.13.0"
resolved "https://registry.npm.taobao.org/commander/download/commander-2.13.0.tgz?cache=0&sync_timestamp=1607931337320&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
......@@ -6807,6 +6866,11 @@ fs-extra@^8.0.1:
jsonfile "^4.0.0"
universalify "^0.1.0"
fs-readdir-recursive@^1.1.0:
version "1.1.0"
resolved "https://registry.npm.taobao.org/fs-readdir-recursive/download/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
integrity sha1-4y/AMKLM7kSmtTcTCNpUvgs5fSc=
fs-write-stream-atomic@^1.0.8:
version "1.0.10"
resolved "https://registry.npm.taobao.org/fs-write-stream-atomic/download/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
......
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