From ed8f3a2774cf5b2724171569d6e51dec0b35d6f2 Mon Sep 17 00:00:00 2001 From: "Gui.H" Date: Tue, 12 Apr 2022 23:23:11 +0800 Subject: [PATCH] fix: update snap --- .../__snapshots__/alipay.spec.ts.snap | 2732 +-- .../__snapshots__/babel.spec.ts.snap | 2982 ++-- .../__snapshots__/bytedance.spec.ts.snap | 1828 +- .../__snapshots__/common-style.spec.ts.snap | 3078 ++-- .../compiler-macros.spec.ts.snap | 2976 ++-- .../__snapshots__/config.spec.ts.snap | 9884 +++++------ .../__snapshots__/css-modules.spec.ts.snap | 6984 ++++---- .../__snapshots__/custom-tabbar.spec.ts.snap | 2052 +-- .../__tests__/__snapshots__/jd.spec.ts.snap | 4575 ++--- .../__snapshots__/parse-html.spec.ts.snap | 2984 ++-- .../__snapshots__/prerender.spec.ts.snap | 10093 +++++------ .../__tests__/__snapshots__/qq.spec.ts.snap | 5572 +++--- .../__snapshots__/react.spec.ts.snap | 2717 ++- .../__tests__/__snapshots__/sass.spec.ts.snap | 14666 +++++++--------- .../__snapshots__/subpackages.spec.ts.snap | 2131 +-- .../__tests__/__snapshots__/swan.spec.ts.snap | 2231 ++- .../__snapshots__/tabbar.spec.ts.snap | 6059 +++---- .../__tests__/__snapshots__/ts.spec.ts.snap | 3131 ++-- .../__tests__/__snapshots__/vue.spec.ts.snap | 1233 +- .../__tests__/__snapshots__/vue3.spec.ts.snap | 1498 +- .../__snapshots__/wx-hybrid.spec.ts.snap | 1378 +- 21 files changed, 38013 insertions(+), 52771 deletions(-) diff --git a/packages/taro-mini-runner/src/__tests__/__snapshots__/alipay.spec.ts.snap b/packages/taro-mini-runner/src/__tests__/__snapshots__/alipay.spec.ts.snap index 1cd77cb39d0c..90bb23c5d24d 100644 --- a/packages/taro-mini-runner/src/__tests__/__snapshots__/alipay.spec.ts.snap +++ b/packages/taro-mini-runner/src/__tests__/__snapshots__/alipay.spec.ts.snap @@ -123,106 +123,149 @@ exports[`alipay should build alipay app 2`] = ` /** filePath: dist\\\\taro.js **/ (my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 1 ], { - 0: function(module, exports, __webpack_require__) { + 0: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _default = \\"taro-runtime-mock\\"; - exports.default = _default; + __webpack_require__.r(__webpack_exports__); + __webpack_exports__[\\"default\\"] = \\"taro-runtime-mock\\"; }, - 16: function(module, exports, __webpack_require__) { + 3: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _default = \\"taro-components-mock\\"; - exports.default = _default; + var _unused_webpack_default_export = \\"taro-components-mock\\"; }, - 6: function(module, exports, __webpack_require__) { + 9: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _default = \\"taro-react-mock\\"; - exports.default = _default; + __webpack_exports__[\\"a\\"] = \\"taro-react-mock\\"; } } ]); /** filePath: dist\\\\common.js **/ (my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 2 ], { - 2: function(module, exports, __webpack_require__) { + 2: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _default = \\"react-mock\\"; - exports.default = _default; + __webpack_require__.r(__webpack_exports__); + __webpack_exports__[\\"default\\"] = \\"react-mock\\"; } } ]); /** filePath: dist\\\\vendors.js **/ -(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 3 ], { - 12: function(module, exports) { - function _typeof(obj) { - \\"@babel/helpers - typeof\\"; - return module.exports = _typeof = \\"function\\" == typeof Symbol && \\"symbol\\" == typeof Symbol.iterator ? function(obj) { - return typeof obj; - } : function(obj) { - return obj && \\"function\\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \\"symbol\\" : typeof obj; - }, module.exports.__esModule = true, module.exports[\\"default\\"] = module.exports, - _typeof(obj); +(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 3 ], [ , , , , function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.d(__webpack_exports__, \\"a\\", (function() { + return _classCallCheck; + })); + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError(\\"Cannot call a class as a function\\"); } - module.exports = _typeof, module.exports.__esModule = true, module.exports[\\"default\\"] = module.exports; - }, - 3: function(module, exports, __webpack_require__) { - var _typeof = __webpack_require__(12)[\\"default\\"]; - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== \\"function\\") return null; - var cacheBabelInterop = new WeakMap; - var cacheNodeInterop = new WeakMap; - return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); + } +}, function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.d(__webpack_exports__, \\"a\\", (function() { + return _createClass; + })); + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if (\\"value\\" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || _typeof(obj) !== \\"object\\" && typeof obj !== \\"function\\") { - return { - default: obj - }; - } - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) { - return cache.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== \\"default\\" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj[\\"default\\"] = obj; - if (cache) { - cache.set(obj, newObj); + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, \\"prototype\\", { + writable: false + }); + return Constructor; + } +}, function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.d(__webpack_exports__, \\"a\\", (function() { + return _createSuper; + })); + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _isNativeReflectConstruct() { + if (typeof Reflect === \\"undefined\\" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === \\"function\\") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))); + return true; + } catch (e) { + return false; + } + } + function _typeof(obj) { + \\"@babel/helpers - typeof\\"; + return _typeof = \\"function\\" == typeof Symbol && \\"symbol\\" == typeof Symbol.iterator ? function(obj) { + return typeof obj; + } : function(obj) { + return obj && \\"function\\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \\"symbol\\" : typeof obj; + }, _typeof(obj); + } + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError(\\"this hasn't been initialised - super() hasn't been called\\"); + } + return self; + } + function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === \\"object\\" || typeof call === \\"function\\")) { + return call; + } else if (call !== void 0) { + throw new TypeError(\\"Derived constructors may only return object or undefined\\"); + } + return _assertThisInitialized(self); + } + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); } - return newObj; + return _possibleConstructorReturn(this, result); + }; + } +}, function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.d(__webpack_exports__, \\"a\\", (function() { + return _inherits; + })); + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _inherits(subClass, superClass) { + if (typeof superClass !== \\"function\\" && superClass !== null) { + throw new TypeError(\\"Super expression must either be null or a function\\"); } - module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports[\\"default\\"] = module.exports; + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, \\"prototype\\", { + writable: false + }); + if (superClass) _setPrototypeOf(subClass, superClass); } -} ]); +} ] ]); /** filePath: dist\\\\app.acss **/ @@ -236,1119 +279,1265 @@ require(\\"./vendors\\"); require(\\"./taro\\"); -(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 4 ], [ , function(module, exports, __webpack_require__) { - \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = exports.EMPTY_OBJ = void 0; - exports.isArray = isArray; - exports.isFunction = isFunction; - exports.mergeInternalComponents = mergeInternalComponents; - exports.mergeReconciler = mergeReconciler; - exports.processApis = processApis; - var _default = \\"taro\\"; - exports.default = _default; - function mergeReconciler() {} - function mergeInternalComponents() {} - function isFunction() {} - function isArray() {} - function processApis() {} - const EMPTY_OBJ = {}; - exports.EMPTY_OBJ = EMPTY_OBJ; -}, , , function(module, exports, __webpack_require__) { - \\"use strict\\"; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.connectReactPage = connectReactPage; - exports.createNativeComponentConfig = createNativeComponentConfig; - exports.createReactApp = createReactApp; - exports.setReconciler = setReconciler; - exports.useTitleClick = exports.useTabItemTap = exports.useShareTimeline = exports.useShareAppMessage = exports.useScope = exports.useRouter = exports.useResize = exports.useReady = exports.useReachBottom = exports.usePullIntercept = exports.usePullDownRefresh = exports.usePageScroll = exports.useOptionMenuClick = exports.useDidShow = exports.useDidHide = exports.useAddToFavorites = void 0; - var _runtime = __webpack_require__(0); - var _shared = __webpack_require__(1); - const reactMeta = { - PageContext: _shared.EMPTY_OBJ, - R: _shared.EMPTY_OBJ - }; - const HOOKS_APP_ID = \\"taro-app\\"; - function isClassComponent(R, component) { - var _a; - const prototype = component.prototype; - if ((_a = component.displayName) === null || _a === void 0 ? void 0 : _a.includes(\\"Connect\\")) return false; - return (0, _shared.isFunction)(component.render) || !!(prototype === null || prototype === void 0 ? void 0 : prototype.isReactComponent) || prototype instanceof R.Component; - } - function ensureIsArray(item) { - if ((0, _shared.isArray)(item)) { - return item; - } else { - return item ? [ item ] : []; - } - } - function setDefaultDescriptor(obj) { - obj.writable = true; - obj.enumerable = true; - return obj; - } - function setRouterParams(options) { - _runtime.Current.router = Object.assign({ - params: options === null || options === void 0 ? void 0 : options.query - }, options); - } - const taroHooks = lifecycle => fn => { - const {R: React, PageContext: PageContext} = reactMeta; - const id = React.useContext(PageContext) || HOOKS_APP_ID; - const fnRef = React.useRef(fn); - if (fnRef.current !== fn) fnRef.current = fn; - React.useLayoutEffect(() => { - let inst = (0, _runtime.getPageInstance)(id); - let first = false; - if (inst == null) { - first = true; - inst = Object.create(null); - } - inst = inst; - const callback = (...args) => fnRef.current(...args); - if ((0, _shared.isFunction)(inst[lifecycle])) { - inst[lifecycle] = [ inst[lifecycle], callback ]; - } else { - inst[lifecycle] = [ ...inst[lifecycle] || [], callback ]; - } - if (first) { - (0, _runtime.injectPageInstance)(inst, id); - } - return () => { - const inst = (0, _runtime.getPageInstance)(id); - const list = inst[lifecycle]; - if (list === callback) { - inst[lifecycle] = undefined; - } else if ((0, _shared.isArray)(list)) { - inst[lifecycle] = list.filter(item => item !== callback); - } - }; - }, []); - }; - const useDidShow = taroHooks(\\"componentDidShow\\"); - exports.useDidShow = useDidShow; - const useDidHide = taroHooks(\\"componentDidHide\\"); - exports.useDidHide = useDidHide; - const usePullDownRefresh = taroHooks(\\"onPullDownRefresh\\"); - exports.usePullDownRefresh = usePullDownRefresh; - const useReachBottom = taroHooks(\\"onReachBottom\\"); - exports.useReachBottom = useReachBottom; - const usePageScroll = taroHooks(\\"onPageScroll\\"); - exports.usePageScroll = usePageScroll; - const useResize = taroHooks(\\"onResize\\"); - exports.useResize = useResize; - const useShareAppMessage = taroHooks(\\"onShareAppMessage\\"); - exports.useShareAppMessage = useShareAppMessage; - const useTabItemTap = taroHooks(\\"onTabItemTap\\"); - exports.useTabItemTap = useTabItemTap; - const useTitleClick = taroHooks(\\"onTitleClick\\"); - exports.useTitleClick = useTitleClick; - const useOptionMenuClick = taroHooks(\\"onOptionMenuClick\\"); - exports.useOptionMenuClick = useOptionMenuClick; - const usePullIntercept = taroHooks(\\"onPullIntercept\\"); - exports.usePullIntercept = usePullIntercept; - const useShareTimeline = taroHooks(\\"onShareTimeline\\"); - exports.useShareTimeline = useShareTimeline; - const useAddToFavorites = taroHooks(\\"onAddToFavorites\\"); - exports.useAddToFavorites = useAddToFavorites; - const useReady = taroHooks(\\"onReady\\"); - exports.useReady = useReady; - const useRouter = (dynamic = false) => { - const React = reactMeta.R; - return dynamic ? _runtime.Current.router : React.useMemo(() => _runtime.Current.router, []); - }; - exports.useRouter = useRouter; - const useScope = () => undefined; - exports.useScope = useScope; - var taroHooks$1 = Object.freeze({ - __proto__: null, - useDidShow: useDidShow, - useDidHide: useDidHide, - usePullDownRefresh: usePullDownRefresh, - useReachBottom: useReachBottom, - usePageScroll: usePageScroll, - useResize: useResize, - useShareAppMessage: useShareAppMessage, - useTabItemTap: useTabItemTap, - useTitleClick: useTitleClick, - useOptionMenuClick: useOptionMenuClick, - usePullIntercept: usePullIntercept, - useShareTimeline: useShareTimeline, - useAddToFavorites: useAddToFavorites, - useReady: useReady, - useRouter: useRouter, - useScope: useScope - }); - let h$1; - let ReactDOM$1; - const pageKeyId = (0, _runtime.incrementId)(); - const hooks$1 = _runtime.container.get(_runtime.SERVICE_IDENTIFIER.Hooks); - function setReconciler(ReactDOM) { - var _a; - hooks$1.getLifecycle = function(instance, lifecycle) { - lifecycle = lifecycle.replace(/^on(Show|Hide)$/, \\"componentDid$1\\"); - return instance[lifecycle]; - }; - (_a = hooks$1.modifyMpEventImpls) === null || _a === void 0 ? void 0 : _a.push((function(event) { - event.type = event.type.replace(/-/g, \\"\\"); +(my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 4 ], { + 1: function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.d(__webpack_exports__, \\"f\\", (function() { + return mergeReconciler; })); - hooks$1.batchedEventUpdates = function(cb) { - ReactDOM.unstable_batchedUpdates(cb); - }; - hooks$1.mergePageInstance = function(prev, next) { - if (!prev || !next) return; - if (\\"constructor\\" in prev) return; - Object.keys(prev).forEach(item => { - const prevList = prev[item]; - const nextList = ensureIsArray(next[item]); - next[item] = nextList.concat(prevList); - }); - }; - if (false) {} - } - function connectReactPage(R, id) { - return Page => { - const isReactComponent = isClassComponent(R, Page); - const inject = node => node && (0, _runtime.injectPageInstance)(node, id); - const refs = isReactComponent ? { - ref: inject - } : { - forwardedRef: inject, - reactReduxForwardedRef: inject - }; - if (reactMeta.PageContext === _shared.EMPTY_OBJ) { - reactMeta.PageContext = R.createContext(\\"\\"); - } - return class PageWrapper extends R.Component { - constructor() { - super(...arguments); - this.state = { - hasError: false - }; + __webpack_require__.d(__webpack_exports__, \\"e\\", (function() { + return mergeInternalComponents; + })); + __webpack_require__.d(__webpack_exports__, \\"d\\", (function() { + return isFunction; + })); + __webpack_require__.d(__webpack_exports__, \\"c\\", (function() { + return isArray; + })); + __webpack_require__.d(__webpack_exports__, \\"g\\", (function() { + return processApis; + })); + __webpack_require__.d(__webpack_exports__, \\"a\\", (function() { + return EMPTY_OBJ; + })); + var _unused_webpack_default_export = \\"taro\\"; + function mergeReconciler() {} + function mergeInternalComponents() {} + function isFunction() {} + function isArray() {} + function processApis() {} + var EMPTY_OBJ = {}; + }, + 12: function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + (function(navigator) { + var _tarojs_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + var needPromiseApis = new Set([ \\"addCardAuth\\", \\"getOpenUserInfo\\", \\"chooseAlipayContact\\", \\"chooseCity\\", \\"chooseContact\\", \\"choosePhoneContact\\", \\"datePicker\\", \\"getAddress\\", \\"getAuthCode\\", \\"getPhoneNumber\\", \\"getRunData\\", \\"getRunScene\\", \\"getServerTime\\", \\"getTitleColor\\", \\"rsa\\", \\"paySignCenter\\", \\"tradePay\\", \\"isCollected\\", \\"multiLevelSelect\\", \\"onLocatedComplete\\", \\"optionsSelect\\", \\"prompt\\", \\"regionPicker\\", \\"setLocatedCity\\", \\"showAuthGuide\\", \\"textRiskIdentification\\", \\"vibrate\\", \\"watchShake\\", \\"connectBLEDevice\\", \\"disconnectBLEDevice\\", \\"makeBluetoothPair\\", \\"writeBLECharacteristicValue\\", \\"readBLECharacteristicValue\\", \\"notifyBLECharacteristicValueChange\\", \\"getBLEDeviceServices\\", \\"getBLEDeviceCharacteristics\\", \\"openBluetoothAdapter\\", \\"closeBluetoothAdapter\\", \\"getBluetoothAdapterState\\", \\"startBluetoothDevicesDiscovery\\", \\"stopBluetoothDevicesDiscovery\\", \\"getBluetoothDevices\\", \\"getConnectedBluetoothDevices\\" ]); + var apiDiff = { + showActionSheet: { + options: { + change: [ { + old: \\"itemList\\", + new: \\"items\\" + } ] + } + }, + showToast: { + options: { + change: [ { + old: \\"title\\", + new: \\"content\\" + }, { + old: \\"icon\\", + new: \\"type\\" + } ] + } + }, + showLoading: { + options: { + change: [ { + old: \\"title\\", + new: \\"content\\" + } ] + } + }, + setNavigationBarTitle: { + alias: \\"setNavigationBar\\" + }, + setNavigationBarColor: { + alias: \\"setNavigationBar\\" + }, + saveImageToPhotosAlbum: { + alias: \\"saveImage\\", + options: { + change: [ { + old: \\"filePath\\", + new: \\"url\\" + } ] + } + }, + previewImage: { + options: { + set: [ { + key: \\"current\\", + value: function value(options) { + return options.urls.indexOf(options.current || options.urls[0]); + } + } ] + } + }, + getFileInfo: { + options: { + change: [ { + old: \\"filePath\\", + new: \\"apFilePath\\" + } ] + } + }, + getSavedFileInfo: { + options: { + change: [ { + old: \\"filePath\\", + new: \\"apFilePath\\" + } ] + } + }, + removeSavedFile: { + options: { + change: [ { + old: \\"filePath\\", + new: \\"apFilePath\\" + } ] + } + }, + saveFile: { + options: { + change: [ { + old: \\"tempFilePath\\", + new: \\"apFilePath\\" + } ] + } + }, + openLocation: { + options: { + set: [ { + key: \\"latitude\\", + value: function value(options) { + return String(options.latitude); + } + }, { + key: \\"longitude\\", + value: function value(options) { + return String(options.longitude); + } + } ] + } + }, + uploadFile: { + options: { + change: [ { + old: \\"name\\", + new: \\"fileName\\" + } ] + } + }, + getClipboardData: { + alias: \\"getClipboard\\" + }, + setClipboardData: { + alias: \\"setClipboard\\", + options: { + change: [ { + old: \\"data\\", + new: \\"text\\" + } ] + } + }, + makePhoneCall: { + options: { + change: [ { + old: \\"phoneNumber\\", + new: \\"number\\" + } ] + } + }, + scanCode: { + alias: \\"scan\\", + options: { + change: [ { + old: \\"onlyFromCamera\\", + new: \\"hideAlbum\\" + } ], + set: [ { + key: \\"type\\", + value: function value(options) { + return options.scanType && options.scanType[0].slice(0, -4) || \\"qr\\"; + } + } ] + } + }, + setScreenBrightness: { + options: { + change: [ { + old: \\"value\\", + new: \\"brightness\\" + } ] + } + }, + onBLEConnectionStateChange: { + alias: \\"onBLEConnectionStateChanged\\" + }, + offBLEConnectionStateChange: { + alias: \\"offBLEConnectionStateChanged\\" + }, + createBLEConnection: { + alias: \\"connectBLEDevice\\" + }, + closeBLEConnection: { + alias: \\"disconnectBLEDevice\\" } - static getDerivedStateFromError(error) { - false && false; - return { - hasError: true + }; + var nativeRequest = my.canIUse(\\"request\\") ? my.request : my.httpRequest; + function request(options) { + options = options || {}; + if (typeof options === \\"string\\") { + options = { + url: options }; } - componentDidCatch(error, info) { - if (false) {} - } - render() { - const children = this.state.hasError ? [] : h$1(reactMeta.PageContext.Provider, { - value: id - }, h$1(Page, Object.assign(Object.assign({}, this.props), refs))); - if (false) {} else { - return h$1(\\"root\\", { - id: id - }, children); + var defaultHeaders = { + \\"content-type\\": \\"application/json\\" + }; + options.headers = defaultHeaders; + if (options.header) { + for (var k in options.header) { + var lowerK = k.toLocaleLowerCase(); + options.headers[lowerK] = options.header[k]; } + delete options.header; } - }; - }; - } - function createReactApp(App, react, dom, config) { - var _a; - if (false) {} - reactMeta.R = react; - h$1 = react.createElement; - ReactDOM$1 = dom; - const appInstanceRef = react.createRef(); - const isReactComponent = isClassComponent(react, App); - let appWrapper; - setReconciler(ReactDOM$1); - function getAppInstance() { - return appInstanceRef.current; - } - class AppWrapper extends react.Component { - constructor() { - super(...arguments); - this.pages = []; - this.elements = []; - } - mount(pageComponent, id, cb) { - const pageWrapper = connectReactPage(react, id)(pageComponent); - const key = id + pageKeyId(); - const page = () => h$1(pageWrapper, { - key: key, - tid: id - }); - this.pages.push(page); - this.forceUpdate(cb); - } - unmount(id, cb) { - const elements = this.elements; - const idx = elements.findIndex(item => item.props.tid === id); - elements.splice(idx, 1); - this.forceUpdate(cb); - } - render() { - const {pages: pages, elements: elements} = this; - while (pages.length > 0) { - const page = pages.pop(); - elements.push(page()); - } - let props = null; - if (isReactComponent) { - props = { - ref: appInstanceRef + var originSuccess = options.success; + var originFail = options.fail; + var originComplete = options.complete; + var requestTask; + var p = new Promise((function(resolve, reject) { + options.success = function(res) { + res.statusCode = res.status; + delete res.status; + res.header = res.headers; + delete res.headers; + originSuccess && originSuccess(res); + resolve(res); }; - } - return h$1(App, props, false ? undefined : elements.slice()); - } - } - if (true) { - appWrapper = (_a = ReactDOM$1.render) === null || _a === void 0 ? void 0 : _a.call(ReactDOM$1, h$1(AppWrapper), _runtime.document.getElementById(\\"app\\")); - } - const [ONLAUNCH, ONSHOW, ONHIDE] = hooks$1.getMiniLifecycleImpl().app; - const appObj = Object.create({ - render(cb) { - appWrapper.forceUpdate(cb); - }, - mount(component, id, cb) { - appWrapper.mount(component, id, cb); - }, - unmount(id, cb) { - appWrapper.unmount(id, cb); + options.fail = function(res) { + originFail && originFail(res); + reject(res); + }; + options.complete = function(res) { + originComplete && originComplete(res); + }; + requestTask = nativeRequest(options); + })); + p.abort = function(cb) { + cb && cb(); + if (requestTask) { + requestTask.abort(); + } + return p; + }; + return p; } - }, { - config: setDefaultDescriptor({ - configurable: true, - value: config - }), - [ONLAUNCH]: setDefaultDescriptor({ - value(options) { - var _a, _b; - setRouterParams(options); - if (false) {} - const app = getAppInstance(); - this.$app = app; - if (app) { - if (app.taroGlobalData) { - const globalData = app.taroGlobalData; - const keys = Object.keys(globalData); - const descriptors = Object.getOwnPropertyDescriptors(globalData); - keys.forEach(key => { - Object.defineProperty(this, key, { - configurable: true, - enumerable: true, - get() { - return globalData[key]; - }, - set(value) { - globalData[key] = value; - } - }); - }); - Object.defineProperties(this, descriptors); + function handleSyncApis(key, global, args) { + if (key === \\"getStorageSync\\") { + var arg1 = args[0]; + if (arg1 != null) { + var res = global[key]({ + key: arg1 + }); + var data = null; + if (res.hasOwnProperty(\\"data\\")) { + data = res.data; + } else if (res.hasOwnProperty(\\"APDataStorage\\")) { + data = res.APDataStorage; } - (_b = app.onLaunch) === null || _b === void 0 ? void 0 : _b.call(app, options); + return data === null ? \\"\\" : data; } + return console.error(\\"getStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); } - }), - [ONSHOW]: setDefaultDescriptor({ - value(options) { - var _a; - setRouterParams(options); - const app = getAppInstance(); - (_a = app === null || app === void 0 ? void 0 : app.componentDidShow) === null || _a === void 0 ? void 0 : _a.call(app, options); - triggerAppHook(\\"onShow\\", options); - } - }), - [ONHIDE]: setDefaultDescriptor({ - value() { - var _a; - const app = getAppInstance(); - (_a = app === null || app === void 0 ? void 0 : app.componentDidHide) === null || _a === void 0 ? void 0 : _a.call(app); - triggerAppHook(\\"onHide\\"); + if (key === \\"setStorageSync\\") { + var _arg = args[0]; + var arg2 = args[1]; + if (_arg != null) { + return global[key]({ + key: _arg, + data: arg2 + }); + } + return console.error(\\"setStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); } - }), - onPageNotFound: setDefaultDescriptor({ - value(res) { - var _a; - const app = getAppInstance(); - (_a = app === null || app === void 0 ? void 0 : app.onPageNotFound) === null || _a === void 0 ? void 0 : _a.call(app, res); + if (key === \\"removeStorageSync\\") { + var _arg2 = args[0]; + if (_arg2 != null) { + return global[key]({ + key: _arg2 + }); + } + return console.error(\\"removeStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); } - }) - }); - function triggerAppHook(lifecycle, ...option) { - const instance = (0, _runtime.getPageInstance)(HOOKS_APP_ID); - if (instance) { - const app = getAppInstance(); - const func = hooks$1.getLifecycle(instance, lifecycle); - if (Array.isArray(func)) { - func.forEach(cb => cb.apply(app, option)); + if (key === \\"createSelectorQuery\\") { + var query = global[key](); + query.in = function() { + return query; + }; + return query; } + return global[key].apply(global, args); } - } - _runtime.Current.app = appObj; - return appObj; - } - const getNativeCompId = (0, _runtime.incrementId)(); - let h; - let ReactDOM; - function initNativeComponentEntry(R, ReactDOM) { - class NativeComponentWrapper extends R.Component { - constructor() { - super(...arguments); - this.root = R.createRef(); - this.ctx = this.props.getCtx(); - } - componentDidMount() { - this.ctx.component = this; - const rootElement = this.root.current; - rootElement.ctx = this.ctx; - rootElement.performUpdate(true); - } - render() { - return h(\\"root\\", { - ref: this.root - }, this.props.renderComponent(this.ctx)); - } - } - class Entry extends R.Component { - constructor() { - super(...arguments); - this.state = { - components: [] + function transformMeta(api, options) { + var apiAlias = api; + if (api === \\"showModal\\") { + options.cancelButtonText = options.cancelText || \\"\\\\u53d6\\\\u6d88\\"; + options.confirmButtonText = options.confirmText || \\"\\\\u786e\\\\u5b9a\\"; + apiAlias = \\"confirm\\"; + if (options.showCancel === false) { + options.buttonText = options.confirmText || \\"\\\\u786e\\\\u5b9a\\"; + apiAlias = \\"alert\\"; + } + } else { + Object.keys(apiDiff).forEach((function(item) { + var apiItem = apiDiff[item]; + if (api === item) { + if (apiItem.alias) { + apiAlias = apiItem.alias; + } + if (apiItem.options) { + var change = apiItem.options.change; + var set = apiItem.options.set; + if (change) { + change.forEach((function(changeItem) { + options[changeItem.new] = options[changeItem.old]; + })); + } + if (set) { + set.forEach((function(setItem) { + options[setItem.key] = typeof setItem.value === \\"function\\" ? setItem.value(options) : setItem.value; + })); + } + } + } + })); + } + return { + key: apiAlias, + options: options }; } - componentDidMount() { - _runtime.Current.app = this; + function modifyApis(apis) { + Object.keys(apiDiff).map((function(key) { + apis.add(key); + var platformKey = apiDiff[key].alias; + platformKey && apis.delete(platformKey); + })); + apis.add(\\"showModal\\"); + apis.delete(\\"confirm\\"); + apis.delete(\\"alert\\"); } - mount(Component, compId, getCtx) { - const isReactComponent = isClassComponent(R, Component); - const inject = node => node && (0, _runtime.injectPageInstance)(node, compId); - const refs = isReactComponent ? { - ref: inject - } : { - forwardedRef: inject, - reactReduxForwardedRef: inject - }; - if (reactMeta.PageContext === _shared.EMPTY_OBJ) { - reactMeta.PageContext = R.createContext(\\"\\"); + function modifyAsyncResult(key, res) { + if (key === \\"saveFile\\") { + res.savedFilePath = res.apFilePath; + } else if (key === \\"downloadFile\\") { + res.tempFilePath = res.apFilePath; + } else if (key === \\"chooseImage\\") { + res.tempFilePaths = res.apFilePaths; + } else if (key === \\"getClipboard\\") { + res.data = res.text; + } else if (key === \\"scan\\") { + res.result = res.code; + } else if (key === \\"getScreenBrightness\\") { + res.value = res.brightness; + delete res.brightness; + } else if (key === \\"connectSocket\\") { + res.onClose = function(cb) { + my.onSocketClose(cb); + }; + res.onError = function(cb) { + my.onSocketError(cb); + }; + res.onMessage = function(cb) { + my.onSocketMessage(cb); + }; + res.onOpen = function(cb) { + my.onSocketOpen(cb); + }; + res.send = function(opt) { + my.sendSocketMessage(opt); + }; + res.close = function() { + my.closeSocket(); + }; } - const item = { - compId: compId, - element: h(NativeComponentWrapper, { - key: compId, - getCtx: getCtx, - renderComponent(ctx) { - return h(reactMeta.PageContext.Provider, { - value: compId - }, h(Component, Object.assign(Object.assign(Object.assign({}, (ctx.data || (ctx.data = {})).props), refs), { - $scope: ctx - }))); - } - }) - }; - this.setState({ - components: [ ...this.state.components, item ] - }); } - unmount(compId) { - const components = this.state.components; - const index = components.findIndex(item => item.compId === compId); - const next = [ ...components.slice(0, index), ...components.slice(index + 1) ]; - this.setState({ - components: next + function initNativeApi(taro) { + Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"g\\"])(taro, my, { + needPromiseApis: needPromiseApis, + handleSyncApis: handleSyncApis, + transformMeta: transformMeta, + modifyApis: modifyApis, + modifyAsyncResult: modifyAsyncResult, + request: request }); } - render() { - const components = this.state.components; - return components.map(({element: element}) => element); - } - } - setReconciler(ReactDOM); - const app = _runtime.document.getElementById(\\"app\\"); - ReactDOM.render(h(Entry, {}), app); - } - function createNativeComponentConfig(Component, react, reactdom, componentConfig) { - var _a, _b; - reactMeta.R = react; - h = react.createElement; - ReactDOM = reactdom; - setReconciler(ReactDOM); - const componentObj = { - options: componentConfig, - properties: { - props: { - type: null, - value: null, - observer(_newVal, oldVal) { - oldVal && this.component.forceUpdate(); - } - } - }, - created() { - if (!_runtime.Current.app) { - initNativeComponentEntry(react, ReactDOM); + var components = { + View: { + \\"disable-scroll\\": \\"false\\", + hidden: \\"false\\", + bindAppear: \\"\\", + bindDisappear: \\"\\", + bindFirstAppear: \\"\\" + }, + Text: { + \\"number-of-lines\\": \\"\\" + }, + Map: { + skew: \\"0\\", + rotate: \\"0\\", + polygons: \\"[]\\", + \\"include-padding\\": \\"\\", + \\"ground-overlays\\": \\"\\", + \\"tile-overlay\\": \\"\\", + \\"custom-map-style\\": \\"\\", + setting: \\"{}\\", + optimize: \\"\\", + bindRegionChange: \\"\\", + bindPanelTap: \\"\\" + }, + Button: { + scope: \\"\\", + \\"public-id\\": \\"\\", + bindGetAuthorize: \\"\\", + bindError: \\"\\" + }, + Checkbox: { + bindChange: \\"\\" + }, + Input: { + \\"random-number\\": \\"false\\", + controlled: \\"false\\", + enableNative: \\"false\\" + }, + Slider: { + \\"track-size\\": \\"4\\", + \\"handle-size\\": \\"22\\", + \\"handle-color\\": Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"singleQuote\\"])(\\"#ffffff\\") + }, + Switch: { + controlled: \\"false\\" + }, + Textarea: { + \\"show-count\\": \\"true\\", + controlled: \\"false\\", + enableNative: \\"false\\" + }, + MovableView: { + bindChangeEnd: \\"\\" + }, + ScrollView: { + \\"scroll-animation-duration\\": \\"\\", + \\"trap-scroll\\": \\"false\\" + }, + Swiper: { + \\"active-class\\": \\"\\", + \\"changing-class\\": \\"\\", + acceleration: \\"false\\", + \\"disable-programmatic-animation\\": \\"false\\", + \\"disable-touch\\": \\"false\\", + bindAnimationEnd: \\"\\" + }, + Image: { + \\"default-source\\": \\"\\" + }, + Canvas: { + type: \\"\\", + width: Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"singleQuote\\"])(\\"300px\\"), + height: Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"singleQuote\\"])(\\"225px\\"), + bindReady: \\"\\" + }, + Video: { + \\"poster-size\\": Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"singleQuote\\"])(\\"contain\\"), + \\"mobilenet-hint-type\\": \\"1\\", + enableNative: \\"false\\", + bindLoading: \\"\\", + bindUserAction: \\"\\", + bindStop: \\"\\", + bindRenderStart: \\"\\" + }, + Lottie: { + autoplay: \\"false\\", + path: \\"\\", + speed: \\"1.0\\", + repeatCount: \\"0\\", + autoReverse: \\"false\\", + assetsPath: \\"\\", + placeholder: \\"\\", + djangoId: \\"\\", + md5: \\"\\", + optimize: \\"false\\", + bindDataReady: \\"\\", + bindDataFailed: \\"\\", + bindAnimationStart: \\"\\", + bindAnimationEnd: \\"\\", + bindAnimationRepeat: \\"\\", + bindAnimationCancel: \\"\\", + bindDataLoadReady: \\"\\" + }, + Lifestyle: { + \\"public-id\\": \\"\\", + memo: \\"\\", + bindFollow: \\"\\" + }, + LifeFollow: { + sceneId: \\"\\", + checkFollow: \\"\\", + bindCheckFollow: \\"\\", + bindClose: \\"\\" + }, + ContactButton: { + \\"tnt-inst-id\\": \\"\\", + scene: \\"\\", + size: \\"25\\", + color: Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"singleQuote\\"])(\\"#00A3FF\\"), + icon: \\"\\", + \\"alipay-card-no\\": \\"\\", + \\"ext-info\\": \\"\\" } - }, - attached() { - setCurrent(); - this.compId = getNativeCompId(); - this.config = componentConfig; - _runtime.Current.app.mount(Component, this.compId, () => this); - }, - ready() { - (0, _runtime.safeExecute)(this.compId, \\"onReady\\"); - }, - detached() { - _runtime.Current.app.unmount(this.compId); - }, - pageLifetimes: { - show(options) { - (0, _runtime.safeExecute)(this.compId, \\"onShow\\", options); + }; + var BUBBLE_EVENTS = new Set([ \\"touchStart\\", \\"touchMove\\", \\"touchEnd\\", \\"touchCancel\\", \\"tap\\", \\"longTap\\" ]); + var hostConfig = { + initNativeApi: initNativeApi, + getEventCenter: function getEventCenter(Events) { + if (!my.taroEventCenter) { + my.taroEventCenter = new Events; + } + return my.taroEventCenter; + }, + modifyTaroEvent: function modifyTaroEvent(event, node) { + if (node.tagName === \\"SWIPER\\" && event.type === \\"animationend\\") { + event.type = \\"animationfinish\\"; + } }, - hide() { - (0, _runtime.safeExecute)(this.compId, \\"onHide\\"); + isBubbleEvents: function isBubbleEvents(eventName) { + return BUBBLE_EVENTS.has(eventName); } - }, - methods: { - eh: _runtime.eventHandler - } - }; - function setCurrent() { - const pages = getCurrentPages(); - const currentPage = pages[pages.length - 1]; - if (_runtime.Current.page === currentPage) return; - _runtime.Current.page = currentPage; - const route = currentPage.route || currentPage.__route__; - const router = { - params: currentPage.options || {}, - path: (0, _runtime.addLeadingSlash)(route), - onReady: \\"\\", - onHide: \\"\\", - onShow: \\"\\" }; - _runtime.Current.router = router; - if (!currentPage.options) { - Object.defineProperty(currentPage, \\"options\\", { + var _navigator = navigator, userAgent = _navigator.userAgent; + Object.defineProperty(navigator, \\"userAgent\\", { + configurable: true, + enumerable: true, + get: function get() { + return userAgent || navigator.swuserAgent || \\"\\"; + } + }); + Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"f\\"])(hostConfig); + Object(_tarojs_shared__WEBPACK_IMPORTED_MODULE_0__[\\"e\\"])(components); + }).call(this, __webpack_require__(0)[\\"navigator\\"]); + }, + 13: function(module, exports, __webpack_require__) {}, + 17: function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.r(__webpack_exports__); + var runtime = __webpack_require__(12); + var taro_runtime = __webpack_require__(0); + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, enumerable: true, configurable: true, - get() { - return this._optionsValue; - }, - set(value) { - router.params = value; - this._optionsValue = value; - } + writable: true }); + } else { + obj[key] = value; } + return obj; } - if (Component.onShareAppMessage || ((_a = Component.prototype) === null || _a === void 0 ? void 0 : _a.onShareAppMessage) || Component.enableShareAppMessage) { - componentObj.methods.onShareAppMessage = function(options) { - const target = options === null || options === void 0 ? void 0 : options.target; - if (target) { - const id = target.id; - const element = _runtime.document.getElementById(id); - if (element) { - target.dataset = element.dataset; - } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArrayLimit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== \\"undefined\\" && arr[Symbol.iterator] || arr[\\"@@iterator\\"]; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; } - return (0, _runtime.safeExecute)(this.compId, \\"onShareAppMessage\\", options); - }; + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i[\\"return\\"] != null) _i[\\"return\\"](); + } finally { + if (_d) throw _e; + } + } + return _arr; } - if (Component.onShareTimeline || ((_b = Component.prototype) === null || _b === void 0 ? void 0 : _b.onShareTimeline) || Component.enableShareTimeline) { - componentObj.methods.onShareTimeline = function() { - return (0, _runtime.safeExecute)(this.compId, \\"onShareTimeline\\"); - }; + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; } - return componentObj; - } - var _a; - const hooks = _runtime.container.get(_runtime.SERVICE_IDENTIFIER.Hooks); - hooks.initNativeApiImpls || (hooks.initNativeApiImpls = []); - hooks.initNativeApiImpls.push((function(taro) { - for (const hook in taroHooks$1) { - taro[hook] = taroHooks$1[hook]; + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === \\"string\\") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === \\"Object\\" && o.constructor) n = o.constructor.name; + if (n === \\"Map\\" || n === \\"Set\\") return Array.from(o); + if (n === \\"Arguments\\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - })); - if (false) {} -}, function(module, exports, __webpack_require__) { - \\"use strict\\"; - var _interopRequireWildcard = __webpack_require__(3).default; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _react = _interopRequireWildcard(__webpack_require__(2)); - __webpack_require__(13); - class App extends _react.Component { - componentDidMount() {} - componentDidShow() {} - componentDidHide() {} - componentDidCatchError() {} - render() { - return this.props.children; + function _nonIterableRest() { + throw new TypeError(\\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\"); } - } - var _default = App; - exports.default = _default; -}, , , , , function(module, __webpack_exports__, __webpack_require__) { - \\"use strict\\"; - __webpack_require__.r(__webpack_exports__); - var _tarojs_plugin_platform_alipay_dist_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11); - var _tarojs_plugin_platform_alipay_dist_runtime__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_tarojs_plugin_platform_alipay_dist_runtime__WEBPACK_IMPORTED_MODULE_0__); - var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); - var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__); - var _tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); - var _tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__); - var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1); - var _tarojs_taro__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__); - var _node_modules_babel_loader_lib_index_js_app_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5); - var _node_modules_babel_loader_lib_index_js_app_js__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_node_modules_babel_loader_lib_index_js_app_js__WEBPACK_IMPORTED_MODULE_4__); - var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2); - var react__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__); - var react_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6); - var react_dom__WEBPACK_IMPORTED_MODULE_6___default = __webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_6__); - var config = { - pages: [ \\"pages/index/index\\" ], - window: { - backgroundTextStyle: \\"light\\", - navigationBarBackgroundColor: \\"#fff\\", - navigationBarTitleText: \\"WeChat\\", - navigationBarTextStyle: \\"black\\" + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - }; - _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__[\\"window\\"].__taroAppConfig = config; - var inst = App(Object(_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__[\\"createReactApp\\"])(_node_modules_babel_loader_lib_index_js_app_js__WEBPACK_IMPORTED_MODULE_4___default.a, react__WEBPACK_IMPORTED_MODULE_5__, react_dom__WEBPACK_IMPORTED_MODULE_6___default.a, config)); - Object(_tarojs_taro__WEBPACK_IMPORTED_MODULE_3__[\\"initPxTransform\\"])({ - designWidth: 750, - deviceRatio: { - 640: 1.17, - 750: 1, - 828: .905 + var classCallCheck = __webpack_require__(4); + var createClass = __webpack_require__(5); + var inherits = __webpack_require__(7); + var createSuper = __webpack_require__(6); + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== \\"undefined\\" && iter[Symbol.iterator] != null || iter[\\"@@iterator\\"] != null) return Array.from(iter); + } + function _nonIterableSpread() { + throw new TypeError(\\"Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\\"); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + var taro = __webpack_require__(1); + var reactMeta = { + PageContext: taro[\\"a\\"], + R: taro[\\"a\\"] + }; + var HOOKS_APP_ID = \\"taro-app\\"; + function isClassComponent(R, component) { + var _a; + var prototype = component.prototype; + if ((_a = component.displayName) === null || _a === void 0 ? void 0 : _a.includes(\\"Connect\\")) return false; + return Object(taro[\\"d\\"])(component.render) || !!(prototype === null || prototype === void 0 ? void 0 : prototype.isReactComponent) || prototype instanceof R.Component; + } + function ensureIsArray(item) { + if (Object(taro[\\"c\\"])(item)) { + return item; + } else { + return item ? [ item ] : []; + } + } + function setDefaultDescriptor(obj) { + obj.writable = true; + obj.enumerable = true; + return obj; + } + function setRouterParams(options) { + taro_runtime[\\"Current\\"].router = Object.assign({ + params: options === null || options === void 0 ? void 0 : options.query + }, options); + } + var runtime_taroHooks = function taroHooks(lifecycle) { + return function(fn) { + var React = reactMeta.R, PageContext = reactMeta.PageContext; + var id = React.useContext(PageContext) || HOOKS_APP_ID; + var fnRef = React.useRef(fn); + if (fnRef.current !== fn) fnRef.current = fn; + React.useLayoutEffect((function() { + var inst = Object(taro_runtime[\\"getPageInstance\\"])(id); + var first = false; + if (inst == null) { + first = true; + inst = Object.create(null); + } + inst = inst; + var callback = function callback() { + return fnRef.current.apply(fnRef, arguments); + }; + if (Object(taro[\\"d\\"])(inst[lifecycle])) { + inst[lifecycle] = [ inst[lifecycle], callback ]; + } else { + inst[lifecycle] = [].concat(_toConsumableArray(inst[lifecycle] || []), [ callback ]); + } + if (first) { + Object(taro_runtime[\\"injectPageInstance\\"])(inst, id); + } + return function() { + var inst = Object(taro_runtime[\\"getPageInstance\\"])(id); + var list = inst[lifecycle]; + if (list === callback) { + inst[lifecycle] = undefined; + } else if (Object(taro[\\"c\\"])(list)) { + inst[lifecycle] = list.filter((function(item) { + return item !== callback; + })); + } + }; + }), []); + }; + }; + var useDidShow = runtime_taroHooks(\\"componentDidShow\\"); + var useDidHide = runtime_taroHooks(\\"componentDidHide\\"); + var usePullDownRefresh = runtime_taroHooks(\\"onPullDownRefresh\\"); + var useReachBottom = runtime_taroHooks(\\"onReachBottom\\"); + var usePageScroll = runtime_taroHooks(\\"onPageScroll\\"); + var useResize = runtime_taroHooks(\\"onResize\\"); + var useShareAppMessage = runtime_taroHooks(\\"onShareAppMessage\\"); + var useTabItemTap = runtime_taroHooks(\\"onTabItemTap\\"); + var useTitleClick = runtime_taroHooks(\\"onTitleClick\\"); + var useOptionMenuClick = runtime_taroHooks(\\"onOptionMenuClick\\"); + var usePullIntercept = runtime_taroHooks(\\"onPullIntercept\\"); + var useShareTimeline = runtime_taroHooks(\\"onShareTimeline\\"); + var useAddToFavorites = runtime_taroHooks(\\"onAddToFavorites\\"); + var useReady = runtime_taroHooks(\\"onReady\\"); + var runtime_useRouter = function useRouter() { + var dynamic = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var React = reactMeta.R; + return dynamic ? taro_runtime[\\"Current\\"].router : React.useMemo((function() { + return taro_runtime[\\"Current\\"].router; + }), []); + }; + var useScope = function useScope() { + return undefined; + }; + var taroHooks$1 = Object.freeze({ + __proto__: null, + useDidShow: useDidShow, + useDidHide: useDidHide, + usePullDownRefresh: usePullDownRefresh, + useReachBottom: useReachBottom, + usePageScroll: usePageScroll, + useResize: useResize, + useShareAppMessage: useShareAppMessage, + useTabItemTap: useTabItemTap, + useTitleClick: useTitleClick, + useOptionMenuClick: useOptionMenuClick, + usePullIntercept: usePullIntercept, + useShareTimeline: useShareTimeline, + useAddToFavorites: useAddToFavorites, + useReady: useReady, + useRouter: runtime_useRouter, + useScope: useScope + }); + var h$1; + var ReactDOM$1; + var pageKeyId = Object(taro_runtime[\\"incrementId\\"])(); + var hooks$1 = taro_runtime[\\"container\\"].get(taro_runtime[\\"SERVICE_IDENTIFIER\\"].Hooks); + function setReconciler(ReactDOM) { + var _a; + hooks$1.getLifecycle = function(instance, lifecycle) { + lifecycle = lifecycle.replace(/^on(Show|Hide)$/, \\"componentDid$1\\"); + return instance[lifecycle]; + }; + (_a = hooks$1.modifyMpEventImpls) === null || _a === void 0 ? void 0 : _a.push((function(event) { + event.type = event.type.replace(/-/g, \\"\\"); + })); + hooks$1.batchedEventUpdates = function(cb) { + ReactDOM.unstable_batchedUpdates(cb); + }; + hooks$1.mergePageInstance = function(prev, next) { + if (!prev || !next) return; + if (\\"constructor\\" in prev) return; + Object.keys(prev).forEach((function(item) { + var prevList = prev[item]; + var nextList = ensureIsArray(next[item]); + next[item] = nextList.concat(prevList); + })); + }; + if (false) {} } - }); -}, function(module, exports, __webpack_require__) { - \\"use strict\\"; - (function(navigator) { - var _shared = __webpack_require__(1); - const needPromiseApis = new Set([ \\"addCardAuth\\", \\"getOpenUserInfo\\", \\"chooseAlipayContact\\", \\"chooseCity\\", \\"chooseContact\\", \\"choosePhoneContact\\", \\"datePicker\\", \\"getAddress\\", \\"getAuthCode\\", \\"getPhoneNumber\\", \\"getRunData\\", \\"getRunScene\\", \\"getServerTime\\", \\"getTitleColor\\", \\"rsa\\", \\"paySignCenter\\", \\"tradePay\\", \\"isCollected\\", \\"multiLevelSelect\\", \\"onLocatedComplete\\", \\"optionsSelect\\", \\"prompt\\", \\"regionPicker\\", \\"setLocatedCity\\", \\"showAuthGuide\\", \\"textRiskIdentification\\", \\"vibrate\\", \\"watchShake\\", \\"connectBLEDevice\\", \\"disconnectBLEDevice\\", \\"makeBluetoothPair\\", \\"writeBLECharacteristicValue\\", \\"readBLECharacteristicValue\\", \\"notifyBLECharacteristicValueChange\\", \\"getBLEDeviceServices\\", \\"getBLEDeviceCharacteristics\\", \\"openBluetoothAdapter\\", \\"closeBluetoothAdapter\\", \\"getBluetoothAdapterState\\", \\"startBluetoothDevicesDiscovery\\", \\"stopBluetoothDevicesDiscovery\\", \\"getBluetoothDevices\\", \\"getConnectedBluetoothDevices\\" ]); - const apiDiff = { - showActionSheet: { - options: { - change: [ { - old: \\"itemList\\", - new: \\"items\\" - } ] + function connectReactPage(R, id) { + return function(Page) { + var isReactComponent = isClassComponent(R, Page); + var inject = function inject(node) { + return node && Object(taro_runtime[\\"injectPageInstance\\"])(node, id); + }; + var refs = isReactComponent ? { + ref: inject + } : { + forwardedRef: inject, + reactReduxForwardedRef: inject + }; + if (reactMeta.PageContext === taro[\\"a\\"]) { + reactMeta.PageContext = R.createContext(\\"\\"); } - }, - showToast: { - options: { - change: [ { - old: \\"title\\", - new: \\"content\\" + return function(_R$Component) { + Object(inherits[\\"a\\"])(PageWrapper, _R$Component); + var _super = Object(createSuper[\\"a\\"])(PageWrapper); + function PageWrapper() { + var _this; + Object(classCallCheck[\\"a\\"])(this, PageWrapper); + _this = _super.apply(this, arguments); + _this.state = { + hasError: false + }; + return _this; + } + Object(createClass[\\"a\\"])(PageWrapper, [ { + key: \\"componentDidCatch\\", + value: function componentDidCatch(error, info) { + if (false) {} + } }, { - old: \\"icon\\", - new: \\"type\\" - } ] - } - }, - showLoading: { - options: { - change: [ { - old: \\"title\\", - new: \\"content\\" - } ] - } - }, - setNavigationBarTitle: { - alias: \\"setNavigationBar\\" - }, - setNavigationBarColor: { - alias: \\"setNavigationBar\\" - }, - saveImageToPhotosAlbum: { - alias: \\"saveImage\\", - options: { - change: [ { - old: \\"filePath\\", - new: \\"url\\" - } ] - } - }, - previewImage: { - options: { - set: [ { - key: \\"current\\", - value(options) { - return options.urls.indexOf(options.current || options.urls[0]); + key: \\"render\\", + value: function render() { + var children = this.state.hasError ? [] : h$1(reactMeta.PageContext.Provider, { + value: id + }, h$1(Page, Object.assign(Object.assign({}, this.props), refs))); + if (false) {} else { + return h$1(\\"root\\", { + id: id + }, children); + } } - } ] - } - }, - getFileInfo: { - options: { - change: [ { - old: \\"filePath\\", - new: \\"apFilePath\\" - } ] - } - }, - getSavedFileInfo: { - options: { - change: [ { - old: \\"filePath\\", - new: \\"apFilePath\\" - } ] - } - }, - removeSavedFile: { - options: { - change: [ { - old: \\"filePath\\", - new: \\"apFilePath\\" - } ] - } - }, - saveFile: { - options: { - change: [ { - old: \\"tempFilePath\\", - new: \\"apFilePath\\" - } ] + } ], [ { + key: \\"getDerivedStateFromError\\", + value: function getDerivedStateFromError(error) { + false && false; + return { + hasError: true + }; + } + } ]); + return PageWrapper; + }(R.Component); + }; + } + function createReactApp(App, react, dom, config) { + var _Object$create; + var _a; + if (false) {} + reactMeta.R = react; + h$1 = react.createElement; + ReactDOM$1 = dom; + var appInstanceRef = react.createRef(); + var isReactComponent = isClassComponent(react, App); + var appWrapper; + setReconciler(ReactDOM$1); + function getAppInstance() { + return appInstanceRef.current; + } + var AppWrapper = function(_react$Component) { + Object(inherits[\\"a\\"])(AppWrapper, _react$Component); + var _super2 = Object(createSuper[\\"a\\"])(AppWrapper); + function AppWrapper() { + var _this2; + Object(classCallCheck[\\"a\\"])(this, AppWrapper); + _this2 = _super2.apply(this, arguments); + _this2.pages = []; + _this2.elements = []; + return _this2; } - }, - openLocation: { - options: { - set: [ { - key: \\"latitude\\", - value(options) { - return String(options.latitude); + Object(createClass[\\"a\\"])(AppWrapper, [ { + key: \\"mount\\", + value: function mount(pageComponent, id, cb) { + var pageWrapper = connectReactPage(react, id)(pageComponent); + var key = id + pageKeyId(); + var page = function page() { + return h$1(pageWrapper, { + key: key, + tid: id + }); + }; + this.pages.push(page); + this.forceUpdate(cb); + } + }, { + key: \\"unmount\\", + value: function unmount(id, cb) { + var elements = this.elements; + var idx = elements.findIndex((function(item) { + return item.props.tid === id; + })); + elements.splice(idx, 1); + this.forceUpdate(cb); + } + }, { + key: \\"render\\", + value: function render() { + var pages = this.pages, elements = this.elements; + while (pages.length > 0) { + var page = pages.pop(); + elements.push(page()); } - }, { - key: \\"longitude\\", - value(options) { - return String(options.longitude); + var props = null; + if (isReactComponent) { + props = { + ref: appInstanceRef + }; } - } ] + return h$1(App, props, false ? undefined : elements.slice()); + } + } ]); + return AppWrapper; + }(react.Component); + if (true) { + appWrapper = (_a = ReactDOM$1.render) === null || _a === void 0 ? void 0 : _a.call(ReactDOM$1, h$1(AppWrapper), taro_runtime[\\"document\\"].getElementById(\\"app\\")); + } + var _hooks$1$getMiniLifec = _slicedToArray(hooks$1.getMiniLifecycleImpl().app, 3), ONLAUNCH = _hooks$1$getMiniLifec[0], ONSHOW = _hooks$1$getMiniLifec[1], ONHIDE = _hooks$1$getMiniLifec[2]; + var appObj = Object.create({ + render: function render(cb) { + appWrapper.forceUpdate(cb); + }, + mount: function mount(component, id, cb) { + appWrapper.mount(component, id, cb); + }, + unmount: function unmount(id, cb) { + appWrapper.unmount(id, cb); } - }, - uploadFile: { - options: { - change: [ { - old: \\"name\\", - new: \\"fileName\\" - } ] + }, (_Object$create = { + config: setDefaultDescriptor({ + configurable: true, + value: config + }) + }, _defineProperty(_Object$create, ONLAUNCH, setDefaultDescriptor({ + value: function value(options) { + var _this3 = this; + var _a, _b; + setRouterParams(options); + if (false) {} + var app = getAppInstance(); + this.$app = app; + if (app) { + if (app.taroGlobalData) { + var globalData = app.taroGlobalData; + var keys = Object.keys(globalData); + var descriptors = Object.getOwnPropertyDescriptors(globalData); + keys.forEach((function(key) { + Object.defineProperty(_this3, key, { + configurable: true, + enumerable: true, + get: function get() { + return globalData[key]; + }, + set: function set(value) { + globalData[key] = value; + } + }); + })); + Object.defineProperties(this, descriptors); + } + (_b = app.onLaunch) === null || _b === void 0 ? void 0 : _b.call(app, options); + } } - }, - getClipboardData: { - alias: \\"getClipboard\\" - }, - setClipboardData: { - alias: \\"setClipboard\\", - options: { - change: [ { - old: \\"data\\", - new: \\"text\\" - } ] + })), _defineProperty(_Object$create, ONSHOW, setDefaultDescriptor({ + value: function value(options) { + var _a; + setRouterParams(options); + var app = getAppInstance(); + (_a = app === null || app === void 0 ? void 0 : app.componentDidShow) === null || _a === void 0 ? void 0 : _a.call(app, options); + triggerAppHook(\\"onShow\\", options); } - }, - makePhoneCall: { - options: { - change: [ { - old: \\"phoneNumber\\", - new: \\"number\\" - } ] + })), _defineProperty(_Object$create, ONHIDE, setDefaultDescriptor({ + value: function value() { + var _a; + var app = getAppInstance(); + (_a = app === null || app === void 0 ? void 0 : app.componentDidHide) === null || _a === void 0 ? void 0 : _a.call(app); + triggerAppHook(\\"onHide\\"); } - }, - scanCode: { - alias: \\"scan\\", - options: { - change: [ { - old: \\"onlyFromCamera\\", - new: \\"hideAlbum\\" - } ], - set: [ { - key: \\"type\\", - value(options) { - return options.scanType && options.scanType[0].slice(0, -4) || \\"qr\\"; - } - } ] + })), _defineProperty(_Object$create, \\"onPageNotFound\\", setDefaultDescriptor({ + value: function value(res) { + var _a; + var app = getAppInstance(); + (_a = app === null || app === void 0 ? void 0 : app.onPageNotFound) === null || _a === void 0 ? void 0 : _a.call(app, res); } - }, - setScreenBrightness: { - options: { - change: [ { - old: \\"value\\", - new: \\"brightness\\" - } ] + })), _Object$create)); + function triggerAppHook(lifecycle) { + for (var _len = arguments.length, option = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + option[_key - 1] = arguments[_key]; } - }, - onBLEConnectionStateChange: { - alias: \\"onBLEConnectionStateChanged\\" - }, - offBLEConnectionStateChange: { - alias: \\"offBLEConnectionStateChanged\\" - }, - createBLEConnection: { - alias: \\"connectBLEDevice\\" - }, - closeBLEConnection: { - alias: \\"disconnectBLEDevice\\" - } - }; - const nativeRequest = my.canIUse(\\"request\\") ? my.request : my.httpRequest; - function request(options) { - options = options || {}; - if (typeof options === \\"string\\") { - options = { - url: options - }; - } - const defaultHeaders = { - \\"content-type\\": \\"application/json\\" - }; - options.headers = defaultHeaders; - if (options.header) { - for (const k in options.header) { - const lowerK = k.toLocaleLowerCase(); - options.headers[lowerK] = options.header[k]; + var instance = Object(taro_runtime[\\"getPageInstance\\"])(HOOKS_APP_ID); + if (instance) { + var app = getAppInstance(); + var func = hooks$1.getLifecycle(instance, lifecycle); + if (Array.isArray(func)) { + func.forEach((function(cb) { + return cb.apply(app, option); + })); + } } - delete options.header; } - const originSuccess = options.success; - const originFail = options.fail; - const originComplete = options.complete; - let requestTask; - const p = new Promise((resolve, reject) => { - options.success = res => { - res.statusCode = res.status; - delete res.status; - res.header = res.headers; - delete res.headers; - originSuccess && originSuccess(res); - resolve(res); - }; - options.fail = res => { - originFail && originFail(res); - reject(res); - }; - options.complete = res => { - originComplete && originComplete(res); - }; - requestTask = nativeRequest(options); - }); - p.abort = cb => { - cb && cb(); - if (requestTask) { - requestTask.abort(); - } - return p; - }; - return p; + taro_runtime[\\"Current\\"].app = appObj; + return appObj; } - function handleSyncApis(key, global, args) { - if (key === \\"getStorageSync\\") { - const arg1 = args[0]; - if (arg1 != null) { - const res = global[key]({ - key: arg1 - }); - let data = null; - if (res.hasOwnProperty(\\"data\\")) { - data = res.data; - } else if (res.hasOwnProperty(\\"APDataStorage\\")) { - data = res.APDataStorage; + var getNativeCompId = Object(taro_runtime[\\"incrementId\\"])(); + var h; + var runtime_ReactDOM; + function initNativeComponentEntry(R, ReactDOM) { + var NativeComponentWrapper = function(_R$Component2) { + Object(inherits[\\"a\\"])(NativeComponentWrapper, _R$Component2); + var _super3 = Object(createSuper[\\"a\\"])(NativeComponentWrapper); + function NativeComponentWrapper() { + var _this4; + Object(classCallCheck[\\"a\\"])(this, NativeComponentWrapper); + _this4 = _super3.apply(this, arguments); + _this4.root = R.createRef(); + _this4.ctx = _this4.props.getCtx(); + return _this4; + } + Object(createClass[\\"a\\"])(NativeComponentWrapper, [ { + key: \\"componentDidMount\\", + value: function componentDidMount() { + this.ctx.component = this; + var rootElement = this.root.current; + rootElement.ctx = this.ctx; + rootElement.performUpdate(true); + } + }, { + key: \\"render\\", + value: function render() { + return h(\\"root\\", { + ref: this.root + }, this.props.renderComponent(this.ctx)); } - return data === null ? \\"\\" : data; + } ]); + return NativeComponentWrapper; + }(R.Component); + var Entry = function(_R$Component3) { + Object(inherits[\\"a\\"])(Entry, _R$Component3); + var _super4 = Object(createSuper[\\"a\\"])(Entry); + function Entry() { + var _this5; + Object(classCallCheck[\\"a\\"])(this, Entry); + _this5 = _super4.apply(this, arguments); + _this5.state = { + components: [] + }; + return _this5; } - return console.error(\\"getStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); - } - if (key === \\"setStorageSync\\") { - const arg1 = args[0]; - const arg2 = args[1]; - if (arg1 != null) { - return global[key]({ - key: arg1, - data: arg2 - }); + Object(createClass[\\"a\\"])(Entry, [ { + key: \\"componentDidMount\\", + value: function componentDidMount() { + taro_runtime[\\"Current\\"].app = this; + } + }, { + key: \\"mount\\", + value: function mount(Component, compId, getCtx) { + var isReactComponent = isClassComponent(R, Component); + var inject = function inject(node) { + return node && Object(taro_runtime[\\"injectPageInstance\\"])(node, compId); + }; + var refs = isReactComponent ? { + ref: inject + } : { + forwardedRef: inject, + reactReduxForwardedRef: inject + }; + if (reactMeta.PageContext === taro[\\"a\\"]) { + reactMeta.PageContext = R.createContext(\\"\\"); + } + var item = { + compId: compId, + element: h(NativeComponentWrapper, { + key: compId, + getCtx: getCtx, + renderComponent: function renderComponent(ctx) { + return h(reactMeta.PageContext.Provider, { + value: compId + }, h(Component, Object.assign(Object.assign(Object.assign({}, (ctx.data || (ctx.data = {})).props), refs), { + $scope: ctx + }))); + } + }) + }; + this.setState({ + components: [].concat(_toConsumableArray(this.state.components), [ item ]) + }); + } + }, { + key: \\"unmount\\", + value: function unmount(compId) { + var components = this.state.components; + var index = components.findIndex((function(item) { + return item.compId === compId; + })); + var next = [].concat(_toConsumableArray(components.slice(0, index)), _toConsumableArray(components.slice(index + 1))); + this.setState({ + components: next + }); + } + }, { + key: \\"render\\", + value: function render() { + var components = this.state.components; + return components.map((function(_ref) { + var element = _ref.element; + return element; + })); + } + } ]); + return Entry; + }(R.Component); + setReconciler(ReactDOM); + var app = taro_runtime[\\"document\\"].getElementById(\\"app\\"); + ReactDOM.render(h(Entry, {}), app); + } + function createNativeComponentConfig(Component, react, reactdom, componentConfig) { + var _a, _b; + reactMeta.R = react; + h = react.createElement; + runtime_ReactDOM = reactdom; + setReconciler(runtime_ReactDOM); + var componentObj = { + options: componentConfig, + properties: { + props: { + type: null, + value: null, + observer: function observer(_newVal, oldVal) { + oldVal && this.component.forceUpdate(); + } + } + }, + created: function created() { + if (!taro_runtime[\\"Current\\"].app) { + initNativeComponentEntry(react, runtime_ReactDOM); + } + }, + attached: function attached() { + var _this6 = this; + setCurrent(); + this.compId = getNativeCompId(); + this.config = componentConfig; + taro_runtime[\\"Current\\"].app.mount(Component, this.compId, (function() { + return _this6; + })); + }, + ready: function ready() { + Object(taro_runtime[\\"safeExecute\\"])(this.compId, \\"onReady\\"); + }, + detached: function detached() { + taro_runtime[\\"Current\\"].app.unmount(this.compId); + }, + pageLifetimes: { + show: function show(options) { + Object(taro_runtime[\\"safeExecute\\"])(this.compId, \\"onShow\\", options); + }, + hide: function hide() { + Object(taro_runtime[\\"safeExecute\\"])(this.compId, \\"onHide\\"); + } + }, + methods: { + eh: taro_runtime[\\"eventHandler\\"] } - return console.error(\\"setStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); - } - if (key === \\"removeStorageSync\\") { - const arg1 = args[0]; - if (arg1 != null) { - return global[key]({ - key: arg1 + }; + function setCurrent() { + var pages = getCurrentPages(); + var currentPage = pages[pages.length - 1]; + if (taro_runtime[\\"Current\\"].page === currentPage) return; + taro_runtime[\\"Current\\"].page = currentPage; + var route = currentPage.route || currentPage.__route__; + var router = { + params: currentPage.options || {}, + path: Object(taro_runtime[\\"addLeadingSlash\\"])(route), + onReady: \\"\\", + onHide: \\"\\", + onShow: \\"\\" + }; + taro_runtime[\\"Current\\"].router = router; + if (!currentPage.options) { + Object.defineProperty(currentPage, \\"options\\", { + enumerable: true, + configurable: true, + get: function get() { + return this._optionsValue; + }, + set: function set(value) { + router.params = value; + this._optionsValue = value; + } }); } - return console.error(\\"removeStorageSync \\\\u4f20\\\\u5165\\\\u53c2\\\\u6570\\\\u9519\\\\u8bef\\"); - } - if (key === \\"createSelectorQuery\\") { - const query = global[key](); - query.in = function() { - return query; - }; - return query; } - return global[key].apply(global, args); - } - function transformMeta(api, options) { - let apiAlias = api; - if (api === \\"showModal\\") { - options.cancelButtonText = options.cancelText || \\"\\\\u53d6\\\\u6d88\\"; - options.confirmButtonText = options.confirmText || \\"\\\\u786e\\\\u5b9a\\"; - apiAlias = \\"confirm\\"; - if (options.showCancel === false) { - options.buttonText = options.confirmText || \\"\\\\u786e\\\\u5b9a\\"; - apiAlias = \\"alert\\"; - } - } else { - Object.keys(apiDiff).forEach(item => { - const apiItem = apiDiff[item]; - if (api === item) { - if (apiItem.alias) { - apiAlias = apiItem.alias; - } - if (apiItem.options) { - const change = apiItem.options.change; - const set = apiItem.options.set; - if (change) { - change.forEach(changeItem => { - options[changeItem.new] = options[changeItem.old]; - }); - } - if (set) { - set.forEach(setItem => { - options[setItem.key] = typeof setItem.value === \\"function\\" ? setItem.value(options) : setItem.value; - }); - } + if (Component.onShareAppMessage || ((_a = Component.prototype) === null || _a === void 0 ? void 0 : _a.onShareAppMessage) || Component.enableShareAppMessage) { + componentObj.methods.onShareAppMessage = function(options) { + var target = options === null || options === void 0 ? void 0 : options.target; + if (target) { + var id = target.id; + var element = taro_runtime[\\"document\\"].getElementById(id); + if (element) { + target.dataset = element.dataset; } } - }); - } - return { - key: apiAlias, - options: options - }; - } - function modifyApis(apis) { - Object.keys(apiDiff).map(key => { - apis.add(key); - const platformKey = apiDiff[key].alias; - platformKey && apis.delete(platformKey); - }); - apis.add(\\"showModal\\"); - apis.delete(\\"confirm\\"); - apis.delete(\\"alert\\"); - } - function modifyAsyncResult(key, res) { - if (key === \\"saveFile\\") { - res.savedFilePath = res.apFilePath; - } else if (key === \\"downloadFile\\") { - res.tempFilePath = res.apFilePath; - } else if (key === \\"chooseImage\\") { - res.tempFilePaths = res.apFilePaths; - } else if (key === \\"getClipboard\\") { - res.data = res.text; - } else if (key === \\"scan\\") { - res.result = res.code; - } else if (key === \\"getScreenBrightness\\") { - res.value = res.brightness; - delete res.brightness; - } else if (key === \\"connectSocket\\") { - res.onClose = function(cb) { - my.onSocketClose(cb); - }; - res.onError = function(cb) { - my.onSocketError(cb); + return Object(taro_runtime[\\"safeExecute\\"])(this.compId, \\"onShareAppMessage\\", options); }; - res.onMessage = function(cb) { - my.onSocketMessage(cb); - }; - res.onOpen = function(cb) { - my.onSocketOpen(cb); - }; - res.send = function(opt) { - my.sendSocketMessage(opt); - }; - res.close = function() { - my.closeSocket(); + } + if (Component.onShareTimeline || ((_b = Component.prototype) === null || _b === void 0 ? void 0 : _b.onShareTimeline) || Component.enableShareTimeline) { + componentObj.methods.onShareTimeline = function() { + return Object(taro_runtime[\\"safeExecute\\"])(this.compId, \\"onShareTimeline\\"); }; } + return componentObj; } - function initNativeApi(taro) { - (0, _shared.processApis)(taro, my, { - needPromiseApis: needPromiseApis, - handleSyncApis: handleSyncApis, - transformMeta: transformMeta, - modifyApis: modifyApis, - modifyAsyncResult: modifyAsyncResult, - request: request - }); + var runtime_a; + var hooks = taro_runtime[\\"container\\"].get(taro_runtime[\\"SERVICE_IDENTIFIER\\"].Hooks); + hooks.initNativeApiImpls || (hooks.initNativeApiImpls = []); + hooks.initNativeApiImpls.push((function(taro) { + for (var hook in taroHooks$1) { + taro[hook] = taroHooks$1[hook]; + } + })); + if (false) { + var oldDiffedHook, oldVNodeHook, runtime_options; } - const components = { - View: { - \\"disable-scroll\\": \\"false\\", - hidden: \\"false\\", - bindAppear: \\"\\", - bindDisappear: \\"\\", - bindFirstAppear: \\"\\" - }, - Text: { - \\"number-of-lines\\": \\"\\" - }, - Map: { - skew: \\"0\\", - rotate: \\"0\\", - polygons: \\"[]\\", - \\"include-padding\\": \\"\\", - \\"ground-overlays\\": \\"\\", - \\"tile-overlay\\": \\"\\", - \\"custom-map-style\\": \\"\\", - setting: \\"{}\\", - optimize: \\"\\", - bindRegionChange: \\"\\", - bindPanelTap: \\"\\" - }, - Button: { - scope: \\"\\", - \\"public-id\\": \\"\\", - bindGetAuthorize: \\"\\", - bindError: \\"\\" - }, - Checkbox: { - bindChange: \\"\\" - }, - Input: { - \\"random-number\\": \\"false\\", - controlled: \\"false\\", - enableNative: \\"false\\" - }, - Slider: { - \\"track-size\\": \\"4\\", - \\"handle-size\\": \\"22\\", - \\"handle-color\\": (0, _shared.singleQuote)(\\"#ffffff\\") - }, - Switch: { - controlled: \\"false\\" - }, - Textarea: { - \\"show-count\\": \\"true\\", - controlled: \\"false\\", - enableNative: \\"false\\" - }, - MovableView: { - bindChangeEnd: \\"\\" - }, - ScrollView: { - \\"scroll-animation-duration\\": \\"\\", - \\"trap-scroll\\": \\"false\\" - }, - Swiper: { - \\"active-class\\": \\"\\", - \\"changing-class\\": \\"\\", - acceleration: \\"false\\", - \\"disable-programmatic-animation\\": \\"false\\", - \\"disable-touch\\": \\"false\\", - bindAnimationEnd: \\"\\" - }, - Image: { - \\"default-source\\": \\"\\" - }, - Canvas: { - type: \\"\\", - width: (0, _shared.singleQuote)(\\"300px\\"), - height: (0, _shared.singleQuote)(\\"225px\\"), - bindReady: \\"\\" - }, - Video: { - \\"poster-size\\": (0, _shared.singleQuote)(\\"contain\\"), - \\"mobilenet-hint-type\\": \\"1\\", - enableNative: \\"false\\", - bindLoading: \\"\\", - bindUserAction: \\"\\", - bindStop: \\"\\", - bindRenderStart: \\"\\" - }, - Lottie: { - autoplay: \\"false\\", - path: \\"\\", - speed: \\"1.0\\", - repeatCount: \\"0\\", - autoReverse: \\"false\\", - assetsPath: \\"\\", - placeholder: \\"\\", - djangoId: \\"\\", - md5: \\"\\", - optimize: \\"false\\", - bindDataReady: \\"\\", - bindDataFailed: \\"\\", - bindAnimationStart: \\"\\", - bindAnimationEnd: \\"\\", - bindAnimationRepeat: \\"\\", - bindAnimationCancel: \\"\\", - bindDataLoadReady: \\"\\" - }, - Lifestyle: { - \\"public-id\\": \\"\\", - memo: \\"\\", - bindFollow: \\"\\" - }, - LifeFollow: { - sceneId: \\"\\", - checkFollow: \\"\\", - bindCheckFollow: \\"\\", - bindClose: \\"\\" - }, - ContactButton: { - \\"tnt-inst-id\\": \\"\\", - scene: \\"\\", - size: \\"25\\", - color: (0, _shared.singleQuote)(\\"#00A3FF\\"), - icon: \\"\\", - \\"alipay-card-no\\": \\"\\", - \\"ext-info\\": \\"\\" + var mocks_react = __webpack_require__(2); + var src_app = __webpack_require__(13); + var app_App = function(_Component) { + Object(inherits[\\"a\\"])(App, _Component); + var _super = Object(createSuper[\\"a\\"])(App); + function App() { + Object(classCallCheck[\\"a\\"])(this, App); + return _super.apply(this, arguments); } - }; - const BUBBLE_EVENTS = new Set([ \\"touchStart\\", \\"touchMove\\", \\"touchEnd\\", \\"touchCancel\\", \\"tap\\", \\"longTap\\" ]); - const hostConfig = { - initNativeApi: initNativeApi, - getEventCenter(Events) { - if (!my.taroEventCenter) { - my.taroEventCenter = new Events; + Object(createClass[\\"a\\"])(App, [ { + key: \\"componentDidMount\\", + value: function componentDidMount() {} + }, { + key: \\"componentDidShow\\", + value: function componentDidShow() {} + }, { + key: \\"componentDidHide\\", + value: function componentDidHide() {} + }, { + key: \\"componentDidCatchError\\", + value: function componentDidCatchError() {} + }, { + key: \\"render\\", + value: function render() { + return this.props.children; } - return my.taroEventCenter; - }, - modifyTaroEvent(event, node) { - if (node.tagName === \\"SWIPER\\" && event.type === \\"animationend\\") { - event.type = \\"animationfinish\\"; - } - }, - isBubbleEvents(eventName) { - return BUBBLE_EVENTS.has(eventName); + } ]); + return App; + }(mocks_react[\\"Component\\"]); + var lib_src_app = app_App; + var taro_react = __webpack_require__(9); + var app_config = { + pages: [ \\"pages/index/index\\" ], + window: { + backgroundTextStyle: \\"light\\", + navigationBarBackgroundColor: \\"#fff\\", + navigationBarTitleText: \\"WeChat\\", + navigationBarTextStyle: \\"black\\" } }; - const {userAgent: userAgent} = navigator; - Object.defineProperty(navigator, \\"userAgent\\", { - configurable: true, - enumerable: true, - get() { - return userAgent || navigator.swuserAgent || \\"\\"; + taro_runtime[\\"window\\"].__taroAppConfig = app_config; + var app_inst = App(createReactApp(lib_src_app, mocks_react, taro_react[\\"a\\"], app_config)); + Object(taro[\\"initPxTransform\\"])({ + designWidth: 750, + deviceRatio: { + 640: 1.17, + 750: 1, + 828: .905 } }); - (0, _shared.mergeReconciler)(hostConfig); - (0, _shared.mergeInternalComponents)(components); - }).call(this, __webpack_require__(0)[\\"navigator\\"]); -}, , function(module, exports, __webpack_require__) {} ], [ [ 10, 0, 1, 3, 2 ] ] ]); + } +}, [ [ 17, 0, 1, 3, 2 ] ] ]); /** filePath: dist\\\\custom-wrapper.js **/ (my[\\"webpackJsonp\\"] = my[\\"webpackJsonp\\"] || []).push([ [ 6 ], { - 14: function(module, exports, __webpack_require__) { + 14: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; - var _runtime = __webpack_require__(0); - Component((0, _runtime.createRecursiveComponentConfig)(\\"custom-wrapper\\")); + __webpack_require__.r(__webpack_exports__); + var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); + Component(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createRecursiveComponentConfig\\"])(\\"custom-wrapper\\")); } }, [ [ 14, 0, 1 ] ] ]); @@ -1360,52 +1549,121 @@ require(\\"./taro\\"); 15: function(module, __webpack_exports__, __webpack_require__) { \\"use strict\\"; __webpack_require__.r(__webpack_exports__); - var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); - var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__); - var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); - var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__); + __webpack_exports__[\\"default\\"] = \\"dependencies\\"; + }, + 16: function(module, exports, __webpack_require__) {}, + 18: function(module, __webpack_exports__, __webpack_require__) { + \\"use strict\\"; + __webpack_require__.r(__webpack_exports__); + var taro_runtime = __webpack_require__(0); + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function() { + var self = this, args = arguments; + return new Promise((function(resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, \\"next\\", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, \\"throw\\", err); + } + _next(undefined); + })); + }; + } + var classCallCheck = __webpack_require__(4); + var createClass = __webpack_require__(5); + var inherits = __webpack_require__(7); + var createSuper = __webpack_require__(6); + var regenerator = __webpack_require__(8); + var regenerator_default = __webpack_require__.n(regenerator); + var react = __webpack_require__(2); + var taro_components = __webpack_require__(3); + var index = __webpack_require__(16); + var index_Index = function(_Component) { + Object(inherits[\\"a\\"])(Index, _Component); + var _super = Object(createSuper[\\"a\\"])(Index); + function Index() { + Object(classCallCheck[\\"a\\"])(this, Index); + return _super.apply(this, arguments); + } + Object(createClass[\\"a\\"])(Index, [ { + key: \\"componentWillMount\\", + value: function() { + var _componentWillMount = _asyncToGenerator(regenerator_default.a.mark((function _callee() { + return regenerator_default.a.wrap((function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return Promise.resolve(1); + + case 2: + case \\"end\\": + return _context.stop(); + } + } + }), _callee); + }))); + function componentWillMount() { + return _componentWillMount.apply(this, arguments); + } + return componentWillMount; + }() + }, { + key: \\"componentDidMount\\", + value: function componentDidMount() {} + }, { + key: \\"componentWillUnmount\\", + value: function componentWillUnmount() {} + }, { + key: \\"componentDidShow\\", + value: function componentDidShow() {} + }, { + key: \\"componentDidHide\\", + value: function componentDidHide() {} + }, { + key: \\"render\\", + value: function render() { + return react[\\"default\\"].createElement(taro_components[\\"View\\"], { + className: \\"index\\" + }, react[\\"default\\"].createElement(taro_components[\\"Text\\"], null, \\"Hello world!\\"), react[\\"default\\"].createElement(taro_components[\\"Input\\"], { + placeholder: \\"input\\", + value: \\"\\" + }), react[\\"default\\"].createElement(taro_components[\\"Textarea\\"], { + value: \\"\\" + }), react[\\"default\\"].createElement(taro_components[\\"Swiper\\"], null, react[\\"default\\"].createElement(taro_components[\\"SwiperItem\\"], null, react[\\"default\\"].createElement(taro_components[\\"Text\\"], null, \\"Swiper item\\"))), react[\\"default\\"].createElement(taro_components[\\"Video\\"], null), react[\\"default\\"].createElement(taro_components[\\"Canvas\\"], null, react[\\"default\\"].createElement(taro_components[\\"CoverView\\"], null, react[\\"default\\"].createElement(taro_components[\\"CoverImage\\"], null)))); + } + } ]); + return Index; + }(react[\\"Component\\"]); var config = { navigationBarTitleText: \\"\\\\u9996\\\\u9875\\" }; - var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1___default.a, \\"pages/index/index\\", { + var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", { root: { cn: [] } }, config || {})); }, - 17: function(module, exports, __webpack_require__) {}, - 7: function(module, exports, __webpack_require__) { - \\"use strict\\"; - var _interopRequireWildcard = __webpack_require__(3).default; - Object.defineProperty(exports, \\"__esModule\\", { - value: true - }); - exports.default = void 0; - var _react = _interopRequireWildcard(__webpack_require__(2)); - var _components = __webpack_require__(16); - __webpack_require__(17); - class Index extends _react.Component { - async componentWillMount() { - await Promise.resolve(1); - } - componentDidMount() {} - componentWillUnmount() {} - componentDidShow() {} - componentDidHide() {} - render() { - return _react.default.createElement(_components.View, { - className: \\"index\\" - }, _react.default.createElement(_components.Text, null, \\"Hello world!\\"), _react.default.createElement(_components.Input, { - placeholder: \\"input\\", - value: \\"\\" - }), _react.default.createElement(_components.Textarea, { - value: \\"\\" - }), _react.default.createElement(_components.Swiper, null, _react.default.createElement(_components.SwiperItem, null, _react.default.createElement(_components.Text, null, \\"Swiper item\\"))), _react.default.createElement(_components.Video, null), _react.default.createElement(_components.Canvas, null, _react.default.createElement(_components.CoverView, null, _react.default.createElement(_components.CoverImage, null)))); - } - } - exports.default = Index; + 8: function(module, exports, __webpack_require__) { + module.exports = __webpack_require__(15); } -}, [ [ 15, 0, 1, 3, 2 ] ] ]); +}, [ [ 18, 0, 1, 3, 2 ] ] ]); /** filePath: dist\\\\pages\\\\index\\\\index.json **/ {\\"navigationBarTitleText\\":\\"首页\\",\\"usingComponents\\":{\\"custom-wrapper\\":\\"../../custom-wrapper\\"}} @@ -1460,18 +1718,6 @@ require(\\"./taro\\"); - - - - - - -