Commit df58645c authored by westzmg's avatar westzmg

编译

parent 68cfcca0
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
[ [
[ [
"@babel/env", "@babel/env",
{ {
"modules": false, "modules": false,
"useBuiltIns": "usage" "useBuiltIns": "usage"
} }
], "@babel/react"] , ], "@babel/react"] ,
"plugins": [ "plugins": [
[ [
"@babel/plugin-proposal-decorators", "@babel/plugin-proposal-decorators",
......
# Created by .ignore support plugin (hsz.mobi) # Created by .ignore support plugin (hsz.mobi)
node_modules node_modules
app/dist/ app/dist/
dist/
npm-debug.log npm-debug.log
.idea/ .idea/
workspace.xml workspace.xml
......
...@@ -167,5 +167,18 @@ export const EVENTS_TYPE = { ...@@ -167,5 +167,18 @@ export const EVENTS_TYPE = {
aliPushMessage: 'aliPushMessage', // 阿里云推送监听 aliPushMessage: 'aliPushMessage', // 阿里云推送监听
}; };
export default {
isNative,
takePhoto,
recordVideo,
barCodeScan,
openWindow,
closeWindow,
getPosition,
launchCQDigitalSign,
launchFingerSign,
launchShare,
getToken,
}
export { default as _Bridge } from './_Bridge';
import "core-js/modules/es6.function.bind";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import "core-js/modules/es6.promise";
import "core-js/modules/es6.object.to-string";
import "regenerator-runtime/runtime";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import "core-js/modules/es6.array.index-of";
import invoke from 'react-native-webview-invoke/browser';
/*
* 检测是否app环境
* @name isNative
* @return true app环境,false 非app环境
*/
export var isNative = function isNative() {
if (!window) return false;
var userAgent = window.navigator.userAgent;
if (userAgent.indexOf('QB/NATIVE') > -1) return true;
if (userAgent.toLocaleLowerCase().indexOf('native')) return true;
return false;
};
/*
* 拍摄照片
* @name takePicture
* @详情参考 https://github.com/react-native-image-picker/react-native-image-picker
* @params opt{
* mediaType: 'photo' or 'video'
* maxWidth: To resize the image
* maxHeight: To resize the image
* videoQuality: 'low', 'medium', or 'high' on iOS, 'low' or 'high' on Android
* durationLimit: Video max duration in seconds
* quality: 0 to 1, photos
* includeBase64: If true, creates base64 string of the image (Avoid using on large image files due to performance)
* saveToPhotos: (Boolean) Only for launchCamera, saves the image/video file captured to public photo
* }
* @return {
* didCancel: true if the user cancelled the process
* errorCode: camera_unavailable/permission/others
* errorMessage: Description of the error, use it for debug purpose only
* base64: The base64 string of the image (photos only)
* uri: The uri to the local file on the device (uri might change for same file for different session so don't save it)
* width: Image dimensions (photos only)
* height: Image dimensions (photos only)
* fileSize: The file size (photos only)
* type: The file type (photos only)
* fileName: The file name
* }
*/
export var takePhoto = /*#__PURE__*/function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(opt) {
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
return _context4.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(resolve) {
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
invoke.define('takePhoto', /*#__PURE__*/function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return function (_x3) {
return _ref3.apply(this, arguments);
};
}());
invoke.define('takePhotoCompleted', /*#__PURE__*/function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(result) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context2.stop();
}
}
}, _callee2);
}));
return function (_x4) {
return _ref4.apply(this, arguments);
};
}());
_context3.next = 4;
return invoke.bind("takePhoto")(opt);
case 4:
case "end":
return _context3.stop();
}
}
}, _callee3);
}));
return function (_x2) {
return _ref2.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context4.stop();
}
}
}, _callee4);
}));
return function takePhoto(_x) {
return _ref.apply(this, arguments);
};
}();
export var recordVideo = /*#__PURE__*/function () {
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(opt) {
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
return _context8.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(resolve) {
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
invoke.define('recordVideo', /*#__PURE__*/function () {
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context5.stop();
}
}
}, _callee5);
}));
return function (_x7) {
return _ref7.apply(this, arguments);
};
}());
invoke.define('recordVideoCompleted', /*#__PURE__*/function () {
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(result) {
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context6.stop();
}
}
}, _callee6);
}));
return function (_x8) {
return _ref8.apply(this, arguments);
};
}());
_context7.next = 4;
return invoke.bind("recordVideo")(opt);
case 4:
case "end":
return _context7.stop();
}
}
}, _callee7);
}));
return function (_x6) {
return _ref6.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context8.stop();
}
}
}, _callee8);
}));
return function recordVideo(_x5) {
return _ref5.apply(this, arguments);
};
}();
/*
* 扫描二维码
* @name barCodeScan
* @return
*/
export var barCodeScan = /*#__PURE__*/function () {
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(opt) {
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
return _context12.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(resolve) {
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
while (1) {
switch (_context11.prev = _context11.next) {
case 0:
invoke.define('barCodeScan', /*#__PURE__*/function () {
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context9.stop();
}
}
}, _callee9);
}));
return function (_x11) {
return _ref11.apply(this, arguments);
};
}());
invoke.define('barCodeScanCompleted', /*#__PURE__*/function () {
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(result) {
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
while (1) {
switch (_context10.prev = _context10.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context10.stop();
}
}
}, _callee10);
}));
return function (_x12) {
return _ref12.apply(this, arguments);
};
}());
_context11.next = 4;
return invoke.bind("barCodeScan")(opt);
case 4:
case "end":
return _context11.stop();
}
}
}, _callee11);
}));
return function (_x10) {
return _ref10.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context12.stop();
}
}
}, _callee12);
}));
return function barCodeScan(_x9) {
return _ref9.apply(this, arguments);
};
}();
/*
* 打开新的WebView
* @name openWindow
* @return
*/
export var openWindow = /*#__PURE__*/function () {
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(opt) {
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
while (1) {
switch (_context15.prev = _context15.next) {
case 0:
return _context15.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(resolve) {
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
while (1) {
switch (_context14.prev = _context14.next) {
case 0:
invoke.define('openWindow', /*#__PURE__*/function () {
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(data) {
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
while (1) {
switch (_context13.prev = _context13.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context13.stop();
}
}
}, _callee13);
}));
return function (_x15) {
return _ref15.apply(this, arguments);
};
}());
_context14.next = 3;
return invoke.bind("openWindow")(opt);
case 3:
case "end":
return _context14.stop();
}
}
}, _callee14);
}));
return function (_x14) {
return _ref14.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context15.stop();
}
}
}, _callee15);
}));
return function openWindow(_x13) {
return _ref13.apply(this, arguments);
};
}();
/*
* 关闭当前的WebView
* @name closeWindow
* @return
*/
export var closeWindow = /*#__PURE__*/function () {
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(opt) {
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
while (1) {
switch (_context18.prev = _context18.next) {
case 0:
return _context18.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(resolve) {
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
while (1) {
switch (_context17.prev = _context17.next) {
case 0:
invoke.define('closeWindow', /*#__PURE__*/function () {
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(data) {
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
while (1) {
switch (_context16.prev = _context16.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context16.stop();
}
}
}, _callee16);
}));
return function (_x18) {
return _ref18.apply(this, arguments);
};
}());
_context17.next = 3;
return invoke.bind("closeWindow")(opt);
case 3:
case "end":
return _context17.stop();
}
}
}, _callee17);
}));
return function (_x17) {
return _ref17.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context18.stop();
}
}
}, _callee18);
}));
return function closeWindow(_x16) {
return _ref16.apply(this, arguments);
};
}();
/*
* 获取坐标信息
* @name getPosition
* @return
*/
export var getPosition = /*#__PURE__*/function () {
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(opt) {
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
while (1) {
switch (_context22.prev = _context22.next) {
case 0:
return _context22.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(resolve) {
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
while (1) {
switch (_context21.prev = _context21.next) {
case 0:
invoke.define('getPosition', /*#__PURE__*/function () {
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(data) {
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
while (1) {
switch (_context19.prev = _context19.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context19.stop();
}
}
}, _callee19);
}));
return function (_x21) {
return _ref21.apply(this, arguments);
};
}());
invoke.define('getPositionCompleted', /*#__PURE__*/function () {
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(result) {
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
while (1) {
switch (_context20.prev = _context20.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context20.stop();
}
}
}, _callee20);
}));
return function (_x22) {
return _ref22.apply(this, arguments);
};
}());
_context21.next = 4;
return invoke.bind("getPosition")(opt);
case 4:
case "end":
return _context21.stop();
}
}
}, _callee21);
}));
return function (_x20) {
return _ref20.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context22.stop();
}
}
}, _callee22);
}));
return function getPosition(_x19) {
return _ref19.apply(this, arguments);
};
}();
/*
* 使用重庆电子签章
* @name launchCQDigitalSign
* @return
*/
export var launchCQDigitalSign = /*#__PURE__*/function () {
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(opt) {
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
while (1) {
switch (_context26.prev = _context26.next) {
case 0:
return _context26.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(resolve) {
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
while (1) {
switch (_context25.prev = _context25.next) {
case 0:
invoke.define('launchCQDigitalSign', /*#__PURE__*/function () {
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(data) {
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
while (1) {
switch (_context23.prev = _context23.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context23.stop();
}
}
}, _callee23);
}));
return function (_x25) {
return _ref25.apply(this, arguments);
};
}());
invoke.define('launchCQDigitalSignCompleted', /*#__PURE__*/function () {
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(result) {
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
while (1) {
switch (_context24.prev = _context24.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context24.stop();
}
}
}, _callee24);
}));
return function (_x26) {
return _ref26.apply(this, arguments);
};
}());
_context25.next = 4;
return invoke.bind("launchCQDigitalSign")(opt);
case 4:
case "end":
return _context25.stop();
}
}
}, _callee25);
}));
return function (_x24) {
return _ref24.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context26.stop();
}
}
}, _callee26);
}));
return function launchCQDigitalSign(_x23) {
return _ref23.apply(this, arguments);
};
}();
/*
* 使用手写板签名
* @name launchFingerSign
* @return
*/
export var launchFingerSign = /*#__PURE__*/function () {
var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(opt) {
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
while (1) {
switch (_context30.prev = _context30.next) {
case 0:
return _context30.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(resolve) {
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
while (1) {
switch (_context29.prev = _context29.next) {
case 0:
invoke.define('launchFingerSign', /*#__PURE__*/function () {
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(data) {
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
while (1) {
switch (_context27.prev = _context27.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context27.stop();
}
}
}, _callee27);
}));
return function (_x29) {
return _ref29.apply(this, arguments);
};
}());
invoke.define('launchFingerSignCompleted', /*#__PURE__*/function () {
var _ref30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(result) {
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
while (1) {
switch (_context28.prev = _context28.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context28.stop();
}
}
}, _callee28);
}));
return function (_x30) {
return _ref30.apply(this, arguments);
};
}());
_context29.next = 4;
return invoke.bind("launchFingerSign")(opt);
case 4:
case "end":
return _context29.stop();
}
}
}, _callee29);
}));
return function (_x28) {
return _ref28.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context30.stop();
}
}
}, _callee30);
}));
return function launchFingerSign(_x27) {
return _ref27.apply(this, arguments);
};
}();
/*
* 社交应用分享
* @name launchShare
* @return
*/
export var launchShare = /*#__PURE__*/function () {
var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(opt) {
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
while (1) {
switch (_context34.prev = _context34.next) {
case 0:
return _context34.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref32 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(resolve) {
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
while (1) {
switch (_context33.prev = _context33.next) {
case 0:
invoke.define('launchShare', /*#__PURE__*/function () {
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(data) {
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
while (1) {
switch (_context31.prev = _context31.next) {
case 0:
resolve(data);
case 1:
case "end":
return _context31.stop();
}
}
}, _callee31);
}));
return function (_x33) {
return _ref33.apply(this, arguments);
};
}());
invoke.define('launchShareCompleted', /*#__PURE__*/function () {
var _ref34 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(result) {
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
while (1) {
switch (_context32.prev = _context32.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context32.stop();
}
}
}, _callee32);
}));
return function (_x34) {
return _ref34.apply(this, arguments);
};
}());
_context33.next = 4;
return invoke.bind("launchShare")(opt);
case 4:
case "end":
return _context33.stop();
}
}
}, _callee33);
}));
return function (_x32) {
return _ref32.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context34.stop();
}
}
}, _callee34);
}));
return function launchShare(_x31) {
return _ref31.apply(this, arguments);
};
}();
/*
* 获取token
* @name getToken
* @return
*/
export var getToken = /*#__PURE__*/function () {
var _ref35 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
while (1) {
switch (_context38.prev = _context38.next) {
case 0:
return _context38.abrupt("return", new Promise( /*#__PURE__*/function () {
var _ref36 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(resolve) {
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
while (1) {
switch (_context37.prev = _context37.next) {
case 0:
invoke.define('getToken', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
while (1) {
switch (_context35.prev = _context35.next) {
case 0:
resolve();
case 1:
case "end":
return _context35.stop();
}
}
}, _callee35);
})));
invoke.define('getTokenCompleted', /*#__PURE__*/function () {
var _ref38 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(result) {
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
while (1) {
switch (_context36.prev = _context36.next) {
case 0:
resolve(result);
case 1:
case "end":
return _context36.stop();
}
}
}, _callee36);
}));
return function (_x36) {
return _ref38.apply(this, arguments);
};
}());
_context37.next = 4;
return invoke.bind("getToken")();
case 4:
case "end":
return _context37.stop();
}
}
}, _callee37);
}));
return function (_x35) {
return _ref36.apply(this, arguments);
};
}()));
case 1:
case "end":
return _context38.stop();
}
}
}, _callee38);
}));
return function getToken() {
return _ref35.apply(this, arguments);
};
}();
export var EVENTS_TYPE = {
keyboardWillShow: 'keyboardWillShow',
// 键盘即将出现
keyboardDidShow: 'keyboardDidShow',
// 键盘已经出现
keyboardDidHide: 'keyboardDidHide',
// 键盘已经隐藏
keyboardWillHide: 'keyboardWillHide',
// 键盘即将隐藏
appStateChange: 'appStateChange',
// app前后台切换
aliPushMessage: 'aliPushMessage' // 阿里云推送监听
};
export default {
isNative: isNative,
takePhoto: takePhoto,
recordVideo: recordVideo,
barCodeScan: barCodeScan,
openWindow: openWindow,
closeWindow: closeWindow,
getPosition: getPosition,
launchCQDigitalSign: launchCQDigitalSign,
launchFingerSign: launchFingerSign,
launchShare: launchShare,
getToken: getToken
};
\ No newline at end of file
export { default as _Bridge } from './_Bridge';
\ No newline at end of file
module.exports = require('./dist');
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts": { "scripts": {
"start": "PORT=15001 COMPILE_ON_DEMAND=none umi dev", "start": "PORT=15001 COMPILE_ON_DEMAND=none umi dev",
"build": "umi build", "build": "umi build",
"dist": "babel components -d libs", "dist": "babel components -d dist",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "westzmg", "author": "westzmg",
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
"umi-plugin-react": "^1.14.5" "umi-plugin-react": "^1.14.5"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.8.4",
"babel-plugin-syntax-dynamic-import": "^6.18.0"
} }
} }
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {barCodeScan} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -15,7 +15,7 @@ export default class extends React.Component { ...@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> { doFunc = async (options)=> {
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
const result = await barCodeScan(options); const result = await _Bridge.barCodeScan(options);
this.setState({result: result}) this.setState({result: result})
}) })
}; };
......
...@@ -3,7 +3,7 @@ import moment from 'moment' ...@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button, Toast} from "antd-mobile"; import {Button, Toast} from "antd-mobile";
import {getPosition} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -17,7 +17,7 @@ export default class extends React.Component { ...@@ -17,7 +17,7 @@ export default class extends React.Component {
Toast.loading("获取坐标"); Toast.loading("获取坐标");
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
try { try {
const result = await getPosition(options); const result = await _Bridge.getPosition(options);
this.setState({result: JSON.stringify(result)}) this.setState({result: JSON.stringify(result)})
} catch (e) { } catch (e) {
console.error(e) console.error(e)
......
...@@ -3,7 +3,7 @@ import moment from 'moment' ...@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {getToken} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -15,7 +15,7 @@ export default class extends React.Component { ...@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> { doFunc = async (options)=> {
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
const result = await getToken(options); const result = await _Bridge.getToken(options);
this.setState({result: result}) this.setState({result: result})
}) })
}; };
......
...@@ -5,7 +5,7 @@ import {Link} from 'umi' ...@@ -5,7 +5,7 @@ import {Link} from 'umi'
import 'antd-mobile/dist/antd-mobile.css' import 'antd-mobile/dist/antd-mobile.css'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {closeWindow} from "./_Bridge" import {closeWindow} from "../components/_Bridge"
moment.locale("zh-CN"); moment.locale("zh-CN");
......
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {launchCQDigitalSign} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -15,7 +15,7 @@ export default class extends React.Component { ...@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> { doFunc = async (options)=> {
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
const result = await launchCQDigitalSign(options); const result = await _Bridge.launchCQDigitalSign(options);
this.setState({result: result}) this.setState({result: result})
}) })
}; };
......
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {launchFingerSign} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -15,7 +15,7 @@ export default class extends React.Component { ...@@ -15,7 +15,7 @@ export default class extends React.Component {
doFunc = async (options)=> { doFunc = async (options)=> {
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
const result = await launchFingerSign(options); const result = await _Bridge.launchFingerSign(options);
this.setState({result: result}) this.setState({result: result})
}) })
}; };
......
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {launchShare} from "./_Bridge" import {_Bridge} from "../components"
import {InputItem} from "antd-mobile"; import {InputItem} from "antd-mobile";
export default class extends React.Component { export default class extends React.Component {
...@@ -20,7 +20,7 @@ export default class extends React.Component { ...@@ -20,7 +20,7 @@ export default class extends React.Component {
const options = { const options = {
message: this.state.message message: this.state.message
}; };
const result = await launchShare(options); const result = await _Bridge.launchShare(options);
this.setState({result: result}) this.setState({result: result})
}) })
}; };
......
...@@ -3,7 +3,7 @@ import moment from 'moment' ...@@ -3,7 +3,7 @@ import moment from 'moment'
import {Button} from "antd-mobile"; import {Button} from "antd-mobile";
import {openWindow} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -13,7 +13,7 @@ export default class extends React.Component { ...@@ -13,7 +13,7 @@ export default class extends React.Component {
} }
doFunc = async (options)=> { doFunc = async (options)=> {
const result = await openWindow(options); const result = await _Bridge.openWindow(options);
}; };
render() { render() {
......
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button, Toast} from "antd-mobile"; import {Button, Toast} from "antd-mobile";
import * as _Bridge from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -3,7 +3,7 @@ import _ from 'lodash' ...@@ -3,7 +3,7 @@ import _ from 'lodash'
import {Button, Toast} from "antd-mobile"; import {Button, Toast} from "antd-mobile";
import {takePhoto} from "./_Bridge" import {_Bridge} from "../components"
export default class extends React.Component { export default class extends React.Component {
constructor(props) { constructor(props) {
...@@ -16,7 +16,7 @@ export default class extends React.Component { ...@@ -16,7 +16,7 @@ export default class extends React.Component {
doFunc = async (options)=> { doFunc = async (options)=> {
Toast.loading("正在装载"); Toast.loading("正在装载");
this.setState({result: null}, async ()=>{ this.setState({result: null}, async ()=>{
const result = await takePhoto(options); const result = await _Bridge.takePhoto(options);
this.setState({result: result}, ()=>{ this.setState({result: result}, ()=>{
Toast.hide() Toast.hide()
}) })
......
...@@ -43,6 +43,23 @@ ...@@ -43,6 +43,23 @@
resolved "https://registry.npm.taobao.org/@ant-design/icons/download/@ant-design/icons-2.1.1.tgz#7b9c08dffd4f5d41db667d9dbe5e0107d0bd9a4a" resolved "https://registry.npm.taobao.org/@ant-design/icons/download/@ant-design/icons-2.1.1.tgz#7b9c08dffd4f5d41db667d9dbe5e0107d0bd9a4a"
integrity sha1-e5wI3/1PXUHbZn2dvl4BB9C9mko= 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": "@babel/code-frame@7.0.0":
version "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" 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 @@ ...@@ -1464,6 +1481,23 @@
call-me-maybe "^1.0.1" call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0" 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": "@nodelib/fs.scandir@2.1.4":
version "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" 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: ...@@ -2937,6 +2971,11 @@ babel-plugin-react-require@3.0.0:
babel-plugin-syntax-jsx "^6.18.0" babel-plugin-syntax-jsx "^6.18.0"
lodash "^4.17.11" 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: babel-plugin-syntax-jsx@^6.18.0:
version "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" 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: ...@@ -3705,6 +3744,21 @@ chokidar@^3.3.0, chokidar@^3.4.1:
optionalDependencies: optionalDependencies:
fsevents "~2.3.1" 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: chownr@^1.0.1, chownr@^1.1.1:
version "1.1.4" version "1.1.4"
resolved "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" 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 ...@@ -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" 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= 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: commander@~2.13.0:
version "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" 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: ...@@ -6807,6 +6866,11 @@ fs-extra@^8.0.1:
jsonfile "^4.0.0" jsonfile "^4.0.0"
universalify "^0.1.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: fs-write-stream-atomic@^1.0.8:
version "1.0.10" version "1.0.10"
resolved "https://registry.npm.taobao.org/fs-write-stream-atomic/download/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" 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