From 9d1198215e7b47f91d5513f9eefaca5cda320ad8 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 26 Jul 2019 15:56:33 +0800 Subject: [PATCH] refactor navigateBack --- build/rollup.config.app.js | 27 +- package.json | 3 +- packages/uni-app-plus-nvue/dist/index.js | 8130 ++++++++++++++++- .../uni-app-plus-nvue/dist/index.legacy.js | 12 + packages/uni-app-plus-nvue/dist/uni.js | 2786 ------ packages/uni-h5/dist/index.umd.min.js | 2 +- src/core/helpers/protocol/network/request.js | 149 +- src/core/service/api/network/request.js | 113 + src/core/service/bridge.js | 18 - src/core/service/platform.js | 16 + src/{platforms/h5 => core}/service/uni.js | 0 src/platforms/app-plus-nvue/service/api.js | 5 +- .../service/api/route/navigate-back.js | 93 +- .../service/api/route/navigate-to.js | 18 +- .../app-plus/service/api/device/system.js | 4 +- src/platforms/app-plus/service/api/index.js | 3 +- .../app-plus/service/api/plugin/event-bus.js | 21 + .../app-plus/service/api/ui/tab-bar.js | 12 +- src/platforms/app-plus/service/bridge.js | 22 + .../app-plus/service/framework/app.js | 74 +- .../app-plus/service/framework/bridge.js | 22 - .../app-plus/service/framework/config.js | 27 +- .../framework/create-instance-context.js | 74 - .../app-plus/service/framework/holder.js | 32 - .../app-plus/service/framework/page.js | 18 +- .../framework/{tabbar.js => tab-bar.js} | 6 - .../service/framework/webview/index.js | 22 +- .../webview/parser/pull-to-refresh-parser.js | 6 +- .../webview/parser/title-nview-parser.js | 2 + .../webview/parser/webview-style-parser.js | 14 +- src/platforms/app-plus/service/index.js | 33 + src/platforms/app-plus/service/polyfill.js | 6 - src/platforms/app-plus/service/uni.js | 27 - .../h5/service/api/network/request.js | 335 +- .../h5/service/api/{ => plugin}/event-bus.js | 0 src/platforms/h5/service/index.js | 2 +- src/shared/index.js | 1 + 37 files changed, 8337 insertions(+), 3798 deletions(-) delete mode 100644 packages/uni-app-plus-nvue/dist/uni.js create mode 100644 src/core/service/api/network/request.js create mode 100644 src/core/service/platform.js rename src/{platforms/h5 => core}/service/uni.js (100%) create mode 100644 src/platforms/app-plus/service/api/plugin/event-bus.js delete mode 100644 src/platforms/app-plus/service/framework/bridge.js delete mode 100644 src/platforms/app-plus/service/framework/create-instance-context.js delete mode 100644 src/platforms/app-plus/service/framework/holder.js rename src/platforms/app-plus/service/framework/{tabbar.js => tab-bar.js} (94%) create mode 100644 src/platforms/app-plus/service/index.js delete mode 100644 src/platforms/app-plus/service/polyfill.js delete mode 100644 src/platforms/app-plus/service/uni.js rename src/platforms/h5/service/api/{ => plugin}/event-bus.js (100%) diff --git a/build/rollup.config.app.js b/build/rollup.config.app.js index 0c8c141fbe..b2e5c49872 100644 --- a/build/rollup.config.app.js +++ b/build/rollup.config.app.js @@ -17,16 +17,27 @@ const external = [] if (process.env.UNI_SERVICE === 'legacy') { input = 'src/platforms/app-plus-nvue/services/index.legacy.js' output.file = 'packages/uni-app-plus-nvue/dist/index.legacy.js' -} else if (process.env.UNI_SERVICE === 'uni') { - input = 'src/platforms/app-plus/service/uni.js' - output.file = 'packages/uni-app-plus-nvue/dist/uni.js' +} else { + input = 'src/platforms/app-plus/service/index.js' + output.file = 'packages/uni-app-plus-nvue/dist/index.js' + output.format = 'iife' + output.name = 'serviceContext' output.banner = - `export function createUniInstance(weex, plus, __uniConfig, __uniRoutes, __registerPage, UniServiceJSBridge, getApp, getCurrentPages){ + `export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge){ var localStorage = plus.storage +var setTimeout = global.setTimeout +var clearTimeout = global.clearTimeout +` + output.footer = + ` +var uni = serviceContext.uni +var getApp = serviceContext.getApp +var getCurrentPages = serviceContext.getCurrentPages + +var __registerPage = serviceContext.__registerPage + +return serviceContext \n} ` - output.footer = '\n return uni$1 \n}' -} else { - external.push('./uni') } module.exports = { @@ -40,7 +51,7 @@ module.exports = { 'uni-core': path.resolve(__dirname, '../src/core'), 'uni-platform': path.resolve(__dirname, '../src/platforms/' + process.env.UNI_PLATFORM), 'uni-platforms': path.resolve(__dirname, '../src/platforms'), - 'uni-shared': path.resolve(__dirname, '../src/shared/util.js'), + 'uni-shared': path.resolve(__dirname, '../src/shared/index.js'), 'uni-helpers': path.resolve(__dirname, '../src/core/helpers') }), replace({ diff --git a/package.json b/package.json index e450eeb5c8..42f26eb600 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "dev:h5": "npm run lint && cross-env NODE_ENV=production UNI_WATCH=true UNI_PLATFORM=h5 node build/build.js", "build:h5": "npm run lint && cross-env NODE_ENV=production UNI_WATCH=false UNI_PLATFORM=h5 node build/build.js", "build:app-plus": "cross-env UNI_PLATFORM=app-plus rollup -c build/rollup.config.mp.js", - "build:app:all": "npm run lint && npm run build:app:uni && npm run build:app:nvue && npm run build:app:legacy", - "build:app:uni": "UNI_PLATFORM=app-plus-nvue UNI_SERVICE=uni rollup -c build/rollup.config.app.js", + "build:app:all": "npm run lint && npm run build:app:nvue && npm run build:app:legacy", "build:app:nvue": "cross-env UNI_PLATFORM=app-plus-nvue rollup -c build/rollup.config.app.js", "build:app:legacy": "cross-env UNI_PLATFORM=app-plus-nvue UNI_SERVICE=legacy rollup -c build/rollup.config.app.js", "build:mp-qq": "cross-env UNI_PLATFORM=mp-qq rollup -c build/rollup.config.mp.js", diff --git a/packages/uni-app-plus-nvue/dist/index.js b/packages/uni-app-plus-nvue/dist/index.js index 24a6e0a46c..c6abb82881 100644 --- a/packages/uni-app-plus-nvue/dist/index.js +++ b/packages/uni-app-plus-nvue/dist/index.js @@ -1,591 +1,7759 @@ -import { createUniInstance } from './uni'; +export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge){ +var localStorage = plus.storage +var setTimeout = global.setTimeout +var clearTimeout = global.clearTimeout -function callHook (vm, hook, params) { - return (vm.$vm || vm).__call_hook(hook, params) -} - -function callAppHook (vm, hook, params) { - if (hook !== 'onError') { - console.debug(`App:${hook} have been invoked` + (params ? ` ${JSON.stringify(params)}` : '')); +var serviceContext = (function () { + 'use strict'; + + function callHook (vm, hook, params) { + return (vm.$vm || vm).__call_hook(hook, params) } - return (vm.$vm || vm).__call_hook(hook, params) -} -function callPageHook (vm, hook, params) { - if (hook !== 'onPageScroll') { - console.debug(`${vm.$page.route}[${vm.$page.id}]:${hook} have been invoked`); + function callAppHook (vm, hook, params) { + if (hook !== 'onError') { + console.debug(`App:${hook} have been invoked` + (params ? ` ${JSON.stringify(params)}` : '')); + } + return (vm.$vm || vm).__call_hook(hook, params) } - return callHook(vm, hook, params) -} + + function callPageHook (vm, hook, params) { + if (hook !== 'onPageScroll') { + console.debug(`${vm.$page.route}[${vm.$page.id}]:${hook} have been invoked`); + } + return callHook(vm, hook, params) + } -let appCtx; - -const NETWORK_TYPES = [ - 'unknown', - 'none', - 'ethernet', - 'wifi', - '2g', - '3g', - '4g' -]; - -function getApp () { - return appCtx -} - -function initGlobalListeners ({ - uni, - plus, - UniServiceJSBridge -}) { - const emit = UniServiceJSBridge.emit; - - plus.key.addEventListener('backbutton', () => { - uni.navigateBack({ - from: 'backbutton' - }); - }); + function callApiSync (api, args, name, alias) { + const ret = api(args); + if (ret && ret.errMsg) { + ret.errMsg = ret.errMsg.replace(name, alias); + } + return ret + } - plus.globalEvent.addEventListener('pause', () => { - emit('onAppEnterBackground'); - }); + function getLastWebview () { + try { + const pages = getCurrentPages(); + if (pages.length) { + return pages[pages.length - 1].$getAppWebview() + } + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + console.log('getCurrentPages is not ready'); + } + } + } - plus.globalEvent.addEventListener('resume', () => { - emit('onAppEnterForeground'); - }); + function isTabBarPage (route = '') { + if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) { + return false + } + try { + if (!route) { + const pages = getCurrentPages(); + if (!pages.length) { + return false + } + const page = pages[pages.length - 1]; + if (!page) { + return false + } + route = page.route; + } + return !!__uniConfig.tabBar.list.find(tabBarPage => { + const pagePath = tabBarPage.pagePath; + return pagePath === route || pagePath === (route + '.html') + }) + } catch (e) { + if (process.env.NODE_ENV !== 'production') { + console.log('getCurrentPages is not ready'); + } + } + return false + } - plus.globalEvent.addEventListener('netchange', () => { - const networkType = NETWORK_TYPES[plus.networkinfo.getCurrentType()]; - emit('onNetworkStatusChange', { - isConnected: networkType !== 'none', - networkType - }); - }); -} + const getRealRoute = (e, t) => { + if (t.indexOf('./') === 0) return getRealRoute(e, t.substr(2)) + let n; + let i; + let o = t.split('/'); + for (n = 0, i = o.length; n < i && o[n] === '..'; n++); + o.splice(0, n); + t = o.join('/'); + let r = e.length > 0 ? e.split('/') : []; + r.splice(r.length - n - 1, n + 1); + return r.concat(o).join('/') + }; -function initAppLaunch (appVm, { - __uniConfig -}) { - const args = { - path: __uniConfig.entryPagePath, - query: {}, - scene: 1001 + // 处理 Android 平台解压与非解压模式下获取的路径不一致的情况 + const _handleLocalPath = filePath => { + let localUrl = plus.io.convertLocalFileSystemURL(filePath); + return localUrl.replace(/^\/?apps\//, '/android_asset/apps/').replace(/\/$/, '') }; - callAppHook(appVm, 'onLaunch', args); - callAppHook(appVm, 'onShow', args); -} + function getRealPath (filePath) { + const SCHEME_RE = /^([a-z-]+:)?\/\//i; + const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/; + + // 无协议的情况补全 https + if (filePath.indexOf('//') === 0) { + filePath = 'https:' + filePath; + } + + // 网络资源或base64 + if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath)) { + return filePath + } -function registerApp (appVm, instanceContext) { - if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] registerApp`); + if (filePath.indexOf('_www') === 0 || filePath.indexOf('_doc') === 0 || filePath.indexOf('_documents') === 0 || + filePath.indexOf('_downloads') === 0) { + return 'file://' + _handleLocalPath(filePath) + } + const wwwPath = 'file://' + _handleLocalPath('_www'); + // 绝对路径转换为本地文件系统路径 + if (filePath.indexOf('/') === 0) { + return wwwPath + filePath + } + // 相对资源 + if (filePath.indexOf('../') === 0 || filePath.indexOf('./') === 0) { + if (typeof __id__ === 'string') { + return wwwPath + getRealRoute('/' + __id__, filePath) + } else { + const pages = getCurrentPages(); + if (pages.length) { + return wwwPath + getRealRoute('/' + pages[pages.length - 1].route, filePath) + } + } + } + return filePath } - appCtx = appVm; + function getStatusBarStyle () { + let style = plus.navigator.getStatusBarStyle(); + if (style === 'UIStatusBarStyleBlackTranslucent' || style === 'UIStatusBarStyleBlackOpaque' || style === 'null') { + style = 'light'; + } else if (style === 'UIStatusBarStyleDefault') { + style = 'dark'; + } + return style + } - initAppLaunch(appVm, instanceContext); + const PI = 3.1415926535897932384626; + const a = 6378245.0; + const ee = 0.00669342162296594323; - initGlobalListeners(instanceContext); -} - -const _toString = Object.prototype.toString; + function wgs84togcj02 (lng, lat) { + lat = +lat; + lng = +lng; + if (outOfChina(lng, lat)) { + return [lng, lat] + } + let dlat = _transformlat(lng - 105.0, lat - 35.0); + let dlng = _transformlng(lng - 105.0, lat - 35.0); + const radlat = lat / 180.0 * PI; + let magic = Math.sin(radlat); + magic = 1 - ee * magic * magic; + const sqrtmagic = Math.sqrt(magic); + dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); + dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI); + const mglat = lat + dlat; + const mglng = lng + dlng; + return [mglng, mglat] + } -function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' -} - -function parseTitleNView (routeOptions) { - const windowOptions = routeOptions.window; - const titleNView = windowOptions.titleNView; - if ( // 无头 - titleNView === false || - titleNView === 'false' || - ( - windowOptions.navigationStyle === 'custom' && - !isPlainObject(titleNView) - ) - ) { - return false + function gcj02towgs84 (lng, lat) { + lat = +lat; + lng = +lng; + if (outOfChina(lng, lat)) { + return [lng, lat] + } + let dlat = _transformlat(lng - 105.0, lat - 35.0); + let dlng = _transformlng(lng - 105.0, lat - 35.0); + const radlat = lat / 180.0 * PI; + let magic = Math.sin(radlat); + magic = 1 - ee * magic * magic; + const sqrtmagic = Math.sqrt(magic); + dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI); + dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI); + const mglat = lat + dlat; + const mglng = lng + dlng; + return [lng * 2 - mglng, lat * 2 - mglat] } - const ret = { - autoBackButton: !routeOptions.meta.isQuit, - backgroundColor: windowOptions.navigationBarBackgroundColor || '#000000', - titleText: windowOptions.navigationBarTitleText || '', - titleColor: windowOptions.navigationBarTextStyle === 'black' ? '#000000' : '#ffffff' + const _transformlat = function (lng, lat) { + let ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng)); + ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0; + ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0; + return ret }; + const _transformlng = function (lng, lat) { + let ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng)); + ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0; + ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0; + ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0; + return ret + }; + + const outOfChina = function (lng, lat) { + return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false) + }; + + let webview; - if (isPlainObject(titleNView)) { - return Object.assign(ret, titleNView) + function setPullDownRefreshPageId (pullDownRefreshWebview) { + webview = pullDownRefreshWebview; } - return ret -} + function startPullDownRefresh () { + if (webview) { + webview.endPullToRefresh(); + } + webview = getLastWebview(); + if (webview) { + webview.beginPullToRefresh(); + return { + errMsg: 'startPullDownRefresh:ok' + } + } + return { + errMsg: 'startPullDownRefresh:fail' + } + } + + function stopPullDownRefresh () { + if (!webview) { + webview = getLastWebview(); + } + if (webview) { + webview.endPullToRefresh(); + webview = null; + return { + errMsg: 'stopPullDownRefresh:ok' + } + } + return { + errMsg: 'stopPullDownRefresh:fail' + } + } -function parsePullToRefresh (routeOptions, { - plus -}) { - const windowOptions = routeOptions.window; + function initOn (on, { + getApp, + getCurrentPages + }) { + function onError (err) { + callAppHook(getApp(), 'onError', err); + } - if (windowOptions.enablePullDownRefresh) { - const pullToRefreshStyles = Object.create(null); - // 初始化默认值 - if (plus.os.name === 'Android') { - Object.assign(pullToRefreshStyles, { - support: true, - style: 'circle' - }); - } else { - Object.assign(pullToRefreshStyles, { - support: true, - style: 'default', - height: '50px', - range: '200px', - contentdown: { - caption: '' - }, - contentover: { - caption: '' - }, - contentrefresh: { - caption: '' - } - }); + function onPageNotFound (page) { + callAppHook(getApp(), 'onPageNotFound', page); } - if (windowOptions.backgroundTextStyle) { - pullToRefreshStyles.color = windowOptions.backgroundTextStyle; - pullToRefreshStyles.snowColor = windowOptions.backgroundTextStyle; + function onPullDownRefresh (args, pageId) { + const page = getCurrentPages().find(page => page.$page.id === pageId); + if (page) { + setPullDownRefreshPageId(pageId); + callPageHook(page, 'onPullDownRefresh'); + } } - Object.assign(pullToRefreshStyles, windowOptions.pullToRefresh || {}); + function callCurrentPageHook (hook, args) { + const pages = getCurrentPages(); + if (pages.length) { + callPageHook(pages[pages.length - 1], hook, args); + } + } - return pullToRefreshStyles - } -} - -const WEBVIEW_STYLE_BLACKLIST = [ - 'navigationBarBackgroundColor', - 'navigationBarTextStyle', - 'navigationBarTitleText', - 'navigationBarShadow', - 'navigationStyle', - 'disableScroll', - 'backgroundColor', - 'backgroundTextStyle', - 'enablePullDownRefresh', - 'onReachBottomDistance', - 'usingComponents', - // 需要解析的 - 'titleNView', - 'pullToRefresh' -]; - -function parseWebviewStyle (id, path, routeOptions = {}, instanceContext) { - const { - __uniConfig - } = instanceContext; - - const webviewStyle = Object.create(null); - - // 合并 - const windowOptions = Object.assign( - JSON.parse(JSON.stringify(__uniConfig.window || {})), - routeOptions.window || {} - ); - - Object.keys(windowOptions).forEach(name => { - if (WEBVIEW_STYLE_BLACKLIST.indexOf(name) === -1) { - webviewStyle[name] = windowOptions[name]; + function createCallCurrentPageHook (hook) { + return function (args) { + callCurrentPageHook(hook, args); + } } - }); - const titleNView = parseTitleNView(routeOptions); - if (titleNView) { - if (id === 1 && __uniConfig.realEntryPagePath === path) { - titleNView.autoBackButton = true; + function onAppEnterBackground () { + callAppHook(getApp(), 'onHide'); + callCurrentPageHook('onHide'); } - webviewStyle.titleNView = titleNView; - } - const pullToRefresh = parsePullToRefresh(routeOptions, instanceContext); - if (pullToRefresh) { - if (pullToRefresh.style === 'circle') { - webviewStyle.bounce = 'none'; + function onAppEnterForeground () { + callAppHook(getApp(), 'onShow'); + callCurrentPageHook('onShow'); + } + + function onWebInvokeAppService ({ + name, + arg + }, pageId) { + if (name === 'postMessage') ; else { + uni[name](arg); + } + } + + const routeHooks = { + navigateTo () { + callCurrentPageHook('onHide'); + }, + navigateBack () { + callCurrentPageHook('onShow'); + } + }; + + function onAppRoute ({ + type + }) { + const routeHook = routeHooks[type]; + routeHook && routeHook(); + } + + on('onError', onError); + on('onPageNotFound', onPageNotFound); + + { // 后续有时间,h5 平台也要迁移到 onAppRoute + on('onAppRoute', onAppRoute); } - webviewStyle.pullToRefresh = pullToRefresh; + + on('onAppEnterBackground', onAppEnterBackground); + on('onAppEnterForeground', onAppEnterForeground); + + on('onPullDownRefresh', onPullDownRefresh); + + on('onTabItemTap', createCallCurrentPageHook('onTabItemTap')); + on('onNavigationBarButtonTap', createCallCurrentPageHook('onNavigationBarButtonTap')); + + on('onNavigationBarSearchInputChanged', createCallCurrentPageHook('onNavigationBarSearchInputChanged')); + on('onNavigationBarSearchInputConfirmed', createCallCurrentPageHook('onNavigationBarSearchInputConfirmed')); + on('onNavigationBarSearchInputClicked', createCallCurrentPageHook('onNavigationBarSearchInputClicked')); + + on('onWebInvokeAppService', onWebInvokeAppService); + } + + let supportsPassive = false; + try { + const opts = {}; + Object.defineProperty(opts, 'passive', ({ + get () { + /* istanbul ignore next */ + supportsPassive = true; + } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); + } catch (e) {} + + const _toString = Object.prototype.toString; + const hasOwnProperty = Object.prototype.hasOwnProperty; + + function isFn (fn) { + return typeof fn === 'function' } - // 不支持 hide - if (webviewStyle.popGesture === 'hide') { - delete webviewStyle.popGesture; + function isPlainObject (obj) { + return _toString.call(obj) === '[object Object]' } - // TODO 下拉刷新 + function hasOwn (obj, key) { + return hasOwnProperty.call(obj, key) + } - if (path && routeOptions.meta.isNVue) { - webviewStyle.uniNView = { - path, - defaultFontSize: __uniConfig.defaultFontSize, - viewport: __uniConfig.viewport - }; + function toRawType (val) { + return _toString.call(val).slice(8, -1) } - return webviewStyle -} + function getLen (str = '') { + /* eslint-disable no-control-regex */ + return ('' + str).replace(/[^\x00-\xff]/g, '**').length + } -function parseNavigationBar (webviewStyle) { - let titleText = ''; - let textColor = ''; - let backgroundColor = ''; - const titleNView = webviewStyle.titleNView; - if (titleNView) { - titleText = titleNView.titleText || ''; - textColor = titleNView.textColor || ''; - backgroundColor = titleNView.backgroundColor || ''; - } - return { - titleText, - textColor, - backgroundColor - } -} + const decode = decodeURIComponent; + + function parseQuery (query) { + const res = {}; + + query = query.trim().replace(/^(\?|#|&)/, ''); + + if (!query) { + return res + } + + query.split('&').forEach(param => { + const parts = param.replace(/\+/g, ' ').split('='); + const key = decode(parts.shift()); + const val = parts.length > 0 + ? decode(parts.join('=')) + : null; + + if (res[key] === undefined) { + res[key] = val; + } else if (Array.isArray(res[key])) { + res[key].push(val); + } else { + res[key] = [res[key], val]; + } + }); + + return res + } -let id = 2; + function parseTitleNView (routeOptions) { + const windowOptions = routeOptions.window; + const titleNView = windowOptions.titleNView; + if ( // 无头 + titleNView === false || + titleNView === 'false' || + ( + windowOptions.navigationStyle === 'custom' && + !isPlainObject(titleNView) + ) + ) { + return false + } -const WEBVIEW_LISTENERS = { - 'pullToRefresh': 'onPullDownRefresh', - 'titleNViewSearchInputChanged': 'onNavigationBarSearchInputChanged', - 'titleNViewSearchInputConfirmed': 'onNavigationBarSearchInputConfirmed', - 'titleNViewSearchInputClicked': 'onNavigationBarSearchInputClicked' -}; + const ret = { + autoBackButton: !routeOptions.meta.isQuit, + backgroundColor: windowOptions.navigationBarBackgroundColor || '#000000', + titleText: windowOptions.navigationBarTitleText || '', + titleColor: windowOptions.navigationBarTextStyle === 'black' ? '#000000' : '#ffffff' + }; -function createWebview (path, instanceContext, routeOptions) { - const webviewId = id++; - const webviewStyle = parseWebviewStyle( - webviewId, - path, - routeOptions, - instanceContext - ); - if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] createWebview`, webviewId, path, webviewStyle); - } - const webview = instanceContext.plus.webview.create('', String(webviewId), webviewStyle); + routeOptions.meta.statusBarStyle = windowOptions.navigationBarTextStyle === 'black' ? 'dark' : 'light'; + + if (isPlainObject(titleNView)) { + return Object.assign(ret, titleNView) + } + + return ret + } + + function parsePullToRefresh (routeOptions) { + const windowOptions = routeOptions.window; + + if (windowOptions.enablePullDownRefresh) { + const pullToRefreshStyles = Object.create(null); + // 初始化默认值 + if (plus.os.name === 'Android') { + Object.assign(pullToRefreshStyles, { + support: true, + style: 'circle' + }); + } else { + Object.assign(pullToRefreshStyles, { + support: true, + style: 'default', + height: '50px', + range: '200px', + contentdown: { + caption: '' + }, + contentover: { + caption: '' + }, + contentrefresh: { + caption: '' + } + }); + } + + if (windowOptions.backgroundTextStyle) { + pullToRefreshStyles.color = windowOptions.backgroundTextStyle; + pullToRefreshStyles.snowColor = windowOptions.backgroundTextStyle; + } + + Object.assign(pullToRefreshStyles, windowOptions.pullToRefresh || {}); + + return pullToRefreshStyles + } + } + + const WEBVIEW_STYLE_BLACKLIST = [ + 'navigationBarBackgroundColor', + 'navigationBarTextStyle', + 'navigationBarTitleText', + 'navigationBarShadow', + 'navigationStyle', + 'disableScroll', + 'backgroundColor', + 'backgroundTextStyle', + 'enablePullDownRefresh', + 'onReachBottomDistance', + 'usingComponents', + // 需要解析的 + 'titleNView', + 'pullToRefresh' + ]; + + function parseWebviewStyle (id, path, routeOptions = {}) { + const webviewStyle = Object.create(null); + + // 合并 + routeOptions.window = Object.assign( + JSON.parse(JSON.stringify(__uniConfig.window || {})), + routeOptions.window || {} + ); + + Object.keys(routeOptions.window).forEach(name => { + if (WEBVIEW_STYLE_BLACKLIST.indexOf(name) === -1) { + webviewStyle[name] = routeOptions.window[name]; + } + }); + + const titleNView = parseTitleNView(routeOptions); + if (titleNView) { + if (id === 1 && __uniConfig.realEntryPagePath === path) { + titleNView.autoBackButton = true; + } + webviewStyle.titleNView = titleNView; + } + + const pullToRefresh = parsePullToRefresh(routeOptions); + if (pullToRefresh) { + if (pullToRefresh.style === 'circle') { + webviewStyle.bounce = 'none'; + } + webviewStyle.pullToRefresh = pullToRefresh; + } - webview.$navigationBar = parseNavigationBar(webviewStyle); + // 不支持 hide + if (webviewStyle.popGesture === 'hide') { + delete webviewStyle.popGesture; + } + + // TODO 下拉刷新 + + if (path && routeOptions.meta.isNVue) { + webviewStyle.uniNView = { + path, + defaultFontSize: __uniConfig.defaultFontSize, + viewport: __uniConfig.viewport + }; + } - return webview -} + return webviewStyle + } + + let id = 2; + + const WEBVIEW_LISTENERS = { + 'pullToRefresh': 'onPullDownRefresh', + 'titleNViewSearchInputChanged': 'onNavigationBarSearchInputChanged', + 'titleNViewSearchInputConfirmed': 'onNavigationBarSearchInputConfirmed', + 'titleNViewSearchInputClicked': 'onNavigationBarSearchInputClicked' + }; -function initWebview (webview, instanceContext, routeOptions) { - if (isPlainObject(routeOptions)) { + function createWebview (path, routeOptions) { + const webviewId = id++; const webviewStyle = parseWebviewStyle( - parseInt(webview.id), - '', - routeOptions, - instanceContext + webviewId, + path, + routeOptions ); if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] updateWebview`, webviewStyle); + console.log(`[uni-app] createWebview`, webviewId, path, webviewStyle); } + const webview = plus.webview.create('', String(webviewId), webviewStyle); - webview.$navigationBar = parseNavigationBar(webviewStyle); - - webview.setStyle(webviewStyle); + return webview } - const { - on, - emit - } = instanceContext.UniServiceJSBridge; + function initWebview (webview, routeOptions) { + if (isPlainObject(routeOptions)) { + const webviewStyle = parseWebviewStyle( + parseInt(webview.id), + '', + routeOptions + ); + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] updateWebview`, webviewStyle); + } + + webview.setStyle(webviewStyle); + } + + const { + on, + emit + } = UniServiceJSBridge; - // TODO subNVues - Object.keys(WEBVIEW_LISTENERS).forEach(name => { - webview.addEventListener(name, (e) => { - emit(WEBVIEW_LISTENERS[name], e, parseInt(webview.id)); + // TODO subNVues + Object.keys(WEBVIEW_LISTENERS).forEach(name => { + webview.addEventListener(name, (e) => { + emit(WEBVIEW_LISTENERS[name], e, parseInt(webview.id)); + }); }); - }); - // TODO 应该结束之前未完成的下拉刷新 - on(webview.id + '.startPullDownRefresh', () => { - webview.beginPullToRefresh(); - }); + // TODO 应该结束之前未完成的下拉刷新 + on(webview.id + '.startPullDownRefresh', () => { + webview.beginPullToRefresh(); + }); - on(webview.id + '.stopPullDownRefresh', () => { - webview.endPullToRefresh(); - }); + on(webview.id + '.stopPullDownRefresh', () => { + webview.endPullToRefresh(); + }); - return webview -} + return webview + } -const pages = []; - -function getCurrentPages () { - return pages -} -/** - * @param {Object} pageVm - * - * page.beforeCreate 时添加 page - * page.beforeDestroy 时移出 page - * - * page.viewappear onShow - * page.viewdisappear onHide - * - * navigateTo - * redirectTo - * - * - * - * - * - * - */ - -/** - * 首页需要主动registerPage,二级页面路由跳转时registerPage - */ -function registerPage ({ - path, - webview -}, instanceContext) { - const routeOptions = JSON.parse(JSON.stringify(instanceContext.__uniRoutes.find(route => route.path === path))); - - if (!webview) { - webview = createWebview(path, instanceContext, routeOptions); - } - - if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] registerPage`, path, webview.id); - } - - initWebview(webview, instanceContext, webview.id === '1' && routeOptions); - - const route = path.slice(1); - - webview.__uniapp_route = route; - - pages.push({ - route, - $getAppWebview () { - return webview - }, - $page: { - id: parseInt(webview.id), - meta: routeOptions.meta, - path, - route + const pages = []; + + function getCurrentPages$1 () { + return pages + } + /** + * @param {Object} pageVm + * + * page.beforeCreate 时添加 page + * page.beforeDestroy 时移出 page + * + * page.viewappear onShow + * page.viewdisappear onHide + * + * navigateTo + * redirectTo + * + * + * + * + * + * + */ + + /** + * 首页需要主动registerPage,二级页面路由跳转时registerPage + */ + function registerPage ({ + path, + query, + webview + }) { + const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path))); + + if (!webview) { + webview = createWebview(path, routeOptions); } - }); - return webview -} - -const uniConfig = Object.create(null); -const uniRoutes = []; - -function parseRoutes (config) { - uniRoutes.length = 0; - /* eslint-disable no-mixed-operators */ - const tabBarList = (config.tabBar && config.tabBar.list || []).map(item => item.pagePath); - - Object.keys(config.page).forEach(function (pagePath) { - const isTabBar = tabBarList.indexOf(pagePath) !== -1; - const isQuit = isTabBar || (config.pages[0] === pagePath); - const isNVue = !!config.page[pagePath].nvue; - uniRoutes.push({ - path: '/' + pagePath, - meta: { - isQuit, - isTabBar, - isNVue - }, - window: config.page[pagePath].window || {} - }); - }); -} + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] registerPage`, path, webview.id); + } -function registerConfig (config, { - plus -}) { - Object.assign(uniConfig, config); + initWebview(webview, webview.id === '1' && routeOptions); - uniConfig.viewport = ''; - uniConfig.defaultFontSize = ''; + const route = path.slice(1); - if (uniConfig.nvueCompiler === 'uni-app') { - uniConfig.viewport = plus.screen.resolutionWidth; - uniConfig.defaultFontSize = uniConfig.viewport / 20; - } + webview.__uniapp_route = route; - parseRoutes(uniConfig); + pages.push({ + route, + options: Object.assign({}, query || {}), + $getAppWebview () { + return webview + }, + $page: { + id: parseInt(webview.id), + meta: routeOptions.meta, + path, + route + } + }); - if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] registerConfig`, uniConfig); + return webview + } + + function unpack (args) { + return args } -} + + function invoke (...args) { + return UniServiceJSBridge.invokeCallbackHandler(...args) + } -function initOn (on, { - getApp, - getCurrentPages -}) { - function onError (err) { - callAppHook(getApp(), 'onError', err); + function requireNativePlugin (name) { + return uni.requireNativePlugin(name) } - function onPageNotFound (page) { - callAppHook(getApp(), 'onPageNotFound', page); + /** + * 触发 service 层,与 onMethod 对应 + */ + function publish (name, res) { + return UniServiceJSBridge.emit('api.' + name, res) } - function onPullDownRefresh (args, pageId) { - const page = getCurrentPages().find(page => page.$page.id === pageId); - if (page) { - callPageHook(page, 'onPullDownRefresh'); + let lastStatusBarStyle; + + function setStatusBarStyle (statusBarStyle) { + if (!statusBarStyle) { + const pages = getCurrentPages(); + if (!pages.length) { + return + } + statusBarStyle = pages[pages.length - 1].$page.meta.statusBarStyle; + if (!statusBarStyle || statusBarStyle === lastStatusBarStyle) { + return + } + } + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] setStatusBarStyle`, statusBarStyle); } - } - function callCurrentPageHook (hook, args) { - const pages = getCurrentPages(); - if (pages.length) { - callPageHook(pages[pages.length - 1], hook, args); + lastStatusBarStyle = statusBarStyle; + + plus.navigator.setStatusBarStyle(statusBarStyle); + } + + const callbacks = {}; + /** + * 注册 view 层通知 service 层事件处理 + */ + function registerPlusMessage (type, callback, keepAlive = true) { + if (callbacks[type]) { + throw new Error(`${type} 已注册:` + (callbacks[type].toString())) } - } + callback.keepAlive = !!keepAlive; + callbacks[type] = callback; + } + + const ANI_SHOW = 'pop-in'; + const ANI_DURATION = 300; - function createCallCurrentPageHook (hook) { - return function (args) { - callCurrentPageHook(hook, args); + const TABBAR_HEIGHT = 56; + const TITLEBAR_HEIGHT = 44; + + var safeArea = { + get bottom () { + if (plus.os.name === 'iOS') { + const safeArea = plus.navigator.getSafeAreaInsets(); + return safeArea ? safeArea.bottom : 0 + } + return 0 } - } + }; + + const IMAGE_TOP = 7; + const IMAGE_WIDTH = 24; + const IMAGE_HEIGHT = 24; + const TEXT_TOP = 36; + const TEXT_SIZE = 12; + const TEXT_NOICON_SIZE = 17; + const TEXT_HEIGHT = 12; + const IMAGE_ID = 'TABITEM_IMAGE_'; + const TABBAR_VIEW_ID = 'TABBAR_VIEW_'; - function onAppEnterBackground () { - callAppHook(getApp(), 'onHide'); - callCurrentPageHook('onHide'); - } + let view; + let config; + let winWidth; + let itemWidth; + let itemLength; + let itemImageLeft; + let itemRects = []; + const itemIcons = []; + const itemLayouts = []; + const itemDot = []; + const itemBadge = []; + let itemClickCallback; - function onAppEnterForeground () { - callAppHook(getApp(), 'onShow'); - callCurrentPageHook('onShow'); - } + let selected = 0; + /** + * tabbar显示状态 + */ + let visible = true; - function onWebInvokeAppService ({ - name, - arg - }, pageId) { - if (name === 'postMessage') ; else { - uni[name](arg); - } - } + const init = function () { + const list = config.list; + itemLength = config.list.length; - const routeHooks = { - navigateTo () { - callCurrentPageHook('onHide'); - }, - navigateBack () { - callCurrentPageHook('onShow'); - } + calcItemLayout(); // 计算选项卡布局 + + initBitmaps(list); // 初始化选项卡图标 + + initView(); }; - function onAppRoute ({ - type - }) { - const routeHook = routeHooks[type]; - routeHook && routeHook(); - } + let initView = function () { + const viewStyles = { + height: TABBAR_HEIGHT + }; + if (config.position === 'top') { + viewStyles.top = 0; + } else { + viewStyles.bottom = 0; + viewStyles.height += safeArea.bottom; + } + view = new plus.nativeObj.View(TABBAR_VIEW_ID, viewStyles, getDraws()); - on('onError', onError); - on('onPageNotFound', onPageNotFound); + view.interceptTouchEvent(true); - { // 后续有时间,h5 平台也要迁移到 onAppRoute - on('onAppRoute', onAppRoute); - } + view.addEventListener('click', (e) => { + if (!__uniConfig.__ready__) { // 未 ready,不允许点击 + return + } + const x = e.clientX; + const y = e.clientY; + for (let i = 0; i < itemRects.length; i++) { + if (isCross(x, y, itemRects[i])) { + const draws = getSelectedDraws(i); + const drawTab = !!draws.length; + itemClickCallback && itemClickCallback(config.list[i], i, drawTab); + if (drawTab) { + setTimeout(() => view.draw(draws)); + } + break + } + } + }); + plus.globalEvent.addEventListener('orientationchange', () => { + calcItemLayout(config.list); + if (config.position !== 'top') { + let height = TABBAR_HEIGHT + safeArea.bottom; + view.setStyle({ + height: height + }); + if (visible) { + setWebviewPosition(height); + } + } + view.draw(getDraws()); + }); + if (!visible) { + view.hide(); + } + }; - on('onAppEnterBackground', onAppEnterBackground); - on('onAppEnterForeground', onAppEnterForeground); + let isCross = function (x, y, rect) { + if (x > rect.left && x < (rect.left + rect.width) && y > rect.top && y < (rect.top + rect.height)) { + return true + } + return false + }; - on('onPullDownRefresh', onPullDownRefresh); + let initBitmaps = function (list) { + for (let i = 0; i < list.length; i++) { + const item = list[i]; + if (item.iconData) { + const bitmap = new plus.nativeObj.Bitmap(IMAGE_ID + i); + bitmap.loadBase64Data(item.iconData); + const selectedBitmap = new plus.nativeObj.Bitmap(`${IMAGE_ID}SELECTED_${i}`); + selectedBitmap.loadBase64Data(item.selectedIconData); + itemIcons[i] = { + icon: bitmap, + selectedIcon: selectedBitmap + }; + } else if (item.iconPath) { + itemIcons[i] = { + icon: item.iconPath, + selectedIcon: item.selectedIconPath + }; + } else { + itemIcons[i] = { + icon: false, + selectedIcon: false + }; + } + } + }; - on('onTabItemTap', createCallCurrentPageHook('onTabItemTap')); - on('onNavigationBarButtonTap', createCallCurrentPageHook('onNavigationBarButtonTap')); + let getDraws = function () { + const backgroundColor = config.backgroundColor; + const borderHeight = Math.max(0.5, 1 / plus.screen.scale); // 高分屏最少0.5 + const borderTop = config.position === 'top' ? (TABBAR_HEIGHT - borderHeight) : 0; + const borderStyle = config.borderStyle === 'white' ? 'rgba(255,255,255,0.33)' : 'rgba(0,0,0,0.33)'; - on('onNavigationBarSearchInputChanged', createCallCurrentPageHook('onNavigationBarSearchInputChanged')); - on('onNavigationBarSearchInputConfirmed', createCallCurrentPageHook('onNavigationBarSearchInputConfirmed')); - on('onNavigationBarSearchInputClicked', createCallCurrentPageHook('onNavigationBarSearchInputClicked')); + const draws = [{ + id: `${TABBAR_VIEW_ID}BG`, // 背景色 + tag: 'rect', + color: backgroundColor, + position: { + top: 0, + left: 0, + width: '100%', + height: TABBAR_HEIGHT + safeArea.bottom + } + }, { + id: `${TABBAR_VIEW_ID}BORDER`, + tag: 'rect', + color: borderStyle, + position: { + top: borderTop, + left: 0, + width: '100%', + height: `${borderHeight}px` + } + }]; - on('onWebInvokeAppService', onWebInvokeAppService); -} - -let bridge; + for (let i = 0; i < itemLength; i++) { + const item = config.list[i]; + if (i === selected) { + drawTabItem(draws, i, item.text, config.selectedColor, itemIcons[i].selectedIcon); + } else { + drawTabItem(draws, i, item.text, config.color, itemIcons[i].icon); + } + } + return draws + }; -function initServiceJSBridge (Vue, instanceContext) { - if (bridge) { - return bridge + let getSelectedDraws = function (newSelected) { + if (selected === newSelected) { + return false + } + const draws = []; + const lastSelected = selected; + selected = newSelected; + drawTabItem(draws, lastSelected); + drawTabItem(draws, selected); + return draws + }; + /** + * 获取文字宽度(全角为1) + * @param {*} text + */ + function getFontWidth (text) { + // eslint-disable-next-line + return text.length - (text.match(/[\u0000-\u00ff]/g) || []).length / 2 } + let calcItemLayout = function () { + winWidth = plus.screen.resolutionWidth; + itemWidth = winWidth / itemLength; + itemImageLeft = (itemWidth - IMAGE_WIDTH) / 2; + itemRects = []; + let dotTop = 0; + let dotLeft = 0; + for (let i = 0; i < itemLength; i++) { + itemRects.push({ + top: 0, + left: i * itemWidth, + width: itemWidth, + height: TABBAR_HEIGHT + }); + } - const Emitter = new Vue(); - - bridge = { - on: Emitter.$on.bind(Emitter), - off: Emitter.$off.bind(Emitter), - once: Emitter.$once.bind(Emitter), - emit: Emitter.$emit.bind(Emitter) + for (let i = 0; i < itemLength; i++) { + const item = config.list[i]; + let imgLeft = itemWidth * i + itemImageLeft; + if ((item.iconData || item.iconPath) && item.text) { // 图文 + itemLayouts[i] = { + text: { + top: TEXT_TOP, + left: `${i * itemWidth}px`, + width: `${itemWidth}px`, + height: TEXT_HEIGHT + }, + img: { + top: IMAGE_TOP, + left: `${imgLeft}px`, + width: IMAGE_WIDTH, + height: IMAGE_HEIGHT + } + }; + dotTop = IMAGE_TOP; + dotLeft = imgLeft + IMAGE_WIDTH; + } else if (!(item.iconData || item.iconPath) && item.text) { // 仅文字 + let textLeft = i * itemWidth; + itemLayouts[i] = { + text: { + top: 0, + left: `${textLeft}px`, + width: `${itemWidth}px`, + height: TABBAR_HEIGHT + } + }; + dotTop = (44 - TEXT_NOICON_SIZE) / 2; + dotLeft = textLeft + itemWidth * 0.5 + getFontWidth(item.text) * TEXT_NOICON_SIZE * 0.5; + } else if ((item.iconData || item.iconPath) && !item.text) { // 仅图片 + const diff = 10; + let imgTop = (TABBAR_HEIGHT - IMAGE_HEIGHT - diff) / 2; + let imgLeft = itemWidth * i + itemImageLeft - diff / 2; + itemLayouts[i] = { + img: { + top: `${imgTop}px`, + left: `${imgLeft}px`, + width: IMAGE_WIDTH + diff, + height: IMAGE_HEIGHT + diff + } + }; + dotTop = imgTop; + dotLeft = imgLeft + IMAGE_WIDTH + diff; + } + let height = itemBadge[i] ? 14 : 10; + let badge = itemBadge[i] || '0'; + let font = getFontWidth(badge) - 0.5; + font = font > 1 ? 1 : font; + let width = height + font * 12; + width = width < height ? height : width; + let itemLayout = itemLayouts[i]; + if (itemLayout) { + itemLayout.doc = { + top: dotTop, + left: `${dotLeft - width * 0.382}px`, + width: `${width}px`, + height: `${height}px` + }; + itemLayout.badge = { + top: dotTop, + left: `${dotLeft - width * 0.382}px`, + width: `${width}px`, + height: `${height}px` + }; + } + } }; - initOn(bridge.on, instanceContext); + let drawTabItem = function (draws, index) { + const layout = itemLayouts[index]; - return bridge -} - -let uni$1; + const item = config.list[index]; -function createInstanceContext (instanceContext) { - const { - weex, - Vue, - WeexPlus - } = instanceContext; - const plus = new WeexPlus(weex); + let color = config.color; + let icon = itemIcons[index].icon; + let dot = itemDot[index]; + let badge = itemBadge[index] || ''; - const UniServiceJSBridge = initServiceJSBridge(Vue, { - plus, - getApp, - getCurrentPages - }); + if (index === selected) { + color = config.selectedColor; + icon = itemIcons[index].selectedIcon; + } - function __registerPage (page) { - return registerPage(page, instanceContext) - } + if (icon) { + draws.push({ + id: `${TABBAR_VIEW_ID}ITEM_${index}_ICON`, + tag: 'img', + position: layout.img, + src: icon + }); + } + if (item.text) { + draws.push({ + id: `${TABBAR_VIEW_ID}ITEM_${index}_TEXT`, + tag: 'font', + position: layout.text, + text: item.text, + textStyles: { + size: icon ? TEXT_SIZE : `${TEXT_NOICON_SIZE}px`, + color + } + }); + } + const hiddenPosition = { + letf: 0, + top: 0, + width: 0, + height: 0 + }; + // 绘制小红点(角标背景) + draws.push({ + id: `${TABBAR_VIEW_ID}ITEM_${index}_DOT`, + tag: 'rect', + position: (dot || badge) ? layout.doc : hiddenPosition, + rectStyles: { + color: '#ff0000', + radius: badge ? '7px' : '5px' + } + }); + // 绘制角标文本 + draws.push({ + id: `${TABBAR_VIEW_ID}ITEM_${index}_BADGE`, + tag: 'font', + position: badge ? layout.badge : hiddenPosition, + text: badge || ' ', + textStyles: { + align: 'center', + verticalAlign: 'middle', + color: badge ? '#ffffff' : 'rgba(0,0,0,0)', + overflow: 'ellipsis', + size: '10px' + } + }); + }; + /** + * { + "color": "#7A7E83", + "selectedColor": "#3cc51f", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [{ + "pagePath": "page/component/index.html", + "iconData": "", + "selectedIconData": "", + "text": "组件" + }, { + "pagePath": "page/API/index.html", + "iconData": "", + "selectedIconData": "", + "text": "接口" + }], + "position":"bottom"//bottom|top + } + */ - if (!uni$1) { - uni$1 = createUniInstance( - weex, - plus, - uniConfig, - uniRoutes, - __registerPage, - UniServiceJSBridge, - getApp, - getCurrentPages - ); + /** + * 设置角标 + * @param {string} type + * @param {number} index + * @param {string} text + */ + function setTabBarBadge (type, index, text) { + if (type === 'none') { + itemDot[index] = false; + itemBadge[index] = ''; + } else if (type === 'text') { + itemBadge[index] = text; + } else if (type === 'redDot') { + itemDot[index] = true; + } + if (view) { + calcItemLayout(config.list); + view.draw(getDraws()); + } + } + /** + * 动态设置 tabBar 某一项的内容 + */ + function setTabBarItem (index, text, iconPath, selectedIconPath) { + if (iconPath || selectedIconPath) { + let itemIcon = itemIcons[index] = itemIcons[index] || {}; + if (iconPath) { + itemIcon.icon = getRealPath(iconPath); + } + if (selectedIconPath) { + itemIcon.selectedIcon = getRealPath(selectedIconPath); + } + } + if (text) { + config.list[index].text = text; + } + view.draw(getDraws()); + } + /** + * 动态设置 tabBar 的整体样式 + * @param {Object} style 样式 + */ + function setTabBarStyle (style) { + for (const key in style) { + config[key] = style[key]; + } + view.draw(getDraws()); + } + /** + * 设置tab页底部或顶部距离 + * @param {*} value 距离 + */ + function setWebviewPosition (value) { + const position = config.position === 'top' ? 'top' : 'bottom'; + plus.webview.all().forEach(webview => { + if (isTabBarPage(String(webview.__uniapp_route))) { + webview.setStyle({ + [position]: value + }); + } + }); + } + /** + * 隐藏 tabBar + * @param {boolean} animation 是否需要动画效果 暂未支持 + */ + function hideTabBar (animation) { + if (visible === false) { + return + } + visible = false; + if (view) { + view.hide(); + setWebviewPosition(0); + } + } + /** + * 显示 tabBar + * @param {boolean} animation 是否需要动画效果 暂未支持 + */ + function showTabBar (animation) { + if (visible === true) { + return + } + visible = true; + if (view) { + view.show(); + setWebviewPosition(TABBAR_HEIGHT + safeArea.bottom); + } } - return { - __uniConfig: uniConfig, - __uniRoutes: uniRoutes, - __registerConfig (config) { - return registerConfig(config, instanceContext) + var tabBar = { + init (options, clickCallback) { + if (options && options.list.length) { + selected = options.selected || 0; + config = options; + config.position = 'bottom'; // 暂时强制使用bottom + itemClickCallback = clickCallback; + init(); + return view + } }, - __registerApp (appVm) { - return registerApp(appVm, instanceContext) + switchTab (page) { + if (itemLength) { + for (let i = 0; i < itemLength; i++) { + if (config.list[i].pagePath === (`${page}.html`)) { + const draws = getSelectedDraws(i); + if (draws.length) { + view.draw(draws); + } + return true + } + } + } + return false }, - __registerPage, - plus, + setTabBarBadge, + setTabBarItem, + setTabBarStyle, + hideTabBar, + showTabBar, + get visible () { + return visible + } + }; + + let appCtx; + + const NETWORK_TYPES = [ + 'unknown', + 'none', + 'ethernet', + 'wifi', + '2g', + '3g', + '4g' + ]; + + function getApp () { + return appCtx + } + + function initGlobalListeners () { + const emit = UniServiceJSBridge.emit; + + plus.key.addEventListener('backbutton', () => { + // TODO uni? + uni.navigateBack({ + from: 'backbutton' + }); + }); + + plus.globalEvent.addEventListener('pause', () => { + emit('onAppEnterBackground'); + }); + + plus.globalEvent.addEventListener('resume', () => { + emit('onAppEnterForeground'); + }); + + plus.globalEvent.addEventListener('netchange', () => { + const networkType = NETWORK_TYPES[plus.networkinfo.getCurrentType()]; + emit('onNetworkStatusChange', { + isConnected: networkType !== 'none', + networkType + }); + }); + } + + function initAppLaunch (appVm) { + const args = { + path: __uniConfig.entryPagePath, + query: {}, + scene: 1001 + }; + + callAppHook(appVm, 'onLaunch', args); + callAppHook(appVm, 'onShow', args); + } + + function initTabBar () { + if (!__uniConfig.tabBar || !__uniConfig.tabBar.list.length) { + return + } + + const currentTab = isTabBarPage(__uniConfig.entryPagePath); + if (currentTab) { + // 取当前 tab 索引值 + __uniConfig.tabBar.selected = __uniConfig.tabBar.list.indexOf(currentTab); + // 如果真实的首页与 condition 都是 tabbar,无需启用 realEntryPagePath 机制 + if (__uniConfig.realEntryPagePath && isTabBarPage(__uniConfig.realEntryPagePath)) { + delete __uniConfig.realEntryPagePath; + } + } + + __uniConfig.__ready__ = true; + + const onLaunchWebviewReady = function onLaunchWebviewReady () { + const tabBarView = tabBar.init(__uniConfig.tabBar, (item) => { + uni.switchTab({ + url: '/' + item.pagePath, + openType: 'switchTab', + from: 'tabbar' + }); + }); + tabBarView && plus.webview.getLaunchWebview().append(tabBarView); + }; + if (plus.webview.getLaunchWebview()) { + onLaunchWebviewReady(); + } else { + registerPlusMessage('UniWebviewReady-' + plus.runtime.appid, onLaunchWebviewReady, false); + } + } + + function registerApp (appVm) { + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] registerApp`); + } + + appCtx = appVm; + + initOn(UniServiceJSBridge.on, { + getApp, + getCurrentPages: getCurrentPages$1 + }); + + initAppLaunch(appVm); + + initGlobalListeners(); + + initTabBar(); + } + + function parseRoutes (config) { + __uniRoutes.length = 0; + /* eslint-disable no-mixed-operators */ + const tabBarList = (config.tabBar && config.tabBar.list || []).map(item => item.pagePath); + + Object.keys(config.page).forEach(function (pagePath) { + const isTabBar = tabBarList.indexOf(pagePath) !== -1; + const isQuit = isTabBar || (config.pages[0] === pagePath); + const isNVue = !!config.page[pagePath].nvue; + __uniRoutes.push({ + path: '/' + pagePath, + meta: { + isQuit, + isTabBar, + isNVue + }, + window: config.page[pagePath].window || {} + }); + }); + } + + function registerConfig (config) { + Object.assign(__uniConfig, config); + + __uniConfig.viewport = ''; + __uniConfig.defaultFontSize = ''; + + if (__uniConfig.nvueCompiler === 'uni-app') { + __uniConfig.viewport = plus.screen.resolutionWidth; + __uniConfig.defaultFontSize = __uniConfig.viewport / 20; + } + + parseRoutes(__uniConfig); + + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] registerConfig`, __uniConfig); + } + } + + const base = [ + 'base64ToArrayBuffer', + 'arrayBufferToBase64' + ]; + + const network = [ + 'request', + 'uploadFile', + 'downloadFile', + 'connectSocket', + 'onSocketOpen', + 'onSocketError', + 'sendSocketMessage', + 'onSocketMessage', + 'closeSocket', + 'onSocketClose' + ]; + + const route = [ + 'navigateTo', + 'redirectTo', + 'reLaunch', + 'switchTab', + 'navigateBack' + ]; + + const storage = [ + 'setStorage', + 'setStorageSync', + 'getStorage', + 'getStorageSync', + 'getStorageInfo', + 'getStorageInfoSync', + 'removeStorage', + 'removeStorageSync', + 'clearStorage', + 'clearStorageSync' + ]; + + const location = [ + 'getLocation', + 'chooseLocation', + 'openLocation', + 'createMapContext' + ]; + + const media = [ + 'chooseImage', + 'previewImage', + 'getImageInfo', + 'saveImageToPhotosAlbum', + 'compressImage', + 'chooseMessageFile', + 'getRecorderManager', + 'getBackgroundAudioManager', + 'createInnerAudioContext', + 'chooseVideo', + 'saveVideoToPhotosAlbum', + 'createVideoContext', + 'createCameraContext', + 'createLivePlayerContext' + ]; + + const device = [ + 'getSystemInfo', + 'getSystemInfoSync', + 'canIUse', + 'onMemoryWarning', + 'getNetworkType', + 'onNetworkStatusChange', + 'onAccelerometerChange', + 'startAccelerometer', + 'stopAccelerometer', + 'onCompassChange', + 'startCompass', + 'stopCompass', + 'onGyroscopeChange', + 'startGyroscope', + 'stopGyroscope', + 'makePhoneCall', + 'scanCode', + 'setClipboardData', + 'getClipboardData', + 'setScreenBrightness', + 'getScreenBrightness', + 'setKeepScreenOn', + 'onUserCaptureScreen', + 'vibrateLong', + 'vibrateShort', + 'addPhoneContact', + 'openBluetoothAdapter', + 'startBluetoothDevicesDiscovery', + 'onBluetoothDeviceFound', + 'stopBluetoothDevicesDiscovery', + 'onBluetoothAdapterStateChange', + 'getConnectedBluetoothDevices', + 'getBluetoothDevices', + 'getBluetoothAdapterState', + 'closeBluetoothAdapter', + 'writeBLECharacteristicValue', + 'readBLECharacteristicValue', + 'onBLEConnectionStateChange', + 'onBLECharacteristicValueChange', + 'notifyBLECharacteristicValueChange', + 'getBLEDeviceServices', + 'getBLEDeviceCharacteristics', + 'createBLEConnection', + 'closeBLEConnection', + 'onBeaconServiceChange', + 'onBeaconUpdate', + 'getBeacons', + 'startBeaconDiscovery', + 'stopBeaconDiscovery' + ]; + + const keyboard = [ + 'hideKeyboard' + ]; + + const ui = [ + 'showToast', + 'hideToast', + 'showLoading', + 'hideLoading', + 'showModal', + 'showActionSheet', + 'setNavigationBarTitle', + 'setNavigationBarColor', + 'showNavigationBarLoading', + 'hideNavigationBarLoading', + 'setTabBarItem', + 'setTabBarStyle', + 'hideTabBar', + 'showTabBar', + 'setTabBarBadge', + 'removeTabBarBadge', + 'showTabBarRedDot', + 'hideTabBarRedDot', + 'setBackgroundColor', + 'setBackgroundTextStyle', + 'createAnimation', + 'pageScrollTo', + 'onWindowResize', + 'offWindowResize', + 'loadFontFace', + 'startPullDownRefresh', + 'stopPullDownRefresh', + 'createSelectorQuery', + 'createIntersectionObserver' + ]; + + const event = [ + '$emit', + '$on', + '$once', + '$off' + ]; + + const file = [ + 'saveFile', + 'getSavedFileList', + 'getSavedFileInfo', + 'removeSavedFile', + 'getFileInfo', + 'openDocument', + 'getFileSystemManager' + ]; + + const canvas = [ + 'createOffscreenCanvas', + 'createCanvasContext', + 'canvasToTempFilePath', + 'canvasPutImageData', + 'canvasGetImageData' + ]; + + const third = [ + 'getProvider', + 'login', + 'checkSession', + 'getUserInfo', + 'share', + 'showShareMenu', + 'hideShareMenu', + 'requestPayment', + 'subscribePush', + 'unsubscribePush', + 'onPush', + 'offPush', + 'requireNativePlugin', + 'upx2px' + ]; + + const apis = [ + ...base, + ...network, + ...route, + ...storage, + ...location, + ...media, + ...device, + ...keyboard, + ...ui, + ...event, + ...file, + ...canvas, + ...third + ]; + + /** + * 框架内 try-catch + */ + function tryCatchFramework (fn) { + return function () { + try { + return fn.apply(fn, arguments) + } catch (e) { + // TODO + console.error(e); + } + } + } + /** + * 开发者 try-catch + */ + function tryCatch (fn) { + return function () { + try { + return fn.apply(fn, arguments) + } catch (e) { + // TODO + console.error(e); + } + } + } + + const HOOKS = [ + 'invoke', + 'success', + 'fail', + 'complete', + 'returnValue' + ]; + + const globalInterceptors = {}; + const scopedInterceptors = {}; + + function mergeHook (parentVal, childVal) { + const res = childVal + ? parentVal + ? parentVal.concat(childVal) + : Array.isArray(childVal) + ? childVal : [childVal] + : parentVal; + return res + ? dedupeHooks(res) + : res + } + + function dedupeHooks (hooks) { + const res = []; + for (let i = 0; i < hooks.length; i++) { + if (res.indexOf(hooks[i]) === -1) { + res.push(hooks[i]); + } + } + return res + } + + function removeHook (hooks, hook) { + const index = hooks.indexOf(hook); + if (index !== -1) { + hooks.splice(index, 1); + } + } + + function mergeInterceptorHook (interceptor, option) { + Object.keys(option).forEach(hook => { + if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) { + interceptor[hook] = mergeHook(interceptor[hook], option[hook]); + } + }); + } + + function removeInterceptorHook (interceptor, option) { + if (!interceptor || !option) { + return + } + Object.keys(option).forEach(hook => { + if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) { + removeHook(interceptor[hook], option[hook]); + } + }); + } + + function addInterceptor (method, option) { + if (typeof method === 'string' && isPlainObject(option)) { + mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option); + } else if (isPlainObject(method)) { + mergeInterceptorHook(globalInterceptors, method); + } + } + + function removeInterceptor (method, option) { + if (typeof method === 'string') { + if (isPlainObject(option)) { + removeInterceptorHook(scopedInterceptors[method], option); + } else { + delete scopedInterceptors[method]; + } + } else if (isPlainObject(method)) { + removeInterceptorHook(globalInterceptors, method); + } + } + + function wrapperHook (hook) { + return function (data) { + return hook(data) || data + } + } + + function isPromise (obj) { + return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function' + } + + function queue (hooks, data) { + let promise = false; + for (let i = 0; i < hooks.length; i++) { + const hook = hooks[i]; + if (promise) { + promise = Promise.then(wrapperHook(hook)); + } else { + const res = hook(data); + if (isPromise(res)) { + promise = Promise.resolve(res); + } + if (res === false) { + return { + then () {} + } + } + } + } + return promise || { + then (callback) { + return callback(data) + } + } + } + + function wrapperOptions (interceptor, options = {}) { + ['success', 'fail', 'complete'].forEach(name => { + if (Array.isArray(interceptor[name])) { + const oldCallback = options[name]; + options[name] = function callbackInterceptor (res) { + queue(interceptor[name], res).then((res) => { + /* eslint-disable no-mixed-operators */ + return isFn(oldCallback) && oldCallback(res) || res + }); + }; + } + }); + return options + } + + function wrapperReturnValue (method, returnValue) { + const returnValueHooks = []; + if (Array.isArray(globalInterceptors.returnValue)) { + returnValueHooks.push(...globalInterceptors.returnValue); + } + const interceptor = scopedInterceptors[method]; + if (interceptor && Array.isArray(interceptor.returnValue)) { + returnValueHooks.push(...interceptor.returnValue); + } + returnValueHooks.forEach(hook => { + returnValue = hook(returnValue) || returnValue; + }); + return returnValue + } + + function getApiInterceptorHooks (method) { + const interceptor = Object.create(null); + Object.keys(globalInterceptors).forEach(hook => { + if (hook !== 'returnValue') { + interceptor[hook] = globalInterceptors[hook].slice(); + } + }); + const scopedInterceptor = scopedInterceptors[method]; + if (scopedInterceptor) { + Object.keys(scopedInterceptor).forEach(hook => { + if (hook !== 'returnValue') { + interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]); + } + }); + } + return interceptor + } + + function invokeApi (method, api, options, ...params) { + const interceptor = getApiInterceptorHooks(method); + if (interceptor && Object.keys(interceptor).length) { + if (Array.isArray(interceptor.invoke)) { + const res = queue(interceptor.invoke, options); + return res.then((options) => { + return api(wrapperOptions(interceptor, options), ...params) + }) + } else { + return api(wrapperOptions(interceptor, options), ...params) + } + } + return api(options, ...params) + } + + const promiseInterceptor = { + returnValue (res) { + if (!isPromise(res)) { + return res + } + return res.then(res => { + return res[1] + }).catch(res => { + return res[0] + }) + } + }; + + const SYNC_API_RE = + /^\$|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + + const CONTEXT_API_RE = /^create|Manager$/; + + const TASK_APIS = ['request', 'downloadFile', 'uploadFile', 'connectSocket']; + + const CALLBACK_API_RE = /^on/; + + function isContextApi (name) { + return CONTEXT_API_RE.test(name) + } + function isSyncApi (name) { + return SYNC_API_RE.test(name) + } + + function isCallbackApi (name) { + return CALLBACK_API_RE.test(name) + } + + function isTaskApi (name) { + return TASK_APIS.indexOf(name) !== -1 + } + + function handlePromise (promise) { + return promise.then(data => { + return [null, data] + }) + .catch(err => [err]) + } + + function shouldPromise (name) { + if ( + isContextApi(name) || + isSyncApi(name) || + isCallbackApi(name) + ) { + return false + } + return true + } + + function promisify (name, api) { + if (!shouldPromise(name)) { + return api + } + return function promiseApi (options = {}, ...params) { + if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) { + return wrapperReturnValue(name, invokeApi(name, api, options, ...params)) + } + return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => { + invokeApi(name, api, Object.assign({}, options, { + success: resolve, + fail: reject + }), ...params); + /* eslint-disable no-extend-native */ + if (!Promise.prototype.finally) { + Promise.prototype.finally = function (callback) { + const promise = this.constructor; + return this.then( + value => promise.resolve(callback()).then(() => value), + reason => promise.resolve(callback()).then(() => { + throw reason + }) + ) + }; + } + }))) + } + } + + const canIUse = [{ + name: 'schema', + type: String, + required: true + }]; + + var require_context_module_0_0 = /*#__PURE__*/Object.freeze({ + canIUse: canIUse + }); + + const base64ToArrayBuffer = [{ + name: 'base64', + type: String, + required: true + }]; + + const arrayBufferToBase64 = [{ + name: 'arrayBuffer', + type: [ArrayBuffer, Uint8Array], + required: true + }]; + + var require_context_module_0_1 = /*#__PURE__*/Object.freeze({ + base64ToArrayBuffer: base64ToArrayBuffer, + arrayBufferToBase64: arrayBufferToBase64 + }); + + function getInt (method) { + return function (value, params) { + if (value) { + params[method] = Math.round(value); + } + } + } + + const canvasGetImageData = { + canvasId: { + type: String, + required: true + }, + x: { + type: Number, + required: true, + validator: getInt('x') + }, + y: { + type: Number, + required: true, + validator: getInt('y') + }, + width: { + type: Number, + required: true, + validator: getInt('width') + }, + height: { + type: Number, + required: true, + validator: getInt('height') + } + }; + + const canvasPutImageData = { + canvasId: { + type: String, + required: true + }, + data: { + type: Uint8ClampedArray, + required: true + }, + x: { + type: Number, + required: true, + validator: getInt('x') + }, + y: { + type: Number, + required: true, + validator: getInt('y') + }, + width: { + type: Number, + required: true, + validator: getInt('width') + }, + height: { + type: Number, + validator: getInt('height') + } + }; + + const fileType = { + PNG: 'png', + JPG: 'jpeg' + }; + + const canvasToTempFilePath = { + x: { + type: Number, + default: 0, + validator: getInt('x') + }, + y: { + type: Number, + default: 0, + validator: getInt('y') + }, + width: { + type: Number, + validator: getInt('width') + }, + height: { + type: Number, + validator: getInt('height') + }, + destWidth: { + type: Number, + validator: getInt('destWidth') + }, + destHeight: { + type: Number, + validator: getInt('destHeight') + }, + canvasId: { + type: String, + require: true + }, + fileType: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase(); + params.fileType = value in fileType ? fileType[value] : fileType.PNG; + } + }, + quality: { + type: Number, + validator (value, params) { + value = Math.floor(value); + params.quality = value > 0 && value < 1 ? value : 1; + } + } + }; + + const drawCanvas = { + canvasId: { + type: String, + require: true + }, + actions: { + type: Array, + require: true + }, + reserve: { + type: Boolean, + default: false + } + }; + + var require_context_module_0_2 = /*#__PURE__*/Object.freeze({ + canvasGetImageData: canvasGetImageData, + canvasPutImageData: canvasPutImageData, + canvasToTempFilePath: canvasToTempFilePath, + drawCanvas: drawCanvas + }); + + const validator = [{ + name: 'id', + type: String, + required: true + }]; + + const createAudioContext = validator; + const createVideoContext = validator; + const createMapContext = validator; + const createCanvasContext = [{ + name: 'canvasId', + type: String, + required: true + }, { + name: 'componentInstance', + type: Object + }]; + + var require_context_module_0_3 = /*#__PURE__*/Object.freeze({ + createAudioContext: createAudioContext, + createVideoContext: createVideoContext, + createMapContext: createMapContext, + createCanvasContext: createCanvasContext + }); + + const makePhoneCall = { + 'phoneNumber': { + type: String, + required: true, + validator (phoneNumber) { + if (!phoneNumber) { + return `makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;` + } + } + } + }; + + var require_context_module_0_4 = /*#__PURE__*/Object.freeze({ + makePhoneCall: makePhoneCall + }); + + const openDocument = { + filePath: { + type: String, + required: true + }, + fileType: { + type: String + } + }; + + var require_context_module_0_5 = /*#__PURE__*/Object.freeze({ + openDocument: openDocument + }); + + const type = { + WGS84: 'WGS84', + GCJ02: 'GCJ02' + }; + const getLocation = { + type: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase(); + params.type = Object.values(type).indexOf(value) < 0 ? type.WGS84 : value; + }, + default: type.WGS84 + }, + altitude: { + altitude: Boolean, + default: false + } + }; + const openLocation = { + latitude: { + type: Number, + required: true + }, + longitude: { + type: Number, + required: true + }, + scale: { + type: Number, + validator (value, params) { + value = Math.floor(value); + params.scale = value >= 5 && value <= 18 ? value : 18; + }, + default: 18 + }, + name: { + type: String + }, + address: { + type: String + } + }; + + var require_context_module_0_6 = /*#__PURE__*/Object.freeze({ + getLocation: getLocation, + openLocation: openLocation + }); + + const SIZE_TYPES = ['original', 'compressed']; + const SOURCE_TYPES = ['album', 'camera']; + + const chooseImage = { + 'count': { + type: Number, + required: false, + default: 9, + validator (count, params) { + if (count <= 0) { + params.count = 9; + } + } + }, + 'sizeType': { + type: Array, + required: false, + default: SIZE_TYPES, + validator (sizeType, params) { + // 非必传的参数,不符合预期时处理为默认值。 + const length = sizeType.length; + if (!length) { + params.sizeType = SIZE_TYPES; + } else { + for (let i = 0; i < length; i++) { + if (typeof sizeType[i] !== 'string' || !~SIZE_TYPES.indexOf(sizeType[i])) { + params.sizeType = SIZE_TYPES; + break + } + } + } + } + }, + 'sourceType': { + type: Array, + required: false, + default: SOURCE_TYPES, + validator (sourceType, params) { + const length = sourceType.length; + if (!length) { + params.sourceType = SOURCE_TYPES; + } else { + for (let i = 0; i < length; i++) { + if (typeof sourceType[i] !== 'string' || !~SOURCE_TYPES.indexOf(sourceType[i])) { + params.sourceType = SOURCE_TYPES; + break + } + } + } + } + } + }; + + var require_context_module_0_7 = /*#__PURE__*/Object.freeze({ + chooseImage: chooseImage + }); + + const SOURCE_TYPES$1 = ['album', 'camera']; + + const chooseVideo = { + 'sourceType': { + type: Array, + required: false, + default: SOURCE_TYPES$1, + validator (sourceType, params) { + const length = sourceType.length; + if (!length) { + params.sourceType = SOURCE_TYPES$1; + } else { + for (let i = 0; i < length; i++) { + if (typeof sourceType[i] !== 'string' || !~SOURCE_TYPES$1.indexOf(sourceType[i])) { + params.sourceType = SOURCE_TYPES$1; + break + } + } + } + } + } + }; + + var require_context_module_0_8 = /*#__PURE__*/Object.freeze({ + chooseVideo: chooseVideo + }); + + function getRealRoute$1 (fromRoute, toRoute) { + if (!toRoute) { + toRoute = fromRoute; + if (toRoute.indexOf('/') === 0) { + return toRoute + } + const pages = getCurrentPages(); + if (pages.length) { + fromRoute = pages[pages.length - 1].$page.route; + } else { + fromRoute = ''; + } + } else { + if (toRoute.indexOf('/') === 0) { + return toRoute + } + } + if (toRoute.indexOf('./') === 0) { + return getRealRoute$1(fromRoute, toRoute.substr(2)) + } + const toRouteArray = toRoute.split('/'); + const toRouteLength = toRouteArray.length; + let i = 0; + for (; i < toRouteLength && toRouteArray[i] === '..'; i++) { + // noop + } + toRouteArray.splice(0, i); + toRoute = toRouteArray.join('/'); + const fromRouteArray = fromRoute.length > 0 ? fromRoute.split('/') : []; + fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); + return '/' + fromRouteArray.concat(toRouteArray).join('/') + } + + const SCHEME_RE = /^([a-z-]+:)?\/\//i; + const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/; + + function addBase (filePath) { + return filePath + } + + function getRealPath$1 (filePath) { + if (filePath.indexOf('/') === 0) { + if (filePath.indexOf('//') === 0) { + filePath = 'https:' + filePath; + } else { + return addBase(filePath.substr(1)) + } + } + // 网络资源或base64 + if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath) || filePath.indexOf('blob:') === 0) { + return filePath + } + + const pages = getCurrentPages(); + if (pages.length) { + return addBase(getRealRoute$1(pages[pages.length - 1].$page.route, filePath).substr(1)) + } + + return filePath + } + + const getImageInfo = { + 'src': { + type: String, + required: true, + validator (src, params) { + params.src = getRealPath$1(src); + } + } + }; + + var require_context_module_0_9 = /*#__PURE__*/Object.freeze({ + getImageInfo: getImageInfo + }); + + const previewImage = { + urls: { + type: Array, + required: true, + validator (value, params) { + var typeError; + params.urls = value.map(url => { + if (typeof url === 'string') { + return getRealPath$1(url) + } else { + typeError = true; + } + }); + if (typeError) { + return 'url is not string' + } + } + }, + current: { + type: [String, Number], + validator (value, params) { + if (typeof value === 'number') { + params.current = value > 0 && value < params.urls.length ? value : 0; + } else if (typeof value === 'string' && value) { + params.current = getRealPath$1(value); + } + }, + default: 0 + } + }; + + var require_context_module_0_10 = /*#__PURE__*/Object.freeze({ + previewImage: previewImage + }); + + const FRONT_COLORS = ['#ffffff', '#000000']; + const setNavigationBarColor = { + 'frontColor': { + type: String, + required: true, + validator (frontColor, params) { + if (FRONT_COLORS.indexOf(frontColor) === -1) { + return `invalid frontColor "${frontColor}"` + } + } + }, + 'backgroundColor': { + type: String, + required: true + }, + 'animation': { + type: Object, + default () { + return { + duration: 0, + timingFunc: 'linear' + } + }, + validator (animation = {}, params) { + params.animation = { + duration: animation.duration || 0, + timingFunc: animation.timingFunc || 'linear' + }; + } + } + }; + const setNavigationBarTitle = { + 'title': { + type: String, + required: true + } + }; + + var require_context_module_0_11 = /*#__PURE__*/Object.freeze({ + setNavigationBarColor: setNavigationBarColor, + setNavigationBarTitle: setNavigationBarTitle + }); + + const downloadFile = { + url: { + type: String, + required: true + }, + header: { + type: Object, + validator (value, params) { + params.header = value || {}; + } + } + }; + + var require_context_module_0_12 = /*#__PURE__*/Object.freeze({ + downloadFile: downloadFile + }); + + const method = { + OPTIONS: 'OPTIONS', + GET: 'GET', + HEAD: 'HEAD', + POST: 'POST', + PUT: 'PUT', + DELETE: 'DELETE', + TRACE: 'TRACE', + CONNECT: 'CONNECT' + }; + const dataType = { + JSON: 'JSON' + }; + const responseType = { + TEXT: 'TEXT', + ARRAYBUFFER: 'ARRAYBUFFER' + }; + + const encode = encodeURIComponent; + + function stringifyQuery (url, data) { + let str = url.split('#'); + const hash = str[1] || ''; + str = str[0].split('?'); + let query = str[1] || ''; + url = str[0]; + const search = query.split('&').filter(item => item); + query = {}; + search.forEach(item => { + item = item.split('='); + query[item[0]] = item[1]; + }); + for (let key in data) { + if (data.hasOwnProperty(key)) { + if (isPlainObject(data[key])) { + query[encode(key)] = encode(JSON.stringify(data[key])); + } else { + query[encode(key)] = encode(data[key]); + } + } + } + query = Object.keys(query).map(item => `${item}=${query[item]}`).join('&'); + return url + (query ? '?' + query : '') + (hash ? '#' + hash : '') + } + + const request = { + method: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase(); + params.method = Object.values(method).indexOf(value) < 0 ? method.GET : value; + } + }, + data: { + type: [Object, String, ArrayBuffer], + validator (value, params) { + params.data = value || ''; + } + }, + url: { + type: String, + required: true, + validator (value, params) { + if ( + params.method === method.GET && + isPlainObject(params.data) && + Object.keys(params.data).length + ) { // 将 method,data 校验提前,保证 url 校验时,method,data 已被格式化 + params.url = stringifyQuery(value, params.data); + } + } + }, + header: { + type: Object, + validator (value, params) { + params.header = value || {}; + } + }, + dataType: { + type: String, + validator (value, params) { + params.dataType = (value || dataType.JSON).toUpperCase(); + } + }, + responseType: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase(); + params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value; + } + } + }; + + var require_context_module_0_13 = /*#__PURE__*/Object.freeze({ + request: request + }); + + const method$1 = { + OPTIONS: 'OPTIONS', + GET: 'GET', + HEAD: 'HEAD', + POST: 'POST', + PUT: 'PUT', + DELETE: 'DELETE', + TRACE: 'TRACE', + CONNECT: 'CONNECT' + }; + const connectSocket = { + url: { + type: String, + required: true + }, + header: { + type: Object, + validator (value, params) { + params.header = value || {}; + } + }, + method: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase(); + params.method = Object.values(method$1).indexOf(value) < 0 ? method$1.GET : value; + } + }, + protocols: { + type: Array, + validator (value, params) { + params.protocols = (value || []).filter(str => typeof str === 'string'); + } + } + }; + const sendSocketMessage = { + data: { + type: [String, ArrayBuffer] + } + }; + const closeSocket = { + code: { + type: Number + }, + reason: { + type: String + } + }; + + var require_context_module_0_14 = /*#__PURE__*/Object.freeze({ + connectSocket: connectSocket, + sendSocketMessage: sendSocketMessage, + closeSocket: closeSocket + }); + + const uploadFile = { + url: { + type: String, + required: true + }, + filePath: { + type: String, + required: true, + validator (value, params) { + params.type = getRealPath$1(value); + } + }, + name: { + type: String, + required: true + }, + header: { + type: Object, + validator (value, params) { + params.header = value || {}; + } + }, + formData: { + type: Object, + validator (value, params) { + params.formData = value || {}; + } + } + }; + + var require_context_module_0_15 = /*#__PURE__*/Object.freeze({ + uploadFile: uploadFile + }); + + const pageScrollTo = { + scrollTop: { + type: Number, + required: true + }, + duration: { + type: Number, + default: 300, + validator (duration, params) { + params.duration = Math.max(0, duration); + } + } + }; + + var require_context_module_0_16 = /*#__PURE__*/Object.freeze({ + pageScrollTo: pageScrollTo + }); + + const service = { + OAUTH: 'OAUTH', + SHARE: 'SHARE', + PAYMENT: 'PAYMENT', + PUSH: 'PUSH' + }; + + const getProvider = { + service: { + type: String, + required: true, + validator (value, params) { + value = (value || '').toUpperCase(); + if (value && Object.values(service).indexOf(value) < 0) { + return 'service error' + } + } + } + }; + + var require_context_module_0_17 = /*#__PURE__*/Object.freeze({ + getProvider: getProvider + }); + + const showModal = { + title: { + type: String, + default: '' + }, + content: { + type: String, + default: '' + }, + showCancel: { + type: Boolean, + default: true + }, + cancelText: { + type: String, + default: '取消' + }, + cancelColor: { + type: String, + default: '#000000' + }, + confirmText: { + type: String, + default: '确定' + }, + confirmColor: { + type: String, + default: '#007aff' + }, + visible: { + type: Boolean, + default: true + } + }; + + const showToast = { + title: { + type: String, + default: '' + }, + icon: { + default: 'success', + validator (icon, params) { + if (['success', 'loading', 'none'].indexOf(icon) === -1) { + params.icon = 'success'; + } + } + }, + image: { + type: String, + default: '', + validator (image, params) { + if (image) { + params.image = getRealPath$1(image); + } + } + }, + duration: { + type: Number, + default: 1500 + }, + mask: { + type: Boolean, + default: false + }, + visible: { + type: Boolean, + default: true + } + }; + const showLoading = { + title: { + type: String, + default: '' + }, + icon: { + type: String, + default: 'loading' + }, + duration: { + type: Number, + default: 100000000 // 简单处理 showLoading,直接设置个大值 + }, + mask: { + type: Boolean, + default: false + }, + visible: { + type: Boolean, + default: true + } + }; + + const showActionSheet = { + itemList: { + type: Array, + required: true, + validator (itemList, params) { + if (!itemList.length) { + return 'parameter.itemList should have at least 1 item' + } + } + }, + itemColor: { + type: String, + default: '#000000' + }, + visible: { + type: Boolean, + default: true + } + }; + + var require_context_module_0_18 = /*#__PURE__*/Object.freeze({ + showModal: showModal, + showToast: showToast, + showLoading: showLoading, + showActionSheet: showActionSheet + }); + + function encodeQueryString (url) { + if (typeof url !== 'string') { + return url + } + const index = url.indexOf('?'); + + if (index === -1) { + return url + } + + const query = url.substr(index + 1).trim().replace(/^(\?|#|&)/, ''); + + if (!query) { + return url + } + + url = url.substr(0, index); + + const params = []; + + query.split('&').forEach(param => { + const parts = param.replace(/\+/g, ' ').split('='); + const key = parts.shift(); + const val = parts.length > 0 + ? parts.join('=') + : ''; + + params.push(key + '=' + encodeURIComponent(val)); + }); + + return params.length ? url + '?' + params.join('&') : url + } + + function createValidator (type) { + return function validator (url, params) { + // 格式化为绝对路径路由 + url = getRealRoute$1(url); + + const pagePath = url.split('?')[0]; + // 匹配路由是否存在 + const routeOptions = __uniRoutes.find(({ + path, + alias + }) => path === pagePath || alias === pagePath); + + if (!routeOptions) { + return 'page `' + url + '` is not found' + } + + // 检测不同类型跳转 + if (type === 'navigateTo' || type === 'redirectTo') { + if (routeOptions.meta.isTabBar) { + return `can not ${type} a tabbar page` + } + } else if (type === 'switchTab') { + if (!routeOptions.meta.isTabBar) { + return 'can not switch to no-tabBar page' + } + } + + // tabBar不允许传递参数 + if (routeOptions.meta.isTabBar) { + url = pagePath; + } + + // 首页自动格式化为`/` + if (routeOptions.meta.isEntry) { + url = url.replace(routeOptions.alias, '/'); + } + + // 参数格式化 + params.url = encodeQueryString(url); + } + } + + function createProtocol (type, extras = {}) { + return Object.assign({ + url: { + type: String, + required: true, + validator: createValidator(type) + } + }, extras) + } + + function createAnimationProtocol (animationTypes) { + return { + animationType: { + type: String, + validator (type) { + if (type && animationTypes.indexOf(type) === -1) { + return '`' + type + '` is not supported for `animationType` (supported values are: `' + animationTypes.join( + '`|`') + '`)' + } + } + }, + animationDuration: { + type: Number + } + } + } + + const redirectTo = createProtocol('redirectTo'); + + const reLaunch = createProtocol('reLaunch'); + + const navigateTo = createProtocol('navigateTo', createAnimationProtocol( + [ + 'slide-in-right', + 'slide-in-left', + 'slide-in-top', + 'slide-in-bottom', + 'fade-in', + 'zoom-out', + 'zoom-fade-out', + 'pop-in', + 'none' + ] + )); + + const switchTab = createProtocol('switchTab'); + + const navigateBack = Object.assign({ + delta: { + type: Number, + validator (delta, params) { + delta = parseInt(delta) || 1; + params.delta = Math.min(getCurrentPages().length - 1, delta); + } + } + }, createAnimationProtocol( + [ + 'slide-out-right', + 'slide-out-left', + 'slide-out-top', + 'slide-out-bottom', + 'fade-out', + 'zoom-in', + 'zoom-fade-in', + 'pop-out', + 'none' + ] + )); + + var require_context_module_0_19 = /*#__PURE__*/Object.freeze({ + redirectTo: redirectTo, + reLaunch: reLaunch, + navigateTo: navigateTo, + switchTab: switchTab, + navigateBack: navigateBack + }); + + const setStorage = { + 'key': { + type: String, + required: true + }, + 'data': { + required: true + } + }; + + const setStorageSync = [{ + name: 'key', + type: String, + required: true + }, { + name: 'data', + required: true + }]; + + var require_context_module_0_20 = /*#__PURE__*/Object.freeze({ + setStorage: setStorage, + setStorageSync: setStorageSync + }); + + const indexValidator = { + type: Number, + required: true + }; + + const setTabBarItem$1 = { + index: indexValidator, + text: { + type: String + }, + iconPath: { + type: String + }, + selectedIconPath: { + type: String + } + }; + + const setTabBarStyle$1 = { + color: { + type: String + }, + selectedColor: { + type: String + }, + backgroundColor: { + type: String + }, + borderStyle: { + type: String, + validator (borderStyle, params) { + if (borderStyle) { + params.borderStyle = borderStyle === 'black' ? 'black' : 'white'; + } + } + } + }; + + const hideTabBar$1 = { + animation: { + type: Boolean, + default: false + } + }; + + const showTabBar$1 = { + animation: { + type: Boolean, + default: false + } + }; + + const hideTabBarRedDot = { + index: indexValidator + }; + + const showTabBarRedDot = { + index: indexValidator + }; + + const removeTabBarBadge = { + index: indexValidator + }; + + const setTabBarBadge$1 = { + index: indexValidator, + text: { + type: String, + required: true, + validator (text, params) { + if (getLen(text) >= 4) { + params.text = '...'; + } + } + } + }; + + var require_context_module_0_21 = /*#__PURE__*/Object.freeze({ + setTabBarItem: setTabBarItem$1, + setTabBarStyle: setTabBarStyle$1, + hideTabBar: hideTabBar$1, + showTabBar: showTabBar$1, + hideTabBarRedDot: hideTabBarRedDot, + showTabBarRedDot: showTabBarRedDot, + removeTabBarBadge: removeTabBarBadge, + setTabBarBadge: setTabBarBadge$1 + }); + + const protocol = Object.create(null); + const modules = + (function() { + var map = { + './base.js': require_context_module_0_0, + './base64.js': require_context_module_0_1, + './canvas.js': require_context_module_0_2, + './context.js': require_context_module_0_3, + './device/make-phone-call.js': require_context_module_0_4, + './file/open-document.js': require_context_module_0_5, + './location.js': require_context_module_0_6, + './media/choose-image.js': require_context_module_0_7, + './media/choose-video.js': require_context_module_0_8, + './media/get-image-info.js': require_context_module_0_9, + './media/preview-image.js': require_context_module_0_10, + './navigation-bar.js': require_context_module_0_11, + './network/download-file.js': require_context_module_0_12, + './network/request.js': require_context_module_0_13, + './network/socket.js': require_context_module_0_14, + './network/upload-file.js': require_context_module_0_15, + './page-scroll-to.js': require_context_module_0_16, + './plugins.js': require_context_module_0_17, + './popup.js': require_context_module_0_18, + './route.js': require_context_module_0_19, + './storage.js': require_context_module_0_20, + './tab-bar.js': require_context_module_0_21, + + }; + var req = function req(key) { + return map[key] || (function() { throw new Error("Cannot find module '" + key + "'.") }()); + }; + req.keys = function() { + return Object.keys(map); + }; + return req; + })(); + + modules.keys().forEach(function (key) { + Object.assign(protocol, modules(key)); + }); + + function validateParam (key, paramTypes, paramsData) { + const paramOptions = paramTypes[key]; + const absent = !hasOwn(paramsData, key); + let value = paramsData[key]; + + const booleanIndex = getTypeIndex(Boolean, paramOptions.type); + if (booleanIndex > -1) { + if (absent && !hasOwn(paramOptions, 'default')) { + value = false; + } + } + if (value === undefined) { + if (hasOwn(paramOptions, 'default')) { + const paramDefault = paramOptions['default']; + value = isFn(paramDefault) ? paramDefault() : paramDefault; + paramsData[key] = value; // 默认值 + } + } + + return assertParam(paramOptions, key, value, absent, paramsData) + } + + function assertParam ( + paramOptions, + name, + value, + absent, + paramsData + ) { + if (paramOptions.required && absent) { + return `Missing required parameter \`${name}\`` + } + + if (value == null && !paramOptions.required) { + const validator = paramOptions.validator; + if (validator) { + return validator(value, paramsData) + } + return + } + let type = paramOptions.type; + let valid = !type || type === true; + const expectedTypes = []; + if (type) { + if (!Array.isArray(type)) { + type = [type]; + } + for (let i = 0; i < type.length && !valid; i++) { + const assertedType = assertType(value, type[i]); + expectedTypes.push(assertedType.expectedType || ''); + valid = assertedType.valid; + } + } + + if (!valid) { + return getInvalidTypeMessage(name, value, expectedTypes) + } + + const validator = paramOptions.validator; + if (validator) { + return validator(value, paramsData) + } + } + + const simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; + + function assertType (value, type) { + let valid; + const expectedType = getType(type); + if (simpleCheckRE.test(expectedType)) { + const t = typeof value; + valid = t === expectedType.toLowerCase(); + if (!valid && t === 'object') { + valid = value instanceof type; + } + } else if (expectedType === 'Object') { + valid = isPlainObject(value); + } else if (expectedType === 'Array') { + valid = Array.isArray(value); + } else { + valid = value instanceof type; + } + return { + valid, + expectedType + } + } + + function getType (fn) { + const match = fn && fn.toString().match(/^\s*function (\w+)/); + return match ? match[1] : '' + } + + function isSameType (a, b) { + return getType(a) === getType(b) + } + + function getTypeIndex (type, expectedTypes) { + if (!Array.isArray(expectedTypes)) { + return isSameType(expectedTypes, type) ? 0 : -1 + } + for (let i = 0, len = expectedTypes.length; i < len; i++) { + if (isSameType(expectedTypes[i], type)) { + return i + } + } + return -1 + } + + function getInvalidTypeMessage (name, value, expectedTypes) { + let message = `parameter \`${name}\`.` + + ` Expected ${expectedTypes.join(', ')}`; + const expectedType = expectedTypes[0]; + const receivedType = toRawType(value); + const expectedValue = styleValue(value, expectedType); + const receivedValue = styleValue(value, receivedType); + if (expectedTypes.length === 1 && + isExplicable(expectedType) && + !isBoolean(expectedType, receivedType)) { + message += ` with value ${expectedValue}`; + } + message += `, got ${receivedType} `; + if (isExplicable(receivedType)) { + message += `with value ${receivedValue}.`; + } + return message + } + + function styleValue (value, type) { + if (type === 'String') { + return `"${value}"` + } else if (type === 'Number') { + return `${Number(value)}` + } else { + return `${value}` + } + } + + const explicitTypes = ['string', 'number', 'boolean']; + + function isExplicable (value) { + return explicitTypes.some(elem => value.toLowerCase() === elem) + } + + function isBoolean (...args) { + return args.some(elem => elem.toLowerCase() === 'boolean') + } + + function invokeCallbackHandlerFail (err, apiName, callbackId) { + const errMsg = `${apiName}:fail ${err}`; + console.error(errMsg); + if (callbackId === -1) { + throw new Error(errMsg) + } + if (typeof callbackId === 'number') { + invokeCallbackHandler(callbackId, { + errMsg + }); + } + return false + } + + const callbackApiParamTypes = [{ + name: 'callback', + type: Function, + required: true + }]; + + function validateParams (apiName, paramsData, callbackId) { + let paramTypes = protocol[apiName]; + if (!paramTypes && isCallbackApi(apiName)) { + paramTypes = callbackApiParamTypes; + } + if (paramTypes) { + if (Array.isArray(paramTypes) && Array.isArray(paramsData)) { + const paramTypeObj = Object.create(null); + const paramsDataObj = Object.create(null); + const paramsDataLength = paramsData.length; + paramTypes.forEach((paramType, index) => { + paramTypeObj[paramType.name] = paramType; + if (paramsDataLength > index) { + paramsDataObj[paramType.name] = paramsData[index]; + } + }); + paramTypes = paramTypeObj; + paramsData = paramsDataObj; + } + + if (isFn(paramTypes.beforeValidate)) { + const err = paramTypes.beforeValidate(paramsData); + if (err) { + return invokeCallbackHandlerFail(err, apiName, callbackId) + } + } + + const keys = Object.keys(paramTypes); + for (let i = 0; i < keys.length; i++) { + if (keys[i] === 'beforeValidate') { + continue + } + const err = validateParam(keys[i], paramTypes, paramsData); + if (err) { + return invokeCallbackHandlerFail(err, apiName, callbackId) + } + } + } + return true + } + + let invokeCallbackId = 1; + + const invokeCallbacks = {}; + + function createKeepAliveApiCallback (apiName, callback) { + const callbackId = invokeCallbackId++; + const invokeCallbackName = 'api.' + apiName + '.' + callbackId; + + const invokeCallback = function (res) { + callback(res); + }; + + invokeCallbacks[callbackId] = { + name: invokeCallbackName, + keepAlive: true, + callback: invokeCallback + }; + return callbackId + } + + function createApiCallback (apiName, params = {}, extras = {}) { + if (!isPlainObject(params)) { + return { + params + } + } + params = Object.assign({}, params); + + const apiCallbacks = {}; + for (let name in params) { + const param = params[name]; + if (isFn(param)) { + apiCallbacks[name] = tryCatch(param); + delete params[name]; + } + } + + const { + success, + fail, + cancel, + complete + } = apiCallbacks; + + const hasSuccess = isFn(success); + const hasFail = isFn(fail); + const hasCancel = isFn(cancel); + const hasComplete = isFn(complete); + + if (!hasSuccess && !hasFail && !hasCancel && !hasComplete) { // 无回调 + return { + params + } + } + + const wrapperCallbacks = {}; + for (let name in extras) { + const extra = extras[name]; + if (isFn(extra)) { + wrapperCallbacks[name] = tryCatchFramework(extra); + delete extras[name]; + } + } + + const { + beforeSuccess, + afterSuccess, + beforeFail, + afterFail, + beforeCancel, + afterCancel, + afterAll + } = wrapperCallbacks; + + const callbackId = invokeCallbackId++; + const invokeCallbackName = 'api.' + apiName + '.' + callbackId; + + const invokeCallback = function (res) { + res.errMsg = res.errMsg || apiName + ':ok'; + + const errMsg = res.errMsg; + + if (errMsg.indexOf(apiName + ':ok') === 0) { + isFn(beforeSuccess) && beforeSuccess(res); + + hasSuccess && success(res); + + isFn(afterSuccess) && afterSuccess(res); + } else if (errMsg.indexOf(apiName + ':cancel') === 0) { + res.errMsg = res.errMsg.replace(apiName + ':cancel', apiName + ':fail cancel'); + + hasFail && fail(res); + + isFn(beforeCancel) && beforeCancel(res); + + hasCancel && cancel(res); + + isFn(afterCancel) && afterCancel(res); + } else if (errMsg.indexOf(apiName + ':fail') === 0) { + isFn(beforeFail) && beforeFail(res); + + hasFail && fail(res); + + isFn(afterFail) && afterFail(res); + } + + hasComplete && complete(res); + + isFn(afterAll) && afterAll(res); + }; + + invokeCallbacks[callbackId] = { + name: invokeCallbackName, + callback: invokeCallback + }; + + return { + params, + callbackId + } + } + + function createInvokeCallback (apiName, params = {}, extras = {}) { + const { + params: args, + callbackId + } = createApiCallback(apiName, params, extras); + + if (isPlainObject(args) && !validateParams(apiName, args, callbackId)) { + return { + params: args, + callbackId: false + } + } + + return { + params: args, + callbackId + } + } + + function invokeCallbackHandler (invokeCallbackId, res) { + if (typeof invokeCallbackId === 'number') { + const invokeCallback = invokeCallbacks[invokeCallbackId]; + if (invokeCallback) { + if (!invokeCallback.keepAlive) { + delete invokeCallbacks[invokeCallbackId]; + } + return invokeCallback.callback(res) + } + } + return res + } + + function wrapperUnimplemented (name) { + return function todo (args) { + console.error('API `' + name + '` is not yet implemented'); + } + } + + function wrapper (name, invokeMethod, extras) { + if (!isFn(invokeMethod)) { + return invokeMethod + } + return function (...args) { + if (isSyncApi(name)) { + if (validateParams(name, args, -1)) { + return invokeMethod.apply(null, args) + } + } else if (isCallbackApi(name)) { + if (validateParams(name, args, -1)) { + return invokeMethod(createKeepAliveApiCallback(name, args[0])) + } + } else { + let argsObj = {}; + if (args.length) { + argsObj = args[0]; + } + const { + params, + callbackId + } = createInvokeCallback(name, argsObj, extras); + if (callbackId !== false) { + let res; + if (isFn(params)) { + res = invokeMethod(callbackId); + } else { + res = invokeMethod(params, callbackId); + } + if (res && !isTaskApi(name)) { + res = invokeCallbackHandler(callbackId, res); + if (isPlainObject(res)) { + res.errMsg = res.errMsg || name + ':ok'; + } + } + return res + } + } + } + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var base64Arraybuffer = createCommonjsModule(function (module, exports) { + /* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ + (function(){ + + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + // Use a lookup table to find the index. + var lookup = new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = lookup[base64.charCodeAt(i)]; + encoded2 = lookup[base64.charCodeAt(i+1)]; + encoded3 = lookup[base64.charCodeAt(i+2)]; + encoded4 = lookup[base64.charCodeAt(i+3)]; + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; + })(); + }); + var base64Arraybuffer_1 = base64Arraybuffer.encode; + var base64Arraybuffer_2 = base64Arraybuffer.decode; + + const base64ToArrayBuffer$1 = base64Arraybuffer_2; + const arrayBufferToBase64$1 = base64Arraybuffer_1; + + var require_context_module_1_0 = /*#__PURE__*/Object.freeze({ + base64ToArrayBuffer: base64ToArrayBuffer$1, + arrayBufferToBase64: arrayBufferToBase64$1 + }); + + var platformSchema = {}; + + // TODO 待处理其他 API 的检测 + + function canIUse$1 (schema) { + if (hasOwn(platformSchema, schema)) { + return platformSchema[schema] + } + return true + } + + var require_context_module_1_1 = /*#__PURE__*/Object.freeze({ + canIUse: canIUse$1 + }); + + const interceptors = { + promiseInterceptor + }; + + var require_context_module_1_2 = /*#__PURE__*/Object.freeze({ + interceptors: interceptors, + addInterceptor: addInterceptor, + removeInterceptor: removeInterceptor + }); + + const EPS = 1e-4; + const BASE_DEVICE_WIDTH = 750; + let isIOS = false; + let deviceWidth = 0; + let deviceDPR = 0; + + function checkDeviceWidth () { + const { + platform, + pixelRatio, + windowWidth + } = uni.getSystemInfoSync(); + + deviceWidth = windowWidth; + deviceDPR = pixelRatio; + isIOS = platform === 'ios'; + } + + function upx2px (number, newDeviceWidth) { + if (deviceWidth === 0) { + checkDeviceWidth(); + } + + number = Number(number); + if (number === 0) { + return 0 + } + let result = (number / BASE_DEVICE_WIDTH) * (newDeviceWidth || deviceWidth); + if (result < 0) { + result = -result; + } + result = Math.floor(result + EPS); + if (result === 0) { + if (deviceDPR === 1 || !isIOS) { + return 1 + } else { + return 0.5 + } + } + return number < 0 ? -result : result + } + + var require_context_module_1_3 = /*#__PURE__*/Object.freeze({ + upx2px: upx2px + }); + + let audios = {}; + + const evts = ['play', 'canplay', 'ended', 'stop', 'waiting', 'seeking', 'seeked', 'pause']; + + const publishAudioStateChange = (state, res = {}) => publish('onAudioStateChange', Object.assign({ + state + }, res)); + + const initStateChage = audioId => { + const audio = audios[audioId]; + if (!audio) { + return + } + if (!audio.initStateChage) { + audio.initStateChage = true; + + audio.addEventListener('error', error => { + publishAudioStateChange('error', { + audioId, + errMsg: 'MediaError', + errCode: error.code + }); + }); + + evts.forEach(event => { + audio.addEventListener(event, () => { + // 添加 isStopped 属性是为了解决 安卓设备停止播放后获取播放进度不正确的问题 + if (event === 'play') { + audio.isStopped = false; + } else if (event === 'stop') { + audio.isStopped = true; + } + publishAudioStateChange(event, { + audioId + }); + }); + }); + } + }; + + function createAudioInstance () { + const audioId = `${Date.now()}${Math.random()}`; + const audio = audios[audioId] = plus.audio.createPlayer(''); + audio.src = ''; + audio.volume = 1; + audio.startTime = 0; + return { + errMsg: 'createAudioInstance:ok', + audioId + } + } + + function destroyAudioInstance ({ + audioId + }) { + if (audios[audioId]) { + audios[audioId].close(); + delete audios[audioId]; + } + return { + errMsg: 'destroyAudioInstance:ok', + audioId + } + } + + function setAudioState ({ + audioId, + src, + startTime, + autoplay = false, + loop = false, + obeyMuteSwitch, + volume + }) { + const audio = audios[audioId]; + if (audio) { + let style = { + loop, + autoplay + }; + if (src) { + audio.src = style.src = getRealPath(src); + } + if (startTime) { + audio.startTime = style.startTime = startTime; + } + if (typeof volume === 'number') { + audio.volume = style.volume = volume; + } + audio.setStyles(style); + initStateChage(audioId); + } + return { + errMsg: 'setAudioState:ok' + } + } + + function getAudioState ({ + audioId + }) { + const audio = audios[audioId]; + if (!audio) { + return { + errMsg: 'getAudioState:fail' + } + } + let { + src, + startTime, + volume + } = audio; + + return { + errMsg: 'getAudioState:ok', + duration: 1e3 * (audio.getDuration() || 0), + currentTime: audio.isStopped ? 0 : 1e3 * audio.getPosition(), + paused: audio.isPaused, + src, + volume, + startTime: 1e3 * startTime, + buffered: 1e3 * audio.getBuffered() + } + } + + function operateAudio ({ + operationType, + audioId, + currentTime + }) { + const audio = audios[audioId]; + const operationTypes = ['play', 'pause', 'stop']; + if (operationTypes.indexOf(operationType) >= 0) { + audio[operationType === operationTypes[0] && audio.isPaused ? 'resume' : operationType](); + } else if (operationType === 'seek') { + audio.seekTo(currentTime / 1e3); + } + return { + errMsg: 'operateAudio:ok' + } + } + + let audio; + + const publishBackgroundAudioStateChange = (state, res = {}) => publish('onBackgroundAudioStateChange', Object.assign({ + state + }, res)); + + const events = ['play', 'pause', 'ended', 'stop']; + + function initMusic () { + if (audio) { + return + } + audio = plus.audio.createPlayer({ + autoplay: true, + backgroundControl: true + }); + audio.src = audio.title = audio.epname = audio.singer = audio.coverImgUrl = audio.webUrl = ''; + audio.startTime = 0; + events.forEach(event => { + audio.addEventListener(event, () => { + // 添加 isStopped 属性是为了解决 安卓设备停止播放后获取播放进度不正确的问题 + if (event === 'play') { + audio.isStopped = false; + } else if (event === 'stop') { + audio.isStopped = true; + } + const eventName = `onMusic${event[0].toUpperCase() + event.substr(1)}`; + publish(eventName, { + dataUrl: audio.src, + errMsg: `${eventName}:ok` + }); + publishBackgroundAudioStateChange(event, { + dataUrl: audio.src + }); + }); + }); + audio.addEventListener('waiting', () => { + publishBackgroundAudioStateChange('waiting', { + dataUrl: audio.src + }); + }); + audio.addEventListener('error', err => { + publish('onMusicError', { + dataUrl: audio.src, + errMsg: 'Error:' + err.message + }); + publishBackgroundAudioStateChange('error', { + dataUrl: audio.src, + errMsg: err.message, + errCode: err.code + }); + }); + audio.addEventListener('prev', () => publish('onBackgroundAudioPrev')); + audio.addEventListener('next', () => publish('onBackgroundAudioNext')); + } + + function setMusicState (args) { + initMusic(); + const props = ['src', 'startTime', 'coverImgUrl', 'webUrl', 'singer', 'epname', 'title']; + const style = {}; + Object.keys(args).forEach(key => { + if (props.indexOf(key) >= 0) { + let val = args[key]; + if (key === props[0] && val) { + val = getRealPath(val); + } + audio[key] = style[key] = val; + } + }); + audio.setStyles(style); + } + + function getAudio () { + return audio + } + + function getMusicPlayerState () { + const audio = getAudio(); + if (audio) { + return { + dataUrl: audio.src, + duration: audio.getDuration() || 0, + currentPosition: audio.getPosition(), + status: audio.isPaused ? 0 : 1, + downloadPercent: Math.round(100 * audio.getBuffered() / audio.getDuration()), + errMsg: `getMusicPlayerState:ok` + } + } + return { + status: 2, + errMsg: `getMusicPlayerState:ok` + } + } + function operateMusicPlayer ({ + operationType, + dataUrl, + position, + api = 'operateMusicPlayer', + title, + coverImgUrl + }) { + const audio = getAudio(); + var operationTypes = ['resume', 'pause', 'stop']; + if (operationTypes.indexOf(operationType) > 0) { + audio && audio[operationType](); + } else if (operationType === 'play') { + setMusicState({ + src: dataUrl, + startTime: position, + title, + coverImgUrl + }); + audio.play(); + } else if (operationType === 'seek') { + audio && audio.seekTo(position); + } + return { + errMsg: `${api}:ok` + } + } + function setBackgroundAudioState (args) { + setMusicState(args); + return { + errMsg: `setBackgroundAudioState:ok` + } + } + function operateBackgroundAudio ({ + operationType, + src, + startTime, + currentTime + }) { + return operateMusicPlayer({ + operationType, + dataUrl: src, + position: startTime || currentTime || 0, + api: 'operateBackgroundAudio' + }) + } + function getBackgroundAudioState () { + let data = { + duration: 0, + currentTime: 0, + paused: false, + src: '', + buffered: 0, + title: '', + epname: '', + singer: '', + coverImgUrl: '', + webUrl: '', + startTime: 0, + errMsg: `getBackgroundAudioState:ok` + }; + const audio = getAudio(); + if (audio) { + let newData = { + duration: audio.getDuration() || 0, + currentTime: audio.isStopped ? 0 : audio.getPosition(), + paused: audio.isPaused, + src: audio.src, + buffered: audio.getBuffered(), + title: audio.title, + epname: audio.epname, + singer: audio.singer, + coverImgUrl: audio.coverImgUrl, + webUrl: audio.webUrl, + startTime: audio.startTime + }; + data = Object.assign(data, newData); + } + return data + } + + const DEVICE_FREQUENCY = 200; + const NETWORK_TYPES$1 = ['unknown', 'none', 'ethernet', 'wifi', '2g', '3g', '4g']; + + const MAP_ID = '__UNIAPP_MAP'; + + const TEMP_PATH_BASE = '_doc/uniapp_temp'; + const TEMP_PATH = `${TEMP_PATH_BASE}_${Date.now()}`; + + let watchAccelerationId = false; + let isWatchAcceleration = false; + + const clearWatchAcceleration = () => { + if (watchAccelerationId) { + plus.accelerometer.clearWatch(watchAccelerationId); + watchAccelerationId = false; + } + }; + + function enableAccelerometer ({ + enable + }) { + if (enable) { // 启用监听 + clearWatchAcceleration(); + watchAccelerationId = plus.accelerometer.watchAcceleration((res) => { + publish('onAccelerometerChange', { + x: res.xAxis, + y: res.yAxis, + z: res.zAxis, + errMsg: 'enableAccelerometer:ok' + }); + }, (e) => { + publish('onAccelerometerChange', { + errMsg: 'enableAccelerometer:fail' + }); + }, { + frequency: DEVICE_FREQUENCY + }); + if (!isWatchAcceleration) { + isWatchAcceleration = true; + const webview = getLastWebview(); + if (webview) { + webview.addEventListener('close', clearWatchAcceleration); + } + } + } else { + clearWatchAcceleration(); + } + return { + errMsg: 'enableAccelerometer:ok' + } + } + + function addPhoneContact ({ + photoFilePath = '', + nickName, + lastName, + middleName, + firstName, + remark, + mobilePhoneNumber, + weChatNumber, + addressCountry, + addressState, + addressCity, + addressStreet, + addressPostalCode, + organization, + title, + workFaxNumber, + workPhoneNumber, + hostNumber, + email, + url, + workAddressCountry, + workAddressState, + workAddressCity, + workAddressStreet, + workAddressPostalCode, + homeFaxNumber, + homePhoneNumber, + homeAddressCountry, + homeAddressState, + homeAddressCity, + homeAddressStreet, + homeAddressPostalCode + } = {}, callbackId) { + plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE, (addressbook) => { + const contact = addressbook.create(); + const name = {}; + if (lastName) { + name.familyName = lastName; + } + if (firstName) { + name.givenName = firstName; + } + if (middleName) { + name.middleName = middleName; + } + contact.name = name; + + if (nickName) { + contact.nickname = nickName; + } + + if (photoFilePath) { + contact.photos = [{ + type: 'url', + value: photoFilePath + }]; + } + + if (remark) { + contact.note = remark; + } + + const mobilePhone = { + type: 'mobile' + }; + + const workPhone = { + type: 'work' + }; + + const companyPhone = { + type: 'company' + }; + + const homeFax = { + type: 'home fax' + }; + + const workFax = { + type: 'work fax' + }; + + if (mobilePhoneNumber) { + mobilePhone.value = mobilePhoneNumber; + } + + if (workPhoneNumber) { + workPhone.value = workPhoneNumber; + } + + if (hostNumber) { + companyPhone.value = hostNumber; + } + + if (homeFaxNumber) { + homeFax.value = homeFaxNumber; + } + + if (workFaxNumber) { + workFax.value = workFaxNumber; + } + + contact.phoneNumbers = [mobilePhone, workPhone, companyPhone, homeFax, workFax]; + + if (email) { + contact.emails = [{ + type: 'home', + value: email + }]; + } + + if (url) { + contact.urls = [{ + type: 'other', + value: url + }]; + } + + if (weChatNumber) { + contact.ims = [{ + type: 'other', + value: weChatNumber + }]; + } + + const defaultAddress = { + type: 'other', + preferred: true + }; + + const homeAddress = { + type: 'home' + }; + const companyAddress = { + type: 'company' + }; + + if (addressCountry) { + defaultAddress.country = addressCountry; + } + + if (addressState) { + defaultAddress.region = addressState; + } + + if (addressCity) { + defaultAddress.locality = addressCity; + } + + if (addressStreet) { + defaultAddress.streetAddress = addressStreet; + } + + if (addressPostalCode) { + defaultAddress.postalCode = addressPostalCode; + } + + if (homeAddressCountry) { + homeAddress.country = homeAddressCountry; + } + + if (homeAddressState) { + homeAddress.region = homeAddressState; + } + + if (homeAddressCity) { + homeAddress.locality = homeAddressCity; + } + + if (homeAddressStreet) { + homeAddress.streetAddress = homeAddressStreet; + } + + if (homeAddressPostalCode) { + homeAddress.postalCode = homeAddressPostalCode; + } + + if (workAddressCountry) { + companyAddress.country = workAddressCountry; + } + + if (workAddressState) { + companyAddress.region = workAddressState; + } + + if (workAddressCity) { + companyAddress.locality = workAddressCity; + } + + if (workAddressStreet) { + companyAddress.streetAddress = workAddressStreet; + } + + if (workAddressPostalCode) { + companyAddress.postalCode = workAddressPostalCode; + } + + contact.addresses = [defaultAddress, homeAddress, companyAddress]; + + contact.save(() => { + invoke(callbackId, { + errMsg: 'addPhoneContact:ok' + }); + }, (e) => { + invoke(callbackId, { + errMsg: 'addPhoneContact:fail' + }); + }); + }, (e) => { + invoke(callbackId, { + errMsg: 'addPhoneContact:fail' + }); + }); + } + + /** + * 执行蓝牙相关方法 + */ + function bluetoothExec (method, callbackId, data = {}, beforeSuccess) { + var deviceId = data.deviceId; + if (deviceId) { + data.deviceId = deviceId.toUpperCase(); + } + var serviceId = data.serviceId; + if (serviceId) { + data.serviceId = serviceId.toUpperCase(); + } + + plus.bluetooth[method.replace('Changed', 'Change')](Object.assign(data, { + success (data) { + if (typeof beforeSuccess === 'function') { + beforeSuccess(data); + } + invoke(callbackId, Object.assign({}, data, { + errMsg: `${method}:ok`, + code: undefined, + message: undefined + })); + }, + fail (error = {}) { + invoke(callbackId, { + errMsg: `${method}:fail ${error.message || ''}`, + errCode: error.code || 0 + }); + } + })); + } + /** + * 监听蓝牙相关事件 + */ + function bluetoothOn (method, beforeSuccess) { + plus.bluetooth[method.replace('Changed', 'Change')](function (data) { + if (typeof beforeSuccess === 'function') { + beforeSuccess(data); + } + publish(method, Object.assign({}, data, { + code: undefined, + message: undefined + })); + }); + return true + } + + function checkDevices (data) { + data.devices = data.devices.map(device => { + var advertisData = device.advertisData; + if (advertisData && typeof advertisData !== 'string') { + device.advertisData = wx.arrayBufferToBase64(advertisData); + } + return device + }); + } + + var onBluetoothAdapterStateChange; + var onBluetoothDeviceFound; + var onBLEConnectionStateChange; + var onBLEConnectionStateChanged; + var onBLECharacteristicValueChange; + + function openBluetoothAdapter (data, callbackId) { + onBluetoothAdapterStateChange = onBluetoothAdapterStateChange || bluetoothOn('onBluetoothAdapterStateChange'); + bluetoothExec('openBluetoothAdapter', callbackId); + } + + function closeBluetoothAdapter (data, callbackId) { + bluetoothExec('closeBluetoothAdapter', callbackId); + } + + function getBluetoothAdapterState (data, callbackId) { + bluetoothExec('getBluetoothAdapterState', callbackId); + } + + function startBluetoothDevicesDiscovery (data, callbackId) { + onBluetoothDeviceFound = onBluetoothDeviceFound || bluetoothOn('onBluetoothDeviceFound', checkDevices); + bluetoothExec('startBluetoothDevicesDiscovery', callbackId, data); + } + + function stopBluetoothDevicesDiscovery (data, callbackId) { + bluetoothExec('stopBluetoothDevicesDiscovery', callbackId); + } + + function getBluetoothDevices (data, callbackId) { + bluetoothExec('getBluetoothDevices', callbackId, {}, checkDevices); + } + + function getConnectedBluetoothDevices (data, callbackId) { + bluetoothExec('getConnectedBluetoothDevices', callbackId, data); + } + + function createBLEConnection (data, callbackId) { + onBLEConnectionStateChange = onBLEConnectionStateChange || bluetoothOn('onBLEConnectionStateChange'); + onBLEConnectionStateChanged = onBLEConnectionStateChanged || bluetoothOn('onBLEConnectionStateChanged'); + bluetoothExec('createBLEConnection', callbackId, data); + } + + function closeBLEConnection (data, callbackId) { + bluetoothExec('closeBLEConnection', callbackId, data); + } + + function getBLEDeviceServices (data, callbackId) { + bluetoothExec('getBLEDeviceServices', callbackId, data); + } + + function getBLEDeviceCharacteristics (data, callbackId) { + bluetoothExec('getBLEDeviceCharacteristics', callbackId, data); + } + + function notifyBLECharacteristicValueChange (data, callbackId) { + onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange', + data => { + data.value = wx.arrayBufferToBase64(data.value); + }); + bluetoothExec('notifyBLECharacteristicValueChange', callbackId, data); + } + + function notifyBLECharacteristicValueChanged (data, callbackId) { + onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange', + data => { + data.value = wx.arrayBufferToBase64(data.value); + }); + bluetoothExec('notifyBLECharacteristicValueChanged', callbackId, data); + } + + function readBLECharacteristicValue (data, callbackId) { + bluetoothExec('readBLECharacteristicValue', callbackId, data); + } + + function writeBLECharacteristicValue (data, callbackId) { + data.value = wx.base64ToArrayBuffer(data.value); + bluetoothExec('writeBLECharacteristicValue', callbackId, data); + } + + function getScreenBrightness () { + return { + errMsg: 'getScreenBrightness:ok', + value: plus.screen.getBrightness() + } + } + + function setScreenBrightness ({ + value + } = {}) { + plus.screen.setBrightness(value); + return { + errMsg: 'setScreenBrightness:ok' + } + } + + function setKeepScreenOn ({ + keepScreenOn + } = {}) { + plus.device.setWakelock(!!keepScreenOn); + return { + errMsg: 'setKeepScreenOn:ok' + } + } + + function getClipboardData (options, callbackId) { + const clipboard = requireNativePlugin('clipboard'); + clipboard.getString(ret => { + if (ret.result === 'success') { + invoke(callbackId, { + data: ret.data, + errMsg: 'getClipboardData:ok' + }); + } else { + invoke(callbackId, { + data: ret.result, + errMsg: 'getClipboardData:fail' + }); + } + }); + } + + function setClipboardData ({ + data + }) { + const clipboard = requireNativePlugin('clipboard'); + clipboard.setString(data); + return { + errMsg: 'setClipboardData:ok' + } + } + + let watchOrientationId = false; + let isWatchOrientation = false; + + const clearWatchOrientation = () => { + if (watchOrientationId) { + plus.orientation.clearWatch(watchOrientationId); + watchOrientationId = false; + } + }; + + function enableCompass ({ + enable + }) { + if (enable) { + clearWatchOrientation(); + watchOrientationId = plus.orientation.watchOrientation((o) => { + publish('onCompassChange', { + direction: o.magneticHeading, + errMsg: 'enableCompass:ok' + }); + }, (e) => { + publish('onCompassChange', { + errMsg: 'enableCompass:fail' + }); + }, { + frequency: DEVICE_FREQUENCY + }); + if (!isWatchOrientation) { + isWatchOrientation = true; + const webview = getLastWebview(); + if (webview) { + webview.addEventListener('close', () => { + plus.orientation.clearWatch(watchOrientationId); + }); + } + } + } else { + clearWatchOrientation(); + } + return { + errMsg: 'enableCompass:ok' + } + } + + function getNetworkType () { + return { + errMsg: 'getNetworkType:ok', + networkType: NETWORK_TYPES$1[plus.networkinfo.getCurrentType()] + } + } + + let beaconUpdateState = false; + + function onBeaconUpdate () { + if (!beaconUpdateState) { + plus.ibeacon.onBeaconUpdate(function (data) { + publish('onBeaconUpdated', data); + }); + beaconUpdateState = true; + } + } + + let beaconServiceChangeState = false; + + function onBeaconServiceChange () { + if (!beaconServiceChangeState) { + plus.ibeacon.onBeaconServiceChange(function (data) { + publish('onBeaconServiceChange', data); + publish('onBeaconServiceChanged', data); + }); + beaconServiceChangeState = true; + } + } + + function getBeacons (params, callbackId) { + plus.ibeacon.getBeacons({ + success: (result) => { + invoke(callbackId, { + errMsg: 'getBeacons:ok', + beacons: result.beacons + }); + }, + fail: (error) => { + invoke(callbackId, { + errMsg: 'getBeacons:fail:' + error.message + }); + } + }); + } + + function startBeaconDiscovery ({ + uuids, + ignoreBluetoothAvailable = false + }, callbackId) { + plus.ibeacon.startBeaconDiscovery({ + uuids, + ignoreBluetoothAvailable, + success: (result) => { + invoke(callbackId, { + errMsg: 'startBeaconDiscovery:ok', + beacons: result.beacons + }); + }, + fail: (error) => { + invoke(callbackId, { + errMsg: 'startBeaconDiscovery:fail:' + error.message + }); + } + }); + } + + function stopBeaconDiscovery (params, callbackId) { + plus.ibeacon.stopBeaconDiscovery({ + success: (result) => { + invoke(callbackId, Object.assign(result, { + errMsg: 'stopBeaconDiscovery:ok' + })); + }, + fail: (error) => { + invoke(callbackId, { + errMsg: 'stopBeaconDiscovery:fail:' + error.message + }); + } + }); + } + + function makePhoneCall$1 ({ + phoneNumber + } = {}) { + plus.device.dial(phoneNumber); + return { + errMsg: 'makePhoneCall:ok' + } + } + + const SCAN_ID = '__UNIAPP_SCAN'; + const SCAN_PATH = '_www/__uniappscan.html'; + + const MESSAGE_TYPE = 'scanCode'; + + function scanCode ({ + onlyFromCamera = false, + scanType + }, callbackId) { + const barcode = plus.barcode; + const SCAN_TYPES = { + 'qrCode': [ + barcode.QR, + barcode.AZTEC, + barcode.MAXICODE + ], + 'barCode': [ + barcode.EAN13, + barcode.EAN8, + barcode.UPCA, + barcode.UPCE, + barcode.CODABAR, + barcode.CODE128, + barcode.CODE39, + barcode.CODE93, + barcode.ITF, + barcode.RSS14, + barcode.RSSEXPANDED + ], + 'datamatrix': [barcode.DATAMATRIX], + 'pdf417': [barcode.PDF417] + }; + + const SCAN_MAPS = { + [barcode.QR]: 'QR_CODE', + [barcode.EAN13]: 'EAN_13', + [barcode.EAN8]: 'EAN_8', + [barcode.DATAMATRIX]: 'DATA_MATRIX', + [barcode.UPCA]: 'UPC_A', + [barcode.UPCE]: 'UPC_E', + [barcode.CODABAR]: 'CODABAR', + [barcode.CODE39]: 'CODE_39', + [barcode.CODE93]: 'CODE_93', + [barcode.CODE128]: 'CODE_128', + [barcode.ITF]: 'CODE_25', + [barcode.PDF417]: 'PDF_417', + [barcode.AZTEC]: 'AZTEC', + [barcode.RSS14]: 'RSS_14', + [barcode.RSSEXPANDED]: 'RSSEXPANDED' + }; + + const statusBarStyle = getStatusBarStyle(); + const isDark = statusBarStyle !== 'light'; + + let result; + + let filters = []; + if (Array.isArray(scanType) && scanType.length) { + scanType.forEach(type => { // 暂不考虑去重 + const types = SCAN_TYPES[type]; + if (types) { + filters = filters.concat(types); + } + }); + } + if (!filters.length) { + filters = filters.concat(SCAN_TYPES['qrCode']).concat(SCAN_TYPES['barCode']).concat(SCAN_TYPES['datamatrix']).concat( + SCAN_TYPES['pdf417']); + } + + const buttons = []; + if (!onlyFromCamera) { + buttons.push({ + 'float': 'right', + 'text': '相册', + 'fontSize': '17px', + 'width': '60px', + 'onclick': function () { + plus.gallery.pick(file => { + barcode.scan(file, (type, code) => { + if (isDark) { + plus.navigator.setStatusBarStyle('isDark'); + } + webview.close('auto'); + result = { + type, + code + }; + }, () => { + plus.nativeUI.toast('识别失败'); + }, filters); + }, err => { + if (err.code !== 12) { + plus.nativeUI.toast('选择失败'); + } + }, { + multiple: false, + system: false + }); + } + }); + } + + const webview = plus.webview.create(SCAN_PATH, SCAN_ID, { + titleNView: { + autoBackButton: true, + type: 'float', + backgroundColor: 'rgba(0,0,0,0)', + titleColor: '#ffffff', + titleText: '扫码', + titleSize: '17px', + buttons + }, + popGesture: 'close', + backButtonAutoControl: 'close' + }, { + __uniapp_type: 'scan', + __uniapp_dark: isDark, + __uniapp_scan_type: filters, + 'uni-app': 'none' + }); + const waiting = plus.nativeUI.showWaiting(); + webview.addEventListener('titleUpdate', () => { + webview.show(ANI_SHOW, ANI_DURATION, () => { + waiting.close(); + }); + }); + webview.addEventListener('close', () => { + if (result && 'code' in result) { + invoke(callbackId, { + result: result.code, + scanType: SCAN_MAPS[result.type] || '', + charSet: 'utf8', + path: '', + errMsg: 'scanCode:ok' + }); + } else { + invoke(callbackId, { + errMsg: 'scanCode:fail cancel' + }); + } + }); + if (isDark) { // 状态栏前景色 + plus.navigator.setStatusBarStyle('light'); + webview.addEventListener('popGesture', ({ + type, + result + }) => { + if (type === 'start') { + plus.navigator.setStatusBarStyle('dark'); + } else if (type === 'end' && !result) { + plus.navigator.setStatusBarStyle('light'); + } + }); + } + // fixed by hxy 注册扫码事件 + registerPlusMessage(MESSAGE_TYPE, function (res) { + if (res && !res.errMsg) { + result = res; + } else { + const errMsg = res && res.errMsg ? ' ' + res.errMsg : ''; + result = { + errMsg: 'scanCode:fail' + errMsg + }; + } + }, false); + } + + function getSystemInfoSync () { + return callApiSync(getSystemInfo, Object.create(null), 'getSystemInfo', 'getSystemInfoSync') + } + + function getSystemInfo () { + const platform = plus.os.name.toLowerCase(); + const ios = platform === 'ios'; + // 安卓 plus 接口获取的屏幕大小值不为整数,iOS js 获取的屏幕大小横屏时颠倒 + const screenWidth = plus.screen.resolutionWidth; + const screenHeight = plus.screen.resolutionHeight; + // 横屏时 iOS 获取的状态栏高度错误,进行纠正 + var landscape = Math.abs(plus.navigator.getOrientation()) === 90; + var statusBarHeight = plus.navigator.getStatusbarHeight(); + if (ios && landscape) { + statusBarHeight = Math.min(20, statusBarHeight); + } + // 判断是否存在 titleNView + var titleNView; + var webview = getLastWebview(); + if (webview) { + let style = webview.getStyle(); + if (style) { + titleNView = style && style.titleNView; + titleNView = titleNView && titleNView.type === 'default'; + } + } + return { + errMsg: 'getSystemInfo:ok', + brand: '', + model: plus.device.model, + pixelRatio: plus.screen.scale, + screenWidth, + screenHeight, + // 安卓端 webview 宽度有时比屏幕多 1px,相比取最小值 + // TODO screenWidth,screenHeight + windowWidth: screenWidth, + windowHeight: Math.min(screenHeight - (titleNView ? (statusBarHeight + TITLEBAR_HEIGHT) + : 0) - (isTabBarPage() && tabBar.visible ? TABBAR_HEIGHT : 0), screenHeight), + statusBarHeight, + language: plus.os.language, + system: plus.os.version, + version: plus.runtime.innerVersion, + fontSizeSetting: '', + platform, + SDKVersion: '', + windowTop: 0, + windowBottom: 0 + } + } + + function vibrateLong () { + plus.device.vibrate(400); + return { + errMsg: 'vibrateLong:ok' + } + } + function vibrateShort () { + plus.device.vibrate(15); + return { + errMsg: 'vibrateShort:ok' + } + } + + const SAVED_DIR = 'uniapp_save'; + const SAVE_PATH = `_doc/${SAVED_DIR}`; + const REGEX_FILENAME = /^.*[/]/; + + function getSavedFileDir (success, fail) { + fail = fail || function () {}; + plus.io.requestFileSystem(plus.io.PRIVATE_DOC, fs => { // 请求_doc fs + fs.root.getDirectory(SAVED_DIR, { // 获取文件保存目录对象 + create: true + }, dir => { + success(dir); + }, err => { + fail('目录[' + SAVED_DIR + ']创建失败' + err.message); + }); + }, err => { + fail('目录[_doc]读取失败' + err.message); + }); + } + + function saveFile ({ + tempFilePath + } = {}, callbackId) { + let fileName = tempFilePath.replace(REGEX_FILENAME, ''); + if (fileName) { + let extName = ''; + if (~fileName.indexOf('.')) { + extName = '.' + fileName.split('.').pop(); + } + + fileName = (+new Date()) + '' + extName; + + plus.io.resolveLocalFileSystemURL(getRealPath(tempFilePath), entry => { // 读取临时文件 FileEntry + getSavedFileDir(dir => { + entry.copyTo(dir, fileName, () => { // 复制临时文件 FileEntry,为了避免把相册里的文件删除,使用 copy,微信中是要删除临时文件的 + const savedFilePath = SAVE_PATH + '/' + fileName; + invoke(callbackId, { + errMsg: 'saveFile:ok', + savedFilePath + }); + }, err => { + invoke(callbackId, { + errMsg: 'saveFile:fail 保存文件[' + tempFilePath + + '] copyTo 失败:' + err.message + }); + }); + }, message => { + invoke(callbackId, { + errMsg: 'saveFile:fail ' + message + }); + }); + }, err => { + invoke(callbackId, { + errMsg: 'saveFile:fail 文件[' + tempFilePath + ']读取失败' + err.message + }); + }); + } else { + return { + errMsg: 'saveFile:fail 文件名[' + tempFilePath + ']不存在' + } + } + } + + function getSavedFileList (options, callbackId) { + getSavedFileDir(entry => { + var reader = entry.createReader(); + + var fileList = []; + reader.readEntries(entries => { + if (entries && entries.length) { + entries.forEach(entry => { + entry.getMetadata(meta => { + fileList.push({ + filePath: plus.io.convertAbsoluteFileSystem(entry.fullPath), + createTime: meta.modificationTime.getTime(), + size: meta.size + }); + if (fileList.length === entries.length) { + invoke(callbackId, { + errMsg: 'getSavedFileList:ok', + fileList + }); + } + }, error => { + invoke(callbackId, { + errMsg: 'getSavedFileList:fail ' + error.message + }); + }, false); + }); + } else { + invoke(callbackId, { + errMsg: 'getSavedFileList:ok', + fileList + }); + } + }, error => { + invoke(callbackId, { + errMsg: 'getSavedFileList:fail ' + error.message + }); + }); + }, message => { + invoke(callbackId, { + errMsg: 'getSavedFileList:fail ' + message + }); + }); + } + + function getFileInfo ({ + filePath, + digestAlgorithm = 'md5' + } = {}, callbackId) { + // TODO 计算文件摘要 + plus.io.resolveLocalFileSystemURL(getRealPath(filePath), entry => { + entry.getMetadata(meta => { + invoke(callbackId, { + errMsg: 'getFileInfo:ok', + size: meta.size, + digestAlgorithm: '' + }); + }, err => { + invoke(callbackId, { + errMsg: 'getFileInfo:fail 文件[' + + filePath + + '] getMetadata 失败:' + err.message + }); + }); + }, err => { + invoke(callbackId, { + errMsg: 'getFileInfo:fail 文件[' + filePath + ']读取失败:' + err.message + }); + }); + } + + function getSavedFileInfo ({ + filePath + } = {}, callbackId) { + plus.io.resolveLocalFileSystemURL(getRealPath(filePath), entry => { + entry.getMetadata(meta => { + invoke(callbackId, { + createTime: meta.modificationTime.getTime(), + size: meta.size, + errMsg: 'getSavedFileInfo:ok' + }); + }, error => { + invoke(callbackId, { + errMsg: 'getSavedFileInfo:fail ' + error.message + }); + }, false); + }, () => { + invoke(callbackId, { + errMsg: 'getSavedFileInfo:fail file not find' + }); + }); + } + + function removeSavedFile ({ + filePath + } = {}, callbackId) { + plus.io.resolveLocalFileSystemURL(getRealPath(filePath), entry => { + entry.remove(() => { + invoke(callbackId, { + errMsg: 'removeSavedFile:ok' + }); + }, err => { + invoke(callbackId, { + errMsg: 'removeSavedFile:fail 文件[' + filePath + ']删除失败:' + err.message + }); + }); + }, () => { + invoke(callbackId, { + errMsg: 'removeSavedFile:fail file not find' + }); + }); + } + + function openDocument$1 ({ + filePath, + fileType + } = {}, callbackId) { + plus.io.resolveLocalFileSystemURL(getRealPath(filePath), entry => { + plus.runtime.openFile(getRealPath(filePath)); + invoke(callbackId, { + errMsg: 'openDocument:ok' + }); + }, err => { + invoke(callbackId, { + errMsg: 'openDocument:fail 文件[' + filePath + ']读取失败:' + err.message + }); + }); + } + + const CHOOSE_LOCATION_PATH = '_www/__uniappchooselocation.html'; + + function chooseLocation (params, callbackId) { + const statusBarStyle = plus.navigator.getStatusBarStyle(); + const webview = plus.webview.create( + CHOOSE_LOCATION_PATH, + MAP_ID, { + titleNView: { + autoBackButton: true, + backgroundColor: '#000000', + titleColor: '#ffffff', + titleText: '选择位置', + titleSize: '17px', + buttons: [{ + float: 'right', + text: '完成', + fontSize: '17px', + onclick: function () { + webview.evalJS('__chooseLocationConfirm__()'); + } + }] + }, + popGesture: 'close', + scrollIndicator: 'none' + }, { + __uniapp_type: 'map', + __uniapp_statusbar_style: statusBarStyle, + 'uni-app': 'none' + } + ); + if (statusBarStyle === 'dark') { + plus.navigator.setStatusBarStyle('light'); + webview.addEventListener('popGesture', ({ + type, + result + }) => { + if (type === 'start') { + plus.navigator.setStatusBarStyle('dark'); + } else if (type === 'end' && !result) { + plus.navigator.setStatusBarStyle('light'); + } + }); + } + + webview.show('slide-in-bottom', ANI_DURATION, () => { + webview.evalJS(`__chooseLocation__(${JSON.stringify(params)})`); + }); + + // fixed by hxy + registerPlusMessage('chooseLocation', function (res) { + if (res && !res.errMsg) { + invoke(callbackId, { + name: res.poiname, + address: res.poiaddress, + latitude: res.latlng.lat, + longitude: res.latlng.lng, + errMsg: 'chooseLocation:ok' + }); + } else { + const errMsg = res && res.errMsg ? ' ' + res.errMsg : ''; + invoke(callbackId, { + errMsg: 'chooseLocation:fail' + errMsg + }); + } + }, false); + } + + function getLocationSuccess (type, position, callbackId) { + const coords = position.coords; + if (type !== position.coordsType) { + if (process.env.NODE_ENV !== 'production') { + console.log( + `UNIAPP[location]:before[${position.coordsType}][lng:${ + coords.longitude + },lat:${coords.latitude}]` + ); + } + let coordArray; + if (type === 'wgs84') { + coordArray = gcj02towgs84(coords.longitude, coords.latitude); + } else if (type === 'gcj02') { + coordArray = wgs84togcj02(coords.longitude, coords.latitude); + } + if (coordArray) { + coords.longitude = coordArray[0]; + coords.latitude = coordArray[1]; + if (process.env.NODE_ENV !== 'production') { + console.log( + `UNIAPP[location]:after[${type}][lng:${coords.longitude},lat:${ + coords.latitude + }]` + ); + } + } + } + + invoke(callbackId, { + type, + altitude: coords.altitude || 0, + latitude: coords.latitude, + longitude: coords.longitude, + speed: coords.speed, + accuracy: coords.accuracy, + address: position.address, + errMsg: 'getLocation:ok' + }); + } + + function getLocation$1 ({ + type = 'wgs84', + geocode = false, + altitude = false + } = {}, callbackId) { + plus.geolocation.getCurrentPosition( + position => { + getLocationSuccess(type, position, callbackId); + }, + e => { + // 坐标地址解析失败 + if (e.code === 1501) { + getLocationSuccess(type, e, callbackId); + return + } + + invoke(callbackId, { + errMsg: 'getLocation:fail ' + e.message + }); + }, { + geocode: geocode, + enableHighAccuracy: altitude + } + ); + } + + const OPEN_LOCATION_PATH = '_www/__uniappopenlocation.html'; + + function openLocation$1 (params) { + const statusBarStyle = plus.navigator.getStatusBarStyle(); + const webview = plus.webview.create( + OPEN_LOCATION_PATH, + MAP_ID, { + titleNView: { + autoBackButton: true, + titleColor: '#ffffff', + titleText: '', + titleSize: '17px', + type: 'transparent' + }, + popGesture: 'close', + scrollIndicator: 'none' + }, { + __uniapp_type: 'map', + __uniapp_statusbar_style: statusBarStyle, + 'uni-app': 'none' + } + ); + if (statusBarStyle === 'light') { + plus.navigator.setStatusBarStyle('dark'); + webview.addEventListener('popGesture', ({ + type, + result + }) => { + if (type === 'start') { + plus.navigator.setStatusBarStyle('light'); + } else if (type === 'end' && !result) { + plus.navigator.setStatusBarStyle('dark'); + } + }); + } + webview.show(ANI_SHOW, ANI_DURATION, () => { + webview.evalJS(`__openLocation__(${JSON.stringify(params)})`); + }); + + return { + errMsg: 'openLocation:ok' + } + } + + const RECORD_TIME = 60 * 60 * 1000; + + let recorder; + let recordTimeout; + + function startRecord (args, callbackId) { + recorder && recorder.stop(); + recorder = plus.audio.getRecorder(); + recorder.record({ + filename: '_doc/audio/', + format: 'aac' + }, (res) => { + invoke(callbackId, { + errMsg: 'startRecord:ok', + tempFilePath: res + }); + }, (res) => { + invoke(callbackId, { + errMsg: 'startRecord:fail' + }); + }); + recordTimeout = setTimeout(() => { + recorder.stop(); + recorder = false; + }, RECORD_TIME); + } + + function stopRecord () { + if (recorder) { + recordTimeout && clearTimeout(recordTimeout); + recorder.stop(); + return { + errMsg: 'stopRecord:ok' + } + } + return { + errMsg: 'stopRecord:fail' + } + } + + let player; + let playerFilePath; + let playerStatus; + + function playVoice ({ + filePath + } = {}, callbackId) { + if (player && playerFilePath === filePath && playerStatus === 'pause') { // 如果是当前音频被暂停,则继续播放 + playerStatus = 'play'; + player.play((res) => { + player = false; + playerFilePath = false; + playerStatus = false; + invoke(callbackId, { + errMsg: 'playVoice:ok' + }); + }); + return { + errMsg: 'playVoice:ok' + } + } + if (player) { // 如果存在音频播放,则停止 + player.stop(); + } + playerFilePath = filePath; + playerStatus = 'play'; + player = plus.audio.createPlayer(getRealPath(filePath)); + // 播放操作成功回调 + player.play((res) => { + player = false; + playerFilePath = false; + playerStatus = false; + invoke(callbackId, { + errMsg: 'playVoice:ok' + }); + }); + } + + function pauseVoice () { + if (player && playerStatus === 'play') { + player.pause(); + playerStatus = 'pause'; + } + return { + errMsg: 'pauseVoice:ok' + } + } + + function stopVoice () { + if (player) { + player.stop(); + player = false; + playerFilePath = false; + playerStatus = false; + } + return { + errMsg: 'stopVoice:ok' + } + } + + /** + * 获取文件信息 + * @param {string} filePath 文件路径 + * @returns {Promise} 文件信息Promise + */ + function getFileInfo$1 (filePath) { + return new Promise((resolve, reject) => { + plus.io.resolveLocalFileSystemURL(filePath, function (entry) { + entry.getMetadata(function (meta) { + resolve({ + size: meta.size + }); + }, reject, false); + }, reject); + }) + } + + const invokeChooseImage = function (callbackId, type, sizeType, tempFilePaths = []) { + if (!tempFilePaths.length) { + invoke(callbackId, { + code: sizeType, + errMsg: `chooseImage:${type}` + }); + return + } + var tempFiles = []; + // plus.zip.compressImage 压缩文件并发调用在iOS端容易出现问题(图像错误、闪退),改为队列执行 + tempFilePaths.reduce((promise, tempFilePath, index, array) => { + return promise + .then(() => { + return getFileInfo$1(tempFilePath) + }) + .then(fileInfo => { + var size = fileInfo.size; + // 压缩阈值 0.5 兆 + var threshold = 1024 * 1024 * 0.5; + // 判断是否需要压缩 + if ((sizeType.indexOf('compressed') >= 0 && sizeType.indexOf('original') < 0) || ((( + sizeType.indexOf( + 'compressed') < 0 && sizeType.indexOf('original') < 0) || (sizeType + .indexOf('compressed') >= 0 && sizeType.indexOf( + 'original') >= 0)) && size > threshold)) { + return new Promise((resolve, reject) => { + var dstPath = TEMP_PATH + '/compressed/' + Date.now() + ( + tempFilePath.match(/\.\S+$/) || [''])[0]; + plus.nativeUI.showWaiting(); + plus.zip.compressImage({ + src: tempFilePath, + dst: dstPath, + overwrite: true + }, () => { + resolve(dstPath); + }, (error) => { + reject(error); + }); + }) + .then(dstPath => { + array[index] = tempFilePath = dstPath; + return getFileInfo$1(tempFilePath) + }) + .then(fileInfo => { + return tempFiles.push({ + path: tempFilePath, + size: fileInfo.size + }) + }) + } + return tempFiles.push({ + path: tempFilePath, + size: size + }) + }) + }, Promise.resolve()) + .then(() => { + plus.nativeUI.closeWaiting(); + invoke(callbackId, { + errMsg: `chooseImage:${type}`, + tempFilePaths, + tempFiles + }); + }).catch(() => { + plus.nativeUI.closeWaiting(); + invoke(callbackId, { + errMsg: `chooseImage:${type}` + }); + }); + }; + const openCamera = function (callbackId, sizeType) { + const camera = plus.camera.getCamera(); + camera.captureImage(e => invokeChooseImage(callbackId, 'ok', sizeType, [e]), + e => invokeChooseImage(callbackId, 'fail', 1), { + filename: TEMP_PATH + '/camera/' + }); + }; + const openAlbum = function (callbackId, sizeType, count) { + // TODO Android 需要拷贝到 temp 目录 + plus.gallery.pick(e => invokeChooseImage(callbackId, 'ok', sizeType, e.files.map(file => { + return file + })), e => { + invokeChooseImage(callbackId, 'fail', 2); + }, { + maximum: count, + multiple: true, + system: false, + filename: TEMP_PATH + '/gallery/' + }); + }; + + function chooseImage$1 ({ + count = 9, + sizeType = ['original', 'compressed'], + sourceType = ['album', 'camera'] + } = {}, callbackId) { + let fallback = true; + if (sourceType.length === 1) { + if (sourceType[0] === 'album') { + fallback = false; + openAlbum(callbackId, sizeType, count); + } else if (sourceType[0] === 'camera') { + fallback = false; + openCamera(callbackId, sizeType); + } + } + if (fallback) { + plus.nativeUI.actionSheet({ + cancel: '取消', + buttons: [{ + title: '拍摄' + }, { + title: '从手机相册选择' + }] + }, (e) => { + switch (e.index) { + case 0: + invokeChooseImage(callbackId, 'fail', 0); + break + case 1: + openCamera(callbackId, sizeType); + break + case 2: + openAlbum(callbackId, sizeType, count); + break + } + }); + } + } + + const invokeChooseVideo = function (callbackId, type, tempFilePath = '') { + let callbackResult = { + errMsg: `chooseVideo:${type}`, + tempFilePath: tempFilePath, + duration: 0, + size: 0, + height: 0, + width: 0 + }; + + if (type !== 'ok') { + invoke(callbackId, callbackResult); + return + } + + plus.io.getVideoInfo({ + filePath: tempFilePath, + success (videoInfo) { + callbackResult.size = videoInfo.size; + callbackResult.duration = videoInfo.duration; + callbackResult.width = videoInfo.width; + callbackResult.height = videoInfo.height; + invoke(callbackId, callbackResult); + }, + fail () { + invoke(callbackId, callbackResult); + }, + complete () { + invoke(callbackId, callbackResult); + } + }); + }; + const openCamera$1 = function (callbackId, maxDuration, cameraIndex) { + const camera = plus.camera.getCamera(); + camera.startVideoCapture(e => invokeChooseVideo(callbackId, 'ok', e), e => invokeChooseVideo( + callbackId, 'fail'), { + index: cameraIndex, + videoMaximumDuration: maxDuration, + filename: TEMP_PATH + '/camera/' + }); + }; + const openAlbum$1 = function (callbackId) { + plus.gallery.pick(e => { + invokeChooseVideo(callbackId, 'ok', e); + }, e => invokeChooseVideo(callbackId, 'fail'), { + filter: 'video', + system: false, + filename: TEMP_PATH + '/gallery/' + }); + }; + function chooseVideo$1 ({ + sourceType = ['album', 'camera'], + maxDuration = 60, + camera = 'back' + } = {}, callbackId) { + let fallback = true; + let cameraIndex = (camera === 'front') ? 2 : 1; + if (sourceType.length === 1) { + if (sourceType[0] === 'album') { + fallback = false; + openAlbum$1(callbackId); + } else if (sourceType[0] === 'camera') { + fallback = false; + openCamera$1(callbackId, maxDuration, cameraIndex); + } + } + if (fallback) { + plus.nativeUI.actionSheet({ + cancel: '取消', + buttons: [{ + title: '拍摄' + }, { + title: '从手机相册选择' + }] + }, e => { + switch (e.index) { + case 0: + invokeChooseVideo(callbackId, 'fail'); + break + case 1: + openCamera$1(callbackId, maxDuration, cameraIndex); + break + case 2: + openAlbum$1(callbackId); + break + } + }); + } + } + + function compressImage ({ + src, + quality + }, callbackId) { + var dst = TEMP_PATH + '/compressed/' + Date.now() + (src.match(/\.\S+$/) || [''])[0]; + plus.zip.compressImage({ + src, + dst, + quality + }, () => { + invoke(callbackId, { + errMsg: `compressImage:ok`, + tempFilePath: dst + }); + }, () => { + invoke(callbackId, { + errMsg: `compressImage:fail` + }); + }); + } + + function getImageInfo$1 ({ + src + } = {}, callbackId) { + // fixed by hxy + plus.io.getImageInfo({ + src, + success (imageInfo) { + invoke(callbackId, { + errMsg: 'getImageInfo:ok', + ...imageInfo + }); + }, + fail () { + invoke(callbackId, { + errMsg: 'getImageInfo:fail' + }); + } + }); + } + + function previewImage$1 ({ + current = 0, + background = '#000000', + indicator = 'number', + loop = false, + urls, + longPressActions + } = {}) { + urls = urls.map(url => getRealPath(url)); + + const index = Number(current); + if (isNaN(index)) { + current = urls.indexOf(getRealPath(current)); + current = current < 0 ? 0 : current; + } else { + current = index; + } + + plus.nativeUI.previewImage(urls, { + current, + background, + indicator, + loop, + onLongPress: function (res) { + let itemList = []; + let itemColor = ''; + let title = ''; + let hasLongPressActions = longPressActions && longPressActions.callbackId; + if (!hasLongPressActions) { + itemList = ['保存相册']; + itemColor = '#000000'; + title = ''; + } else { + itemList = longPressActions.itemList ? longPressActions.itemList : []; + itemColor = longPressActions.itemColor ? longPressActions.itemColor : '#000000'; + title = longPressActions.title ? longPressActions.title : ''; + } + + const options = { + buttons: itemList.map(item => ({ + title: item, + color: itemColor + })), + cancel: '取消' + }; + if (title) { + options.title = title; + } + // if (plus.os.name === 'iOS') { + // options.cancel = '取消' + // } + plus.nativeUI.actionSheet(options, (e) => { + if (e.index > 0) { + if (hasLongPressActions) { + publish(longPressActions.callbackId, { + errMsg: 'showActionSheet:ok', + tapIndex: e.index - 1, + index: res.index + }); + return + } + plus.gallery.save(res.url, function (GallerySaveEvent) { + plus.nativeUI.toast('保存图片到相册成功'); + }); + } else if (hasLongPressActions) { + publish(longPressActions.callbackId, { + errMsg: 'showActionSheet:fail cancel' + }); + } + }); + } + }); + return { + errMsg: 'previewImage:ok' + } + } + + let recorder$1; + let recordTimeout$1; + + const publishRecorderStateChange = (state, res = {}) => { + publish('onRecorderStateChange', Object.assign({ + state + }, res)); + }; + + const Recorder = { + start ({ + duration = 60000, + sampleRate, + numberOfChannels, + encodeBitRate, + format = 'mp3', + frameSize, + audioSource = 'auto' + }, callbackId) { + if (recorder$1) { + return publishRecorderStateChange('start') + } + recorder$1 = plus.audio.getRecorder(); + recorder$1.record({ + format, + samplerate: sampleRate, + filename: TEMP_PATH + '/recorder/' + }, res => publishRecorderStateChange('stop', { + tempFilePath: res + }), err => publishRecorderStateChange('error', { + errMsg: err.message + })); + recordTimeout$1 = setTimeout(() => { + Recorder.stop(); + }, duration); + publishRecorderStateChange('start'); + }, + stop () { + if (recorder$1) { + recorder$1.stop(); + recorder$1 = false; + recordTimeout$1 && clearTimeout(recordTimeout$1); + } + }, + pause () { + if (recorder$1) { + publishRecorderStateChange('error', { + errMsg: '暂不支持录音pause操作' + }); + } + }, + resume () { + if (recorder$1) { + publishRecorderStateChange('error', { + errMsg: '暂不支持录音resume操作' + }); + } + } + }; + + function operateRecorder ({ + operationType, + ...args + }, callbackId) { + Recorder[operationType](args); + return { + errMsg: 'operateRecorder:ok' + } + } + + function saveImageToPhotosAlbum ({ + filePath + } = {}, callbackId) { + plus.gallery.save(getRealPath(filePath), e => { + invoke(callbackId, { + errMsg: 'saveImageToPhotosAlbum:ok' + }); + }, e => { + invoke(callbackId, { + errMsg: 'saveImageToPhotosAlbum:fail' + }); + }); + } + + function saveVideoToPhotosAlbum ({ + filePath + } = {}, callbackId) { + plus.gallery.save(getRealPath(filePath), e => { + invoke(callbackId, { + errMsg: 'saveVideoToPhotosAlbum:ok' + }); + }, e => { + invoke(callbackId, { + errMsg: 'saveVideoToPhotosAlbum:fail' + }); + }); + } + + let downloadTaskId = 0; + const downloadTasks = {}; + + const publishStateChange = (res) => { + publish('onDownloadTaskStateChange', res); + }; + + const createDownloadTaskById = function (downloadTaskId, { + url, + header + } = {}) { + const downloader = plus.downloader.createDownload(url, { + time: __uniConfig.networkTimeout.downloadFile ? __uniConfig.networkTimeout.downloadFile / 1000 : 120, + filename: TEMP_PATH + '/download/', + // 需要与其它平台上的表现保持一致,不走重试的逻辑。 + retry: 0, + retryInterval: 0 + }, (download, statusCode) => { + if (statusCode) { + publishStateChange({ + downloadTaskId, + state: 'success', + tempFilePath: download.filename, + statusCode + }); + } else { + publishStateChange({ + downloadTaskId, + state: 'fail', + statusCode + }); + } + }); + for (const name in header) { + if (header.hasOwnProperty(name)) { + downloader.setRequestHeader(name, header[name]); + } + } + downloader.addEventListener('statechanged', (download, status) => { + if (download.downloadedSize && download.totalSize) { + publishStateChange({ + downloadTaskId, + state: 'progressUpdate', + progress: parseInt(download.downloadedSize / download.totalSize * 100), + totalBytesWritten: download.downloadedSize, + totalBytesExpectedToWrite: download.totalSize + }); + } + }); + downloadTasks[downloadTaskId] = downloader; + downloader.start(); + return { + downloadTaskId, + errMsg: 'createDownloadTask:ok' + } + }; + + function operateDownloadTask ({ + downloadTaskId, + operationType + } = {}) { + const downloadTask = downloadTasks[downloadTaskId]; + if (downloadTask && operationType === 'abort') { + delete downloadTasks[downloadTaskId]; + downloadTask.abort(); + publishStateChange({ + downloadTaskId, + state: 'fail', + errMsg: 'abort' + }); + return { + errMsg: 'operateDownloadTask:ok' + } + } + return { + errMsg: 'operateDownloadTask:fail' + } + } + + function createDownloadTask (args) { + return createDownloadTaskById(++downloadTaskId, args) + } + + const USER_AGENT = + 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G36 MicroMessenger/6.5.1 NetType/WIFI Language/zh_CN'; + + let requestTaskId = 0; + const requestTasks = {}; + + const publishStateChange$1 = res => { + publish('onRequestTaskStateChange', res); + delete requestTasks[requestTaskId]; + }; + + const parseResponseHeaders = headerStr => { + const headers = {}; + if (!headerStr) { + return headers + } + const headerPairs = headerStr.split('\u000d\u000a'); + for (let i = 0; i < headerPairs.length; i++) { + const headerPair = headerPairs[i]; + const index = headerPair.indexOf('\u003a\u0020'); + if (index > 0) { + const key = headerPair.substring(0, index); + const val = headerPair.substring(index + 2); + headers[key] = val; + } + } + return headers + }; + + function createRequestTaskById (requestTaskId, { + url, + data, + header, + method = 'GET' + } = {}) { + let abortTimeout; + let xhr; + // fixed by hxy 始终使用 plus 的 XHR + xhr = new plus.net.XMLHttpRequest(); + xhr.open(method, url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + if (abortTimeout) { + clearTimeout(abortTimeout); + } + xhr.onreadystatechange = null; + const statusCode = xhr.status; + if (statusCode) { + publishStateChange$1({ + requestTaskId, + state: 'success', + data: xhr.responseText, + statusCode, + header: parseResponseHeaders(xhr.getAllResponseHeaders()) + }); + } else { + publishStateChange$1({ + requestTaskId, + state: 'fail', + statusCode, + errMsg: 'abort' + }); + } + } + }; + let hasContentType = false; + for (const name in header) { + if (header.hasOwnProperty(name)) { + if (!hasContentType && name.toLowerCase() === 'content-type') { + hasContentType = true; + xhr.setRequestHeader('Content-Type', header[name]); // 大小写必须一致,否则部分服务器会返回invalid header name + } else { + xhr.setRequestHeader(name, header[name]); + } + } + } + if (!hasContentType && method === 'POST') { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); + } + if (__uniConfig.crossDomain === true) { + xhr.setRequestHeader('User-Agent', USER_AGENT); + } + + if (__uniConfig.networkTimeout.request) { + abortTimeout = setTimeout(() => { + xhr.onreadystatechange = null; + xhr.abort(); + publishStateChange$1({ + requestTaskId, + state: 'fail', + data: xhr.responseText, + statusCode: 0, + errMsg: 'timeout' + }); + }, __uniConfig.networkTimeout.request); + } + + if (typeof data !== 'string' && method === 'GET') { + data = null; + } + try { + xhr.send(data); + requestTasks[requestTaskId] = xhr; + } catch (e) { + return { + requestTaskId, + errMsg: 'createRequestTask:fail' + } + } + return { + requestTaskId, + errMsg: 'createRequestTask:ok' + } + } + + function createRequestTask (args) { + return createRequestTaskById(++requestTaskId, args) + } + + function operateRequestTask ({ + requestTaskId, + operationType + } = {}) { + const requestTask = requestTasks[requestTaskId]; + if (requestTask && operationType === 'abort') { + requestTask.abort(); + return { + errMsg: 'operateRequestTask:ok' + } + } + return { + errMsg: 'operateRequestTask:fail' + } + } + + let socketTaskId = 0; + const socketTasks = {}; + + const publishStateChange$2 = (res) => { + publish('onSocketTaskStateChange', res); + }; + + const createSocketTaskById = function (socketTaskId, { + url, + data, + header, + method, + protocols + } = {}) { + // fixed by hxy 需要测试是否支持 arraybuffer + const socket = requireNativePlugin('webSocket'); + socket.WebSocket(url, Array.isArray(protocols) ? protocols.join(',') : protocols); + // socket.binaryType = 'arraybuffer' + socketTasks[socketTaskId] = socket; + + socket.onopen(function (e) { + publishStateChange$2({ + socketTaskId, + state: 'open' + }); + }); + socket.onmessage(function (e) { + publishStateChange$2({ + socketTaskId, + state: 'message', + data: e.data + }); + }); + socket.onerror(function (e) { + publishStateChange$2({ + socketTaskId, + state: 'error', + errMsg: e.message + }); + }); + socket.onclose(function (e) { + delete socketTasks[socketTaskId]; + publishStateChange$2({ + socketTaskId, + state: 'close' + }); + }); + return { + socketTaskId, + errMsg: 'createSocketTask:ok' + } + }; + + function createSocketTask (args) { + return createSocketTaskById(++socketTaskId, args) + } + + function operateSocketTask (args) { + const { + operationType, + code, + data, + socketTaskId + } = unpack(args); + const socket = socketTasks[socketTaskId]; + if (!socket) { + return { + errMsg: 'operateSocketTask:fail' + } + } + switch (operationType) { + case 'send': + if (data) { + socket.send(data); + } + return { + errMsg: 'operateSocketTask:ok' + } + case 'close': + socket.close(code); + delete socketTasks[socketTaskId]; + return { + errMsg: 'operateSocketTask:ok' + } + } + return { + errMsg: 'operateSocketTask:fail' + } + } + + let uploadTaskId = 0; + const uploadTasks = {}; + + const publishStateChange$3 = (res) => { + publish('onUploadTaskStateChange', res); + }; + + const createUploadTaskById = function (uploadTaskId, { + url, + filePath, + name, + files, + header, + formData + } = {}) { + const uploader = plus.uploader.createUpload(url, { + timeout: __uniConfig.networkTimeout.uploadFile ? __uniConfig.networkTimeout.uploadFile / 1000 : 120, + // 需要与其它平台上的表现保持一致,不走重试的逻辑。 + retry: 0, + retryInterval: 0 + }, (upload, statusCode) => { + if (statusCode) { + publishStateChange$3({ + uploadTaskId, + state: 'success', + data: upload.responseText, + statusCode + }); + } else { + publishStateChange$3({ + uploadTaskId, + state: 'fail', + data: '', + statusCode + }); + } + delete uploadTasks[uploadTaskId]; + }); + + for (const name in header) { + if (header.hasOwnProperty(name)) { + uploader.setRequestHeader(name, header[name]); + } + } + for (const name in formData) { + if (formData.hasOwnProperty(name)) { + uploader.addData(name, formData[name]); + } + } + if (files && files.length) { + files.forEach(file => { + uploader.addFile(getRealPath(file.uri), { + key: file.name || 'file' + }); + }); + } else { + uploader.addFile(getRealPath(filePath), { + key: name + }); + } + uploader.addEventListener('statechanged', (upload, status) => { + if (upload.uploadedSize && upload.totalSize) { + publishStateChange$3({ + uploadTaskId, + state: 'progressUpdate', + progress: parseInt(upload.uploadedSize / upload.totalSize * 100), + totalBytesSent: upload.uploadedSize, + totalBytesExpectedToSend: upload.totalSize + }); + } + }); + uploadTasks[uploadTaskId] = uploader; + uploader.start(); + return { + uploadTaskId, + errMsg: 'createUploadTask:ok' + } + }; + + function operateUploadTask ({ + uploadTaskId, + operationType + } = {}) { + const uploadTask = uploadTasks[uploadTaskId]; + if (uploadTask && operationType === 'abort') { + delete uploadTasks[uploadTaskId]; + uploadTask.abort(); + publishStateChange$3({ + uploadTaskId, + state: 'fail', + errMsg: 'abort' + }); + return { + errMsg: 'operateUploadTask:ok' + } + } + return { + errMsg: 'operateUploadTask:fail' + } + } + + function createUploadTask (args) { + return createUploadTaskById(++uploadTaskId, args) + } + + const providers = { + oauth (callback) { + plus.oauth.getServices(services => { + const provider = []; + services.forEach(({ + id + }) => { + provider.push(id); + }); + callback(null, provider); + }, err => { + callback(err); + }); + }, + share (callback) { + plus.share.getServices(services => { + const provider = []; + services.forEach(({ + id + }) => { + provider.push(id); + }); + callback(null, provider); + }, err => { + callback(err); + }); + }, + payment (callback) { + plus.payment.getChannels(services => { + const provider = []; + services.forEach(({ + id + }) => { + provider.push(id); + }); + callback(null, provider); + }, err => { + callback(err); + }); + }, + push (callback) { + if (typeof weex !== 'undefined' || typeof plus !== 'undefined') { + callback(null, [plus.push.getClientInfo().id]); + } else { + callback(null, []); + } + } + }; + + function getProvider$1 ({ + service + }, callbackId) { + if (providers[service]) { + providers[service]((err, provider) => { + if (err) { + invoke(callbackId, { + errMsg: 'getProvider:fail:' + err.message + }); + } else { + invoke(callbackId, { + errMsg: 'getProvider:ok', + service, + provider + }); + } + }); + } else { + invoke(callbackId, { + errMsg: 'getProvider:fail:服务[' + service + ']不支持' + }); + } + } + + const loginServices = {}; + + const loginByService = (provider, callbackId) => { + function login () { + loginServices[provider].login(res => { + const authResult = res.target.authResult; + invoke(callbackId, { + code: authResult.code, + authResult: authResult, + errMsg: 'login:ok' + }); + }, err => { + invoke(callbackId, { + code: err.code, + errMsg: 'login:fail:' + err.message + }); + }); + } + // 先注销再登录 + loginServices[provider].logout(login, login); + }; + /** + * 微信登录 + */ + function login (params, callbackId) { + const provider = params.provider || 'weixin'; + if (loginServices[provider]) { + loginByService(provider, callbackId); + } else { + plus.oauth.getServices(services => { + loginServices[provider] = services.find(({ + id + }) => id === provider); + if (!loginServices[provider]) { + invoke(callbackId, { + code: '', + errMsg: 'login:fail:登录服务[' + provider + ']不存在' + }); + } else { + loginByService(provider, callbackId); + } + }, err => { + invoke(callbackId, { + code: err.code, + errMsg: 'login:fail:' + err.message + }); + }); + } + } + + const getUserInfo = function (params, callbackId) { + const provider = params.provider || 'weixin'; + const loginService = loginServices[provider]; + if (!loginService || !loginService.authResult) { + return invoke(callbackId, { + errMsg: 'operateWXData:fail:请先调用 uni.login' + }) + } + loginService.getUserInfo(res => { + if (provider === 'weixin') { + const wechatUserInfo = loginService.userInfo; + const userInfo = { + openId: wechatUserInfo.openid, + nickName: wechatUserInfo.nickname, + gender: wechatUserInfo.sex, + city: wechatUserInfo.city, + province: wechatUserInfo.province, + country: wechatUserInfo.country, + avatarUrl: wechatUserInfo.headimgurl, + unionId: wechatUserInfo.unionid + }; + invoke(callbackId, { + errMsg: 'operateWXData:ok', + data: { + data: JSON.stringify(userInfo), + rawData: '', + signature: '', + encryptedData: '', + iv: '' + } + }); + } else { + loginService.userInfo.openId = loginService.userInfo.openId || loginService.userInfo.openid || + loginService.authResult.openid; + loginService.userInfo.nickName = loginService.userInfo.nickName || loginService.userInfo.nickname; + loginService.userInfo.avatarUrl = loginService.userInfo.avatarUrl || loginService.userInfo.avatarUrl || + loginService.userInfo.headimgurl; + invoke(callbackId, { + errMsg: 'operateWXData:ok', + data: { + data: JSON.stringify(loginService.userInfo), + rawData: '', + signature: '', + encryptedData: '', + iv: '' + } + }); + } + }, err => { + invoke(callbackId, { + errMsg: 'operateWXData:fail:' + err.message + }); + }); + }; + + /** + * 获取用户信息 + */ + function operateWXData (params, callbackId) { + switch (params.data.api_name) { + case 'webapi_getuserinfo': + getUserInfo(params, callbackId); + break + default: + return { + errMsg: 'operateWXData:fail' + } + } + } + + function requestPayment (params, callbackId) { + const provider = params.provider; + plus.payment.getChannels(services => { + const service = services.find(({ + id + }) => id === provider); + if (!service) { + invoke(callbackId, { + errMsg: 'requestPayment:fail:支付服务[' + provider + ']不存在' + }); + } else { + plus.payment.request(service, params.orderInfo, res => { + invoke(callbackId, { + errMsg: 'requestPayment:ok' + }); + }, err => { + invoke(callbackId, { + errMsg: 'requestPayment:fail:' + err.message + }); + }); + } + }, err => { + invoke(callbackId, { + errMsg: 'requestPayment:fail:' + err.message + }); + }); + } + + let onPushing; + + let isListening = false; + + let unsubscribe = false; + + function subscribePush (params, callbackId) { + const clientInfo = plus.push.getClientInfo(); + if (clientInfo) { + if (!isListening) { + isListening = true; + plus.push.addEventListener('receive', msg => { + if (onPushing && !unsubscribe) { + publish('onPushMessage', { + messageId: msg.__UUID__, + data: msg.payload, + errMsg: 'onPush:ok' + }); + } + }); + } + unsubscribe = false; + clientInfo.errMsg = 'subscribePush:ok'; + return clientInfo + } else { + return { + errMsg: 'subscribePush:fail:请确保当前运行环境已包含 push 模块' + } + } + } + + function unsubscribePush (params) { + unsubscribe = true; + return { + errMsg: 'unsubscribePush:ok' + } + } + + function onPush () { + if (!isListening) { + return { + errMsg: 'onPush:fail:请先调用 uni.subscribePush' + } + } + if (plus.push.getClientInfo()) { + onPushing = true; + return { + errMsg: 'onPush:ok' + } + } + return { + errMsg: 'onPush:fail:请确保当前运行环境已包含 push 模块' + } + } + + function offPush (params) { + onPushing = false; + return { + errMsg: 'offPush:ok' + } + } + + // 0:图文,1:纯文字,2:纯图片,3:音乐,4:视频,5:小程序 + const TYPES = { + '0': { + name: 'web', + title: '图文' + }, + '1': { + name: 'text', + title: '纯文字' + }, + '2': { + name: 'image', + title: '纯图片' + }, + '3': { + name: 'music', + title: '音乐' + }, + '4': { + name: 'video', + title: '视频' + }, + '5': { + name: 'miniProgram', + title: '小程序' + } + }; + + const parseParams = (args, callbackId, method) => { + args.type = args.type || 0; + + let { + provider, + type, + title, + summary: content, + href, + imageUrl, + mediaUrl: media, + scene, + miniProgram + } = args; + + if (typeof imageUrl === 'string' && imageUrl) { + imageUrl = getRealPath(imageUrl); + } + + const shareType = TYPES[type + '']; + if (shareType) { + let sendMsg = { + provider, + type: shareType.name, + title, + content, + href, + pictures: [imageUrl], + thumbs: [imageUrl], + media, + miniProgram, + extra: { + scene + } + }; + if (provider === 'weixin' && (type === 1 || type === 2)) { + delete sendMsg.thumbs; + } + return sendMsg + } + return '分享参数 type 不正确' + }; + + const sendShareMsg = function (service, params, callbackId, method = 'share') { + service.send( + params, + () => { + invoke(callbackId, { + errMsg: method + ':ok' + }); + }, + err => { + invoke(callbackId, { + errMsg: method + ':fail:' + err.message + }); + } + ); + }; + + function shareAppMessageDirectly ({ + title, + path, + imageUrl, + useDefaultSnapshot + }, callbackId) { + title = title || __uniConfig.appname; + const goShare = () => { + share({ + provider: 'weixin', + type: 0, + title, + imageUrl, + href: path, + scene: 'WXSceneSession' + }, + callbackId, + 'shareAppMessageDirectly' + ); + }; + if (useDefaultSnapshot) { + const pages = getCurrentPages(); + const webview = plus.webview.getWebviewById(pages[pages.length - 1].__wxWebviewId__ + ''); + if (webview) { + const bitmap = new plus.nativeObj.Bitmap(); + webview.draw( + bitmap, + () => { + const fileName = TEMP_PATH + '/share/snapshot.jpg'; + bitmap.save( + fileName, { + overwrite: true, + format: 'jpg' + }, + () => { + imageUrl = fileName; + goShare(); + }, + err => { + invoke(callbackId, { + errMsg: 'shareAppMessageDirectly:fail:' + err.message + }); + } + ); + }, + err => { + invoke(callbackId, { + errMsg: 'shareAppMessageDirectly:fail:' + err.message + }); + } + ); + } else { + goShare(); + } + } else { + goShare(); + } + } + + function share (params, callbackId, method = 'share') { + params = parseParams(params); + if (typeof params === 'string') { + return invoke(callbackId, { + errMsg: method + ':fail:' + params + }) + } + const provider = params.provider; + plus.share.getServices( + services => { + const service = services.find(({ + id + }) => id === provider); + if (!service) { + invoke(callbackId, { + errMsg: method + ':fail:分享服务[' + provider + ']不存在' + }); + } else { + if (service.authenticated) { + sendShareMsg(service, params, callbackId); + } else { + service.authorize( + () => sendShareMsg(service, params, callbackId), + err => { + invoke(callbackId, { + errMsg: method + ':fail:' + err.message + }); + } + ); + } + } + }, + err => { + invoke(callbackId, { + errMsg: method + ':fail:' + err.message + }); + } + ); + } + + const Emitter = new Vue(); + + function apply (ctx, method, args) { + return ctx[method].apply(ctx, args) + } + + function $on () { + return apply(Emitter, '$on', [...arguments]) + } + + function $off () { + return apply(Emitter, '$off', [...arguments]) + } + + function $once () { + return apply(Emitter, '$once', [...arguments]) + } + + function $emit () { + return apply(Emitter, '$emit', [...arguments]) + } + + function showKeyboard () { + plus.key.showSoftKeybord(); + return { + errMsg: 'showKeyboard:ok' + } + } + + function hideKeyboard () { + plus.key.hideSoftKeybord(); + return { + errMsg: 'hideKeyboard:ok' + } + } + + function setNavigationBarTitle$1 ({ + title = '' + } = {}) { + const webview = getLastWebview(); + if (webview) { + const style = webview.getStyle(); + if (style && style.titleNView) { + webview.setStyle({ + titleNView: { + titleText: title + } + }); + } + return { + errMsg: 'setNavigationBarTitle:ok' + } + } + return { + errMsg: 'setNavigationBarTitle:fail' + } + } + + function showNavigationBarLoading () { + plus.nativeUI.showWaiting('', { + modal: false + }); + return { + errMsg: 'showNavigationBarLoading:ok' + } + } + + function hideNavigationBarLoading () { + plus.nativeUI.closeWaiting(); + return { + errMsg: 'hideNavigationBarLoading:ok' + } + } + + function setNavigationBarColor$1 ({ + frontColor, + backgroundColor + } = {}) { + const webview = getLastWebview(); + if (webview) { + const styles = {}; + if (frontColor) { + styles.titleColor = frontColor; + } + if (backgroundColor) { + styles.backgroundColor = backgroundColor; + } + plus.navigator.setStatusBarStyle(frontColor === '#000000' ? 'dark' : 'light'); + const style = webview.getStyle(); + if (style && style.titleNView) { + webview.setStyle({ + titleNView: styles + }); + } + return { + errMsg: 'setNavigationBarColor:ok' + } + } + return { + errMsg: 'setNavigationBarColor:fail' + } + } + + let waiting; + let waitingTimeout; + let toast = false; + let toastTimeout; + + function showLoading$1 (args) { + return callApiSync(showToast$1, args, 'showToast', 'showLoading') + } + + function hideLoading () { + return callApiSync(hideToast, Object.create(null), 'hideToast', 'hideLoading') + } + + function showToast$1 ({ + title = '', + icon = 'success', + image = '', + duration = 1500, + mask = false, + position = '' + } = {}) { + if (position) { + if (toast) { + toastTimeout && clearTimeout(toastTimeout); + plus.nativeUI.closeToast(); + } + if (waiting) { + waitingTimeout && clearTimeout(waitingTimeout); + waiting.close(); + } + if (~['top', 'center', 'bottom'].indexOf(position)) { + let richText = `${title}`; + plus.nativeUI.toast(richText, { + verticalAlign: position, + type: 'richtext' + }); + toast = true; + toastTimeout = setTimeout(() => { + hideToast(); + }, 2000); + return { + errMsg: 'showToast:ok' + } + } + console.warn('uni.showToast 传入的 "position" 值 "' + position + '" 无效'); + } + + if (duration) { + if (waiting) { + waitingTimeout && clearTimeout(waitingTimeout); + waiting.close(); + } + if (toast) { + toastTimeout && clearTimeout(toastTimeout); + plus.nativeUI.closeToast(); + } + if (icon && !~['success', 'loading', 'none'].indexOf(icon)) { + icon = 'success'; + } + const waitingOptions = { + modal: mask, + back: 'transmit', + padding: '10px', + size: '16px' // 固定字体大小 + }; + if (!image && (!icon || icon === 'none')) { // 无图 + // waitingOptions.width = '120px' + // waitingOptions.height = '40px' + waitingOptions.loading = { + display: 'none' + }; + } else { // 有图 + waitingOptions.width = '140px'; + waitingOptions.height = '112px'; + } + if (image) { + waitingOptions.loading = { + display: 'block', + height: '55px', + icon: image, + interval: duration + }; + } else { + if (icon === 'success') { + waitingOptions.loading = { + display: 'block', + height: '55px', + icon: '__uniappsuccess.png', + interval: duration + + }; + } + } + + waiting = plus.nativeUI.showWaiting(title, waitingOptions); + waitingTimeout = setTimeout(() => { + hideToast(); + }, duration); + } + return { + errMsg: 'showToast:ok' + } + } + + function hideToast () { + if (toast) { + toastTimeout && clearTimeout(toastTimeout); + plus.nativeUI.closeToast(); + toast = false; + } + if (waiting) { + waitingTimeout && clearTimeout(waitingTimeout); + waiting.close(); + waiting = null; + waitingTimeout = null; + } + return { + errMsg: 'hideToast:ok' + } + } + function showModal$1 ({ + title = '', + content = '', + showCancel = true, + cancelText = '取消', + cancelColor = '#000000', + confirmText = '确定', + confirmColor = '#3CC51F' + } = {}, callbackId) { + plus.nativeUI.confirm(content, (e) => { + if (showCancel) { + invoke(callbackId, { + errMsg: 'showModal:ok', + confirm: e.index === 1, + cancel: e.index === 0 || e.index === -1 + }); + } else { + invoke(callbackId, { + errMsg: 'showModal:ok', + confirm: e.index === 0, + cancel: false + }); + } + }, title, showCancel ? [cancelText, confirmText] : [confirmText]); + } + function showActionSheet$1 ({ + itemList = [], + itemColor = '#000000', + title = '' + }, callbackId) { + const options = { + buttons: itemList.map(item => ({ + title: item + })) + }; + if (title) { + options.title = title; + } + + if (plus.os.name === 'iOS') { + options.cancel = '取消'; + } + + plus.nativeUI.actionSheet(options, (e) => { + if (e.index > 0) { + invoke(callbackId, { + errMsg: 'showActionSheet:ok', + tapIndex: e.index - 1 + }); + } else { + invoke(callbackId, { + errMsg: 'showActionSheet:fail cancel' + }); + } + }); + } + + function setTabBarBadge$2 ({ + index, + text, + type + }) { + tabBar.setTabBarBadge(type, index, text); + return { + errMsg: 'setTabBarBadge:ok' + } + } + + function setTabBarItem$2 ({ + index, + text, + iconPath, + selectedIconPath + }) { + if (!isTabBarPage()) { + return { + errMsg: 'setTabBarItem:fail not TabBar page' + } + } + tabBar.setTabBarItem(index, text, iconPath, selectedIconPath); + return { + errMsg: 'setTabBarItem:ok' + } + } + + function setTabBarStyle$2 ({ + color, + selectedColor, + backgroundColor, + borderStyle + }) { + if (!isTabBarPage()) { + return { + errMsg: 'setTabBarStyle:fail not TabBar page' + } + } + tabBar.setTabBarStyle({ + color, + selectedColor, + backgroundColor, + borderStyle + }); + return { + errMsg: 'setTabBarStyle:ok' + } + } + + function hideTabBar$2 ({ + animation + }) { + if (!isTabBarPage()) { + return { + errMsg: 'hideTabBar:fail not TabBar page' + } + } + tabBar.hideTabBar(animation); + return { + errMsg: 'hideTabBar:ok' + } + } + + function showTabBar$2 ({ + animation + }) { + if (!isTabBarPage()) { + return { + errMsg: 'showTabBar:fail not TabBar page' + } + } + tabBar.showTabBar(animation); + return { + errMsg: 'showTabBar:ok' + } + } + + + + var appApi = /*#__PURE__*/Object.freeze({ + startPullDownRefresh: startPullDownRefresh, + stopPullDownRefresh: stopPullDownRefresh, + chooseVideo: chooseVideo$1, + createAudioInstance: createAudioInstance, + destroyAudioInstance: destroyAudioInstance, + setAudioState: setAudioState, + getAudioState: getAudioState, + operateAudio: operateAudio, + enableAccelerometer: enableAccelerometer, + addPhoneContact: addPhoneContact, + openBluetoothAdapter: openBluetoothAdapter, + closeBluetoothAdapter: closeBluetoothAdapter, + getBluetoothAdapterState: getBluetoothAdapterState, + startBluetoothDevicesDiscovery: startBluetoothDevicesDiscovery, + stopBluetoothDevicesDiscovery: stopBluetoothDevicesDiscovery, + getBluetoothDevices: getBluetoothDevices, + getConnectedBluetoothDevices: getConnectedBluetoothDevices, + createBLEConnection: createBLEConnection, + closeBLEConnection: closeBLEConnection, + getBLEDeviceServices: getBLEDeviceServices, + getBLEDeviceCharacteristics: getBLEDeviceCharacteristics, + notifyBLECharacteristicValueChange: notifyBLECharacteristicValueChange, + notifyBLECharacteristicValueChanged: notifyBLECharacteristicValueChanged, + readBLECharacteristicValue: readBLECharacteristicValue, + writeBLECharacteristicValue: writeBLECharacteristicValue, + getScreenBrightness: getScreenBrightness, + setScreenBrightness: setScreenBrightness, + setKeepScreenOn: setKeepScreenOn, + getClipboardData: getClipboardData, + setClipboardData: setClipboardData, + enableCompass: enableCompass, + getNetworkType: getNetworkType, + onBeaconUpdate: onBeaconUpdate, + onBeaconServiceChange: onBeaconServiceChange, + getBeacons: getBeacons, + startBeaconDiscovery: startBeaconDiscovery, + stopBeaconDiscovery: stopBeaconDiscovery, + makePhoneCall: makePhoneCall$1, + SCAN_ID: SCAN_ID, + SCAN_PATH: SCAN_PATH, + scanCode: scanCode, + getSystemInfoSync: getSystemInfoSync, + getSystemInfo: getSystemInfo, + vibrateLong: vibrateLong, + vibrateShort: vibrateShort, + saveFile: saveFile, + getSavedFileList: getSavedFileList, + getFileInfo: getFileInfo, + getSavedFileInfo: getSavedFileInfo, + removeSavedFile: removeSavedFile, + openDocument: openDocument$1, + chooseLocation: chooseLocation, + getLocation: getLocation$1, + openLocation: openLocation$1, + startRecord: startRecord, + stopRecord: stopRecord, + playVoice: playVoice, + pauseVoice: pauseVoice, + stopVoice: stopVoice, + chooseImage: chooseImage$1, + getMusicPlayerState: getMusicPlayerState, + operateMusicPlayer: operateMusicPlayer, + setBackgroundAudioState: setBackgroundAudioState, + operateBackgroundAudio: operateBackgroundAudio, + getBackgroundAudioState: getBackgroundAudioState, + compressImage: compressImage, + getImageInfo: getImageInfo$1, + previewImage: previewImage$1, + operateRecorder: operateRecorder, + saveImageToPhotosAlbum: saveImageToPhotosAlbum, + saveVideoToPhotosAlbum: saveVideoToPhotosAlbum, + operateDownloadTask: operateDownloadTask, + createDownloadTask: createDownloadTask, + createRequestTaskById: createRequestTaskById, + createRequestTask: createRequestTask, + operateRequestTask: operateRequestTask, + createSocketTask: createSocketTask, + operateSocketTask: operateSocketTask, + operateUploadTask: operateUploadTask, + createUploadTask: createUploadTask, + getProvider: getProvider$1, + login: login, + operateWXData: operateWXData, + requestPayment: requestPayment, + subscribePush: subscribePush, + unsubscribePush: unsubscribePush, + onPush: onPush, + offPush: offPush, + shareAppMessageDirectly: shareAppMessageDirectly, + share: share, + $on: $on, + $off: $off, + $once: $once, + $emit: $emit, + showKeyboard: showKeyboard, + hideKeyboard: hideKeyboard, + setNavigationBarTitle: setNavigationBarTitle$1, + showNavigationBarLoading: showNavigationBarLoading, + hideNavigationBarLoading: hideNavigationBarLoading, + setNavigationBarColor: setNavigationBarColor$1, + showLoading: showLoading$1, + hideLoading: hideLoading, + showToast: showToast$1, + hideToast: hideToast, + showModal: showModal$1, + showActionSheet: showActionSheet$1, + setTabBarBadge: setTabBarBadge$2, + setTabBarItem: setTabBarItem$2, + setTabBarStyle: setTabBarStyle$2, + hideTabBar: hideTabBar$2, + showTabBar: showTabBar$2 + }); + + const SUCCESS = 'success'; + const FAIL = 'fail'; + const COMPLETE = 'complete'; + const CALLBACKS = [SUCCESS, FAIL, COMPLETE]; + + /** + * 调用无参数,或仅一个参数且为 callback 的 API + * @param {Object} vm + * @param {Object} method + * @param {Object} args + * @param {Object} extras + */ + function invokeVmMethodWithoutArgs (vm, method, args, extras) { + if (!vm) { + return + } + if (typeof args === 'undefined') { + return vm[method]() + } + const [, callbacks] = normalizeArgs(args, extras); + if (!Object.keys(callbacks).length) { + return vm[method]() + } + return vm[method](normalizeCallback(method, callbacks)) + } + /** + * 调用两个参数(第一个入参为普通参数,第二个入参为 callback) API + * @param {Object} vm + * @param {Object} method + * @param {Object} args + * @param {Object} extras + */ + function invokeVmMethod (vm, method, args, extras) { + if (!vm) { + return + } + const [pureArgs, callbacks] = normalizeArgs(args, extras); + if (!Object.keys(callbacks).length) { + return vm[method](pureArgs) + } + return vm[method](pureArgs, normalizeCallback(method, callbacks)) + } + + function findElmById (id, vm) { + return findElmByVNode(id, vm._vnode) + } + + function findElmByVNode (id, vnode) { + if (!id || !vnode) { + return + } + if ( + vnode.data && + vnode.data.attrs && + vnode.data.attrs.id === id + ) { + return vnode.elm + } + const children = vnode.children; + if (!children) { + return + } + for (let i = 0, len = children.length; i < len; i++) { + const elm = findElmByVNode(id, children[i]); + if (elm) { + return elm + } + } + } + + function normalizeArgs (args = {}, extras) { + const callbacks = Object.create(null); + + const iterator = function iterator (name) { + const callback = args[name]; + if (isFn(callback)) { + callbacks[name] = callback; + delete args[name]; + } + }; + + CALLBACKS.forEach(iterator); + + extras && extras.forEach(iterator); + + return [args, callbacks] + } + + function normalizeCallback (method, callbacks) { + return function weexCallback (ret) { + const type = ret.type; + delete ret.type; + const callback = callbacks[type]; + + if (type === SUCCESS) { + ret.errMsg = `${method}:ok`; + } else if (type === FAIL) { + ret.errMsg = method + ':fail' + (ret.msg ? (' ' + ret.msg) : ''); + } + + delete ret.code; + delete ret.msg; + + isFn(callback) && callback(ret); + + if (type === SUCCESS || type === FAIL) { + const complete = callbacks['complete']; + isFn(complete) && complete(ret); + } + } + } + + class LivePusherContext { + constructor (id, ctx) { + this.id = id; + this.ctx = ctx; + } + + start (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'start', cbs) + } + + stop (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'stop', cbs) + } + + pause (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'pause', cbs) + } + + resume (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'resume', cbs) + } + + switchCamera (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'switchCamera', cbs) + } + + snapshot (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'snapshot', cbs) + } + + toggleTorch (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'toggleTorch', cbs) + } + + playBGM (args) { + return invokeVmMethod(this.ctx, 'playBGM', args) + } + + stopBGM (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'stopBGM', cbs) + } + + pauseBGM (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'pauseBGM', cbs) + } + + resumeBGM (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'resumeBGM', cbs) + } + + setBGMVolume (cbs) { + return invokeVmMethod(this.ctx, 'setBGMVolume', cbs) + } + + startPreview (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'startPreview', cbs) + } + + stopPreview (args) { + return invokeVmMethodWithoutArgs(this.ctx, 'stopPreview', args) + } + } + + function createLivePusherContext (id, vm) { + if (!vm) { + return console.warn('uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)') + } + const elm = findElmById(id, vm); + if (!elm) { + return console.warn('Can not find `' + id + '`') + } + return new LivePusherContext(id, elm) + } + + class MapContext { + constructor (id, ctx) { + this.id = id; + this.ctx = ctx; + } + + getCenterLocation (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'getCenterLocation', cbs) + } + + moveToLocation () { + return invokeVmMethodWithoutArgs(this.ctx, 'moveToLocation') + } + + translateMarker (args) { + return invokeVmMethod(this.ctx, 'translateMarker', args, ['animationEnd']) + } + + includePoints (args) { + return invokeVmMethod(this.ctx, 'includePoints', args) + } + + getRegion (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'getRegion', cbs) + } + + getScale (cbs) { + return invokeVmMethodWithoutArgs(this.ctx, 'getScale', cbs) + } + } + + function createMapContext$1 (id, vm) { + if (!vm) { + return console.warn('uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)') + } + const elm = findElmById(id, vm); + if (!elm) { + return console.warn('Can not find `' + id + '`') + } + return new MapContext(id, elm) + } + + class VideoContext { + constructor (id, ctx) { + this.id = id; + this.ctx = ctx; + } + + play () { + return invokeVmMethodWithoutArgs(this.ctx, 'play') + } + + pause () { + return invokeVmMethodWithoutArgs(this.ctx, 'pause') + } + + seek (args) { + return invokeVmMethod(this.ctx, 'seek', args) + } + + stop () { + return invokeVmMethodWithoutArgs(this.ctx, 'stop') + } + + sendDanmu (args) { + return invokeVmMethod(this.ctx, 'sendDanmu', args) + } + + playbackRate (args) { + return invokeVmMethod(this.ctx, 'playbackRate', args) + } + + requestFullScreen (args) { + return invokeVmMethod(this.ctx, 'requestFullScreen', args) + } + + exitFullScreen () { + return invokeVmMethodWithoutArgs(this.ctx, 'exitFullScreen') + } + + showStatusBar () { + return invokeVmMethodWithoutArgs(this.ctx, 'showStatusBar') + } + + hideStatusBar () { + return invokeVmMethodWithoutArgs(this.ctx, 'hideStatusBar') + } + } + + function createVideoContext$1 (id, vm) { + if (!vm) { + return console.warn('uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)') + } + const elm = findElmById(id, vm); + if (!elm) { + return console.warn('Can not find `' + id + '`') + } + return new VideoContext(id, elm) + } + + function requireNativePlugin$1 (name) { + return weex.requireModule(name) + } + + const ANI_DURATION$1 = 300; + const ANI_SHOW$1 = 'pop-in'; + + function showWebview (webview, animationType, animationDuration) { + setTimeout(() => { + webview.show( + animationType || ANI_SHOW$1, + animationDuration || ANI_DURATION$1, + () => { + console.log('show.callback'); + } + ); + }, 50); + } + + let firstBackTime = 0; + + function quit () { + if (!firstBackTime) { + firstBackTime = Date.now(); + plus.nativeUI.toast('再按一次退出应用'); + setTimeout(() => { + firstBackTime = null; + }, 2000); + } else if (Date.now() - firstBackTime < 2000) { + plus.runtime.quit(); + } + } + + function backWebview (webview, callback) { + if (!webview.__uniapp_webview) { + return callback() + } + const children = webview.children(); + if (!children || !children.length) { // 有子 webview + return callback() + } + const childWebview = children[0]; + childWebview.canBack(({ + canBack + }) => { + if (canBack) { + childWebview.back(); // webview 返回 + } else { + callback(); + } + }); + } + + function back (delta, animationType, animationDuration) { + const pages = getCurrentPages(); + const len = pages.length; + const currentPage = pages[len - 1]; + + if (delta > 1) { + // 中间页隐藏 + pages.slice(len - delta, len - 1).reverse().forEach(deltaPage => { + deltaPage.$getAppWebview().close('none'); + }); + } + + backWebview(currentPage, () => { + if (animationType) { + currentPage.$getAppWebview().close(animationType, animationDuration || ANI_DURATION$1); + } else { + currentPage.$getAppWebview().close('auto'); + } + // 移除所有 page + pages.splice(len - delta, len); + + setStatusBarStyle(); + + UniServiceJSBridge.emit('onAppRoute', { + type: 'navigateBack' + }); + }); + } + + function navigateBack$1 ({ + delta, + animationType, + animationDuration + }) { + const pages = getCurrentPages(); + const len = pages.length; + + uni.hideToast(); // 后退时,关闭 toast,loading + + pages[len - 1].$page.meta.isQuit + ? quit() + : back(Math.min(len - 1, delta), animationType, animationDuration); + } + + function navigateTo$1 ({ + url, + animationType, + animationDuration + }) { + const urls = url.split('?'); + const path = urls[0]; + + const query = parseQuery(urls[1] || ''); + + UniServiceJSBridge.emit('onAppRoute', { + type: 'navigateTo', + path + }); + + showWebview( + __registerPage({ + path, + query + }), + animationType, + animationDuration + ); + + setStatusBarStyle(); + } + + function reLaunch$1 ({ + path + }) {} + + function redirectTo$1 ({ + path + }) {} + + function switchTab$1 ({ + path + }) {} + + + + var nvueApi = /*#__PURE__*/Object.freeze({ + createLivePusherContext: createLivePusherContext, + createMapContext: createMapContext$1, + createVideoContext: createVideoContext$1, + requireNativePlugin: requireNativePlugin$1, + navigateBack: navigateBack$1, + navigateTo: navigateTo$1, + reLaunch: reLaunch$1, + redirectTo: redirectTo$1, + switchTab: switchTab$1 + }); + + var platformApi = Object.assign(Object.create(null), appApi, nvueApi); + + /** + * 执行内部平台方法 + */ + function invokeMethod (name, ...args) { + return platformApi[name].apply(null, args) + } + /** + * 监听 service 层内部平台方法回调,与 publish 对应 + * @param {Object} name + * @param {Object} callback + */ + function onMethod (name, callback) { + return UniServiceJSBridge.on('api.' + name, callback) + } + + const requestTasks$1 = Object.create(null); + + function formatResponse (res, args) { + if ( + typeof res.data === 'string' && + res.data.charCodeAt(0) === 65279 + ) { + res.data = res.data.substr(1); + } + + res.statusCode = parseInt(res.statusCode, 10); + + if (isPlainObject(res.header)) { + res.header = Object.keys(res.header).reduce(function (ret, key) { + const value = res.header[key]; + if (Array.isArray(value)) { + ret[key] = value.join(','); + } else if (typeof value === 'string') { + ret[key] = value; + } + return ret + }, {}); + } + + if (args.dataType && args.dataType.toLowerCase() === 'json') { + try { + res.data = JSON.parse(res.data); + } catch (e) {} + } + + return res + } + + onMethod('onRequestTaskStateChange', function ({ + requestTaskId, + state, + data, + statusCode, + header, + errMsg + }) { + const { + args, + callbackId + } = requestTasks$1[requestTaskId]; + + if (!callbackId) { + return + } + delete requestTasks$1[requestTaskId]; + switch (state) { + case 'success': + invoke(callbackId, formatResponse({ + data, + statusCode, + header, + errMsg: 'request:ok' + }, args)); + break + case 'fail': + invoke(callbackId, { + errMsg: 'request:fail ' + errMsg + }); + break + } + }); + + class RequestTask { + constructor (id) { + this.id = id; + } + + abort () { + invokeMethod('operateRequestTask', { + requestTaskId: this.id, + operationType: 'abort' + }); + } + + offHeadersReceived () { + + } + + onHeadersReceived () { + + } + } + + function request$1 (args, callbackId) { + const { + requestTaskId + } = invokeMethod('createRequestTask', args); + + requestTasks$1[requestTaskId] = { + args, + callbackId + }; + + return new RequestTask(requestTaskId) + } + + var require_context_module_1_4 = /*#__PURE__*/Object.freeze({ + request: request$1 + }); + + function setStorage$1 ({ + key, + data + } = {}) { + const value = { + type: typeof data === 'object' ? 'object' : 'string', + data: data + }; + localStorage.setItem(key, JSON.stringify(value)); + const keyList = localStorage.getItem('uni-storage-keys'); + if (!keyList) { + localStorage.setItem('uni-storage-keys', JSON.stringify([key])); + } else { + const keys = JSON.parse(keyList); + if (keys.indexOf(key) < 0) { + keys.push(key); + localStorage.setItem('uni-storage-keys', JSON.stringify(keys)); + } + } + return { + errMsg: 'setStorage:ok' + } + } + + function setStorageSync$1 (key, data) { + setStorage$1({ + key, + data + }); + } + + function getStorage ({ + key + } = {}) { + const data = localStorage.getItem(key); + return data ? { + data: JSON.parse(data).data, + errMsg: 'getStorage:ok' + } : { + data: '', + errMsg: 'getStorage:fail' + } + } + + function getStorageSync (key) { + const res = getStorage({ + key + }); + return res.data + } + + function removeStorage ({ + key + } = {}) { + const keyList = localStorage.getItem('uni-storage-keys'); + if (keyList) { + const keys = JSON.parse(keyList); + const index = keys.indexOf(key); + keys.splice(index, 1); + localStorage.setItem('uni-storage-keys', JSON.stringify(keys)); + } + localStorage.removeItem(key); + return { + errMsg: 'removeStorage:ok' + } + } + + function removeStorageSync (key) { + removeStorage({ + key + }); + } + + function clearStorage () { + localStorage.clear(); + return { + errMsg: 'clearStorage:ok' + } + } + + function clearStorageSync () { + clearStorage(); + } + + function getStorageInfo () { // TODO 暂时先不做大小的转换 + const keyList = localStorage.getItem('uni-storage-keys'); + return keyList ? { + keys: JSON.parse(keyList), + currentSize: 0, + limitSize: 0, + errMsg: 'getStorageInfo:ok' + } : { + keys: '', + currentSize: 0, + limitSize: 0, + errMsg: 'getStorageInfo:fail' + } + } + + function getStorageInfoSync () { + const res = getStorageInfo(); + delete res.errMsg; + return res + } + + var require_context_module_1_5 = /*#__PURE__*/Object.freeze({ + setStorage: setStorage$1, + setStorageSync: setStorageSync$1, + getStorage: getStorage, + getStorageSync: getStorageSync, + removeStorage: removeStorage, + removeStorageSync: removeStorageSync, + clearStorage: clearStorage, + clearStorageSync: clearStorageSync, + getStorageInfo: getStorageInfo, + getStorageInfoSync: getStorageInfoSync + }); + + function pageScrollTo$1 (args) { + const pages = getCurrentPages(); + if (pages.length) { + UniServiceJSBridge.publishHandler('pageScrollTo', args, pages[pages.length - 1].$page.id); + } + return {} + } + + var require_context_module_1_6 = /*#__PURE__*/Object.freeze({ + pageScrollTo: pageScrollTo$1 + }); + + const api = Object.create(null); + + const modules$1 = + (function() { + var map = { + './base/base64.js': require_context_module_1_0, + './base/can-i-use.js': require_context_module_1_1, + './base/interceptor.js': require_context_module_1_2, + './base/upx2px.js': require_context_module_1_3, + './network/request.js': require_context_module_1_4, + './storage/storage.js': require_context_module_1_5, + './ui/page-scroll-to.js': require_context_module_1_6, + + }; + var req = function req(key) { + return map[key] || (function() { throw new Error("Cannot find module '" + key + "'.") }()); + }; + req.keys = function() { + return Object.keys(map); + }; + return req; + })(); + + + modules$1.keys().forEach(function (key) { + Object.assign(api, modules$1(key)); + }); + + const api$1 = Object.assign(Object.create(null), api, platformApi); + + const uni$1 = Object.create(null); + + apis.forEach(name => { + if (api$1[name]) { + uni$1[name] = promisify(name, wrapper(name, api$1[name])); + } else { + uni$1[name] = wrapperUnimplemented(name); + } + }); + + UniServiceJSBridge.publishHandler = UniServiceJSBridge.emit; // TODO + UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler; + + var index = { + __registerConfig: registerConfig, + __registerApp: registerApp, + __registerPage: registerPage, uni: uni$1, getApp, - getCurrentPages, - UniServiceJSBridge - } -} + getCurrentPages: getCurrentPages$1 + }; + + return index; -export { createInstanceContext }; +}()); + +var uni = serviceContext.uni +var getApp = serviceContext.getApp +var getCurrentPages = serviceContext.getCurrentPages + +var __registerPage = serviceContext.__registerPage + +return serviceContext +} diff --git a/packages/uni-app-plus-nvue/dist/index.legacy.js b/packages/uni-app-plus-nvue/dist/index.legacy.js index b0a33bd721..72d5a986b8 100644 --- a/packages/uni-app-plus-nvue/dist/index.legacy.js +++ b/packages/uni-app-plus-nvue/dist/index.legacy.js @@ -1,3 +1,15 @@ +let supportsPassive = false; +try { + const opts = {}; + Object.defineProperty(opts, 'passive', ({ + get () { + /* istanbul ignore next */ + supportsPassive = true; + } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); +} catch (e) {} + const hasOwnProperty = Object.prototype.hasOwnProperty; function isFn (fn) { diff --git a/packages/uni-app-plus-nvue/dist/uni.js b/packages/uni-app-plus-nvue/dist/uni.js deleted file mode 100644 index 838887ec08..0000000000 --- a/packages/uni-app-plus-nvue/dist/uni.js +++ /dev/null @@ -1,2786 +0,0 @@ -export function createUniInstance(weex, plus, __uniConfig, __uniRoutes, __registerPage, UniServiceJSBridge, getApp, getCurrentPages){ -var localStorage = plus.storage - -const _toString = Object.prototype.toString; -const hasOwnProperty = Object.prototype.hasOwnProperty; - -function isFn (fn) { - return typeof fn === 'function' -} - -function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' -} - -function hasOwn (obj, key) { - return hasOwnProperty.call(obj, key) -} - -function toRawType (val) { - return _toString.call(val).slice(8, -1) -} - -function getLen (str = '') { - /* eslint-disable no-control-regex */ - return ('' + str).replace(/[^\x00-\xff]/g, '**').length -} - -/** - * 框架内 try-catch - */ -function tryCatchFramework (fn) { - return function () { - try { - return fn.apply(fn, arguments) - } catch (e) { - // TODO - console.error(e); - } - } -} -/** - * 开发者 try-catch - */ -function tryCatch (fn) { - return function () { - try { - return fn.apply(fn, arguments) - } catch (e) { - // TODO - console.error(e); - } - } -} - -const HOOKS = [ - 'invoke', - 'success', - 'fail', - 'complete', - 'returnValue' -]; - -const globalInterceptors = {}; -const scopedInterceptors = {}; - -function mergeHook (parentVal, childVal) { - const res = childVal - ? parentVal - ? parentVal.concat(childVal) - : Array.isArray(childVal) - ? childVal : [childVal] - : parentVal; - return res - ? dedupeHooks(res) - : res -} - -function dedupeHooks (hooks) { - const res = []; - for (let i = 0; i < hooks.length; i++) { - if (res.indexOf(hooks[i]) === -1) { - res.push(hooks[i]); - } - } - return res -} - -function removeHook (hooks, hook) { - const index = hooks.indexOf(hook); - if (index !== -1) { - hooks.splice(index, 1); - } -} - -function mergeInterceptorHook (interceptor, option) { - Object.keys(option).forEach(hook => { - if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) { - interceptor[hook] = mergeHook(interceptor[hook], option[hook]); - } - }); -} - -function removeInterceptorHook (interceptor, option) { - if (!interceptor || !option) { - return - } - Object.keys(option).forEach(hook => { - if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) { - removeHook(interceptor[hook], option[hook]); - } - }); -} - -function addInterceptor (method, option) { - if (typeof method === 'string' && isPlainObject(option)) { - mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option); - } else if (isPlainObject(method)) { - mergeInterceptorHook(globalInterceptors, method); - } -} - -function removeInterceptor (method, option) { - if (typeof method === 'string') { - if (isPlainObject(option)) { - removeInterceptorHook(scopedInterceptors[method], option); - } else { - delete scopedInterceptors[method]; - } - } else if (isPlainObject(method)) { - removeInterceptorHook(globalInterceptors, method); - } -} - -function wrapperHook (hook) { - return function (data) { - return hook(data) || data - } -} - -function isPromise (obj) { - return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function' -} - -function queue (hooks, data) { - let promise = false; - for (let i = 0; i < hooks.length; i++) { - const hook = hooks[i]; - if (promise) { - promise = Promise.then(wrapperHook(hook)); - } else { - const res = hook(data); - if (isPromise(res)) { - promise = Promise.resolve(res); - } - if (res === false) { - return { - then () {} - } - } - } - } - return promise || { - then (callback) { - return callback(data) - } - } -} - -function wrapperOptions (interceptor, options = {}) { - ['success', 'fail', 'complete'].forEach(name => { - if (Array.isArray(interceptor[name])) { - const oldCallback = options[name]; - options[name] = function callbackInterceptor (res) { - queue(interceptor[name], res).then((res) => { - /* eslint-disable no-mixed-operators */ - return isFn(oldCallback) && oldCallback(res) || res - }); - }; - } - }); - return options -} - -function wrapperReturnValue (method, returnValue) { - const returnValueHooks = []; - if (Array.isArray(globalInterceptors.returnValue)) { - returnValueHooks.push(...globalInterceptors.returnValue); - } - const interceptor = scopedInterceptors[method]; - if (interceptor && Array.isArray(interceptor.returnValue)) { - returnValueHooks.push(...interceptor.returnValue); - } - returnValueHooks.forEach(hook => { - returnValue = hook(returnValue) || returnValue; - }); - return returnValue -} - -function getApiInterceptorHooks (method) { - const interceptor = Object.create(null); - Object.keys(globalInterceptors).forEach(hook => { - if (hook !== 'returnValue') { - interceptor[hook] = globalInterceptors[hook].slice(); - } - }); - const scopedInterceptor = scopedInterceptors[method]; - if (scopedInterceptor) { - Object.keys(scopedInterceptor).forEach(hook => { - if (hook !== 'returnValue') { - interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]); - } - }); - } - return interceptor -} - -function invokeApi (method, api, options, ...params) { - const interceptor = getApiInterceptorHooks(method); - if (interceptor && Object.keys(interceptor).length) { - if (Array.isArray(interceptor.invoke)) { - const res = queue(interceptor.invoke, options); - return res.then((options) => { - return api(wrapperOptions(interceptor, options), ...params) - }) - } else { - return api(wrapperOptions(interceptor, options), ...params) - } - } - return api(options, ...params) -} - -const promiseInterceptor = { - returnValue (res) { - if (!isPromise(res)) { - return res - } - return res.then(res => { - return res[1] - }).catch(res => { - return res[0] - }) - } -}; - -const SYNC_API_RE = - /^\$|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; - -const CONTEXT_API_RE = /^create|Manager$/; - -const TASK_APIS = ['request', 'downloadFile', 'uploadFile', 'connectSocket']; - -const CALLBACK_API_RE = /^on/; - -function isContextApi (name) { - return CONTEXT_API_RE.test(name) -} -function isSyncApi (name) { - return SYNC_API_RE.test(name) -} - -function isCallbackApi (name) { - return CALLBACK_API_RE.test(name) -} - -function isTaskApi (name) { - return TASK_APIS.indexOf(name) !== -1 -} - -function handlePromise (promise) { - return promise.then(data => { - return [null, data] - }) - .catch(err => [err]) -} - -function shouldPromise (name) { - if ( - isContextApi(name) || - isSyncApi(name) || - isCallbackApi(name) - ) { - return false - } - return true -} - -function promisify (name, api) { - if (!shouldPromise(name)) { - return api - } - return function promiseApi (options = {}, ...params) { - if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) { - return wrapperReturnValue(name, invokeApi(name, api, options, ...params)) - } - return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => { - invokeApi(name, api, Object.assign({}, options, { - success: resolve, - fail: reject - }), ...params); - /* eslint-disable no-extend-native */ - if (!Promise.prototype.finally) { - Promise.prototype.finally = function (callback) { - const promise = this.constructor; - return this.then( - value => promise.resolve(callback()).then(() => value), - reason => promise.resolve(callback()).then(() => { - throw reason - }) - ) - }; - } - }))) - } -} - -const canIUse = [{ - name: 'schema', - type: String, - required: true -}]; - -var require_context_module_1_0 = /*#__PURE__*/Object.freeze({ - canIUse: canIUse -}); - -const base64ToArrayBuffer = [{ - name: 'base64', - type: String, - required: true -}]; - -const arrayBufferToBase64 = [{ - name: 'arrayBuffer', - type: [ArrayBuffer, Uint8Array], - required: true -}]; - -var require_context_module_1_1 = /*#__PURE__*/Object.freeze({ - base64ToArrayBuffer: base64ToArrayBuffer, - arrayBufferToBase64: arrayBufferToBase64 -}); - -function getInt (method) { - return function (value, params) { - if (value) { - params[method] = Math.round(value); - } - } -} - -const canvasGetImageData = { - canvasId: { - type: String, - required: true - }, - x: { - type: Number, - required: true, - validator: getInt('x') - }, - y: { - type: Number, - required: true, - validator: getInt('y') - }, - width: { - type: Number, - required: true, - validator: getInt('width') - }, - height: { - type: Number, - required: true, - validator: getInt('height') - } -}; - -const canvasPutImageData = { - canvasId: { - type: String, - required: true - }, - data: { - type: Uint8ClampedArray, - required: true - }, - x: { - type: Number, - required: true, - validator: getInt('x') - }, - y: { - type: Number, - required: true, - validator: getInt('y') - }, - width: { - type: Number, - required: true, - validator: getInt('width') - }, - height: { - type: Number, - validator: getInt('height') - } -}; - -const fileType = { - PNG: 'png', - JPG: 'jpeg' -}; - -const canvasToTempFilePath = { - x: { - type: Number, - default: 0, - validator: getInt('x') - }, - y: { - type: Number, - default: 0, - validator: getInt('y') - }, - width: { - type: Number, - validator: getInt('width') - }, - height: { - type: Number, - validator: getInt('height') - }, - destWidth: { - type: Number, - validator: getInt('destWidth') - }, - destHeight: { - type: Number, - validator: getInt('destHeight') - }, - canvasId: { - type: String, - require: true - }, - fileType: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase(); - params.fileType = value in fileType ? fileType[value] : fileType.PNG; - } - }, - quality: { - type: Number, - validator (value, params) { - value = Math.floor(value); - params.quality = value > 0 && value < 1 ? value : 1; - } - } -}; - -const drawCanvas = { - canvasId: { - type: String, - require: true - }, - actions: { - type: Array, - require: true - }, - reserve: { - type: Boolean, - default: false - } -}; - -var require_context_module_1_2 = /*#__PURE__*/Object.freeze({ - canvasGetImageData: canvasGetImageData, - canvasPutImageData: canvasPutImageData, - canvasToTempFilePath: canvasToTempFilePath, - drawCanvas: drawCanvas -}); - -const validator = [{ - name: 'id', - type: String, - required: true -}]; - -const createAudioContext = validator; -const createVideoContext = validator; -const createMapContext = validator; -const createCanvasContext = [{ - name: 'canvasId', - type: String, - required: true -}, { - name: 'componentInstance', - type: Object -}]; - -var require_context_module_1_3 = /*#__PURE__*/Object.freeze({ - createAudioContext: createAudioContext, - createVideoContext: createVideoContext, - createMapContext: createMapContext, - createCanvasContext: createCanvasContext -}); - -const makePhoneCall = { - 'phoneNumber': { - type: String, - required: true, - validator (phoneNumber) { - if (!phoneNumber) { - return `makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;` - } - } - } -}; - -var require_context_module_1_4 = /*#__PURE__*/Object.freeze({ - makePhoneCall: makePhoneCall -}); - -const openDocument = { - filePath: { - type: String, - required: true - }, - fileType: { - type: String - } -}; - -var require_context_module_1_5 = /*#__PURE__*/Object.freeze({ - openDocument: openDocument -}); - -const type = { - WGS84: 'WGS84', - GCJ02: 'GCJ02' -}; -const getLocation = { - type: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase(); - params.type = Object.values(type).indexOf(value) < 0 ? type.WGS84 : value; - }, - default: type.WGS84 - }, - altitude: { - altitude: Boolean, - default: false - } -}; -const openLocation = { - latitude: { - type: Number, - required: true - }, - longitude: { - type: Number, - required: true - }, - scale: { - type: Number, - validator (value, params) { - value = Math.floor(value); - params.scale = value >= 5 && value <= 18 ? value : 18; - }, - default: 18 - }, - name: { - type: String - }, - address: { - type: String - } -}; - -var require_context_module_1_6 = /*#__PURE__*/Object.freeze({ - getLocation: getLocation, - openLocation: openLocation -}); - -const SIZE_TYPES = ['original', 'compressed']; -const SOURCE_TYPES = ['album', 'camera']; - -const chooseImage = { - 'count': { - type: Number, - required: false, - default: 9, - validator (count, params) { - if (count <= 0) { - params.count = 9; - } - } - }, - 'sizeType': { - type: Array, - required: false, - default: SIZE_TYPES, - validator (sizeType, params) { - // 非必传的参数,不符合预期时处理为默认值。 - const length = sizeType.length; - if (!length) { - params.sizeType = SIZE_TYPES; - } else { - for (let i = 0; i < length; i++) { - if (typeof sizeType[i] !== 'string' || !~SIZE_TYPES.indexOf(sizeType[i])) { - params.sizeType = SIZE_TYPES; - break - } - } - } - } - }, - 'sourceType': { - type: Array, - required: false, - default: SOURCE_TYPES, - validator (sourceType, params) { - const length = sourceType.length; - if (!length) { - params.sourceType = SOURCE_TYPES; - } else { - for (let i = 0; i < length; i++) { - if (typeof sourceType[i] !== 'string' || !~SOURCE_TYPES.indexOf(sourceType[i])) { - params.sourceType = SOURCE_TYPES; - break - } - } - } - } - } -}; - -var require_context_module_1_7 = /*#__PURE__*/Object.freeze({ - chooseImage: chooseImage -}); - -const SOURCE_TYPES$1 = ['album', 'camera']; - -const chooseVideo = { - 'sourceType': { - type: Array, - required: false, - default: SOURCE_TYPES$1, - validator (sourceType, params) { - const length = sourceType.length; - if (!length) { - params.sourceType = SOURCE_TYPES$1; - } else { - for (let i = 0; i < length; i++) { - if (typeof sourceType[i] !== 'string' || !~SOURCE_TYPES$1.indexOf(sourceType[i])) { - params.sourceType = SOURCE_TYPES$1; - break - } - } - } - } - } -}; - -var require_context_module_1_8 = /*#__PURE__*/Object.freeze({ - chooseVideo: chooseVideo -}); - -function getRealRoute (fromRoute, toRoute) { - if (!toRoute) { - toRoute = fromRoute; - if (toRoute.indexOf('/') === 0) { - return toRoute - } - const pages = getCurrentPages(); - if (pages.length) { - fromRoute = pages[pages.length - 1].$page.route; - } else { - fromRoute = ''; - } - } else { - if (toRoute.indexOf('/') === 0) { - return toRoute - } - } - if (toRoute.indexOf('./') === 0) { - return getRealRoute(fromRoute, toRoute.substr(2)) - } - const toRouteArray = toRoute.split('/'); - const toRouteLength = toRouteArray.length; - let i = 0; - for (; i < toRouteLength && toRouteArray[i] === '..'; i++) { - // noop - } - toRouteArray.splice(0, i); - toRoute = toRouteArray.join('/'); - const fromRouteArray = fromRoute.length > 0 ? fromRoute.split('/') : []; - fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); - return '/' + fromRouteArray.concat(toRouteArray).join('/') -} - -const SCHEME_RE = /^([a-z-]+:)?\/\//i; -const BASE64_RE = /^data:[a-z-]+\/[a-z-]+;base64,/; - -function addBase (filePath) { - return filePath -} - -function getRealPath (filePath) { - if (filePath.indexOf('/') === 0) { - if (filePath.indexOf('//') === 0) { - filePath = 'https:' + filePath; - } else { - return addBase(filePath.substr(1)) - } - } - // 网络资源或base64 - if (SCHEME_RE.test(filePath) || BASE64_RE.test(filePath) || filePath.indexOf('blob:') === 0) { - return filePath - } - - const pages = getCurrentPages(); - if (pages.length) { - return addBase(getRealRoute(pages[pages.length - 1].$page.route, filePath).substr(1)) - } - - return filePath -} - -const getImageInfo = { - 'src': { - type: String, - required: true, - validator (src, params) { - params.src = getRealPath(src); - } - } -}; - -var require_context_module_1_9 = /*#__PURE__*/Object.freeze({ - getImageInfo: getImageInfo -}); - -const previewImage = { - urls: { - type: Array, - required: true, - validator (value, params) { - var typeError; - params.urls = value.map(url => { - if (typeof url === 'string') { - return getRealPath(url) - } else { - typeError = true; - } - }); - if (typeError) { - return 'url is not string' - } - } - }, - current: { - type: [String, Number], - validator (value, params) { - if (typeof value === 'number') { - params.current = value > 0 && value < params.urls.length ? value : 0; - } else if (typeof value === 'string' && value) { - params.current = getRealPath(value); - } - }, - default: 0 - } -}; - -var require_context_module_1_10 = /*#__PURE__*/Object.freeze({ - previewImage: previewImage -}); - -const FRONT_COLORS = ['#ffffff', '#000000']; -const setNavigationBarColor = { - 'frontColor': { - type: String, - required: true, - validator (frontColor, params) { - if (FRONT_COLORS.indexOf(frontColor) === -1) { - return `invalid frontColor "${frontColor}"` - } - } - }, - 'backgroundColor': { - type: String, - required: true - }, - 'animation': { - type: Object, - default () { - return { - duration: 0, - timingFunc: 'linear' - } - }, - validator (animation = {}, params) { - params.animation = { - duration: animation.duration || 0, - timingFunc: animation.timingFunc || 'linear' - }; - } - } -}; -const setNavigationBarTitle = { - 'title': { - type: String, - required: true - } -}; - -var require_context_module_1_11 = /*#__PURE__*/Object.freeze({ - setNavigationBarColor: setNavigationBarColor, - setNavigationBarTitle: setNavigationBarTitle -}); - -const downloadFile = { - url: { - type: String, - required: true - }, - header: { - type: Object, - validator (value, params) { - params.header = value || {}; - } - } -}; - -var require_context_module_1_12 = /*#__PURE__*/Object.freeze({ - downloadFile: downloadFile -}); - -const method = { - OPTIONS: 'OPTIONS', - GET: 'GET', - HEAD: 'HEAD', - POST: 'POST', - PUT: 'PUT', - DELETE: 'DELETE', - TRACE: 'TRACE', - CONNECT: 'CONNECT' -}; -const dataType = { - JSON: 'JSON' -}; -const responseType = { - TEXT: 'TEXT', - ARRAYBUFFER: 'ARRAYBUFFER' -}; -const request = { - url: { - type: String, - required: true - }, - data: { - type: [Object, String, ArrayBuffer], - validator (value, params) { - params.data = value || ''; - } - }, - header: { - type: Object, - validator (value, params) { - params.header = value || {}; - } - }, - method: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase(); - params.method = Object.values(method).indexOf(value) < 0 ? method.GET : value; - } - }, - dataType: { - type: String, - validator (value, params) { - params.dataType = (value || dataType.JSON).toUpperCase(); - } - }, - responseType: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase(); - params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value; - } - } -}; - -var require_context_module_1_13 = /*#__PURE__*/Object.freeze({ - request: request -}); - -const method$1 = { - OPTIONS: 'OPTIONS', - GET: 'GET', - HEAD: 'HEAD', - POST: 'POST', - PUT: 'PUT', - DELETE: 'DELETE', - TRACE: 'TRACE', - CONNECT: 'CONNECT' -}; -const connectSocket = { - url: { - type: String, - required: true - }, - header: { - type: Object, - validator (value, params) { - params.header = value || {}; - } - }, - method: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase(); - params.method = Object.values(method$1).indexOf(value) < 0 ? method$1.GET : value; - } - }, - protocols: { - type: Array, - validator (value, params) { - params.protocols = (value || []).filter(str => typeof str === 'string'); - } - } -}; -const sendSocketMessage = { - data: { - type: [String, ArrayBuffer] - } -}; -const closeSocket = { - code: { - type: Number - }, - reason: { - type: String - } -}; - -var require_context_module_1_14 = /*#__PURE__*/Object.freeze({ - connectSocket: connectSocket, - sendSocketMessage: sendSocketMessage, - closeSocket: closeSocket -}); - -const uploadFile = { - url: { - type: String, - required: true - }, - filePath: { - type: String, - required: true, - validator (value, params) { - params.type = getRealPath(value); - } - }, - name: { - type: String, - required: true - }, - header: { - type: Object, - validator (value, params) { - params.header = value || {}; - } - }, - formData: { - type: Object, - validator (value, params) { - params.formData = value || {}; - } - } -}; - -var require_context_module_1_15 = /*#__PURE__*/Object.freeze({ - uploadFile: uploadFile -}); - -const pageScrollTo = { - scrollTop: { - type: Number, - required: true - }, - duration: { - type: Number, - default: 300, - validator (duration, params) { - params.duration = Math.max(0, duration); - } - } -}; - -var require_context_module_1_16 = /*#__PURE__*/Object.freeze({ - pageScrollTo: pageScrollTo -}); - -const service = { - OAUTH: 'OAUTH', - SHARE: 'SHARE', - PAYMENT: 'PAYMENT', - PUSH: 'PUSH' -}; - -const getProvider = { - service: { - type: String, - required: true, - validator (value, params) { - value = (value || '').toUpperCase(); - if (value && Object.values(service).indexOf(value) < 0) { - return 'service error' - } - } - } -}; - -var require_context_module_1_17 = /*#__PURE__*/Object.freeze({ - getProvider: getProvider -}); - -const showModal = { - title: { - type: String, - default: '' - }, - content: { - type: String, - default: '' - }, - showCancel: { - type: Boolean, - default: true - }, - cancelText: { - type: String, - default: '取消' - }, - cancelColor: { - type: String, - default: '#000000' - }, - confirmText: { - type: String, - default: '确定' - }, - confirmColor: { - type: String, - default: '#007aff' - }, - visible: { - type: Boolean, - default: true - } -}; - -const showToast = { - title: { - type: String, - default: '' - }, - icon: { - default: 'success', - validator (icon, params) { - if (['success', 'loading', 'none'].indexOf(icon) === -1) { - params.icon = 'success'; - } - } - }, - image: { - type: String, - default: '', - validator (image, params) { - if (image) { - params.image = getRealPath(image); - } - } - }, - duration: { - type: Number, - default: 1500 - }, - mask: { - type: Boolean, - default: false - }, - visible: { - type: Boolean, - default: true - } -}; -const showLoading = { - title: { - type: String, - default: '' - }, - icon: { - type: String, - default: 'loading' - }, - duration: { - type: Number, - default: 100000000 // 简单处理 showLoading,直接设置个大值 - }, - mask: { - type: Boolean, - default: false - }, - visible: { - type: Boolean, - default: true - } -}; - -const showActionSheet = { - itemList: { - type: Array, - required: true, - validator (itemList, params) { - if (!itemList.length) { - return 'parameter.itemList should have at least 1 item' - } - } - }, - itemColor: { - type: String, - default: '#000000' - }, - visible: { - type: Boolean, - default: true - } -}; - -var require_context_module_1_18 = /*#__PURE__*/Object.freeze({ - showModal: showModal, - showToast: showToast, - showLoading: showLoading, - showActionSheet: showActionSheet -}); - -function encodeQueryString (url) { - if (typeof url !== 'string') { - return url - } - const index = url.indexOf('?'); - - if (index === -1) { - return url - } - - const query = url.substr(index + 1).trim().replace(/^(\?|#|&)/, ''); - - if (!query) { - return url - } - - url = url.substr(0, index); - - const params = []; - - query.split('&').forEach(param => { - const parts = param.replace(/\+/g, ' ').split('='); - const key = parts.shift(); - const val = parts.length > 0 - ? parts.join('=') - : ''; - - params.push(key + '=' + encodeURIComponent(val)); - }); - - return params.length ? url + '?' + params.join('&') : url -} - -function createValidator (type) { - return function validator (url, params) { - // 格式化为绝对路径路由 - url = getRealRoute(url); - - const pagePath = url.split('?')[0]; - // 匹配路由是否存在 - const routeOptions = __uniRoutes.find(({ - path, - alias - }) => path === pagePath || alias === pagePath); - - if (!routeOptions) { - return 'page `' + url + '` is not found' - } - - // 检测不同类型跳转 - if (type === 'navigateTo' || type === 'redirectTo') { - if (routeOptions.meta.isTabBar) { - return `can not ${type} a tabbar page` - } - } else if (type === 'switchTab') { - if (!routeOptions.meta.isTabBar) { - return 'can not switch to no-tabBar page' - } - } - - // tabBar不允许传递参数 - if (routeOptions.meta.isTabBar) { - url = pagePath; - } - - // 首页自动格式化为`/` - if (routeOptions.meta.isEntry) { - url = url.replace(routeOptions.alias, '/'); - } - - // 参数格式化 - params.url = encodeQueryString(url); - } -} - -function createProtocol (type, extras = {}) { - return Object.assign({ - url: { - type: String, - required: true, - validator: createValidator(type) - } - }, extras) -} - -function createAnimationProtocol (animationTypes) { - return { - animationType: { - type: String, - validator (type) { - if (type && animationTypes.indexOf(type) === -1) { - return '`' + type + '` is not supported for `animationType` (supported values are: `' + animationTypes.join( - '`|`') + '`)' - } - } - }, - animationDuration: { - type: Number - } - } -} - -const redirectTo = createProtocol('redirectTo'); - -const reLaunch = createProtocol('reLaunch'); - -const navigateTo = createProtocol('navigateTo', createAnimationProtocol( - [ - 'slide-in-right', - 'slide-in-left', - 'slide-in-top', - 'slide-in-bottom', - 'fade-in', - 'zoom-out', - 'zoom-fade-out', - 'pop-in', - 'none' - ] -)); - -const switchTab = createProtocol('switchTab'); - -const navigateBack = Object.assign({ - delta: { - type: Number, - validator (delta, params) { - delta = parseInt(delta) || 1; - params.delta = Math.min(getCurrentPages().length - 1, delta); - } - } -}, createAnimationProtocol( - [ - 'slide-out-right', - 'slide-out-left', - 'slide-out-top', - 'slide-out-bottom', - 'fade-out', - 'zoom-in', - 'zoom-fade-in', - 'pop-out', - 'none' - ] -)); - -var require_context_module_1_19 = /*#__PURE__*/Object.freeze({ - redirectTo: redirectTo, - reLaunch: reLaunch, - navigateTo: navigateTo, - switchTab: switchTab, - navigateBack: navigateBack -}); - -const setStorage = { - 'key': { - type: String, - required: true - }, - 'data': { - required: true - } -}; - -const setStorageSync = [{ - name: 'key', - type: String, - required: true -}, { - name: 'data', - required: true -}]; - -var require_context_module_1_20 = /*#__PURE__*/Object.freeze({ - setStorage: setStorage, - setStorageSync: setStorageSync -}); - -const indexValidator = { - type: Number, - required: true -}; - -const setTabBarItem = { - index: indexValidator, - text: { - type: String - }, - iconPath: { - type: String - }, - selectedIconPath: { - type: String - } -}; - -const setTabBarStyle = { - color: { - type: String - }, - selectedColor: { - type: String - }, - backgroundColor: { - type: String - }, - borderStyle: { - type: String, - validator (borderStyle, params) { - if (borderStyle) { - params.borderStyle = borderStyle === 'black' ? 'black' : 'white'; - } - } - } -}; - -const hideTabBar = { - animation: { - type: Boolean, - default: false - } -}; - -const showTabBar = { - animation: { - type: Boolean, - default: false - } -}; - -const hideTabBarRedDot = { - index: indexValidator -}; - -const showTabBarRedDot = { - index: indexValidator -}; - -const removeTabBarBadge = { - index: indexValidator -}; - -const setTabBarBadge = { - index: indexValidator, - text: { - type: String, - required: true, - validator (text, params) { - if (getLen(text) >= 4) { - params.text = '...'; - } - } - } -}; - -var require_context_module_1_21 = /*#__PURE__*/Object.freeze({ - setTabBarItem: setTabBarItem, - setTabBarStyle: setTabBarStyle, - hideTabBar: hideTabBar, - showTabBar: showTabBar, - hideTabBarRedDot: hideTabBarRedDot, - showTabBarRedDot: showTabBarRedDot, - removeTabBarBadge: removeTabBarBadge, - setTabBarBadge: setTabBarBadge -}); - -const protocol = Object.create(null); -const modules = - (function() { - var map = { - './base.js': require_context_module_1_0, -'./base64.js': require_context_module_1_1, -'./canvas.js': require_context_module_1_2, -'./context.js': require_context_module_1_3, -'./device/make-phone-call.js': require_context_module_1_4, -'./file/open-document.js': require_context_module_1_5, -'./location.js': require_context_module_1_6, -'./media/choose-image.js': require_context_module_1_7, -'./media/choose-video.js': require_context_module_1_8, -'./media/get-image-info.js': require_context_module_1_9, -'./media/preview-image.js': require_context_module_1_10, -'./navigation-bar.js': require_context_module_1_11, -'./network/download-file.js': require_context_module_1_12, -'./network/request.js': require_context_module_1_13, -'./network/socket.js': require_context_module_1_14, -'./network/upload-file.js': require_context_module_1_15, -'./page-scroll-to.js': require_context_module_1_16, -'./plugins.js': require_context_module_1_17, -'./popup.js': require_context_module_1_18, -'./route.js': require_context_module_1_19, -'./storage.js': require_context_module_1_20, -'./tab-bar.js': require_context_module_1_21, - - }; - var req = function req(key) { - return map[key] || (function() { throw new Error("Cannot find module '" + key + "'.") }()); - }; - req.keys = function() { - return Object.keys(map); - }; - return req; - })(); - -modules.keys().forEach(function (key) { - Object.assign(protocol, modules(key)); -}); - -function validateParam (key, paramTypes, paramsData) { - const paramOptions = paramTypes[key]; - const absent = !hasOwn(paramsData, key); - let value = paramsData[key]; - - const booleanIndex = getTypeIndex(Boolean, paramOptions.type); - if (booleanIndex > -1) { - if (absent && !hasOwn(paramOptions, 'default')) { - value = false; - } - } - if (value === undefined) { - if (hasOwn(paramOptions, 'default')) { - const paramDefault = paramOptions['default']; - value = isFn(paramDefault) ? paramDefault() : paramDefault; - paramsData[key] = value; // 默认值 - } - } - - return assertParam(paramOptions, key, value, absent, paramsData) -} - -function assertParam ( - paramOptions, - name, - value, - absent, - paramsData -) { - if (paramOptions.required && absent) { - return `Missing required parameter \`${name}\`` - } - - if (value == null && !paramOptions.required) { - const validator = paramOptions.validator; - if (validator) { - return validator(value, paramsData) - } - return - } - let type = paramOptions.type; - let valid = !type || type === true; - const expectedTypes = []; - if (type) { - if (!Array.isArray(type)) { - type = [type]; - } - for (let i = 0; i < type.length && !valid; i++) { - const assertedType = assertType(value, type[i]); - expectedTypes.push(assertedType.expectedType || ''); - valid = assertedType.valid; - } - } - - if (!valid) { - return getInvalidTypeMessage(name, value, expectedTypes) - } - - const validator = paramOptions.validator; - if (validator) { - return validator(value, paramsData) - } -} - -const simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; - -function assertType (value, type) { - let valid; - const expectedType = getType(type); - if (simpleCheckRE.test(expectedType)) { - const t = typeof value; - valid = t === expectedType.toLowerCase(); - if (!valid && t === 'object') { - valid = value instanceof type; - } - } else if (expectedType === 'Object') { - valid = isPlainObject(value); - } else if (expectedType === 'Array') { - valid = Array.isArray(value); - } else { - valid = value instanceof type; - } - return { - valid, - expectedType - } -} - -function getType (fn) { - const match = fn && fn.toString().match(/^\s*function (\w+)/); - return match ? match[1] : '' -} - -function isSameType (a, b) { - return getType(a) === getType(b) -} - -function getTypeIndex (type, expectedTypes) { - if (!Array.isArray(expectedTypes)) { - return isSameType(expectedTypes, type) ? 0 : -1 - } - for (let i = 0, len = expectedTypes.length; i < len; i++) { - if (isSameType(expectedTypes[i], type)) { - return i - } - } - return -1 -} - -function getInvalidTypeMessage (name, value, expectedTypes) { - let message = `parameter \`${name}\`.` + - ` Expected ${expectedTypes.join(', ')}`; - const expectedType = expectedTypes[0]; - const receivedType = toRawType(value); - const expectedValue = styleValue(value, expectedType); - const receivedValue = styleValue(value, receivedType); - if (expectedTypes.length === 1 && - isExplicable(expectedType) && - !isBoolean(expectedType, receivedType)) { - message += ` with value ${expectedValue}`; - } - message += `, got ${receivedType} `; - if (isExplicable(receivedType)) { - message += `with value ${receivedValue}.`; - } - return message -} - -function styleValue (value, type) { - if (type === 'String') { - return `"${value}"` - } else if (type === 'Number') { - return `${Number(value)}` - } else { - return `${value}` - } -} - -const explicitTypes = ['string', 'number', 'boolean']; - -function isExplicable (value) { - return explicitTypes.some(elem => value.toLowerCase() === elem) -} - -function isBoolean (...args) { - return args.some(elem => elem.toLowerCase() === 'boolean') -} - -function invokeCallbackHandlerFail (err, apiName, callbackId) { - const errMsg = `${apiName}:fail ${err}`; - console.error(errMsg); - if (callbackId === -1) { - throw new Error(errMsg) - } - if (typeof callbackId === 'number') { - invokeCallbackHandler(callbackId, { - errMsg - }); - } - return false -} - -const callbackApiParamTypes = [{ - name: 'callback', - type: Function, - required: true -}]; - -function validateParams (apiName, paramsData, callbackId) { - let paramTypes = protocol[apiName]; - if (!paramTypes && isCallbackApi(apiName)) { - paramTypes = callbackApiParamTypes; - } - if (paramTypes) { - if (Array.isArray(paramTypes) && Array.isArray(paramsData)) { - const paramTypeObj = Object.create(null); - const paramsDataObj = Object.create(null); - const paramsDataLength = paramsData.length; - paramTypes.forEach((paramType, index) => { - paramTypeObj[paramType.name] = paramType; - if (paramsDataLength > index) { - paramsDataObj[paramType.name] = paramsData[index]; - } - }); - paramTypes = paramTypeObj; - paramsData = paramsDataObj; - } - - if (isFn(paramTypes.beforeValidate)) { - const err = paramTypes.beforeValidate(paramsData); - if (err) { - return invokeCallbackHandlerFail(err, apiName, callbackId) - } - } - - const keys = Object.keys(paramTypes); - for (let i = 0; i < keys.length; i++) { - if (keys[i] === 'beforeValidate') { - continue - } - const err = validateParam(keys[i], paramTypes, paramsData); - if (err) { - return invokeCallbackHandlerFail(err, apiName, callbackId) - } - } - } - return true -} - -let invokeCallbackId = 1; - -const invokeCallbacks = {}; - -function createKeepAliveApiCallback (apiName, callback) { - const callbackId = invokeCallbackId++; - const invokeCallbackName = 'api.' + apiName + '.' + callbackId; - - const invokeCallback = function (res) { - callback(res); - }; - - invokeCallbacks[callbackId] = { - name: invokeCallbackName, - keepAlive: true, - callback: invokeCallback - }; - return callbackId -} - -function createApiCallback (apiName, params = {}, extras = {}) { - if (!isPlainObject(params)) { - return { - params - } - } - params = Object.assign({}, params); - - const apiCallbacks = {}; - for (let name in params) { - const param = params[name]; - if (isFn(param)) { - apiCallbacks[name] = tryCatch(param); - delete params[name]; - } - } - - const { - success, - fail, - cancel, - complete - } = apiCallbacks; - - const hasSuccess = isFn(success); - const hasFail = isFn(fail); - const hasCancel = isFn(cancel); - const hasComplete = isFn(complete); - - if (!hasSuccess && !hasFail && !hasCancel && !hasComplete) { // 无回调 - return { - params - } - } - - const wrapperCallbacks = {}; - for (let name in extras) { - const extra = extras[name]; - if (isFn(extra)) { - wrapperCallbacks[name] = tryCatchFramework(extra); - delete extras[name]; - } - } - - const { - beforeSuccess, - afterSuccess, - beforeFail, - afterFail, - beforeCancel, - afterCancel, - afterAll - } = wrapperCallbacks; - - const callbackId = invokeCallbackId++; - const invokeCallbackName = 'api.' + apiName + '.' + callbackId; - - const invokeCallback = function (res) { - res.errMsg = res.errMsg || apiName + ':ok'; - - const errMsg = res.errMsg; - - if (errMsg.indexOf(apiName + ':ok') === 0) { - isFn(beforeSuccess) && beforeSuccess(res); - - hasSuccess && success(res); - - isFn(afterSuccess) && afterSuccess(res); - } else if (errMsg.indexOf(apiName + ':cancel') === 0) { - res.errMsg = res.errMsg.replace(apiName + ':cancel', apiName + ':fail cancel'); - - hasFail && fail(res); - - isFn(beforeCancel) && beforeCancel(res); - - hasCancel && cancel(res); - - isFn(afterCancel) && afterCancel(res); - } else if (errMsg.indexOf(apiName + ':fail') === 0) { - isFn(beforeFail) && beforeFail(res); - - hasFail && fail(res); - - isFn(afterFail) && afterFail(res); - } - - hasComplete && complete(res); - - isFn(afterAll) && afterAll(res); - }; - - invokeCallbacks[callbackId] = { - name: invokeCallbackName, - callback: invokeCallback - }; - - return { - params, - callbackId - } -} - -function createInvokeCallback (apiName, params = {}, extras = {}) { - const { - params: args, - callbackId - } = createApiCallback(apiName, params, extras); - - if (isPlainObject(args) && !validateParams(apiName, args, callbackId)) { - return { - params: args, - callbackId: false - } - } - - return { - params: args, - callbackId - } -} - -function invokeCallbackHandler (invokeCallbackId, res) { - if (typeof invokeCallbackId === 'number') { - const invokeCallback = invokeCallbacks[invokeCallbackId]; - if (invokeCallback) { - if (!invokeCallback.keepAlive) { - delete invokeCallbacks[invokeCallbackId]; - } - return invokeCallback.callback(res) - } - } - return res -} - -function wrapperUnimplemented (name) { - return function todo (args) { - console.error('API `' + name + '` is not yet implemented'); - } -} - -function wrapper (name, invokeMethod, extras) { - if (!isFn(invokeMethod)) { - return invokeMethod - } - return function (...args) { - if (isSyncApi(name)) { - if (validateParams(name, args, -1)) { - return invokeMethod.apply(null, args) - } - } else if (isCallbackApi(name)) { - if (validateParams(name, args, -1)) { - return invokeMethod(createKeepAliveApiCallback(name, args[0])) - } - } else { - let argsObj = {}; - if (args.length) { - argsObj = args[0]; - } - const { - params, - callbackId - } = createInvokeCallback(name, argsObj, extras); - if (callbackId !== false) { - let res; - if (isFn(params)) { - res = invokeMethod(callbackId); - } else { - res = invokeMethod(params, callbackId); - } - if (res && !isTaskApi(name)) { - res = invokeCallbackHandler(callbackId, res); - if (isPlainObject(res)) { - res.errMsg = res.errMsg || name + ':ok'; - } - } - return res - } - } - } -} - -UniServiceJSBridge.publishHandler = UniServiceJSBridge.emit; -UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler; - -const base = [ - 'base64ToArrayBuffer', - 'arrayBufferToBase64' -]; - -const network = [ - 'request', - 'uploadFile', - 'downloadFile', - 'connectSocket', - 'onSocketOpen', - 'onSocketError', - 'sendSocketMessage', - 'onSocketMessage', - 'closeSocket', - 'onSocketClose' -]; - -const route = [ - 'navigateTo', - 'redirectTo', - 'reLaunch', - 'switchTab', - 'navigateBack' -]; - -const storage = [ - 'setStorage', - 'setStorageSync', - 'getStorage', - 'getStorageSync', - 'getStorageInfo', - 'getStorageInfoSync', - 'removeStorage', - 'removeStorageSync', - 'clearStorage', - 'clearStorageSync' -]; - -const location = [ - 'getLocation', - 'chooseLocation', - 'openLocation', - 'createMapContext' -]; - -const media = [ - 'chooseImage', - 'previewImage', - 'getImageInfo', - 'saveImageToPhotosAlbum', - 'compressImage', - 'chooseMessageFile', - 'getRecorderManager', - 'getBackgroundAudioManager', - 'createInnerAudioContext', - 'chooseVideo', - 'saveVideoToPhotosAlbum', - 'createVideoContext', - 'createCameraContext', - 'createLivePlayerContext' -]; - -const device = [ - 'getSystemInfo', - 'getSystemInfoSync', - 'canIUse', - 'onMemoryWarning', - 'getNetworkType', - 'onNetworkStatusChange', - 'onAccelerometerChange', - 'startAccelerometer', - 'stopAccelerometer', - 'onCompassChange', - 'startCompass', - 'stopCompass', - 'onGyroscopeChange', - 'startGyroscope', - 'stopGyroscope', - 'makePhoneCall', - 'scanCode', - 'setClipboardData', - 'getClipboardData', - 'setScreenBrightness', - 'getScreenBrightness', - 'setKeepScreenOn', - 'onUserCaptureScreen', - 'vibrateLong', - 'vibrateShort', - 'addPhoneContact', - 'openBluetoothAdapter', - 'startBluetoothDevicesDiscovery', - 'onBluetoothDeviceFound', - 'stopBluetoothDevicesDiscovery', - 'onBluetoothAdapterStateChange', - 'getConnectedBluetoothDevices', - 'getBluetoothDevices', - 'getBluetoothAdapterState', - 'closeBluetoothAdapter', - 'writeBLECharacteristicValue', - 'readBLECharacteristicValue', - 'onBLEConnectionStateChange', - 'onBLECharacteristicValueChange', - 'notifyBLECharacteristicValueChange', - 'getBLEDeviceServices', - 'getBLEDeviceCharacteristics', - 'createBLEConnection', - 'closeBLEConnection', - 'onBeaconServiceChange', - 'onBeaconUpdate', - 'getBeacons', - 'startBeaconDiscovery', - 'stopBeaconDiscovery' -]; - -const keyboard = [ - 'hideKeyboard' -]; - -const ui = [ - 'showToast', - 'hideToast', - 'showLoading', - 'hideLoading', - 'showModal', - 'showActionSheet', - 'setNavigationBarTitle', - 'setNavigationBarColor', - 'showNavigationBarLoading', - 'hideNavigationBarLoading', - 'setTabBarItem', - 'setTabBarStyle', - 'hideTabBar', - 'showTabBar', - 'setTabBarBadge', - 'removeTabBarBadge', - 'showTabBarRedDot', - 'hideTabBarRedDot', - 'setBackgroundColor', - 'setBackgroundTextStyle', - 'createAnimation', - 'pageScrollTo', - 'onWindowResize', - 'offWindowResize', - 'loadFontFace', - 'startPullDownRefresh', - 'stopPullDownRefresh', - 'createSelectorQuery', - 'createIntersectionObserver' -]; - -const event = [ - '$emit', - '$on', - '$once', - '$off' -]; - -const file = [ - 'saveFile', - 'getSavedFileList', - 'getSavedFileInfo', - 'removeSavedFile', - 'getFileInfo', - 'openDocument', - 'getFileSystemManager' -]; - -const canvas = [ - 'createOffscreenCanvas', - 'createCanvasContext', - 'canvasToTempFilePath', - 'canvasPutImageData', - 'canvasGetImageData' -]; - -const third = [ - 'getProvider', - 'login', - 'checkSession', - 'getUserInfo', - 'share', - 'showShareMenu', - 'hideShareMenu', - 'requestPayment', - 'subscribePush', - 'unsubscribePush', - 'onPush', - 'offPush', - 'requireNativePlugin', - 'upx2px' -]; - -const apis = [ - ...base, - ...network, - ...route, - ...storage, - ...location, - ...media, - ...device, - ...keyboard, - ...ui, - ...event, - ...file, - ...canvas, - ...third -]; - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var base64Arraybuffer = createCommonjsModule(function (module, exports) { -/* - * base64-arraybuffer - * https://github.com/niklasvh/base64-arraybuffer - * - * Copyright (c) 2012 Niklas von Hertzen - * Licensed under the MIT license. - */ -(function(){ - - var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - // Use a lookup table to find the index. - var lookup = new Uint8Array(256); - for (var i = 0; i < chars.length; i++) { - lookup[chars.charCodeAt(i)] = i; - } - - exports.encode = function(arraybuffer) { - var bytes = new Uint8Array(arraybuffer), - i, len = bytes.length, base64 = ""; - - for (i = 0; i < len; i+=3) { - base64 += chars[bytes[i] >> 2]; - base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; - base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; - base64 += chars[bytes[i + 2] & 63]; - } - - if ((len % 3) === 2) { - base64 = base64.substring(0, base64.length - 1) + "="; - } else if (len % 3 === 1) { - base64 = base64.substring(0, base64.length - 2) + "=="; - } - - return base64; - }; - - exports.decode = function(base64) { - var bufferLength = base64.length * 0.75, - len = base64.length, i, p = 0, - encoded1, encoded2, encoded3, encoded4; - - if (base64[base64.length - 1] === "=") { - bufferLength--; - if (base64[base64.length - 2] === "=") { - bufferLength--; - } - } - - var arraybuffer = new ArrayBuffer(bufferLength), - bytes = new Uint8Array(arraybuffer); - - for (i = 0; i < len; i+=4) { - encoded1 = lookup[base64.charCodeAt(i)]; - encoded2 = lookup[base64.charCodeAt(i+1)]; - encoded3 = lookup[base64.charCodeAt(i+2)]; - encoded4 = lookup[base64.charCodeAt(i+3)]; - - bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); - bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); - bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); - } - - return arraybuffer; - }; -})(); -}); -var base64Arraybuffer_1 = base64Arraybuffer.encode; -var base64Arraybuffer_2 = base64Arraybuffer.decode; - -const base64ToArrayBuffer$1 = base64Arraybuffer_2; -const arrayBufferToBase64$1 = base64Arraybuffer_1; - -var require_context_module_0_0 = /*#__PURE__*/Object.freeze({ - base64ToArrayBuffer: base64ToArrayBuffer$1, - arrayBufferToBase64: arrayBufferToBase64$1 -}); - -var platformSchema = {}; - -// TODO 待处理其他 API 的检测 - -function canIUse$1 (schema) { - if (hasOwn(platformSchema, schema)) { - return platformSchema[schema] - } - return true -} - -var require_context_module_0_1 = /*#__PURE__*/Object.freeze({ - canIUse: canIUse$1 -}); - -const interceptors = { - promiseInterceptor -}; - -var require_context_module_0_2 = /*#__PURE__*/Object.freeze({ - interceptors: interceptors, - addInterceptor: addInterceptor, - removeInterceptor: removeInterceptor -}); - -const EPS = 1e-4; -const BASE_DEVICE_WIDTH = 750; -let isIOS = false; -let deviceWidth = 0; -let deviceDPR = 0; - -function checkDeviceWidth () { - const { - platform, - pixelRatio, - windowWidth - } = uni.getSystemInfoSync(); - - deviceWidth = windowWidth; - deviceDPR = pixelRatio; - isIOS = platform === 'ios'; -} - -function upx2px (number, newDeviceWidth) { - if (deviceWidth === 0) { - checkDeviceWidth(); - } - - number = Number(number); - if (number === 0) { - return 0 - } - let result = (number / BASE_DEVICE_WIDTH) * (newDeviceWidth || deviceWidth); - if (result < 0) { - result = -result; - } - result = Math.floor(result + EPS); - if (result === 0) { - if (deviceDPR === 1 || !isIOS) { - return 1 - } else { - return 0.5 - } - } - return number < 0 ? -result : result -} - -var require_context_module_0_3 = /*#__PURE__*/Object.freeze({ - upx2px: upx2px -}); - -function setStorage$1 ({ - key, - data -} = {}) { - const value = { - type: typeof data === 'object' ? 'object' : 'string', - data: data - }; - localStorage.setItem(key, JSON.stringify(value)); - const keyList = localStorage.getItem('uni-storage-keys'); - if (!keyList) { - localStorage.setItem('uni-storage-keys', JSON.stringify([key])); - } else { - const keys = JSON.parse(keyList); - if (keys.indexOf(key) < 0) { - keys.push(key); - localStorage.setItem('uni-storage-keys', JSON.stringify(keys)); - } - } - return { - errMsg: 'setStorage:ok' - } -} - -function setStorageSync$1 (key, data) { - setStorage$1({ - key, - data - }); -} - -function getStorage ({ - key -} = {}) { - const data = localStorage.getItem(key); - return data ? { - data: JSON.parse(data).data, - errMsg: 'getStorage:ok' - } : { - data: '', - errMsg: 'getStorage:fail' - } -} - -function getStorageSync (key) { - const res = getStorage({ - key - }); - return res.data -} - -function removeStorage ({ - key -} = {}) { - const keyList = localStorage.getItem('uni-storage-keys'); - if (keyList) { - const keys = JSON.parse(keyList); - const index = keys.indexOf(key); - keys.splice(index, 1); - localStorage.setItem('uni-storage-keys', JSON.stringify(keys)); - } - localStorage.removeItem(key); - return { - errMsg: 'removeStorage:ok' - } -} - -function removeStorageSync (key) { - removeStorage({ - key - }); -} - -function clearStorage () { - localStorage.clear(); - return { - errMsg: 'clearStorage:ok' - } -} - -function clearStorageSync () { - clearStorage(); -} - -function getStorageInfo () { // TODO 暂时先不做大小的转换 - const keyList = localStorage.getItem('uni-storage-keys'); - return keyList ? { - keys: JSON.parse(keyList), - currentSize: 0, - limitSize: 0, - errMsg: 'getStorageInfo:ok' - } : { - keys: '', - currentSize: 0, - limitSize: 0, - errMsg: 'getStorageInfo:fail' - } -} - -function getStorageInfoSync () { - const res = getStorageInfo(); - delete res.errMsg; - return res -} - -var require_context_module_0_4 = /*#__PURE__*/Object.freeze({ - setStorage: setStorage$1, - setStorageSync: setStorageSync$1, - getStorage: getStorage, - getStorageSync: getStorageSync, - removeStorage: removeStorage, - removeStorageSync: removeStorageSync, - clearStorage: clearStorage, - clearStorageSync: clearStorageSync, - getStorageInfo: getStorageInfo, - getStorageInfoSync: getStorageInfoSync -}); - -function pageScrollTo$1 (args) { - const pages = getCurrentPages(); - if (pages.length) { - UniServiceJSBridge.publishHandler('pageScrollTo', args, pages[pages.length - 1].$page.id); - } - return {} -} - -var require_context_module_0_5 = /*#__PURE__*/Object.freeze({ - pageScrollTo: pageScrollTo$1 -}); - -const api = Object.create(null); - -const modules$1 = - (function() { - var map = { - './base/base64.js': require_context_module_0_0, -'./base/can-i-use.js': require_context_module_0_1, -'./base/interceptor.js': require_context_module_0_2, -'./base/upx2px.js': require_context_module_0_3, -'./storage/storage.js': require_context_module_0_4, -'./ui/page-scroll-to.js': require_context_module_0_5, - - }; - var req = function req(key) { - return map[key] || (function() { throw new Error("Cannot find module '" + key + "'.") }()); - }; - req.keys = function() { - return Object.keys(map); - }; - return req; - })(); - - -modules$1.keys().forEach(function (key) { - Object.assign(api, modules$1(key)); -}); - -const SUCCESS = 'success'; -const FAIL = 'fail'; -const COMPLETE = 'complete'; -const CALLBACKS = [SUCCESS, FAIL, COMPLETE]; - -/** - * 调用无参数,或仅一个参数且为 callback 的 API - * @param {Object} vm - * @param {Object} method - * @param {Object} args - * @param {Object} extras - */ -function invokeVmMethodWithoutArgs (vm, method, args, extras) { - if (!vm) { - return - } - if (typeof args === 'undefined') { - return vm[method]() - } - const [, callbacks] = normalizeArgs(args, extras); - if (!Object.keys(callbacks).length) { - return vm[method]() - } - return vm[method](normalizeCallback(method, callbacks)) -} -/** - * 调用两个参数(第一个入参为普通参数,第二个入参为 callback) API - * @param {Object} vm - * @param {Object} method - * @param {Object} args - * @param {Object} extras - */ -function invokeVmMethod (vm, method, args, extras) { - if (!vm) { - return - } - const [pureArgs, callbacks] = normalizeArgs(args, extras); - if (!Object.keys(callbacks).length) { - return vm[method](pureArgs) - } - return vm[method](pureArgs, normalizeCallback(method, callbacks)) -} - -function findElmById (id, vm) { - return findElmByVNode(id, vm._vnode) -} - -function findElmByVNode (id, vnode) { - if (!id || !vnode) { - return - } - if ( - vnode.data && - vnode.data.attrs && - vnode.data.attrs.id === id - ) { - return vnode.elm - } - const children = vnode.children; - if (!children) { - return - } - for (let i = 0, len = children.length; i < len; i++) { - const elm = findElmByVNode(id, children[i]); - if (elm) { - return elm - } - } -} - -function normalizeArgs (args = {}, extras) { - const callbacks = Object.create(null); - - const iterator = function iterator (name) { - const callback = args[name]; - if (isFn(callback)) { - callbacks[name] = callback; - delete args[name]; - } - }; - - CALLBACKS.forEach(iterator); - - extras && extras.forEach(iterator); - - return [args, callbacks] -} - -function normalizeCallback (method, callbacks) { - return function weexCallback (ret) { - const type = ret.type; - delete ret.type; - const callback = callbacks[type]; - - if (type === SUCCESS) { - ret.errMsg = `${method}:ok`; - } else if (type === FAIL) { - ret.errMsg = method + ':fail' + (ret.msg ? (' ' + ret.msg) : ''); - } - - delete ret.code; - delete ret.msg; - - isFn(callback) && callback(ret); - - if (type === SUCCESS || type === FAIL) { - const complete = callbacks['complete']; - isFn(complete) && complete(ret); - } - } -} - -class LivePusherContext { - constructor (id, ctx) { - this.id = id; - this.ctx = ctx; - } - - start (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'start', cbs) - } - - stop (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'stop', cbs) - } - - pause (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'pause', cbs) - } - - resume (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'resume', cbs) - } - - switchCamera (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'switchCamera', cbs) - } - - snapshot (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'snapshot', cbs) - } - - toggleTorch (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'toggleTorch', cbs) - } - - playBGM (args) { - return invokeVmMethod(this.ctx, 'playBGM', args) - } - - stopBGM (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'stopBGM', cbs) - } - - pauseBGM (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'pauseBGM', cbs) - } - - resumeBGM (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'resumeBGM', cbs) - } - - setBGMVolume (cbs) { - return invokeVmMethod(this.ctx, 'setBGMVolume', cbs) - } - - startPreview (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'startPreview', cbs) - } - - stopPreview (args) { - return invokeVmMethodWithoutArgs(this.ctx, 'stopPreview', args) - } -} - -function createLivePusherContext (id, vm) { - if (!vm) { - return console.warn('uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)') - } - const elm = findElmById(id, vm); - if (!elm) { - return console.warn('Can not find `' + id + '`') - } - return new LivePusherContext(id, elm) -} - -class MapContext { - constructor (id, ctx) { - this.id = id; - this.ctx = ctx; - } - - getCenterLocation (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'getCenterLocation', cbs) - } - - moveToLocation () { - return invokeVmMethodWithoutArgs(this.ctx, 'moveToLocation') - } - - translateMarker (args) { - return invokeVmMethod(this.ctx, 'translateMarker', args, ['animationEnd']) - } - - includePoints (args) { - return invokeVmMethod(this.ctx, 'includePoints', args) - } - - getRegion (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'getRegion', cbs) - } - - getScale (cbs) { - return invokeVmMethodWithoutArgs(this.ctx, 'getScale', cbs) - } -} - -function createMapContext$1 (id, vm) { - if (!vm) { - return console.warn('uni.createMapContext 必须传入第二个参数,即当前 vm 对象(this)') - } - const elm = findElmById(id, vm); - if (!elm) { - return console.warn('Can not find `' + id + '`') - } - return new MapContext(id, elm) -} - -class VideoContext { - constructor (id, ctx) { - this.id = id; - this.ctx = ctx; - } - - play () { - return invokeVmMethodWithoutArgs(this.ctx, 'play') - } - - pause () { - return invokeVmMethodWithoutArgs(this.ctx, 'pause') - } - - seek (args) { - return invokeVmMethod(this.ctx, 'seek', args) - } - - stop () { - return invokeVmMethodWithoutArgs(this.ctx, 'stop') - } - - sendDanmu (args) { - return invokeVmMethod(this.ctx, 'sendDanmu', args) - } - - playbackRate (args) { - return invokeVmMethod(this.ctx, 'playbackRate', args) - } - - requestFullScreen (args) { - return invokeVmMethod(this.ctx, 'requestFullScreen', args) - } - - exitFullScreen () { - return invokeVmMethodWithoutArgs(this.ctx, 'exitFullScreen') - } - - showStatusBar () { - return invokeVmMethodWithoutArgs(this.ctx, 'showStatusBar') - } - - hideStatusBar () { - return invokeVmMethodWithoutArgs(this.ctx, 'hideStatusBar') - } -} - -function createVideoContext$1 (id, vm) { - if (!vm) { - return console.warn('uni.createVideoContext 必须传入第二个参数,即当前 vm 对象(this)') - } - const elm = findElmById(id, vm); - if (!elm) { - return console.warn('Can not find `' + id + '`') - } - return new VideoContext(id, elm) -} - -function requireNativePlugin (name) { - return weex.requireModule(name) -} - -const ANI_DURATION = 300; -const ANI_SHOW = 'pop-in'; - -function showWebview (webview, animationType, animationDuration) { - setTimeout(() => { - webview.show( - animationType || ANI_SHOW, - animationDuration || ANI_DURATION, - () => { - console.log('show.callback'); - } - ); - }, 50); -} - -let firstBackTime = 0; - -function navigateBack$1 ({ - delta, - animationType, - animationDuration -}) { - const pages = getCurrentPages(); - const len = pages.length - 1; - const page = pages[len]; - if (page.$page.meta.isQuit) { - if (!firstBackTime) { - firstBackTime = Date.now(); - plus.nativeUI.toast('再按一次退出应用'); - setTimeout(() => { - firstBackTime = null; - }, 2000); - } else if (Date.now() - firstBackTime < 2000) { - plus.runtime.quit(); - } - } else { - pages.splice(len, 1); - if (animationType) { - page.$getAppWebview().close(animationType, animationDuration || ANI_DURATION); - } else { - page.$getAppWebview().close('auto'); - } - UniServiceJSBridge.emit('onAppRoute', { - type: 'navigateBack' - }); - } -} - -function navigateTo$1 ({ - url, - animationType, - animationDuration -}) { - const path = url.split('?')[0]; - - UniServiceJSBridge.emit('onAppRoute', { - type: 'navigateTo', - path - }); - - showWebview( - __registerPage({ - path - }), - animationType, - animationDuration - ); -} - -function reLaunch$1 ({ - path -}) {} - -function redirectTo$1 ({ - path -}) {} - -function switchTab$1 ({ - path -}) {} - - - -var api$1 = /*#__PURE__*/Object.freeze({ - createLivePusherContext: createLivePusherContext, - createMapContext: createMapContext$1, - createVideoContext: createVideoContext$1, - requireNativePlugin: requireNativePlugin, - navigateBack: navigateBack$1, - navigateTo: navigateTo$1, - reLaunch: reLaunch$1, - redirectTo: redirectTo$1, - switchTab: switchTab$1 -}); - -const api$2 = Object.assign(Object.create(null), api, api$1); - -const uni$1 = Object.create(null); - -apis.forEach(name => { - if (api$2[name]) { - uni$1[name] = promisify(name, wrapper(name, api$2[name])); - } else { - uni$1[name] = wrapperUnimplemented(name); - } -}); - - return uni$1 -} diff --git a/packages/uni-h5/dist/index.umd.min.js b/packages/uni-h5/dist/index.umd.min.js index ef0b44dd0f..3267a7e8a6 100644 --- a/packages/uni-h5/dist/index.umd.min.js +++ b/packages/uni-h5/dist/index.umd.min.js @@ -1 +1 @@ -(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue-router"),require("vue")):"function"===typeof define&&define.amd?define([,],e):"object"===typeof exports?exports["index"]=e(require("vue-router"),require("vue")):t["index"]=e(t["VueRouter"],t["Vue"])})("undefined"!==typeof self?self:this,function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"0138":function(t,e,n){"use strict";n.r(e),function(t){var i=n("052f"),r=n("3d1f"),o=n("85c1"),a=n("abbf");n.d(e,"getApp",function(){return a["b"]}),n.d(e,"getCurrentPages",function(){return a["c"]}),Object(i["a"])(t.on,{getApp:a["b"],getCurrentPages:a["c"]}),Object(r["a"])(t.subscribe,{getApp:a["b"],getCurrentPages:a["c"]}),e["default"]=o["a"]}.call(this,n("0dd1"))},"052f":function(t,e,n){"use strict";n.d(e,"a",function(){return o});var i=n("a741"),r=n("45db");function o(t,e){var n=e.getApp,o=e.getCurrentPages;function a(t){Object(i["a"])(n(),"onError",t)}function s(t){Object(i["a"])(n(),"onPageNotFound",t)}function c(t,e){var n=o().find(function(t){return t.$page.id===e});n&&(Object(r["setPullDownRefreshPageId"])(e),Object(i["b"])(n,"onPullDownRefresh"))}function u(t,e){var n=o();n.length&&Object(i["b"])(n[n.length-1],t,e)}function l(t){return function(e){u(t,e)}}function h(){Object(i["a"])(n(),"onHide"),u("onHide")}function d(){Object(i["a"])(n(),"onShow"),u("onShow")}function f(t,e){var n=t.name,i=t.arg;"postMessage"===n||uni[n](i)}t("onError",a),t("onPageNotFound",s),t("onAppEnterBackground",h),t("onAppEnterForeground",d),t("onPullDownRefresh",c),t("onTabItemTap",l("onTabItemTap")),t("onNavigationBarButtonTap",l("onNavigationBarButtonTap")),t("onNavigationBarSearchInputChanged",l("onNavigationBarSearchInputChanged")),t("onNavigationBarSearchInputConfirmed",l("onNavigationBarSearchInputConfirmed")),t("onNavigationBarSearchInputClicked",l("onNavigationBarSearchInputClicked")),t("onWebInvokeAppService",f)}},"0554":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"getLocation",function(){return o});var i=n("ffdc");function r(t,e,n){var r=__uniConfig.qqMapKey,o="https://apis.map.qq.com/ws/coord/v1/translate?locations=".concat(t.latitude,",").concat(t.longitude,"&type=1&key=").concat(r,"&output=jsonp");Object(i["a"])(o,{},function(t){"locations"in t&&t.locations.length?e({longitude:t.locations[0].lng,latitude:t.locations[0].lat}):n(t)},n)}function o(e,n){var i=e.type,o=e.altitude,a=t,s=a.invokeCallbackHandler;function c(t){s(n,Object.assign(t,{errMsg:"getLocation:ok",verticalAccuracy:t.altitudeAccuracy||0,horizontalAccuracy:t.accuracy}))}navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){var e=t.coords;"WGS84"===i?c(e):r(e,c,function(t){s(n,{errMsg:"getLocation:fail "+JSON.stringify(t)})})},function(){s(n,{errMsg:"getLocation:fail"})},{enableHighAccuracy:o,timeout:3e5}):s(n,{errMsg:"getLocation:fail device nonsupport geolocation"})}}.call(this,n("0dd1"))},"066f":function(t,e,n){"use strict";n.r(e),n.d(e,"setTabBarItem",function(){return o}),n.d(e,"setTabBarStyle",function(){return a}),n.d(e,"hideTabBar",function(){return s}),n.d(e,"showTabBar",function(){return c}),n.d(e,"hideTabBarRedDot",function(){return u}),n.d(e,"showTabBarRedDot",function(){return l}),n.d(e,"removeTabBarBadge",function(){return h}),n.d(e,"setTabBarBadge",function(){return d});var i=n("f2b3"),r={type:Number,required:!0},o={index:r,text:{type:String},iconPath:{type:String},selectedIconPath:{type:String}},a={color:{type:String},selectedColor:{type:String},backgroundColor:{type:String},borderStyle:{type:String,validator:function(t,e){t&&(e.borderStyle="black"===t?"black":"white")}}},s={animation:{type:Boolean,default:!1}},c={animation:{type:Boolean,default:!1}},u={index:r},l={index:r},h={index:r},d={index:r,text:{type:String,required:!0,validator:function(t,e){Object(i["b"])(t)>=4&&(e.text="...")}}}},"0741":function(t,e,n){"use strict";var i=n("9a72"),r=n.n(i);r.a},"0784":function(t,e,n){"use strict";var i=n("a741");function r(t){var e=t.$route;t.route=e.meta.pagePath,t.__page__={id:e.params.__id__,path:e.path,route:e.meta.pagePath,meta:Object.assign({},e.meta)},t.$vm=t,t.$root=t,t.$holder=t.$parent.$parent,t.$mp={mpType:"page",page:t,query:{},status:""}}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};return Object.keys(t).forEach(function(n){try{e[n]=decodeURIComponent(t[n])}catch(i){e[n]=t[n]}}),e}function a(){return{created:function(){r(this),Object(i["b"])(this,"onLoad",o(this.$route.query)),Object(i["b"])(this,"onShow")}}}n.d(e,"a",function(){return a})},"08c9":function(t,e,n){},"0950":function(t,e,n){},"0998":function(t,e,n){"use strict";var i=n("4509"),r=n.n(i);r.a},"0a32":function(t,e,n){"use strict";var i=n("17ac"),r=n.n(i);r.a},"0c7c":function(t,e,n){"use strict";function i(t,e,n,i,r,o,a,s){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):r&&(c=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:u}}n.d(e,"a",function(){return i})},"0dba":function(t,e,n){},"0dd1":function(t,e,n){"use strict";n.r(e),n.d(e,"on",function(){return c}),n.d(e,"off",function(){return u}),n.d(e,"once",function(){return l}),n.d(e,"emit",function(){return h}),n.d(e,"subscribe",function(){return d}),n.d(e,"unsubscribe",function(){return f}),n.d(e,"subscribeHandler",function(){return p});var i=n("8bbf"),r=n.n(i),o=n("27a7");n.d(e,"invokeCallbackHandler",function(){return o["a"]});var a=n("b865");n.d(e,"publishHandler",function(){return a["a"]});var s=new r.a,c=s.$on.bind(s),u=s.$off.bind(s),l=s.$once.bind(s),h=s.$emit.bind(s);function d(t,e){return c("view."+t,e)}function f(t,e){return u("view."+t,e)}function p(t,e,n){return h("view."+t,e,n)}},"0f55":function(t,e,n){"use strict";var i=n("eaa4"),r=n.n(i);r.a},"0f74":function(t,e,n){"use strict";function i(t,e){if(e){if(0===e.indexOf("/"))return e}else{if(e=t,0===e.indexOf("/"))return e;var n=getCurrentPages();t=n.length?n[n.length-1].$page.route:""}if(0===e.indexOf("./"))return i(t,e.substr(2));for(var r=e.split("/"),o=r.length,a=0;a0?t.split("/"):[];return s.splice(s.length-a-1,a+1),"/"+s.concat(r).join("/")}n.d(e,"a",function(){return i})},1047:function(t,e,n){},1067:function(t,e,n){},1082:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-image",t._g({},t.$listeners),[n("div",{ref:"content",style:t.modeStyle}),n("img",{attrs:{src:t.realImagePath}}),"widthFix"===t.mode?n("v-uni-resize-sensor",{ref:"sensor",on:{resize:t._resize}}):t._e()],1)},r=[],o={name:"Image",props:{src:{type:String,default:""},mode:{type:String,default:"scaleToFill"},lazyLoad:{type:[Boolean,String],default:!1}},data:function(){return{originalWidth:0,originalHeight:0,availHeight:"",sizeFixed:!1}},computed:{ratio:function(){return this.originalWidth&&this.originalHeight?this.originalWidth/this.originalHeight:0},realImagePath:function(){return this.src&&this.$getRealPath(this.src)},modeStyle:function(){var t="auto",e="",n="no-repeat";switch(this.mode){case"aspectFit":t="contain",e="center center";break;case"aspectFill":t="cover",e="center center";break;case"widthFix":t="100% 100%";break;case"top":e="center top";break;case"bottom":e="center bottom";break;case"center":e="center center";break;case"left":e="left center";break;case"right":e="right center";break;case"top left":e="left top";break;case"top right":e="right top";break;case"bottom left":e="left bottom";break;case"bottom right":e="right bottom";break;default:t="100% 100%",e="0% 0%";break}return"background-position:".concat(e,";background-size:").concat(t,";background-repeat:").concat(n,";")}},watch:{src:function(t,e){this._loadImage()},mode:function(t,e){"widthFix"===e&&(this.$el.style.height=this.availHeight,this.sizeFixed=!1),"widthFix"===t&&this.ratio&&this._fixSize()}},mounted:function(){this.availHeight=this.$el.style.height||"",this._loadImage()},methods:{_resize:function(){"widthFix"!==this.mode||this.sizeFixed||this._fixSize()},_fixSize:function(){var t=this._getWidth();t&&(this.$el.style.height=t/this.ratio+"px",this.sizeFixed=!0)},_loadImage:function(){this.$refs.content.style.backgroundImage=this.src?"url(".concat(this.realImagePath,")"):"none";var t=this,e=new Image;e.onload=function(e){t.originalWidth=this.width,t.originalHeight=this.height,"widthFix"===t.mode&&t._fixSize(),t.$trigger("load",e,{width:this.width,height:this.height})},e.onerror=function(e){t.$trigger("error",e,{errMsg:"GET ".concat(t.src," 404 (Not Found)")})},e.src=this.realImagePath},_getWidth:function(){var t=window.getComputedStyle(this.$el),e=(parseFloat(t.borderLeftWidth,10)||0)+(parseFloat(t.borderRightWidth,10)||0),n=(parseFloat(t.paddingLeft,10)||0)+(parseFloat(t.paddingRight,10)||0);return this.$el.offsetWidth-e-n}}},a=o,s=(n("db18"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},1164:function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return o}),n.d(e,"c",function(){return a}),n.d(e,"a",function(){return s});var i=n("23e5"),r=!1;function o(){return r}function a(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=[],i=o();if(!i)return t.error("app is not ready"),[];var r=i.$children[0];if(r&&r.$children.length){var a=r.$children.find(function(t){return"TabBar"===t.$options.name});r.$children.forEach(function(t){if(a!==t&&t.$children.length&&"Page"===t.$children[0].$options.name&&t.$children[0].$slots.page){var r=t.$children[0].$children.find(function(t){return"PageBody"===t.$options.name}).$children.find(function(t){return!!t.$page});if(r){var o=!0;!e&&a&&r.$page&&r.$page.meta.isTabBar&&(i.$route.meta&&i.$route.meta.isTabBar?i.$route.path!==r.$page.path&&(o=!1):a.__path__!==r.$page.path&&(o=!1)),o&&n.push(r)}}})}var s=n.length;if(s>1){var c=n[s-1];c.$page.path!==i.$route.path&&n.splice(s-1,1)}return n}function s(t,e){r=t,r.globalData=r.$options.globalData||{},Object(i["a"])(r,e)}}).call(this,n("3ad9")["default"])},"11fb":function(t,e,n){"use strict";n.r(e),n.d(e,"previewImage",function(){return r});var i=n("cb0f"),r={urls:{type:Array,required:!0,validator:function(t,e){var n;if(e.urls=t.map(function(t){if("string"===typeof t)return Object(i["a"])(t);n=!0}),n)return"url is not string"}},current:{type:[String,Number],validator:function(t,e){"number"===typeof t?e.current=t>0&&t.5&&e._A<=.5?o.forEach(function(t){t.color=a}):s<=.5&&e._A>.5&&o.forEach(function(t){t.color="#fff"}),e._A=s,i&&(i.style.opacity=s),n.backgroundColor="rgba(".concat(e._R,",").concat(e._G,",").concat(e._B,",").concat(s,")"),l.forEach(function(t,e){var n=u[e],i=n.match(/[\d+\.]+/g);i[3]=(1-s)*(4===i.length?i[3]:1),t.backgroundColor="rgba(".concat(i,")")}))})}},computed:{color:function(){return"transparent"===this.type?"#fff":this.textColor},offset:function(){return parseInt(this.coverage)},bgColor:function(){if("transparent"===this.type){var t=Object(i["d"])(this.backgroundColor),e=t.r,n=t.g,r=t.b;return this._R=e,this._G=n,this._B=r,"rgba(".concat(e,",").concat(n,",").concat(r,",0)")}return this.backgroundColor}}}}).call(this,n("501c"))},"167a":function(t,e,n){"use strict";var i=n("deaf"),r=n.n(i);r.a},"17ac":function(t,e,n){},"17fd":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hoverClass&&"none"!==t.hoverClass?n("uni-navigator",t._g({class:[t.hovering?t.hoverClass:""],on:{touchstart:t._hoverTouchStart,touchend:t._hoverTouchEnd,touchcancel:t._hoverTouchCancel,click:t._onClick}},t.$listeners),[t._t("default")],2):n("uni-navigator",t._g({on:{click:t._onClick}},t.$listeners),[t._t("default")],2)},r=[],o=n("eecc"),a=o["a"],s=(n("f7fd"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},"18fd":function(t,e,n){"use strict";n.d(e,"a",function(){return d});var i=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,o=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,a=f("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),s=f("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),c=f("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),u=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),l=f("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),h=f("script,style");function d(t,e){var n,d,f,p=[],g=t;p.last=function(){return this[this.length-1]};while(t){if(d=!0,p.last()&&h[p.last()])t=t.replace(new RegExp("([\\s\\S]*?)]*>"),function(t,n){return n=n.replace(/|/g,"$1$2"),e.chars&&e.chars(n),""}),b("",p.last());else if(0==t.indexOf("\x3c!--")?(n=t.indexOf("--\x3e"),n>=0&&(e.comment&&e.comment(t.substring(4,n)),t=t.substring(n+3),d=!1)):0==t.indexOf("=0;i--)if(p[i]==n)break}else var i=0;if(i>=0){for(var r=p.length-1;r>=i;r--)e.end&&e.end(p[r]);p.length=i}}b()}function f(t){for(var e={},n=t.split(","),i=0;i*{height: ").concat(t,"px;overflow: hidden;}"),document.head.appendChild(e)},_handleTrack:function(t){if(this._scroller)switch(t.detail.state){case"start":this._handleTouchStart(t);break;case"move":this._handleTouchMove(t);break;case"end":case"cancel":this._handleTouchEnd(t)}},_handleTap:function(t){if(t.target!==t.currentTarget&&!this._scroller.isScrolling()){var e=t.touches&&t.touches[0]&&t.touches[0].clientY,n="number"===typeof e?e:t.detail.y-document.body.scrollTop,i=this.$el.getBoundingClientRect(),r=n-i.top-this._height/2,o=this.indicatorHeight/2;if(!(Math.abs(r)<=o)){var a=Math.ceil((Math.abs(r)-o)/this.indicatorHeight),s=r<0?-a:a;this.current+=s,this._scroller.scrollTo(this.current*this.indicatorHeight)}}},setCurrent:function(t){t!==this.current&&(this.current=t,this.inited&&this.update())},init:function(){var t=this;this.initScroller(this.$refs.content,{enableY:!0,enableX:!1,enableSnap:!0,itemSize:this.indicatorHeight,friction:new s["a"](1e-4),spring:new c["a"](2,90,20),onSnap:function(e){isNaN(e)||e===t.current||(t.current=e)}}),this.inited=!0},update:function(){var t=this;this.$nextTick(function(){var e=Math.max(t.length-1,0),n=Math.min(t.current,e);t._scroller.update(n*t.indicatorHeight,void 0,t.indicatorHeight)})},_resize:function(t){var e=t.height;this.indicatorHeight=e}},render:function(t){return this.length=this.$slots.default&&this.$slots.default.length||0,t("uni-picker-view-column",{on:{tap:this._handleTap}},[t("div",{ref:"main",staticClass:"uni-picker-view-group"},[t("div",{ref:"mask",staticClass:"uni-picker-view-mask",class:this.maskClass,style:"background-size: 100% ".concat(this.maskSize,"px;").concat(this.maskStyle)}),t("div",{ref:"indicator",staticClass:"uni-picker-view-indicator",class:this.indicatorClass,style:this.indicatorStyle},[t("v-uni-resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}})]),t("div",{ref:"content",staticClass:"uni-picker-view-content",class:this.scope,style:"padding: ".concat(this.maskSize,"px 0;")},[this.$slots.default])])])}},l=u,h=(n("edfa"),n("0c7c")),d=Object(h["a"])(l,i,r,!1,null,null,null);e["default"]=d.exports},"19c4":function(t,e,n){var i={"./base.js":"22ec","./base64.js":"a8fd","./canvas.js":"a041","./context.js":"9fef","./device/make-phone-call.js":"f102","./file/open-document.js":"2604","./location.js":"c439","./media/choose-image.js":"f1b2","./media/choose-video.js":"ed9f","./media/get-image-info.js":"b866","./media/preview-image.js":"11fb","./navigation-bar.js":"4043","./network/download-file.js":"439a","./network/request.js":"a201","./network/socket.js":"abb2","./network/upload-file.js":"9a3e","./page-scroll-to.js":"e8e6","./plugins.js":"cef5","./popup.js":"d68b","./route.js":"40ab","./storage.js":"3858","./tab-bar.js":"066f"};function r(t){var e=o(t);return n(e)}function o(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=o,t.exports=r,r.id="19c4"},"1a12":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.delta,o=e.animationType,a=e.animationDuration,s=e.from,c=void 0===s?"navigateBack":s,u=e.detail,l=getApp().$router;switch(t){case"redirectTo":l.replace({type:t,path:n});break;case"navigateTo":l.push({type:t,path:n,animationType:o,animationDuration:a});break;case"navigateBack":var h=!0,d=getCurrentPages();if(d.length){var f=d[d.length-1];Object(i["a"])(f.$options,"onBackPress")&&!0===f.__call_hook("onBackPress",{from:c})&&(h=!1)}h&&(r>1&&(l._$delta=r),l.go(-r,{animationType:o,animationDuration:a}));break;case"reLaunch":l.replace({type:t,path:n});break;case"switchTab":l.replace({type:t,path:n,params:{detail:u}});break}return{errMsg:t+":ok"}}function o(t){return r("redirectTo",t)}function a(t){return r("navigateTo",t)}function s(t){return r("navigateBack",t)}function c(t){return r("reLaunch",t)}function u(t){return r("switchTab",t)}},"1b6f":function(t,e,n){"use strict";(function(t){var i=n("f2b3");e["a"]={mounted:function(){var t=this;this._toggleListeners("subscribe",this.id),this.$watch("id",function(e,n){t._toggleListeners("unsubscribe",n,!0),t._toggleListeners("subscribe",e,!0)})},beforeDestroy:function(){this._toggleListeners("unsubscribe",this.id)},methods:{_toggleListeners:function(e,n,r){r&&!n||Object(i["e"])(this._handleSubscribe)&&t[e](this.$page.id+"-"+this.$options.name.replace(/VUni([A-Z])/,"$1").toLowerCase()+"-"+n,this._handleSubscribe)}}}}).call(this,n("501c"))},"1c64":function(t,e,n){"use strict";var i=n("9613"),r=n.n(i);r.a},"1ca3":function(t,e,n){"use strict";n.r(e),n.d(e,"base64ToArrayBuffer",function(){return r}),n.d(e,"arrayBufferToBase64",function(){return o});var i=n("8390"),r=i["decode"],o=i["encode"]},"1efd":function(t,e,n){"use strict";n.r(e);var i=n("8bbf"),r=n.n(i),o=n("cb0f"),a=n("d4b6"),s={methods:{$getRealPath:function(t){return Object(o["a"])(t)},$trigger:function(t,e,n){this.$emit(t,a["b"].call(this,t,e,n,this.$el,this.$el))}}};function c(t){return h(t)||l(t)||u()}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function l(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function h(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;o--){var s=r[o],c=s.$page.meta;c.isTabBar||(a.call(this,c.name+"-"+s.$page.id),Object(i["b"])(s,"onUnload"))}}function h(t){__uniConfig.reLaunch=(__uniConfig.reLaunch||1)+1;for(var e=getCurrentPages(!0),n=e.length-1;n>=0;n--)Object(i["b"])(e[n],"onUnload"),e[n].$destroy();this.keepAliveInclude=[],s=Object.create(null)}var d=[];function f(t,e,n,i){d=getCurrentPages(!0);var o=e.params.__id__,s=t.params.__id__,c=t.meta.name+"-"+s;if(s===o)t.fullPath!==e.fullPath?(a.call(this,c),n()):n(!1);else if(t.meta.id&&t.meta.id!==s)n({path:t.path,replace:!0});else{var u=e.meta.name+"-"+o;switch(t.type){case"navigateTo":break;case"redirectTo":if(a.call(this,u),e.meta&&(e.meta.isQuit&&(t.meta.isQuit=!0,t.meta.isEntry=!!e.meta.isEntry),e.meta.isTabBar)){t.meta.isTabBar=!0,t.meta.tabBarIndex=e.meta.tabBarIndex;var f=getApp().$children[0];f.$set(f.tabBar.list[t.meta.tabBarIndex],"pagePath",t.meta.pagePath)}break;case"switchTab":l.call(this,i,t,e);break;case"reLaunch":h.call(this,c),t.meta.isQuit=!0;break;default:o&&o>s&&(a.call(this,u),this.$router._$delta>1&&a.call(this,this.$router._$delta));break}if("reLaunch"!==t.type&&e.meta.id&&r.call(this,u),r.call(this,c),t.meta&&t.meta.name){document.body.className="uni-body "+t.meta.name;var p="nvue-dir-"+__uniConfig.nvue["flex-direction"];t.meta.isNVue?(document.body.setAttribute("nvue",""),document.body.setAttribute(p,"")):(document.body.removeAttribute("nvue"),document.body.removeAttribute(p))}n()}}function p(t,e){var n=e.params.__id__,r=t.params.__id__,a=d.find(function(t){return t.$page.id===n});switch(t.type){case"navigateTo":a&&Object(i["b"])(a,"onHide");break;case"redirectTo":a&&Object(i["b"])(a,"onUnload");break;case"switchTab":e.meta.isTabBar&&a&&Object(i["b"])(a,"onHide");break;case"reLaunch":break;default:n&&n>r&&(a&&Object(i["b"])(a,"onUnload"),this.$router._$delta>1&&o.reverse().forEach(function(t){var e=d.find(function(e){return e.$page.id===t});e&&Object(i["b"])(e,"onUnload")}));break}if(delete this.$router._$delta,o.length=0,"reLaunch"!==t.type){var s=getCurrentPages(!0).find(function(t){return t.$page.id===r});s&&(setTimeout(function(){Object(i["b"])(s,"onShow")},0),document.title=s.$parent.$parent.navigationBar.titleText)}}function g(t,e){t.$router.beforeEach(function(n,i,r){f.call(t,n,i,r,e)}),t.$router.afterEach(function(e,n){p.call(t,e,n)})}},"24aa":function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n},"24d9":function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a});var i=n("f2b3");function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t){return Object.assign({mp:t,_processed:!0},t)}function a(t,e){return Object(i["f"])(e)&&(Object(i["c"])(e,"backgroundColor")&&(t.backgroundColor=e.backgroundColor),Object(i["c"])(e,"buttons")&&(t.buttons=e.buttons),Object(i["c"])(e,"titleColor")&&(t.textColor=e.titleColor),Object(i["c"])(e,"titleText")&&(t.titleText=e.titleText),Object(i["c"])(e,"titleSize")&&(t.titleSize=e.titleSize),Object(i["c"])(e,"type")&&(t.type=e.type),Object(i["c"])(e,"searchInput")&&"object"===r(e.searchInput)&&(t.searchInput=Object.assign({autoFocus:!1,align:"center",color:"#000000",backgroundColor:"rgba(255,255,255,0.5)",borderRadius:"0px",placeholder:"",placeholderColor:"#CCCCCC",disabled:!1},e.searchInput))),t}},"250d":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-input",t._g({},t.$listeners),[n("div",{ref:"wrapper",staticClass:"uni-input-wrapper"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!(t.composing||t.inputValue.length),expression:"!(composing || inputValue.length)"}],ref:"placeholder",staticClass:"uni-input-placeholder",class:t.placeholderClass,style:t.placeholderStyle},[t._v(t._s(t.placeholder))]),"checkbox"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:"checkbox"},domProps:{checked:Array.isArray(t.inputValue)?t._i(t.inputValue,null)>-1:t.inputValue},on:{focus:t._onFocus,blur:t._onBlur,input:function(e){return e.stopPropagation(),t._onInput(e)},compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)},change:function(e){var n=t.inputValue,i=e.target,r=!!i.checked;if(Array.isArray(n)){var o=null,a=t._i(n,o);i.checked?a<0&&(t.inputValue=n.concat([o])):a>-1&&(t.inputValue=n.slice(0,a).concat(n.slice(a+1)))}else t.inputValue=r}}}):"radio"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:"radio"},domProps:{checked:t._q(t.inputValue,null)},on:{focus:t._onFocus,blur:t._onBlur,input:function(e){return e.stopPropagation(),t._onInput(e)},compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)},change:function(e){t.inputValue=null}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:t.inputType},domProps:{value:t.inputValue},on:{focus:t._onFocus,blur:t._onBlur,input:[function(e){e.target.composing||(t.inputValue=e.target.value)},function(e){return e.stopPropagation(),t._onInput(e)}],compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)}}})])])},r=[],o=n("8af1"),a=["text","number","idcard","digit","password"],s=["number","digit"],c={name:"Input",mixins:[o["a"]],model:{prop:"value",event:"update:value"},props:{name:{type:String,default:""},value:{type:[String,Number],default:""},type:{type:String,default:"text"},password:{type:[Boolean,String],default:!1},placeholder:{type:String,default:""},placeholderStyle:{type:String,default:""},placeholderClass:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},maxlength:{type:[Number,String],default:140},focus:{type:[Boolean,String],default:!1},confirmType:{type:String,default:"done"}},data:function(){return{inputValue:this.value+"",composing:!1,wrapperHeight:0,cachedValue:""}},computed:{inputType:function(){var t="";switch(this.type){case"text":"search"===this.confirmType&&(t="search");break;case"idcard":t="text";break;case"digit":t="number";break;default:t=~a.indexOf(this.type)?this.type:"text";break}return this.password?"password":t},step:function(){return~s.indexOf(this.type)?"0.000000000000000001":""}},watch:{focus:function(t){t&&this._focusInput()},value:function(t){this.inputValue=t+""},inputValue:function(t){this.$emit("update:value",t)},maxlength:function(t){var e=this.inputValue.slice(0,parseInt(t,10));e!==this.inputValue&&(this.inputValue=e)}},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},mounted:function(){if("search"===this.confirmType){var t=document.createElement("form");t.action="",t.onsubmit=function(){return!1},t.className="uni-input-form",t.appendChild(this.$refs.input),this.$refs.wrapper.appendChild(t)}var e=this;while(e){var n=e.$options._scopeId;n&&this.$refs.placeholder.setAttribute(n,""),e=e.$parent}this.focus&&this._focusInput()},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onKeyup:function(t){13===t.keyCode&&this.$trigger("confirm",t,{value:t.target.value})},_onInput:function(t){if(!this.composing){if(~s.indexOf(this.type)){if(this.$refs.input.validity&&!this.$refs.input.validity.valid)return t.target.value=this.cachedValue,void(this.inputValue=t.target.value);this.cachedValue=this.inputValue}if("number"===this.inputType){var e=parseInt(this.maxlength,10);if(e>0&&t.target.value.length>e)return t.target.value=t.target.value.slice(0,e),void(this.inputValue=t.target.value)}this.$trigger("input",t,{value:this.inputValue})}},_onFocus:function(t){this.$trigger("focus",t,{value:t.target.value})},_onBlur:function(t){this.$trigger("blur",t,{value:t.target.value})},_focusInput:function(){var t=this;setTimeout(function(){t.$refs.input.focus()},350)},_blurInput:function(){var t=this;setTimeout(function(){t.$refs.input.blur()},350)},_onComposition:function(t){"compositionstart"===t.type?this.composing=!0:this.composing=!1},_resetFormData:function(){this.inputValue=""},_getFormData:function(){return this.name?{value:this.inputValue,key:this.name}:{}}}},u=c,l=(n("0f55"),n("0c7c")),h=Object(l["a"])(u,i,r,!1,null,null,null);e["default"]=h.exports},"25ce":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-checkbox-group",t._g({},t.$listeners),[t._t("default")],2)},r=[],o=n("8af1"),a={name:"CheckboxGroup",mixins:[o["a"],o["c"]],props:{name:{type:String,default:""}},data:function(){return{checkboxList:[]}},listeners:{"@checkbox-change":"_changeHandler","@checkbox-group-update":"_checkboxGroupUpdateHandler"},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_changeHandler:function(t){var e=[];this.checkboxList.forEach(function(t){t.checkboxChecked&&e.push(t.value)}),this.$trigger("change",t,{value:e})},_checkboxGroupUpdateHandler:function(t){if("add"===t.type)this.checkboxList.push(t.vm);else{var e=this.checkboxList.indexOf(t.vm);this.checkboxList.splice(e,1)}},_getFormData:function(){var t={};if(""!==this.name){var e=[];this.checkboxList.forEach(function(t){t.checkboxChecked&&e.push(t.value)}),t["value"]=e,t["key"]=this.name}return t}}},s=a,c=(n("0998"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},2604:function(t,e,n){"use strict";n.r(e),n.d(e,"openDocument",function(){return i});var i={filePath:{type:String,required:!0},fileType:{type:String}}},2608:function(t,e,n){"use strict";(function(t){function i(e){return function(){try{return e.apply(e,arguments)}catch(n){t.error(n)}}}function r(e){return function(){try{return e.apply(e,arguments)}catch(n){t.error(n)}}}n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r})}).call(this,n("3ad9")["default"])},2765:function(t,e,n){"use strict";var i=n("91ce"),r=n.n(i);r.a},"27a7":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return m}),n.d(e,"c",function(){return v}),n.d(e,"b",function(){return b});var i=n("f2b3"),r=n("2608"),o=n("ed1a"),a=n("cc76"),s=n("de29");function c(e,n,i){var r="".concat(n,":fail ").concat(e);if(t.error(r),-1===i)throw new Error(r);return"number"===typeof i&&m(i,{errMsg:r}),!1}var u=[{name:"callback",type:Function,required:!0}];function l(t,e,n){var r=a["a"][t];if(!r&&Object(o["a"])(t)&&(r=u),r){if(Array.isArray(r)&&Array.isArray(e)){var l=Object.create(null),h=Object.create(null),d=e.length;r.forEach(function(t,n){l[t.name]=t,d>n&&(h[t.name]=e[n])}),r=l,e=h}if(Object(i["e"])(r.beforeValidate)){var f=r.beforeValidate(e);if(f)return c(f,t,n)}for(var p=Object.keys(r),g=0;g1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Object(i["f"])(e))return{params:e};e=Object.assign({},e);var o={};for(var a in e){var s=e[a];Object(i["e"])(s)&&(o[a]=Object(r["a"])(s),delete e[a])}var c=o.success,u=o.fail,l=o.cancel,f=o.complete,p=Object(i["e"])(c),g=Object(i["e"])(u),m=Object(i["e"])(l),v=Object(i["e"])(f);if(!p&&!g&&!m&&!v)return{params:e};var b={};for(var y in n){var _=n[y];Object(i["e"])(_)&&(b[y]=Object(r["b"])(_),delete n[y])}var w=b.beforeSuccess,S=b.afterSuccess,k=b.beforeFail,T=b.afterFail,x=b.beforeCancel,C=b.afterCancel,O=b.afterAll,M=h++,E="api."+t+"."+M,A=function(e){e.errMsg=e.errMsg||t+":ok";var n=e.errMsg;0===n.indexOf(t+":ok")?(Object(i["e"])(w)&&w(e),p&&c(e),Object(i["e"])(S)&&S(e)):0===n.indexOf(t+":cancel")?(e.errMsg=e.errMsg.replace(t+":cancel",t+":fail cancel"),g&&u(e),Object(i["e"])(x)&&x(e),m&&l(e),Object(i["e"])(C)&&C(e)):0===n.indexOf(t+":fail")&&(Object(i["e"])(k)&&k(e),g&&u(e),Object(i["e"])(T)&&T(e)),v&&f(e),Object(i["e"])(O)&&O(e)};return d[M]={name:E,callback:A},{params:e,callbackId:M}}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=p(t,e,n),o=r.params,a=r.callbackId;return Object(i["f"])(o)&&!l(t,o,a)?{params:o,callbackId:!1}:{params:o,callbackId:a}}function m(t,e){if("number"===typeof t){var n=d[t];if(n)return n.keepAlive||delete d[t],n.callback(e)}return e}function v(e){return function(n){t.error("API `"+e+"` is not yet implemented")}}function b(t,e,n){return Object(i["e"])(e)?function(){for(var r=arguments.length,a=new Array(r),s=0;s0&&(r.currentTime=e)}),r.addEventListener("progress",function(t){var e=r.buffered;e.length&&(n.buffered=e.end(e.length-1)/r.duration)}),r.addEventListener("waiting",function(t){n.$trigger("waiting",t,{})}),r.addEventListener("error",function(t){n.playing=!1,n.$trigger("error",t,{})}),r.addEventListener("play",function(t){n.start=!0,n.playing=!0,n.fullscreenTriggering||n.$trigger("play",t,{})}),r.addEventListener("pause",function(t){n.playing=!1,n.fullscreenTriggering||n.$trigger("pause",t,{})}),r.addEventListener("ended",function(t){n.playing=!1,n.$trigger("ended",t,{})}),r.addEventListener("timeupdate",function(t){var e=n.currentTime=r.currentTime,o=r.duration,a=i.danmuIndex,s={time:e,index:a.index},c=i.danmuList;if(e>a.time)for(var u=a.index+1;u=(l.time||0)))break;s.index=u,n.playing&&n.enableDanmuSync&&n.playDanmu(l)}else if(e-1;h--){var d=c[h];if(!(e<=(d.time||0)))break;s.index=h-1}i.danmuIndex=s,n.$trigger("timeupdate",t,{currentTime:e,duration:o})}),r.addEventListener("x5videoenterfullscreen",function(t){n.$trigger("fullscreenchange",t,{fullScreen:!0})}),r.addEventListener("x5videoexitfullscreen",function(t){n.$trigger("fullscreenchange",t,{fullScreen:!1})});var a,c=!0;function u(i){var r=n.getScreenXY(i.targetTouches[0]),o=r.pageX,s=r.pageY;if(c&&Math.abs(o-t)100&&(h=100),n.progress=h,i.preventDefault(),i.stopPropagation()}}function l(t){n.controlsTouching=!1,n.touching&&(o.removeEventListener("touchmove",u,s),c||(t.preventDefault(),t.stopPropagation(),n.seek(n.$refs.video.duration*n.progress/100)),n.touching=!1)}o.addEventListener("touchstart",function(i){n.controlsTouching=!0;var r=n.getScreenXY(i.targetTouches[0]);t=r.pageX,e=r.pageY,a=n.progress,c=!0,n.touching=!0,o.addEventListener("touchmove",u,s)}),o.addEventListener("touchend",l),o.addEventListener("touchcancel",l),String(this.srcSync).length&&this.autoplay&&r.play()},beforeDestroy:function(){this.$refs.container.remove(),clearTimeout(this.otherData.hideTiming)},methods:{_handleSubscribe:function(t){var e=t.type,n=t.data,i=void 0===n?{}:n;switch(e){case"play":this.play();break;case"pause":this.pause();break;case"seek":this.seek(i.position);break;case"sendDanmu":this.sendDanmu(i);break;case"playbackRate":this.$refs.video.playbackRate=i.rate;break;case"requestFullScreen":this.enterFullscreen();break;case"exitFullScreen":this.leaveFullscreen();break}},resize:function(){var t=window.innerWidth,e=window.innerHeight,n=Math.abs(this.directionSync);this.rotateType=0===n?t>e?"left":"":90===n?t>e?"":"right":"",this.rotateType?(this.width=e+"px",this.height=t+"px"):(this.width=t+"px",this.height=e+"px")},trigger:function(){this.playing?this.$refs.video.pause():this.$refs.video.play()},play:function(){this.start=!0,this.$refs.video.play()},pause:function(){this.$refs.video.pause()},seek:function(t){t=Number(t),"number"!==typeof t||isNaN(t)||(this.$refs.video.currentTime=t)},clickProgress:function(t){var e=t.offsetX,n=this.$refs.progress,i=t.target;while(i!==n)e+=i.offsetLeft,i=i.parentNode;var r=n.offsetWidth,o=0;e>=0&&e<=r&&(o=e/r,this.seek(this.$refs.video.duration*o))},triggerDanmu:function(){this.enableDanmuSync=!this.enableDanmuSync},playDanmu:function(t){var e=document.createElement("p");e.className="uni-video-danmu-item",e.innerText=t.text;var n="bottom: ".concat(100*Math.random(),"%;color: ").concat(t.color,";");e.setAttribute("style",n),this.$refs.danmu.appendChild(e),setTimeout(function(){n+="left: 0;-webkit-transform: translateX(-100%);transform: translateX(-100%);",e.setAttribute("style",n),setTimeout(function(){e.remove()},4e3)},17)},sendDanmu:function(t){var e=this.otherData;e.danmuList.splice(e.danmuIndex.index+1,0,{text:String(t.text),color:t.color,time:this.$refs.video.currentTime||0})},triggerFullscreen:function(){this.fullscreen=!this.fullscreen},enterFullscreen:function(t){var e=Number(t);isNaN(NaN)||(this.directionSync=e),this.fullscreen=!0},leaveFullscreen:function(){this.fullscreen=!1},triggerControls:function(){this.controlsVisible=!this.controlsVisible},touchstart:function(t){var e=this.getScreenXY(t.targetTouches[0]);this.touchStartOrigin={x:e.pageX,y:e.pageY},this.gestureType=c.NONE,this.volumeOld=null,this.currentTimeOld=this.currentTimeNew=0},touchmove:function(t){function e(){t.stopPropagation(),t.preventDefault()}this.fullscreen&&e();var n=this.gestureType;if(n!==c.STOP){var i=this.getScreenXY(t.targetTouches[0]),r=i.pageX,o=i.pageY,a=this.touchStartOrigin;if(n===c.PROGRESS?this.changeProgress(r-a.x):n===c.VOLUME&&this.changeVolume(o-a.y),n===c.NONE)if(Math.abs(r-a.x)>Math.abs(o-a.y)){if(!this.enableProgressGesture)return void(this.gestureType=c.STOP);this.gestureType=c.PROGRESS,this.currentTimeOld=this.currentTimeNew=this.$refs.video.currentTime,this.fullscreen||e()}else{if(!this.pageGesture)return void(this.gestureType=c.STOP);this.gestureType=c.VOLUME,this.volumeOld=this.$refs.video.volume,this.fullscreen||e()}}},touchend:function(t){this.gestureType!==c.NONE&&this.gestureType!==c.STOP&&(t.stopPropagation(),t.preventDefault()),this.gestureType===c.PROGRESS&&this.currentTimeOld!==this.currentTimeNew&&(this.$refs.video.currentTime=this.currentTimeNew),this.gestureType=c.NONE},changeProgress:function(t){var e=this.$refs.video.duration,n=t/600*e+this.currentTimeOld;n<0?n=0:n>e&&(n=e),this.currentTimeNew=n},changeVolume:function(t){var e,n=this.volumeOld;"number"===typeof n&&(e=n-t/200,e<0?e=0:e>1&&(e=1),this.$refs.video.volume=e,this.volumeNew=e)},autoHideStart:function(){var t=this;this.otherData.hideTiming=setTimeout(function(){t.controlsVisible=!1},3e3)},autoHideEnd:function(){var t=this.otherData;t.hideTiming&&(clearTimeout(t.hideTiming),t.hideTiming=null)},getScreenXY:function(t){var e=this.rotateType;if(!this.fullscreen||!e)return t;var n,i,r=screen.width,o=screen.height,a=t.pageX,s=t.pageY;return"left"===e?(n=o-s,i=a):(n=s,i=r-a),{pageX:n,pageY:i}},updateProgress:function(){this.touching||(this.progress=this.currentTime/this.durationTime*100)}}},l=u,h=(n("856e"),n("0c7c")),d=Object(h["a"])(l,i,r,!1,null,null,null);e["default"]=d.exports},"33ab":function(t,e,n){},"33ed":function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return r}),n.d(e,"c",function(){return o}),n.d(e,"a",function(){return a});var i=n("4a59");function r(t){t.preventDefault()}function o(t){var e=t.scrollTop,n=t.duration,i=document.documentElement,r=i.clientHeight,o=i.scrollHeight;function a(t){if(t<=0)window.scrollTo(0,e);else{var n=e-window.scrollY;requestAnimationFrame(function(){window.scrollTo(0,window.scrollY+n/t*10),a(t-10)})}}e=Math.min(e,o-r),0!==n?window.scrollY!==e&&a(n):i.scrollTop=document.body.scrollTop=e}function a(e,n){var r=n.enablePageScroll,o=n.enablePageReachBottom,a=n.onReachBottomDistance,s=n.enableTransparentTitleNView,c=!1,u=!1,l=!0;function h(){var t=document.documentElement,e=t.clientHeight,n=t.scrollHeight,i=window.scrollY,r=i>0&&n>e&&i+e+a>=n;return r&&!u?(u=!0,!0):(!r&&u&&(u=!1),!1)}function d(){var n=window.pageYOffset;r&&Object(i["a"])("onPageScroll",{scrollTop:n},e),s&&t.emit("onPageScroll",{scrollTop:n}),o&&l&&h()&&(Object(i["a"])("onReachBottom",{},e),l=!1,setTimeout(function(){l=!0},350)),c=!1}return function(){c||requestAnimationFrame(d),c=!0}}}).call(this,n("501c"))},"347e":function(t,e,n){"use strict";(function(t){var i=n("8aec"),r=n("f2b3"),o=!!r["h"]&&{passive:!0};e["a"]={name:"ScrollView",mixins:[i["a"]],props:{scrollX:{type:[Boolean,String],default:!1},scrollY:{type:[Boolean,String],default:!1},upperThreshold:{type:[Number,String],default:50},lowerThreshold:{type:[Number,String],default:50},scrollTop:{type:[Number,String],default:0},scrollLeft:{type:[Number,String],default:0},scrollIntoView:{type:String,default:""},scrollWithAnimation:{type:[Boolean,String],default:!1},enableBackToTop:{type:[Boolean,String],default:!1}},data:function(){return{lastScrollTop:this.scrollTopNumber,lastScrollLeft:this.scrollLeftNumber,lastScrollToUpperTime:0,lastScrollToLowerTime:0}},computed:{upperThresholdNumber:function(){var t=Number(this.upperThreshold);return isNaN(t)?50:t},lowerThresholdNumber:function(){var t=Number(this.lowerThreshold);return isNaN(t)?50:t},scrollTopNumber:function(){return Number(this.scrollTop)||0},scrollLeftNumber:function(){return Number(this.scrollLeft)||0}},watch:{scrollTopNumber:function(t){this._scrollTopChanged(t)},scrollLeftNumber:function(t){this._scrollLeftChanged(t)},scrollIntoView:function(t){this._scrollIntoViewChanged(t)}},mounted:function(){var t=this;this._attached=!0,this._scrollTopChanged(this.scrollTopNumber),this._scrollLeftChanged(this.scrollLeftNumber),this._scrollIntoViewChanged(this.scrollIntoView),this.__handleScroll=function(e){event.preventDefault(),event.stopPropagation(),t._handleScroll.bind(t,event)()};var e=null,n=null;this.__handleTouchMove=function(i){var r=i.touches[0].pageX,o=i.touches[0].pageY,a=t.$refs.main;if(null===n)if(Math.abs(r-e.x)>Math.abs(o-e.y))if(t.scrollX){if(0===a.scrollLeft&&r>e.x)return void(n=!1);if(a.scrollWidth===a.offsetWidth+a.scrollLeft&&re.y)return void(n=!1);if(a.scrollHeight===a.offsetHeight+a.scrollTop&&on.scrollWidth-n.offsetWidth?t=n.scrollWidth-n.offsetWidth:"y"===e&&t>n.scrollHeight-n.offsetHeight&&(t=n.scrollHeight-n.offsetHeight);var i=0,r="";"x"===e?i=n.scrollLeft-t:"y"===e&&(i=n.scrollTop-t),0!==i&&(this.$refs.content.style.transition="transform .3s ease-out",this.$refs.content.style.webkitTransition="-webkit-transform .3s ease-out","x"===e?r="translateX("+i+"px) translateZ(0)":"y"===e&&(r="translateY("+i+"px) translateZ(0)"),this.$refs.content.removeEventListener("transitionend",this.__transitionEnd),this.$refs.content.removeEventListener("webkitTransitionEnd",this.__transitionEnd),this.__transitionEnd=this._transitionEnd.bind(this,t,e),this.$refs.content.addEventListener("transitionend",this.__transitionEnd),this.$refs.content.addEventListener("webkitTransitionEnd",this.__transitionEnd),"x"===e?n.style.overflowX="hidden":"y"===e&&(n.style.overflowY="hidden"),this.$refs.content.style.transform=r,this.$refs.content.style.webkitTransform=r)},_handleTrack:function(t){if("start"===t.detail.state)return this._x=t.detail.x,this._y=t.detail.y,void(this._noBubble=null);"end"===t.detail.state&&(this._noBubble=!1),null===this._noBubble&&this.scrollY&&(Math.abs(this._y-t.detail.y)/Math.abs(this._x-t.detail.x)>1?this._noBubble=!0:this._noBubble=!1),null===this._noBubble&&this.scrollX&&(Math.abs(this._x-t.detail.x)/Math.abs(this._y-t.detail.y)>1?this._noBubble=!0:this._noBubble=!1),this._x=t.detail.x,this._y=t.detail.y,this._noBubble&&t.stopPropagation()},_handleScroll:function(t){if(!(t.timeStamp-this._lastScrollTime<20)){this._lastScrollTime=t.timeStamp;var e=t.target;this.$trigger("scroll",t,{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,deltaX:this.lastScrollLeft-e.scrollLeft,deltaY:this.lastScrollTop-e.scrollTop}),this.scrollY&&(e.scrollTop<=this.upperThresholdNumber&&this.lastScrollTop-e.scrollTop>0&&t.timeStamp-this.lastScrollToUpperTime>200&&(this.$trigger("scrolltoupper",t,{direction:"top"}),this.lastScrollToUpperTime=t.timeStamp),e.scrollTop+e.offsetHeight+this.lowerThresholdNumber>=e.scrollHeight&&this.lastScrollTop-e.scrollTop<0&&t.timeStamp-this.lastScrollToLowerTime>200&&(this.$trigger("scrolltolower",t,{direction:"bottom"}),this.lastScrollToLowerTime=t.timeStamp)),this.scrollX&&(e.scrollLeft<=this.upperThresholdNumber&&this.lastScrollLeft-e.scrollLeft>0&&t.timeStamp-this.lastScrollToUpperTime>200&&(this.$trigger("scrolltoupper",t,{direction:"left"}),this.lastScrollToUpperTime=t.timeStamp),e.scrollLeft+e.offsetWidth+this.lowerThresholdNumber>=e.scrollWidth&&this.lastScrollLeft-e.scrollLeft<0&&t.timeStamp-this.lastScrollToLowerTime>200&&(this.$trigger("scrolltolower",t,{direction:"right"}),this.lastScrollToLowerTime=t.timeStamp)),this.lastScrollTop=e.scrollTop,this.lastScrollLeft=e.scrollLeft}},_scrollTopChanged:function(t){this.scrollY&&(this._innerSetScrollTop?this._innerSetScrollTop=!1:this.scrollWithAnimation?this.scrollTo(t,"y"):this.$refs.main.scrollTop=t)},_scrollLeftChanged:function(t){this.scrollX&&(this._innerSetScrollLeft?this._innerSetScrollLeft=!1:this.scrollWithAnimation?this.scrollTo(t,"x"):this.$refs.main.scrollLeft=t)},_scrollIntoViewChanged:function(e){if(e){if(!/^[_a-zA-Z][-_a-zA-Z0-9:]*$/.test(e))return t.group('scroll-into-view="'+e+'" 有误'),t.error("id 属性值格式错误。如不能以数字开头。"),void t.groupEnd();var n=this.$el.querySelector("#"+e);if(n){var i=this.$refs.main.getBoundingClientRect(),r=n.getBoundingClientRect();if(this.scrollX){var o=r.left-i.left,a=this.$refs.main.scrollLeft,s=a+o;this.scrollWithAnimation?this.scrollTo(s,"x"):this.$refs.main.scrollLeft=s}if(this.scrollY){var c=r.top-i.top,u=this.$refs.main.scrollTop,l=u+c;this.scrollWithAnimation?this.scrollTo(l,"y"):this.$refs.main.scrollTop=l}}}},_transitionEnd:function(t,e){this.$refs.content.style.transition="",this.$refs.content.style.webkitTransition="",this.$refs.content.style.transform="",this.$refs.content.style.webkitTransform="";var n=this.$refs.main;"x"===e?(n.style.overflowX=this.scrollX?"auto":"hidden",n.scrollLeft=t):"y"===e&&(n.style.overflowY=this.scrollY?"auto":"hidden",n.scrollTop=t),this.$refs.content.removeEventListener("transitionend",this.__transitionEnd),this.$refs.content.removeEventListener("webkitTransitionEnd",this.__transitionEnd)},getScrollPosition:function(){var t=this.$refs.main;return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}}}}).call(this,n("3ad9")["default"])},"34b2":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"getImageInfo",function(){return o});var i=n("cb0f");function r(){return window.location.protocol+"//"+window.location.host}function o(e,n){var o=e.src,a=t,s=a.invokeCallbackHandler,c=new Image,u=Object(i["a"])(o);c.onload=function(){s(n,{errMsg:"getImageInfo:ok",width:c.naturalWidth,height:c.naturalHeight,path:0===u.indexOf("/")?r()+u:u})},c.onerror=function(t){s(n,{errMsg:"getImageInfo:fail"})},c.src=o}}.call(this,n("0dd1"))},3648:function(t,e,n){"use strict";n.r(e);var i=n("f2b3"),r={"css.var":window.CSS&&window.CSS.supports&&window.CSS.supports("--a",0)};function o(t){return!Object(i["c"])(r,t)||r[t]}n.d(e,"canIUse",function(){return o})},3858:function(t,e,n){"use strict";n.r(e),n.d(e,"setStorage",function(){return i}),n.d(e,"setStorageSync",function(){return r});var i={key:{type:String,required:!0},data:{required:!0}},r=[{name:"key",type:String,required:!0},{name:"data",required:!0}]},"3ad9":function(t,e,n){"use strict";n.r(e),function(t){var n=Array.prototype.unshift;function i(t){return n.call(t,"[system]"),t}function r(e){return function(){var n=!0;"debug"!==e||__uniConfig.debug||(n=!1),n&&t.console[e].apply(t.console,i(arguments))}}e["default"]={log:r("log"),info:r("info"),warn:r("warn"),debug:r("debug"),error:r("error")}}.call(this,n("24aa"))},"3d1f":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return o});var i=n("62b5"),r=n("a741");function o(e,n){n.getApp;var o=n.getCurrentPages;function a(e){return function(n,i){var a=o(),s=a.find(function(t){return t.$page.id===i});s?Object(r["b"])(s,e,n):t.error("Not Found:Page[".concat(i,"]"))}}var s=Object(i["a"])("requestComponentInfo");function c(t){var e=t.reqId,n=t.res,i=s.pop(e);i&&i(n)}var u=Object(i["a"])("requestComponentObserver");function l(t){var e=t.reqId,n=t.reqEnd,i=t.res,r=u.get(e);if(r){if(n)return void u.pop(e);r(i)}}e("onPageReady",a("onReady")),e("onPageScroll",a("onPageScroll")),e("onReachBottom",a("onReachBottom")),e("onRequestComponentInfo",c),e("onRequestComponentObserver",l)}}).call(this,n("3ad9")["default"])},"3d64":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"onNetworkStatusChange",function(){return c}),n.d(e,"getNetworkType",function(){return u});var i=t,r=i.invokeCallbackHandler,o=[];function a(){var t=navigator.connection.type,e="";if(~["none","wifi","unknown"].indexOf(t))e=t;else{var n=navigator.connection.effectiveType;"slow-2g"===n&&(n="2g"),e=n}return e}function s(){var t=!0,e=a();"none"===e&&(t=!1),o.forEach(function(n){n&&r(n,{errMsg:"onNetworkStatusChange:ok",isConnected:t,networkType:e})})}function c(t){window.NetworkInformation?(o.push(t),navigator.connection.onchange=s):t&&r(t,{errMsg:"onNetworkStatusChange:fail"})}function u(){return window.NetworkInformation?{errMsg:"getNetworkType:ok",networkType:a()}:{errMsg:"getNetworkType:fail"}}}.call(this,n("0dd1"))},"3da9":function(t,e,n){"use strict";var i=n("33ab"),r=n.n(i);r.a},"3e8c":function(t,e,n){"use strict";n.r(e);var i,r,o={name:"ResizeSensor",props:{initial:{type:[Boolean,String],default:!1}},data:function(){return{size:{width:-1,height:-1}}},watch:{size:{deep:!0,handler:function(t){this.$emit("resize",Object.assign({},t))}}},mounted:function(){!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"AnimationEvent"in window||this.reset()},methods:{reset:function(){var t=this.$el.firstChild,e=this.$el.lastChild;t.scrollLeft=1e5,t.scrollTop=1e5,e.scrollLeft=1e5,e.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight,this.reset()}},render:function(t){return t("uni-resize-sensor",{on:{"~animationstart":this.update}},[t("div",{on:{scroll:this.update}},[t("div")]),t("div",{on:{scroll:this.update}},[t("div")])])}},a=o,s=(n("64d0"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},"3f7e":function(t,e,n){"use strict";var i=n("1a33"),r=n.n(i);r.a},4043:function(t,e,n){"use strict";n.r(e),n.d(e,"setNavigationBarColor",function(){return r}),n.d(e,"setNavigationBarTitle",function(){return o});var i=["#ffffff","#000000"],r={frontColor:{type:String,required:!0,validator:function(t,e){if(-1===i.indexOf(t))return'invalid frontColor "'.concat(t,'"')}},backgroundColor:{type:String,required:!0},animation:{type:Object,default:function(){return{duration:0,timingFunc:"linear"}},validator:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;e.animation={duration:t.duration||0,timingFunc:t.timingFunc||"linear"}}}},o={title:{type:String,required:!0}}},"40ab":function(t,e,n){"use strict";n.r(e),n.d(e,"redirectTo",function(){return c}),n.d(e,"reLaunch",function(){return u}),n.d(e,"navigateTo",function(){return l}),n.d(e,"switchTab",function(){return h}),n.d(e,"navigateBack",function(){return d});var i=n("0f74");function r(t){if("string"!==typeof t)return t;var e=t.indexOf("?");if(-1===e)return t;var n=t.substr(e+1).trim().replace(/^(\?|#|&)/,"");if(!n)return t;t=t.substr(0,e);var i=[];return n.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),n=e.shift(),r=e.length>0?e.join("="):"";i.push(n+"="+encodeURIComponent(r))}),i.length?t+"?"+i.join("&"):t}function o(t){return function(e,n){e=Object(i["a"])(e);var o=e.split("?")[0],a=__uniRoutes.find(function(t){var e=t.path,n=t.alias;return e===o||n===o});if(!a)return"page `"+e+"` is not found";if("navigateTo"===t||"redirectTo"===t){if(a.meta.isTabBar)return"can not ".concat(t," a tabbar page")}else if("switchTab"===t&&!a.meta.isTabBar)return"can not switch to no-tabBar page";a.meta.isTabBar&&(e=o),a.meta.isEntry&&(e=e.replace(a.alias,"/")),n.url=r(e)}}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.assign({url:{type:String,required:!0,validator:o(t)}},e)}function s(t){return{animationType:{type:String,validator:function(e){if(e&&-1===t.indexOf(e))return"`"+e+"` is not supported for `animationType` (supported values are: `"+t.join("`|`")+"`)"}},animationDuration:{type:Number}}}var c=a("redirectTo"),u=a("reLaunch"),l=a("navigateTo",s(["slide-in-right","slide-in-left","slide-in-top","slide-in-bottom","fade-in","zoom-out","zoom-fade-out","pop-in","none"])),h=a("switchTab"),d=Object.assign({delta:{type:Number,validator:function(t,e){t=parseInt(t)||1,e.delta=Math.min(getCurrentPages().length-1,t)}}},s(["slide-out-right","slide-out-left","slide-out-top","slide-out-bottom","fade-out","zoom-in","zoom-fade-in","pop-out","none"]))},"439a":function(t,e,n){"use strict";n.r(e),n.d(e,"downloadFile",function(){return i});var i={url:{type:String,required:!0},header:{type:Object,validator:function(t,e){e.header=t||{}}}}},"442e":function(t,e,n){"use strict";n.r(e),function(t){var e=n("8bbf"),i=n.n(e),r=n("5129"),o=n.n(r),a=i.a.config.isReservedTag;i.a.config.isReservedTag=function(t){return-1!==o.a.indexOf(t)||a(t)},i.a.config.ignoredElements=o.a;var s=i.a.config.getTagNamespace,c=["switch","image","text","view"];i.a.config.getTagNamespace=function(t){return!~c.indexOf(t)&&(s(t)||!1)},i.a.config.errorHandler=function(e,n,i){t.emit("onError",e)}}.call(this,n("0dd1"))},"44de":function(t,e,n){"use strict";n.r(e),n.d(e,"vibrateLong",function(){return r}),n.d(e,"vibrateShort",function(){return o});var i=!!window.navigator.vibrate;function r(){return i&&window.navigator.vibrate(400)?{errMsg:"vibrateLong:ok"}:{errMsg:"vibrateLong:fail"}}function o(){return i&&window.navigator.vibrate(15)?{errMsg:"vibrateShort:ok"}:{errMsg:"vibrateShort:fail"}}},4509:function(t,e,n){},"45ae":function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=t.data,r={type:"object"===i(n)?"object":"string",data:n};localStorage.setItem(e,JSON.stringify(r));var o=localStorage.getItem("uni-storage-keys");if(o){var a=JSON.parse(o);a.indexOf(e)<0&&(a.push(e),localStorage.setItem("uni-storage-keys",JSON.stringify(a)))}else localStorage.setItem("uni-storage-keys",JSON.stringify([e]));return{errMsg:"setStorage:ok"}}function o(t,e){r({key:t,data:e})}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=localStorage.getItem(e);return n?{data:JSON.parse(n).data,errMsg:"getStorage:ok"}:{data:"",errMsg:"getStorage:fail"}}function s(t){var e=a({key:t});return e.data}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=localStorage.getItem("uni-storage-keys");if(n){var i=JSON.parse(n),r=i.indexOf(e);i.splice(r,1),localStorage.setItem("uni-storage-keys",JSON.stringify(i))}return localStorage.removeItem(e),{errMsg:"removeStorage:ok"}}function u(t){c({key:t})}function l(){return localStorage.clear(),{errMsg:"clearStorage:ok"}}function h(){l()}function d(){var t=localStorage.getItem("uni-storage-keys");return t?{keys:JSON.parse(t),currentSize:0,limitSize:0,errMsg:"getStorageInfo:ok"}:{keys:"",currentSize:0,limitSize:0,errMsg:"getStorageInfo:fail"}}function f(){var t=d();return delete t.errMsg,t}n.r(e),n.d(e,"setStorage",function(){return r}),n.d(e,"setStorageSync",function(){return o}),n.d(e,"getStorage",function(){return a}),n.d(e,"getStorageSync",function(){return s}),n.d(e,"removeStorage",function(){return c}),n.d(e,"removeStorageSync",function(){return u}),n.d(e,"clearStorage",function(){return l}),n.d(e,"clearStorageSync",function(){return h}),n.d(e,"getStorageInfo",function(){return d}),n.d(e,"getStorageInfoSync",function(){return f})},4871:function(t,e,n){},"488c":function(t,e,n){},"4a59":function(t,e,n){"use strict";(function(t){function i(e,n,i){t.UniServiceJSBridge.subscribeHandler(e,n,i)}n.d(e,"a",function(){return i})}).call(this,n("24aa"))},"4c68":function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return a}),n.d(e,"a",function(){return s});n("5abe");var i=n("85b6");function r(t){return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}var o={};function a(e,n){var a=e.reqId,s=e.options,c=getCurrentPages(),u=c.find(function(t){return t.$page.id===n});if(!u)throw new Error("Not Found:Page[".concat(n,"]"));var l=u.$el,h=s.relativeToSelector?l.querySelector(s.relativeToSelector):null,d=o[a]=new IntersectionObserver(function(e,n){e.forEach(function(e){t.publishHandler("onRequestComponentObserver",{reqId:a,res:{intersectionRatio:e.intersectionRatio,intersectionRect:r(e.intersectionRect),boundingClientRect:r(e.boundingClientRect),relativeRect:r(e.rootBounds),time:Date.now(),dataset:Object(i["c"])(e.target.dataset||{}),id:e.target.id}},u.$page.id)})},{root:h,rootMargin:s.rootMargin,threshold:s.thresholds});s.observeAll?(d.USE_MUTATION_OBSERVER=!0,Array.prototype.map.call(l.querySelectorAll(s.selector),function(t){d.observe(t)})):(d.USE_MUTATION_OBSERVER=!1,d.observe(l.querySelector(s.selector)))}function s(e){var n=e.reqId,i=o[n];i&&(i.disconnect(),t.publishHandler("onRequestComponentObserver",{reqId:n,reqEnd:!0}))}}).call(this,n("501c"))},"4ca9":function(t,e,n){"use strict";n.r(e),function(t){var i=n("6389"),r=n.n(i),o=n("85b6"),a=n("abbf"),s=n("0784"),c=n("aa92"),u=n("23e5");function l(t){var e=0;return t.forEach(function(t){t.meta.id&&e++}),e}function h(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":decodeURI(t.slice(e+1))}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=decodeURI(window.location.pathname);return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}e["default"]={install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.routes;Object(c["a"])(e);var f=l(i),p=new r.a({id:f,mode:__uniConfig.router.mode,base:__uniConfig.router.base,routes:i,scrollBehavior:function(t,e,n){if(n)return n;if(t&&e&&t.meta.isTabBar&&e.meta.isTabBar){var i=Object(u["b"])(t.params.__id__);if(i)return i}return{x:0,y:0}}}),g=[],m=p.match("history"===__uniConfig.router.mode?d(__uniConfig.router.base):h());if(m.meta.name&&(m.meta.id?g.push(m.meta.name+"-"+m.meta.id):g.push(m.meta.name+"-"+(f+1))),m.meta&&m.meta.name&&(document.body.className="uni-body "+m.meta.name,m.meta.isNVue)){var v="nvue-dir-"+__uniConfig.nvue["flex-direction"];document.body.setAttribute("nvue",""),document.body.setAttribute(v,"")}e.mixin({beforeCreate:function(){var e=this.$options;if("app"===e.mpType){e.data=function(){return{keepAliveInclude:g}};var n=Object(a["a"])(i,m);Object.keys(n).forEach(function(t){e[t]=e[t]?[].concat(n[t],e[t]):[n[t]]}),e.router=p,Array.isArray(e.onError)&&0!==e.onError.length||(e.onError=[function(e){t.error(e)}])}else if(Object(o["b"])(this)){var r=Object(s["a"])();Object.keys(r).forEach(function(t){e[t]=e[t]?[].concat(r[t],e[t]):[r[t]]})}else this.$parent&&this.$parent.__page__&&(this.__page__=this.$parent.__page__)}}),Object.defineProperty(e.prototype,"$page",{get:function(){return this.__page__}}),e.prototype.createSelectorQuery=function(){return uni.createSelectorQuery().in(this)},e.prototype.createIntersectionObserver=function(t){return uni.createIntersectionObserver(this,t)},e.use(r.a)}}}.call(this,n("3ad9")["default"])},"4da7":function(t,e,n){"use strict";n.r(e);var i,r,o=n("4f97"),a=o["a"],s=(n("c8ed"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},"4ec0":function(t,e,n){"use strict";(function(t,i){var r=n("f2b3"),o=n("65a8"),a=n("81ea"),s=n("f1ea");e["a"]={name:"App",components:a["a"],mixins:s["default"],props:{keepAliveInclude:{type:Array,default:function(){return[]}}},data:function(){return{transitionName:"fade",hideTabBar:!1,tabBar:__uniConfig.tabBar||{}}},computed:{key:function(){return this.$route.meta.name+"-"+this.$route.params.__id__+"-"+(__uniConfig.reLaunch||1)},hasTabBar:function(){return __uniConfig.tabBar&&__uniConfig.tabBar.list&&__uniConfig.tabBar.list.length},showTabBar:function(){return this.$route.meta.isTabBar&&!this.hideTabBar}},watch:{$route:function(e,n){t.emit("onHidePopup")},hideTabBar:function(t,e){if(uni.canIUse("css.var")){var n=t?"0px":o["b"]+"px";document.documentElement.style.setProperty("--window-bottom",n),i.debug("uni.".concat(n?"showTabBar":"hideTabBar",":--window-bottom=").concat(n))}window.dispatchEvent(new CustomEvent("resize"))}},created:function(){uni.canIUse("css.var")&&document.documentElement.style.setProperty("--status-bar-height","0px")},mounted:function(){window.addEventListener("message",function(e){Object(r["f"])(e.data)&&"WEB_INVOKE_APPSERVICE"===e.data.type&&t.emit("onWebInvokeAppService",e.data.data,e.data.pageId)}),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState?t.emit("onAppEnterForeground"):t.emit("onAppEnterBackground")})}}}).call(this,n("0dd1"),n("3ad9")["default"])},"4f1c":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-switch",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-switch-wrapper"},[n("div",{directives:[{name:"show",rawName:"v-show",value:"switch"===t.type,expression:"type === 'switch'"}],staticClass:"uni-switch-input",class:[t.switchChecked?"uni-switch-input-checked":""],style:{backgroundColor:t.switchChecked?t.color:"#DFDFDF",borderColor:t.switchChecked?t.color:"#DFDFDF"}}),n("div",{directives:[{name:"show",rawName:"v-show",value:"checkbox"===t.type,expression:"type === 'checkbox'"}],staticClass:"uni-checkbox-input",class:[t.switchChecked?"uni-checkbox-input-checked":""],style:{color:t.color}})])])},r=[],o=n("8af1"),a={name:"Switch",mixins:[o["a"],o["c"]],props:{name:{type:String,default:""},checked:{type:[Boolean,String],default:!1},type:{type:String,default:"switch"},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007aff"}},data:function(){return{switchChecked:this.checked}},watch:{checked:function(t){this.switchChecked=t}},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},listeners:{"label-click":"_onClick","@label-click":"_onClick"},methods:{_onClick:function(t){this.disabled||(this.switchChecked=!this.switchChecked,this.$trigger("change",t,{value:this.switchChecked}))},_resetFormData:function(){this.switchChecked=!1},_getFormData:function(){var t={};return""!==this.name&&(t["value"]=this.switchChecked,t["key"]=this.name),t}}},s=a,c=(n("a5ec"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"4f43":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"downloadFile",function(){return u});var i=n("e2e2");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")),t}},render:function(e){var n=this,i=[];return this.$slots.default&&this.$slots.default.forEach(function(r){if(r.text){var o=r.text.replace(/\\n/g,"\n"),a=o.split("\n");a.forEach(function(t,r){i.push(n._decodeHtml(t)),r!==a.length-1&&i.push(e("br"))})}else r.componentOptions&&"v-uni-text"!==r.componentOptions.tag&&t.warn(" 组件内只支持嵌套 ,不支持其它组件或自定义组件,否则会引发在不同平台的渲染差异。"),i.push(r)}),e("uni-text",{on:this.$listeners,attrs:{selectable:!!this.selectable}},[e("span",{},i)])}}}).call(this,n("3ad9")["default"])},"4fef":function(t,e,n){"use strict";var i=n("2fb0"),r=n.n(i);r.a},"500a":function(t,e,n){},"501c":function(t,e,n){"use strict";n.r(e),n.d(e,"on",function(){return c}),n.d(e,"off",function(){return u}),n.d(e,"once",function(){return l}),n.d(e,"emit",function(){return h}),n.d(e,"subscribe",function(){return d}),n.d(e,"unsubscribe",function(){return f}),n.d(e,"subscribeHandler",function(){return p});var i=n("8bbf"),r=n.n(i),o=n("8ecd"),a=n("4a59");n.d(e,"publishHandler",function(){return a["a"]});var s=new r.a,c=s.$on.bind(s),u=s.$off.bind(s),l=s.$once.bind(s),h=s.$emit.bind(s);function d(t,e){return c("service."+t,e)}function f(t,e){return u("service."+t,e)}function p(t,e,n){h("service."+t,e,n)}Object(o["a"])(d)},5129:function(t,e){t.exports=["uni-app","uni-tabbar","uni-page","uni-page-head","uni-page-wrapper","uni-page-body","uni-page-refresh","uni-actionsheet","uni-modal","uni-picker","uni-toast","uni-resize-sensor","uni-ad","uni-audio","uni-button","uni-camera","uni-canvas","uni-checkbox","uni-checkbox-group","uni-cover-image","uni-cover-view","uni-form","uni-functional-page-navigator","uni-image","uni-input","uni-label","uni-live-player","uni-live-pusher","uni-map","uni-movable-area","uni-movable-view","uni-navigator","uni-official-account","uni-open-data","uni-picker","uni-picker-view","uni-picker-view-column","uni-progress","uni-radio","uni-radio-group","uni-rich-text","uni-scroll-view","uni-slider","uni-swiper","uni-swiper-item","uni-switch","uni-text","uni-textarea","uni-video","uni-view","uni-web-view"]},5363:function(t,e,n){"use strict";function i(t){this._drag=t,this._dragLog=Math.log(t),this._x=0,this._v=0,this._startTime=0}n.d(e,"a",function(){return i}),i.prototype.set=function(t,e){this._x=t,this._v=e,this._startTime=(new Date).getTime()},i.prototype.setVelocityByEnd=function(t){this._v=(t-this._x)*this._dragLog/(Math.pow(this._drag,100)-1)},i.prototype.x=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._x+this._v*e/this._dragLog-this._v/this._dragLog},i.prototype.dx=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._v*e},i.prototype.done=function(){return Math.abs(this.dx())<3},i.prototype.reconfigure=function(t){var e=this.x(),n=this.dx();this._drag=t,this._dragLog=Math.log(t),this.set(e,n)},i.prototype.configuration=function(){var t=this;return[{label:"Friction",read:function(){return t._drag},write:function(e){t.reconfigure(e)},min:.001,max:.1,step:.001}]}},"53f0":function(t,e,n){},5408:function(t,e,n){var i={"./button/index.vue":"d3bd","./canvas/index.vue":"bacd","./checkbox-group/index.vue":"25ce","./checkbox/index.vue":"7bb3","./form/index.vue":"b34d","./image/index.vue":"1082","./input/index.vue":"250d","./label/index.vue":"70f4","./movable-area/index.vue":"c61c","./movable-view/index.vue":"8842","./navigator/index.vue":"17fd","./picker-view-column/index.vue":"1955","./picker-view/index.vue":"27ab","./picker/index.vue":"c35d","./progress/index.vue":"9b1f","./radio-group/index.vue":"d5ec","./radio/index.vue":"6491","./resize-sensor/index.vue":"3e8c","./rich-text/index.vue":"b705","./scroll-view/index.vue":"f1ef","./slider/index.vue":"9f96","./swiper-item/index.vue":"9213","./swiper/index.vue":"5513","./switch/index.vue":"4f1c","./text/index.vue":"4da7","./textarea/index.vue":"5768","./view/index.vue":"2bbe"};function r(t){var e=o(t);return n(e)}function o(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=o,t.exports=r,r.id="5408"},5513:function(t,e,n){"use strict";n.r(e);var i,r,o=n("ba15"),a={name:"Swiper",mixins:[o["a"]],props:{indicatorDots:{type:[Boolean,String],default:!1},vertical:{type:[Boolean,String],default:!1},autoplay:{type:[Boolean,String],default:!1},circular:{type:[Boolean,String],default:!1},interval:{type:[Number,String],default:5e3},duration:{type:[Number,String],default:500},current:{type:[Number,String],default:0},indicatorColor:{type:String,default:""},indicatorActiveColor:{type:String,default:""},previousMargin:{type:String,default:""},nextMargin:{type:String,default:""},currentItemId:{type:String,default:""},skipHiddenItemLayout:{type:[Boolean,String],default:!1},displayMultipleItems:{type:[Number,String],default:1}},data:function(){return{currentSync:Math.round(this.current)||0,currentItemIdSync:this.currentItemId||"",userTracking:!1,currentChangeSource:"",items:[]}},computed:{intervalNumber:function(){var t=Number(this.interval);return isNaN(t)?5e3:t},durationNumber:function(){var t=Number(this.duration);return isNaN(t)?500:t},displayMultipleItemsNumber:function(){var t=Math.round(this.displayMultipleItems);return isNaN(t)?1:t},slidesStyle:function(){var t={};return(this.nextMargin||this.previousMargin)&&(t=this.vertical?{left:0,right:0,top:this._upx2px(this.previousMargin),bottom:this._upx2px(this.nextMargin)}:{top:0,bottom:0,left:this._upx2px(this.previousMargin),right:this._upx2px(this.nextMargin)}),t},slideFrameStyle:function(){var t=Math.abs(100/this.displayMultipleItemsNumber)+"%";return{width:this.vertical?"100%":t,height:this.vertical?t:"100%"}},circularEnabled:function(){return this.circular&&this.items.length>this.displayMultipleItemsNumber}},watch:{vertical:function(){this._resetLayout()},circular:function(){this._resetLayout()},intervalNumber:function(t){this._timer&&(this._cancelSchedule(),this._scheduleAutoplay())},current:function(t){this._currentCheck()},currentSync:function(t){this._currentChanged(t),this.$emit("update:current",t)},currentItemId:function(t){this._currentCheck()},currentItemIdSync:function(t){this.$emit("update:currentItemId",t)},displayMultipleItemsNumber:function(){this._resetLayout()}},created:function(){this._invalid=!0,this._viewportPosition=0,this._viewportMoveRatio=1,this._animating=null,this._requestedAnimation=!1,this._userDirectionChecked=!1,this._contentTrackViewport=0,this._contentTrackSpeed=0,this._contentTrackT=0},mounted:function(){var t=this;this._currentCheck(),this.touchtrack(this.$refs.slidesWrapper,"_handleContentTrack",!0),this._resetLayout(),this.$watch(function(){return t.autoplay&&!t.userTracking},this._inintAutoplay),this._inintAutoplay(this.autoplay&&!this.userTracking),this.$watch("items.length",this._resetLayout)},beforeDestroy:function(){this._cancelSchedule()},methods:{_inintAutoplay:function(t){t?this._scheduleAutoplay():this._cancelSchedule()},_currentCheck:function(){var t=-1;if(this.currentItemId)for(var e=0,n=this.items;ee-this.displayMultipleItemsNumber)return e-this.displayMultipleItemsNumber;return n},_upx2px:function(t){return/\d+[ur]px$/i.test(t)&&t.replace(/\d+[ur]px$/i,function(t){return"".concat(uni.upx2px(parseFloat(t)),"px")}),t||""},_resetLayout:function(){if(this._isMounted){this._cancelSchedule(),this._endViewportAnimation();for(var t=this.items,e=0;e0&&this._viewportMoveRatio<1||(this._viewportMoveRatio=1)}var r=this._viewportPosition;this._viewportPosition=-2;var o=this.currentSync;o>=0?(this._invalid=!1,this.userTracking?(this._updateViewport(r+o-this._contentTrackViewport),this._contentTrackViewport=o):(this._updateViewport(o),this.autoplay&&this._scheduleAutoplay())):(this._invalid=!0,this._updateViewport(-this.displayMultipleItemsNumber-1))}},_checkCircularLayout:function(t){if(!this._invalid)for(var e=this.items,n=e.length,i=t+this.displayMultipleItemsNumber,r=0;rt;)o-=r}else if(n>0){for(;o>t;)o-=r;for(;o+rt;)o-=r;o+r-tr)&&(i<0?i=-o(-i):i>r&&(i=r+o(i-r)),e._contentTrackSpeed=0),e._updateViewport(i)}var s=this._contentTrackT-n||1;this.vertical?a(-t.dy/this.$refs.slideFrame.offsetHeight,-t.ddy/s):a(-t.dx/this.$refs.slideFrame.offsetWidth,-t.ddx/s)},_handleTrackEnd:function(t){this.userTracking=!1;var e=this._contentTrackSpeed/Math.abs(this._contentTrackSpeed),n=0;!t&&Math.abs(this._contentTrackSpeed)>.2&&(n=.5*e);var i=this._normalizeCurrentValue(this._viewportPosition+n);t?this._updateViewport(this._contentTrackViewport):(this.currentChangeSource="touch",this.currentSync=i,this._animateViewport(i,"touch",0!==n?n:0===i&&this.circularEnabled&&this._viewportPosition>=1?1:0))},_handleContentTrack:function(t){if(!this._invalid){if("start"===t.detail.state)return this.userTracking=!0,this._userDirectionChecked=!1,this._handleTrackStart();if("end"===t.detail.state)return this._handleTrackEnd(!1);if("cancel"===t.detail.state)return this._handleTrackEnd(!0);if(this.userTracking){if(!this._userDirectionChecked){this._userDirectionChecked=!0;var e=Math.abs(t.detail.dx),n=Math.abs(t.detail.dy);if(e>=n&&this.vertical?this.userTracking=!1:e<=n&&!this.vertical&&(this.userTracking=!1),!this.userTracking)return void(this.autoplay&&this._scheduleAutoplay())}return this._handleTrackMove(t.detail),!1}}}},render:function(t){var e=[],n=[];this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"v-uni-swiper-item"===t.componentOptions.tag&&n.push(t)});for(var i=0,r=n.length;i=o||i-1&&this.selectionEndNumber>-1&&(this.$refs.textarea.selectionStart=this.selectionStartNumber,this.$refs.textarea.selectionEnd=this.selectionEndNumber)},_checkCursor:function(){this.focusSync&&("focus"===this.focusChangeSource||!this.focusChangeSource&&this.selectionStartNumber<0&&this.selectionEndNumber<0)&&this.cursorNumber>-1&&(this.$refs.textarea.selectionEnd=this.$refs.textarea.selectionStart=this.cursorNumber)},_blur:function(t){this.focusSync=!1,this.$trigger("blur",t,{value:this.valueSync,cursor:this.$refs.textarea.selectionEnd})},_compositionstart:function(t){this.composition=!0},_compositionend:function(t){this.composition=!1},_confirm:function(t){this.$trigger("confirm",t,{value:this.valueSync})},_linechange:function(t){this.$trigger("linechange",t,{value:this.valueSync})},_touchstart:function(){this.focusChangeSource="touch"},_resize:function(t){var e=t.height;this.height=e},_input:function(t){this.composition&&(this.valueComposition=t.target.value)},_getFormData:function(){return{value:this.valueSync,key:this.name}},_resetFormData:function(){this.valueSync=""},_checkEmpty:function(t){return t||!1}}},s=a,c=(n("9400"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"580e":function(t,e,n){"use strict";(function(t){var i=n("bab8");e["a"]={name:"SystemChooseLocation",components:{SystemHeader:i["a"]},data:function(){return{src:"",data:null}},mounted:function(){var t=this,e=__uniConfig.qqMapKey;this.src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=".concat(e,"&referer=uniapp"),window.addEventListener("message",function(e){var n=e.data;n&&"locationPicker"===n.module&&(t.data={name:n.poiname,address:n.poiaddress,latitude:n.latlng.lat,longitude:n.latlng.lng})},!1)},methods:{_choose:function(){this.data&&(t.publishHandler("onChooseLocation",this.data),getApp().$router.back())},_back:function(){t.publishHandler("onChooseLocation",null),getApp().$router.back()}}}}).call(this,n("501c"))},"594d":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-map",{attrs:{id:t.id}},[n("div",{ref:"map",staticStyle:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}}),n("div",{staticStyle:{position:"absolute",top:"0",width:"100%",height:"100%",overflow:"hidden","pointer-events":"none"}},[t._t("default")],2)])},r=[],o=n("635e"),a=o["a"],s=(n("3f7e"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},5964:function(t,e,n){"use strict";function i(t,e){var n=getCurrentPages();if(n.length){var i=n[n.length-1].$holder;switch(t){case"setNavigationBarColor":var r=e.frontColor,o=e.backgroundColor,a=e.animation,s=a.duration,c=a.timingFunc;r&&(i.navigationBar.textColor="#000000"===r?"black":"white"),o&&(i.navigationBar.backgroundColor=o),i.navigationBar.duration=s+"ms",i.navigationBar.timingFunc=c;break;case"showNavigationBarLoading":i.navigationBar.loading=!0;break;case"hideNavigationBarLoading":i.navigationBar.loading=!1;break;case"setNavigationBarTitle":var u=e.title;i.navigationBar.titleText=u,document.title=u;break}}return{}}function r(t){return i("setNavigationBarColor",t)}function o(){return i("showNavigationBarLoading")}function a(){return i("hideNavigationBarLoading")}function s(t){return i("setNavigationBarTitle",t)}n.r(e),n.d(e,"setNavigationBarColor",function(){return r}),n.d(e,"showNavigationBarLoading",function(){return o}),n.d(e,"hideNavigationBarLoading",function(){return a}),n.d(e,"setNavigationBarTitle",function(){return s})},"5a56":function(t,e,n){"use strict";n.r(e),e["default"]={methods:{beforeTransition:function(){},afterTransition:function(){}}}},"5ab3":function(t,e,n){"use strict";var i=n("fcd8"),r=n.n(i);r.a},"5abe":function(t,e){(function(){"use strict";if("object"===typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=window.document,e=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i.prototype.observe=function(t){var e=this._observationTargets.some(function(e){return e.element==t});if(!e){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},i.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},i.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},i.prototype._parseRootMargin=function(t){var e=t||"0px",n=e.split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(a(window,"resize",this._checkForIntersections,!0),a(t,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(window,"resize",this._checkForIntersections,!0),s(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():l();this._observationTargets.forEach(function(i){var o=i.element,a=u(o),s=this._rootContainsTarget(o),c=i.entry,l=t&&s&&this._computeTargetAndRootIntersection(o,e),h=i.entry=new n({time:r(),target:o,boundingClientRect:a,rootBounds:e,intersectionRect:l});c?t&&s?this._hasCrossedThreshold(c,h)&&this._queuedEntries.push(h):c&&c.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(e,n){if("none"!=window.getComputedStyle(e).display){var i=u(e),r=i,o=d(e),a=!1;while(!a){var s=null,l=1==o.nodeType?window.getComputedStyle(o):{};if("none"==l.display)return;if(o==this.root||o==t?(a=!0,s=n):o!=t.body&&o!=t.documentElement&&"visible"!=l.overflow&&(s=u(o)),s&&(r=c(s,r),!r))break;o=d(o)}return r}},i.prototype._getRootRect=function(){var e;if(this.root)e=u(this.root);else{var n=t.documentElement,i=t.body;e={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(e)},i.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},i.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,i=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==i)for(var r=0;r=0&&s>=0&&{top:n,bottom:i,left:r,right:o,width:a,height:s}}function u(t){var e;try{e=t.getBoundingClientRect()}catch(n){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):l()}function l(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function h(t,e){var n=e;while(n){if(n==t)return!0;n=d(n)}return!1}function d(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e&&e.assignedSlot?e.assignedSlot.parentNode:e}})()},"5b1e":function(t,e,n){"use strict";(function(t){var i=n("cb0f");e["a"]={name:"TabBar",props:{position:{default:"bottom",validator:function(t){return-1!==["bottom","top"].indexOf(t)}},color:{type:String,default:"#999"},selectedColor:{type:String,default:"#007aff"},backgroundColor:{type:String,default:"#f7f7fa"},borderStyle:{default:"black",validator:function(t){return-1!==["black","white"].indexOf(t)}},list:{type:Array,default:function(){return[]}}},computed:{borderColor:function(){return"white"===this.borderStyle?"rgba(255, 255, 255, 0.33)":"rgba(0, 0, 0, 0.33)"}},watch:{$route:function(t,e){t.meta.isTabBar&&(this.__path__=t.path)}},beforeCreate:function(){this.__path__=this.$route.path},methods:{_getRealPath:function(t){return 0!==t.indexOf("/")&&(t="/"+t),Object(i["a"])(t)},_switchTab:function(e,n){var i=e.text,r=e.pagePath,o="/"+r;o===__uniRoutes[0].alias&&(o="/");var a={index:n,text:i,pagePath:r};this.$route.path!==o?(this.__path__=this.$route.path,uni.switchTab({from:"tabBar",url:o,detail:a})):t.emit("onTabItemTap",a)}}}}).call(this,n("0dd1"))},"5d1d":function(t,e,n){"use strict";var i=n("91b0"),r=n.n(i);r.a},6062:function(t,e,n){"use strict";var i=n("748c"),r=n.n(i);r.a},6144:function(t,e,n){},"61c2":function(t,e,n){"use strict";var i=n("f2b3"),r=n("8af1");function o(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})}function a(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})}var s={name:"uni://form-field",init:function(t,e){e.constructor.options.props&&e.constructor.options.props.name&&e.constructor.options.props.value||(e.constructor.options.props||(e.constructor.options.props={}),e.constructor.options.props.name||(e.constructor.options.props.name=t.props.name={type:String}),e.constructor.options.props.value||(e.constructor.options.props.value=t.props.value={type:null})),t.propsData||(t.propsData={});var n=e.$vnode;if(n&&n.data&&n.data.attrs&&(Object(i["c"])(n.data.attrs,"name")&&(t.propsData.name=n.data.attrs.name),Object(i["c"])(n.data.attrs,"value")&&(t.propsData.value=n.data.attrs.value)),!e.constructor.options.methods||!e.constructor.options.methods._getFormData){e.constructor.options.methods||(e.constructor.options.methods={}),t.methods||(t.methods={});var s={_getFormData:function(){return this.name?{key:this.name,value:this.value}:{}},_resetFormData:function(){this.value=""}};Object.assign(e.constructor.options.methods,s),Object.assign(t.methods,s),Object.assign(e.constructor.options.methods,r["a"].methods),Object.assign(t.methods,r["a"].methods);var c=t["created"];e.constructor.options["created"]=t["created"]=c?[].concat(o,c):[o];var u=t["beforeDestroy"];e.constructor.options["beforeDestroy"]=t["beforeDestroy"]=u?[].concat(a,u):[a]}}};function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return l});var u=c({},s.name,s);function l(t,e){t.behaviors.forEach(function(n){var i=u[n];i&&i.init(t,e)})}},6226:function(t,e,n){"use strict";var i=n("e670"),r=n.n(i);r.a},6258:function(t,e,n){"use strict";(function(t){var i=n("5a56");e["a"]={name:"Toast",mixins:[i["default"]],props:{title:{type:String,default:""},icon:{default:"success",validator:function(t){return-1!==["success","loading","none"].indexOf(t)}},image:{type:String,default:""},duration:{type:Number,default:1500},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},computed:{iconClass:function(){return"success"===this.icon?"uni-icon-success-no-circle":"loading"===this.icon?"uni-loading":void 0}},beforeUpdate:function(){this.visible&&(this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(function(){t.emit("onHideToast")},this.duration))}}}).call(this,n("0dd1"))},"626d":function(t,e,n){"use strict";n.r(e),function(t){var i=n("f2b3");e["default"]={data:function(){return{showActionSheet:{visible:!1}}},created:function(){var e=this;t.on("onShowActionSheet",function(t,n){e.showActionSheet=t,e.onActionSheetCloseCallback=n}),t.on("onHidePopup",function(t){e.showActionSheet.visible=!1})},methods:{_onActionSheetClose:function(t){this.showActionSheet.visible=!1,Object(i["e"])(this.onActionSheetCloseCallback)&&this.onActionSheetCloseCallback(t)}}}}.call(this,n("0dd1"))},"62b5":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var i={};function r(t){var e=i[t];return e||(e={id:1,callbacks:Object.create(null)},i[t]=e),{get:function(t){return e.callbacks[t]},pop:function(t){var n=e.callbacks[t];return n&&delete e.callbacks[t],n},push:function(t){var n=e.id++;return e.callbacks[n]=t,n}}}},"635e":function(t,e,n){"use strict";(function(t){var i,r=n("8af1"),o=n("f2b3");e["a"]={name:"Map",mixins:[r["d"]],props:{id:{type:String,default:""},latitude:{type:[String,Number],default:39.92},longitude:{type:[String,Number],default:116.46},scale:{type:[String,Number],default:16},markers:{type:Array,default:function(){return[]}},covers:{type:Array,default:function(){return[]}},includePoints:{type:Array,default:function(){return[]}},polyline:{type:Array,default:function(){return[]}},circles:{type:Array,default:function(){return[]}},controls:{type:Array,default:function(){return[]}},showLocation:{type:[Boolean,String],default:!1}},data:function(){return{center:{latitude:116.46,longitude:116.46},isMapReady:!1,isBoundsReady:!1,markersSync:[],polylineSync:[],circlesSync:[],controlsSync:[]}},watch:{latitude:function(){this.centerChange()},longitude:function(){this.centerChange()},scale:function(t){var e=this;this.mapReady(function(){e._map.setZoom(Number(t)||16)})},markers:function(t,e){var n=this;this.mapReady(function(){var i=[],r=[],o=[],a=[],s=[];t.forEach(function(t){if("id"in t){for(var n=!1,s=0;s=0?(e=o.indexOf(i))>=0&&n.changeMarker(t,a[e]):s.push(t)}),n.removeMarkers(s),n.createMarkers(i)})},polyline:function(t){var e=this;this.mapReady(function(){e.createPolyline()})},circles:function(){var t=this;this.mapReady(function(){t.createCircles()})},controls:function(){var t=this;this.mapReady(function(){t.createControls()})},includePoints:function(){var t=this;this.mapReady(function(){t.fitBounds(t.includePoints)})},showLocation:function(t){var e=this;this.mapReady(function(){e[t?"createLocation":"removeLocation"]()})}},created:function(){var t=this.latitude,e=this.longitude;t&&e&&(this.center.latitude=t,this.center.longitude=e)},mounted:function(){var t=this;this.loadMap(function(){t.init()})},beforeDestroy:function(){this.removeMarkers(this.markersSync),this.removePolyline(),this.removeCircles(),this.removeControls(),this.removeLocation()},methods:{_handleSubscribe:function(t){var e=this,n=t.type,r=t.data,o=void 0===r?{}:r;function a(t,e){t=t||{},t.errMsg="".concat(n,":").concat(e?"fail"+e:"ok");var i=e?o.fail:o.success;"function"===typeof i&&i(t),"function"===typeof o.complete&&o.complete(t)}switch(n){case"getCenterLocation":this.mapReady(function(){var t,n,i=e._map.getCenter();t=i.getLat(),n=i.getLng(),a({latitude:t,longitude:n})});break;case"moveToLocation":var s=this._locationPosition;s&&this._map.setCenter(s);break;case"translateMarker":this.mapReady(function(){try{var t=e.getMarker(o.markerId),n=o.destination,r=o.duration,s=!!o.autoRotate,c=Number(o.rotate)?o.rotate:0,u=t.getRotation(),l=t.getPosition(),h=new i.LatLng(n.latitude,n.longitude),d=i.geometry.spherical.computeDistanceBetween(l,h)/1e3,f=("number"===typeof r?r:1e3)/36e5,p=d/f,g=i.event.addListener(t,"moving",function(e){var n=e.latLng,i=t.label;i&&i.setPosition(n);var r=t.callout;r&&r.setPosition(n)}),m=i.event.addListener(t,"moveend",function(e){m.remove(),g.remove(),t.lastPosition=l,t.setPosition(h);var n=t.label;n&&n.setPosition(h);var i=t.callout;i&&i.setPosition(h);var r=o.animationEnd;"function"===typeof r&&r()}),v=0;s&&(t.lastPosition&&(v=i.geometry.spherical.computeHeading(t.lastPosition,l)),c=i.geometry.spherical.computeHeading(l,h)-v),t.setRotation(u+c),t.moveTo(h,p)}catch(b){a(null,b)}});break;case"includePoints":this.fitBounds(o.points);break;case"getRegion":this.boundsReady(function(){var t=e._map.getBounds(),n=t.getSouthWest(),i=t.getNorthEast();a({southwest:{latitude:n.getLat(),longitude:n.getLng()},northeast:{latitude:i.getLat(),longitude:i.getLng()}})});break;case"getScale":this.mapReady(function(){a({scale:Number(e.scale)})});break}},init:function(){var t=this,e=new i.LatLng(this.center.latitude,this.center.longitude),n=this._map=new i.Map(this.$refs.map,{center:e,zoom:Number(this.scale),scrollwheel:!1,disableDoubleClickZoom:!0,mapTypeControl:!1,zoomControl:!1,scaleControl:!1,minZoom:5,maxZoom:18,draggable:!0}),r=i.event.addListener(n,"bounds_changed",function(e){r.remove(),t.isBoundsReady=!0,t.$emit("boundsready")});i.event.addListener(n,"click",function(){t.$trigger("click",{},{})}),i.event.addListener(n,"dragstart",function(){t.$trigger("regionchange",{},{type:"begin"})}),i.event.addListener(n,"dragend",function(){t.$trigger("regionchange",{},{type:"end"})}),i.event.addListener(n,"zoom_changed",function(){t.$emit("update:scale",n.getZoom())}),i.event.addListener(n,"center_changed",function(){var e,i,r=n.getCenter();e=r.getLat(),i=r.getLng(),t.$emit("update:latitude",e),t.$emit("update:longitude",i)}),this.markers&&Array.isArray(this.markers)&&this.markers.length&&this.createMarkers(this.markers),this.polyline&&Array.isArray(this.polyline)&&this.polyline.length&&this.createPolyline(),this.circles&&Array.isArray(this.circles)&&this.circles.length&&this.createCircles(),this.controls&&Array.isArray(this.controls)&&this.controls.length&&this.createControls(),this.showLocation&&this.createLocation(),this.includePoints&&Array.isArray(this.includePoints)&&this.includePoints.length&&this.fitBounds(this.includePoints,function(){n.setCenter(e)}),this.isMapReady=!0,this.$emit("mapready")},centerChange:function(){var t=this,e=Number(this.latitude),n=Number(this.longitude);e===this.center.latitude&&n===this.center.longitude||(this.center.latitude=e,this.center.longitude=n,this._map&&this.mapReady(function(){t._map.setCenter(new i.LatLng(e,n))}))},createMarkers:function(t){var e=this,n=this._map,r=this.markersSync;t.forEach(function(t){var a=new i.Marker({map:n,flat:!0,autoRotation:!1});a.id=t.id,e.changeMarker(a,t),i.event.addListener(a,"click",function(n){var i=a.callout;if(i){var r=i.div,s=r.parentNode;i.alwaysVisible||i.set("visible",!i.visible),i.visible&&(s.removeChild(r),s.appendChild(r))}Object(o["c"])(t,"id")&&e.$trigger("markertap",{},{markerId:t.id})}),r.push(a)})},changeMarker:function(t,e){var n=this,r=this._map,a=e.title||e.name,s=new i.LatLng(e.latitude,e.longitude),c=new Image;c.onload=function(){var u,l,h,d,f=e.anchor||{},p=f.x,g=f.y;e.iconPath&&(e.width||e.height)?(l=e.width||c.width/c.height*e.height,h=e.height||c.height/c.width*e.width):(l=c.width/2,h=c.height/2),p=("number"===typeof p?p:.5)*l,g=("number"===typeof g?g:1)*h,d=h-(h-g),u=new i.MarkerImage(c.src,null,null,new i.Point(p,g),new i.Size(l,h)),t.setPosition(s),t.setIcon(u),t.setRotation(e.rotate||0);var m,v=e.label||{};t.label&&(t.label.setMap(null),delete t.label),v.content&&(m=new i.Label({position:s,map:r,clickable:!1,content:v.content,style:{border:"none",padding:"8px",background:"none",color:v.color,fontSize:(v.fontSize||14)+"px",lineHeight:(v.fontSize||14)+"px",marginLeft:v.x,marginTop:v.y}}),t.label=m);var b,y=e.callout||{},_=t.callout;y.content?b={id:e.id,position:s,map:r,top:d,content:y.content,color:y.color,fontSize:y.fontSize,borderRadius:y.borderRadius,bgColor:y.bgColor,padding:y.padding,boxShadow:y.boxShadow,display:y.display}:a&&(b={id:e.id,position:s,map:r,top:d,content:a,boxShadow:"0px 0px 3px 1px rgba(0,0,0,0.5)"}),b?_?_.setOption(b):(_=t.callout=new i.Callout(b),_.div.onclick=function(t){Object(o["c"])(e,"id")&&n.$trigger("callouttap",t,{markerId:e.id}),t.stopPropagation(),t.preventDefault()}):_&&(_.setMap(null),delete t.callout)},c.src=e.iconPath?this.$getRealPath(e.iconPath):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAABQCAYAAABFyhZTAAANDElEQVR4nNWce4hc133Hv+fc92MeuytpV5ZXll2XuvTlUBTSP1IREsdNiKGEEAgE3EBLaBtK/2hNoQTStISUosiGOqVpQ+qkIdAax1FiG+oYIxyD4xi3uKlEXSFFke3d1e5od+a+H+ec/nHvmbkzs6ud2bmjTX7wY3b3zr3nfM7vd37n8Tt3CW6DiDP3EABSd/0KAEEuXBHzrsteFTiwVOBo+amUP9PK34ZuAcD30NoboTZgceYeCaQAUEvVAKiZ0lpiiv0Lgmi/imFLF5YV2SWFR1e0fGcDQF5qVn4y1Ag/E3DFmhJSB2Dk1D2Squ0HBdT3C0JPE6oco6oKqmm7PodnGXieQ3DWIYL/iCB/UWO95zTW2wCQlpqhgJ8J/MDApUUVFFY0AFiRdvwMJ8bvCaKcUW3bUE0DimGAKMpkz2QMLEnBkhhZEHICfoHy+AkrW3seQAwgQQHPyIUr/CD1nhq4tCpFAWoCsGNt5X2MWo9Qw/p1zXGgWiZAZu8teRQhCwLwOLpEefKolb3zDIAQBXyGAnwqa09Vq4pVDQBOqrTuTmn7c9S0H9QdB6ptT/O4iSWPY2S+DxYHFzTW+5zBti8BCFBYfCprTwxcwmoALABupK48lFPri0az1dSbjWkZDiSp5yPpdn2Vh39m5evPAPABRACySaH3Ba64sA7ABtD0tdXPUqvxKd1xoJrmDAjTSx7HCDsdroj0nJO99TiAHgprZwD4fi5+S+AKrAHA5UQ7EijH/05rND9sNJsglNaEMZ3wPEfq+8i97vdstv4IFdkWBi5+S2h1n2dL2IYAXQqU449pjdYHzFaruDr3edEelVJUmK02YpCPBD454uRrf0BFtlleTlAMX7vfu9eFSp91ALR95cRfq27zA2ariXK+cOhqtprQnOZ7AmXlLIA2ABeAXtZ9cuDSlVUUfbYVKCsPq27zo1arddiMY2q2WlCd5gd95fhnALTKOmslw/7A5RcVFGNsI6ILpzNi/rnu2IdPt4caDRc5Mf4opEu/DaBR1l3dDXo3CxMUEdkRoO2UuJ+3Wy1VUbXD5tpTKVVgt9s0I85fcahLKLqhvhvf0B/KFpFjbdOnRz+pOY17f5atK1W3LWiue8KnR38fQLNkGLPyaAvI8dZl0Jcz6J82bPuwWSZW03GRQ3s4JdYqigBmoOie48CVQGUBcAO68AnTbTQUVQWE+LlQSimsRsOKSPthFG49ZmU6Aq8DsAWomwnt4+bPgSuPqunYyIX6uwzqIoqIPdSXacW6clFgB6T9Xs0wFylVDrv+UyshFIZlOSFpP1ACG1Ury5mWdGcTgJkJ/UO2ZZVPqU+EqiL9xV8GWzoGAFC2t6C/eQkkS2stR7cs+KH2OwDOo2AKUcy1hQTur28FiJVDOa0bRm283HHhPfQxhL91BsIYXmyQLIX1yktofvdJ0N5OLeVpug4G5TcY1IaCvIuCLQHAq8A6ACOCe5+qag1CSBEMZpT01L3Y/vSfgi0e2fW60HSE730/4vtPY/Erj0J/8+LMZRIAmq7rUeLe75KdTRTACoCcVvqvBsBIhXG/qumoo0Plx5Zx80/+Yk/YqvBGE53PPILsxGotZWuahkxov4bCkDoARZy5h1S3UjUAKhf0pKrWE6x2Hv5DcMedwCaFCMPEzqf+GCB05rIVVQUHOVlySQuPAzNB7lAUBbOOickv/QrSe++bGFZKtnoK0f2nZy5foRRc0Dsw2C5WANDRvWRFAIv9/juDxr/5nqlhpcTvevfM5VNKwYHFijEVAEStWFgBQIWASQkKv5hBstVTM947W/mEABDCxMCgFBXgfkpECGgAmbW8seFnqntNc+byiSDggqgYSfPIKVc/2SUgcsH57C7V3T5wZWmvO3P5QnAAPMdwnotU59KkaBkR1AGs/fTqgYG1n16dHZhzQCAea8zKz4UTEdFl/EBZjCGxXn354Pe+8tLM5TPGAPAxN5PAQioR7CdZls1u4auXYf3wB1NX1Pjv/4Rx8Y2Zy8/zHAR8reTiko9W/sAAcIWwt+oAhhBofeMrUDfWJoZVtjtof/Xvayk7TTMo4D/BSL55FJiZNPvfNE1rKZT2ulj64mehX/m/fWG169ew9IW/hHJzqx7gLIVO00slWy6B1QpsBoC5SnR1O7K3GecLSg2ZBaWziSOffwTB+x5E8MGHkB8/MXx9cwPuf3wX9gvPgeT5zOUBgBACcZKmR63of1CwycS6UFFYeCjjrhD2WhTHD7iWVUsFwBic7z8L5/vPgh1dBneL5BsJg6lcflKJ4hgKYT8iENXTBAzl8lBgYOEMALOV9IUgDB9w55AoU26sQ7mxXvtzq+KHISyavogBV4oCXNAy8cSrF9pa+EaSJmtpWk/wup2a5zmiONle0MMflpD94xLkwhUhOykrL8TlJzNo9lQvDHHYe1TTai8MYSjZd0p3zjA4LcCB4XFYXowB5EeM4HkvDDpxmh4+xYSa5hm6fuAt6cH3Sp5kV+Aye55XvpAqRCSOmv5LLwgO3U0n1V4QwFLSf9UoD0tPjSrAomphoHDrBINDI/kxM3wxTMIf7/j+ocPsp90ggBcFV5bN8LnSeHHJIs+BjAFLt45QZNNjAOyIET3a8XwvTNLD9tg9NU4zbPa8dEmPzxIipKeGpabSnYeAyxbIS2BfftnVsrWmnjzWDQPkLD98uhHlgqMbBnC19PGmnl4rAUMMDrzk1SMQo1MpXt4QAPDKG7OjZvwKy4Ov3/R/9vrzVs9DmgZPrljRCyg8NCzr7o9adwx4xMpeqTEAdqcT/nuY+M9v9rxDh5S62fMQxP7Lq27wBIoYFJd17mFwnElUGXc71CLKlgowvONnrbrhl6/2sEoJuW/JcXa59fbJzTDATuRfu7sRfgmDgCthpXXF6H1jq4OyRWRr+QC65WeiEJEet+O/7fj+thfHOKx+6ycxtjy/u2Ilf6NSISdLsq59r9zt+NKuy6EKdFS2WBeFxVNHY5sLRnr27Z0dzhi77W7MGMNb2zu8ZaTnGnq+hoE37mDgynuewdxz/VdORuTDuqUWQcxO/8tU+ZObfnDbDbzpBzBV9m/LdvraCGzfKLc6hnjLBW8F2q88NATATjaib3pxcLFzG2dim74PLw5eP9mIv4U9PHC/M5eTrPCrQ5XszzElyFac9OwN3/P8NMG8TeslMbZCf/tEIzlHSX8m5VXqlGBkCDoQ8C5BrH+Ys6GzjZaRP3YzDCHmaFnOOW6GERaM/Jyt8u0SLijrcssgNTXwLtAy9AcAsjvc7JWMxc9seP7cDHzDD8B49NSKk72OwUyqV+rEsBMDl9DVICZbNgLATjXTf96OgiudMKzdup0wxHYcvHlXM/sGxvttiCnOSk8FXIrsz8PjMxXpspOffcfz8rTG+XbCcqx5Xrri5OcUKuQGRbXssaljrcC36M/posWuuTr/+lYY1ebKnTCCq/MnFkx2HYPAKWdSQ8u+uQCPQEvX6qFwrfyuVvadnTi4uFmDa28GAXbi4Men2tl5FPN7uSiYKkjNDFxCy/4sg0d/qLqjwR5b9/04Znue0d5X4jzHehDEJxrsUYwHy6n7bVVm2WnnKNxqyLXbJn/b1fkTswSwrSiCq/OvtUy+juHl6sTjbe3AFdeW0DJqZ3e182d3kujNThxh2o7biSJ0k+ji3Qv5sxj2Ig8H7LdVmSmXUhY8VilKkB1z2Jev9zzOuZiYl3GB656XL7vsHzC85Os35qzvH9bxWorAsNsFANKjDr9saeL82hRz7fUggKWJp4/Y/CoGw1//mWVZM8nMwLdw7fxUm31zKwo7vXT/s5S9NMVWFK7ds8C+heG9NR8zROVRqeXFoxHXlhZJDBXBoi0e34yi/YehKMKiLf5JU/p7yUONV9d7xHW+aSWhhzYAV1v81SBPLm7FY8ct+rIVxwjz5I3VFn8V4w1XiytLqQ24sgEoXbvviiuu+Me9rCyEwDXP48uu+CqGZ3G1urKUWt+l28W1QwDpMVdcZsgvrIXh2D0bUQRDxUvHXHEZw8GvVleWMo+XB6sbBnIznJ1s8a+9EwQ5rxyJ4pzjbd/P72xyuc1aTQLMNMHYS2oHrri2dM0QQNI0sWnrOL8eRf3vrkcRbB3n2xY2MEiP9NM88/ivD/N6PbTq2rIv5qtt8dRaGKaccwgh8E4Y5ne2xNMYb6B+tq9umQvwyDIyKDVxddw0VfH8jTjGZhzDVMWLDQNbGGzZzNW6wPwsXM05V7OR+fEmvn09CPiNKMKyi29jYN0Ag0BVe9+Vst/7w7OKnIEFKF6pMRdtrL3VxctMMOOoi2q2r5/LnWeF5vqK90gAGyTaXTy5ZAtpXRms5jIMjcq8LQwMnywIAVgrDVwuD+9K68oZ1dxcWcrcX+IfScHKwBRWfu9H8Xn2XSm3w8LAYHfEQ5F6TVGYWM6qYsy570q5Lf+mYSRH1QFwA8AGgJsooOXe7tzl/wGchYFKtBMCwAAAAABJRU5ErkJggg=="},removeMarkers:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{};this.option=t;var e=t.map;this.position=t.position,this.index=1,this.visible=this.alwaysVisible="ALWAYS"===t.display,this.init(),Object.defineProperty(this,"onclick",{setter:function(t){this.div.onclick=t},getter:function(){return this.div.onclick}}),e&&this.setMap(e)};e.prototype=new i.Overlay,e.prototype.init=function(){var t=this.option,e=this.div=document.createElement("div"),n=e.style;n.position="absolute",n.whiteSpace="nowrap",n.transform="translateX(-50%) translateY(-100%)",n.zIndex=1,n.boxShadow=t.boxShadow||"none",n.display=this.visible?"block":"none";var i=this.triangle=document.createElement("div");i.setAttribute("style","position: absolute;white-space: nowrap;border-width: 4px;border-style: solid;border-color: #fff transparent transparent;border-image: initial;font-size: 12px;padding: 0px;background-color: transparent;width: 0px;height: 0px;transform: translate(-50%, 100%);left: 50%;bottom: 0;"),this.setStyle(t),this.changed=function(t){n.display=this.visible?"block":"none"},e.appendChild(i)},e.prototype.construct=function(){var t=this.div,e=this.getPanes();e.floatPane.appendChild(t)},e.prototype.draw=function(){var t=this.getProjection();if(this.position&&this.div&&t){var e=t.fromLatLngToDivPixel(this.position),n=this.div.style;n.left=e.x+"px",n.top=e.y+"px"}},e.prototype.destroy=function(){this.div.parentNode.removeChild(this.div),this.div=null,this.triangle=null},e.prototype.setOption=function(t){this.option=t,this.setPosition(t.position),"ALWAYS"===t.display?this.alwaysVisible=this.visible=!0:this.alwaysVisible=!1,this.setStyle(t)},e.prototype.setStyle=function(t){var e=this.div,n=e.style;e.innerText=t.content,n.lineHeight=(t.fontSize||14)+"px",n.fontSize=(t.fontSize||14)+"px",n.padding=(t.padding||8)+"px",n.color=t.color||"#000",n.borderRadius=(t.borderRadius||0)+"px",n.backgroundColor=t.bgColor||"#fff",n.marginTop="-"+(t.top+5)+"px",this.triangle.style.borderColor="".concat(t.bgColor||"#fff"," transparent transparent")},e.prototype.setPosition=function(t){this.position=t,this.draw()},t()};var r=document.createElement("script");r.src="https://map.qq.com/api/js?v=2.exp&key=".concat(e,"&callback=").concat(n,"&libraries=geometry"),document.body.appendChild(r)}}}}}).call(this,n("3ad9")["default"])},6389:function(e,n){e.exports=t},6428:function(t,e,n){"use strict";var i=n("c99c"),r=n.n(i);r.a},6491:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-radio",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-radio-wrapper"},[n("div",{staticClass:"uni-radio-input",class:t.radioChecked?"uni-radio-input-checked":"",style:t.radioChecked?t.checkedStyle:""}),t._t("default")],2)])},r=[],o=n("8af1"),a={name:"Radio",mixins:[o["a"],o["c"]],props:{checked:{type:[Boolean,String],default:!1},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007AFF"},value:{type:String,default:""}},data:function(){return{radioChecked:this.checked,radioValue:this.value}},computed:{checkedStyle:function(){return"background-color: ".concat(this.color,";border-color: ").concat(this.color,";")}},watch:{checked:function(t){this.radioChecked=t},value:function(t){this.radioValue=t}},listeners:{"label-click":"_onClick","@label-click":"_onClick"},created:function(){this.$dispatch("RadioGroup","uni-radio-group-update",{type:"add",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("RadioGroup","uni-radio-group-update",{type:"remove",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onClick:function(t){this.disabled||this.radioChecked||(this.radioChecked=!0,this.$dispatch("RadioGroup","uni-radio-change",t,this))},_resetFormData:function(){this.radioChecked=this.min}}},s=a,c=(n("c96e"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"64d0":function(t,e,n){"use strict";var i=n("1047"),r=n.n(i);r.a},6575:function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=e.latitude,r=e.longitude,o=e.scale,a=e.name,s=e.address,c=t,u=c.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/open-location",query:{latitude:i,longitude:r,scale:o,name:a,address:s}},function(){u(n,{errMsg:"openLocation:ok"})},function(){u(n,{errMsg:"openLocation:fail"})})}n.d(e,"openLocation",function(){return i})}.call(this,n("0dd1"))},"65a8":function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r});var i=44,r=50},6725:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"createSelectorQuery",function(){return d});var i=n("f2b3"),r=n("62b5");function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;ne-n&&t0){var u=(-n-Math.sqrt(o))/(2*i),l=(-n+Math.sqrt(o))/(2*i),h=(e-u*t)/(l-u),d=t-h;return{x:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*e+h*n},dx:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*u*e+h*l*n}}}var f=Math.sqrt(4*i*r-n*n)/(2*i),p=-n/2*i,g=t,m=(e-p*t)/f;return{x:function(t){return Math.pow(Math.E,p*t)*(g*Math.cos(f*t)+m*Math.sin(f*t))},dx:function(t){var e=Math.pow(Math.E,p*t),n=Math.cos(f*t),i=Math.sin(f*t);return e*(m*f*n-g*f*i)+p*e*(m*i+g*n)}}},o.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},o.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},o.prototype.setEnd=function(t,e,n){if(n||(n=(new Date).getTime()),t!==this._endPosition||!r(e,.4)){e=e||0;var i=this._endPosition;this._solution&&(r(e,.4)&&(e=this._solution.dx((n-this._startTime)/1e3)),i=this._solution.x((n-this._startTime)/1e3),r(e,.4)&&(e=0),r(i,.4)&&(i=0),i+=this._endPosition),this._solution&&r(i-t,.4)&&r(e,.4)||(this._endPosition=t,this._solution=this._solve(i-this._endPosition,e),this._startTime=n)}},o.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},o.prototype.done=function(t){return t||(t=(new Date).getTime()),i(this.x(),this._endPosition,.4)&&r(this.dx(),.4)},o.prototype.reconfigure=function(t,e,n){this._m=t,this._k=e,this._c=n,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},o.prototype.springConstant=function(){return this._k},o.prototype.damping=function(){return this._c},o.prototype.configuration=function(){function t(t,e){t.reconfigure(1,e,t.damping())}function e(t,e){t.reconfigure(1,t.springConstant(),e)}return[{label:"Spring Constant",read:this.springConstant.bind(this),write:t.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:e.bind(this,this),min:1,max:500}]}},"748c":function(t,e,n){},"74ce":function(t,e,n){},7557:function(t,e,n){"use strict";n.r(e),function(t){var n={visible:!1,mode:"",range:[],rangeKey:"",value:"",disabled:!1,start:"",end:"",fields:"day",customItem:""};e["default"]={data:function(){return{showPicker:{visible:!1}}},created:function(){var e=this;t.subscribe("showPicker",function(t,i){e.showPicker=Object.assign(n,t,{pageId:i,visible:!0})}),t.subscribe("hidePicker",function(){e._onPickerClose()}),t.on("onHidePopup",function(){e._onPickerClose()})},methods:{_onPickerClose:function(){this.showPicker.visible=!1,this.showPicker.mode="selector",this.showPicker.range=[],this.showPicker.value=0}}}}.call(this,n("0dd1"))},"763a":function(t,e,n){"use strict";var i=n("1067"),r=n.n(i);r.a},"77e0":function(t,e,n){"use strict";n.r(e),function(t,n){e["default"]={data:function(){return{showToast:{visible:!1}}},created:function(){var e=this,i="",r=function(t){return function(n){i=t,setTimeout(function(){e.showToast=n},10)}};t.on("onShowToast",r("onShowToast")),t.on("onShowLoading",r("onShowLoading"));var o=function(t){return function(){var r="";if("onHideToast"===t&&"onShowToast"!==i?r="请注意 showToast 与 hideToast 必须配对使用":"onHideLoading"===t&&"onShowLoading"!==i&&(r="请注意 showLoading 与 hideLoading 必须配对使用"),r)return n.warn(r);i="",setTimeout(function(){e.showToast.visible=!1},10)}};t.on("onHidePopup",o("onHidePopup")),t.on("onHideToast",o("onHideToast")),t.on("onHideLoading",o("onHideLoading"))}}}.call(this,n("0dd1"),n("3ad9")["default"])},"78c8":function(t,e,n){"use strict";n.r(e),n.d(e,"getSystemInfoSync",function(){return s}),n.d(e,"getSystemInfo",function(){return c});var i=n("a470"),r=navigator.userAgent,o=/android/i.test(r),a=/iphone|ipad|ipod/i.test(r);function s(){var t,e,n,s=window.innerWidth,c=window.innerHeight,u=window.screen,l=window.devicePixelRatio,h=u.width,d=u.height,f=navigator.language,p=0;if(a){t="iOS";var g=r.match(/OS\s([\w_]+)\slike/);g&&(e=g[1].replace(/_/g,"."));var m=r.match(/\(([a-zA-Z]+);/);m&&(n=m[1])}else if(o){t="Android";var v=r.match(/Android[\s\/]([\w\.]+)[;\s]/);v&&(e=v[1]);for(var b=r.match(/\((.+?)\)/),y=b?b[1].split(";"):r.split(" "),_=[/\bAndroid\b/i,/\bLinux\b/i,/\bU\b/i,/^\s?[a-z][a-z]$/i,/^\s?[a-z][a-z]-[a-z][a-z]$/i,/\bwv\b/i,/\/[\d\.,]+$/,/^\s?[\d\.,]+$/,/\bBrowser\b/i,/\bMobile\b/i],w=0;w0){n=S.split("Build")[0].trim();break}for(var k=void 0,T=0;T<_.length;T++)if(_[T].test(S)){k=!0;break}if(!k){n=S.trim();break}}}else t="Other",e="0";var x="".concat(t," ").concat(e),C=t.toLocaleLowerCase(),O=Object(i["a"])(),M=O.top,E=O.bottom;return c-=M,c-=E,{windowTop:M,windowBottom:E,windowWidth:s,windowHeight:c,pixelRatio:l,screenWidth:h,screenHeight:d,language:f,statusBarHeight:p,system:x,platform:C,model:n}}function c(){return s()}},"7bb3":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-checkbox",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-checkbox-wrapper"},[n("div",{staticClass:"uni-checkbox-input",class:[t.checkboxChecked?"uni-checkbox-input-checked":""],style:{color:t.color}}),t._t("default")],2)])},r=[],o=n("8af1"),a={name:"Checkbox",mixins:[o["a"],o["c"]],props:{checked:{type:[Boolean,String],default:!1},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007aff"},value:{type:String,default:""}},data:function(){return{checkboxChecked:this.checked,checkboxValue:this.value}},watch:{checked:function(t){this.checkboxChecked=t},value:function(t){this.checkboxValue=t}},listeners:{"label-click":"_onClick","@label-click":"_onClick"},created:function(){this.$dispatch("CheckboxGroup","uni-checkbox-group-update",{type:"add",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("CheckboxGroup","uni-checkbox-group-update",{type:"remove",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onClick:function(t){this.disabled||(this.checkboxChecked=!this.checkboxChecked,this.$dispatch("CheckboxGroup","uni-checkbox-change",t))},_resetFormData:function(){this.checkboxChecked=!1}}},s=a,c=(n("f53a"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"7c2b":function(t,e,n){"use strict";var i=n("6144"),r=n.n(i);r.a},"7d18":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"uploadFile",function(){return u});var i=n("e2e2");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n>2],o+=t[(3&i[n])<<4|i[n+1]>>4],o+=t[(15&i[n+1])<<2|i[n+2]>>6],o+=t[63&i[n+2]];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=function(t){var e,i,r,o,a,s=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s),h=new Uint8Array(l);for(e=0;e>4,h[u++]=(15&r)<<4|o>>2,h[u++]=(3&o)<<6|63&a;return l}})()},"83a6":function(t,e,n){"use strict";e["a"]={data:function(){return{hovering:!1}},props:{hoverClass:{type:String,default:"none"},hoverStopPropagation:{type:Boolean,default:!1},hoverStartTime:{type:Number,default:50},hoverStayTime:{type:Number,default:400}},methods:{_hoverTouchStart:function(t){var e=this;t._hoverPropagationStopped||this.hoverClass&&"none"!==this.hoverClass&&!this.disabled&&(t.touches.length>1||(this.hoverStopPropagation&&(t._hoverPropagationStopped=!0),this._hoverTouch=!0,this._hoverStartTimer=setTimeout(function(){e.hovering=!0,e._hoverTouch||e._hoverReset()},this.hoverStartTime)))},_hoverTouchEnd:function(t){this._hoverTouch=!1,this.hovering&&this._hoverReset()},_hoverReset:function(){var t=this;requestAnimationFrame(function(){clearTimeout(t._hoverStayTimer),t._hoverStayTimer=setTimeout(function(){t.hovering=!1},t.hoverStayTime)})},_hoverTouchCancel:function(t){this._hoverTouch=!1,this.hovering=!1,clearTimeout(this._hoverStartTimer)}}}},"84e0":function(t,e,n){"use strict";n.r(e),function(t){function i(e){var n=getCurrentPages();return n.length&&t.publishHandler("pageScrollTo",e,n[n.length-1].$page.id),{}}n.d(e,"pageScrollTo",function(){return i})}.call(this,n("0dd1"))},8542:function(t,e,n){"use strict";n.d(e,"a",function(){return v}),n.d(e,"d",function(){return b}),n.d(e,"e",function(){return k}),n.d(e,"b",function(){return x}),n.d(e,"c",function(){return C});var i=n("f2b3");function r(t){return s(t)||a(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function a(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{};return["success","fail","complete"].forEach(function(n){if(Array.isArray(t[n])){var r=e[n];e[n]=function(e){w(t[n],e).then(function(t){return Object(i["e"])(r)&&r(t)||t})}}}),e}function k(t,e){var n=[];Array.isArray(l.returnValue)&&n.push.apply(n,r(l.returnValue));var i=h[t];return i&&Array.isArray(i.returnValue)&&n.push.apply(n,r(i.returnValue)),n.forEach(function(t){e=t(e)||e}),e}function T(t){var e=Object.create(null);Object.keys(l).forEach(function(t){"returnValue"!==t&&(e[t]=l[t].slice())});var n=h[t];return n&&Object.keys(n).forEach(function(t){"returnValue"!==t&&(e[t]=(e[t]||[]).concat(n[t]))}),e}function x(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t[e])&&t[e].length}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=JSON.parse(JSON.stringify(t)),n=Object.keys(e),i=n.length;if(i)for(var r=0;re-n&&tthis._t&&(t=this._t,this._lastDt=t);var e=this._x_v*t+.5*this._x_a*Math.pow(t,2)+this._x_s,n=this._y_v*t+.5*this._y_a*Math.pow(t,2)+this._y_s;return(this._x_a>0&&ethis._endPositionX)&&(e=this._endPositionX),(this._y_a>0&&nthis._endPositionY)&&(n=this._endPositionY),{x:e,y:n}},u.prototype.ds=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),t>this._t&&(t=this._t),{dx:this._x_v+this._x_a*t,dy:this._y_v+this._y_a*t}},u.prototype.delta=function(){return{x:-1.5*Math.pow(this._x_v,2)/this._x_a||0,y:-1.5*Math.pow(this._y_v,2)/this._y_a||0}},u.prototype.dt=function(){return-this._x_v/this._x_a},u.prototype.done=function(){var t=a(this.s().x,this._endPositionX)||a(this.s().y,this._endPositionY)||this._lastDt===this._t;return this._lastDt=null,t},u.prototype.setEnd=function(t,e){this._endPositionX=t,this._endPositionY=e},u.prototype.reconfigure=function(t,e){this._m=t,this._f=1e3*e},l.prototype._solve=function(t,e){var n=this._c,i=this._m,r=this._k,o=n*n-4*i*r;if(0===o){var a=-n/(2*i),s=t,c=e/(a*t);return{x:function(t){return(s+c*t)*Math.pow(Math.E,a*t)},dx:function(t){var e=Math.pow(Math.E,a*t);return a*(s+c*t)*e+c*e}}}if(o>0){var u=(-n-Math.sqrt(o))/(2*i),l=(-n+Math.sqrt(o))/(2*i),h=(e-u*t)/(l-u),d=t-h;return{x:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*e+h*n},dx:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*u*e+h*l*n}}}var f=Math.sqrt(4*i*r-n*n)/(2*i),p=-n/2*i,g=t,m=(e-p*t)/f;return{x:function(t){return Math.pow(Math.E,p*t)*(g*Math.cos(f*t)+m*Math.sin(f*t))},dx:function(t){var e=Math.pow(Math.E,p*t),n=Math.cos(f*t),i=Math.sin(f*t);return e*(m*f*n-g*f*i)+p*e*(m*i+g*n)}}},l.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},l.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},l.prototype.setEnd=function(t,e,n){if(n||(n=(new Date).getTime()),t!==this._endPosition||!s(e,.1)){e=e||0;var i=this._endPosition;this._solution&&(s(e,.1)&&(e=this._solution.dx((n-this._startTime)/1e3)),i=this._solution.x((n-this._startTime)/1e3),s(e,.1)&&(e=0),s(i,.1)&&(i=0),i+=this._endPosition),this._solution&&s(i-t,.1)&&s(e,.1)||(this._endPosition=t,this._solution=this._solve(i-this._endPosition,e),this._startTime=n)}},l.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},l.prototype.done=function(t){return t||(t=(new Date).getTime()),a(this.x(),this._endPosition,.1)&&s(this.dx(),.1)},l.prototype.reconfigure=function(t,e,n){this._m=t,this._k=e,this._c=n,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},l.prototype.springConstant=function(){return this._k},l.prototype.damping=function(){return this._c},l.prototype.configuration=function(){function t(t,e){t.reconfigure(1,e,t.damping())}function e(t,e){t.reconfigure(1,t.springConstant(),e)}return[{label:"Spring Constant",read:this.springConstant.bind(this),write:t.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:e.bind(this,this),min:1,max:500}]},h.prototype.setEnd=function(t,e,n,i){var r=(new Date).getTime();this._springX.setEnd(t,i,r),this._springY.setEnd(e,i,r),this._springScale.setEnd(n,i,r),this._startTime=r},h.prototype.x=function(){var t=((new Date).getTime()-this._startTime)/1e3;return{x:this._springX.x(t),y:this._springY.x(t),scale:this._springScale.x(t)}},h.prototype.done=function(){var t=(new Date).getTime();return this._springX.done(t)&&this._springY.done(t)&&this._springScale.done(t)},h.prototype.reconfigure=function(t,e,n){this._springX.reconfigure(t,e,n),this._springY.reconfigure(t,e,n),this._springScale.reconfigure(t,e,n)};var d=!1;function f(t){d||(d=!0,requestAnimationFrame(function(){t(),d=!1}))}function p(t,e){if(t===e)return 0;var n=t.offsetLeft;return t.offsetParent?n+=p(t.offsetParent,e):0}function g(t,e){if(t===e)return 0;var n=t.offsetTop;return t.offsetParent?n+=g(t.offsetParent,e):0}function m(t,e){return+((1e3*t-1e3*e)/1e3).toFixed(1)}function v(t,e,n){var i=function(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)},r={id:0,cancelled:!1};function o(e,n,i,r){if(!e||!e.cancelled){i(n);var a=t.done();a||e.cancelled||(e.id=requestAnimationFrame(o.bind(null,e,n,i,r))),a&&r&&r(n)}}return o(r,t,e,n),{cancel:i.bind(null,r),model:t}}var b={name:"MovableView",mixins:[o["a"]],props:{direction:{type:String,default:"none"},inertia:{type:[Boolean,String],default:!1},outOfBounds:{type:[Boolean,String],default:!1},x:{type:[Number,String],default:0},y:{type:[Number,String],default:0},damping:{type:[Number,String],default:20},friction:{type:[Number,String],default:2},disabled:{type:[Boolean,String],default:!1},scale:{type:[Boolean,String],default:!1},scaleMin:{type:[Number,String],default:.5},scaleMax:{type:[Number,String],default:10},scaleValue:{type:[Number,String],default:1},animation:{type:[Boolean,String],default:!0}},data:function(){return{xSync:this._getPx(this.x),ySync:this._getPx(this.y),scaleValueSync:Number(this.scaleValue)||1,width:0,height:0,minX:0,minY:0,maxX:0,maxY:0}},computed:{dampingNumber:function(){var t=Number(this.damping);return isNaN(t)?20:t},frictionNumber:function(){var t=Number(this.friction);return isNaN(t)||t<=0?2:t},scaleMinNumber:function(){var t=Number(this.scaleMin);return isNaN(t)?.5:t},scaleMaxNumber:function(){var t=Number(this.scaleMax);return isNaN(t)?10:t},xMove:function(){return"all"===this.direction||"horizontal"===this.direction},yMove:function(){return"all"===this.direction||"vertical"===this.direction}},watch:{x:function(t){this.xSync=this._getPx(t)},xSync:function(t){this._setX(t)},y:function(t){this.ySync=this._getPx(t)},ySync:function(t){this._setY(t)},scaleValue:function(t){this.scaleValueSync=Number(t)||0},scaleValueSync:function(t){this._setScaleValue(t)},scaleMinNumber:function(){this._setScaleMinOrMax()},scaleMaxNumber:function(){this._setScaleMinOrMax()}},created:function(){this._offset={x:0,y:0},this._scaleOffset={x:0,y:0},this._translateX=0,this._translateY=0,this._scale=1,this._oldScale=1,this._STD=new h(1,9*Math.pow(this.dampingNumber,2)/40,this.dampingNumber),this._friction=new u(1,this.frictionNumber),this._declineX=new c,this._declineY=new c,this.__touchInfo={historyX:[0,0],historyY:[0,0],historyT:[0,0]}},mounted:function(){this.touchtrack(this.$el,"_onTrack"),this.setParent(),this._friction.reconfigure(1,this.frictionNumber),this._STD.reconfigure(1,9*Math.pow(this.dampingNumber,2)/40,this.dampingNumber),this.$el.style.transformOrigin="center"},methods:{_getPx:function(t){return/\d+[ur]px$/i.test(t)?uni.upx2px(parseFloat(t)):Number(t)||0},_setX:function(t){if(this.xMove){if(t+this._scaleOffset.x===this._translateX)return this._translateX;this._SFA&&this._SFA.cancel(),this._animationTo(t+this._scaleOffset.x,this.ySync+this._scaleOffset.y,this._scale)}return t},_setY:function(t){if(this.yMove){if(t+this._scaleOffset.y===this._translateY)return this._translateY;this._SFA&&this._SFA.cancel(),this._animationTo(this.xSync+this._scaleOffset.x,t+this._scaleOffset.y,this._scale)}return t},_setScaleMinOrMax:function(){if(!this.scale)return!1;this._updateScale(this._scale,!0),this._updateOldScale(this._scale)},_setScaleValue:function(t){return!!this.scale&&(t=this._adjustScale(t),this._updateScale(t,!0),this._updateOldScale(t),t)},__handleTouchStart:function(){this._isScaling||this.disabled||(this._FA&&this._FA.cancel(),this._SFA&&this._SFA.cancel(),this.__touchInfo.historyX=[0,0],this.__touchInfo.historyY=[0,0],this.__touchInfo.historyT=[0,0],this.xMove&&(this.__baseX=this._translateX),this.yMove&&(this.__baseY=this._translateY),this.$el.style.willChange="transform",this._checkCanMove=null,this._firstMoveDirection=null,this._isTouching=!0)},__handleTouchMove:function(t){var e=this;if(!this._isScaling&&!this.disabled&&this._isTouching){var n=this._translateX,i=this._translateY;if(null===this._firstMoveDirection&&(this._firstMoveDirection=Math.abs(t.detail.dx/t.detail.dy)>1?"htouchmove":"vtouchmove"),this.xMove&&(n=t.detail.dx+this.__baseX,this.__touchInfo.historyX.shift(),this.__touchInfo.historyX.push(n),this.yMove||!0!==this._checkCanMove&&(Math.abs(t.detail.dx/t.detail.dy)>1?this._checkCanMove=!1:this._checkCanMove=!0)),this.yMove&&(i=t.detail.dy+this.__baseY,this.__touchInfo.historyY.shift(),this.__touchInfo.historyY.push(i),this.xMove||!0!==this._checkCanMove&&(Math.abs(t.detail.dy/t.detail.dx)>1?this._checkCanMove=!1:this._checkCanMove=!0)),this.__touchInfo.historyT.shift(),this.__touchInfo.historyT.push(t.detail.timeStamp),!this._checkCanMove){t.preventDefault();var r="touch";nthis.maxX&&(this.outOfBounds?(r="touch-out-of-bounds",n=this.maxX+this._declineX.x(n-this.maxX)):n=this.maxX),ithis.maxY&&(this.outOfBounds?(r="touch-out-of-bounds",i=this.maxY+this._declineY.x(i-this.maxY)):i=this.maxY),f(function(){e._setTransform(n,i,e._scale,r)})}}},__handleTouchEnd:function(){var t=this;if(!this._isScaling&&!this.disabled&&this._isTouching&&(this.$el.style.willChange="auto",this._isTouching=!1,!this._checkCanMove&&!this._revise("out-of-bounds")&&this.inertia)){var e=1e3*(this.__touchInfo.historyX[1]-this.__touchInfo.historyX[0])/(this.__touchInfo.historyT[1]-this.__touchInfo.historyT[0]),n=1e3*(this.__touchInfo.historyY[1]-this.__touchInfo.historyY[0])/(this.__touchInfo.historyT[1]-this.__touchInfo.historyT[0]);this._friction.setV(e,n),this._friction.setS(this._translateX,this._translateY);var i=this._friction.delta().x,r=this._friction.delta().y,o=i+this._translateX,a=r+this._translateY;othis.maxX&&(o=this.maxX,a=this._translateY+(this.maxX-this._translateX)*r/i),athis.maxY&&(a=this.maxY,o=this._translateX+(this.maxY-this._translateY)*i/r),this._friction.setEnd(o,a),this._FA=v(this._friction,function(){var e=t._friction.s(),n=e.x,i=e.y;t._setTransform(n,i,t._scale,"friction")},function(){t._FA.cancel()})}},_onTrack:function(t){switch(t.detail.state){case"start":this.__handleTouchStart();break;case"move":this.__handleTouchMove(t);break;case"end":this.__handleTouchEnd()}},_getLimitXY:function(t,e){var n=!1;return t>this.maxX?(t=this.maxX,n=!0):tthis.maxY?(e=this.maxY,n=!0):e3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;null!==t&&"NaN"!==t.toString()&&"number"===typeof t||(t=this._translateX||0),null!==e&&"NaN"!==e.toString()&&"number"===typeof e||(e=this._translateY||0),t=Number(t.toFixed(1)),e=Number(e.toFixed(1)),n=Number(n.toFixed(1)),this._translateX===t&&this._translateY===e||r||this.$trigger("change",{},{x:m(t,this._scaleOffset.x),y:m(e,this._scaleOffset.y),source:i}),this.scale||(n=this._scale),n=this._adjustScale(n),n=+n.toFixed(3),o&&n!==this._scale&&this.$trigger("scale",{},{x:t,y:e,scale:n});var a="translateX("+t+"px) translateY("+e+"px) translateZ(0px) scale("+n+")";this.$el.style.transform=a,this.$el.style.webkitTransform=a,this._translateX=t,this._translateY=e,this._scale=n}}},y=b,_=(n("7c2b"),n("0c7c")),w=Object(_["a"])(y,i,r,!1,null,null,null);e["default"]=w.exports},"893e":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=this._webSocket;try{n.send(e),this._callback(t,"sendSocketMessage:ok")}catch(i){this._callback(t,"sendSocketMessage:fail ".concat(i))}}},{key:"close",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=t.data,i=this._webSocket;try{i.close(e,n),this._callback(t,"sendSocketMessage:ok")}catch(r){this._callback(t,"sendSocketMessage:fail ".concat(r))}}},{key:"onOpen",value:function(t){this._on("open",t)}},{key:"onClose",value:function(t){this._on("close",t)}},{key:"onError",value:function(t){this._on("error",t)}},{key:"onMessage",value:function(t){this._on("message",t)}},{key:"_on",value:function(t,e){this._webSocket.addEventListener(t,function(n){"message"===t?e({data:n.data}):e()},!1)}},{key:"_callback",value:function(t,e){var n=t.success,i=t.fail,r=t.complete,o={errMsg:e};/:ok$/.test(e)?"function"===typeof n&&n(o):"function"===typeof i&&i(o),"function"===typeof r&&r(o)}}]),t}();function u(e,n){var i=e.url,r=e.protocols,o=t,a=o.invokeCallbackHandler;return s=new c(i,r),setTimeout(function(){a(n,{errMsg:"connectSocket:ok"})},0),s}function l(e,n){var i=t,r=i.invokeCallbackHandler;s&&s._webSocket.readyState===WebSocket.OPEN?s.send(Object.assign(e,{complete:function(t){r(n,t)}})):r(n,{errMsg:"sendSocketMessage:fail WebSocket is not connected "})}function h(e,n){var i=t,r=i.invokeCallbackHandler;s&&s._webSocket.readyState!==WebSocket.CLOSED?s.close(Object.assign(e,{complete:function(t){r(n,t)}})):r(n,{errMsg:"closeSocket:fail WebSocket is not connected"})}function d(e){var n=t,i=n.invokeCallbackHandler;return function(t){s&&s[e](function(e){i(t,e)})}}var f=d("onOpen"),p=d("onError"),g=d("onMessage"),m=d("onClose")}.call(this,n("0dd1"))},"8a36":function(t,e,n){"use strict";(function(t){var i=n("f2b3");e["a"]={props:{id:{type:String,default:""}},created:function(){var t=this;this._addListeners(this.id),this.$watch("id",function(e,n){t._removeListeners(n,!0),t._addListeners(e,!0)})},beforeDestroy:function(){this._removeListeners(this.id)},methods:{_addListeners:function(e,n){var r=this;if(!n||e){var o=this.$options.listeners;Object(i["f"])(o)&&Object.keys(o).forEach(function(i){n?0!==i.indexOf("@")&&0!==i.indexOf("uni-")&&t.on("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[o[i]]):0===i.indexOf("@")?r.$on("uni-".concat(i.substr(1)),r[o[i]]):0===i.indexOf("uni-")?t.on(i,r[o[i]]):e&&t.on("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[o[i]])})}},_removeListeners:function(e,n){var r=this;if(!n||e){var o=this.$options.listeners;Object(i["f"])(o)&&Object.keys(o).forEach(function(i){n?0!==i.indexOf("@")&&0!==i.indexOf("uni-")&&t.off("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[o[i]]):0===i.indexOf("@")?r.$off("uni-".concat(i.substr(1)),r[o[i]]):0===i.indexOf("uni-")?t.off(i,r[o[i]]):e&&t.off("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[o[i]])})}}}}}).call(this,n("501c"))},"8aec":function(t,e,n){"use strict";var i=n("5363"),r=n("72b3");function o(t,e,n){this._extent=t,this._friction=e||new i["a"](.01),this._spring=n||new r["a"](1,90,20),this._startTime=0,this._springing=!1,this._springOffset=0}function a(t,e,n){function i(t,e,n,r){if(!t||!t.cancelled){n(e);var o=e.done();o||t.cancelled||(t.id=requestAnimationFrame(i.bind(null,t,e,n,r))),o&&r&&r(e)}}function r(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)}var o={id:0,cancelled:!1};return i(o,t,e,n),{cancel:r.bind(null,o),model:t}}function s(t,e){e=e||{},this._element=t,this._options=e,this._enableSnap=e.enableSnap||!1,this._itemSize=e.itemSize||0,this._enableX=e.enableX||!1,this._enableY=e.enableY||!1,this._shouldDispatchScrollEvent=!!e.onScroll,this._enableX?(this._extent=(e.scrollWidth||this._element.offsetWidth)-this._element.parentElement.offsetWidth,this._scrollWidth=e.scrollWidth):(this._extent=(e.scrollHeight||this._element.offsetHeight)-this._element.parentElement.offsetHeight,this._scrollHeight=e.scrollHeight),this._position=0,this._scroll=new o(this._extent,e.friction,e.spring),this._onTransitionEnd=this.onTransitionEnd.bind(this),this.updatePosition()}o.prototype.snap=function(t,e){this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(e)},o.prototype.set=function(t,e){this._friction.set(t,e),t>0&&e>=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(0)):t<-this._extent&&e<=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(-this._extent)):this._springing=!1,this._startTime=(new Date).getTime()},o.prototype.x=function(t){if(!this._startTime)return 0;if(t||(t=((new Date).getTime()-this._startTime)/1e3),this._springing)return this._spring.x()+this._springOffset;var e=this._friction.x(t),n=this.dx(t);return(e>0&&n>=0||e<-this._extent&&n<=0)&&(this._springing=!0,this._spring.setEnd(0,n),e<-this._extent?this._springOffset=-this._extent:this._springOffset=0,e=this._spring.x()+this._springOffset),e},o.prototype.dx=function(t){var e=0;return e=this._lastTime===t?this._lastDx:this._springing?this._spring.dx(t):this._friction.dx(t),this._lastTime=t,this._lastDx=e,e},o.prototype.done=function(){return this._springing?this._spring.done():this._friction.done()},o.prototype.setVelocityByEnd=function(t){this._friction.setVelocityByEnd(t)},o.prototype.configuration=function(){var t=this._friction.configuration();return t.push.apply(t,this._spring.configuration()),t},s.prototype.onTouchStart=function(){this._startPosition=this._position,this._lastChangePos=this._startPosition,this._startPosition>0?this._startPosition/=.5:this._startPosition<-this._extent&&(this._startPosition=(this._startPosition+this._extent)/.5-this._extent),this._animation&&(this._animation.cancel(),this._scrolling=!1),this.updatePosition()},s.prototype.onTouchMove=function(t,e){var n=this._startPosition;this._enableX?n+=t:this._enableY&&(n+=e),n>0?n*=.5:n<-this._extent&&(n=.5*(n+this._extent)-this._extent),this._position=n,this.updatePosition(),this.dispatchScroll()},s.prototype.onTouchEnd=function(t,e,n){var i=this;if(this._enableSnap&&this._position>-this._extent&&this._position<0){if(this._enableY&&(Math.abs(e)this._itemSize/2?r-(this._itemSize-Math.abs(o)):r-o;s<=0&&s>=-this._extent&&this._scroll.setVelocityByEnd(s)}this._lastTime=Date.now(),this._lastDelay=0,this._scrolling=!0,this._lastChangePos=this._position,this._lastIdx=Math.floor(Math.abs(this._position/this._itemSize)),this._animation=a(this._scroll,function(){var t=Date.now(),e=(t-i._scroll._startTime)/1e3,n=i._scroll.x(e);i._position=n,i.updatePosition();var r=i._scroll.dx(e);i._shouldDispatchScrollEvent&&t-i._lastTime>i._lastDelay&&(i.dispatchScroll(),i._lastDelay=Math.abs(2e3/r),i._lastTime=t)},function(){i._enableSnap&&(s<=0&&s>=-i._extent&&(i._position=s,i.updatePosition()),"function"===typeof i._options.onSnap&&i._options.onSnap(Math.floor(Math.abs(i._position)/i._itemSize))),i._shouldDispatchScrollEvent&&i.dispatchScroll(),i._scrolling=!1})},s.prototype.onTransitionEnd=function(){this._element.style.transition="",this._element.style.webkitTransition="",this._element.removeEventListener("transitionend",this._onTransitionEnd),this._element.removeEventListener("webkitTransitionEnd",this._onTransitionEnd),this._snapping&&(this._snapping=!1),this.dispatchScroll()},s.prototype.snap=function(){var t=this._itemSize,e=this._position%t,n=Math.abs(e)>this._itemSize/2?this._position-(t-Math.abs(e)):this._position-e;this._position!==n&&(this._snapping=!0,this.scrollTo(-n),"function"===typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize)))},s.prototype.scrollTo=function(t,e){this._animation&&(this._animation.cancel(),this._scrolling=!1),"number"===typeof t&&(this._position=-t),this._position<-this._extent?this._position=-this._extent:this._position>0&&(this._position=0),this._element.style.transition="transform "+(e||.2)+"s ease-out",this._element.style.webkitTransition="-webkit-transform "+(e||.2)+"s ease-out",this.updatePosition(),this._element.addEventListener("transitionend",this._onTransitionEnd),this._element.addEventListener("webkitTransitionEnd",this._onTransitionEnd)},s.prototype.dispatchScroll=function(){if("function"===typeof this._options.onScroll&&Math.round(this._lastPos)!==Math.round(this._position)){this._lastPos=this._position;var t={target:{scrollLeft:this._enableX?-this._position:0,scrollTop:this._enableY?-this._position:0,scrollHeight:this._scrollHeight||this._element.offsetHeight,scrollWidth:this._scrollWidth||this._element.offsetWidth,offsetHeight:this._element.parentElement.offsetHeight,offsetWidth:this._element.parentElement.offsetWidth}};this._options.onScroll(t)}},s.prototype.update=function(t,e,n){var i=0,r=this._position;this._enableX?(i=this._element.childNodes.length?(e||this._element.offsetWidth)-this._element.parentElement.offsetWidth:0,this._scrollWidth=e):(i=this._element.childNodes.length?(e||this._element.offsetHeight)-this._element.parentElement.offsetHeight:0,this._scrollHeight=e),"number"===typeof t&&(this._position=-t),this._position<-i?this._position=-i:this._position>0&&(this._position=0),this._itemSize=n||this._itemSize,this.updatePosition(),r!==this._position&&(this.dispatchScroll(),"function"===typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize))),this._extent=i,this._scroll._extent=i},s.prototype.updatePosition=function(){var t="";this._enableX?t="translateX("+this._position+"px) translateZ(0)":this._enableY&&(t="translateY("+this._position+"px) translateZ(0)"),this._element.style.webkitTransform=t,this._element.style.transform=t},s.prototype.isScrolling=function(){return this._scrolling||this._snapping};e["a"]={methods:{initScroller:function(t,e){this._touchInfo={trackingID:-1,maxDy:0,maxDx:0},this._scroller=new s(t,e),this.__handleTouchStart=this._handleTouchStart.bind(this),this.__handleTouchMove=this._handleTouchMove.bind(this),this.__handleTouchEnd=this._handleTouchEnd.bind(this),this._initedScroller=!0},_findDelta:function(t){var e=this._touchInfo;return"move"===t.detail.state||"end"===t.detail.state?{x:t.detail.dx,y:t.detail.dy}:{x:t.screenX-e.x,y:t.screenY-e.y}},_handleTouchStart:function(t){var e=this._touchInfo,n=this._scroller;n&&("start"===t.detail.state?(e.trackingID="touch",e.x=t.detail.x,e.y=t.detail.y):(e.trackingID="mouse",e.x=t.screenX,e.y=t.screenY),e.maxDx=0,e.maxDy=0,e.historyX=[0],e.historyY=[0],e.historyTime=[t.detail.timeStamp],e.listener=n,n.onTouchStart&&n.onTouchStart())},_handleTouchMove:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var n=this._findDelta(t);if(n){for(e.maxDy=Math.max(e.maxDy,Math.abs(n.y)),e.maxDx=Math.max(e.maxDx,Math.abs(n.x)),e.historyX.push(n.x),e.historyY.push(n.y),e.historyTime.push(t.detail.timeStamp);e.historyTime.length>10;)e.historyTime.shift(),e.historyX.shift(),e.historyY.shift();e.listener&&e.listener.onTouchMove&&e.listener.onTouchMove(n.x,n.y,t.detail.timeStamp)}}},_handleTouchEnd:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var n=this._findDelta(t);if(n){var i=e.listener;e.trackingID=-1,e.listener=null;var r=e.historyTime.length,o={x:0,y:0};if(r>2)for(var a=e.historyTime.length-1,s=e.historyTime[a],c=e.historyX[a],u=e.historyY[a];a>0;){a--;var l=e.historyTime[a],h=s-l;if(h>30&&h<50){o.x=(c-e.historyX[a])/(h/1e3),o.y=(u-e.historyY[a])/(h/1e3);break}}e.historyTime=[],e.historyX=[],e.historyY=[],i&&i.onTouchEnd&&i.onTouchEnd(n.x,n.y,o)}}}}}},"8af1":function(t,e,n){"use strict";function i(t,e){for(var n=this.$children,r=n.length,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s2?r-2:0),a=2;a2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{};e.routes;Object(r["a"])(),t.prototype.$handleEvent=function(t){if(t instanceof Event){for(var e=t.target,n=this.$el;e&&e!==n;e=e.parentNode)if(e.tagName&&0===e.tagName.indexOf("UNI-"))break;t=r["b"].call(this,t.type,t,{},e||t.target,t.currentTarget)}return t},t.mixin({beforeCreate:function(){var t=this.$options;t.behaviors&&t.behaviors.length&&Object(o["a"])(t,this),Object(i["b"])(this)&&(t.mounted=t.mounted?[].concat(a,t.mounted):[a])}})}}}.call(this,n("501c"))},"8ce3":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"chooseVideo",function(){return u});var i=n("e2e2"),r=n("f2b3"),o=t,a=o.invokeCallbackHandler,s=null,c=function(t){var e=document.createElement("input");return e.type="file",Object(r["j"])(e,{position:"absolute",visibility:"hidden","z-index":-999,width:0,height:0,top:0,left:0}),e.accept="video/*",1===t.sourceType.length&&"camera"===t.sourceType[0]&&(e.capture="camera"),e};function u(t,e){var n=t.sourceType;s&&(document.body.removeChild(s),s=null),s=c({sourceType:n}),document.body.appendChild(s),s.addEventListener("change",function(t){var n=t.target.files[0],r=Object(i["a"])(n),o={errMsg:"chooseVideo:ok",tempFilePath:r,size:n.size,duration:0,width:0,height:0},s=document.createElement("video");s.onloadedmetadata?(s.onloadedmetadata=function(){o.duration=s.duration||0,o.width=s.videoWidth||0,o.height=s.videoHeight||0,a(e,o)},s.src=r):a(e,o)}),s.click()}}.call(this,n("0dd1"))},"8e16":function(t,e,n){"use strict";var i=n("a1e3"),r=n.n(i);r.a},"8ecd":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return h});var i=n("f2b3"),r=n("85b6"),o=n("65a8"),a=n("33ed"),s=n("9fe6"),c=n("4c68"),u=!!i["h"]&&{passive:!1};function l(e){if(uni.canIUse("css.var")){var n=e.$parent.$parent,i=n.showNavigationBar&&"transparent"!==n.navigationBar.type?o["a"]+"px":"0px",r=getApp().$children[0].showTabBar?o["b"]+"px":"0px",a=document.documentElement.style;a.setProperty("--window-top",i),a.setProperty("--window-bottom",r),t.debug("".concat(e.$page.route,"[").concat(e.$page.id,"]:--window-top=").concat(i)),t.debug("".concat(e.$page.route,"[").concat(e.$page.id,"]:--window-bottom=").concat(r))}}function h(t){t("requestComponentInfo",s["a"]),t("pageScrollTo",a["c"]),t("requestComponentObserver",c["b"]),t("destroyComponentObserver",c["a"]);var e=!1,n=!1;t("onPageLoad",function(t){l(t)}),t("onPageShow",function(t){var o=t.$parent.$parent;t._isMounted&&l(t),n&&document.removeEventListener("touchmove",n,u),o.disableScroll&&(n=a["b"],document.addEventListener("touchmove",n,u));var s=Object(r["a"])(t.$options,"onPageScroll"),c=Object(r["a"])(t.$options,"onReachBottom"),h=o.onReachBottomDistance,d=Object(i["f"])(o.titleNView)&&"transparent"===o.titleNView.type;e&&document.removeEventListener("scroll",e),(d||s||c)&&(e=Object(a["a"])(t.$page.id,{enablePageScroll:s,enablePageReachBottom:c,onReachBottomDistance:h,enableTransparentTitleNView:d}),setTimeout(function(){document.addEventListener("scroll",e)},10))})}}).call(this,n("3ad9")["default"])},"8f7e":function(t,e,n){"use strict";n.r(e);var i=n("8bbf"),r=n.n(i),o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-app",{class:{"uni-app--showtabbar":t.showTabBar}},[n("keep-alive",{attrs:{include:t.keepAliveInclude}},[n("router-view",{key:t.key})],1),t.hasTabBar?n("tab-bar",t._b({directives:[{name:"show",rawName:"v-show",value:t.showTabBar,expression:"showTabBar"}]},"tab-bar",t.tabBar,!1)):t._e(),n("toast",t._b({},"toast",t.showToast,!1)),n("action-sheet",t._b({on:{close:t._onActionSheetClose}},"action-sheet",t.showActionSheet,!1)),n("modal",t._b({on:{close:t._onModalClose}},"modal",t.showModal,!1)),n("picker",t._b({on:{close:t._onPickerClose}},"picker",t.showPicker,!1))],1)},a=[],s=n("4ec0"),c=s["a"],u=(n("854d"),n("0c7c")),l=Object(u["a"])(c,o,a,!1,null,null,null),h=l.exports,d=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page",{attrs:{"data-page":t.$route.meta.pagePath}},[t.showNavigationBar?n("page-head",t._b({},"page-head",t.navigationBar,!1)):t._e(),t.enablePullDownRefresh?n("page-refresh",{ref:"refresh",attrs:{color:t.refreshOptions.color,offset:t.refreshOptions.offset}}):t._e(),t.enablePullDownRefresh?n("page-body",{nativeOn:{touchstart:function(e){return t._touchstart(e)},touchmove:function(e){return t._touchmove(e)},touchend:function(e){return t._touchend(e)},touchcancel:function(e){return t._touchend(e)}}},[t._t("page")],2):n("page-body",[t._t("page")],2)],1)},f=[],p=n("85b6"),g=n("65a8"),m=n("24d9"),v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-head",{attrs:{"uni-page-head-type":t.type}},[n("div",{staticClass:"uni-page-head",class:{"uni-page-head-transparent":"transparent"===t.type},style:{transitionDuration:t.duration,transitionTimingFunction:t.timingFunc,backgroundColor:t.bgColor,color:t.textColor}},[n("div",{staticClass:"uni-page-head-hd"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.backButton,expression:"backButton"}],staticClass:"uni-page-head-btn",on:{click:t._back}},[n("i",{staticClass:"uni-btn-icon",style:{color:t.color,fontSize:"27px"}},[t._v("")])]),t._l(t.btns,function(e,i){return["left"===e.float?n("div",{key:i,staticClass:"uni-page-head-btn",class:{"uni-page-head-btn-red-dot":e.redDot||e.badgeText,"uni-page-head-btn-select":e.select},style:{backgroundColor:"transparent"===t.type?e.background:"transparent",width:e.width},attrs:{"badge-text":e.badgeText}},[n("i",{staticClass:"uni-btn-icon",style:t._formatBtnStyle(e),domProps:{innerHTML:t._s(t._formatBtnFontText(e))},on:{click:function(e){return t._onBtnClick(i)}}})]):t._e()]})],2),t.searchInput?t._e():n("div",{staticClass:"uni-page-head-bd"},[n("div",{staticClass:"uni-page-head__title",style:{fontSize:t.titleSize,opacity:"transparent"===t.type?0:1}},[t.loading?n("i",{staticClass:"uni-loading"}):t._e(),t._v("\n "+t._s(t.titleText)+"\n ")])]),t.searchInput?n("div",{staticClass:"uni-page-head-search",style:{"border-radius":t.searchInput.borderRadius,"background-color":t.searchInput.backgroundColor}},[n("div",{staticClass:"uni-page-head-search-placeholder",class:["uni-page-head-search-placeholder-"+(t.focus||t.text?"left":t.searchInput.align)],style:{color:t.searchInput.placeholderColor}},[t._v(t._s(t.text||t.composing?"":t.searchInput.placeholder))]),n("v-uni-input",{ref:"input",staticClass:"uni-page-head-search-input",style:{color:t.searchInput.color},attrs:{focus:t.searchInput.autoFocus,disabled:t.searchInput.disabled,"placeholder-style":"color:"+t.searchInput.placeholderColor,"confirm-type":"search"},on:{focus:t._focus,blur:t._blur,"update:value":t._input},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1):t._e(),n("div",{staticClass:"uni-page-head-ft"},[t._l(t.btns,function(e,i){return["left"!==e.float?n("div",{key:i,staticClass:"uni-page-head-btn",class:{"uni-page-head-btn-red-dot":e.redDot||e.badgeText,"uni-page-head-btn-select":e.select},style:{backgroundColor:"transparent"===t.type?e.background:"transparent",width:e.width},attrs:{"badge-text":e.badgeText}},[n("i",{staticClass:"uni-btn-icon",style:t._formatBtnStyle(e),domProps:{innerHTML:t._s(t._formatBtnFontText(e))},on:{click:function(e){return t._onBtnClick(i)}}})]):t._e()]})],2)]),"transparent"!==t.type?n("div",{staticClass:"uni-placeholder"}):t._e()])},b=[],y=n("adb0"),_=y["a"],w=(n("8e16"),Object(u["a"])(_,v,b,!1,null,null,null)),S=w.exports,k=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-wrapper",[n("uni-page-body",[t._t("default")],2)],1)},T=[],x={name:"PageBody"},C=x,O=(n("167a"),Object(u["a"])(C,k,T,!1,null,null,null)),M=O.exports,E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-refresh",[n("div",{staticClass:"uni-page-refresh",style:{"margin-top":t.offset+"px"}},[n("div",{staticClass:"uni-page-refresh-inner"},[n("svg",{staticClass:"uni-page-refresh__icon",attrs:{fill:t.color,width:"24",height:"24",viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}}),n("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),n("svg",{staticClass:"uni-page-refresh__spinner",attrs:{width:"24",height:"24",viewBox:"25 25 50 50"}},[n("circle",{staticClass:"uni-page-refresh__path",attrs:{stroke:t.color,cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"}})])])])])},A=[],$={name:"PageRefresh",props:{color:{type:String,default:"#2BD009"},offset:{type:Number,default:0}}},I=$,P=(n("9b5b"),Object(u["a"])(I,E,A,!1,null,null,null)),B=P.exports,j=n("be12"),L={name:"Page",mpType:"page",components:{PageHead:S,PageBody:M,PageRefresh:B},mixins:[j["a"]],props:{isQuit:{type:Boolean,default:!1},isEntry:{type:Boolean,default:!1},isTabBar:{type:Boolean,default:!1},tabBarIndex:{type:Number,default:-1},navigationBarBackgroundColor:{type:String,default:"#000"},navigationBarTextStyle:{default:"white",validator:function(t){return-1!==["white","black"].indexOf(t)}},navigationBarTitleText:{type:String,default:""},navigationStyle:{default:"default",validator:function(t){return-1!==["default","custom"].indexOf(t)}},backgroundColor:{type:String,default:"#ffffff"},backgroundTextStyle:{default:"dark",validator:function(t){return-1!==["dark","light"].indexOf(t)}},backgroundColorTop:{type:String,default:"#fff"},backgroundColorBottom:{type:String,default:"#fff"},enablePullDownRefresh:{type:Boolean,default:!1},onReachBottomDistance:{type:Number,default:50},disableScroll:{type:Boolean,default:!1},titleNView:{type:[Boolean,Object],default:!0},pullToRefresh:{type:Object,default:function(){return{}}}},data:function(){var t=Object(m["a"])({loading:!1,backButton:!this.isQuit&&!this.$route.meta.isQuit,backgroundColor:this.navigationBarBackgroundColor,textColor:"black"===this.navigationBarTextStyle?"#000":"#fff",titleText:this.navigationBarTitleText,duration:"0",timingFunc:""},this.titleNView),e="default"===this.navigationStyle&&this.titleNView,n=Object.assign({support:!0,color:"#2BD009",style:"circle",height:70,range:150,offset:0},this.pullToRefresh),i=Object(p["d"])(n.offset);return e&&(this.titleNView&&"transparent"===this.titleNView.type||(i+=g["a"])),n.offset=i,n.height=Object(p["d"])(n.height),n.range=Object(p["d"])(n.range),{showNavigationBar:e,navigationBar:t,refreshOptions:n}},created:function(){document.title=this.navigationBar.titleText}},N=L,D=(n("6226"),Object(u["a"])(N,d,f,!1,null,null,null)),z=D.exports,R=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-async-error",on:{click:t._onClick}},[t._v("\n 网络不给力,点击屏幕重试\n")])},F=[],q={name:"AsyncError",methods:{_onClick:function(){window.location.reload()}}},V=q,H=(n("b628"),Object(u["a"])(V,R,F,!1,null,null,null)),Y=H.exports,X=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},U=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-async-loading"},[n("i",{staticClass:"uni-loading"})])}],W={name:"AsyncLoading"},G=W,K=(n("5727"),Object(u["a"])(G,X,U,!1,null,null,null)),Q=K.exports,Z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-choose-location"},[n("system-header",{attrs:{confirm:!!t.data},on:{back:t._back,confirm:t._choose}},[t._v("选择位置")]),n("div",{staticClass:"map-content"},[n("iframe",{attrs:{src:t.src,allow:"geolocation",seamless:"",sandbox:"allow-scripts allow-same-origin allow-forms",frameborder:"0"}})])],1)},J=[],tt=n("580e"),et=tt["a"],nt=(n("9470"),Object(u["a"])(et,Z,J,!1,null,null,null)),it=nt.exports,rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-open-location"},[n("system-header",{on:{back:t._back}},[t._v("位置")]),n("div",{staticClass:"map-content"},[n("iframe",{ref:"map",attrs:{src:t.src,allow:"geolocation",sandbox:"allow-scripts allow-same-origin allow-forms allow-top-navigation allow-modals allow-popups",frameborder:"0"},on:{load:t._load}}),t.isPoimarkerSrc?n("div",{staticClass:"actTonav",on:{click:t._nav}}):t._e()])],1)},ot=[],at=n("bab8"),st=__uniConfig.qqMapKey,ct="uniapp",ut="https://apis.map.qq.com/tools/poimarker",lt={name:"SystemOpenLocation",components:{SystemHeader:at["a"]},data:function(){var t=this.$route.query,e=t.latitude,n=t.longitude,i=t.scale,r=t.name,o=t.address;return{latitude:e,longitude:n,scale:i,name:r,address:o,src:"",isPoimarkerSrc:!1}},mounted:function(){this.latitude&&this.longitude&&(this.src="".concat(ut,"?type=0&marker=coord:").concat(this.latitude,",").concat(this.longitude,";title:").concat(this.name,";addr:").concat(this.address,";&key=").concat(st,"&referer=").concat(ct))},methods:{_back:function(){0!==this.$refs.map.src.indexOf(ut)?this.$refs.map.src=this.src:getApp().$router.back()},_load:function(){0===this.$refs.map.src.indexOf(ut)?this.isPoimarkerSrc=!0:this.isPoimarkerSrc=!1},_nav:function(){var t="https://apis.map.qq.com/uri/v1/routeplan?type=drive&to=".concat(encodeURIComponent(this.name),"&tocoord=").concat(this.latitude,",").concat(this.longitude,"&referer=").concat(ct);this.$refs.map.src=t}}},ht=lt,dt=(n("3da9"),Object(u["a"])(ht,rt,ot,!1,null,null,null)),ft=dt.exports,pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-preview-image",on:{click:t._click}},[n("v-uni-swiper",{staticClass:"uni-swiper",attrs:{current:t.index,"indicator-dots":!1,autoplay:!1},on:{"update:current":function(e){t.index=e}}},t._l(t.urls,function(t,e){return n("v-uni-swiper-item",{key:e},[n("img",{staticClass:"uni-preview-image",attrs:{src:t}})])}),1)],1)},gt=[],mt={name:"SystemPreviewImage",data:function(){var t=this.$route.params,e=t.urls,n=t.current;return{urls:e||[],current:n,index:0}},created:function(){var t="number"===typeof this.current?this.current:this.urls.indexOf(this.current);this.index=t<0?0:t},methods:{_click:function(){getApp().$router.back()}}},vt=mt,bt=(n("f10e"),Object(u["a"])(vt,pt,gt,!1,null,null,null)),yt=bt.exports;r.a.component(h.name,h),r.a.component(z.name,z),r.a.component(Y.name,Y),r.a.component(Q.name,Q),r.a.component(it.name,it),r.a.component(ft.name,ft),r.a.component(yt.name,yt)},"8ffa":function(t,e,n){},9040:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"createIntersectionObserver",function(){return d});var i=n("8bbf"),r=n.n(i),o=n("62b5");function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.options.rootMargin=["top","right","bottom","left"].map(function(e){return"".concat(Number(t[e])||0,"px")}).join(" ")}},{key:"relativeTo",value:function(t,e){return this.options.relativeToSelector=t,this._makeRootMargin(e),this}},{key:"relativeToViewport",value:function(t){return this.options.relativeToSelector=null,this._makeRootMargin(t),this}},{key:"observe",value:function(e,n){"function"===typeof n&&(this.options.selector=e,this.reqId=u.push(n),t.publishHandler("requestComponentObserver",{reqId:this.reqId,options:this.options},this.pageId))}},{key:"disconnect",value:function(){t.publishHandler("destroyComponentObserver",{reqId:this.reqId},this.pageId)}}]),e}();function d(e,n){if(e instanceof r.a||(n=e,e=null),e)return new h(e.$page.id,n);var i=getApp();if(i.$route&&i.$route.params.__id__)return new h(i.$route.params.__id__,n);t.emit("onError","createIntersectionObserver:fail")}}.call(this,n("0dd1"))},"90c9":function(t,e,n){},"91b0":function(t,e,n){},"91ce":function(t,e,n){},9213:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-swiper-item",t._g({},t.$listeners),[t._t("default")],2)},r=[],o={name:"SwiperItem",props:{itemId:{type:String,default:""}},mounted:function(){var t=this.$el;t.style.position="absolute",t.style.width="100%",t.style.height="100%";var e=this.$vnode._callbacks;e&&e.forEach(function(t){t()})}},a=o,s=(n("bfea"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},"924c":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n100&&(t=100),t}},watch:{realPercent:function(t,e){this.strokeTimer&&clearInterval(this.strokeTimer),this.lastPercent=e||0,this._activeAnimation()}},created:function(){this._activeAnimation()},methods:{_activeAnimation:function(){var t=this;this.active?(this.currentPercent=this.activeMode===o.activeMode?0:this.lastPercent,this.strokeTimer=setInterval(function(){t.currentPercent+1>t.realPercent?(t.currentPercent=t.realPercent,t.strokeTimer&&clearInterval(t.strokeTimer)):t.currentPercent+=1},30)):this.currentPercent=this.realPercent}}},s=a,c=(n("944e"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"9b5b":function(t,e,n){"use strict";var i=n("f8d2"),r=n.n(i);r.a},"9e56":function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=e.urls,r=e.current,o=t,a=o.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/preview-image",params:{urls:i,current:r}},function(){a(n,{errMsg:"previewImage:ok"})},function(){a(n,{errMsg:"previewImage:fail"})})}n.d(e,"previewImage",function(){return i})}.call(this,n("0dd1"))},"9f96":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-slider",t._g({ref:"uni-slider",on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-slider-wrapper"},[n("div",{staticClass:"uni-slider-tap-area"},[n("div",{staticClass:"uni-slider-handle-wrapper",style:t.setBgColor},[n("div",{ref:"uni-slider-handle",staticClass:"uni-slider-handle",style:t.setBlockBg}),n("div",{staticClass:"uni-slider-thumb",style:t.setBlockStyle}),n("div",{staticClass:"uni-slider-track",style:t.setActiveColor})])]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.showValue,expression:"showValue"}],staticClass:"uni-slider-value"},[t._v(t._s(t.sliderValue))])]),t._t("default")],2)},r=[],o=n("8af1"),a=n("ba15"),s={name:"Slider",mixins:[o["a"],o["c"],a["a"]],props:{name:{type:String,default:""},min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},value:{type:[Number,String],default:0},step:{type:[Number,String],default:1},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#e9e9e9"},backgroundColor:{type:String,default:"#e9e9e9"},activeColor:{type:String,default:"#007aff"},selectedColor:{type:String,default:"#007aff"},blockColor:{type:String,default:"#ffffff"},blockSize:{type:[Number,String],default:28},showValue:{type:[Boolean,String],default:!1}},data:function(){return{sliderValue:Number(this.value)}},computed:{setBlockStyle:function(){return{width:this.blockSize+"px",height:this.blockSize+"px",marginLeft:-this.blockSize/2+"px",marginTop:-this.blockSize/2+"px",left:this._getValueWidth(),backgroundColor:this.blockColor}},setBgColor:function(){return{backgroundColor:this._getBgColor()}},setBlockBg:function(){return{left:this._getValueWidth()}},setActiveColor:function(){return{backgroundColor:this._getActiveColor(),width:this._getValueWidth()}}},watch:{value:function(t){this.sliderValue=Number(t)}},mounted:function(){this.touchtrack(this.$refs["uni-slider-handle"],"_onTrack")},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onUserChangedValue:function(t){var e=this.$refs["uni-slider"],n=e.offsetWidth,i=e.getBoundingClientRect().left,r=(t.x-i)*(this.max-this.min)/n+Number(this.min);this.sliderValue=this._filterValue(r)},_filterValue:function(t){return tthis.max?this.max:Math.round((t-this.min)/this.step)*this.step+Number(this.min)},_getValueWidth:function(){return 100*(this.sliderValue-this.min)/(this.max-this.min)+"%"},_getBgColor:function(){return"#e9e9e9"!==this.backgroundColor?this.backgroundColor:"#007aff"!==this.color?this.color:"#007aff"},_getActiveColor:function(){return"#007aff"!==this.activeColor?this.activeColor:"#e9e9e9"!==this.selectedColor?this.selectedColor:"#e9e9e9"},_onTrack:function(t){if(!this.disabled)return"move"===t.detail.state?(this._onUserChangedValue({x:t.detail.x0}),this.$trigger("changing",t,{value:this.sliderValue}),!1):void("end"===t.detail.state&&this.$trigger("change",t,{value:this.sliderValue}))},_onClick:function(t){this.disabled||(this._onUserChangedValue(t),this.$trigger("change",t,{value:this.sliderValue}))},_resetFormData:function(){this.sliderValue=this.min},_getFormData:function(){var t={};return""!==this.name&&(t["value"]=this.sliderValue,t["key"]=this.name),t}}},c=s,u=(n("6428"),n("0c7c")),l=Object(u["a"])(c,i,r,!1,null,null,null);e["default"]=l.exports},"9fe6":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return c});var i=n("85b6"),r=n("a470");function o(t){var e={};return t.id&&(e.id=""),t.dataset&&(e.dataset={}),t.rect&&(e.left=0,e.right=0,e.top=0,e.bottom=0),t.size&&(e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight),t.scrollOffset&&(e.scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft||0,e.scrollTop=document.documentElement.scrollTop||document.body.scrollTop||0),e}function a(t,e){var n={},o=Object(r["a"])(),a=o.top;if(e.id&&(n.id=t.id),e.dataset&&(n.dataset=Object(i["c"])(t.dataset||{})),e.rect||e.size){var s=t.getBoundingClientRect();e.rect&&(n.left=s.left,n.right=s.right,n.top=s.top-a,n.bottom=s.bottom),e.size&&(n.width=s.width,n.height=s.height)}return e.properties&&e.properties.forEach(function(t){t=t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}),e.scrollOffset&&("UNI-SCROLL-VIEW"===t.tagName&&t.__vue__&&t.__vue__.getScrollPosition?Object.assign(n,t.__vue__.getScrollPosition()):(n.scrollLeft=0,n.scrollTop=0)),n}function s(t,e,n,i,r){var o=e&&e.$el||t.$el;if(i){var s=o&&(o.matches(n)?o:o.querySelector(n));return s?a(s,r):null}if(o){var c=[],u=o.querySelectorAll(n);return u&&u.length&&(c=[].map.call(u,function(t){return a(t,r)})),o.matches(n)&&c.unshift(o),c}return[]}function c(e,n){var i=e.reqId,r=e.reqs,a=getCurrentPages(),c=a.find(function(t){return t.$page.id===n});if(!c)throw new Error("Not Found:Page[".concat(n,"]"));var u=[];r.forEach(function(t){var e=t.component,n=t.selector,i=t.single,r=t.fields;0===e?u.push(o(r)):u.push(s(c,e,n,i,r))}),t.publishHandler("onRequestComponentInfo",{reqId:i,res:u},c.$page.id)}}).call(this,n("501c"))},"9fef":function(t,e,n){"use strict";n.r(e),n.d(e,"createAudioContext",function(){return r}),n.d(e,"createVideoContext",function(){return o}),n.d(e,"createMapContext",function(){return a}),n.d(e,"createCanvasContext",function(){return s});var i=[{name:"id",type:String,required:!0}],r=i,o=i,a=i,s=[{name:"canvasId",type:String,required:!0},{name:"componentInstance",type:Object}]},a041:function(t,e,n){"use strict";function i(t){return function(e,n){e&&(n[t]=Math.round(e))}}n.r(e),n.d(e,"canvasGetImageData",function(){return r}),n.d(e,"canvasPutImageData",function(){return o}),n.d(e,"canvasToTempFilePath",function(){return s}),n.d(e,"drawCanvas",function(){return c});var r={canvasId:{type:String,required:!0},x:{type:Number,required:!0,validator:i("x")},y:{type:Number,required:!0,validator:i("y")},width:{type:Number,required:!0,validator:i("width")},height:{type:Number,required:!0,validator:i("height")}},o={canvasId:{type:String,required:!0},data:{type:Uint8ClampedArray,required:!0},x:{type:Number,required:!0,validator:i("x")},y:{type:Number,required:!0,validator:i("y")},width:{type:Number,required:!0,validator:i("width")},height:{type:Number,validator:i("height")}},a={PNG:"png",JPG:"jpeg"},s={x:{type:Number,default:0,validator:i("x")},y:{type:Number,default:0,validator:i("y")},width:{type:Number,validator:i("width")},height:{type:Number,validator:i("height")},destWidth:{type:Number,validator:i("destWidth")},destHeight:{type:Number,validator:i("destHeight")},canvasId:{type:String,require:!0},fileType:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.fileType=t in a?a[t]:a.PNG}},quality:{type:Number,validator:function(t,e){t=Math.floor(t),e.quality=t>0&&t<1?t:1}}},c={canvasId:{type:String,require:!0},actions:{type:Array,require:!0},reserve:{type:Boolean,default:!1}}},a1e3:function(t,e,n){},a201:function(t,e,n){"use strict";n.r(e),n.d(e,"request",function(){return a});var i={OPTIONS:"OPTIONS",GET:"GET",HEAD:"HEAD",POST:"POST",PUT:"PUT",DELETE:"DELETE",TRACE:"TRACE",CONNECT:"CONNECT"},r={JSON:"JSON"},o={TEXT:"TEXT",ARRAYBUFFER:"ARRAYBUFFER"},a={url:{type:String,required:!0},data:{type:[Object,String,ArrayBuffer],validator:function(t,e){e.data=t||""}},header:{type:Object,validator:function(t,e){e.header=t||{}}},method:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.method=Object.values(i).indexOf(t)<0?i.GET:t}},dataType:{type:String,validator:function(t,e){e.dataType=(t||r.JSON).toUpperCase()}},responseType:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.responseType=Object.values(o).indexOf(t)<0?o.TEXT:t}}}},a20f:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return s});var i=function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/n}(),r=function(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},o={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",setTransform:[4,5]};if(1!==i){var a=CanvasRenderingContext2D.prototype;r(o,function(t,e){a[e]=function(e){return function(){if(!this.__hidpi__)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);if("all"===t)n=n.map(function(t){return t*i});else if(Array.isArray(t))for(var r=0;r\n/,"").replace(/\n/,"").replace(/\n/,"")}function o(t){return t.reduce(function(t,e){var n=e.value,i=e.name;return n.match(/ /)&&"style"!==i&&(n=n.split(" ")),t[i]?Array.isArray(t[i])?t[i].push(n):t[i]=[t[i],n]:t[i]=n,t},{})}function a(e){e=r(e);var n=[],a={node:"root",children:[]};return Object(i["a"])(e,{start:function(t,e,i){var r={name:t};if(0!==e.length&&(r.attrs=o(e)),i){var s=n[0]||a;s.children||(s.children=[]),s.children.push(r)}else n.unshift(r)},end:function(e){var i=n.shift();if(i.name!==e&&t.error("invalid state: mismatch end tag"),0===n.length)a.children.push(i);else{var r=n[0];r.children||(r.children=[]),r.children.push(i)}},chars:function(t){var e={type:"text",text:t};if(0===n.length)a.children.push(e);else{var i=n[0];i.children||(i.children=[]),i.children.push(e)}},comment:function(t){var e={node:"comment",text:t},i=n[0];i.children||(i.children=[]),i.children.push(e)}}),a.children}}).call(this,n("3ad9")["default"])},b34d:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-form",t._g({},t.$listeners),[n("span",[t._t("default")],2)])},r=[],o=n("8af1"),a={name:"Form",mixins:[o["c"]],data:function(){return{childrenList:[]}},listeners:{"@form-submit":"_onSubmit","@form-reset":"_onReset","@form-group-update":"_formGroupUpdateHandler"},methods:{_onSubmit:function(t){var e={};this.childrenList.forEach(function(t){t._getFormData&&t._getFormData().key&&(e[t._getFormData().key]=t._getFormData().value)}),this.$trigger("submit",t,{value:e})},_onReset:function(t){this.$trigger("reset",t,{}),this.childrenList.forEach(function(t){t._resetFormData&&t._resetFormData()})},_formGroupUpdateHandler:function(t){if("add"===t.type)this.childrenList.push(t.vm);else{var e=this.childrenList.indexOf(t.vm);this.childrenList.splice(e,1)}}}},s=a,c=n("0c7c"),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},b628:function(t,e,n){"use strict";var i=n("bde3"),r=n.n(i);r.a},b705:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-rich-text",t._g({},t.$listeners),[n("div")])},r=[],o=n("b10a"),a=n("f2b3"),s={a:"",abbr:"",b:"",blockquote:"",br:"",code:"",col:["span","width"],colgroup:["span","width"],dd:"",del:"",div:"",dl:"",dt:"",em:"",fieldset:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:"",hr:"",i:"",img:["alt","src","height","width"],ins:"",label:"",legend:"",li:"",ol:["start","type"],p:"",q:"",span:"",strong:"",sub:"",sup:"",table:["width"],tbody:"",td:["colspan","rowspan","height","width"],tfoot:"",th:["colspan","rowspan","height","width"],thead:"",tr:"",ul:""},c={amp:"&",gt:">",lt:"<",nbsp:" ",quot:'"',apos:"'"};function u(t){return t.replace(/&(([a-zA-Z]+)|(#x{0,1}[\da-zA-Z]+));/gi,function(t,e){if(Object(a["c"])(c,e)&&c[e])return c[e];if(/^#[0-9]{1,4}$/.test(e))return String.fromCharCode(e.slice(1));if(/^#x[0-9a-f]{1,4}$/i.test(e))return String.fromCharCode("0"+e.slice(1));var n=document.createElement("div");return n.innerHTML=t,n.innerText||n.textContent})}function l(t,e){return t.forEach(function(t){if(Object(a["f"])(t))if(Object(a["c"])(t,"type")&&"node"!==t.type)"text"===t.type&&"string"===typeof t.text&&""!==t.text&&e.appendChild(document.createTextNode(u(t.text)));else{if("string"!==typeof t.name||!t.name)return;var n=t.name.toLowerCase();if(!Object(a["c"])(s,n))return;var i=document.createElement(n);if(!i)return;var r=t.attrs;if(Object(a["f"])(r)){var o=s[n]||[];Object.keys(r).forEach(function(t){var e=r[t];switch(t){case"class":case"style":i.setAttribute(t,e);break;default:-1!==o.indexOf(t)&&i.setAttribute(t,e)}})}var c=t.children;Array.isArray(c)&&c.length&&l(t.children,i),e.appendChild(i)}}),e}var h={name:"RichText",props:{nodes:{type:[Array,String],default:function(){return[]}}},watch:{nodes:function(t){this._renderNodes(t)}},mounted:function(){this._renderNodes(this.nodes)},methods:{_renderNodes:function(t){"string"===typeof t&&(t=Object(o["a"])(t));var e=l(t,document.createDocumentFragment());this.$el.firstChild.innerHTML="",this.$el.firstChild.appendChild(e)}}},d=h,f=n("0c7c"),p=Object(f["a"])(d,i,r,!1,null,null,null);e["default"]=p.exports},b865:function(t,e,n){"use strict";(function(t){function i(e,n,i){t.UniViewJSBridge.subscribeHandler(e,n,i)}n.d(e,"a",function(){return i})}).call(this,n("24aa"))},b866:function(t,e,n){"use strict";n.r(e),n.d(e,"getImageInfo",function(){return r});var i=n("cb0f"),r={src:{type:String,required:!0,validator:function(t,e){e.src=Object(i["a"])(t)}}}},ba15:function(t,e,n){"use strict";var i=function(t,e,n,i){t.addEventListener(e,function(t){"function"===typeof n&&!1===n(t)&&(t.preventDefault(),t.stopPropagation())},{passive:!1})};e["a"]={methods:{touchtrack:function(t,e,n){var r=this,o=0,a=0,s=0,c=0,u=function(t,n,i,u){if(!1===r[e]({target:t.target,currentTarget:t.currentTarget,preventDefault:t.preventDefault.bind(t),stopPropagation:t.stopPropagation.bind(t),touches:t.touches,changedTouches:t.changedTouches,detail:{state:n,x0:i,y0:u,dx:i-o,dy:u-a,ddx:i-s,ddy:u-c,timeStamp:t.timeStamp}}))return!1},l=null;i(t,"touchstart",function(t){if(1===t.touches.length&&!l)return l=t,o=s=t.touches[0].pageX,a=c=t.touches[0].pageY,u(t,"start",o,a)}),i(t,"touchmove",function(t){if(1===t.touches.length&&l){var e=u(t,"move",t.touches[0].pageX,t.touches[0].pageY);return s=t.touches[0].pageX,c=t.touches[0].pageY,e}}),i(t,"touchend",function(t){if(0===t.touches.length&&l)return l=null,u(t,"end",t.changedTouches[0].pageX,t.changedTouches[0].pageY)}),i(t,"touchcancel",function(t){if(l){var e=l;return l=null,u(t,n?"cancel":"end",e.touches[0].pageX,e.touches[0].pageY)}})}}}},bab8:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"system-header"},[n("div",{staticClass:"header-text"},[t._t("default")],2),n("div",{staticClass:"header-btn header-back uni-btn-icon header-btn-icon",on:{click:t._back}},[t._v("")]),t.confirm?n("div",{staticClass:"header-btn header-confirm",on:{click:t._confirm}},[n("svg",{staticClass:"header-btn-img",attrs:{width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M939.6960642844446 226.08613831111114c-14.635971697777777-13.725872355555557-37.719236835555556-13.070208568888889-51.445109191111115 1.6029502577777779L402.69993870222225 744.6571451733333 137.46159843555557 483.31364238222227c-14.344349013333334-14.12709944888889-37.392384-13.98030904888889-51.51948344888889 0.3640399644444444-14.12709944888889 14.30911886222222-13.945078897777778 37.392384 0.40122709333333334 51.482296319999996l291.8171704888889 287.48392106666665c0.10960327111111111 0.10960327111111111 0.2544366933333333 0.1448334222222222 0.3640399644444444 0.2544366933333333s0.1448334222222222 0.2544366933333333 0.2544366933333333 0.3640399644444444c2.293843057777778 2.1842397866666667 5.061329351111111 3.4231500799999997 7.719212373333333 4.879309937777777 1.3113264355555554 0.7652670577777777 2.43867648 1.8926159644444445 3.822419057777778 2.43867648 4.2960634311111106 1.6753664 8.846562417777779 2.548279751111111 13.361832391111111 2.548279751111111 4.769706666666666 0 9.539412195555554-0.9472864711111111 13.98030904888889-2.839903573333333 1.4933469866666664-0.6184766577777778 2.6578830222222223-1.8926159644444445 4.0416267377777775-2.6950701511111115 2.7302991644444448-1.6029502577777779 5.5702027377777785-2.9495068444444446 7.901232924444444-5.315766044444445 0.10960327111111111-0.10960327111111111 0.1448334222222222-0.2916238222222222 0.2544366933333333-0.40122709333333334 0.07241614222222222-0.10960327111111111 0.21920654222222222-0.1448334222222222 0.3268528355555555-0.2544366933333333L941.2579134577779 277.5273335466667C955.0953460622222 262.9305059555556 954.3320359822221 239.8844279466666 939.6960642844446 226.08613831111114z"}})])]):t._e()])},r=[],o={name:"SystemHeader",props:{confirm:{type:Boolean,default:!1}},created:function(){document.title=this.$slots.default[0].text},methods:{_back:function(){this.$emit("back")},_confirm:function(){this.$emit("confirm")}}},a=o,s=(n("0a32"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["a"]=c.exports},bacd:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-canvas",t._g({attrs:{"canvas-id":t.canvasId,"disable-scroll":t.disableScroll}},t._listeners),[n("canvas",{ref:"canvas",attrs:{width:"300",height:"150"}}),n("div",{staticStyle:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden"}},[t._t("default")],2),n("v-uni-resize-sensor",{ref:"sensor",on:{resize:t._resize}})],1)},r=[],o=n("dc5e"),a=o["a"],s=(n("0741"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},bdb1:function(t,e,n){var i={"./base/base64.js":"1ca3","./base/can-i-use.js":"3648","./base/interceptor.js":"2eae","./base/upx2px.js":"45d2","./storage/storage.js":"484e","./ui/page-scroll-to.js":"84e0"};function r(t){var e=o(t);return n(e)}function o(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=o,t.exports=r,r.id="bdb1"},bde3:function(t,e,n){},be12:function(t,e,n){"use strict";(function(t){function n(t,e,n){var i=Array.prototype.slice.call(t.changedTouches).filter(function(t){return t.identifier===e})[0];return!!i&&(t.deltaY=i.pageY-n,!0)}var i="pulling",r="reached",o="aborting",a="refreshing",s="restoring";e["a"]={mounted:function(){var e=this;this.enablePullDownRefresh&&(this.refreshContainerElem=this.$refs.refresh.$el,this.refreshControllerElem=this.refreshContainerElem.querySelector(".uni-page-refresh"),this.refreshInnerElemStyle=this.refreshControllerElem.querySelector(".uni-page-refresh-inner").style,t.on(this.$route.params.__id__+".startPullDownRefresh",function(){e.state||(e.state=a,e._addClass(),setTimeout(function(){e._refreshing()},50))}),t.on(this.$route.params.__id__+".stopPullDownRefresh",function(){e.state===a&&(e._removeClass(),e.state=s,e._addClass(),e._restoring(function(){e._removeClass(),e.state=e.distance=e.offset=null}))}))},methods:{_touchstart:function(t){var e=t.changedTouches[0];this.touchId=e.identifier,this.startY=e.pageY,[o,a,s].indexOf(this.state)>=0?this.canRefresh=!1:this.canRefresh=!0},_touchmove:function(t){if(this.canRefresh&&n(t,this.touchId,this.startY)){var e=t.deltaY;if(0===(document.documentElement.scrollTop||document.body.scrollTop)){if(!(e<0)||this.state){t.preventDefault(),null==this.distance&&(this.offset=e,this.state=i,this._addClass()),e-=this.offset,e<0&&(e=0),this.distance=e;var o=e>=this.refreshOptions.range&&this.state!==r,a=e1?i=1:i*=i*i;var r=Math.round(t/(this.refreshOptions.range/this.refreshOptions.height)),o=r?"translate3d(-50%, "+r+"px, 0)":0;n.webkitTransform=o,n.clip="rect("+(45-r)+"px,45px,45px,-5px)",this.refreshInnerElemStyle.webkitTransform="rotate("+360*i+"deg)"}},_aborting:function(t){var e=this.refreshControllerElem;if(e){var n=e.style;if(n.webkitTransform){n.webkitTransition="-webkit-transform 0.3s",n.webkitTransform="translate3d(-50%, 0, 0)";var i=function i(){r&&clearTimeout(r),e.removeEventListener("webkitTransitionEnd",i),n.webkitTransition="",t()};e.addEventListener("webkitTransitionEnd",i);var r=setTimeout(i,350)}else t()}},_refreshing:function(){var e=this.refreshControllerElem;if(e){var n=e.style;n.webkitTransition="-webkit-transform 0.2s",n.webkitTransform="translate3d(-50%, "+this.refreshOptions.height+"px, 0)",t.emit("onPullDownRefresh",{},this.$route.params.__id__)}},_restoring:function(t){var e=this.refreshControllerElem;if(e){var n=e.style;n.webkitTransition="-webkit-transform 0.3s",n.webkitTransform+=" scale(0.01)";var i=function i(){r&&clearTimeout(r),e.removeEventListener("webkitTransitionEnd",i),n.webkitTransition="",n.webkitTransform="translate3d(-50%, 0, 0)",t()};e.addEventListener("webkitTransitionEnd",i);var r=setTimeout(i,350)}}}}}).call(this,n("0dd1"))},be14:function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=t,r=i.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/choose-location"},function(){var e=function e(i){t.unsubscribe("onChooseLocation",e),r(n,i?Object.assign(i,{errMsg:"chooseLocation:ok"}):{errMsg:"chooseLocation:fail"})};t.subscribe("onChooseLocation",e)},function(){r(n,{errMsg:"chooseLocation:fail"})})}n.d(e,"chooseLocation",function(){return i})}.call(this,n("0dd1"))},bfea:function(t,e,n){"use strict";var i=n("1360"),r=n.n(i);r.a},c312:function(t,e,n){},c33f:function(t,e,n){"use strict";var i=n("74ce"),r=n.n(i);r.a},c35d:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-picker",{on:{click:function(e){return e.stopPropagation(),t._click(e)}}},[n("div",[t._t("default")],2)])},r=[],o=n("f11c"),a=o["a"],s=(n("6f00"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},c41f:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-cover-view",t._g({attrs:{"scroll-top":t.scrollTop}},t.$listeners),[n("div",{ref:"content",staticClass:"uni-cover-view"},[t._t("default")],2)])},r=[],o={name:"CoverView",props:{scrollTop:{type:[String,Number],default:0}},watch:{scrollTop:function(t){this.setScrollTop(t)}},mounted:function(){this.setScrollTop(this.scrollTop)},methods:{setScrollTop:function(t){var e=this.$refs.content;"scroll"===getComputedStyle(e).overflowY&&(e.scrollTop=this._upx2pxNum(t))},_upx2pxNum:function(t){return/\d+[ur]px$/i.test(t)&&t.replace(/\d+[ur]px$/i,function(t){return uni.upx2px(parseFloat(t))}),parseFloat(t)||0}}},a=o,s=(n("cc5f"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},c439:function(t,e,n){"use strict";n.r(e),n.d(e,"getLocation",function(){return r}),n.d(e,"openLocation",function(){return o});var i={WGS84:"WGS84",GCJ02:"GCJ02"},r={type:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.type=Object.values(i).indexOf(t)<0?i.WGS84:t},default:i.WGS84},altitude:{altitude:Boolean,default:!1}},o={latitude:{type:Number,required:!0},longitude:{type:Number,required:!0},scale:{type:Number,validator:function(t,e){t=Math.floor(t),e.scale=t>=5&&t<=18?t:18},default:18},name:{type:String},address:{type:String}}},c61c:function(t,e,n){"use strict";function i(t){return Math.sqrt(t.x*t.x+t.y*t.y)}n.r(e);var r,o,a={name:"MovableArea",props:{scaleArea:{type:Boolean,default:!1}},data:function(){return{width:0,height:0,items:[]}},created:function(){this.gapV={x:null,y:null},this.pinchStartLen=null},mounted:function(){this._resize()},methods:{_resize:function(){this._getWH(),this.items.forEach(function(t,e){t.componentInstance.setParent()})},_find:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.items,n=this.$el;function i(t){for(var r=0;r1){var n={x:e[1].pageX-e[0].pageX,y:e[1].pageY-e[0].pageY};if(this.pinchStartLen=i(n),this.gapV=n,!this.scaleArea){var r=this._find(e[0].target),o=this._find(e[1].target);this._scaleMovableView=r&&r===o?r:null}}},_touchmove:function(t){var e=t.touches;if(e&&e.length>1){t.preventDefault();var n={x:e[1].pageX-e[0].pageX,y:e[1].pageY-e[0].pageY};if(null!==this.gapV.x&&this.pinchStartLen>0){var r=i(n)/this.pinchStartLen;this._updateScale(r)}this.gapV=n}},_touchend:function(t){var e=t.touches;e&&e.length||t.changedTouches&&(this.gapV.x=0,this.gapV.y=0,this.pinchStartLen=null,this.scaleArea?this.items.forEach(function(t){t.componentInstance._endScale()}):this._scaleMovableView&&this._scaleMovableView.componentInstance._endScale())},_updateScale:function(t){t&&1!==t&&(this.scaleArea?this.items.forEach(function(e){e.componentInstance._setScale(t)}):this._scaleMovableView&&this._scaleMovableView.componentInstance._setScale(t))},_getWH:function(){var t=window.getComputedStyle(this.$el),e=this.$el.getBoundingClientRect();this.width=e.width-["Left","Right"].reduce(function(e,n){return e+parseFloat(t["border"+n+"Width"])+parseFloat(t["padding"+n])},0),this.height=e.height-["Top","Bottom"].reduce(function(e,n){return e+parseFloat(t["border"+n+"Width"])+parseFloat(t["padding"+n])},0)}},render:function(t){var e=this,n=[];this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"v-uni-movable-view"===t.componentOptions.tag&&n.push(t)}),this.items=n;var i=Object.assign({},this.$listeners),r=["touchstart","touchmove","touchend"];return r.forEach(function(t){var n=i[t],r=e["_".concat(t)];i[t]=n?[].concat(n,r):r}),t("uni-movable-area",{on:i},[t("v-uni-resize-sensor",{on:{resize:this._resize}})].concat(n))}},s=a,c=(n("a3e5"),n("0c7c")),u=Object(c["a"])(s,r,o,!1,null,null,null);e["default"]=u.exports},c8ed:function(t,e,n){"use strict";var i=n("0dba"),r=n.n(i);r.a},c96e:function(t,e,n){"use strict";var i=n("c312"),r=n.n(i);r.a},c99c:function(t,e,n){},cb0f:function(t,e,n){"use strict";n.d(e,"a",function(){return s});var i=n("0f74"),r=/^([a-z-]+:)?\/\//i,o=/^data:[a-z-]+\/[a-z-]+;base64,/;function a(t){return __uniConfig.router.base?__uniConfig.router.base+t:t}function s(t){if(0===t.indexOf("/")){if(0!==t.indexOf("//"))return a(t.substr(1));t="https:"+t}if(r.test(t)||o.test(t)||0===t.indexOf("blob:"))return t;var e=getCurrentPages();return e.length?a(Object(i["a"])(e[e.length-1].$page.route,t).substr(1)):t}},cc5f:function(t,e,n){"use strict";var i=n("6f45"),r=n.n(i);r.a},cc76:function(t,e,n){"use strict";var i=Object.create(null),r=n("19c4");r.keys().forEach(function(t){Object.assign(i,r(t))}),e["a"]=i},cc83:function(t,e,n){},cee1:function(t,e,n){},cef5:function(t,e,n){"use strict";n.r(e),n.d(e,"getProvider",function(){return r});var i={OAUTH:"OAUTH",SHARE:"SHARE",PAYMENT:"PAYMENT",PUSH:"PUSH"},r={service:{type:String,required:!0,validator:function(t,e){if(t=(t||"").toUpperCase(),t&&Object.values(i).indexOf(t)<0)return"service error"}}}},d3bd:function(t,e,n){"use strict";n.r(e);var i,r,o=n("8af1"),a={name:"Button",mixins:[o["b"],o["a"],o["c"]],props:{hoverClass:{type:String,default:"button-hover"},disabled:{type:[Boolean,String],default:!1},id:{type:String,default:""},hoverStopPropagation:{type:Boolean,default:!1},hoverStartTime:{type:Number,default:20},hoverStayTime:{type:Number,default:70},formType:{type:String,default:"",validator:function(t){return~["","submit","reset"].indexOf(t)}}},data:function(){return{clickFunction:null}},methods:{_onClick:function(t,e){this.disabled||(e&&this.$el.click(),this.formType&&this.$dispatch("Form","submit"===this.formType?"uni-form-submit":"uni-form-reset",{type:this.formType}))},_bindObjectListeners:function(t,e){if(e)for(var n in e){var i=t.on[n],r=e[n];t.on[n]=i?[].concat(i,r):r}return t}},render:function(t){var e=this,n=Object.create(null);return this.$listeners&&Object.keys(this.$listeners).forEach(function(t){(!e.disabled||"click"!==t&&"tap"!==t)&&(n[t]=e.$listeners[t])}),this.hoverClass&&"none"!==this.hoverClass?t("uni-button",this._bindObjectListeners({class:[this.hovering?this.hoverClass:""],attrs:{disabled:this.disabled},on:{touchstart:this._hoverTouchStart,touchend:this._hoverTouchEnd,touchcancel:this._hoverTouchCancel,click:this._onClick}},n),this.$slots.default):t("uni-button",this._bindObjectListeners({class:[this.hovering?this.hoverClass:""],attrs:{disabled:this.disabled},on:{click:this._onClick}},n),this.$slots.default)},listeners:{"label-click":"_onClick","@label-click":"_onClick"}},s=a,c=(n("5676"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},d4b6:function(t,e,n){"use strict";n.d(e,"b",function(){return f}),n.d(e,"a",function(){return k});var i=n("f2b3"),r=n("85b6"),o=n("24d9"),a=n("a470");function s(t,e){return l(t)||u(t,e)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function u(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done);i=!0)if(n.push(a.value),e&&n.length===e)break}catch(c){r=!0,o=c}finally{try{i||null==s["return"]||s["return"]()}finally{if(r)throw o}}return n}function l(t){if(Array.isArray(t))return t}function h(t,e){var n={id:t.id,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,dataset:Object(r["c"])(t.dataset)};return e&&Object.assign(n,e),n}function d(t){if(t){for(var e=[],n=Object(a["a"])(),i=n.top,r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e._processed)return e.type=n.type||t,e;if("click"===t){var s=Object(a["a"])(),c=s.top;n={x:e.x,y:e.y-c},e.touches=e.changedTouches=[{force:1,identifier:0,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}]}return Object(o["b"])({type:n.type||t,timeStamp:e.timeStamp||0,detail:n,target:h(i,n),currentTarget:h(r),touches:e instanceof Event?d(e.touches):e.touches,changedTouches:e instanceof Event?d(e.changedTouches):e.changedTouches,preventDefault:function(){},stopPropagation:function(){}})}var p=350,g=10,m=!!i["h"]&&{passive:!0},v=!1;function b(){v&&(clearTimeout(v),v=!1)}var y=0,_=0;function w(t){if(b(),1===t.touches.length){var e=s(t.touches,1),n=e[0],i=n.pageX,r=n.pageY;y=i,_=r,v=setTimeout(function(){t.target.dispatchEvent(new TouchEvent("longpress",{bubbles:!0,cancelable:!0,target:t.target,currentTarget:t.currentTarget,touches:t.touches,changedTouches:t.changedTouches}))},p)}}function S(t){if(v){if(1!==t.touches.length)return b();var e=s(t.touches,1),n=e[0],i=n.pageX,r=n.pageY;return Math.abs(i-y)>g||Math.abs(r-_)>g?b():void 0}}function k(){window.addEventListener("touchstart",w,m),window.addEventListener("touchmove",S,m),window.addEventListener("touchend",b,m),window.addEventListener("touchcancel",b,m)}},d5bc:function(t,e,n){},d5be:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"chooseImage",function(){return u});var i=n("e2e2"),r=n("f2b3"),o=t,a=o.invokeCallbackHandler,s=null,c=function(t){var e=document.createElement("input");return e.type="file",Object(r["j"])(e,{position:"absolute",visibility:"hidden","z-index":-999,width:0,height:0,top:0,left:0}),e.accept="image/*",t.count>1&&(e.multiple="multiple"),1===t.sourceType.length&&"camera"===t.sourceType[0]&&(e.capture="camera"),e};function u(t,e){var n=t.count,r=t.sourceType;s&&(document.body.removeChild(s),s=null),s=c({count:n,sourceType:r}),document.body.appendChild(s),s.addEventListener("change",function(t){for(var n=[],r=[],o=t.target.files.length,s=0;s=e||n.radioList[e].radioChecked&&(n.radioList[r].radioChecked=!1)}))})},_getFormData:function(){var t={};if(""!==this.name){var e="";this.radioList.forEach(function(t){t.radioChecked&&(e=t.value)}),t["value"]=e,t["key"]=this.name}return t}}},s=a,c=(n("fb61"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},d60d:function(t,e,n){},d677:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-cover-image",t._g({attrs:{src:t.src}},t.$listeners),[n("div",{staticClass:"uni-cover-image"},[t.src?n("img",{attrs:{src:t.$getRealPath(t.src)},on:{load:t._load,error:t._error}}):t._e()])])},r=[],o={name:"CoverImage",props:{src:{type:String,default:""}},methods:{_load:function(t){this.$trigger("load",t)},_error:function(t){this.$trigger("error",t)}}},a=o,s=(n("5d1d"),n("0c7c")),c=Object(s["a"])(a,i,r,!1,null,null,null);e["default"]=c.exports},d68b:function(t,e,n){"use strict";n.r(e),n.d(e,"showModal",function(){return r}),n.d(e,"showToast",function(){return o}),n.d(e,"showLoading",function(){return a}),n.d(e,"showActionSheet",function(){return s});var i=n("cb0f"),r={title:{type:String,default:""},content:{type:String,default:""},showCancel:{type:Boolean,default:!0},cancelText:{type:String,default:"取消"},cancelColor:{type:String,default:"#000000"},confirmText:{type:String,default:"确定"},confirmColor:{type:String,default:"#007aff"},visible:{type:Boolean,default:!0}},o={title:{type:String,default:""},icon:{default:"success",validator:function(t,e){-1===["success","loading","none"].indexOf(t)&&(e.icon="success")}},image:{type:String,default:"",validator:function(t,e){t&&(e.image=Object(i["a"])(t))}},duration:{type:Number,default:1500},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},a={title:{type:String,default:""},icon:{type:String,default:"loading"},duration:{type:Number,default:1e8},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},s={itemList:{type:Array,required:!0,validator:function(t,e){if(!t.length)return"parameter.itemList should have at least 1 item"}},itemColor:{type:String,default:"#000000"},visible:{type:Boolean,default:!0}}},daa0:function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.text,n=t.color;a(this.id,this.pageId,"sendDanmu",{text:e,color:n})}},{key:"playbackRate",value:function(t){~s.indexOf(t)||(t=1),a(this.id,this.pageId,"playbackRate",{rate:t})}},{key:"requestFullScreen",value:function(){a(this.id,this.pageId,"requestFullScreen")}},{key:"exitFullScreen",value:function(){a(this.id,this.pageId,"exitFullScreen")}},{key:"showStatusBar",value:function(){a(this.id,this.pageId,"showStatusBar")}},{key:"hideStatusBar",value:function(){a(this.id,this.pageId,"hideStatusBar")}}]),t}();function u(e,n){if(n)return new c(e,n.$page.id);var i=getApp();if(i.$route&&i.$route.params.__id__)return new c(e,i.$route.params.__id__);t.emit("onError","createVideoContext:fail")}}.call(this,n("0dd1"))},db18:function(t,e,n){"use strict";var i=n("08c9"),r=n.n(i);r.a},dc5e:function(t,e,n){"use strict";(function(t,i){var r=n("8af1"),o=n("a20f");function a(t){return u(t)||c(t)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function c(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function u(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e-1&&o&&!Object(i["c"])(r,"default")&&(s=!1),void 0===s&&Object(i["c"])(r,"default")){var u=r["default"];s=Object(i["e"])(u)?u():u,n[t]=s}return a(r,t,s,o,n)}function a(t,e,n,i,r){if(t.required&&i)return"Missing required parameter `".concat(e,"`");if(null==n&&!t.required){var o=t.validator;return o?o(n,r):void 0}var a=t.type,s=!a||!0===a,u=[];if(a){Array.isArray(a)||(a=[a]);for(var l=0;l=0?f:255,[l,h,d,f]}return i.group("非法颜色: "+t),i.error("不支持颜色:"+t),i.groupEnd(),[0,0,0,255]}function b(t){this.width=t}function y(t,e){this.image=t,this.repetition=e}var _,w=function(){function t(e,n){h(this,t),this.type=e,this.data=n,this.colorStop=[]}return f(t,[{key:"addColorStop",value:function(t,e){this.colorStop.push([t,v(e)])}}]),t}(),S=["scale","rotate","translate","setTransform","transform"],k=["drawImage","fillText","fill","stroke","fillRect","strokeRect","clearRect","strokeText"],T=["setFillStyle","setTextAlign","setStrokeStyle","setGlobalAlpha","setShadow","setFontSize","setLineCap","setLineJoin","setLineWidth","setMiterLimit","setTextBaseline","setLineDash"];function x(){return _||(_=document.createElement("canvas")),_}var C=function(){function t(e,n){h(this,t),this.id=e,this.pageId=n,this.actions=[],this.path=[],this.subpath=[],this.currentTransform=[],this.currentStepAnimates=[],this.drawingState=[],this.state={lineDash:[0,0],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:[0,0,0,0],font:"10px sans-serif",fontSize:10,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif"}}return f(t,[{key:"draw",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,i=s(this.actions);this.actions=[],this.path=[],"function"===typeof n&&(t=p.push(n)),g(this.id,this.pageId,"actionsChanged",{actions:i,reserve:e,callbackId:t})}},{key:"createLinearGradient",value:function(t,e,n,i){return new w("linear",[t,e,n,i])}},{key:"createCircularGradient",value:function(t,e,n){return new w("radial",[t,e,n])}},{key:"createPattern",value:function(t,e){if(void 0===e)i.error("Failed to execute 'createPattern' on 'CanvasContext': 2 arguments required, but only 1 present.");else{if(!(["repeat","repeat-x","repeat-y","no-repeat"].indexOf(e)<0))return new y(t,e);i.error("Failed to execute 'createPattern' on 'CanvasContext': The provided type ('"+e+"') is not one of 'repeat', 'no-repeat', 'repeat-x', or 'repeat-y'.")}}},{key:"measureText",value:function(t){var e=x().getContext("2d");return e.font=this.state.font,new b(e.measureText(t).width||0)}},{key:"save",value:function(){this.actions.push({method:"save",data:[]}),this.drawingState.push(this.state)}},{key:"restore",value:function(){this.actions.push({method:"restore",data:[]}),this.state=this.drawingState.pop()||{lineDash:[0,0],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:[0,0,0,0],font:"10px sans-serif",fontSize:10,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif"}}},{key:"beginPath",value:function(){this.path=[],this.subpath=[]}},{key:"moveTo",value:function(t,e){this.path.push({method:"moveTo",data:[t,e]}),this.subpath=[[t,e]]}},{key:"lineTo",value:function(t,e){0===this.path.length&&0===this.subpath.length?this.path.push({method:"moveTo",data:[t,e]}):this.path.push({method:"lineTo",data:[t,e]}),this.subpath.push([t,e])}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.push({method:"quadraticCurveTo",data:[t,e,n,i]}),this.subpath.push([n,i])}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){this.path.push({method:"bezierCurveTo",data:[t,e,n,i,r,o]}),this.subpath.push([r,o])}},{key:"arc",value:function(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.path.push({method:"arc",data:[t,e,n,i,r,o]}),this.subpath.push([t,e])}},{key:"rect",value:function(t,e,n,i){this.path.push({method:"rect",data:[t,e,n,i]}),this.subpath=[[t,e]]}},{key:"arcTo",value:function(t,e,n,i,r){this.path.push({method:"arcTo",data:[t,e,n,i,r]}),this.subpath.push([n,i])}},{key:"clip",value:function(){this.actions.push({method:"clip",data:s(this.path)})}},{key:"closePath",value:function(){this.path.push({method:"closePath",data:[]}),this.subpath.length&&(this.subpath=[this.subpath.shift()])}},{key:"clearActions",value:function(){this.actions=[],this.path=[],this.subpath=[]}},{key:"getActions",value:function(){var t=s(this.actions);return this.clearActions(),t}},{key:"lineDashOffset",set:function(t){this.actions.push({method:"setLineDashOffset",data:[t]})}},{key:"globalCompositeOperation",set:function(t){this.actions.push({method:"setGlobalCompositeOperation",data:[t]})}},{key:"shadowBlur",set:function(t){this.actions.push({method:"setShadowBlur",data:[t]})}},{key:"shadowColor",set:function(t){this.actions.push({method:"setShadowColor",data:[t]})}},{key:"shadowOffsetX",set:function(t){this.actions.push({method:"setShadowOffsetX",data:[t]})}},{key:"shadowOffsetY",set:function(t){this.actions.push({method:"setShadowOffsetY",data:[t]})}},{key:"font",set:function(t){var e=this;this.state.font=t;var n=t.match(/^(([\w\-]+\s)*)(\d+r?px)(\/(\d+\.?\d*(r?px)?))?\s+(.*)/);if(n){var r=n[1].trim().split(/\s/),o=parseFloat(n[3]),a=n[7],s=[];r.forEach(function(t,n){["italic","oblique","normal"].indexOf(t)>-1?(s.push({method:"setFontStyle",data:[t]}),e.state.fontStyle=t):["bold","normal"].indexOf(t)>-1?(s.push({method:"setFontWeight",data:[t]}),e.state.fontWeight=t):0===n?(s.push({method:"setFontStyle",data:["normal"]}),e.state.fontStyle="normal"):1===n&&c()}),1===r.length&&c(),r=s.map(function(t){return t.data[0]}).join(" "),this.state.fontSize=o,this.state.fontFamily=a,this.actions.push({method:"setFont",data:["".concat(r," ").concat(o,"px ").concat(a)]})}else i.warn("Failed to set 'font' on 'CanvasContext': invalid format.");function c(){s.push({method:"setFontWeight",data:["normal"]}),e.state.fontWeight="normal"}},get:function(){return this.state.font}},{key:"fillStyle",set:function(t){this.setFillStyle(t)}},{key:"strokeStyle",set:function(t){this.setStrokeStyle(t)}},{key:"globalAlpha",set:function(t){t=Math.floor(255*parseFloat(t)),this.actions.push({method:"setGlobalAlpha",data:[t]})}},{key:"textAlign",set:function(t){this.actions.push({method:"setTextAlign",data:[t]})}},{key:"lineCap",set:function(t){this.actions.push({method:"setLineCap",data:[t]})}},{key:"lineJoin",set:function(t){this.actions.push({method:"setLineJoin",data:[t]})}},{key:"lineWidth",set:function(t){this.actions.push({method:"setLineWidth",data:[t]})}},{key:"miterLimit",set:function(t){this.actions.push({method:"setMiterLimit",data:[t]})}},{key:"textBaseline",set:function(t){this.actions.push({method:"setTextBaseline",data:[t]})}}]),t}();function O(e,n){if(n)return new C(e,n.$page.id);var i=getApp();if(i.$route&&i.$route.params.__id__)return new C(e,i.$route.params.__id__);t.emit("onError","createCanvasContext:fail")}[].concat(S,k).forEach(function(t){function e(t){switch(t){case"fill":case"stroke":return function(){this.actions.push({method:t+"Path",data:s(this.path)})};case"fillRect":return function(t,e,n,i){this.actions.push({method:"fillPath",data:[{method:"rect",data:[t,e,n,i]}]})};case"strokeRect":return function(t,e,n,i){this.actions.push({method:"strokePath",data:[{method:"rect",data:[t,e,n,i]}]})};case"fillText":case"strokeText":return function(e,n,i,r){var o=[e.toString(),n,i];"number"===typeof r&&o.push(r),this.actions.push({method:t,data:o})};case"drawImage":return function(e,n,i,r,o,a,s,c,u){var l;function h(t){return"number"===typeof t}void 0===u&&(a=n,s=i,c=r,u=o,n=void 0,i=void 0,r=void 0,o=void 0),l=h(n)&&h(i)&&h(r)&&h(o)?[e,a,s,c,u,n,i,r,o]:h(c)&&h(u)?[e,a,s,c,u]:[e,a,s],this.actions.push({method:t,data:l})};default:return function(){for(var e=arguments.length,n=new Array(e),i=0;i2&&void 0!==arguments[2]&&arguments[2],i=document.getElementById(e);i&&n&&(i.parentNode.removeChild(i),i=null),i||(i=document.createElement("style"),i.type="text/css",e&&(i.id=e),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(t))}n.d(e,"a",function(){return i})},eaa4:function(t,e,n){},ed1a:function(t,e,n){"use strict";n.d(e,"b",function(){return l}),n.d(e,"a",function(){return h}),n.d(e,"c",function(){return d}),n.d(e,"d",function(){return g});var i=n("f2b3"),r=n("8542"),o=/^\$|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/,a=/^create|Manager$/,s=["request","downloadFile","uploadFile","connectSocket"],c=/^on/;function u(t){return a.test(t)}function l(t){return o.test(t)}function h(t){return c.test(t)}function d(t){return-1!==s.indexOf(t)}function f(t){return t.then(function(t){return[null,t]}).catch(function(t){return[t]})}function p(t){return!(u(t)||l(t)||h(t))}function g(t,e){return p(t)?function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length,a=new Array(o>1?o-1:0),s=1;s should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab")}}}}).call(this,n("3ad9")["default"])},f102:function(t,e,n){"use strict";n.r(e),n.d(e,"makePhoneCall",function(){return i});var i={phoneNumber:{type:String,required:!0,validator:function(t){if(!t)return"makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;"}}}},f10e:function(t,e,n){"use strict";var i=n("53f0"),r=n.n(i);r.a},f11c:function(t,e,n){"use strict";(function(t){var i=n("8af1");function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var o=t,a=o.subscribe,s=o.unsubscribe,c=o.publishHandler,u={SELECTOR:"selector",MULTISELECTOR:"multiSelector",TIME:"time",DATE:"date"},l={YEAR:"year",MONTH:"month",DAY:"day"};e["a"]={name:"Picker",mixins:[i["a"]],props:{name:{type:String,default:""},range:{type:Array,default:function(){return[]}},rangeKey:{type:String,default:""},value:{type:[Number,String,Array],default:0},mode:{type:String,default:u.SELECTOR,validator:function(t){return Object.values(u).indexOf(t)>=0}},fields:{type:String,default:"day",validator:function(t){return Object.values(l).indexOf(t)>=0}},start:{type:String,default:function(){if(this.mode===u.TIME)return"00:00";if(this.mode===u.DATE){var t=(new Date).getFullYear()-100;switch(this.fields){case l.YEAR:return t;case l.MONTH:return t+"-01";case l.DAY:return t+"-01-01"}}return""}},end:{type:String,default:function(){if(this.mode===u.TIME)return"23:59";if(this.mode===u.DATE){var t=(new Date).getFullYear()+100;switch(this.fields){case l.YEAR:return t;case l.MONTH:return t+"-12";case l.DAY:return t+"-12-31"}}return""}},disabled:{type:[Boolean,String],default:!1}},data:function(){return{valueSync:this.value||0,visible:!1,valueChangeSource:""}},watch:{value:function(t){var e=this;Array.isArray(t)?(Array.isArray(this.valueSync)||(this.valueSync=[]),this.valueSync.length=t.length,t.forEach(function(t,n){t!==e.valueSync[n]&&e.$set(e.valueSync,n,t)})):"object"!==r(t)&&(this.valueSync=t)},valueSync:function(t){this.valueChangeSource?this.$emit("update:value",t):this._show()}},created:function(){var t=this;this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this}),Object.keys(this.$props).forEach(function(e){"value"!==e&&"name"!==e&&t.$watch(e,t._show)})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},destroyed:function(){if(this.visible){var t=this.$page.id;c("hidePicker",{},t)}},methods:{_click:function(){if(!this.disabled){var t=this.$page.id;a("".concat(t,"-picker-change"),this.change),a("".concat(t,"-picker-columnchange"),this.columnchange),a("".concat(t,"-picker-cancel"),this.cancel),this.visible=!0,this._show()}},_show:function(){if(this.visible){var t=this.$page.id,e=Object.assign({},this.$props);e.value=this.valueSync,c("showPicker",e,t)}},change:function(t){this.visible=!1;var e=this.$page.id;if(s("".concat(e,"-picker-change")),s("".concat(e,"-picker-columnchange")),s("".concat(e,"-picker-cancel")),!this.disabled){this.valueChangeSource="click";var n=t.value;this.valueSync=Array.isArray(n)?n.map(function(t){return t}):n,this.$trigger("change",{},{value:n})}},columnchange:function(t){this.$trigger("columnchange",{},t)},cancel:function(t){this.visible=!1;var e=this.$page.id;s("".concat(e,"-picker-change")),s("".concat(e,"-picker-columnchange")),s("".concat(e,"-picker-cancel")),this.$trigger("cancel",{},{})},_getFormData:function(){return{value:this.valueSync,key:this.name}},_resetFormData:function(){this.valueSync=""}}}}).call(this,n("501c"))},f1b2:function(t,e,n){"use strict";n.r(e),n.d(e,"chooseImage",function(){return o});var i=["original","compressed"],r=["album","camera"],o={count:{type:Number,required:!1,default:9,validator:function(t,e){t<=0&&(e.count=9)}},sizeType:{type:Array,required:!1,default:i,validator:function(t,e){var n=t.length;if(n){for(var r=0;r9?t:"0"+t};function c(t){return"function"===typeof t}function u(t){return"[object Object]"===o.call(t)}function l(t,e){return a.call(t,e)}function h(t){return o.call(t).slice(8,-1)}function d(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var f=/-(\w)/g;d(function(t){return t.replace(f,function(t,e){return e?e.toUpperCase():""})});function p(t,e,n){e.forEach(function(e){l(n,e)&&(t[e]=n[e])})}function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(""+t).replace(/[^\x00-\xff]/g,"**").length}function m(t){var e=t.date,n=void 0===e?new Date:e,i=t.mode,r=void 0===i?"date":i;return"time"===r?s(n.getHours())+":"+s(n.getMinutes()):n.getFullYear()+"-"+s(n.getMonth()+1)+"-"+s(n.getDate())}function v(t,e){for(var n in e)t.style[n]=e[n]}function b(t){var e,n,i;return t=t.replace("#",""),6===t.length&&(e=t.substring(0,2),n=t.substring(2,4),i=t.substring(4,6),1===e.length&&(e+=e),1===n.length&&(n+=n),1===i.length&&(i+=i),e=parseInt(e,16),n=parseInt(n,16),i=parseInt(i,16),{r:e,g:n,b:i})}n.d(e,"h",function(){return i}),n.d(e,"e",function(){return c}),n.d(e,"f",function(){return u}),n.d(e,"c",function(){return l}),n.d(e,"i",function(){return h}),n.d(e,"g",function(){return p}),n.d(e,"b",function(){return g}),n.d(e,"a",function(){return m}),n.d(e,"j",function(){return v}),n.d(e,"d",function(){return b})},f4e0:function(t,e,n){"use strict";var i=n("ffdb"),r=n.n(i);r.a},f53a:function(t,e,n){"use strict";var i=n("4871"),r=n.n(i);r.a},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(i){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},f7b4:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"onCompassChange",function(){return o}),n.d(e,"startCompass",function(){return a}),n.d(e,"stopCompass",function(){return s});var i,r=[];function o(t){r.push(t),i||a()}function a(){var e=t,n=e.invokeCallbackHandler;if(window.DeviceOrientationEvent)return i=function(t){var e=360-t.alpha;r.forEach(function(t){n(t,{errMsg:"onCompassChange:ok",direction:e||0})})},window.addEventListener("deviceorientation",i,!1),{};throw new Error("device nonsupport deviceorientation")}function s(){return i&&(window.removeEventListener("deviceorientation",i,!1),i=null),{}}}.call(this,n("0dd1"))},f7fd:function(t,e,n){"use strict";var i=n("ac9d"),r=n.n(i);r.a},f8d2:function(t,e,n){},f9d2:function(t,e,n){"use strict";n.r(e),n.d(e,"createInnerAudioContext",function(){return h});var i=n("cb0f");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n0&&(n.currentTime=t)});var a=["canplay","play","pause","ended","timeUpdate","error","waiting","seeking","seeked"],u=["pause","seeking","seeked","timeUpdate"];a.forEach(function(t){n.addEventListener(t.toLowerCase(),function(){e._stoping&&u.indexOf(t)>=0||e._events["on".concat(t.substr(0,1).toUpperCase()).concat(t.substr(1))].forEach(function(t){t()})},!1)})}return a(t,[{key:"play",value:function(){this._stoping=!1,this._audio.play()}},{key:"pause",value:function(){this._audio.pause()}},{key:"stop",value:function(){this._stoping=!0,this._audio.pause(),this._audio.currentTime=0,this._events.onStop.forEach(function(t){t()})}},{key:"seek",value:function(t){this._stoping=!1,t=Number(t),"number"!==typeof t||isNaN(t)||(this._audio.currentTime=t)}},{key:"destroy",value:function(){this.stop()}}]),t}();function h(){return new l}c.forEach(function(t){l.prototype[t]=function(e){"function"===typeof e&&this._events[t].push(e)}}),u.forEach(function(t){l.prototype[t]=function(e){var n=this._events[t.replace("off","on")],i=n.indexOf(e);i>=0&&n.splice(i,1)}})},fa1e:function(t,e,n){"use strict";function i(){var t=document.activeElement;!t||"TEXTAREA"!==t.tagName&&"INPUT"!==t.tagName||t.blur()}n.r(e),n.d(e,"hideKeyboard",function(){return i})},fa89:function(t,e,n){},fae3:function(t,e,n){"use strict";var i;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=i[1]));n("2ef3")},fb61:function(t,e,n){"use strict";var i=n("90c9"),r=n.n(i);r.a},fb79:function(t,e,n){"use strict";(function(t){var i=n("f2b3");function r(t){return s(t)||a(t)||o()}function o(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function a(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0&&(n=e.map(function(){return 0})),n},endArray:function(){var t=this.mode===c.DATE?"-":":",e=this.mode===c.DATE?this.dateArray:this.timeArray,n=this.end.split(t).map(function(t,n){return e[n].indexOf(t)});return n.indexOf(-1)>=0&&(n=e.map(function(t){return t.length-1})),n},units:function(){switch(this.mode){case c.DATE:return["年","月","日"];case c.TIME:return["时","分"];default:return[]}}},watch:{valueArray:function(e){var n=this;if(this.mode===c.TIME||this.mode===c.DATE){var i=this.mode===c.TIME?this._getTimeValue:this._getDateValue,r=this.valueArray,o=this.startArray,a=this.endArray;if(this.mode===c.DATE){var s=this.dateArray,u=s[2].length,l=s[2][r[2]],h=new Date("".concat(s[0][r[0]],"/").concat(s[1][r[1]],"/").concat(l)).getDate();l=Number(l),hi(a)&&this._cloneArray(r,a)}e.forEach(function(e,i){e!==n.oldValueArray[i]&&(n.oldValueArray[i]=e,n.mode===c.MULTISELECTOR&&t.publishHandler(n.pageId+"-picker-columnchange",{column:i,value:e},n.pageId))})},visible:function(t){var e=this;t||this.$nextTick(function(){return e._setValue()})}},created:function(){this._createTime(),this._createDate(),this._setValue(),this.$watch("value",this._setValue),this.$watch("mode",this._setValue)},methods:{_createTime:function(){var t=[],e=[];t.splice(0,t.length);for(var n=0;n<24;n++)t.push((n<10?"0":"")+n);e.splice(0,e.length);for(var i=0;i<60;i++)e.push((i<10?"0":"")+i);this.timeArray.push(t,e)},_createDate:function(){for(var t=[],e=(new Date).getFullYear(),n=e-150,i=e+150;n<=i;n++)t.push(String(n));for(var r=[],o=1;o<=12;o++)r.push((o<10?"0":"")+o);for(var a=[],s=1;s<=31;s++)a.push((s<10?"0":"")+s);this.dateArray.push(t,r,a)},_getTimeValue:function(t){return 60*t[0]+t[1]},_getDateValue:function(t){return 366*t[0]+31*(t[1]||0)+(t[2]||0)},_cloneArray:function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=getApp();if(n){var s=!1,c=getCurrentPages();if(c.length?c[c.length-1].$page.meta.isTabBar&&(s=!0):n.$children[0].hasTabBar&&(s=!0),!s)return{errMsg:"".concat(t,":fail not TabBar page")};var u=e.index,l=n.$children[0].tabBar;if(u>=__uniConfig.tabBar.list.length)return{errMsg:"".concat(t,":fail tabbar item not found")};switch(t){case"showTabBar":n.$children[0].hideTabBar=!1;break;case"hideTabBar":n.$children[0].hideTabBar=!0;break;case"setTabBarItem":Object(i["g"])(l.list[u],r,e);break;case"setTabBarStyle":Object(i["g"])(l,o,e);break;case"showTabBarRedDot":Object(i["g"])(l.list[u],a,{badge:"",redDot:!0});break;case"setTabBarBadge":Object(i["g"])(l.list[u],a,{badge:e.text,redDot:!0});break;case"hideTabBarRedDot":case"removeTabBarBadge":Object(i["g"])(l.list[u],a,{badge:"",redDot:!1});break}}return{}}function c(t){return s("setTabBarItem",t)}function u(t){return s("setTabBarStyle",t)}function l(t){return s("hideTabBar",t)}function h(t){return s("showTabBar",t)}function d(t){return s("hideTabBarRedDot",t)}function f(t){return s("showTabBarRedDot",t)}function p(t){return s("removeTabBarBadge",t)}function g(t){return s("setTabBarBadge",t)}},fcd8:function(t,e,n){},ff28:function(t,e,n){"use strict";var i=n("23af"),r=n.n(i);r.a},ffdb:function(t,e,n){},ffdc:function(t,e,n){"use strict";function i(t,e,n,i){var r,o=document.createElement("script"),a=e.callback||"callback",s="__callback"+Date.now(),c=e.timeout||3e4;function u(){clearTimeout(r),delete window[s],o.remove()}window[s]=function(t){"function"===typeof n&&n(t),u()},o.onerror=function(){"function"===typeof i&&i(),u()},r=setTimeout(function(){"function"===typeof i&&i(),u()},c),o.src=t+(t.indexOf("?")>=0?"&":"?")+a+"="+s,document.body.appendChild(o)}n.d(e,"a",function(){return i})}})}); \ No newline at end of file +(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue-router"),require("vue")):"function"===typeof define&&define.amd?define([,],e):"object"===typeof exports?exports["index"]=e(require("vue-router"),require("vue")):t["index"]=e(t["VueRouter"],t["Vue"])})("undefined"!==typeof self?self:this,function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fae3")}({"0138":function(t,e,n){"use strict";n.r(e),function(t){var i=n("052f"),r=n("3d1f"),a=n("98be"),o=n("abbf");n.d(e,"getApp",function(){return o["b"]}),n.d(e,"getCurrentPages",function(){return o["c"]}),Object(i["a"])(t.on,{getApp:o["b"],getCurrentPages:o["c"]}),Object(r["a"])(t.subscribe,{getApp:o["b"],getCurrentPages:o["c"]}),e["default"]=a["a"]}.call(this,n("0dd1"))},"052f":function(t,e,n){"use strict";n.d(e,"a",function(){return a});var i=n("a741"),r=n("45db");function a(t,e){var n=e.getApp,a=e.getCurrentPages;function o(t){Object(i["a"])(n(),"onError",t)}function s(t){Object(i["a"])(n(),"onPageNotFound",t)}function c(t,e){var n=a().find(function(t){return t.$page.id===e});n&&(Object(r["setPullDownRefreshPageId"])(e),Object(i["b"])(n,"onPullDownRefresh"))}function u(t,e){var n=a();n.length&&Object(i["b"])(n[n.length-1],t,e)}function l(t){return function(e){u(t,e)}}function h(){Object(i["a"])(n(),"onHide"),u("onHide")}function d(){Object(i["a"])(n(),"onShow"),u("onShow")}function f(t,e){var n=t.name,i=t.arg;"postMessage"===n||uni[n](i)}t("onError",o),t("onPageNotFound",s),t("onAppEnterBackground",h),t("onAppEnterForeground",d),t("onPullDownRefresh",c),t("onTabItemTap",l("onTabItemTap")),t("onNavigationBarButtonTap",l("onNavigationBarButtonTap")),t("onNavigationBarSearchInputChanged",l("onNavigationBarSearchInputChanged")),t("onNavigationBarSearchInputConfirmed",l("onNavigationBarSearchInputConfirmed")),t("onNavigationBarSearchInputClicked",l("onNavigationBarSearchInputClicked")),t("onWebInvokeAppService",f)}},"0554":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"getLocation",function(){return a});var i=n("ffdc");function r(t,e,n){var r=__uniConfig.qqMapKey,a="https://apis.map.qq.com/ws/coord/v1/translate?locations=".concat(t.latitude,",").concat(t.longitude,"&type=1&key=").concat(r,"&output=jsonp");Object(i["a"])(a,{},function(t){"locations"in t&&t.locations.length?e({longitude:t.locations[0].lng,latitude:t.locations[0].lat}):n(t)},n)}function a(e,n){var i=e.type,a=e.altitude,o=t,s=o.invokeCallbackHandler;function c(t){s(n,Object.assign(t,{errMsg:"getLocation:ok",verticalAccuracy:t.altitudeAccuracy||0,horizontalAccuracy:t.accuracy}))}navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){var e=t.coords;"WGS84"===i?c(e):r(e,c,function(t){s(n,{errMsg:"getLocation:fail "+JSON.stringify(t)})})},function(){s(n,{errMsg:"getLocation:fail"})},{enableHighAccuracy:a,timeout:3e5}):s(n,{errMsg:"getLocation:fail device nonsupport geolocation"})}}.call(this,n("0dd1"))},"066f":function(t,e,n){"use strict";n.r(e),n.d(e,"setTabBarItem",function(){return a}),n.d(e,"setTabBarStyle",function(){return o}),n.d(e,"hideTabBar",function(){return s}),n.d(e,"showTabBar",function(){return c}),n.d(e,"hideTabBarRedDot",function(){return u}),n.d(e,"showTabBarRedDot",function(){return l}),n.d(e,"removeTabBarBadge",function(){return h}),n.d(e,"setTabBarBadge",function(){return d});var i=n("f2b3"),r={type:Number,required:!0},a={index:r,text:{type:String},iconPath:{type:String},selectedIconPath:{type:String}},o={color:{type:String},selectedColor:{type:String},backgroundColor:{type:String},borderStyle:{type:String,validator:function(t,e){t&&(e.borderStyle="black"===t?"black":"white")}}},s={animation:{type:Boolean,default:!1}},c={animation:{type:Boolean,default:!1}},u={index:r},l={index:r},h={index:r},d={index:r,text:{type:String,required:!0,validator:function(t,e){Object(i["b"])(t)>=4&&(e.text="...")}}}},"0741":function(t,e,n){"use strict";var i=n("9a72"),r=n.n(i);r.a},"0784":function(t,e,n){"use strict";var i=n("a741");function r(t){var e=t.$route;t.route=e.meta.pagePath,t.__page__={id:e.params.__id__,path:e.path,route:e.meta.pagePath,meta:Object.assign({},e.meta)},t.$vm=t,t.$root=t,t.$holder=t.$parent.$parent,t.$mp={mpType:"page",page:t,query:{},status:""}}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};return Object.keys(t).forEach(function(n){try{e[n]=decodeURIComponent(t[n])}catch(i){e[n]=t[n]}}),e}function o(){return{created:function(){r(this),Object(i["b"])(this,"onLoad",a(this.$route.query)),Object(i["b"])(this,"onShow")}}}n.d(e,"a",function(){return o})},"08c9":function(t,e,n){},"0950":function(t,e,n){},"0998":function(t,e,n){"use strict";var i=n("4509"),r=n.n(i);r.a},"0a32":function(t,e,n){"use strict";var i=n("17ac"),r=n.n(i);r.a},"0c7c":function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=c):r&&(c=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:u}}n.d(e,"a",function(){return i})},"0dba":function(t,e,n){},"0dd1":function(t,e,n){"use strict";n.r(e),n.d(e,"on",function(){return c}),n.d(e,"off",function(){return u}),n.d(e,"once",function(){return l}),n.d(e,"emit",function(){return h}),n.d(e,"subscribe",function(){return d}),n.d(e,"unsubscribe",function(){return f}),n.d(e,"subscribeHandler",function(){return p});var i=n("8bbf"),r=n.n(i),a=n("27a7");n.d(e,"invokeCallbackHandler",function(){return a["a"]});var o=n("b865");n.d(e,"publishHandler",function(){return o["a"]});var s=new r.a,c=s.$on.bind(s),u=s.$off.bind(s),l=s.$once.bind(s),h=s.$emit.bind(s);function d(t,e){return c("view."+t,e)}function f(t,e){return u("view."+t,e)}function p(t,e,n){return h("view."+t,e,n)}},"0f55":function(t,e,n){"use strict";var i=n("eaa4"),r=n.n(i);r.a},"0f74":function(t,e,n){"use strict";function i(t,e){if(e){if(0===e.indexOf("/"))return e}else{if(e=t,0===e.indexOf("/"))return e;var n=getCurrentPages();t=n.length?n[n.length-1].$page.route:""}if(0===e.indexOf("./"))return i(t,e.substr(2));for(var r=e.split("/"),a=r.length,o=0;o0?t.split("/"):[];return s.splice(s.length-o-1,o+1),"/"+s.concat(r).join("/")}n.d(e,"a",function(){return i})},1047:function(t,e,n){},1067:function(t,e,n){},1082:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-image",t._g({},t.$listeners),[n("div",{ref:"content",style:t.modeStyle}),n("img",{attrs:{src:t.realImagePath}}),"widthFix"===t.mode?n("v-uni-resize-sensor",{ref:"sensor",on:{resize:t._resize}}):t._e()],1)},r=[],a={name:"Image",props:{src:{type:String,default:""},mode:{type:String,default:"scaleToFill"},lazyLoad:{type:[Boolean,String],default:!1}},data:function(){return{originalWidth:0,originalHeight:0,availHeight:"",sizeFixed:!1}},computed:{ratio:function(){return this.originalWidth&&this.originalHeight?this.originalWidth/this.originalHeight:0},realImagePath:function(){return this.src&&this.$getRealPath(this.src)},modeStyle:function(){var t="auto",e="",n="no-repeat";switch(this.mode){case"aspectFit":t="contain",e="center center";break;case"aspectFill":t="cover",e="center center";break;case"widthFix":t="100% 100%";break;case"top":e="center top";break;case"bottom":e="center bottom";break;case"center":e="center center";break;case"left":e="left center";break;case"right":e="right center";break;case"top left":e="left top";break;case"top right":e="right top";break;case"bottom left":e="left bottom";break;case"bottom right":e="right bottom";break;default:t="100% 100%",e="0% 0%";break}return"background-position:".concat(e,";background-size:").concat(t,";background-repeat:").concat(n,";")}},watch:{src:function(t,e){this._loadImage()},mode:function(t,e){"widthFix"===e&&(this.$el.style.height=this.availHeight,this.sizeFixed=!1),"widthFix"===t&&this.ratio&&this._fixSize()}},mounted:function(){this.availHeight=this.$el.style.height||"",this._loadImage()},methods:{_resize:function(){"widthFix"!==this.mode||this.sizeFixed||this._fixSize()},_fixSize:function(){var t=this._getWidth();t&&(this.$el.style.height=t/this.ratio+"px",this.sizeFixed=!0)},_loadImage:function(){this.$refs.content.style.backgroundImage=this.src?"url(".concat(this.realImagePath,")"):"none";var t=this,e=new Image;e.onload=function(e){t.originalWidth=this.width,t.originalHeight=this.height,"widthFix"===t.mode&&t._fixSize(),t.$trigger("load",e,{width:this.width,height:this.height})},e.onerror=function(e){t.$trigger("error",e,{errMsg:"GET ".concat(t.src," 404 (Not Found)")})},e.src=this.realImagePath},_getWidth:function(){var t=window.getComputedStyle(this.$el),e=(parseFloat(t.borderLeftWidth,10)||0)+(parseFloat(t.borderRightWidth,10)||0),n=(parseFloat(t.paddingLeft,10)||0)+(parseFloat(t.paddingRight,10)||0);return this.$el.offsetWidth-e-n}}},o=a,s=(n("db18"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},1164:function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return a}),n.d(e,"c",function(){return o}),n.d(e,"a",function(){return s});var i=n("23e5"),r=!1;function a(){return r}function o(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=[],i=a();if(!i)return t.error("app is not ready"),[];var r=i.$children[0];if(r&&r.$children.length){var o=r.$children.find(function(t){return"TabBar"===t.$options.name});r.$children.forEach(function(t){if(o!==t&&t.$children.length&&"Page"===t.$children[0].$options.name&&t.$children[0].$slots.page){var r=t.$children[0].$children.find(function(t){return"PageBody"===t.$options.name}).$children.find(function(t){return!!t.$page});if(r){var a=!0;!e&&o&&r.$page&&r.$page.meta.isTabBar&&(i.$route.meta&&i.$route.meta.isTabBar?i.$route.path!==r.$page.path&&(a=!1):o.__path__!==r.$page.path&&(a=!1)),a&&n.push(r)}}})}var s=n.length;if(s>1){var c=n[s-1];c.$page.path!==i.$route.path&&n.splice(s-1,1)}return n}function s(t,e){r=t,r.globalData=r.$options.globalData||{},Object(i["a"])(r,e)}}).call(this,n("3ad9")["default"])},"11fb":function(t,e,n){"use strict";n.r(e),n.d(e,"previewImage",function(){return r});var i=n("cb0f"),r={urls:{type:Array,required:!0,validator:function(t,e){var n;if(e.urls=t.map(function(t){if("string"===typeof t)return Object(i["a"])(t);n=!0}),n)return"url is not string"}},current:{type:[String,Number],validator:function(t,e){"number"===typeof t?e.current=t>0&&t.5&&e._A<=.5?a.forEach(function(t){t.color=o}):s<=.5&&e._A>.5&&a.forEach(function(t){t.color="#fff"}),e._A=s,i&&(i.style.opacity=s),n.backgroundColor="rgba(".concat(e._R,",").concat(e._G,",").concat(e._B,",").concat(s,")"),l.forEach(function(t,e){var n=u[e],i=n.match(/[\d+\.]+/g);i[3]=(1-s)*(4===i.length?i[3]:1),t.backgroundColor="rgba(".concat(i,")")}))})}},computed:{color:function(){return"transparent"===this.type?"#fff":this.textColor},offset:function(){return parseInt(this.coverage)},bgColor:function(){if("transparent"===this.type){var t=Object(i["d"])(this.backgroundColor),e=t.r,n=t.g,r=t.b;return this._R=e,this._G=n,this._B=r,"rgba(".concat(e,",").concat(n,",").concat(r,",0)")}return this.backgroundColor}}}}).call(this,n("501c"))},"167a":function(t,e,n){"use strict";var i=n("deaf"),r=n.n(i);r.a},"17ac":function(t,e,n){},"17fd":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.hoverClass&&"none"!==t.hoverClass?n("uni-navigator",t._g({class:[t.hovering?t.hoverClass:""],on:{touchstart:t._hoverTouchStart,touchend:t._hoverTouchEnd,touchcancel:t._hoverTouchCancel,click:t._onClick}},t.$listeners),[t._t("default")],2):n("uni-navigator",t._g({on:{click:t._onClick}},t.$listeners),[t._t("default")],2)},r=[],a=n("eecc"),o=a["a"],s=(n("f7fd"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},"18fd":function(t,e,n){"use strict";n.d(e,"a",function(){return d});var i=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,a=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=f("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),s=f("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),c=f("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),u=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),l=f("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),h=f("script,style");function d(t,e){var n,d,f,p=[],g=t;p.last=function(){return this[this.length-1]};while(t){if(d=!0,p.last()&&h[p.last()])t=t.replace(new RegExp("([\\s\\S]*?)]*>"),function(t,n){return n=n.replace(/|/g,"$1$2"),e.chars&&e.chars(n),""}),b("",p.last());else if(0==t.indexOf("\x3c!--")?(n=t.indexOf("--\x3e"),n>=0&&(e.comment&&e.comment(t.substring(4,n)),t=t.substring(n+3),d=!1)):0==t.indexOf("=0;i--)if(p[i]==n)break}else var i=0;if(i>=0){for(var r=p.length-1;r>=i;r--)e.end&&e.end(p[r]);p.length=i}}b()}function f(t){for(var e={},n=t.split(","),i=0;i*{height: ").concat(t,"px;overflow: hidden;}"),document.head.appendChild(e)},_handleTrack:function(t){if(this._scroller)switch(t.detail.state){case"start":this._handleTouchStart(t);break;case"move":this._handleTouchMove(t);break;case"end":case"cancel":this._handleTouchEnd(t)}},_handleTap:function(t){if(t.target!==t.currentTarget&&!this._scroller.isScrolling()){var e=t.touches&&t.touches[0]&&t.touches[0].clientY,n="number"===typeof e?e:t.detail.y-document.body.scrollTop,i=this.$el.getBoundingClientRect(),r=n-i.top-this._height/2,a=this.indicatorHeight/2;if(!(Math.abs(r)<=a)){var o=Math.ceil((Math.abs(r)-a)/this.indicatorHeight),s=r<0?-o:o;this.current+=s,this._scroller.scrollTo(this.current*this.indicatorHeight)}}},setCurrent:function(t){t!==this.current&&(this.current=t,this.inited&&this.update())},init:function(){var t=this;this.initScroller(this.$refs.content,{enableY:!0,enableX:!1,enableSnap:!0,itemSize:this.indicatorHeight,friction:new s["a"](1e-4),spring:new c["a"](2,90,20),onSnap:function(e){isNaN(e)||e===t.current||(t.current=e)}}),this.inited=!0},update:function(){var t=this;this.$nextTick(function(){var e=Math.max(t.length-1,0),n=Math.min(t.current,e);t._scroller.update(n*t.indicatorHeight,void 0,t.indicatorHeight)})},_resize:function(t){var e=t.height;this.indicatorHeight=e}},render:function(t){return this.length=this.$slots.default&&this.$slots.default.length||0,t("uni-picker-view-column",{on:{tap:this._handleTap}},[t("div",{ref:"main",staticClass:"uni-picker-view-group"},[t("div",{ref:"mask",staticClass:"uni-picker-view-mask",class:this.maskClass,style:"background-size: 100% ".concat(this.maskSize,"px;").concat(this.maskStyle)}),t("div",{ref:"indicator",staticClass:"uni-picker-view-indicator",class:this.indicatorClass,style:this.indicatorStyle},[t("v-uni-resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}})]),t("div",{ref:"content",staticClass:"uni-picker-view-content",class:this.scope,style:"padding: ".concat(this.maskSize,"px 0;")},[this.$slots.default])])])}},l=u,h=(n("edfa"),n("0c7c")),d=Object(h["a"])(l,i,r,!1,null,null,null);e["default"]=d.exports},"19c4":function(t,e,n){var i={"./base.js":"22ec","./base64.js":"a8fd","./canvas.js":"a041","./context.js":"9fef","./device/make-phone-call.js":"f102","./file/open-document.js":"2604","./location.js":"c439","./media/choose-image.js":"f1b2","./media/choose-video.js":"ed9f","./media/get-image-info.js":"b866","./media/preview-image.js":"11fb","./navigation-bar.js":"4043","./network/download-file.js":"439a","./network/request.js":"a201","./network/socket.js":"abb2","./network/upload-file.js":"9a3e","./page-scroll-to.js":"e8e6","./plugins.js":"cef5","./popup.js":"d68b","./route.js":"40ab","./storage.js":"3858","./tab-bar.js":"066f"};function r(t){var e=a(t);return n(e)}function a(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=a,t.exports=r,r.id="19c4"},"1a12":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.delta,a=e.animationType,o=e.animationDuration,s=e.from,c=void 0===s?"navigateBack":s,u=e.detail,l=getApp().$router;switch(t){case"redirectTo":l.replace({type:t,path:n});break;case"navigateTo":l.push({type:t,path:n,animationType:a,animationDuration:o});break;case"navigateBack":var h=!0,d=getCurrentPages();if(d.length){var f=d[d.length-1];Object(i["a"])(f.$options,"onBackPress")&&!0===f.__call_hook("onBackPress",{from:c})&&(h=!1)}h&&(r>1&&(l._$delta=r),l.go(-r,{animationType:a,animationDuration:o}));break;case"reLaunch":l.replace({type:t,path:n});break;case"switchTab":l.replace({type:t,path:n,params:{detail:u}});break}return{errMsg:t+":ok"}}function a(t){return r("redirectTo",t)}function o(t){return r("navigateTo",t)}function s(t){return r("navigateBack",t)}function c(t){return r("reLaunch",t)}function u(t){return r("switchTab",t)}},"1ad3":function(t,e,n){"use strict";n.r(e),n.d(e,"$on",function(){return s}),n.d(e,"$off",function(){return c}),n.d(e,"$once",function(){return u}),n.d(e,"$emit",function(){return l});var i=n("8bbf"),r=n.n(i),a=new r.a;function o(t,e,n){return t[e].apply(t,n)}function s(){return o(a,"$on",Array.prototype.slice.call(arguments))}function c(){return o(a,"$off",Array.prototype.slice.call(arguments))}function u(){return o(a,"$once",Array.prototype.slice.call(arguments))}function l(){return o(a,"$emit",Array.prototype.slice.call(arguments))}},"1b6f":function(t,e,n){"use strict";(function(t){var i=n("f2b3");e["a"]={mounted:function(){var t=this;this._toggleListeners("subscribe",this.id),this.$watch("id",function(e,n){t._toggleListeners("unsubscribe",n,!0),t._toggleListeners("subscribe",e,!0)})},beforeDestroy:function(){this._toggleListeners("unsubscribe",this.id)},methods:{_toggleListeners:function(e,n,r){r&&!n||Object(i["e"])(this._handleSubscribe)&&t[e](this.$page.id+"-"+this.$options.name.replace(/VUni([A-Z])/,"$1").toLowerCase()+"-"+n,this._handleSubscribe)}}}}).call(this,n("501c"))},"1c64":function(t,e,n){"use strict";var i=n("9613"),r=n.n(i);r.a},"1ca3":function(t,e,n){"use strict";n.r(e),n.d(e,"base64ToArrayBuffer",function(){return r}),n.d(e,"arrayBufferToBase64",function(){return a});var i=n("8390"),r=i["decode"],a=i["encode"]},"1efd":function(t,e,n){"use strict";n.r(e);var i=n("8bbf"),r=n.n(i),a=n("cb0f"),o=n("d4b6"),s={methods:{$getRealPath:function(t){return Object(a["a"])(t)},$trigger:function(t,e,n){this.$emit(t,o["b"].call(this,t,e,n,this.$el,this.$el))}}};function c(t){return h(t)||l(t)||u()}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function l(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function h(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;a--){var s=r[a],c=s.$page.meta;c.isTabBar||(o.call(this,c.name+"-"+s.$page.id),Object(i["b"])(s,"onUnload"))}}function h(t){__uniConfig.reLaunch=(__uniConfig.reLaunch||1)+1;for(var e=getCurrentPages(!0),n=e.length-1;n>=0;n--)Object(i["b"])(e[n],"onUnload"),e[n].$destroy();this.keepAliveInclude=[],s=Object.create(null)}var d=[];function f(t,e,n,i){d=getCurrentPages(!0);var a=e.params.__id__,s=t.params.__id__,c=t.meta.name+"-"+s;if(s===a)t.fullPath!==e.fullPath?(o.call(this,c),n()):n(!1);else if(t.meta.id&&t.meta.id!==s)n({path:t.path,replace:!0});else{var u=e.meta.name+"-"+a;switch(t.type){case"navigateTo":break;case"redirectTo":if(o.call(this,u),e.meta&&(e.meta.isQuit&&(t.meta.isQuit=!0,t.meta.isEntry=!!e.meta.isEntry),e.meta.isTabBar)){t.meta.isTabBar=!0,t.meta.tabBarIndex=e.meta.tabBarIndex;var f=getApp().$children[0];f.$set(f.tabBar.list[t.meta.tabBarIndex],"pagePath",t.meta.pagePath)}break;case"switchTab":l.call(this,i,t,e);break;case"reLaunch":h.call(this,c),t.meta.isQuit=!0;break;default:a&&a>s&&(o.call(this,u),this.$router._$delta>1&&o.call(this,this.$router._$delta));break}if("reLaunch"!==t.type&&e.meta.id&&r.call(this,u),r.call(this,c),t.meta&&t.meta.name){document.body.className="uni-body "+t.meta.name;var p="nvue-dir-"+__uniConfig.nvue["flex-direction"];t.meta.isNVue?(document.body.setAttribute("nvue",""),document.body.setAttribute(p,"")):(document.body.removeAttribute("nvue"),document.body.removeAttribute(p))}n()}}function p(t,e){var n=e.params.__id__,r=t.params.__id__,o=d.find(function(t){return t.$page.id===n});switch(t.type){case"navigateTo":o&&Object(i["b"])(o,"onHide");break;case"redirectTo":o&&Object(i["b"])(o,"onUnload");break;case"switchTab":e.meta.isTabBar&&o&&Object(i["b"])(o,"onHide");break;case"reLaunch":break;default:n&&n>r&&(o&&Object(i["b"])(o,"onUnload"),this.$router._$delta>1&&a.reverse().forEach(function(t){var e=d.find(function(e){return e.$page.id===t});e&&Object(i["b"])(e,"onUnload")}));break}if(delete this.$router._$delta,a.length=0,"reLaunch"!==t.type){var s=getCurrentPages(!0).find(function(t){return t.$page.id===r});s&&(setTimeout(function(){Object(i["b"])(s,"onShow")},0),document.title=s.$parent.$parent.navigationBar.titleText)}}function g(t,e){t.$router.beforeEach(function(n,i,r){f.call(t,n,i,r,e)}),t.$router.afterEach(function(e,n){p.call(t,e,n)})}},"24aa":function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"===typeof window&&(n=window)}t.exports=n},"24d9":function(t,e,n){"use strict";n.d(e,"b",function(){return a}),n.d(e,"a",function(){return o});var i=n("f2b3");function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t){return Object.assign({mp:t,_processed:!0},t)}function o(t,e){return Object(i["f"])(e)&&(Object(i["c"])(e,"backgroundColor")&&(t.backgroundColor=e.backgroundColor),Object(i["c"])(e,"buttons")&&(t.buttons=e.buttons),Object(i["c"])(e,"titleColor")&&(t.textColor=e.titleColor),Object(i["c"])(e,"titleText")&&(t.titleText=e.titleText),Object(i["c"])(e,"titleSize")&&(t.titleSize=e.titleSize),Object(i["c"])(e,"type")&&(t.type=e.type),Object(i["c"])(e,"searchInput")&&"object"===r(e.searchInput)&&(t.searchInput=Object.assign({autoFocus:!1,align:"center",color:"#000000",backgroundColor:"rgba(255,255,255,0.5)",borderRadius:"0px",placeholder:"",placeholderColor:"#CCCCCC",disabled:!1},e.searchInput))),t}},"250d":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-input",t._g({},t.$listeners),[n("div",{ref:"wrapper",staticClass:"uni-input-wrapper"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!(t.composing||t.inputValue.length),expression:"!(composing || inputValue.length)"}],ref:"placeholder",staticClass:"uni-input-placeholder",class:t.placeholderClass,style:t.placeholderStyle},[t._v(t._s(t.placeholder))]),"checkbox"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:"checkbox"},domProps:{checked:Array.isArray(t.inputValue)?t._i(t.inputValue,null)>-1:t.inputValue},on:{focus:t._onFocus,blur:t._onBlur,input:function(e){return e.stopPropagation(),t._onInput(e)},compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)},change:function(e){var n=t.inputValue,i=e.target,r=!!i.checked;if(Array.isArray(n)){var a=null,o=t._i(n,a);i.checked?o<0&&(t.inputValue=n.concat([a])):o>-1&&(t.inputValue=n.slice(0,o).concat(n.slice(o+1)))}else t.inputValue=r}}}):"radio"===t.inputType?n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:"radio"},domProps:{checked:t._q(t.inputValue,null)},on:{focus:t._onFocus,blur:t._onBlur,input:function(e){return e.stopPropagation(),t._onInput(e)},compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)},change:function(e){t.inputValue=null}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",staticClass:"uni-input-input",attrs:{disabled:t.disabled,maxlength:t.maxlength,step:t.step,autocomplete:"off",type:t.inputType},domProps:{value:t.inputValue},on:{focus:t._onFocus,blur:t._onBlur,input:[function(e){e.target.composing||(t.inputValue=e.target.value)},function(e){return e.stopPropagation(),t._onInput(e)}],compositionstart:t._onComposition,compositionend:t._onComposition,keyup:function(e){return e.stopPropagation(),t._onKeyup(e)}}})])])},r=[],a=n("8af1"),o=["text","number","idcard","digit","password"],s=["number","digit"],c={name:"Input",mixins:[a["a"]],model:{prop:"value",event:"update:value"},props:{name:{type:String,default:""},value:{type:[String,Number],default:""},type:{type:String,default:"text"},password:{type:[Boolean,String],default:!1},placeholder:{type:String,default:""},placeholderStyle:{type:String,default:""},placeholderClass:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},maxlength:{type:[Number,String],default:140},focus:{type:[Boolean,String],default:!1},confirmType:{type:String,default:"done"}},data:function(){return{inputValue:this.value+"",composing:!1,wrapperHeight:0,cachedValue:""}},computed:{inputType:function(){var t="";switch(this.type){case"text":"search"===this.confirmType&&(t="search");break;case"idcard":t="text";break;case"digit":t="number";break;default:t=~o.indexOf(this.type)?this.type:"text";break}return this.password?"password":t},step:function(){return~s.indexOf(this.type)?"0.000000000000000001":""}},watch:{focus:function(t){t&&this._focusInput()},value:function(t){this.inputValue=t+""},inputValue:function(t){this.$emit("update:value",t)},maxlength:function(t){var e=this.inputValue.slice(0,parseInt(t,10));e!==this.inputValue&&(this.inputValue=e)}},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},mounted:function(){if("search"===this.confirmType){var t=document.createElement("form");t.action="",t.onsubmit=function(){return!1},t.className="uni-input-form",t.appendChild(this.$refs.input),this.$refs.wrapper.appendChild(t)}var e=this;while(e){var n=e.$options._scopeId;n&&this.$refs.placeholder.setAttribute(n,""),e=e.$parent}this.focus&&this._focusInput()},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onKeyup:function(t){13===t.keyCode&&this.$trigger("confirm",t,{value:t.target.value})},_onInput:function(t){if(!this.composing){if(~s.indexOf(this.type)){if(this.$refs.input.validity&&!this.$refs.input.validity.valid)return t.target.value=this.cachedValue,void(this.inputValue=t.target.value);this.cachedValue=this.inputValue}if("number"===this.inputType){var e=parseInt(this.maxlength,10);if(e>0&&t.target.value.length>e)return t.target.value=t.target.value.slice(0,e),void(this.inputValue=t.target.value)}this.$trigger("input",t,{value:this.inputValue})}},_onFocus:function(t){this.$trigger("focus",t,{value:t.target.value})},_onBlur:function(t){this.$trigger("blur",t,{value:t.target.value})},_focusInput:function(){var t=this;setTimeout(function(){t.$refs.input.focus()},350)},_blurInput:function(){var t=this;setTimeout(function(){t.$refs.input.blur()},350)},_onComposition:function(t){"compositionstart"===t.type?this.composing=!0:this.composing=!1},_resetFormData:function(){this.inputValue=""},_getFormData:function(){return this.name?{value:this.inputValue,key:this.name}:{}}}},u=c,l=(n("0f55"),n("0c7c")),h=Object(l["a"])(u,i,r,!1,null,null,null);e["default"]=h.exports},"25ce":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-checkbox-group",t._g({},t.$listeners),[t._t("default")],2)},r=[],a=n("8af1"),o={name:"CheckboxGroup",mixins:[a["a"],a["c"]],props:{name:{type:String,default:""}},data:function(){return{checkboxList:[]}},listeners:{"@checkbox-change":"_changeHandler","@checkbox-group-update":"_checkboxGroupUpdateHandler"},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_changeHandler:function(t){var e=[];this.checkboxList.forEach(function(t){t.checkboxChecked&&e.push(t.value)}),this.$trigger("change",t,{value:e})},_checkboxGroupUpdateHandler:function(t){if("add"===t.type)this.checkboxList.push(t.vm);else{var e=this.checkboxList.indexOf(t.vm);this.checkboxList.splice(e,1)}},_getFormData:function(){var t={};if(""!==this.name){var e=[];this.checkboxList.forEach(function(t){t.checkboxChecked&&e.push(t.value)}),t["value"]=e,t["key"]=this.name}return t}}},s=o,c=(n("0998"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},2604:function(t,e,n){"use strict";n.r(e),n.d(e,"openDocument",function(){return i});var i={filePath:{type:String,required:!0},fileType:{type:String}}},2608:function(t,e,n){"use strict";(function(t){function i(e){return function(){try{return e.apply(e,arguments)}catch(n){t.error(n)}}}function r(e){return function(){try{return e.apply(e,arguments)}catch(n){t.error(n)}}}n.d(e,"b",function(){return i}),n.d(e,"a",function(){return r})}).call(this,n("3ad9")["default"])},2765:function(t,e,n){"use strict";var i=n("91ce"),r=n.n(i);r.a},"27a7":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return m}),n.d(e,"c",function(){return v}),n.d(e,"b",function(){return b});var i=n("f2b3"),r=n("2608"),a=n("ed1a"),o=n("cc76"),s=n("de29");function c(e,n,i){var r="".concat(n,":fail ").concat(e);if(t.error(r),-1===i)throw new Error(r);return"number"===typeof i&&m(i,{errMsg:r}),!1}var u=[{name:"callback",type:Function,required:!0}];function l(t,e,n){var r=o["a"][t];if(!r&&Object(a["a"])(t)&&(r=u),r){if(Array.isArray(r)&&Array.isArray(e)){var l=Object.create(null),h=Object.create(null),d=e.length;r.forEach(function(t,n){l[t.name]=t,d>n&&(h[t.name]=e[n])}),r=l,e=h}if(Object(i["e"])(r.beforeValidate)){var f=r.beforeValidate(e);if(f)return c(f,t,n)}for(var p=Object.keys(r),g=0;g1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!Object(i["f"])(e))return{params:e};e=Object.assign({},e);var a={};for(var o in e){var s=e[o];Object(i["e"])(s)&&(a[o]=Object(r["a"])(s),delete e[o])}var c=a.success,u=a.fail,l=a.cancel,f=a.complete,p=Object(i["e"])(c),g=Object(i["e"])(u),m=Object(i["e"])(l),v=Object(i["e"])(f);if(!p&&!g&&!m&&!v)return{params:e};var b={};for(var y in n){var _=n[y];Object(i["e"])(_)&&(b[y]=Object(r["b"])(_),delete n[y])}var w=b.beforeSuccess,S=b.afterSuccess,k=b.beforeFail,T=b.afterFail,x=b.beforeCancel,C=b.afterCancel,O=b.afterAll,M=h++,E="api."+t+"."+M,A=function(e){e.errMsg=e.errMsg||t+":ok";var n=e.errMsg;0===n.indexOf(t+":ok")?(Object(i["e"])(w)&&w(e),p&&c(e),Object(i["e"])(S)&&S(e)):0===n.indexOf(t+":cancel")?(e.errMsg=e.errMsg.replace(t+":cancel",t+":fail cancel"),g&&u(e),Object(i["e"])(x)&&x(e),m&&l(e),Object(i["e"])(C)&&C(e)):0===n.indexOf(t+":fail")&&(Object(i["e"])(k)&&k(e),g&&u(e),Object(i["e"])(T)&&T(e)),v&&f(e),Object(i["e"])(O)&&O(e)};return d[M]={name:E,callback:A},{params:e,callbackId:M}}function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=p(t,e,n),a=r.params,o=r.callbackId;return Object(i["f"])(a)&&!l(t,a,o)?{params:a,callbackId:!1}:{params:a,callbackId:o}}function m(t,e){if("number"===typeof t){var n=d[t];if(n)return n.keepAlive||delete d[t],n.callback(e)}return e}function v(e){return function(n){t.error("API `"+e+"` is not yet implemented")}}function b(t,e,n){return Object(i["e"])(e)?function(){for(var r=arguments.length,o=new Array(r),s=0;s0&&(r.currentTime=e)}),r.addEventListener("progress",function(t){var e=r.buffered;e.length&&(n.buffered=e.end(e.length-1)/r.duration)}),r.addEventListener("waiting",function(t){n.$trigger("waiting",t,{})}),r.addEventListener("error",function(t){n.playing=!1,n.$trigger("error",t,{})}),r.addEventListener("play",function(t){n.start=!0,n.playing=!0,n.fullscreenTriggering||n.$trigger("play",t,{})}),r.addEventListener("pause",function(t){n.playing=!1,n.fullscreenTriggering||n.$trigger("pause",t,{})}),r.addEventListener("ended",function(t){n.playing=!1,n.$trigger("ended",t,{})}),r.addEventListener("timeupdate",function(t){var e=n.currentTime=r.currentTime,a=r.duration,o=i.danmuIndex,s={time:e,index:o.index},c=i.danmuList;if(e>o.time)for(var u=o.index+1;u=(l.time||0)))break;s.index=u,n.playing&&n.enableDanmuSync&&n.playDanmu(l)}else if(e-1;h--){var d=c[h];if(!(e<=(d.time||0)))break;s.index=h-1}i.danmuIndex=s,n.$trigger("timeupdate",t,{currentTime:e,duration:a})}),r.addEventListener("x5videoenterfullscreen",function(t){n.$trigger("fullscreenchange",t,{fullScreen:!0})}),r.addEventListener("x5videoexitfullscreen",function(t){n.$trigger("fullscreenchange",t,{fullScreen:!1})});var o,c=!0;function u(i){var r=n.getScreenXY(i.targetTouches[0]),a=r.pageX,s=r.pageY;if(c&&Math.abs(a-t)100&&(h=100),n.progress=h,i.preventDefault(),i.stopPropagation()}}function l(t){n.controlsTouching=!1,n.touching&&(a.removeEventListener("touchmove",u,s),c||(t.preventDefault(),t.stopPropagation(),n.seek(n.$refs.video.duration*n.progress/100)),n.touching=!1)}a.addEventListener("touchstart",function(i){n.controlsTouching=!0;var r=n.getScreenXY(i.targetTouches[0]);t=r.pageX,e=r.pageY,o=n.progress,c=!0,n.touching=!0,a.addEventListener("touchmove",u,s)}),a.addEventListener("touchend",l),a.addEventListener("touchcancel",l),String(this.srcSync).length&&this.autoplay&&r.play()},beforeDestroy:function(){this.$refs.container.remove(),clearTimeout(this.otherData.hideTiming)},methods:{_handleSubscribe:function(t){var e=t.type,n=t.data,i=void 0===n?{}:n;switch(e){case"play":this.play();break;case"pause":this.pause();break;case"seek":this.seek(i.position);break;case"sendDanmu":this.sendDanmu(i);break;case"playbackRate":this.$refs.video.playbackRate=i.rate;break;case"requestFullScreen":this.enterFullscreen();break;case"exitFullScreen":this.leaveFullscreen();break}},resize:function(){var t=window.innerWidth,e=window.innerHeight,n=Math.abs(this.directionSync);this.rotateType=0===n?t>e?"left":"":90===n?t>e?"":"right":"",this.rotateType?(this.width=e+"px",this.height=t+"px"):(this.width=t+"px",this.height=e+"px")},trigger:function(){this.playing?this.$refs.video.pause():this.$refs.video.play()},play:function(){this.start=!0,this.$refs.video.play()},pause:function(){this.$refs.video.pause()},seek:function(t){t=Number(t),"number"!==typeof t||isNaN(t)||(this.$refs.video.currentTime=t)},clickProgress:function(t){var e=t.offsetX,n=this.$refs.progress,i=t.target;while(i!==n)e+=i.offsetLeft,i=i.parentNode;var r=n.offsetWidth,a=0;e>=0&&e<=r&&(a=e/r,this.seek(this.$refs.video.duration*a))},triggerDanmu:function(){this.enableDanmuSync=!this.enableDanmuSync},playDanmu:function(t){var e=document.createElement("p");e.className="uni-video-danmu-item",e.innerText=t.text;var n="bottom: ".concat(100*Math.random(),"%;color: ").concat(t.color,";");e.setAttribute("style",n),this.$refs.danmu.appendChild(e),setTimeout(function(){n+="left: 0;-webkit-transform: translateX(-100%);transform: translateX(-100%);",e.setAttribute("style",n),setTimeout(function(){e.remove()},4e3)},17)},sendDanmu:function(t){var e=this.otherData;e.danmuList.splice(e.danmuIndex.index+1,0,{text:String(t.text),color:t.color,time:this.$refs.video.currentTime||0})},triggerFullscreen:function(){this.fullscreen=!this.fullscreen},enterFullscreen:function(t){var e=Number(t);isNaN(NaN)||(this.directionSync=e),this.fullscreen=!0},leaveFullscreen:function(){this.fullscreen=!1},triggerControls:function(){this.controlsVisible=!this.controlsVisible},touchstart:function(t){var e=this.getScreenXY(t.targetTouches[0]);this.touchStartOrigin={x:e.pageX,y:e.pageY},this.gestureType=c.NONE,this.volumeOld=null,this.currentTimeOld=this.currentTimeNew=0},touchmove:function(t){function e(){t.stopPropagation(),t.preventDefault()}this.fullscreen&&e();var n=this.gestureType;if(n!==c.STOP){var i=this.getScreenXY(t.targetTouches[0]),r=i.pageX,a=i.pageY,o=this.touchStartOrigin;if(n===c.PROGRESS?this.changeProgress(r-o.x):n===c.VOLUME&&this.changeVolume(a-o.y),n===c.NONE)if(Math.abs(r-o.x)>Math.abs(a-o.y)){if(!this.enableProgressGesture)return void(this.gestureType=c.STOP);this.gestureType=c.PROGRESS,this.currentTimeOld=this.currentTimeNew=this.$refs.video.currentTime,this.fullscreen||e()}else{if(!this.pageGesture)return void(this.gestureType=c.STOP);this.gestureType=c.VOLUME,this.volumeOld=this.$refs.video.volume,this.fullscreen||e()}}},touchend:function(t){this.gestureType!==c.NONE&&this.gestureType!==c.STOP&&(t.stopPropagation(),t.preventDefault()),this.gestureType===c.PROGRESS&&this.currentTimeOld!==this.currentTimeNew&&(this.$refs.video.currentTime=this.currentTimeNew),this.gestureType=c.NONE},changeProgress:function(t){var e=this.$refs.video.duration,n=t/600*e+this.currentTimeOld;n<0?n=0:n>e&&(n=e),this.currentTimeNew=n},changeVolume:function(t){var e,n=this.volumeOld;"number"===typeof n&&(e=n-t/200,e<0?e=0:e>1&&(e=1),this.$refs.video.volume=e,this.volumeNew=e)},autoHideStart:function(){var t=this;this.otherData.hideTiming=setTimeout(function(){t.controlsVisible=!1},3e3)},autoHideEnd:function(){var t=this.otherData;t.hideTiming&&(clearTimeout(t.hideTiming),t.hideTiming=null)},getScreenXY:function(t){var e=this.rotateType;if(!this.fullscreen||!e)return t;var n,i,r=screen.width,a=screen.height,o=t.pageX,s=t.pageY;return"left"===e?(n=a-s,i=o):(n=s,i=r-o),{pageX:n,pageY:i}},updateProgress:function(){this.touching||(this.progress=this.currentTime/this.durationTime*100)}}},l=u,h=(n("856e"),n("0c7c")),d=Object(h["a"])(l,i,r,!1,null,null,null);e["default"]=d.exports},"33ab":function(t,e,n){},"33ed":function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return r}),n.d(e,"c",function(){return a}),n.d(e,"a",function(){return o});var i=n("4a59");function r(t){t.preventDefault()}function a(t){var e=t.scrollTop,n=t.duration,i=document.documentElement,r=i.clientHeight,a=i.scrollHeight;function o(t){if(t<=0)window.scrollTo(0,e);else{var n=e-window.scrollY;requestAnimationFrame(function(){window.scrollTo(0,window.scrollY+n/t*10),o(t-10)})}}e=Math.min(e,a-r),0!==n?window.scrollY!==e&&o(n):i.scrollTop=document.body.scrollTop=e}function o(e,n){var r=n.enablePageScroll,a=n.enablePageReachBottom,o=n.onReachBottomDistance,s=n.enableTransparentTitleNView,c=!1,u=!1,l=!0;function h(){var t=document.documentElement,e=t.clientHeight,n=t.scrollHeight,i=window.scrollY,r=i>0&&n>e&&i+e+o>=n;return r&&!u?(u=!0,!0):(!r&&u&&(u=!1),!1)}function d(){var n=window.pageYOffset;r&&Object(i["a"])("onPageScroll",{scrollTop:n},e),s&&t.emit("onPageScroll",{scrollTop:n}),a&&l&&h()&&(Object(i["a"])("onReachBottom",{},e),l=!1,setTimeout(function(){l=!0},350)),c=!1}return function(){c||requestAnimationFrame(d),c=!0}}}).call(this,n("501c"))},"347e":function(t,e,n){"use strict";(function(t){var i=n("8aec"),r=n("f2b3"),a=!!r["h"]&&{passive:!0};e["a"]={name:"ScrollView",mixins:[i["a"]],props:{scrollX:{type:[Boolean,String],default:!1},scrollY:{type:[Boolean,String],default:!1},upperThreshold:{type:[Number,String],default:50},lowerThreshold:{type:[Number,String],default:50},scrollTop:{type:[Number,String],default:0},scrollLeft:{type:[Number,String],default:0},scrollIntoView:{type:String,default:""},scrollWithAnimation:{type:[Boolean,String],default:!1},enableBackToTop:{type:[Boolean,String],default:!1}},data:function(){return{lastScrollTop:this.scrollTopNumber,lastScrollLeft:this.scrollLeftNumber,lastScrollToUpperTime:0,lastScrollToLowerTime:0}},computed:{upperThresholdNumber:function(){var t=Number(this.upperThreshold);return isNaN(t)?50:t},lowerThresholdNumber:function(){var t=Number(this.lowerThreshold);return isNaN(t)?50:t},scrollTopNumber:function(){return Number(this.scrollTop)||0},scrollLeftNumber:function(){return Number(this.scrollLeft)||0}},watch:{scrollTopNumber:function(t){this._scrollTopChanged(t)},scrollLeftNumber:function(t){this._scrollLeftChanged(t)},scrollIntoView:function(t){this._scrollIntoViewChanged(t)}},mounted:function(){var t=this;this._attached=!0,this._scrollTopChanged(this.scrollTopNumber),this._scrollLeftChanged(this.scrollLeftNumber),this._scrollIntoViewChanged(this.scrollIntoView),this.__handleScroll=function(e){event.preventDefault(),event.stopPropagation(),t._handleScroll.bind(t,event)()};var e=null,n=null;this.__handleTouchMove=function(i){var r=i.touches[0].pageX,a=i.touches[0].pageY,o=t.$refs.main;if(null===n)if(Math.abs(r-e.x)>Math.abs(a-e.y))if(t.scrollX){if(0===o.scrollLeft&&r>e.x)return void(n=!1);if(o.scrollWidth===o.offsetWidth+o.scrollLeft&&re.y)return void(n=!1);if(o.scrollHeight===o.offsetHeight+o.scrollTop&&an.scrollWidth-n.offsetWidth?t=n.scrollWidth-n.offsetWidth:"y"===e&&t>n.scrollHeight-n.offsetHeight&&(t=n.scrollHeight-n.offsetHeight);var i=0,r="";"x"===e?i=n.scrollLeft-t:"y"===e&&(i=n.scrollTop-t),0!==i&&(this.$refs.content.style.transition="transform .3s ease-out",this.$refs.content.style.webkitTransition="-webkit-transform .3s ease-out","x"===e?r="translateX("+i+"px) translateZ(0)":"y"===e&&(r="translateY("+i+"px) translateZ(0)"),this.$refs.content.removeEventListener("transitionend",this.__transitionEnd),this.$refs.content.removeEventListener("webkitTransitionEnd",this.__transitionEnd),this.__transitionEnd=this._transitionEnd.bind(this,t,e),this.$refs.content.addEventListener("transitionend",this.__transitionEnd),this.$refs.content.addEventListener("webkitTransitionEnd",this.__transitionEnd),"x"===e?n.style.overflowX="hidden":"y"===e&&(n.style.overflowY="hidden"),this.$refs.content.style.transform=r,this.$refs.content.style.webkitTransform=r)},_handleTrack:function(t){if("start"===t.detail.state)return this._x=t.detail.x,this._y=t.detail.y,void(this._noBubble=null);"end"===t.detail.state&&(this._noBubble=!1),null===this._noBubble&&this.scrollY&&(Math.abs(this._y-t.detail.y)/Math.abs(this._x-t.detail.x)>1?this._noBubble=!0:this._noBubble=!1),null===this._noBubble&&this.scrollX&&(Math.abs(this._x-t.detail.x)/Math.abs(this._y-t.detail.y)>1?this._noBubble=!0:this._noBubble=!1),this._x=t.detail.x,this._y=t.detail.y,this._noBubble&&t.stopPropagation()},_handleScroll:function(t){if(!(t.timeStamp-this._lastScrollTime<20)){this._lastScrollTime=t.timeStamp;var e=t.target;this.$trigger("scroll",t,{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,deltaX:this.lastScrollLeft-e.scrollLeft,deltaY:this.lastScrollTop-e.scrollTop}),this.scrollY&&(e.scrollTop<=this.upperThresholdNumber&&this.lastScrollTop-e.scrollTop>0&&t.timeStamp-this.lastScrollToUpperTime>200&&(this.$trigger("scrolltoupper",t,{direction:"top"}),this.lastScrollToUpperTime=t.timeStamp),e.scrollTop+e.offsetHeight+this.lowerThresholdNumber>=e.scrollHeight&&this.lastScrollTop-e.scrollTop<0&&t.timeStamp-this.lastScrollToLowerTime>200&&(this.$trigger("scrolltolower",t,{direction:"bottom"}),this.lastScrollToLowerTime=t.timeStamp)),this.scrollX&&(e.scrollLeft<=this.upperThresholdNumber&&this.lastScrollLeft-e.scrollLeft>0&&t.timeStamp-this.lastScrollToUpperTime>200&&(this.$trigger("scrolltoupper",t,{direction:"left"}),this.lastScrollToUpperTime=t.timeStamp),e.scrollLeft+e.offsetWidth+this.lowerThresholdNumber>=e.scrollWidth&&this.lastScrollLeft-e.scrollLeft<0&&t.timeStamp-this.lastScrollToLowerTime>200&&(this.$trigger("scrolltolower",t,{direction:"right"}),this.lastScrollToLowerTime=t.timeStamp)),this.lastScrollTop=e.scrollTop,this.lastScrollLeft=e.scrollLeft}},_scrollTopChanged:function(t){this.scrollY&&(this._innerSetScrollTop?this._innerSetScrollTop=!1:this.scrollWithAnimation?this.scrollTo(t,"y"):this.$refs.main.scrollTop=t)},_scrollLeftChanged:function(t){this.scrollX&&(this._innerSetScrollLeft?this._innerSetScrollLeft=!1:this.scrollWithAnimation?this.scrollTo(t,"x"):this.$refs.main.scrollLeft=t)},_scrollIntoViewChanged:function(e){if(e){if(!/^[_a-zA-Z][-_a-zA-Z0-9:]*$/.test(e))return t.group('scroll-into-view="'+e+'" 有误'),t.error("id 属性值格式错误。如不能以数字开头。"),void t.groupEnd();var n=this.$el.querySelector("#"+e);if(n){var i=this.$refs.main.getBoundingClientRect(),r=n.getBoundingClientRect();if(this.scrollX){var a=r.left-i.left,o=this.$refs.main.scrollLeft,s=o+a;this.scrollWithAnimation?this.scrollTo(s,"x"):this.$refs.main.scrollLeft=s}if(this.scrollY){var c=r.top-i.top,u=this.$refs.main.scrollTop,l=u+c;this.scrollWithAnimation?this.scrollTo(l,"y"):this.$refs.main.scrollTop=l}}}},_transitionEnd:function(t,e){this.$refs.content.style.transition="",this.$refs.content.style.webkitTransition="",this.$refs.content.style.transform="",this.$refs.content.style.webkitTransform="";var n=this.$refs.main;"x"===e?(n.style.overflowX=this.scrollX?"auto":"hidden",n.scrollLeft=t):"y"===e&&(n.style.overflowY=this.scrollY?"auto":"hidden",n.scrollTop=t),this.$refs.content.removeEventListener("transitionend",this.__transitionEnd),this.$refs.content.removeEventListener("webkitTransitionEnd",this.__transitionEnd)},getScrollPosition:function(){var t=this.$refs.main;return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}}}}).call(this,n("3ad9")["default"])},"34b2":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"getImageInfo",function(){return a});var i=n("cb0f");function r(){return window.location.protocol+"//"+window.location.host}function a(e,n){var a=e.src,o=t,s=o.invokeCallbackHandler,c=new Image,u=Object(i["a"])(a);c.onload=function(){s(n,{errMsg:"getImageInfo:ok",width:c.naturalWidth,height:c.naturalHeight,path:0===u.indexOf("/")?r()+u:u})},c.onerror=function(t){s(n,{errMsg:"getImageInfo:fail"})},c.src=a}}.call(this,n("0dd1"))},3648:function(t,e,n){"use strict";n.r(e);var i=n("f2b3"),r={"css.var":window.CSS&&window.CSS.supports&&window.CSS.supports("--a",0)};function a(t){return!Object(i["c"])(r,t)||r[t]}n.d(e,"canIUse",function(){return a})},3858:function(t,e,n){"use strict";n.r(e),n.d(e,"setStorage",function(){return i}),n.d(e,"setStorageSync",function(){return r});var i={key:{type:String,required:!0},data:{required:!0}},r=[{name:"key",type:String,required:!0},{name:"data",required:!0}]},"3ad9":function(t,e,n){"use strict";n.r(e),function(t){var n=Array.prototype.unshift;function i(t){return n.call(t,"[system]"),t}function r(e){return function(){var n=!0;"debug"!==e||__uniConfig.debug||(n=!1),n&&t.console[e].apply(t.console,i(arguments))}}e["default"]={log:r("log"),info:r("info"),warn:r("warn"),debug:r("debug"),error:r("error")}}.call(this,n("24aa"))},"3b67":function(t,e,n){"use strict";var i=Object.create(null),r=n("e3a7");r.keys().forEach(function(t){Object.assign(i,r(t))}),e["a"]=i},"3d1f":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return a});var i=n("62b5"),r=n("a741");function a(e,n){n.getApp;var a=n.getCurrentPages;function o(e){return function(n,i){var o=a(),s=o.find(function(t){return t.$page.id===i});s?Object(r["b"])(s,e,n):t.error("Not Found:Page[".concat(i,"]"))}}var s=Object(i["a"])("requestComponentInfo");function c(t){var e=t.reqId,n=t.res,i=s.pop(e);i&&i(n)}var u=Object(i["a"])("requestComponentObserver");function l(t){var e=t.reqId,n=t.reqEnd,i=t.res,r=u.get(e);if(r){if(n)return void u.pop(e);r(i)}}e("onPageReady",o("onReady")),e("onPageScroll",o("onPageScroll")),e("onReachBottom",o("onReachBottom")),e("onRequestComponentInfo",c),e("onRequestComponentObserver",l)}}).call(this,n("3ad9")["default"])},"3d64":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"onNetworkStatusChange",function(){return c}),n.d(e,"getNetworkType",function(){return u});var i=t,r=i.invokeCallbackHandler,a=[];function o(){var t=navigator.connection.type,e="";if(~["none","wifi","unknown"].indexOf(t))e=t;else{var n=navigator.connection.effectiveType;"slow-2g"===n&&(n="2g"),e=n}return e}function s(){var t=!0,e=o();"none"===e&&(t=!1),a.forEach(function(n){n&&r(n,{errMsg:"onNetworkStatusChange:ok",isConnected:t,networkType:e})})}function c(t){window.NetworkInformation?(a.push(t),navigator.connection.onchange=s):t&&r(t,{errMsg:"onNetworkStatusChange:fail"})}function u(){return window.NetworkInformation?{errMsg:"getNetworkType:ok",networkType:o()}:{errMsg:"getNetworkType:fail"}}}.call(this,n("0dd1"))},"3da9":function(t,e,n){"use strict";var i=n("33ab"),r=n.n(i);r.a},"3e8c":function(t,e,n){"use strict";n.r(e);var i,r,a={name:"ResizeSensor",props:{initial:{type:[Boolean,String],default:!1}},data:function(){return{size:{width:-1,height:-1}}},watch:{size:{deep:!0,handler:function(t){this.$emit("resize",Object.assign({},t))}}},mounted:function(){!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"AnimationEvent"in window||this.reset()},methods:{reset:function(){var t=this.$el.firstChild,e=this.$el.lastChild;t.scrollLeft=1e5,t.scrollTop=1e5,e.scrollLeft=1e5,e.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight,this.reset()}},render:function(t){return t("uni-resize-sensor",{on:{"~animationstart":this.update}},[t("div",{on:{scroll:this.update}},[t("div")]),t("div",{on:{scroll:this.update}},[t("div")])])}},o=a,s=(n("64d0"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},"3f7e":function(t,e,n){"use strict";var i=n("1a33"),r=n.n(i);r.a},4043:function(t,e,n){"use strict";n.r(e),n.d(e,"setNavigationBarColor",function(){return r}),n.d(e,"setNavigationBarTitle",function(){return a});var i=["#ffffff","#000000"],r={frontColor:{type:String,required:!0,validator:function(t,e){if(-1===i.indexOf(t))return'invalid frontColor "'.concat(t,'"')}},backgroundColor:{type:String,required:!0},animation:{type:Object,default:function(){return{duration:0,timingFunc:"linear"}},validator:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;e.animation={duration:t.duration||0,timingFunc:t.timingFunc||"linear"}}}},a={title:{type:String,required:!0}}},"40ab":function(t,e,n){"use strict";n.r(e),n.d(e,"redirectTo",function(){return c}),n.d(e,"reLaunch",function(){return u}),n.d(e,"navigateTo",function(){return l}),n.d(e,"switchTab",function(){return h}),n.d(e,"navigateBack",function(){return d});var i=n("0f74");function r(t){if("string"!==typeof t)return t;var e=t.indexOf("?");if(-1===e)return t;var n=t.substr(e+1).trim().replace(/^(\?|#|&)/,"");if(!n)return t;t=t.substr(0,e);var i=[];return n.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),n=e.shift(),r=e.length>0?e.join("="):"";i.push(n+"="+encodeURIComponent(r))}),i.length?t+"?"+i.join("&"):t}function a(t){return function(e,n){e=Object(i["a"])(e);var a=e.split("?")[0],o=__uniRoutes.find(function(t){var e=t.path,n=t.alias;return e===a||n===a});if(!o)return"page `"+e+"` is not found";if("navigateTo"===t||"redirectTo"===t){if(o.meta.isTabBar)return"can not ".concat(t," a tabbar page")}else if("switchTab"===t&&!o.meta.isTabBar)return"can not switch to no-tabBar page";o.meta.isTabBar&&(e=a),o.meta.isEntry&&(e=e.replace(o.alias,"/")),n.url=r(e)}}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.assign({url:{type:String,required:!0,validator:a(t)}},e)}function s(t){return{animationType:{type:String,validator:function(e){if(e&&-1===t.indexOf(e))return"`"+e+"` is not supported for `animationType` (supported values are: `"+t.join("`|`")+"`)"}},animationDuration:{type:Number}}}var c=o("redirectTo"),u=o("reLaunch"),l=o("navigateTo",s(["slide-in-right","slide-in-left","slide-in-top","slide-in-bottom","fade-in","zoom-out","zoom-fade-out","pop-in","none"])),h=o("switchTab"),d=Object.assign({delta:{type:Number,validator:function(t,e){t=parseInt(t)||1,e.delta=Math.min(getCurrentPages().length-1,t)}}},s(["slide-out-right","slide-out-left","slide-out-top","slide-out-bottom","fade-out","zoom-in","zoom-fade-in","pop-out","none"]))},"439a":function(t,e,n){"use strict";n.r(e),n.d(e,"downloadFile",function(){return i});var i={url:{type:String,required:!0},header:{type:Object,validator:function(t,e){e.header=t||{}}}}},"442e":function(t,e,n){"use strict";n.r(e),function(t){var e=n("8bbf"),i=n.n(e),r=n("5129"),a=n.n(r),o=i.a.config.isReservedTag;i.a.config.isReservedTag=function(t){return-1!==a.a.indexOf(t)||o(t)},i.a.config.ignoredElements=a.a;var s=i.a.config.getTagNamespace,c=["switch","image","text","view"];i.a.config.getTagNamespace=function(t){return!~c.indexOf(t)&&(s(t)||!1)},i.a.config.errorHandler=function(e,n,i){t.emit("onError",e)}}.call(this,n("0dd1"))},"44de":function(t,e,n){"use strict";n.r(e),n.d(e,"vibrateLong",function(){return r}),n.d(e,"vibrateShort",function(){return a});var i=!!window.navigator.vibrate;function r(){return i&&window.navigator.vibrate(400)?{errMsg:"vibrateLong:ok"}:{errMsg:"vibrateLong:fail"}}function a(){return i&&window.navigator.vibrate(15)?{errMsg:"vibrateShort:ok"}:{errMsg:"vibrateShort:fail"}}},4509:function(t,e,n){},"45ae":function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=t.data,r={type:"object"===i(n)?"object":"string",data:n};localStorage.setItem(e,JSON.stringify(r));var a=localStorage.getItem("uni-storage-keys");if(a){var o=JSON.parse(a);o.indexOf(e)<0&&(o.push(e),localStorage.setItem("uni-storage-keys",JSON.stringify(o)))}else localStorage.setItem("uni-storage-keys",JSON.stringify([e]));return{errMsg:"setStorage:ok"}}function a(t,e){r({key:t,data:e})}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=localStorage.getItem(e);return n?{data:JSON.parse(n).data,errMsg:"getStorage:ok"}:{data:"",errMsg:"getStorage:fail"}}function s(t){var e=o({key:t});return e.data}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=localStorage.getItem("uni-storage-keys");if(n){var i=JSON.parse(n),r=i.indexOf(e);i.splice(r,1),localStorage.setItem("uni-storage-keys",JSON.stringify(i))}return localStorage.removeItem(e),{errMsg:"removeStorage:ok"}}function u(t){c({key:t})}function l(){return localStorage.clear(),{errMsg:"clearStorage:ok"}}function h(){l()}function d(){var t=localStorage.getItem("uni-storage-keys");return t?{keys:JSON.parse(t),currentSize:0,limitSize:0,errMsg:"getStorageInfo:ok"}:{keys:"",currentSize:0,limitSize:0,errMsg:"getStorageInfo:fail"}}function f(){var t=d();return delete t.errMsg,t}n.r(e),n.d(e,"setStorage",function(){return r}),n.d(e,"setStorageSync",function(){return a}),n.d(e,"getStorage",function(){return o}),n.d(e,"getStorageSync",function(){return s}),n.d(e,"removeStorage",function(){return c}),n.d(e,"removeStorageSync",function(){return u}),n.d(e,"clearStorage",function(){return l}),n.d(e,"clearStorageSync",function(){return h}),n.d(e,"getStorageInfo",function(){return d}),n.d(e,"getStorageInfoSync",function(){return f})},4871:function(t,e,n){},"488c":function(t,e,n){},"4a59":function(t,e,n){"use strict";(function(t){function i(e,n,i){t.UniServiceJSBridge.subscribeHandler(e,n,i)}n.d(e,"a",function(){return i})}).call(this,n("24aa"))},"4c68":function(t,e,n){"use strict";(function(t){n.d(e,"b",function(){return o}),n.d(e,"a",function(){return s});n("5abe");var i=n("85b6");function r(t){return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}var a={};function o(e,n){var o=e.reqId,s=e.options,c=getCurrentPages(),u=c.find(function(t){return t.$page.id===n});if(!u)throw new Error("Not Found:Page[".concat(n,"]"));var l=u.$el,h=s.relativeToSelector?l.querySelector(s.relativeToSelector):null,d=a[o]=new IntersectionObserver(function(e,n){e.forEach(function(e){t.publishHandler("onRequestComponentObserver",{reqId:o,res:{intersectionRatio:e.intersectionRatio,intersectionRect:r(e.intersectionRect),boundingClientRect:r(e.boundingClientRect),relativeRect:r(e.rootBounds),time:Date.now(),dataset:Object(i["c"])(e.target.dataset||{}),id:e.target.id}},u.$page.id)})},{root:h,rootMargin:s.rootMargin,threshold:s.thresholds});s.observeAll?(d.USE_MUTATION_OBSERVER=!0,Array.prototype.map.call(l.querySelectorAll(s.selector),function(t){d.observe(t)})):(d.USE_MUTATION_OBSERVER=!1,d.observe(l.querySelector(s.selector)))}function s(e){var n=e.reqId,i=a[n];i&&(i.disconnect(),t.publishHandler("onRequestComponentObserver",{reqId:n,reqEnd:!0}))}}).call(this,n("501c"))},"4ca9":function(t,e,n){"use strict";n.r(e),function(t){var i=n("6389"),r=n.n(i),a=n("85b6"),o=n("abbf"),s=n("0784"),c=n("aa92"),u=n("23e5");function l(t){var e=0;return t.forEach(function(t){t.meta.id&&e++}),e}function h(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":decodeURI(t.slice(e+1))}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=decodeURI(window.location.pathname);return t&&0===e.indexOf(t)&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}e["default"]={install:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.routes;Object(c["a"])(e);var f=l(i),p=new r.a({id:f,mode:__uniConfig.router.mode,base:__uniConfig.router.base,routes:i,scrollBehavior:function(t,e,n){if(n)return n;if(t&&e&&t.meta.isTabBar&&e.meta.isTabBar){var i=Object(u["b"])(t.params.__id__);if(i)return i}return{x:0,y:0}}}),g=[],m=p.match("history"===__uniConfig.router.mode?d(__uniConfig.router.base):h());if(m.meta.name&&(m.meta.id?g.push(m.meta.name+"-"+m.meta.id):g.push(m.meta.name+"-"+(f+1))),m.meta&&m.meta.name&&(document.body.className="uni-body "+m.meta.name,m.meta.isNVue)){var v="nvue-dir-"+__uniConfig.nvue["flex-direction"];document.body.setAttribute("nvue",""),document.body.setAttribute(v,"")}e.mixin({beforeCreate:function(){var e=this.$options;if("app"===e.mpType){e.data=function(){return{keepAliveInclude:g}};var n=Object(o["a"])(i,m);Object.keys(n).forEach(function(t){e[t]=e[t]?[].concat(n[t],e[t]):[n[t]]}),e.router=p,Array.isArray(e.onError)&&0!==e.onError.length||(e.onError=[function(e){t.error(e)}])}else if(Object(a["b"])(this)){var r=Object(s["a"])();Object.keys(r).forEach(function(t){e[t]=e[t]?[].concat(r[t],e[t]):[r[t]]})}else this.$parent&&this.$parent.__page__&&(this.__page__=this.$parent.__page__)}}),Object.defineProperty(e.prototype,"$page",{get:function(){return this.__page__}}),e.prototype.createSelectorQuery=function(){return uni.createSelectorQuery().in(this)},e.prototype.createIntersectionObserver=function(t){return uni.createIntersectionObserver(this,t)},e.use(r.a)}}}.call(this,n("3ad9")["default"])},"4da7":function(t,e,n){"use strict";n.r(e);var i,r,a=n("4f97"),o=a["a"],s=(n("c8ed"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},"4ec0":function(t,e,n){"use strict";(function(t,i){var r=n("f2b3"),a=n("65a8"),o=n("81ea"),s=n("f1ea");e["a"]={name:"App",components:o["a"],mixins:s["default"],props:{keepAliveInclude:{type:Array,default:function(){return[]}}},data:function(){return{transitionName:"fade",hideTabBar:!1,tabBar:__uniConfig.tabBar||{}}},computed:{key:function(){return this.$route.meta.name+"-"+this.$route.params.__id__+"-"+(__uniConfig.reLaunch||1)},hasTabBar:function(){return __uniConfig.tabBar&&__uniConfig.tabBar.list&&__uniConfig.tabBar.list.length},showTabBar:function(){return this.$route.meta.isTabBar&&!this.hideTabBar}},watch:{$route:function(e,n){t.emit("onHidePopup")},hideTabBar:function(t,e){if(uni.canIUse("css.var")){var n=t?"0px":a["b"]+"px";document.documentElement.style.setProperty("--window-bottom",n),i.debug("uni.".concat(n?"showTabBar":"hideTabBar",":--window-bottom=").concat(n))}window.dispatchEvent(new CustomEvent("resize"))}},created:function(){uni.canIUse("css.var")&&document.documentElement.style.setProperty("--status-bar-height","0px")},mounted:function(){window.addEventListener("message",function(e){Object(r["f"])(e.data)&&"WEB_INVOKE_APPSERVICE"===e.data.type&&t.emit("onWebInvokeAppService",e.data.data,e.data.pageId)}),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState?t.emit("onAppEnterForeground"):t.emit("onAppEnterBackground")})}}}).call(this,n("0dd1"),n("3ad9")["default"])},"4f1c":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-switch",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-switch-wrapper"},[n("div",{directives:[{name:"show",rawName:"v-show",value:"switch"===t.type,expression:"type === 'switch'"}],staticClass:"uni-switch-input",class:[t.switchChecked?"uni-switch-input-checked":""],style:{backgroundColor:t.switchChecked?t.color:"#DFDFDF",borderColor:t.switchChecked?t.color:"#DFDFDF"}}),n("div",{directives:[{name:"show",rawName:"v-show",value:"checkbox"===t.type,expression:"type === 'checkbox'"}],staticClass:"uni-checkbox-input",class:[t.switchChecked?"uni-checkbox-input-checked":""],style:{color:t.color}})])])},r=[],a=n("8af1"),o={name:"Switch",mixins:[a["a"],a["c"]],props:{name:{type:String,default:""},checked:{type:[Boolean,String],default:!1},type:{type:String,default:"switch"},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007aff"}},data:function(){return{switchChecked:this.checked}},watch:{checked:function(t){this.switchChecked=t}},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},listeners:{"label-click":"_onClick","@label-click":"_onClick"},methods:{_onClick:function(t){this.disabled||(this.switchChecked=!this.switchChecked,this.$trigger("change",t,{value:this.switchChecked}))},_resetFormData:function(){this.switchChecked=!1},_getFormData:function(){var t={};return""!==this.name&&(t["value"]=this.switchChecked,t["key"]=this.name),t}}},s=o,c=(n("a5ec"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"4f43":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"downloadFile",function(){return u});var i=n("e2e2");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")),t}},render:function(e){var n=this,i=[];return this.$slots.default&&this.$slots.default.forEach(function(r){if(r.text){var a=r.text.replace(/\\n/g,"\n"),o=a.split("\n");o.forEach(function(t,r){i.push(n._decodeHtml(t)),r!==o.length-1&&i.push(e("br"))})}else r.componentOptions&&"v-uni-text"!==r.componentOptions.tag&&t.warn(" 组件内只支持嵌套 ,不支持其它组件或自定义组件,否则会引发在不同平台的渲染差异。"),i.push(r)}),e("uni-text",{on:this.$listeners,attrs:{selectable:!!this.selectable}},[e("span",{},i)])}}}).call(this,n("3ad9")["default"])},"4fef":function(t,e,n){"use strict";var i=n("2fb0"),r=n.n(i);r.a},"500a":function(t,e,n){},"501c":function(t,e,n){"use strict";n.r(e),n.d(e,"on",function(){return c}),n.d(e,"off",function(){return u}),n.d(e,"once",function(){return l}),n.d(e,"emit",function(){return h}),n.d(e,"subscribe",function(){return d}),n.d(e,"unsubscribe",function(){return f}),n.d(e,"subscribeHandler",function(){return p});var i=n("8bbf"),r=n.n(i),a=n("8ecd"),o=n("4a59");n.d(e,"publishHandler",function(){return o["a"]});var s=new r.a,c=s.$on.bind(s),u=s.$off.bind(s),l=s.$once.bind(s),h=s.$emit.bind(s);function d(t,e){return c("service."+t,e)}function f(t,e){return u("service."+t,e)}function p(t,e,n){h("service."+t,e,n)}Object(a["a"])(d)},5129:function(t,e){t.exports=["uni-app","uni-tabbar","uni-page","uni-page-head","uni-page-wrapper","uni-page-body","uni-page-refresh","uni-actionsheet","uni-modal","uni-picker","uni-toast","uni-resize-sensor","uni-ad","uni-audio","uni-button","uni-camera","uni-canvas","uni-checkbox","uni-checkbox-group","uni-cover-image","uni-cover-view","uni-form","uni-functional-page-navigator","uni-image","uni-input","uni-label","uni-live-player","uni-live-pusher","uni-map","uni-movable-area","uni-movable-view","uni-navigator","uni-official-account","uni-open-data","uni-picker","uni-picker-view","uni-picker-view-column","uni-progress","uni-radio","uni-radio-group","uni-rich-text","uni-scroll-view","uni-slider","uni-swiper","uni-swiper-item","uni-switch","uni-text","uni-textarea","uni-video","uni-view","uni-web-view"]},5363:function(t,e,n){"use strict";function i(t){this._drag=t,this._dragLog=Math.log(t),this._x=0,this._v=0,this._startTime=0}n.d(e,"a",function(){return i}),i.prototype.set=function(t,e){this._x=t,this._v=e,this._startTime=(new Date).getTime()},i.prototype.setVelocityByEnd=function(t){this._v=(t-this._x)*this._dragLog/(Math.pow(this._drag,100)-1)},i.prototype.x=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._x+this._v*e/this._dragLog-this._v/this._dragLog},i.prototype.dx=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._v*e},i.prototype.done=function(){return Math.abs(this.dx())<3},i.prototype.reconfigure=function(t){var e=this.x(),n=this.dx();this._drag=t,this._dragLog=Math.log(t),this.set(e,n)},i.prototype.configuration=function(){var t=this;return[{label:"Friction",read:function(){return t._drag},write:function(e){t.reconfigure(e)},min:.001,max:.1,step:.001}]}},"53f0":function(t,e,n){},5408:function(t,e,n){var i={"./button/index.vue":"d3bd","./canvas/index.vue":"bacd","./checkbox-group/index.vue":"25ce","./checkbox/index.vue":"7bb3","./form/index.vue":"b34d","./image/index.vue":"1082","./input/index.vue":"250d","./label/index.vue":"70f4","./movable-area/index.vue":"c61c","./movable-view/index.vue":"8842","./navigator/index.vue":"17fd","./picker-view-column/index.vue":"1955","./picker-view/index.vue":"27ab","./picker/index.vue":"c35d","./progress/index.vue":"9b1f","./radio-group/index.vue":"d5ec","./radio/index.vue":"6491","./resize-sensor/index.vue":"3e8c","./rich-text/index.vue":"b705","./scroll-view/index.vue":"f1ef","./slider/index.vue":"9f96","./swiper-item/index.vue":"9213","./swiper/index.vue":"5513","./switch/index.vue":"4f1c","./text/index.vue":"4da7","./textarea/index.vue":"5768","./view/index.vue":"2bbe"};function r(t){var e=a(t);return n(e)}function a(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=a,t.exports=r,r.id="5408"},5513:function(t,e,n){"use strict";n.r(e);var i,r,a=n("ba15"),o={name:"Swiper",mixins:[a["a"]],props:{indicatorDots:{type:[Boolean,String],default:!1},vertical:{type:[Boolean,String],default:!1},autoplay:{type:[Boolean,String],default:!1},circular:{type:[Boolean,String],default:!1},interval:{type:[Number,String],default:5e3},duration:{type:[Number,String],default:500},current:{type:[Number,String],default:0},indicatorColor:{type:String,default:""},indicatorActiveColor:{type:String,default:""},previousMargin:{type:String,default:""},nextMargin:{type:String,default:""},currentItemId:{type:String,default:""},skipHiddenItemLayout:{type:[Boolean,String],default:!1},displayMultipleItems:{type:[Number,String],default:1}},data:function(){return{currentSync:Math.round(this.current)||0,currentItemIdSync:this.currentItemId||"",userTracking:!1,currentChangeSource:"",items:[]}},computed:{intervalNumber:function(){var t=Number(this.interval);return isNaN(t)?5e3:t},durationNumber:function(){var t=Number(this.duration);return isNaN(t)?500:t},displayMultipleItemsNumber:function(){var t=Math.round(this.displayMultipleItems);return isNaN(t)?1:t},slidesStyle:function(){var t={};return(this.nextMargin||this.previousMargin)&&(t=this.vertical?{left:0,right:0,top:this._upx2px(this.previousMargin),bottom:this._upx2px(this.nextMargin)}:{top:0,bottom:0,left:this._upx2px(this.previousMargin),right:this._upx2px(this.nextMargin)}),t},slideFrameStyle:function(){var t=Math.abs(100/this.displayMultipleItemsNumber)+"%";return{width:this.vertical?"100%":t,height:this.vertical?t:"100%"}},circularEnabled:function(){return this.circular&&this.items.length>this.displayMultipleItemsNumber}},watch:{vertical:function(){this._resetLayout()},circular:function(){this._resetLayout()},intervalNumber:function(t){this._timer&&(this._cancelSchedule(),this._scheduleAutoplay())},current:function(t){this._currentCheck()},currentSync:function(t){this._currentChanged(t),this.$emit("update:current",t)},currentItemId:function(t){this._currentCheck()},currentItemIdSync:function(t){this.$emit("update:currentItemId",t)},displayMultipleItemsNumber:function(){this._resetLayout()}},created:function(){this._invalid=!0,this._viewportPosition=0,this._viewportMoveRatio=1,this._animating=null,this._requestedAnimation=!1,this._userDirectionChecked=!1,this._contentTrackViewport=0,this._contentTrackSpeed=0,this._contentTrackT=0},mounted:function(){var t=this;this._currentCheck(),this.touchtrack(this.$refs.slidesWrapper,"_handleContentTrack",!0),this._resetLayout(),this.$watch(function(){return t.autoplay&&!t.userTracking},this._inintAutoplay),this._inintAutoplay(this.autoplay&&!this.userTracking),this.$watch("items.length",this._resetLayout)},beforeDestroy:function(){this._cancelSchedule()},methods:{_inintAutoplay:function(t){t?this._scheduleAutoplay():this._cancelSchedule()},_currentCheck:function(){var t=-1;if(this.currentItemId)for(var e=0,n=this.items;ee-this.displayMultipleItemsNumber)return e-this.displayMultipleItemsNumber;return n},_upx2px:function(t){return/\d+[ur]px$/i.test(t)&&t.replace(/\d+[ur]px$/i,function(t){return"".concat(uni.upx2px(parseFloat(t)),"px")}),t||""},_resetLayout:function(){if(this._isMounted){this._cancelSchedule(),this._endViewportAnimation();for(var t=this.items,e=0;e0&&this._viewportMoveRatio<1||(this._viewportMoveRatio=1)}var r=this._viewportPosition;this._viewportPosition=-2;var a=this.currentSync;a>=0?(this._invalid=!1,this.userTracking?(this._updateViewport(r+a-this._contentTrackViewport),this._contentTrackViewport=a):(this._updateViewport(a),this.autoplay&&this._scheduleAutoplay())):(this._invalid=!0,this._updateViewport(-this.displayMultipleItemsNumber-1))}},_checkCircularLayout:function(t){if(!this._invalid)for(var e=this.items,n=e.length,i=t+this.displayMultipleItemsNumber,r=0;rt;)a-=r}else if(n>0){for(;a>t;)a-=r;for(;a+rt;)a-=r;a+r-tr)&&(i<0?i=-a(-i):i>r&&(i=r+a(i-r)),e._contentTrackSpeed=0),e._updateViewport(i)}var s=this._contentTrackT-n||1;this.vertical?o(-t.dy/this.$refs.slideFrame.offsetHeight,-t.ddy/s):o(-t.dx/this.$refs.slideFrame.offsetWidth,-t.ddx/s)},_handleTrackEnd:function(t){this.userTracking=!1;var e=this._contentTrackSpeed/Math.abs(this._contentTrackSpeed),n=0;!t&&Math.abs(this._contentTrackSpeed)>.2&&(n=.5*e);var i=this._normalizeCurrentValue(this._viewportPosition+n);t?this._updateViewport(this._contentTrackViewport):(this.currentChangeSource="touch",this.currentSync=i,this._animateViewport(i,"touch",0!==n?n:0===i&&this.circularEnabled&&this._viewportPosition>=1?1:0))},_handleContentTrack:function(t){if(!this._invalid){if("start"===t.detail.state)return this.userTracking=!0,this._userDirectionChecked=!1,this._handleTrackStart();if("end"===t.detail.state)return this._handleTrackEnd(!1);if("cancel"===t.detail.state)return this._handleTrackEnd(!0);if(this.userTracking){if(!this._userDirectionChecked){this._userDirectionChecked=!0;var e=Math.abs(t.detail.dx),n=Math.abs(t.detail.dy);if(e>=n&&this.vertical?this.userTracking=!1:e<=n&&!this.vertical&&(this.userTracking=!1),!this.userTracking)return void(this.autoplay&&this._scheduleAutoplay())}return this._handleTrackMove(t.detail),!1}}}},render:function(t){var e=[],n=[];this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"v-uni-swiper-item"===t.componentOptions.tag&&n.push(t)});for(var i=0,r=n.length;i=a||i-1&&this.selectionEndNumber>-1&&(this.$refs.textarea.selectionStart=this.selectionStartNumber,this.$refs.textarea.selectionEnd=this.selectionEndNumber)},_checkCursor:function(){this.focusSync&&("focus"===this.focusChangeSource||!this.focusChangeSource&&this.selectionStartNumber<0&&this.selectionEndNumber<0)&&this.cursorNumber>-1&&(this.$refs.textarea.selectionEnd=this.$refs.textarea.selectionStart=this.cursorNumber)},_blur:function(t){this.focusSync=!1,this.$trigger("blur",t,{value:this.valueSync,cursor:this.$refs.textarea.selectionEnd})},_compositionstart:function(t){this.composition=!0},_compositionend:function(t){this.composition=!1},_confirm:function(t){this.$trigger("confirm",t,{value:this.valueSync})},_linechange:function(t){this.$trigger("linechange",t,{value:this.valueSync})},_touchstart:function(){this.focusChangeSource="touch"},_resize:function(t){var e=t.height;this.height=e},_input:function(t){this.composition&&(this.valueComposition=t.target.value)},_getFormData:function(){return{value:this.valueSync,key:this.name}},_resetFormData:function(){this.valueSync=""},_checkEmpty:function(t){return t||!1}}},s=o,c=(n("9400"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"580e":function(t,e,n){"use strict";(function(t){var i=n("bab8");e["a"]={name:"SystemChooseLocation",components:{SystemHeader:i["a"]},data:function(){return{src:"",data:null}},mounted:function(){var t=this,e=__uniConfig.qqMapKey;this.src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=".concat(e,"&referer=uniapp"),window.addEventListener("message",function(e){var n=e.data;n&&"locationPicker"===n.module&&(t.data={name:n.poiname,address:n.poiaddress,latitude:n.latlng.lat,longitude:n.latlng.lng})},!1)},methods:{_choose:function(){this.data&&(t.publishHandler("onChooseLocation",this.data),getApp().$router.back())},_back:function(){t.publishHandler("onChooseLocation",null),getApp().$router.back()}}}}).call(this,n("501c"))},"594d":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-map",{attrs:{id:t.id}},[n("div",{ref:"map",staticStyle:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}}),n("div",{staticStyle:{position:"absolute",top:"0",width:"100%",height:"100%",overflow:"hidden","pointer-events":"none"}},[t._t("default")],2)])},r=[],a=n("635e"),o=a["a"],s=(n("3f7e"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},5964:function(t,e,n){"use strict";function i(t,e){var n=getCurrentPages();if(n.length){var i=n[n.length-1].$holder;switch(t){case"setNavigationBarColor":var r=e.frontColor,a=e.backgroundColor,o=e.animation,s=o.duration,c=o.timingFunc;r&&(i.navigationBar.textColor="#000000"===r?"black":"white"),a&&(i.navigationBar.backgroundColor=a),i.navigationBar.duration=s+"ms",i.navigationBar.timingFunc=c;break;case"showNavigationBarLoading":i.navigationBar.loading=!0;break;case"hideNavigationBarLoading":i.navigationBar.loading=!1;break;case"setNavigationBarTitle":var u=e.title;i.navigationBar.titleText=u,document.title=u;break}}return{}}function r(t){return i("setNavigationBarColor",t)}function a(){return i("showNavigationBarLoading")}function o(){return i("hideNavigationBarLoading")}function s(t){return i("setNavigationBarTitle",t)}n.r(e),n.d(e,"setNavigationBarColor",function(){return r}),n.d(e,"showNavigationBarLoading",function(){return a}),n.d(e,"hideNavigationBarLoading",function(){return o}),n.d(e,"setNavigationBarTitle",function(){return s})},"5a56":function(t,e,n){"use strict";n.r(e),e["default"]={methods:{beforeTransition:function(){},afterTransition:function(){}}}},"5ab3":function(t,e,n){"use strict";var i=n("fcd8"),r=n.n(i);r.a},"5abe":function(t,e){(function(){"use strict";if("object"===typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=window.document,e=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i.prototype.observe=function(t){var e=this._observationTargets.some(function(e){return e.element==t});if(!e){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},i.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},i.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},i.prototype._parseRootMargin=function(t){var e=t||"0px",n=e.split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(o(window,"resize",this._checkForIntersections,!0),o(t,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(window,"resize",this._checkForIntersections,!0),s(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():l();this._observationTargets.forEach(function(i){var a=i.element,o=u(a),s=this._rootContainsTarget(a),c=i.entry,l=t&&s&&this._computeTargetAndRootIntersection(a,e),h=i.entry=new n({time:r(),target:a,boundingClientRect:o,rootBounds:e,intersectionRect:l});c?t&&s?this._hasCrossedThreshold(c,h)&&this._queuedEntries.push(h):c&&c.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(e,n){if("none"!=window.getComputedStyle(e).display){var i=u(e),r=i,a=d(e),o=!1;while(!o){var s=null,l=1==a.nodeType?window.getComputedStyle(a):{};if("none"==l.display)return;if(a==this.root||a==t?(o=!0,s=n):a!=t.body&&a!=t.documentElement&&"visible"!=l.overflow&&(s=u(a)),s&&(r=c(s,r),!r))break;a=d(a)}return r}},i.prototype._getRootRect=function(){var e;if(this.root)e=u(this.root);else{var n=t.documentElement,i=t.body;e={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(e)},i.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},i.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,i=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==i)for(var r=0;r=0&&s>=0&&{top:n,bottom:i,left:r,right:a,width:o,height:s}}function u(t){var e;try{e=t.getBoundingClientRect()}catch(n){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):l()}function l(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function h(t,e){var n=e;while(n){if(n==t)return!0;n=d(n)}return!1}function d(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e&&e.assignedSlot?e.assignedSlot.parentNode:e}})()},"5b1e":function(t,e,n){"use strict";(function(t){var i=n("cb0f");e["a"]={name:"TabBar",props:{position:{default:"bottom",validator:function(t){return-1!==["bottom","top"].indexOf(t)}},color:{type:String,default:"#999"},selectedColor:{type:String,default:"#007aff"},backgroundColor:{type:String,default:"#f7f7fa"},borderStyle:{default:"black",validator:function(t){return-1!==["black","white"].indexOf(t)}},list:{type:Array,default:function(){return[]}}},computed:{borderColor:function(){return"white"===this.borderStyle?"rgba(255, 255, 255, 0.33)":"rgba(0, 0, 0, 0.33)"}},watch:{$route:function(t,e){t.meta.isTabBar&&(this.__path__=t.path)}},beforeCreate:function(){this.__path__=this.$route.path},methods:{_getRealPath:function(t){return 0!==t.indexOf("/")&&(t="/"+t),Object(i["a"])(t)},_switchTab:function(e,n){var i=e.text,r=e.pagePath,a="/"+r;a===__uniRoutes[0].alias&&(a="/");var o={index:n,text:i,pagePath:r};this.$route.path!==a?(this.__path__=this.$route.path,uni.switchTab({from:"tabBar",url:a,detail:o})):t.emit("onTabItemTap",o)}}}}).call(this,n("0dd1"))},"5d1d":function(t,e,n){"use strict";var i=n("91b0"),r=n.n(i);r.a},6062:function(t,e,n){"use strict";var i=n("748c"),r=n.n(i);r.a},6144:function(t,e,n){},"61c2":function(t,e,n){"use strict";var i=n("f2b3"),r=n("8af1");function a(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})}function o(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})}var s={name:"uni://form-field",init:function(t,e){e.constructor.options.props&&e.constructor.options.props.name&&e.constructor.options.props.value||(e.constructor.options.props||(e.constructor.options.props={}),e.constructor.options.props.name||(e.constructor.options.props.name=t.props.name={type:String}),e.constructor.options.props.value||(e.constructor.options.props.value=t.props.value={type:null})),t.propsData||(t.propsData={});var n=e.$vnode;if(n&&n.data&&n.data.attrs&&(Object(i["c"])(n.data.attrs,"name")&&(t.propsData.name=n.data.attrs.name),Object(i["c"])(n.data.attrs,"value")&&(t.propsData.value=n.data.attrs.value)),!e.constructor.options.methods||!e.constructor.options.methods._getFormData){e.constructor.options.methods||(e.constructor.options.methods={}),t.methods||(t.methods={});var s={_getFormData:function(){return this.name?{key:this.name,value:this.value}:{}},_resetFormData:function(){this.value=""}};Object.assign(e.constructor.options.methods,s),Object.assign(t.methods,s),Object.assign(e.constructor.options.methods,r["a"].methods),Object.assign(t.methods,r["a"].methods);var c=t["created"];e.constructor.options["created"]=t["created"]=c?[].concat(a,c):[a];var u=t["beforeDestroy"];e.constructor.options["beforeDestroy"]=t["beforeDestroy"]=u?[].concat(o,u):[o]}}};function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return l});var u=c({},s.name,s);function l(t,e){t.behaviors.forEach(function(n){var i=u[n];i&&i.init(t,e)})}},6226:function(t,e,n){"use strict";var i=n("e670"),r=n.n(i);r.a},6258:function(t,e,n){"use strict";(function(t){var i=n("5a56");e["a"]={name:"Toast",mixins:[i["default"]],props:{title:{type:String,default:""},icon:{default:"success",validator:function(t){return-1!==["success","loading","none"].indexOf(t)}},image:{type:String,default:""},duration:{type:Number,default:1500},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!1}},computed:{iconClass:function(){return"success"===this.icon?"uni-icon-success-no-circle":"loading"===this.icon?"uni-loading":void 0}},beforeUpdate:function(){this.visible&&(this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(function(){t.emit("onHideToast")},this.duration))}}}).call(this,n("0dd1"))},"626d":function(t,e,n){"use strict";n.r(e),function(t){var i=n("f2b3");e["default"]={data:function(){return{showActionSheet:{visible:!1}}},created:function(){var e=this;t.on("onShowActionSheet",function(t,n){e.showActionSheet=t,e.onActionSheetCloseCallback=n}),t.on("onHidePopup",function(t){e.showActionSheet.visible=!1})},methods:{_onActionSheetClose:function(t){this.showActionSheet.visible=!1,Object(i["e"])(this.onActionSheetCloseCallback)&&this.onActionSheetCloseCallback(t)}}}}.call(this,n("0dd1"))},"62b5":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var i={};function r(t){var e=i[t];return e||(e={id:1,callbacks:Object.create(null)},i[t]=e),{get:function(t){return e.callbacks[t]},pop:function(t){var n=e.callbacks[t];return n&&delete e.callbacks[t],n},push:function(t){var n=e.id++;return e.callbacks[n]=t,n}}}},"635e":function(t,e,n){"use strict";(function(t){var i,r=n("8af1"),a=n("f2b3");e["a"]={name:"Map",mixins:[r["d"]],props:{id:{type:String,default:""},latitude:{type:[String,Number],default:39.92},longitude:{type:[String,Number],default:116.46},scale:{type:[String,Number],default:16},markers:{type:Array,default:function(){return[]}},covers:{type:Array,default:function(){return[]}},includePoints:{type:Array,default:function(){return[]}},polyline:{type:Array,default:function(){return[]}},circles:{type:Array,default:function(){return[]}},controls:{type:Array,default:function(){return[]}},showLocation:{type:[Boolean,String],default:!1}},data:function(){return{center:{latitude:116.46,longitude:116.46},isMapReady:!1,isBoundsReady:!1,markersSync:[],polylineSync:[],circlesSync:[],controlsSync:[]}},watch:{latitude:function(){this.centerChange()},longitude:function(){this.centerChange()},scale:function(t){var e=this;this.mapReady(function(){e._map.setZoom(Number(t)||16)})},markers:function(t,e){var n=this;this.mapReady(function(){var i=[],r=[],a=[],o=[],s=[];t.forEach(function(t){if("id"in t){for(var n=!1,s=0;s=0?(e=a.indexOf(i))>=0&&n.changeMarker(t,o[e]):s.push(t)}),n.removeMarkers(s),n.createMarkers(i)})},polyline:function(t){var e=this;this.mapReady(function(){e.createPolyline()})},circles:function(){var t=this;this.mapReady(function(){t.createCircles()})},controls:function(){var t=this;this.mapReady(function(){t.createControls()})},includePoints:function(){var t=this;this.mapReady(function(){t.fitBounds(t.includePoints)})},showLocation:function(t){var e=this;this.mapReady(function(){e[t?"createLocation":"removeLocation"]()})}},created:function(){var t=this.latitude,e=this.longitude;t&&e&&(this.center.latitude=t,this.center.longitude=e)},mounted:function(){var t=this;this.loadMap(function(){t.init()})},beforeDestroy:function(){this.removeMarkers(this.markersSync),this.removePolyline(),this.removeCircles(),this.removeControls(),this.removeLocation()},methods:{_handleSubscribe:function(t){var e=this,n=t.type,r=t.data,a=void 0===r?{}:r;function o(t,e){t=t||{},t.errMsg="".concat(n,":").concat(e?"fail"+e:"ok");var i=e?a.fail:a.success;"function"===typeof i&&i(t),"function"===typeof a.complete&&a.complete(t)}switch(n){case"getCenterLocation":this.mapReady(function(){var t,n,i=e._map.getCenter();t=i.getLat(),n=i.getLng(),o({latitude:t,longitude:n})});break;case"moveToLocation":var s=this._locationPosition;s&&this._map.setCenter(s);break;case"translateMarker":this.mapReady(function(){try{var t=e.getMarker(a.markerId),n=a.destination,r=a.duration,s=!!a.autoRotate,c=Number(a.rotate)?a.rotate:0,u=t.getRotation(),l=t.getPosition(),h=new i.LatLng(n.latitude,n.longitude),d=i.geometry.spherical.computeDistanceBetween(l,h)/1e3,f=("number"===typeof r?r:1e3)/36e5,p=d/f,g=i.event.addListener(t,"moving",function(e){var n=e.latLng,i=t.label;i&&i.setPosition(n);var r=t.callout;r&&r.setPosition(n)}),m=i.event.addListener(t,"moveend",function(e){m.remove(),g.remove(),t.lastPosition=l,t.setPosition(h);var n=t.label;n&&n.setPosition(h);var i=t.callout;i&&i.setPosition(h);var r=a.animationEnd;"function"===typeof r&&r()}),v=0;s&&(t.lastPosition&&(v=i.geometry.spherical.computeHeading(t.lastPosition,l)),c=i.geometry.spherical.computeHeading(l,h)-v),t.setRotation(u+c),t.moveTo(h,p)}catch(b){o(null,b)}});break;case"includePoints":this.fitBounds(a.points);break;case"getRegion":this.boundsReady(function(){var t=e._map.getBounds(),n=t.getSouthWest(),i=t.getNorthEast();o({southwest:{latitude:n.getLat(),longitude:n.getLng()},northeast:{latitude:i.getLat(),longitude:i.getLng()}})});break;case"getScale":this.mapReady(function(){o({scale:Number(e.scale)})});break}},init:function(){var t=this,e=new i.LatLng(this.center.latitude,this.center.longitude),n=this._map=new i.Map(this.$refs.map,{center:e,zoom:Number(this.scale),scrollwheel:!1,disableDoubleClickZoom:!0,mapTypeControl:!1,zoomControl:!1,scaleControl:!1,minZoom:5,maxZoom:18,draggable:!0}),r=i.event.addListener(n,"bounds_changed",function(e){r.remove(),t.isBoundsReady=!0,t.$emit("boundsready")});i.event.addListener(n,"click",function(){t.$trigger("click",{},{})}),i.event.addListener(n,"dragstart",function(){t.$trigger("regionchange",{},{type:"begin"})}),i.event.addListener(n,"dragend",function(){t.$trigger("regionchange",{},{type:"end"})}),i.event.addListener(n,"zoom_changed",function(){t.$emit("update:scale",n.getZoom())}),i.event.addListener(n,"center_changed",function(){var e,i,r=n.getCenter();e=r.getLat(),i=r.getLng(),t.$emit("update:latitude",e),t.$emit("update:longitude",i)}),this.markers&&Array.isArray(this.markers)&&this.markers.length&&this.createMarkers(this.markers),this.polyline&&Array.isArray(this.polyline)&&this.polyline.length&&this.createPolyline(),this.circles&&Array.isArray(this.circles)&&this.circles.length&&this.createCircles(),this.controls&&Array.isArray(this.controls)&&this.controls.length&&this.createControls(),this.showLocation&&this.createLocation(),this.includePoints&&Array.isArray(this.includePoints)&&this.includePoints.length&&this.fitBounds(this.includePoints,function(){n.setCenter(e)}),this.isMapReady=!0,this.$emit("mapready")},centerChange:function(){var t=this,e=Number(this.latitude),n=Number(this.longitude);e===this.center.latitude&&n===this.center.longitude||(this.center.latitude=e,this.center.longitude=n,this._map&&this.mapReady(function(){t._map.setCenter(new i.LatLng(e,n))}))},createMarkers:function(t){var e=this,n=this._map,r=this.markersSync;t.forEach(function(t){var o=new i.Marker({map:n,flat:!0,autoRotation:!1});o.id=t.id,e.changeMarker(o,t),i.event.addListener(o,"click",function(n){var i=o.callout;if(i){var r=i.div,s=r.parentNode;i.alwaysVisible||i.set("visible",!i.visible),i.visible&&(s.removeChild(r),s.appendChild(r))}Object(a["c"])(t,"id")&&e.$trigger("markertap",{},{markerId:t.id})}),r.push(o)})},changeMarker:function(t,e){var n=this,r=this._map,o=e.title||e.name,s=new i.LatLng(e.latitude,e.longitude),c=new Image;c.onload=function(){var u,l,h,d,f=e.anchor||{},p=f.x,g=f.y;e.iconPath&&(e.width||e.height)?(l=e.width||c.width/c.height*e.height,h=e.height||c.height/c.width*e.width):(l=c.width/2,h=c.height/2),p=("number"===typeof p?p:.5)*l,g=("number"===typeof g?g:1)*h,d=h-(h-g),u=new i.MarkerImage(c.src,null,null,new i.Point(p,g),new i.Size(l,h)),t.setPosition(s),t.setIcon(u),t.setRotation(e.rotate||0);var m,v=e.label||{};t.label&&(t.label.setMap(null),delete t.label),v.content&&(m=new i.Label({position:s,map:r,clickable:!1,content:v.content,style:{border:"none",padding:"8px",background:"none",color:v.color,fontSize:(v.fontSize||14)+"px",lineHeight:(v.fontSize||14)+"px",marginLeft:v.x,marginTop:v.y}}),t.label=m);var b,y=e.callout||{},_=t.callout;y.content?b={id:e.id,position:s,map:r,top:d,content:y.content,color:y.color,fontSize:y.fontSize,borderRadius:y.borderRadius,bgColor:y.bgColor,padding:y.padding,boxShadow:y.boxShadow,display:y.display}:o&&(b={id:e.id,position:s,map:r,top:d,content:o,boxShadow:"0px 0px 3px 1px rgba(0,0,0,0.5)"}),b?_?_.setOption(b):(_=t.callout=new i.Callout(b),_.div.onclick=function(t){Object(a["c"])(e,"id")&&n.$trigger("callouttap",t,{markerId:e.id}),t.stopPropagation(),t.preventDefault()}):_&&(_.setMap(null),delete t.callout)},c.src=e.iconPath?this.$getRealPath(e.iconPath):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAABQCAYAAABFyhZTAAANDElEQVR4nNWce4hc133Hv+fc92MeuytpV5ZXll2XuvTlUBTSP1IREsdNiKGEEAgE3EBLaBtK/2hNoQTStISUosiGOqVpQ+qkIdAax1FiG+oYIxyD4xi3uKlEXSFFke3d1e5od+a+H+ec/nHvmbkzs6ud2bmjTX7wY3b3zr3nfM7vd37n8Tt3CW6DiDP3EABSd/0KAEEuXBHzrsteFTiwVOBo+amUP9PK34ZuAcD30NoboTZgceYeCaQAUEvVAKiZ0lpiiv0Lgmi/imFLF5YV2SWFR1e0fGcDQF5qVn4y1Ag/E3DFmhJSB2Dk1D2Squ0HBdT3C0JPE6oco6oKqmm7PodnGXieQ3DWIYL/iCB/UWO95zTW2wCQlpqhgJ8J/MDApUUVFFY0AFiRdvwMJ8bvCaKcUW3bUE0DimGAKMpkz2QMLEnBkhhZEHICfoHy+AkrW3seQAwgQQHPyIUr/CD1nhq4tCpFAWoCsGNt5X2MWo9Qw/p1zXGgWiZAZu8teRQhCwLwOLpEefKolb3zDIAQBXyGAnwqa09Vq4pVDQBOqrTuTmn7c9S0H9QdB6ptT/O4iSWPY2S+DxYHFzTW+5zBti8BCFBYfCprTwxcwmoALABupK48lFPri0az1dSbjWkZDiSp5yPpdn2Vh39m5evPAPABRACySaH3Ba64sA7ABtD0tdXPUqvxKd1xoJrmDAjTSx7HCDsdroj0nJO99TiAHgprZwD4fi5+S+AKrAHA5UQ7EijH/05rND9sNJsglNaEMZ3wPEfq+8i97vdstv4IFdkWBi5+S2h1n2dL2IYAXQqU449pjdYHzFaruDr3edEelVJUmK02YpCPBD454uRrf0BFtlleTlAMX7vfu9eFSp91ALR95cRfq27zA2ariXK+cOhqtprQnOZ7AmXlLIA2ABeAXtZ9cuDSlVUUfbYVKCsPq27zo1arddiMY2q2WlCd5gd95fhnALTKOmslw/7A5RcVFGNsI6ILpzNi/rnu2IdPt4caDRc5Mf4opEu/DaBR1l3dDXo3CxMUEdkRoO2UuJ+3Wy1VUbXD5tpTKVVgt9s0I85fcahLKLqhvhvf0B/KFpFjbdOnRz+pOY17f5atK1W3LWiue8KnR38fQLNkGLPyaAvI8dZl0Jcz6J82bPuwWSZW03GRQ3s4JdYqigBmoOie48CVQGUBcAO68AnTbTQUVQWE+LlQSimsRsOKSPthFG49ZmU6Aq8DsAWomwnt4+bPgSuPqunYyIX6uwzqIoqIPdSXacW6clFgB6T9Xs0wFylVDrv+UyshFIZlOSFpP1ACG1Ury5mWdGcTgJkJ/UO2ZZVPqU+EqiL9xV8GWzoGAFC2t6C/eQkkS2stR7cs+KH2OwDOo2AKUcy1hQTur28FiJVDOa0bRm283HHhPfQxhL91BsIYXmyQLIX1yktofvdJ0N5OLeVpug4G5TcY1IaCvIuCLQHAq8A6ACOCe5+qag1CSBEMZpT01L3Y/vSfgi0e2fW60HSE730/4vtPY/Erj0J/8+LMZRIAmq7rUeLe75KdTRTACoCcVvqvBsBIhXG/qumoo0Plx5Zx80/+Yk/YqvBGE53PPILsxGotZWuahkxov4bCkDoARZy5h1S3UjUAKhf0pKrWE6x2Hv5DcMedwCaFCMPEzqf+GCB05rIVVQUHOVlySQuPAzNB7lAUBbOOickv/QrSe++bGFZKtnoK0f2nZy5foRRc0Dsw2C5WANDRvWRFAIv9/juDxr/5nqlhpcTvevfM5VNKwYHFijEVAEStWFgBQIWASQkKv5hBstVTM947W/mEABDCxMCgFBXgfkpECGgAmbW8seFnqntNc+byiSDggqgYSfPIKVc/2SUgcsH57C7V3T5wZWmvO3P5QnAAPMdwnotU59KkaBkR1AGs/fTqgYG1n16dHZhzQCAea8zKz4UTEdFl/EBZjCGxXn354Pe+8tLM5TPGAPAxN5PAQioR7CdZls1u4auXYf3wB1NX1Pjv/4Rx8Y2Zy8/zHAR8reTiko9W/sAAcIWwt+oAhhBofeMrUDfWJoZVtjtof/Xvayk7TTMo4D/BSL55FJiZNPvfNE1rKZT2ulj64mehX/m/fWG169ew9IW/hHJzqx7gLIVO00slWy6B1QpsBoC5SnR1O7K3GecLSg2ZBaWziSOffwTB+x5E8MGHkB8/MXx9cwPuf3wX9gvPgeT5zOUBgBACcZKmR63of1CwycS6UFFYeCjjrhD2WhTHD7iWVUsFwBic7z8L5/vPgh1dBneL5BsJg6lcflKJ4hgKYT8iENXTBAzl8lBgYOEMALOV9IUgDB9w55AoU26sQ7mxXvtzq+KHISyavogBV4oCXNAy8cSrF9pa+EaSJmtpWk/wup2a5zmiONle0MMflpD94xLkwhUhOykrL8TlJzNo9lQvDHHYe1TTai8MYSjZd0p3zjA4LcCB4XFYXowB5EeM4HkvDDpxmh4+xYSa5hm6fuAt6cH3Sp5kV+Aye55XvpAqRCSOmv5LLwgO3U0n1V4QwFLSf9UoD0tPjSrAomphoHDrBINDI/kxM3wxTMIf7/j+ocPsp90ggBcFV5bN8LnSeHHJIs+BjAFLt45QZNNjAOyIET3a8XwvTNLD9tg9NU4zbPa8dEmPzxIipKeGpabSnYeAyxbIS2BfftnVsrWmnjzWDQPkLD98uhHlgqMbBnC19PGmnl4rAUMMDrzk1SMQo1MpXt4QAPDKG7OjZvwKy4Ov3/R/9vrzVs9DmgZPrljRCyg8NCzr7o9adwx4xMpeqTEAdqcT/nuY+M9v9rxDh5S62fMQxP7Lq27wBIoYFJd17mFwnElUGXc71CLKlgowvONnrbrhl6/2sEoJuW/JcXa59fbJzTDATuRfu7sRfgmDgCthpXXF6H1jq4OyRWRr+QC65WeiEJEet+O/7fj+thfHOKx+6ycxtjy/u2Ilf6NSISdLsq59r9zt+NKuy6EKdFS2WBeFxVNHY5sLRnr27Z0dzhi77W7MGMNb2zu8ZaTnGnq+hoE37mDgynuewdxz/VdORuTDuqUWQcxO/8tU+ZObfnDbDbzpBzBV9m/LdvraCGzfKLc6hnjLBW8F2q88NATATjaib3pxcLFzG2dim74PLw5eP9mIv4U9PHC/M5eTrPCrQ5XszzElyFac9OwN3/P8NMG8TeslMbZCf/tEIzlHSX8m5VXqlGBkCDoQ8C5BrH+Ys6GzjZaRP3YzDCHmaFnOOW6GERaM/Jyt8u0SLijrcssgNTXwLtAy9AcAsjvc7JWMxc9seP7cDHzDD8B49NSKk72OwUyqV+rEsBMDl9DVICZbNgLATjXTf96OgiudMKzdup0wxHYcvHlXM/sGxvttiCnOSk8FXIrsz8PjMxXpspOffcfz8rTG+XbCcqx5Xrri5OcUKuQGRbXssaljrcC36M/posWuuTr/+lYY1ebKnTCCq/MnFkx2HYPAKWdSQ8u+uQCPQEvX6qFwrfyuVvadnTi4uFmDa28GAXbi4Men2tl5FPN7uSiYKkjNDFxCy/4sg0d/qLqjwR5b9/04Znue0d5X4jzHehDEJxrsUYwHy6n7bVVm2WnnKNxqyLXbJn/b1fkTswSwrSiCq/OvtUy+juHl6sTjbe3AFdeW0DJqZ3e182d3kujNThxh2o7biSJ0k+ji3Qv5sxj2Ig8H7LdVmSmXUhY8VilKkB1z2Jev9zzOuZiYl3GB656XL7vsHzC85Os35qzvH9bxWorAsNsFANKjDr9saeL82hRz7fUggKWJp4/Y/CoGw1//mWVZM8nMwLdw7fxUm31zKwo7vXT/s5S9NMVWFK7ds8C+heG9NR8zROVRqeXFoxHXlhZJDBXBoi0e34yi/YehKMKiLf5JU/p7yUONV9d7xHW+aSWhhzYAV1v81SBPLm7FY8ct+rIVxwjz5I3VFn8V4w1XiytLqQ24sgEoXbvviiuu+Me9rCyEwDXP48uu+CqGZ3G1urKUWt+l28W1QwDpMVdcZsgvrIXh2D0bUQRDxUvHXHEZw8GvVleWMo+XB6sbBnIznJ1s8a+9EwQ5rxyJ4pzjbd/P72xyuc1aTQLMNMHYS2oHrri2dM0QQNI0sWnrOL8eRf3vrkcRbB3n2xY2MEiP9NM88/ivD/N6PbTq2rIv5qtt8dRaGKaccwgh8E4Y5ne2xNMYb6B+tq9umQvwyDIyKDVxddw0VfH8jTjGZhzDVMWLDQNbGGzZzNW6wPwsXM05V7OR+fEmvn09CPiNKMKyi29jYN0Ag0BVe9+Vst/7w7OKnIEFKF6pMRdtrL3VxctMMOOoi2q2r5/LnWeF5vqK90gAGyTaXTy5ZAtpXRms5jIMjcq8LQwMnywIAVgrDVwuD+9K68oZ1dxcWcrcX+IfScHKwBRWfu9H8Xn2XSm3w8LAYHfEQ5F6TVGYWM6qYsy570q5Lf+mYSRH1QFwA8AGgJsooOXe7tzl/wGchYFKtBMCwAAAAABJRU5ErkJggg=="},removeMarkers:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{};this.option=t;var e=t.map;this.position=t.position,this.index=1,this.visible=this.alwaysVisible="ALWAYS"===t.display,this.init(),Object.defineProperty(this,"onclick",{setter:function(t){this.div.onclick=t},getter:function(){return this.div.onclick}}),e&&this.setMap(e)};e.prototype=new i.Overlay,e.prototype.init=function(){var t=this.option,e=this.div=document.createElement("div"),n=e.style;n.position="absolute",n.whiteSpace="nowrap",n.transform="translateX(-50%) translateY(-100%)",n.zIndex=1,n.boxShadow=t.boxShadow||"none",n.display=this.visible?"block":"none";var i=this.triangle=document.createElement("div");i.setAttribute("style","position: absolute;white-space: nowrap;border-width: 4px;border-style: solid;border-color: #fff transparent transparent;border-image: initial;font-size: 12px;padding: 0px;background-color: transparent;width: 0px;height: 0px;transform: translate(-50%, 100%);left: 50%;bottom: 0;"),this.setStyle(t),this.changed=function(t){n.display=this.visible?"block":"none"},e.appendChild(i)},e.prototype.construct=function(){var t=this.div,e=this.getPanes();e.floatPane.appendChild(t)},e.prototype.draw=function(){var t=this.getProjection();if(this.position&&this.div&&t){var e=t.fromLatLngToDivPixel(this.position),n=this.div.style;n.left=e.x+"px",n.top=e.y+"px"}},e.prototype.destroy=function(){this.div.parentNode.removeChild(this.div),this.div=null,this.triangle=null},e.prototype.setOption=function(t){this.option=t,this.setPosition(t.position),"ALWAYS"===t.display?this.alwaysVisible=this.visible=!0:this.alwaysVisible=!1,this.setStyle(t)},e.prototype.setStyle=function(t){var e=this.div,n=e.style;e.innerText=t.content,n.lineHeight=(t.fontSize||14)+"px",n.fontSize=(t.fontSize||14)+"px",n.padding=(t.padding||8)+"px",n.color=t.color||"#000",n.borderRadius=(t.borderRadius||0)+"px",n.backgroundColor=t.bgColor||"#fff",n.marginTop="-"+(t.top+5)+"px",this.triangle.style.borderColor="".concat(t.bgColor||"#fff"," transparent transparent")},e.prototype.setPosition=function(t){this.position=t,this.draw()},t()};var r=document.createElement("script");r.src="https://map.qq.com/api/js?v=2.exp&key=".concat(e,"&callback=").concat(n,"&libraries=geometry"),document.body.appendChild(r)}}}}}).call(this,n("3ad9")["default"])},6389:function(e,n){e.exports=t},6428:function(t,e,n){"use strict";var i=n("c99c"),r=n.n(i);r.a},6491:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-radio",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-radio-wrapper"},[n("div",{staticClass:"uni-radio-input",class:t.radioChecked?"uni-radio-input-checked":"",style:t.radioChecked?t.checkedStyle:""}),t._t("default")],2)])},r=[],a=n("8af1"),o={name:"Radio",mixins:[a["a"],a["c"]],props:{checked:{type:[Boolean,String],default:!1},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007AFF"},value:{type:String,default:""}},data:function(){return{radioChecked:this.checked,radioValue:this.value}},computed:{checkedStyle:function(){return"background-color: ".concat(this.color,";border-color: ").concat(this.color,";")}},watch:{checked:function(t){this.radioChecked=t},value:function(t){this.radioValue=t}},listeners:{"label-click":"_onClick","@label-click":"_onClick"},created:function(){this.$dispatch("RadioGroup","uni-radio-group-update",{type:"add",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("RadioGroup","uni-radio-group-update",{type:"remove",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onClick:function(t){this.disabled||this.radioChecked||(this.radioChecked=!0,this.$dispatch("RadioGroup","uni-radio-change",t,this))},_resetFormData:function(){this.radioChecked=this.min}}},s=o,c=(n("c96e"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"64d0":function(t,e,n){"use strict";var i=n("1047"),r=n.n(i);r.a},6575:function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=e.latitude,r=e.longitude,a=e.scale,o=e.name,s=e.address,c=t,u=c.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/open-location",query:{latitude:i,longitude:r,scale:a,name:o,address:s}},function(){u(n,{errMsg:"openLocation:ok"})},function(){u(n,{errMsg:"openLocation:fail"})})}n.d(e,"openLocation",function(){return i})}.call(this,n("0dd1"))},"65a8":function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r});var i=44,r=50},6725:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"createSelectorQuery",function(){return d});var i=n("f2b3"),r=n("62b5");function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;ne-n&&t0){var u=(-n-Math.sqrt(a))/(2*i),l=(-n+Math.sqrt(a))/(2*i),h=(e-u*t)/(l-u),d=t-h;return{x:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*e+h*n},dx:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*u*e+h*l*n}}}var f=Math.sqrt(4*i*r-n*n)/(2*i),p=-n/2*i,g=t,m=(e-p*t)/f;return{x:function(t){return Math.pow(Math.E,p*t)*(g*Math.cos(f*t)+m*Math.sin(f*t))},dx:function(t){var e=Math.pow(Math.E,p*t),n=Math.cos(f*t),i=Math.sin(f*t);return e*(m*f*n-g*f*i)+p*e*(m*i+g*n)}}},a.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},a.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},a.prototype.setEnd=function(t,e,n){if(n||(n=(new Date).getTime()),t!==this._endPosition||!r(e,.4)){e=e||0;var i=this._endPosition;this._solution&&(r(e,.4)&&(e=this._solution.dx((n-this._startTime)/1e3)),i=this._solution.x((n-this._startTime)/1e3),r(e,.4)&&(e=0),r(i,.4)&&(i=0),i+=this._endPosition),this._solution&&r(i-t,.4)&&r(e,.4)||(this._endPosition=t,this._solution=this._solve(i-this._endPosition,e),this._startTime=n)}},a.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},a.prototype.done=function(t){return t||(t=(new Date).getTime()),i(this.x(),this._endPosition,.4)&&r(this.dx(),.4)},a.prototype.reconfigure=function(t,e,n){this._m=t,this._k=e,this._c=n,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},a.prototype.springConstant=function(){return this._k},a.prototype.damping=function(){return this._c},a.prototype.configuration=function(){function t(t,e){t.reconfigure(1,e,t.damping())}function e(t,e){t.reconfigure(1,t.springConstant(),e)}return[{label:"Spring Constant",read:this.springConstant.bind(this),write:t.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:e.bind(this,this),min:1,max:500}]}},"748c":function(t,e,n){},"74ce":function(t,e,n){},7557:function(t,e,n){"use strict";n.r(e),function(t){var n={visible:!1,mode:"",range:[],rangeKey:"",value:"",disabled:!1,start:"",end:"",fields:"day",customItem:""};e["default"]={data:function(){return{showPicker:{visible:!1}}},created:function(){var e=this;t.subscribe("showPicker",function(t,i){e.showPicker=Object.assign(n,t,{pageId:i,visible:!0})}),t.subscribe("hidePicker",function(){e._onPickerClose()}),t.on("onHidePopup",function(){e._onPickerClose()})},methods:{_onPickerClose:function(){this.showPicker.visible=!1,this.showPicker.mode="selector",this.showPicker.range=[],this.showPicker.value=0}}}}.call(this,n("0dd1"))},"763a":function(t,e,n){"use strict";var i=n("1067"),r=n.n(i);r.a},"77e0":function(t,e,n){"use strict";n.r(e),function(t,n){e["default"]={data:function(){return{showToast:{visible:!1}}},created:function(){var e=this,i="",r=function(t){return function(n){i=t,setTimeout(function(){e.showToast=n},10)}};t.on("onShowToast",r("onShowToast")),t.on("onShowLoading",r("onShowLoading"));var a=function(t){return function(){var r="";if("onHideToast"===t&&"onShowToast"!==i?r="请注意 showToast 与 hideToast 必须配对使用":"onHideLoading"===t&&"onShowLoading"!==i&&(r="请注意 showLoading 与 hideLoading 必须配对使用"),r)return n.warn(r);i="",setTimeout(function(){e.showToast.visible=!1},10)}};t.on("onHidePopup",a("onHidePopup")),t.on("onHideToast",a("onHideToast")),t.on("onHideLoading",a("onHideLoading"))}}}.call(this,n("0dd1"),n("3ad9")["default"])},"78c8":function(t,e,n){"use strict";n.r(e),n.d(e,"getSystemInfoSync",function(){return s}),n.d(e,"getSystemInfo",function(){return c});var i=n("a470"),r=navigator.userAgent,a=/android/i.test(r),o=/iphone|ipad|ipod/i.test(r);function s(){var t,e,n,s=window.innerWidth,c=window.innerHeight,u=window.screen,l=window.devicePixelRatio,h=u.width,d=u.height,f=navigator.language,p=0;if(o){t="iOS";var g=r.match(/OS\s([\w_]+)\slike/);g&&(e=g[1].replace(/_/g,"."));var m=r.match(/\(([a-zA-Z]+);/);m&&(n=m[1])}else if(a){t="Android";var v=r.match(/Android[\s\/]([\w\.]+)[;\s]/);v&&(e=v[1]);for(var b=r.match(/\((.+?)\)/),y=b?b[1].split(";"):r.split(" "),_=[/\bAndroid\b/i,/\bLinux\b/i,/\bU\b/i,/^\s?[a-z][a-z]$/i,/^\s?[a-z][a-z]-[a-z][a-z]$/i,/\bwv\b/i,/\/[\d\.,]+$/,/^\s?[\d\.,]+$/,/\bBrowser\b/i,/\bMobile\b/i],w=0;w0){n=S.split("Build")[0].trim();break}for(var k=void 0,T=0;T<_.length;T++)if(_[T].test(S)){k=!0;break}if(!k){n=S.trim();break}}}else t="Other",e="0";var x="".concat(t," ").concat(e),C=t.toLocaleLowerCase(),O=Object(i["a"])(),M=O.top,E=O.bottom;return c-=M,c-=E,{windowTop:M,windowBottom:E,windowWidth:s,windowHeight:c,pixelRatio:l,screenWidth:h,screenHeight:d,language:f,statusBarHeight:p,system:x,platform:C,model:n}}function c(){return s()}},"7bb3":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-checkbox",t._g({on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-checkbox-wrapper"},[n("div",{staticClass:"uni-checkbox-input",class:[t.checkboxChecked?"uni-checkbox-input-checked":""],style:{color:t.color}}),t._t("default")],2)])},r=[],a=n("8af1"),o={name:"Checkbox",mixins:[a["a"],a["c"]],props:{checked:{type:[Boolean,String],default:!1},id:{type:String,default:""},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#007aff"},value:{type:String,default:""}},data:function(){return{checkboxChecked:this.checked,checkboxValue:this.value}},watch:{checked:function(t){this.checkboxChecked=t},value:function(t){this.checkboxValue=t}},listeners:{"label-click":"_onClick","@label-click":"_onClick"},created:function(){this.$dispatch("CheckboxGroup","uni-checkbox-group-update",{type:"add",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("CheckboxGroup","uni-checkbox-group-update",{type:"remove",vm:this}),this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onClick:function(t){this.disabled||(this.checkboxChecked=!this.checkboxChecked,this.$dispatch("CheckboxGroup","uni-checkbox-change",t))},_resetFormData:function(){this.checkboxChecked=!1}}},s=o,c=(n("f53a"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"7c2b":function(t,e,n){"use strict";var i=n("6144"),r=n.n(i);r.a},"7d18":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"uploadFile",function(){return u});var i=n("e2e2");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n>2],a+=t[(3&i[n])<<4|i[n+1]>>4],a+=t[(15&i[n+1])<<2|i[n+2]>>6],a+=t[63&i[n+2]];return r%3===2?a=a.substring(0,a.length-1)+"=":r%3===1&&(a=a.substring(0,a.length-2)+"=="),a},e.decode=function(t){var e,i,r,a,o,s=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var l=new ArrayBuffer(s),h=new Uint8Array(l);for(e=0;e>4,h[u++]=(15&r)<<4|a>>2,h[u++]=(3&a)<<6|63&o;return l}})()},"83a6":function(t,e,n){"use strict";e["a"]={data:function(){return{hovering:!1}},props:{hoverClass:{type:String,default:"none"},hoverStopPropagation:{type:Boolean,default:!1},hoverStartTime:{type:Number,default:50},hoverStayTime:{type:Number,default:400}},methods:{_hoverTouchStart:function(t){var e=this;t._hoverPropagationStopped||this.hoverClass&&"none"!==this.hoverClass&&!this.disabled&&(t.touches.length>1||(this.hoverStopPropagation&&(t._hoverPropagationStopped=!0),this._hoverTouch=!0,this._hoverStartTimer=setTimeout(function(){e.hovering=!0,e._hoverTouch||e._hoverReset()},this.hoverStartTime)))},_hoverTouchEnd:function(t){this._hoverTouch=!1,this.hovering&&this._hoverReset()},_hoverReset:function(){var t=this;requestAnimationFrame(function(){clearTimeout(t._hoverStayTimer),t._hoverStayTimer=setTimeout(function(){t.hovering=!1},t.hoverStayTime)})},_hoverTouchCancel:function(t){this._hoverTouch=!1,this.hovering=!1,clearTimeout(this._hoverStartTimer)}}}},"84e0":function(t,e,n){"use strict";n.r(e),function(t){function i(e){var n=getCurrentPages();return n.length&&t.publishHandler("pageScrollTo",e,n[n.length-1].$page.id),{}}n.d(e,"pageScrollTo",function(){return i})}.call(this,n("0dd1"))},8542:function(t,e,n){"use strict";n.d(e,"a",function(){return v}),n.d(e,"d",function(){return b}),n.d(e,"e",function(){return k}),n.d(e,"b",function(){return x}),n.d(e,"c",function(){return C});var i=n("f2b3");function r(t){return s(t)||o(t)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function o(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{};return["success","fail","complete"].forEach(function(n){if(Array.isArray(t[n])){var r=e[n];e[n]=function(e){w(t[n],e).then(function(t){return Object(i["e"])(r)&&r(t)||t})}}}),e}function k(t,e){var n=[];Array.isArray(l.returnValue)&&n.push.apply(n,r(l.returnValue));var i=h[t];return i&&Array.isArray(i.returnValue)&&n.push.apply(n,r(i.returnValue)),n.forEach(function(t){e=t(e)||e}),e}function T(t){var e=Object.create(null);Object.keys(l).forEach(function(t){"returnValue"!==t&&(e[t]=l[t].slice())});var n=h[t];return n&&Object.keys(n).forEach(function(t){"returnValue"!==t&&(e[t]=(e[t]||[]).concat(n[t]))}),e}function x(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),a=3;a0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t[e])&&t[e].length}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=JSON.parse(JSON.stringify(t)),n=Object.keys(e),i=n.length;if(i)for(var r=0;re-n&&tthis._t&&(t=this._t,this._lastDt=t);var e=this._x_v*t+.5*this._x_a*Math.pow(t,2)+this._x_s,n=this._y_v*t+.5*this._y_a*Math.pow(t,2)+this._y_s;return(this._x_a>0&&ethis._endPositionX)&&(e=this._endPositionX),(this._y_a>0&&nthis._endPositionY)&&(n=this._endPositionY),{x:e,y:n}},u.prototype.ds=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),t>this._t&&(t=this._t),{dx:this._x_v+this._x_a*t,dy:this._y_v+this._y_a*t}},u.prototype.delta=function(){return{x:-1.5*Math.pow(this._x_v,2)/this._x_a||0,y:-1.5*Math.pow(this._y_v,2)/this._y_a||0}},u.prototype.dt=function(){return-this._x_v/this._x_a},u.prototype.done=function(){var t=o(this.s().x,this._endPositionX)||o(this.s().y,this._endPositionY)||this._lastDt===this._t;return this._lastDt=null,t},u.prototype.setEnd=function(t,e){this._endPositionX=t,this._endPositionY=e},u.prototype.reconfigure=function(t,e){this._m=t,this._f=1e3*e},l.prototype._solve=function(t,e){var n=this._c,i=this._m,r=this._k,a=n*n-4*i*r;if(0===a){var o=-n/(2*i),s=t,c=e/(o*t);return{x:function(t){return(s+c*t)*Math.pow(Math.E,o*t)},dx:function(t){var e=Math.pow(Math.E,o*t);return o*(s+c*t)*e+c*e}}}if(a>0){var u=(-n-Math.sqrt(a))/(2*i),l=(-n+Math.sqrt(a))/(2*i),h=(e-u*t)/(l-u),d=t-h;return{x:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*e+h*n},dx:function(t){var e,n;return t===this._t&&(e=this._powER1T,n=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,u*t)),n||(n=this._powER2T=Math.pow(Math.E,l*t)),d*u*e+h*l*n}}}var f=Math.sqrt(4*i*r-n*n)/(2*i),p=-n/2*i,g=t,m=(e-p*t)/f;return{x:function(t){return Math.pow(Math.E,p*t)*(g*Math.cos(f*t)+m*Math.sin(f*t))},dx:function(t){var e=Math.pow(Math.E,p*t),n=Math.cos(f*t),i=Math.sin(f*t);return e*(m*f*n-g*f*i)+p*e*(m*i+g*n)}}},l.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},l.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},l.prototype.setEnd=function(t,e,n){if(n||(n=(new Date).getTime()),t!==this._endPosition||!s(e,.1)){e=e||0;var i=this._endPosition;this._solution&&(s(e,.1)&&(e=this._solution.dx((n-this._startTime)/1e3)),i=this._solution.x((n-this._startTime)/1e3),s(e,.1)&&(e=0),s(i,.1)&&(i=0),i+=this._endPosition),this._solution&&s(i-t,.1)&&s(e,.1)||(this._endPosition=t,this._solution=this._solve(i-this._endPosition,e),this._startTime=n)}},l.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},l.prototype.done=function(t){return t||(t=(new Date).getTime()),o(this.x(),this._endPosition,.1)&&s(this.dx(),.1)},l.prototype.reconfigure=function(t,e,n){this._m=t,this._k=e,this._c=n,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},l.prototype.springConstant=function(){return this._k},l.prototype.damping=function(){return this._c},l.prototype.configuration=function(){function t(t,e){t.reconfigure(1,e,t.damping())}function e(t,e){t.reconfigure(1,t.springConstant(),e)}return[{label:"Spring Constant",read:this.springConstant.bind(this),write:t.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:e.bind(this,this),min:1,max:500}]},h.prototype.setEnd=function(t,e,n,i){var r=(new Date).getTime();this._springX.setEnd(t,i,r),this._springY.setEnd(e,i,r),this._springScale.setEnd(n,i,r),this._startTime=r},h.prototype.x=function(){var t=((new Date).getTime()-this._startTime)/1e3;return{x:this._springX.x(t),y:this._springY.x(t),scale:this._springScale.x(t)}},h.prototype.done=function(){var t=(new Date).getTime();return this._springX.done(t)&&this._springY.done(t)&&this._springScale.done(t)},h.prototype.reconfigure=function(t,e,n){this._springX.reconfigure(t,e,n),this._springY.reconfigure(t,e,n),this._springScale.reconfigure(t,e,n)};var d=!1;function f(t){d||(d=!0,requestAnimationFrame(function(){t(),d=!1}))}function p(t,e){if(t===e)return 0;var n=t.offsetLeft;return t.offsetParent?n+=p(t.offsetParent,e):0}function g(t,e){if(t===e)return 0;var n=t.offsetTop;return t.offsetParent?n+=g(t.offsetParent,e):0}function m(t,e){return+((1e3*t-1e3*e)/1e3).toFixed(1)}function v(t,e,n){var i=function(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)},r={id:0,cancelled:!1};function a(e,n,i,r){if(!e||!e.cancelled){i(n);var o=t.done();o||e.cancelled||(e.id=requestAnimationFrame(a.bind(null,e,n,i,r))),o&&r&&r(n)}}return a(r,t,e,n),{cancel:i.bind(null,r),model:t}}var b={name:"MovableView",mixins:[a["a"]],props:{direction:{type:String,default:"none"},inertia:{type:[Boolean,String],default:!1},outOfBounds:{type:[Boolean,String],default:!1},x:{type:[Number,String],default:0},y:{type:[Number,String],default:0},damping:{type:[Number,String],default:20},friction:{type:[Number,String],default:2},disabled:{type:[Boolean,String],default:!1},scale:{type:[Boolean,String],default:!1},scaleMin:{type:[Number,String],default:.5},scaleMax:{type:[Number,String],default:10},scaleValue:{type:[Number,String],default:1},animation:{type:[Boolean,String],default:!0}},data:function(){return{xSync:this._getPx(this.x),ySync:this._getPx(this.y),scaleValueSync:Number(this.scaleValue)||1,width:0,height:0,minX:0,minY:0,maxX:0,maxY:0}},computed:{dampingNumber:function(){var t=Number(this.damping);return isNaN(t)?20:t},frictionNumber:function(){var t=Number(this.friction);return isNaN(t)||t<=0?2:t},scaleMinNumber:function(){var t=Number(this.scaleMin);return isNaN(t)?.5:t},scaleMaxNumber:function(){var t=Number(this.scaleMax);return isNaN(t)?10:t},xMove:function(){return"all"===this.direction||"horizontal"===this.direction},yMove:function(){return"all"===this.direction||"vertical"===this.direction}},watch:{x:function(t){this.xSync=this._getPx(t)},xSync:function(t){this._setX(t)},y:function(t){this.ySync=this._getPx(t)},ySync:function(t){this._setY(t)},scaleValue:function(t){this.scaleValueSync=Number(t)||0},scaleValueSync:function(t){this._setScaleValue(t)},scaleMinNumber:function(){this._setScaleMinOrMax()},scaleMaxNumber:function(){this._setScaleMinOrMax()}},created:function(){this._offset={x:0,y:0},this._scaleOffset={x:0,y:0},this._translateX=0,this._translateY=0,this._scale=1,this._oldScale=1,this._STD=new h(1,9*Math.pow(this.dampingNumber,2)/40,this.dampingNumber),this._friction=new u(1,this.frictionNumber),this._declineX=new c,this._declineY=new c,this.__touchInfo={historyX:[0,0],historyY:[0,0],historyT:[0,0]}},mounted:function(){this.touchtrack(this.$el,"_onTrack"),this.setParent(),this._friction.reconfigure(1,this.frictionNumber),this._STD.reconfigure(1,9*Math.pow(this.dampingNumber,2)/40,this.dampingNumber),this.$el.style.transformOrigin="center"},methods:{_getPx:function(t){return/\d+[ur]px$/i.test(t)?uni.upx2px(parseFloat(t)):Number(t)||0},_setX:function(t){if(this.xMove){if(t+this._scaleOffset.x===this._translateX)return this._translateX;this._SFA&&this._SFA.cancel(),this._animationTo(t+this._scaleOffset.x,this.ySync+this._scaleOffset.y,this._scale)}return t},_setY:function(t){if(this.yMove){if(t+this._scaleOffset.y===this._translateY)return this._translateY;this._SFA&&this._SFA.cancel(),this._animationTo(this.xSync+this._scaleOffset.x,t+this._scaleOffset.y,this._scale)}return t},_setScaleMinOrMax:function(){if(!this.scale)return!1;this._updateScale(this._scale,!0),this._updateOldScale(this._scale)},_setScaleValue:function(t){return!!this.scale&&(t=this._adjustScale(t),this._updateScale(t,!0),this._updateOldScale(t),t)},__handleTouchStart:function(){this._isScaling||this.disabled||(this._FA&&this._FA.cancel(),this._SFA&&this._SFA.cancel(),this.__touchInfo.historyX=[0,0],this.__touchInfo.historyY=[0,0],this.__touchInfo.historyT=[0,0],this.xMove&&(this.__baseX=this._translateX),this.yMove&&(this.__baseY=this._translateY),this.$el.style.willChange="transform",this._checkCanMove=null,this._firstMoveDirection=null,this._isTouching=!0)},__handleTouchMove:function(t){var e=this;if(!this._isScaling&&!this.disabled&&this._isTouching){var n=this._translateX,i=this._translateY;if(null===this._firstMoveDirection&&(this._firstMoveDirection=Math.abs(t.detail.dx/t.detail.dy)>1?"htouchmove":"vtouchmove"),this.xMove&&(n=t.detail.dx+this.__baseX,this.__touchInfo.historyX.shift(),this.__touchInfo.historyX.push(n),this.yMove||!0!==this._checkCanMove&&(Math.abs(t.detail.dx/t.detail.dy)>1?this._checkCanMove=!1:this._checkCanMove=!0)),this.yMove&&(i=t.detail.dy+this.__baseY,this.__touchInfo.historyY.shift(),this.__touchInfo.historyY.push(i),this.xMove||!0!==this._checkCanMove&&(Math.abs(t.detail.dy/t.detail.dx)>1?this._checkCanMove=!1:this._checkCanMove=!0)),this.__touchInfo.historyT.shift(),this.__touchInfo.historyT.push(t.detail.timeStamp),!this._checkCanMove){t.preventDefault();var r="touch";nthis.maxX&&(this.outOfBounds?(r="touch-out-of-bounds",n=this.maxX+this._declineX.x(n-this.maxX)):n=this.maxX),ithis.maxY&&(this.outOfBounds?(r="touch-out-of-bounds",i=this.maxY+this._declineY.x(i-this.maxY)):i=this.maxY),f(function(){e._setTransform(n,i,e._scale,r)})}}},__handleTouchEnd:function(){var t=this;if(!this._isScaling&&!this.disabled&&this._isTouching&&(this.$el.style.willChange="auto",this._isTouching=!1,!this._checkCanMove&&!this._revise("out-of-bounds")&&this.inertia)){var e=1e3*(this.__touchInfo.historyX[1]-this.__touchInfo.historyX[0])/(this.__touchInfo.historyT[1]-this.__touchInfo.historyT[0]),n=1e3*(this.__touchInfo.historyY[1]-this.__touchInfo.historyY[0])/(this.__touchInfo.historyT[1]-this.__touchInfo.historyT[0]);this._friction.setV(e,n),this._friction.setS(this._translateX,this._translateY);var i=this._friction.delta().x,r=this._friction.delta().y,a=i+this._translateX,o=r+this._translateY;athis.maxX&&(a=this.maxX,o=this._translateY+(this.maxX-this._translateX)*r/i),othis.maxY&&(o=this.maxY,a=this._translateX+(this.maxY-this._translateY)*i/r),this._friction.setEnd(a,o),this._FA=v(this._friction,function(){var e=t._friction.s(),n=e.x,i=e.y;t._setTransform(n,i,t._scale,"friction")},function(){t._FA.cancel()})}},_onTrack:function(t){switch(t.detail.state){case"start":this.__handleTouchStart();break;case"move":this.__handleTouchMove(t);break;case"end":this.__handleTouchEnd()}},_getLimitXY:function(t,e){var n=!1;return t>this.maxX?(t=this.maxX,n=!0):tthis.maxY?(e=this.maxY,n=!0):e3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;null!==t&&"NaN"!==t.toString()&&"number"===typeof t||(t=this._translateX||0),null!==e&&"NaN"!==e.toString()&&"number"===typeof e||(e=this._translateY||0),t=Number(t.toFixed(1)),e=Number(e.toFixed(1)),n=Number(n.toFixed(1)),this._translateX===t&&this._translateY===e||r||this.$trigger("change",{},{x:m(t,this._scaleOffset.x),y:m(e,this._scaleOffset.y),source:i}),this.scale||(n=this._scale),n=this._adjustScale(n),n=+n.toFixed(3),a&&n!==this._scale&&this.$trigger("scale",{},{x:t,y:e,scale:n});var o="translateX("+t+"px) translateY("+e+"px) translateZ(0px) scale("+n+")";this.$el.style.transform=o,this.$el.style.webkitTransform=o,this._translateX=t,this._translateY=e,this._scale=n}}},y=b,_=(n("7c2b"),n("0c7c")),w=Object(_["a"])(y,i,r,!1,null,null,null);e["default"]=w.exports},"893e":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=this._webSocket;try{n.send(e),this._callback(t,"sendSocketMessage:ok")}catch(i){this._callback(t,"sendSocketMessage:fail ".concat(i))}}},{key:"close",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data,n=t.data,i=this._webSocket;try{i.close(e,n),this._callback(t,"sendSocketMessage:ok")}catch(r){this._callback(t,"sendSocketMessage:fail ".concat(r))}}},{key:"onOpen",value:function(t){this._on("open",t)}},{key:"onClose",value:function(t){this._on("close",t)}},{key:"onError",value:function(t){this._on("error",t)}},{key:"onMessage",value:function(t){this._on("message",t)}},{key:"_on",value:function(t,e){this._webSocket.addEventListener(t,function(n){"message"===t?e({data:n.data}):e()},!1)}},{key:"_callback",value:function(t,e){var n=t.success,i=t.fail,r=t.complete,a={errMsg:e};/:ok$/.test(e)?"function"===typeof n&&n(a):"function"===typeof i&&i(a),"function"===typeof r&&r(a)}}]),t}();function u(e,n){var i=e.url,r=e.protocols,a=t,o=a.invokeCallbackHandler;return s=new c(i,r),setTimeout(function(){o(n,{errMsg:"connectSocket:ok"})},0),s}function l(e,n){var i=t,r=i.invokeCallbackHandler;s&&s._webSocket.readyState===WebSocket.OPEN?s.send(Object.assign(e,{complete:function(t){r(n,t)}})):r(n,{errMsg:"sendSocketMessage:fail WebSocket is not connected "})}function h(e,n){var i=t,r=i.invokeCallbackHandler;s&&s._webSocket.readyState!==WebSocket.CLOSED?s.close(Object.assign(e,{complete:function(t){r(n,t)}})):r(n,{errMsg:"closeSocket:fail WebSocket is not connected"})}function d(e){var n=t,i=n.invokeCallbackHandler;return function(t){s&&s[e](function(e){i(t,e)})}}var f=d("onOpen"),p=d("onError"),g=d("onMessage"),m=d("onClose")}.call(this,n("0dd1"))},"8a36":function(t,e,n){"use strict";(function(t){var i=n("f2b3");e["a"]={props:{id:{type:String,default:""}},created:function(){var t=this;this._addListeners(this.id),this.$watch("id",function(e,n){t._removeListeners(n,!0),t._addListeners(e,!0)})},beforeDestroy:function(){this._removeListeners(this.id)},methods:{_addListeners:function(e,n){var r=this;if(!n||e){var a=this.$options.listeners;Object(i["f"])(a)&&Object.keys(a).forEach(function(i){n?0!==i.indexOf("@")&&0!==i.indexOf("uni-")&&t.on("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[a[i]]):0===i.indexOf("@")?r.$on("uni-".concat(i.substr(1)),r[a[i]]):0===i.indexOf("uni-")?t.on(i,r[a[i]]):e&&t.on("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[a[i]])})}},_removeListeners:function(e,n){var r=this;if(!n||e){var a=this.$options.listeners;Object(i["f"])(a)&&Object.keys(a).forEach(function(i){n?0!==i.indexOf("@")&&0!==i.indexOf("uni-")&&t.off("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[a[i]]):0===i.indexOf("@")?r.$off("uni-".concat(i.substr(1)),r[a[i]]):0===i.indexOf("uni-")?t.off(i,r[a[i]]):e&&t.off("uni-".concat(i,"-").concat(r.$page.id,"-").concat(e),r[a[i]])})}}}}}).call(this,n("501c"))},"8aec":function(t,e,n){"use strict";var i=n("5363"),r=n("72b3");function a(t,e,n){this._extent=t,this._friction=e||new i["a"](.01),this._spring=n||new r["a"](1,90,20),this._startTime=0,this._springing=!1,this._springOffset=0}function o(t,e,n){function i(t,e,n,r){if(!t||!t.cancelled){n(e);var a=e.done();a||t.cancelled||(t.id=requestAnimationFrame(i.bind(null,t,e,n,r))),a&&r&&r(e)}}function r(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)}var a={id:0,cancelled:!1};return i(a,t,e,n),{cancel:r.bind(null,a),model:t}}function s(t,e){e=e||{},this._element=t,this._options=e,this._enableSnap=e.enableSnap||!1,this._itemSize=e.itemSize||0,this._enableX=e.enableX||!1,this._enableY=e.enableY||!1,this._shouldDispatchScrollEvent=!!e.onScroll,this._enableX?(this._extent=(e.scrollWidth||this._element.offsetWidth)-this._element.parentElement.offsetWidth,this._scrollWidth=e.scrollWidth):(this._extent=(e.scrollHeight||this._element.offsetHeight)-this._element.parentElement.offsetHeight,this._scrollHeight=e.scrollHeight),this._position=0,this._scroll=new a(this._extent,e.friction,e.spring),this._onTransitionEnd=this.onTransitionEnd.bind(this),this.updatePosition()}a.prototype.snap=function(t,e){this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(e)},a.prototype.set=function(t,e){this._friction.set(t,e),t>0&&e>=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(0)):t<-this._extent&&e<=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(-this._extent)):this._springing=!1,this._startTime=(new Date).getTime()},a.prototype.x=function(t){if(!this._startTime)return 0;if(t||(t=((new Date).getTime()-this._startTime)/1e3),this._springing)return this._spring.x()+this._springOffset;var e=this._friction.x(t),n=this.dx(t);return(e>0&&n>=0||e<-this._extent&&n<=0)&&(this._springing=!0,this._spring.setEnd(0,n),e<-this._extent?this._springOffset=-this._extent:this._springOffset=0,e=this._spring.x()+this._springOffset),e},a.prototype.dx=function(t){var e=0;return e=this._lastTime===t?this._lastDx:this._springing?this._spring.dx(t):this._friction.dx(t),this._lastTime=t,this._lastDx=e,e},a.prototype.done=function(){return this._springing?this._spring.done():this._friction.done()},a.prototype.setVelocityByEnd=function(t){this._friction.setVelocityByEnd(t)},a.prototype.configuration=function(){var t=this._friction.configuration();return t.push.apply(t,this._spring.configuration()),t},s.prototype.onTouchStart=function(){this._startPosition=this._position,this._lastChangePos=this._startPosition,this._startPosition>0?this._startPosition/=.5:this._startPosition<-this._extent&&(this._startPosition=(this._startPosition+this._extent)/.5-this._extent),this._animation&&(this._animation.cancel(),this._scrolling=!1),this.updatePosition()},s.prototype.onTouchMove=function(t,e){var n=this._startPosition;this._enableX?n+=t:this._enableY&&(n+=e),n>0?n*=.5:n<-this._extent&&(n=.5*(n+this._extent)-this._extent),this._position=n,this.updatePosition(),this.dispatchScroll()},s.prototype.onTouchEnd=function(t,e,n){var i=this;if(this._enableSnap&&this._position>-this._extent&&this._position<0){if(this._enableY&&(Math.abs(e)this._itemSize/2?r-(this._itemSize-Math.abs(a)):r-a;s<=0&&s>=-this._extent&&this._scroll.setVelocityByEnd(s)}this._lastTime=Date.now(),this._lastDelay=0,this._scrolling=!0,this._lastChangePos=this._position,this._lastIdx=Math.floor(Math.abs(this._position/this._itemSize)),this._animation=o(this._scroll,function(){var t=Date.now(),e=(t-i._scroll._startTime)/1e3,n=i._scroll.x(e);i._position=n,i.updatePosition();var r=i._scroll.dx(e);i._shouldDispatchScrollEvent&&t-i._lastTime>i._lastDelay&&(i.dispatchScroll(),i._lastDelay=Math.abs(2e3/r),i._lastTime=t)},function(){i._enableSnap&&(s<=0&&s>=-i._extent&&(i._position=s,i.updatePosition()),"function"===typeof i._options.onSnap&&i._options.onSnap(Math.floor(Math.abs(i._position)/i._itemSize))),i._shouldDispatchScrollEvent&&i.dispatchScroll(),i._scrolling=!1})},s.prototype.onTransitionEnd=function(){this._element.style.transition="",this._element.style.webkitTransition="",this._element.removeEventListener("transitionend",this._onTransitionEnd),this._element.removeEventListener("webkitTransitionEnd",this._onTransitionEnd),this._snapping&&(this._snapping=!1),this.dispatchScroll()},s.prototype.snap=function(){var t=this._itemSize,e=this._position%t,n=Math.abs(e)>this._itemSize/2?this._position-(t-Math.abs(e)):this._position-e;this._position!==n&&(this._snapping=!0,this.scrollTo(-n),"function"===typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize)))},s.prototype.scrollTo=function(t,e){this._animation&&(this._animation.cancel(),this._scrolling=!1),"number"===typeof t&&(this._position=-t),this._position<-this._extent?this._position=-this._extent:this._position>0&&(this._position=0),this._element.style.transition="transform "+(e||.2)+"s ease-out",this._element.style.webkitTransition="-webkit-transform "+(e||.2)+"s ease-out",this.updatePosition(),this._element.addEventListener("transitionend",this._onTransitionEnd),this._element.addEventListener("webkitTransitionEnd",this._onTransitionEnd)},s.prototype.dispatchScroll=function(){if("function"===typeof this._options.onScroll&&Math.round(this._lastPos)!==Math.round(this._position)){this._lastPos=this._position;var t={target:{scrollLeft:this._enableX?-this._position:0,scrollTop:this._enableY?-this._position:0,scrollHeight:this._scrollHeight||this._element.offsetHeight,scrollWidth:this._scrollWidth||this._element.offsetWidth,offsetHeight:this._element.parentElement.offsetHeight,offsetWidth:this._element.parentElement.offsetWidth}};this._options.onScroll(t)}},s.prototype.update=function(t,e,n){var i=0,r=this._position;this._enableX?(i=this._element.childNodes.length?(e||this._element.offsetWidth)-this._element.parentElement.offsetWidth:0,this._scrollWidth=e):(i=this._element.childNodes.length?(e||this._element.offsetHeight)-this._element.parentElement.offsetHeight:0,this._scrollHeight=e),"number"===typeof t&&(this._position=-t),this._position<-i?this._position=-i:this._position>0&&(this._position=0),this._itemSize=n||this._itemSize,this.updatePosition(),r!==this._position&&(this.dispatchScroll(),"function"===typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize))),this._extent=i,this._scroll._extent=i},s.prototype.updatePosition=function(){var t="";this._enableX?t="translateX("+this._position+"px) translateZ(0)":this._enableY&&(t="translateY("+this._position+"px) translateZ(0)"),this._element.style.webkitTransform=t,this._element.style.transform=t},s.prototype.isScrolling=function(){return this._scrolling||this._snapping};e["a"]={methods:{initScroller:function(t,e){this._touchInfo={trackingID:-1,maxDy:0,maxDx:0},this._scroller=new s(t,e),this.__handleTouchStart=this._handleTouchStart.bind(this),this.__handleTouchMove=this._handleTouchMove.bind(this),this.__handleTouchEnd=this._handleTouchEnd.bind(this),this._initedScroller=!0},_findDelta:function(t){var e=this._touchInfo;return"move"===t.detail.state||"end"===t.detail.state?{x:t.detail.dx,y:t.detail.dy}:{x:t.screenX-e.x,y:t.screenY-e.y}},_handleTouchStart:function(t){var e=this._touchInfo,n=this._scroller;n&&("start"===t.detail.state?(e.trackingID="touch",e.x=t.detail.x,e.y=t.detail.y):(e.trackingID="mouse",e.x=t.screenX,e.y=t.screenY),e.maxDx=0,e.maxDy=0,e.historyX=[0],e.historyY=[0],e.historyTime=[t.detail.timeStamp],e.listener=n,n.onTouchStart&&n.onTouchStart())},_handleTouchMove:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var n=this._findDelta(t);if(n){for(e.maxDy=Math.max(e.maxDy,Math.abs(n.y)),e.maxDx=Math.max(e.maxDx,Math.abs(n.x)),e.historyX.push(n.x),e.historyY.push(n.y),e.historyTime.push(t.detail.timeStamp);e.historyTime.length>10;)e.historyTime.shift(),e.historyX.shift(),e.historyY.shift();e.listener&&e.listener.onTouchMove&&e.listener.onTouchMove(n.x,n.y,t.detail.timeStamp)}}},_handleTouchEnd:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var n=this._findDelta(t);if(n){var i=e.listener;e.trackingID=-1,e.listener=null;var r=e.historyTime.length,a={x:0,y:0};if(r>2)for(var o=e.historyTime.length-1,s=e.historyTime[o],c=e.historyX[o],u=e.historyY[o];o>0;){o--;var l=e.historyTime[o],h=s-l;if(h>30&&h<50){a.x=(c-e.historyX[o])/(h/1e3),a.y=(u-e.historyY[o])/(h/1e3);break}}e.historyTime=[],e.historyX=[],e.historyY=[],i&&i.onTouchEnd&&i.onTouchEnd(n.x,n.y,a)}}}}}},"8af1":function(t,e,n){"use strict";function i(t,e){for(var n=this.$children,r=n.length,a=arguments.length,o=new Array(a>2?a-2:0),s=2;s2?r-2:0),o=2;o2?n-2:0),a=2;a1&&void 0!==arguments[1]?arguments[1]:{};e.routes;Object(r["a"])(),t.prototype.$handleEvent=function(t){if(t instanceof Event){for(var e=t.target,n=this.$el;e&&e!==n;e=e.parentNode)if(e.tagName&&0===e.tagName.indexOf("UNI-"))break;t=r["b"].call(this,t.type,t,{},e||t.target,t.currentTarget)}return t},t.mixin({beforeCreate:function(){var t=this.$options;t.behaviors&&t.behaviors.length&&Object(a["a"])(t,this),Object(i["b"])(this)&&(t.mounted=t.mounted?[].concat(o,t.mounted):[o])}})}}}.call(this,n("501c"))},"8ce3":function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"chooseVideo",function(){return u});var i=n("e2e2"),r=n("f2b3"),a=t,o=a.invokeCallbackHandler,s=null,c=function(t){var e=document.createElement("input");return e.type="file",Object(r["j"])(e,{position:"absolute",visibility:"hidden","z-index":-999,width:0,height:0,top:0,left:0}),e.accept="video/*",1===t.sourceType.length&&"camera"===t.sourceType[0]&&(e.capture="camera"),e};function u(t,e){var n=t.sourceType;s&&(document.body.removeChild(s),s=null),s=c({sourceType:n}),document.body.appendChild(s),s.addEventListener("change",function(t){var n=t.target.files[0],r=Object(i["a"])(n),a={errMsg:"chooseVideo:ok",tempFilePath:r,size:n.size,duration:0,width:0,height:0},s=document.createElement("video");s.onloadedmetadata?(s.onloadedmetadata=function(){a.duration=s.duration||0,a.width=s.videoWidth||0,a.height=s.videoHeight||0,o(e,a)},s.src=r):o(e,a)}),s.click()}}.call(this,n("0dd1"))},"8e16":function(t,e,n){"use strict";var i=n("a1e3"),r=n.n(i);r.a},"8ecd":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return h});var i=n("f2b3"),r=n("85b6"),a=n("65a8"),o=n("33ed"),s=n("9fe6"),c=n("4c68"),u=!!i["h"]&&{passive:!1};function l(e){if(uni.canIUse("css.var")){var n=e.$parent.$parent,i=n.showNavigationBar&&"transparent"!==n.navigationBar.type?a["a"]+"px":"0px",r=getApp().$children[0].showTabBar?a["b"]+"px":"0px",o=document.documentElement.style;o.setProperty("--window-top",i),o.setProperty("--window-bottom",r),t.debug("".concat(e.$page.route,"[").concat(e.$page.id,"]:--window-top=").concat(i)),t.debug("".concat(e.$page.route,"[").concat(e.$page.id,"]:--window-bottom=").concat(r))}}function h(t){t("requestComponentInfo",s["a"]),t("pageScrollTo",o["c"]),t("requestComponentObserver",c["b"]),t("destroyComponentObserver",c["a"]);var e=!1,n=!1;t("onPageLoad",function(t){l(t)}),t("onPageShow",function(t){var a=t.$parent.$parent;t._isMounted&&l(t),n&&document.removeEventListener("touchmove",n,u),a.disableScroll&&(n=o["b"],document.addEventListener("touchmove",n,u));var s=Object(r["a"])(t.$options,"onPageScroll"),c=Object(r["a"])(t.$options,"onReachBottom"),h=a.onReachBottomDistance,d=Object(i["f"])(a.titleNView)&&"transparent"===a.titleNView.type;e&&document.removeEventListener("scroll",e),(d||s||c)&&(e=Object(o["a"])(t.$page.id,{enablePageScroll:s,enablePageReachBottom:c,onReachBottomDistance:h,enableTransparentTitleNView:d}),setTimeout(function(){document.addEventListener("scroll",e)},10))})}}).call(this,n("3ad9")["default"])},"8f7e":function(t,e,n){"use strict";n.r(e);var i=n("8bbf"),r=n.n(i),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-app",{class:{"uni-app--showtabbar":t.showTabBar}},[n("keep-alive",{attrs:{include:t.keepAliveInclude}},[n("router-view",{key:t.key})],1),t.hasTabBar?n("tab-bar",t._b({directives:[{name:"show",rawName:"v-show",value:t.showTabBar,expression:"showTabBar"}]},"tab-bar",t.tabBar,!1)):t._e(),n("toast",t._b({},"toast",t.showToast,!1)),n("action-sheet",t._b({on:{close:t._onActionSheetClose}},"action-sheet",t.showActionSheet,!1)),n("modal",t._b({on:{close:t._onModalClose}},"modal",t.showModal,!1)),n("picker",t._b({on:{close:t._onPickerClose}},"picker",t.showPicker,!1))],1)},o=[],s=n("4ec0"),c=s["a"],u=(n("854d"),n("0c7c")),l=Object(u["a"])(c,a,o,!1,null,null,null),h=l.exports,d=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page",{attrs:{"data-page":t.$route.meta.pagePath}},[t.showNavigationBar?n("page-head",t._b({},"page-head",t.navigationBar,!1)):t._e(),t.enablePullDownRefresh?n("page-refresh",{ref:"refresh",attrs:{color:t.refreshOptions.color,offset:t.refreshOptions.offset}}):t._e(),t.enablePullDownRefresh?n("page-body",{nativeOn:{touchstart:function(e){return t._touchstart(e)},touchmove:function(e){return t._touchmove(e)},touchend:function(e){return t._touchend(e)},touchcancel:function(e){return t._touchend(e)}}},[t._t("page")],2):n("page-body",[t._t("page")],2)],1)},f=[],p=n("85b6"),g=n("65a8"),m=n("24d9"),v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-head",{attrs:{"uni-page-head-type":t.type}},[n("div",{staticClass:"uni-page-head",class:{"uni-page-head-transparent":"transparent"===t.type},style:{transitionDuration:t.duration,transitionTimingFunction:t.timingFunc,backgroundColor:t.bgColor,color:t.textColor}},[n("div",{staticClass:"uni-page-head-hd"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.backButton,expression:"backButton"}],staticClass:"uni-page-head-btn",on:{click:t._back}},[n("i",{staticClass:"uni-btn-icon",style:{color:t.color,fontSize:"27px"}},[t._v("")])]),t._l(t.btns,function(e,i){return["left"===e.float?n("div",{key:i,staticClass:"uni-page-head-btn",class:{"uni-page-head-btn-red-dot":e.redDot||e.badgeText,"uni-page-head-btn-select":e.select},style:{backgroundColor:"transparent"===t.type?e.background:"transparent",width:e.width},attrs:{"badge-text":e.badgeText}},[n("i",{staticClass:"uni-btn-icon",style:t._formatBtnStyle(e),domProps:{innerHTML:t._s(t._formatBtnFontText(e))},on:{click:function(e){return t._onBtnClick(i)}}})]):t._e()]})],2),t.searchInput?t._e():n("div",{staticClass:"uni-page-head-bd"},[n("div",{staticClass:"uni-page-head__title",style:{fontSize:t.titleSize,opacity:"transparent"===t.type?0:1}},[t.loading?n("i",{staticClass:"uni-loading"}):t._e(),t._v("\n "+t._s(t.titleText)+"\n ")])]),t.searchInput?n("div",{staticClass:"uni-page-head-search",style:{"border-radius":t.searchInput.borderRadius,"background-color":t.searchInput.backgroundColor}},[n("div",{staticClass:"uni-page-head-search-placeholder",class:["uni-page-head-search-placeholder-"+(t.focus||t.text?"left":t.searchInput.align)],style:{color:t.searchInput.placeholderColor}},[t._v(t._s(t.text||t.composing?"":t.searchInput.placeholder))]),n("v-uni-input",{ref:"input",staticClass:"uni-page-head-search-input",style:{color:t.searchInput.color},attrs:{focus:t.searchInput.autoFocus,disabled:t.searchInput.disabled,"placeholder-style":"color:"+t.searchInput.placeholderColor,"confirm-type":"search"},on:{focus:t._focus,blur:t._blur,"update:value":t._input},model:{value:t.text,callback:function(e){t.text=e},expression:"text"}})],1):t._e(),n("div",{staticClass:"uni-page-head-ft"},[t._l(t.btns,function(e,i){return["left"!==e.float?n("div",{key:i,staticClass:"uni-page-head-btn",class:{"uni-page-head-btn-red-dot":e.redDot||e.badgeText,"uni-page-head-btn-select":e.select},style:{backgroundColor:"transparent"===t.type?e.background:"transparent",width:e.width},attrs:{"badge-text":e.badgeText}},[n("i",{staticClass:"uni-btn-icon",style:t._formatBtnStyle(e),domProps:{innerHTML:t._s(t._formatBtnFontText(e))},on:{click:function(e){return t._onBtnClick(i)}}})]):t._e()]})],2)]),"transparent"!==t.type?n("div",{staticClass:"uni-placeholder"}):t._e()])},b=[],y=n("adb0"),_=y["a"],w=(n("8e16"),Object(u["a"])(_,v,b,!1,null,null,null)),S=w.exports,k=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-wrapper",[n("uni-page-body",[t._t("default")],2)],1)},T=[],x={name:"PageBody"},C=x,O=(n("167a"),Object(u["a"])(C,k,T,!1,null,null,null)),M=O.exports,E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-page-refresh",[n("div",{staticClass:"uni-page-refresh",style:{"margin-top":t.offset+"px"}},[n("div",{staticClass:"uni-page-refresh-inner"},[n("svg",{staticClass:"uni-page-refresh__icon",attrs:{fill:t.color,width:"24",height:"24",viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}}),n("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})]),n("svg",{staticClass:"uni-page-refresh__spinner",attrs:{width:"24",height:"24",viewBox:"25 25 50 50"}},[n("circle",{staticClass:"uni-page-refresh__path",attrs:{stroke:t.color,cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"}})])])])])},A=[],$={name:"PageRefresh",props:{color:{type:String,default:"#2BD009"},offset:{type:Number,default:0}}},I=$,P=(n("9b5b"),Object(u["a"])(I,E,A,!1,null,null,null)),B=P.exports,j=n("be12"),L={name:"Page",mpType:"page",components:{PageHead:S,PageBody:M,PageRefresh:B},mixins:[j["a"]],props:{isQuit:{type:Boolean,default:!1},isEntry:{type:Boolean,default:!1},isTabBar:{type:Boolean,default:!1},tabBarIndex:{type:Number,default:-1},navigationBarBackgroundColor:{type:String,default:"#000"},navigationBarTextStyle:{default:"white",validator:function(t){return-1!==["white","black"].indexOf(t)}},navigationBarTitleText:{type:String,default:""},navigationStyle:{default:"default",validator:function(t){return-1!==["default","custom"].indexOf(t)}},backgroundColor:{type:String,default:"#ffffff"},backgroundTextStyle:{default:"dark",validator:function(t){return-1!==["dark","light"].indexOf(t)}},backgroundColorTop:{type:String,default:"#fff"},backgroundColorBottom:{type:String,default:"#fff"},enablePullDownRefresh:{type:Boolean,default:!1},onReachBottomDistance:{type:Number,default:50},disableScroll:{type:Boolean,default:!1},titleNView:{type:[Boolean,Object],default:!0},pullToRefresh:{type:Object,default:function(){return{}}}},data:function(){var t=Object(m["a"])({loading:!1,backButton:!this.isQuit&&!this.$route.meta.isQuit,backgroundColor:this.navigationBarBackgroundColor,textColor:"black"===this.navigationBarTextStyle?"#000":"#fff",titleText:this.navigationBarTitleText,duration:"0",timingFunc:""},this.titleNView),e="default"===this.navigationStyle&&this.titleNView,n=Object.assign({support:!0,color:"#2BD009",style:"circle",height:70,range:150,offset:0},this.pullToRefresh),i=Object(p["d"])(n.offset);return e&&(this.titleNView&&"transparent"===this.titleNView.type||(i+=g["a"])),n.offset=i,n.height=Object(p["d"])(n.height),n.range=Object(p["d"])(n.range),{showNavigationBar:e,navigationBar:t,refreshOptions:n}},created:function(){document.title=this.navigationBar.titleText}},N=L,D=(n("6226"),Object(u["a"])(N,d,f,!1,null,null,null)),z=D.exports,R=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-async-error",on:{click:t._onClick}},[t._v("\n 网络不给力,点击屏幕重试\n")])},F=[],q={name:"AsyncError",methods:{_onClick:function(){window.location.reload()}}},V=q,H=(n("b628"),Object(u["a"])(V,R,F,!1,null,null,null)),Y=H.exports,X=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},U=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-async-loading"},[n("i",{staticClass:"uni-loading"})])}],W={name:"AsyncLoading"},G=W,K=(n("5727"),Object(u["a"])(G,X,U,!1,null,null,null)),Q=K.exports,Z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-choose-location"},[n("system-header",{attrs:{confirm:!!t.data},on:{back:t._back,confirm:t._choose}},[t._v("选择位置")]),n("div",{staticClass:"map-content"},[n("iframe",{attrs:{src:t.src,allow:"geolocation",seamless:"",sandbox:"allow-scripts allow-same-origin allow-forms",frameborder:"0"}})])],1)},J=[],tt=n("580e"),et=tt["a"],nt=(n("9470"),Object(u["a"])(et,Z,J,!1,null,null,null)),it=nt.exports,rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-open-location"},[n("system-header",{on:{back:t._back}},[t._v("位置")]),n("div",{staticClass:"map-content"},[n("iframe",{ref:"map",attrs:{src:t.src,allow:"geolocation",sandbox:"allow-scripts allow-same-origin allow-forms allow-top-navigation allow-modals allow-popups",frameborder:"0"},on:{load:t._load}}),t.isPoimarkerSrc?n("div",{staticClass:"actTonav",on:{click:t._nav}}):t._e()])],1)},at=[],ot=n("bab8"),st=__uniConfig.qqMapKey,ct="uniapp",ut="https://apis.map.qq.com/tools/poimarker",lt={name:"SystemOpenLocation",components:{SystemHeader:ot["a"]},data:function(){var t=this.$route.query,e=t.latitude,n=t.longitude,i=t.scale,r=t.name,a=t.address;return{latitude:e,longitude:n,scale:i,name:r,address:a,src:"",isPoimarkerSrc:!1}},mounted:function(){this.latitude&&this.longitude&&(this.src="".concat(ut,"?type=0&marker=coord:").concat(this.latitude,",").concat(this.longitude,";title:").concat(this.name,";addr:").concat(this.address,";&key=").concat(st,"&referer=").concat(ct))},methods:{_back:function(){0!==this.$refs.map.src.indexOf(ut)?this.$refs.map.src=this.src:getApp().$router.back()},_load:function(){0===this.$refs.map.src.indexOf(ut)?this.isPoimarkerSrc=!0:this.isPoimarkerSrc=!1},_nav:function(){var t="https://apis.map.qq.com/uri/v1/routeplan?type=drive&to=".concat(encodeURIComponent(this.name),"&tocoord=").concat(this.latitude,",").concat(this.longitude,"&referer=").concat(ct);this.$refs.map.src=t}}},ht=lt,dt=(n("3da9"),Object(u["a"])(ht,rt,at,!1,null,null,null)),ft=dt.exports,pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"uni-system-preview-image",on:{click:t._click}},[n("v-uni-swiper",{staticClass:"uni-swiper",attrs:{current:t.index,"indicator-dots":!1,autoplay:!1},on:{"update:current":function(e){t.index=e}}},t._l(t.urls,function(t,e){return n("v-uni-swiper-item",{key:e},[n("img",{staticClass:"uni-preview-image",attrs:{src:t}})])}),1)],1)},gt=[],mt={name:"SystemPreviewImage",data:function(){var t=this.$route.params,e=t.urls,n=t.current;return{urls:e||[],current:n,index:0}},created:function(){var t="number"===typeof this.current?this.current:this.urls.indexOf(this.current);this.index=t<0?0:t},methods:{_click:function(){getApp().$router.back()}}},vt=mt,bt=(n("f10e"),Object(u["a"])(vt,pt,gt,!1,null,null,null)),yt=bt.exports;r.a.component(h.name,h),r.a.component(z.name,z),r.a.component(Y.name,Y),r.a.component(Q.name,Q),r.a.component(it.name,it),r.a.component(ft.name,ft),r.a.component(yt.name,yt)},"8ffa":function(t,e,n){},9040:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"createIntersectionObserver",function(){return d});var i=n("8bbf"),r=n.n(i),a=n("62b5");function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.options.rootMargin=["top","right","bottom","left"].map(function(e){return"".concat(Number(t[e])||0,"px")}).join(" ")}},{key:"relativeTo",value:function(t,e){return this.options.relativeToSelector=t,this._makeRootMargin(e),this}},{key:"relativeToViewport",value:function(t){return this.options.relativeToSelector=null,this._makeRootMargin(t),this}},{key:"observe",value:function(e,n){"function"===typeof n&&(this.options.selector=e,this.reqId=u.push(n),t.publishHandler("requestComponentObserver",{reqId:this.reqId,options:this.options},this.pageId))}},{key:"disconnect",value:function(){t.publishHandler("destroyComponentObserver",{reqId:this.reqId},this.pageId)}}]),e}();function d(e,n){if(e instanceof r.a||(n=e,e=null),e)return new h(e.$page.id,n);var i=getApp();if(i.$route&&i.$route.params.__id__)return new h(i.$route.params.__id__,n);t.emit("onError","createIntersectionObserver:fail")}}.call(this,n("0dd1"))},"90c9":function(t,e,n){},"91b0":function(t,e,n){},"91ce":function(t,e,n){},9213:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-swiper-item",t._g({},t.$listeners),[t._t("default")],2)},r=[],a={name:"SwiperItem",props:{itemId:{type:String,default:""}},mounted:function(){var t=this.$el;t.style.position="absolute",t.style.width="100%",t.style.height="100%";var e=this.$vnode._callbacks;e&&e.forEach(function(t){t()})}},o=a,s=(n("bfea"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},"924c":function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n100&&(t=100),t}},watch:{realPercent:function(t,e){this.strokeTimer&&clearInterval(this.strokeTimer),this.lastPercent=e||0,this._activeAnimation()}},created:function(){this._activeAnimation()},methods:{_activeAnimation:function(){var t=this;this.active?(this.currentPercent=this.activeMode===a.activeMode?0:this.lastPercent,this.strokeTimer=setInterval(function(){t.currentPercent+1>t.realPercent?(t.currentPercent=t.realPercent,t.strokeTimer&&clearInterval(t.strokeTimer)):t.currentPercent+=1},30)):this.currentPercent=this.realPercent}}},s=o,c=(n("944e"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},"9b5b":function(t,e,n){"use strict";var i=n("f8d2"),r=n.n(i);r.a},"9e56":function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=e.urls,r=e.current,a=t,o=a.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/preview-image",params:{urls:i,current:r}},function(){o(n,{errMsg:"previewImage:ok"})},function(){o(n,{errMsg:"previewImage:fail"})})}n.d(e,"previewImage",function(){return i})}.call(this,n("0dd1"))},"9f96":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-slider",t._g({ref:"uni-slider",on:{click:t._onClick}},t.$listeners),[n("div",{staticClass:"uni-slider-wrapper"},[n("div",{staticClass:"uni-slider-tap-area"},[n("div",{staticClass:"uni-slider-handle-wrapper",style:t.setBgColor},[n("div",{ref:"uni-slider-handle",staticClass:"uni-slider-handle",style:t.setBlockBg}),n("div",{staticClass:"uni-slider-thumb",style:t.setBlockStyle}),n("div",{staticClass:"uni-slider-track",style:t.setActiveColor})])]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.showValue,expression:"showValue"}],staticClass:"uni-slider-value"},[t._v(t._s(t.sliderValue))])]),t._t("default")],2)},r=[],a=n("8af1"),o=n("ba15"),s={name:"Slider",mixins:[a["a"],a["c"],o["a"]],props:{name:{type:String,default:""},min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},value:{type:[Number,String],default:0},step:{type:[Number,String],default:1},disabled:{type:[Boolean,String],default:!1},color:{type:String,default:"#e9e9e9"},backgroundColor:{type:String,default:"#e9e9e9"},activeColor:{type:String,default:"#007aff"},selectedColor:{type:String,default:"#007aff"},blockColor:{type:String,default:"#ffffff"},blockSize:{type:[Number,String],default:28},showValue:{type:[Boolean,String],default:!1}},data:function(){return{sliderValue:Number(this.value)}},computed:{setBlockStyle:function(){return{width:this.blockSize+"px",height:this.blockSize+"px",marginLeft:-this.blockSize/2+"px",marginTop:-this.blockSize/2+"px",left:this._getValueWidth(),backgroundColor:this.blockColor}},setBgColor:function(){return{backgroundColor:this._getBgColor()}},setBlockBg:function(){return{left:this._getValueWidth()}},setActiveColor:function(){return{backgroundColor:this._getActiveColor(),width:this._getValueWidth()}}},watch:{value:function(t){this.sliderValue=Number(t)}},mounted:function(){this.touchtrack(this.$refs["uni-slider-handle"],"_onTrack")},created:function(){this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},methods:{_onUserChangedValue:function(t){var e=this.$refs["uni-slider"],n=e.offsetWidth,i=e.getBoundingClientRect().left,r=(t.x-i)*(this.max-this.min)/n+Number(this.min);this.sliderValue=this._filterValue(r)},_filterValue:function(t){return tthis.max?this.max:Math.round((t-this.min)/this.step)*this.step+Number(this.min)},_getValueWidth:function(){return 100*(this.sliderValue-this.min)/(this.max-this.min)+"%"},_getBgColor:function(){return"#e9e9e9"!==this.backgroundColor?this.backgroundColor:"#007aff"!==this.color?this.color:"#007aff"},_getActiveColor:function(){return"#007aff"!==this.activeColor?this.activeColor:"#e9e9e9"!==this.selectedColor?this.selectedColor:"#e9e9e9"},_onTrack:function(t){if(!this.disabled)return"move"===t.detail.state?(this._onUserChangedValue({x:t.detail.x0}),this.$trigger("changing",t,{value:this.sliderValue}),!1):void("end"===t.detail.state&&this.$trigger("change",t,{value:this.sliderValue}))},_onClick:function(t){this.disabled||(this._onUserChangedValue(t),this.$trigger("change",t,{value:this.sliderValue}))},_resetFormData:function(){this.sliderValue=this.min},_getFormData:function(){var t={};return""!==this.name&&(t["value"]=this.sliderValue,t["key"]=this.name),t}}},c=s,u=(n("6428"),n("0c7c")),l=Object(u["a"])(c,i,r,!1,null,null,null);e["default"]=l.exports},"9fe6":function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return c});var i=n("85b6"),r=n("a470");function a(t){var e={};return t.id&&(e.id=""),t.dataset&&(e.dataset={}),t.rect&&(e.left=0,e.right=0,e.top=0,e.bottom=0),t.size&&(e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight),t.scrollOffset&&(e.scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft||0,e.scrollTop=document.documentElement.scrollTop||document.body.scrollTop||0),e}function o(t,e){var n={},a=Object(r["a"])(),o=a.top;if(e.id&&(n.id=t.id),e.dataset&&(n.dataset=Object(i["c"])(t.dataset||{})),e.rect||e.size){var s=t.getBoundingClientRect();e.rect&&(n.left=s.left,n.right=s.right,n.top=s.top-o,n.bottom=s.bottom),e.size&&(n.width=s.width,n.height=s.height)}return e.properties&&e.properties.forEach(function(t){t=t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}),e.scrollOffset&&("UNI-SCROLL-VIEW"===t.tagName&&t.__vue__&&t.__vue__.getScrollPosition?Object.assign(n,t.__vue__.getScrollPosition()):(n.scrollLeft=0,n.scrollTop=0)),n}function s(t,e,n,i,r){var a=e&&e.$el||t.$el;if(i){var s=a&&(a.matches(n)?a:a.querySelector(n));return s?o(s,r):null}if(a){var c=[],u=a.querySelectorAll(n);return u&&u.length&&(c=[].map.call(u,function(t){return o(t,r)})),a.matches(n)&&c.unshift(a),c}return[]}function c(e,n){var i=e.reqId,r=e.reqs,o=getCurrentPages(),c=o.find(function(t){return t.$page.id===n});if(!c)throw new Error("Not Found:Page[".concat(n,"]"));var u=[];r.forEach(function(t){var e=t.component,n=t.selector,i=t.single,r=t.fields;0===e?u.push(a(r)):u.push(s(c,e,n,i,r))}),t.publishHandler("onRequestComponentInfo",{reqId:i,res:u},c.$page.id)}}).call(this,n("501c"))},"9fef":function(t,e,n){"use strict";n.r(e),n.d(e,"createAudioContext",function(){return r}),n.d(e,"createVideoContext",function(){return a}),n.d(e,"createMapContext",function(){return o}),n.d(e,"createCanvasContext",function(){return s});var i=[{name:"id",type:String,required:!0}],r=i,a=i,o=i,s=[{name:"canvasId",type:String,required:!0},{name:"componentInstance",type:Object}]},a041:function(t,e,n){"use strict";function i(t){return function(e,n){e&&(n[t]=Math.round(e))}}n.r(e),n.d(e,"canvasGetImageData",function(){return r}),n.d(e,"canvasPutImageData",function(){return a}),n.d(e,"canvasToTempFilePath",function(){return s}),n.d(e,"drawCanvas",function(){return c});var r={canvasId:{type:String,required:!0},x:{type:Number,required:!0,validator:i("x")},y:{type:Number,required:!0,validator:i("y")},width:{type:Number,required:!0,validator:i("width")},height:{type:Number,required:!0,validator:i("height")}},a={canvasId:{type:String,required:!0},data:{type:Uint8ClampedArray,required:!0},x:{type:Number,required:!0,validator:i("x")},y:{type:Number,required:!0,validator:i("y")},width:{type:Number,required:!0,validator:i("width")},height:{type:Number,validator:i("height")}},o={PNG:"png",JPG:"jpeg"},s={x:{type:Number,default:0,validator:i("x")},y:{type:Number,default:0,validator:i("y")},width:{type:Number,validator:i("width")},height:{type:Number,validator:i("height")},destWidth:{type:Number,validator:i("destWidth")},destHeight:{type:Number,validator:i("destHeight")},canvasId:{type:String,require:!0},fileType:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.fileType=t in o?o[t]:o.PNG}},quality:{type:Number,validator:function(t,e){t=Math.floor(t),e.quality=t>0&&t<1?t:1}}},c={canvasId:{type:String,require:!0},actions:{type:Array,require:!0},reserve:{type:Boolean,default:!1}}},a118:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return r}),n.d(e,"b",function(){return a}),n.d(e,"c",function(){return o});var i=n("3b67");function r(){var e;return(e=t).invokeCallbackHandler.apply(e,arguments)}function a(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r\n/,"").replace(/\n/,"").replace(/\n/,"")}function a(t){return t.reduce(function(t,e){var n=e.value,i=e.name;return n.match(/ /)&&"style"!==i&&(n=n.split(" ")),t[i]?Array.isArray(t[i])?t[i].push(n):t[i]=[t[i],n]:t[i]=n,t},{})}function o(e){e=r(e);var n=[],o={node:"root",children:[]};return Object(i["a"])(e,{start:function(t,e,i){var r={name:t};if(0!==e.length&&(r.attrs=a(e)),i){var s=n[0]||o;s.children||(s.children=[]),s.children.push(r)}else n.unshift(r)},end:function(e){var i=n.shift();if(i.name!==e&&t.error("invalid state: mismatch end tag"),0===n.length)o.children.push(i);else{var r=n[0];r.children||(r.children=[]),r.children.push(i)}},chars:function(t){var e={type:"text",text:t};if(0===n.length)o.children.push(e);else{var i=n[0];i.children||(i.children=[]),i.children.push(e)}},comment:function(t){var e={node:"comment",text:t},i=n[0];i.children||(i.children=[]),i.children.push(e)}}),o.children}}).call(this,n("3ad9")["default"])},b34d:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-form",t._g({},t.$listeners),[n("span",[t._t("default")],2)])},r=[],a=n("8af1"),o={name:"Form",mixins:[a["c"]],data:function(){return{childrenList:[]}},listeners:{"@form-submit":"_onSubmit","@form-reset":"_onReset","@form-group-update":"_formGroupUpdateHandler"},methods:{_onSubmit:function(t){var e={};this.childrenList.forEach(function(t){t._getFormData&&t._getFormData().key&&(e[t._getFormData().key]=t._getFormData().value)}),this.$trigger("submit",t,{value:e})},_onReset:function(t){this.$trigger("reset",t,{}),this.childrenList.forEach(function(t){t._resetFormData&&t._resetFormData()})},_formGroupUpdateHandler:function(t){if("add"===t.type)this.childrenList.push(t.vm);else{var e=this.childrenList.indexOf(t.vm);this.childrenList.splice(e,1)}}}},s=o,c=n("0c7c"),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},b628:function(t,e,n){"use strict";var i=n("bde3"),r=n.n(i);r.a},b705:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-rich-text",t._g({},t.$listeners),[n("div")])},r=[],a=n("b10a"),o=n("f2b3"),s={a:"",abbr:"",b:"",blockquote:"",br:"",code:"",col:["span","width"],colgroup:["span","width"],dd:"",del:"",div:"",dl:"",dt:"",em:"",fieldset:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:"",hr:"",i:"",img:["alt","src","height","width"],ins:"",label:"",legend:"",li:"",ol:["start","type"],p:"",q:"",span:"",strong:"",sub:"",sup:"",table:["width"],tbody:"",td:["colspan","rowspan","height","width"],tfoot:"",th:["colspan","rowspan","height","width"],thead:"",tr:"",ul:""},c={amp:"&",gt:">",lt:"<",nbsp:" ",quot:'"',apos:"'"};function u(t){return t.replace(/&(([a-zA-Z]+)|(#x{0,1}[\da-zA-Z]+));/gi,function(t,e){if(Object(o["c"])(c,e)&&c[e])return c[e];if(/^#[0-9]{1,4}$/.test(e))return String.fromCharCode(e.slice(1));if(/^#x[0-9a-f]{1,4}$/i.test(e))return String.fromCharCode("0"+e.slice(1));var n=document.createElement("div");return n.innerHTML=t,n.innerText||n.textContent})}function l(t,e){return t.forEach(function(t){if(Object(o["f"])(t))if(Object(o["c"])(t,"type")&&"node"!==t.type)"text"===t.type&&"string"===typeof t.text&&""!==t.text&&e.appendChild(document.createTextNode(u(t.text)));else{if("string"!==typeof t.name||!t.name)return;var n=t.name.toLowerCase();if(!Object(o["c"])(s,n))return;var i=document.createElement(n);if(!i)return;var r=t.attrs;if(Object(o["f"])(r)){var a=s[n]||[];Object.keys(r).forEach(function(t){var e=r[t];switch(t){case"class":case"style":i.setAttribute(t,e);break;default:-1!==a.indexOf(t)&&i.setAttribute(t,e)}})}var c=t.children;Array.isArray(c)&&c.length&&l(t.children,i),e.appendChild(i)}}),e}var h={name:"RichText",props:{nodes:{type:[Array,String],default:function(){return[]}}},watch:{nodes:function(t){this._renderNodes(t)}},mounted:function(){this._renderNodes(this.nodes)},methods:{_renderNodes:function(t){"string"===typeof t&&(t=Object(a["a"])(t));var e=l(t,document.createDocumentFragment());this.$el.firstChild.innerHTML="",this.$el.firstChild.appendChild(e)}}},d=h,f=n("0c7c"),p=Object(f["a"])(d,i,r,!1,null,null,null);e["default"]=p.exports},b865:function(t,e,n){"use strict";(function(t){function i(e,n,i){t.UniViewJSBridge.subscribeHandler(e,n,i)}n.d(e,"a",function(){return i})}).call(this,n("24aa"))},b866:function(t,e,n){"use strict";n.r(e),n.d(e,"getImageInfo",function(){return r});var i=n("cb0f"),r={src:{type:String,required:!0,validator:function(t,e){e.src=Object(i["a"])(t)}}}},ba15:function(t,e,n){"use strict";var i=function(t,e,n,i){t.addEventListener(e,function(t){"function"===typeof n&&!1===n(t)&&(t.preventDefault(),t.stopPropagation())},{passive:!1})};e["a"]={methods:{touchtrack:function(t,e,n){var r=this,a=0,o=0,s=0,c=0,u=function(t,n,i,u){if(!1===r[e]({target:t.target,currentTarget:t.currentTarget,preventDefault:t.preventDefault.bind(t),stopPropagation:t.stopPropagation.bind(t),touches:t.touches,changedTouches:t.changedTouches,detail:{state:n,x0:i,y0:u,dx:i-a,dy:u-o,ddx:i-s,ddy:u-c,timeStamp:t.timeStamp}}))return!1},l=null;i(t,"touchstart",function(t){if(1===t.touches.length&&!l)return l=t,a=s=t.touches[0].pageX,o=c=t.touches[0].pageY,u(t,"start",a,o)}),i(t,"touchmove",function(t){if(1===t.touches.length&&l){var e=u(t,"move",t.touches[0].pageX,t.touches[0].pageY);return s=t.touches[0].pageX,c=t.touches[0].pageY,e}}),i(t,"touchend",function(t){if(0===t.touches.length&&l)return l=null,u(t,"end",t.changedTouches[0].pageX,t.changedTouches[0].pageY)}),i(t,"touchcancel",function(t){if(l){var e=l;return l=null,u(t,n?"cancel":"end",e.touches[0].pageX,e.touches[0].pageY)}})}}}},bab8:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"system-header"},[n("div",{staticClass:"header-text"},[t._t("default")],2),n("div",{staticClass:"header-btn header-back uni-btn-icon header-btn-icon",on:{click:t._back}},[t._v("")]),t.confirm?n("div",{staticClass:"header-btn header-confirm",on:{click:t._confirm}},[n("svg",{staticClass:"header-btn-img",attrs:{width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M939.6960642844446 226.08613831111114c-14.635971697777777-13.725872355555557-37.719236835555556-13.070208568888889-51.445109191111115 1.6029502577777779L402.69993870222225 744.6571451733333 137.46159843555557 483.31364238222227c-14.344349013333334-14.12709944888889-37.392384-13.98030904888889-51.51948344888889 0.3640399644444444-14.12709944888889 14.30911886222222-13.945078897777778 37.392384 0.40122709333333334 51.482296319999996l291.8171704888889 287.48392106666665c0.10960327111111111 0.10960327111111111 0.2544366933333333 0.1448334222222222 0.3640399644444444 0.2544366933333333s0.1448334222222222 0.2544366933333333 0.2544366933333333 0.3640399644444444c2.293843057777778 2.1842397866666667 5.061329351111111 3.4231500799999997 7.719212373333333 4.879309937777777 1.3113264355555554 0.7652670577777777 2.43867648 1.8926159644444445 3.822419057777778 2.43867648 4.2960634311111106 1.6753664 8.846562417777779 2.548279751111111 13.361832391111111 2.548279751111111 4.769706666666666 0 9.539412195555554-0.9472864711111111 13.98030904888889-2.839903573333333 1.4933469866666664-0.6184766577777778 2.6578830222222223-1.8926159644444445 4.0416267377777775-2.6950701511111115 2.7302991644444448-1.6029502577777779 5.5702027377777785-2.9495068444444446 7.901232924444444-5.315766044444445 0.10960327111111111-0.10960327111111111 0.1448334222222222-0.2916238222222222 0.2544366933333333-0.40122709333333334 0.07241614222222222-0.10960327111111111 0.21920654222222222-0.1448334222222222 0.3268528355555555-0.2544366933333333L941.2579134577779 277.5273335466667C955.0953460622222 262.9305059555556 954.3320359822221 239.8844279466666 939.6960642844446 226.08613831111114z"}})])]):t._e()])},r=[],a={name:"SystemHeader",props:{confirm:{type:Boolean,default:!1}},created:function(){document.title=this.$slots.default[0].text},methods:{_back:function(){this.$emit("back")},_confirm:function(){this.$emit("confirm")}}},o=a,s=(n("0a32"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["a"]=c.exports},bacd:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-canvas",t._g({attrs:{"canvas-id":t.canvasId,"disable-scroll":t.disableScroll}},t._listeners),[n("canvas",{ref:"canvas",attrs:{width:"300",height:"150"}}),n("div",{staticStyle:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden"}},[t._t("default")],2),n("v-uni-resize-sensor",{ref:"sensor",on:{resize:t._resize}})],1)},r=[],a=n("dc5e"),o=a["a"],s=(n("0741"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},bdb1:function(t,e,n){var i={"./base/base64.js":"1ca3","./base/can-i-use.js":"3648","./base/interceptor.js":"2eae","./base/upx2px.js":"45d2","./network/request.js":"82c2","./storage/storage.js":"484e","./ui/page-scroll-to.js":"84e0"};function r(t){var e=a(t);return n(e)}function a(t){var e=i[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}r.keys=function(){return Object.keys(i)},r.resolve=a,t.exports=r,r.id="bdb1"},bde3:function(t,e,n){},be12:function(t,e,n){"use strict";(function(t){function n(t,e,n){var i=Array.prototype.slice.call(t.changedTouches).filter(function(t){return t.identifier===e})[0];return!!i&&(t.deltaY=i.pageY-n,!0)}var i="pulling",r="reached",a="aborting",o="refreshing",s="restoring";e["a"]={mounted:function(){var e=this;this.enablePullDownRefresh&&(this.refreshContainerElem=this.$refs.refresh.$el,this.refreshControllerElem=this.refreshContainerElem.querySelector(".uni-page-refresh"),this.refreshInnerElemStyle=this.refreshControllerElem.querySelector(".uni-page-refresh-inner").style,t.on(this.$route.params.__id__+".startPullDownRefresh",function(){e.state||(e.state=o,e._addClass(),setTimeout(function(){e._refreshing()},50))}),t.on(this.$route.params.__id__+".stopPullDownRefresh",function(){e.state===o&&(e._removeClass(),e.state=s,e._addClass(),e._restoring(function(){e._removeClass(),e.state=e.distance=e.offset=null}))}))},methods:{_touchstart:function(t){var e=t.changedTouches[0];this.touchId=e.identifier,this.startY=e.pageY,[a,o,s].indexOf(this.state)>=0?this.canRefresh=!1:this.canRefresh=!0},_touchmove:function(t){if(this.canRefresh&&n(t,this.touchId,this.startY)){var e=t.deltaY;if(0===(document.documentElement.scrollTop||document.body.scrollTop)){if(!(e<0)||this.state){t.preventDefault(),null==this.distance&&(this.offset=e,this.state=i,this._addClass()),e-=this.offset,e<0&&(e=0),this.distance=e;var a=e>=this.refreshOptions.range&&this.state!==r,o=e1?i=1:i*=i*i;var r=Math.round(t/(this.refreshOptions.range/this.refreshOptions.height)),a=r?"translate3d(-50%, "+r+"px, 0)":0;n.webkitTransform=a,n.clip="rect("+(45-r)+"px,45px,45px,-5px)",this.refreshInnerElemStyle.webkitTransform="rotate("+360*i+"deg)"}},_aborting:function(t){var e=this.refreshControllerElem;if(e){var n=e.style;if(n.webkitTransform){n.webkitTransition="-webkit-transform 0.3s",n.webkitTransform="translate3d(-50%, 0, 0)";var i=function i(){r&&clearTimeout(r),e.removeEventListener("webkitTransitionEnd",i),n.webkitTransition="",t()};e.addEventListener("webkitTransitionEnd",i);var r=setTimeout(i,350)}else t()}},_refreshing:function(){var e=this.refreshControllerElem;if(e){var n=e.style;n.webkitTransition="-webkit-transform 0.2s",n.webkitTransform="translate3d(-50%, "+this.refreshOptions.height+"px, 0)",t.emit("onPullDownRefresh",{},this.$route.params.__id__)}},_restoring:function(t){var e=this.refreshControllerElem;if(e){var n=e.style;n.webkitTransition="-webkit-transform 0.3s",n.webkitTransform+=" scale(0.01)";var i=function i(){r&&clearTimeout(r),e.removeEventListener("webkitTransitionEnd",i),n.webkitTransition="",n.webkitTransform="translate3d(-50%, 0, 0)",t()};e.addEventListener("webkitTransitionEnd",i);var r=setTimeout(i,350)}}}}}).call(this,n("0dd1"))},be14:function(t,e,n){"use strict";n.r(e),function(t){function i(e,n){var i=t,r=i.invokeCallbackHandler;getApp().$router.push({type:"navigateTo",path:"/choose-location"},function(){var e=function e(i){t.unsubscribe("onChooseLocation",e),r(n,i?Object.assign(i,{errMsg:"chooseLocation:ok"}):{errMsg:"chooseLocation:fail"})};t.subscribe("onChooseLocation",e)},function(){r(n,{errMsg:"chooseLocation:fail"})})}n.d(e,"chooseLocation",function(){return i})}.call(this,n("0dd1"))},bfea:function(t,e,n){"use strict";var i=n("1360"),r=n.n(i);r.a},c312:function(t,e,n){},c33f:function(t,e,n){"use strict";var i=n("74ce"),r=n.n(i);r.a},c35d:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-picker",{on:{click:function(e){return e.stopPropagation(),t._click(e)}}},[n("div",[t._t("default")],2)])},r=[],a=n("f11c"),o=a["a"],s=(n("6f00"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},c41f:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-cover-view",t._g({attrs:{"scroll-top":t.scrollTop}},t.$listeners),[n("div",{ref:"content",staticClass:"uni-cover-view"},[t._t("default")],2)])},r=[],a={name:"CoverView",props:{scrollTop:{type:[String,Number],default:0}},watch:{scrollTop:function(t){this.setScrollTop(t)}},mounted:function(){this.setScrollTop(this.scrollTop)},methods:{setScrollTop:function(t){var e=this.$refs.content;"scroll"===getComputedStyle(e).overflowY&&(e.scrollTop=this._upx2pxNum(t))},_upx2pxNum:function(t){return/\d+[ur]px$/i.test(t)&&t.replace(/\d+[ur]px$/i,function(t){return uni.upx2px(parseFloat(t))}),parseFloat(t)||0}}},o=a,s=(n("cc5f"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},c439:function(t,e,n){"use strict";n.r(e),n.d(e,"getLocation",function(){return r}),n.d(e,"openLocation",function(){return a});var i={WGS84:"WGS84",GCJ02:"GCJ02"},r={type:{type:String,validator:function(t,e){t=(t||"").toUpperCase(),e.type=Object.values(i).indexOf(t)<0?i.WGS84:t},default:i.WGS84},altitude:{altitude:Boolean,default:!1}},a={latitude:{type:Number,required:!0},longitude:{type:Number,required:!0},scale:{type:Number,validator:function(t,e){t=Math.floor(t),e.scale=t>=5&&t<=18?t:18},default:18},name:{type:String},address:{type:String}}},c61c:function(t,e,n){"use strict";function i(t){return Math.sqrt(t.x*t.x+t.y*t.y)}n.r(e);var r,a,o={name:"MovableArea",props:{scaleArea:{type:Boolean,default:!1}},data:function(){return{width:0,height:0,items:[]}},created:function(){this.gapV={x:null,y:null},this.pinchStartLen=null},mounted:function(){this._resize()},methods:{_resize:function(){this._getWH(),this.items.forEach(function(t,e){t.componentInstance.setParent()})},_find:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.items,n=this.$el;function i(t){for(var r=0;r1){var n={x:e[1].pageX-e[0].pageX,y:e[1].pageY-e[0].pageY};if(this.pinchStartLen=i(n),this.gapV=n,!this.scaleArea){var r=this._find(e[0].target),a=this._find(e[1].target);this._scaleMovableView=r&&r===a?r:null}}},_touchmove:function(t){var e=t.touches;if(e&&e.length>1){t.preventDefault();var n={x:e[1].pageX-e[0].pageX,y:e[1].pageY-e[0].pageY};if(null!==this.gapV.x&&this.pinchStartLen>0){var r=i(n)/this.pinchStartLen;this._updateScale(r)}this.gapV=n}},_touchend:function(t){var e=t.touches;e&&e.length||t.changedTouches&&(this.gapV.x=0,this.gapV.y=0,this.pinchStartLen=null,this.scaleArea?this.items.forEach(function(t){t.componentInstance._endScale()}):this._scaleMovableView&&this._scaleMovableView.componentInstance._endScale())},_updateScale:function(t){t&&1!==t&&(this.scaleArea?this.items.forEach(function(e){e.componentInstance._setScale(t)}):this._scaleMovableView&&this._scaleMovableView.componentInstance._setScale(t))},_getWH:function(){var t=window.getComputedStyle(this.$el),e=this.$el.getBoundingClientRect();this.width=e.width-["Left","Right"].reduce(function(e,n){return e+parseFloat(t["border"+n+"Width"])+parseFloat(t["padding"+n])},0),this.height=e.height-["Top","Bottom"].reduce(function(e,n){return e+parseFloat(t["border"+n+"Width"])+parseFloat(t["padding"+n])},0)}},render:function(t){var e=this,n=[];this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"v-uni-movable-view"===t.componentOptions.tag&&n.push(t)}),this.items=n;var i=Object.assign({},this.$listeners),r=["touchstart","touchmove","touchend"];return r.forEach(function(t){var n=i[t],r=e["_".concat(t)];i[t]=n?[].concat(n,r):r}),t("uni-movable-area",{on:i},[t("v-uni-resize-sensor",{on:{resize:this._resize}})].concat(n))}},s=o,c=(n("a3e5"),n("0c7c")),u=Object(c["a"])(s,r,a,!1,null,null,null);e["default"]=u.exports},c8ed:function(t,e,n){"use strict";var i=n("0dba"),r=n.n(i);r.a},c96e:function(t,e,n){"use strict";var i=n("c312"),r=n.n(i);r.a},c99c:function(t,e,n){},cb0f:function(t,e,n){"use strict";n.d(e,"a",function(){return s});var i=n("0f74"),r=/^([a-z-]+:)?\/\//i,a=/^data:[a-z-]+\/[a-z-]+;base64,/;function o(t){return __uniConfig.router.base?__uniConfig.router.base+t:t}function s(t){if(0===t.indexOf("/")){if(0!==t.indexOf("//"))return o(t.substr(1));t="https:"+t}if(r.test(t)||a.test(t)||0===t.indexOf("blob:"))return t;var e=getCurrentPages();return e.length?o(Object(i["a"])(e[e.length-1].$page.route,t).substr(1)):t}},cc5f:function(t,e,n){"use strict";var i=n("6f45"),r=n.n(i);r.a},cc76:function(t,e,n){"use strict";var i=Object.create(null),r=n("19c4");r.keys().forEach(function(t){Object.assign(i,r(t))}),e["a"]=i},cc83:function(t,e,n){},cee1:function(t,e,n){},cef5:function(t,e,n){"use strict";n.r(e),n.d(e,"getProvider",function(){return r});var i={OAUTH:"OAUTH",SHARE:"SHARE",PAYMENT:"PAYMENT",PUSH:"PUSH"},r={service:{type:String,required:!0,validator:function(t,e){if(t=(t||"").toUpperCase(),t&&Object.values(i).indexOf(t)<0)return"service error"}}}},d3bd:function(t,e,n){"use strict";n.r(e);var i,r,a=n("8af1"),o={name:"Button",mixins:[a["b"],a["a"],a["c"]],props:{hoverClass:{type:String,default:"button-hover"},disabled:{type:[Boolean,String],default:!1},id:{type:String,default:""},hoverStopPropagation:{type:Boolean,default:!1},hoverStartTime:{type:Number,default:20},hoverStayTime:{type:Number,default:70},formType:{type:String,default:"",validator:function(t){return~["","submit","reset"].indexOf(t)}}},data:function(){return{clickFunction:null}},methods:{_onClick:function(t,e){this.disabled||(e&&this.$el.click(),this.formType&&this.$dispatch("Form","submit"===this.formType?"uni-form-submit":"uni-form-reset",{type:this.formType}))},_bindObjectListeners:function(t,e){if(e)for(var n in e){var i=t.on[n],r=e[n];t.on[n]=i?[].concat(i,r):r}return t}},render:function(t){var e=this,n=Object.create(null);return this.$listeners&&Object.keys(this.$listeners).forEach(function(t){(!e.disabled||"click"!==t&&"tap"!==t)&&(n[t]=e.$listeners[t])}),this.hoverClass&&"none"!==this.hoverClass?t("uni-button",this._bindObjectListeners({class:[this.hovering?this.hoverClass:""],attrs:{disabled:this.disabled},on:{touchstart:this._hoverTouchStart,touchend:this._hoverTouchEnd,touchcancel:this._hoverTouchCancel,click:this._onClick}},n),this.$slots.default):t("uni-button",this._bindObjectListeners({class:[this.hovering?this.hoverClass:""],attrs:{disabled:this.disabled},on:{click:this._onClick}},n),this.$slots.default)},listeners:{"label-click":"_onClick","@label-click":"_onClick"}},s=o,c=(n("5676"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},d4b6:function(t,e,n){"use strict";n.d(e,"b",function(){return f}),n.d(e,"a",function(){return k});var i=n("f2b3"),r=n("85b6"),a=n("24d9"),o=n("a470");function s(t,e){return l(t)||u(t,e)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function u(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done);i=!0)if(n.push(o.value),e&&n.length===e)break}catch(c){r=!0,a=c}finally{try{i||null==s["return"]||s["return"]()}finally{if(r)throw a}}return n}function l(t){if(Array.isArray(t))return t}function h(t,e){var n={id:t.id,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,dataset:Object(r["c"])(t.dataset)};return e&&Object.assign(n,e),n}function d(t){if(t){for(var e=[],n=Object(o["a"])(),i=n.top,r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e._processed)return e.type=n.type||t,e;if("click"===t){var s=Object(o["a"])(),c=s.top;n={x:e.x,y:e.y-c},e.touches=e.changedTouches=[{force:1,identifier:0,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}]}return Object(a["b"])({type:n.type||t,timeStamp:e.timeStamp||0,detail:n,target:h(i,n),currentTarget:h(r),touches:e instanceof Event?d(e.touches):e.touches,changedTouches:e instanceof Event?d(e.changedTouches):e.changedTouches,preventDefault:function(){},stopPropagation:function(){}})}var p=350,g=10,m=!!i["h"]&&{passive:!0},v=!1;function b(){v&&(clearTimeout(v),v=!1)}var y=0,_=0;function w(t){if(b(),1===t.touches.length){var e=s(t.touches,1),n=e[0],i=n.pageX,r=n.pageY;y=i,_=r,v=setTimeout(function(){t.target.dispatchEvent(new TouchEvent("longpress",{bubbles:!0,cancelable:!0,target:t.target,currentTarget:t.currentTarget,touches:t.touches,changedTouches:t.changedTouches}))},p)}}function S(t){if(v){if(1!==t.touches.length)return b();var e=s(t.touches,1),n=e[0],i=n.pageX,r=n.pageY;return Math.abs(i-y)>g||Math.abs(r-_)>g?b():void 0}}function k(){window.addEventListener("touchstart",w,m),window.addEventListener("touchmove",S,m),window.addEventListener("touchend",b,m),window.addEventListener("touchcancel",b,m)}},d5bc:function(t,e,n){},d5be:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"chooseImage",function(){return u});var i=n("e2e2"),r=n("f2b3"),a=t,o=a.invokeCallbackHandler,s=null,c=function(t){var e=document.createElement("input");return e.type="file",Object(r["j"])(e,{position:"absolute",visibility:"hidden","z-index":-999,width:0,height:0,top:0,left:0}),e.accept="image/*",t.count>1&&(e.multiple="multiple"),1===t.sourceType.length&&"camera"===t.sourceType[0]&&(e.capture="camera"),e};function u(t,e){var n=t.count,r=t.sourceType;s&&(document.body.removeChild(s),s=null),s=c({count:n,sourceType:r}),document.body.appendChild(s),s.addEventListener("change",function(t){for(var n=[],r=[],a=t.target.files.length,s=0;s=e||n.radioList[e].radioChecked&&(n.radioList[r].radioChecked=!1)}))})},_getFormData:function(){var t={};if(""!==this.name){var e="";this.radioList.forEach(function(t){t.radioChecked&&(e=t.value)}),t["value"]=e,t["key"]=this.name}return t}}},s=o,c=(n("fb61"),n("0c7c")),u=Object(c["a"])(s,i,r,!1,null,null,null);e["default"]=u.exports},d60d:function(t,e,n){},d677:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("uni-cover-image",t._g({attrs:{src:t.src}},t.$listeners),[n("div",{staticClass:"uni-cover-image"},[t.src?n("img",{attrs:{src:t.$getRealPath(t.src)},on:{load:t._load,error:t._error}}):t._e()])])},r=[],a={name:"CoverImage",props:{src:{type:String,default:""}},methods:{_load:function(t){this.$trigger("load",t)},_error:function(t){this.$trigger("error",t)}}},o=a,s=(n("5d1d"),n("0c7c")),c=Object(s["a"])(o,i,r,!1,null,null,null);e["default"]=c.exports},d68b:function(t,e,n){"use strict";n.r(e),n.d(e,"showModal",function(){return r}),n.d(e,"showToast",function(){return a}),n.d(e,"showLoading",function(){return o}),n.d(e,"showActionSheet",function(){return s});var i=n("cb0f"),r={title:{type:String,default:""},content:{type:String,default:""},showCancel:{type:Boolean,default:!0},cancelText:{type:String,default:"取消"},cancelColor:{type:String,default:"#000000"},confirmText:{type:String,default:"确定"},confirmColor:{type:String,default:"#007aff"},visible:{type:Boolean,default:!0}},a={title:{type:String,default:""},icon:{default:"success",validator:function(t,e){-1===["success","loading","none"].indexOf(t)&&(e.icon="success")}},image:{type:String,default:"",validator:function(t,e){t&&(e.image=Object(i["a"])(t))}},duration:{type:Number,default:1500},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},o={title:{type:String,default:""},icon:{type:String,default:"loading"},duration:{type:Number,default:1e8},mask:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},s={itemList:{type:Array,required:!0,validator:function(t,e){if(!t.length)return"parameter.itemList should have at least 1 item"}},itemColor:{type:String,default:"#000000"},visible:{type:Boolean,default:!0}}},daa0:function(t,e,n){"use strict";n.r(e),function(t){function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=t.text,n=t.color;o(this.id,this.pageId,"sendDanmu",{text:e,color:n})}},{key:"playbackRate",value:function(t){~s.indexOf(t)||(t=1),o(this.id,this.pageId,"playbackRate",{rate:t})}},{key:"requestFullScreen",value:function(){o(this.id,this.pageId,"requestFullScreen")}},{key:"exitFullScreen",value:function(){o(this.id,this.pageId,"exitFullScreen")}},{key:"showStatusBar",value:function(){o(this.id,this.pageId,"showStatusBar")}},{key:"hideStatusBar",value:function(){o(this.id,this.pageId,"hideStatusBar")}}]),t}();function u(e,n){if(n)return new c(e,n.$page.id);var i=getApp();if(i.$route&&i.$route.params.__id__)return new c(e,i.$route.params.__id__);t.emit("onError","createVideoContext:fail")}}.call(this,n("0dd1"))},db18:function(t,e,n){"use strict";var i=n("08c9"),r=n.n(i);r.a},dc5e:function(t,e,n){"use strict";(function(t,i){var r=n("8af1"),a=n("a20f");function o(t){return u(t)||c(t)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function c(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function u(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e-1&&a&&!Object(i["c"])(r,"default")&&(s=!1),void 0===s&&Object(i["c"])(r,"default")){var u=r["default"];s=Object(i["e"])(u)?u():u,n[t]=s}return o(r,t,s,a,n)}function o(t,e,n,i,r){if(t.required&&i)return"Missing required parameter `".concat(e,"`");if(null==n&&!t.required){var a=t.validator;return a?a(n,r):void 0}var o=t.type,s=!o||!0===o,u=[];if(o){Array.isArray(o)||(o=[o]);for(var l=0;l=0?f:255,[l,h,d,f]}return i.group("非法颜色: "+t),i.error("不支持颜色:"+t),i.groupEnd(),[0,0,0,255]}function b(t){this.width=t}function y(t,e){this.image=t,this.repetition=e}var _,w=function(){function t(e,n){h(this,t),this.type=e,this.data=n,this.colorStop=[]}return f(t,[{key:"addColorStop",value:function(t,e){this.colorStop.push([t,v(e)])}}]),t}(),S=["scale","rotate","translate","setTransform","transform"],k=["drawImage","fillText","fill","stroke","fillRect","strokeRect","clearRect","strokeText"],T=["setFillStyle","setTextAlign","setStrokeStyle","setGlobalAlpha","setShadow","setFontSize","setLineCap","setLineJoin","setLineWidth","setMiterLimit","setTextBaseline","setLineDash"];function x(){return _||(_=document.createElement("canvas")),_}var C=function(){function t(e,n){h(this,t),this.id=e,this.pageId=n,this.actions=[],this.path=[],this.subpath=[],this.currentTransform=[],this.currentStepAnimates=[],this.drawingState=[],this.state={lineDash:[0,0],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:[0,0,0,0],font:"10px sans-serif",fontSize:10,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif"}}return f(t,[{key:"draw",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,i=s(this.actions);this.actions=[],this.path=[],"function"===typeof n&&(t=p.push(n)),g(this.id,this.pageId,"actionsChanged",{actions:i,reserve:e,callbackId:t})}},{key:"createLinearGradient",value:function(t,e,n,i){return new w("linear",[t,e,n,i])}},{key:"createCircularGradient",value:function(t,e,n){return new w("radial",[t,e,n])}},{key:"createPattern",value:function(t,e){if(void 0===e)i.error("Failed to execute 'createPattern' on 'CanvasContext': 2 arguments required, but only 1 present.");else{if(!(["repeat","repeat-x","repeat-y","no-repeat"].indexOf(e)<0))return new y(t,e);i.error("Failed to execute 'createPattern' on 'CanvasContext': The provided type ('"+e+"') is not one of 'repeat', 'no-repeat', 'repeat-x', or 'repeat-y'.")}}},{key:"measureText",value:function(t){var e=x().getContext("2d");return e.font=this.state.font,new b(e.measureText(t).width||0)}},{key:"save",value:function(){this.actions.push({method:"save",data:[]}),this.drawingState.push(this.state)}},{key:"restore",value:function(){this.actions.push({method:"restore",data:[]}),this.state=this.drawingState.pop()||{lineDash:[0,0],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:[0,0,0,0],font:"10px sans-serif",fontSize:10,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif"}}},{key:"beginPath",value:function(){this.path=[],this.subpath=[]}},{key:"moveTo",value:function(t,e){this.path.push({method:"moveTo",data:[t,e]}),this.subpath=[[t,e]]}},{key:"lineTo",value:function(t,e){0===this.path.length&&0===this.subpath.length?this.path.push({method:"moveTo",data:[t,e]}):this.path.push({method:"lineTo",data:[t,e]}),this.subpath.push([t,e])}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.push({method:"quadraticCurveTo",data:[t,e,n,i]}),this.subpath.push([n,i])}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){this.path.push({method:"bezierCurveTo",data:[t,e,n,i,r,a]}),this.subpath.push([r,a])}},{key:"arc",value:function(t,e,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.path.push({method:"arc",data:[t,e,n,i,r,a]}),this.subpath.push([t,e])}},{key:"rect",value:function(t,e,n,i){this.path.push({method:"rect",data:[t,e,n,i]}),this.subpath=[[t,e]]}},{key:"arcTo",value:function(t,e,n,i,r){this.path.push({method:"arcTo",data:[t,e,n,i,r]}),this.subpath.push([n,i])}},{key:"clip",value:function(){this.actions.push({method:"clip",data:s(this.path)})}},{key:"closePath",value:function(){this.path.push({method:"closePath",data:[]}),this.subpath.length&&(this.subpath=[this.subpath.shift()])}},{key:"clearActions",value:function(){this.actions=[],this.path=[],this.subpath=[]}},{key:"getActions",value:function(){var t=s(this.actions);return this.clearActions(),t}},{key:"lineDashOffset",set:function(t){this.actions.push({method:"setLineDashOffset",data:[t]})}},{key:"globalCompositeOperation",set:function(t){this.actions.push({method:"setGlobalCompositeOperation",data:[t]})}},{key:"shadowBlur",set:function(t){this.actions.push({method:"setShadowBlur",data:[t]})}},{key:"shadowColor",set:function(t){this.actions.push({method:"setShadowColor",data:[t]})}},{key:"shadowOffsetX",set:function(t){this.actions.push({method:"setShadowOffsetX",data:[t]})}},{key:"shadowOffsetY",set:function(t){this.actions.push({method:"setShadowOffsetY",data:[t]})}},{key:"font",set:function(t){var e=this;this.state.font=t;var n=t.match(/^(([\w\-]+\s)*)(\d+r?px)(\/(\d+\.?\d*(r?px)?))?\s+(.*)/);if(n){var r=n[1].trim().split(/\s/),a=parseFloat(n[3]),o=n[7],s=[];r.forEach(function(t,n){["italic","oblique","normal"].indexOf(t)>-1?(s.push({method:"setFontStyle",data:[t]}),e.state.fontStyle=t):["bold","normal"].indexOf(t)>-1?(s.push({method:"setFontWeight",data:[t]}),e.state.fontWeight=t):0===n?(s.push({method:"setFontStyle",data:["normal"]}),e.state.fontStyle="normal"):1===n&&c()}),1===r.length&&c(),r=s.map(function(t){return t.data[0]}).join(" "),this.state.fontSize=a,this.state.fontFamily=o,this.actions.push({method:"setFont",data:["".concat(r," ").concat(a,"px ").concat(o)]})}else i.warn("Failed to set 'font' on 'CanvasContext': invalid format.");function c(){s.push({method:"setFontWeight",data:["normal"]}),e.state.fontWeight="normal"}},get:function(){return this.state.font}},{key:"fillStyle",set:function(t){this.setFillStyle(t)}},{key:"strokeStyle",set:function(t){this.setStrokeStyle(t)}},{key:"globalAlpha",set:function(t){t=Math.floor(255*parseFloat(t)),this.actions.push({method:"setGlobalAlpha",data:[t]})}},{key:"textAlign",set:function(t){this.actions.push({method:"setTextAlign",data:[t]})}},{key:"lineCap",set:function(t){this.actions.push({method:"setLineCap",data:[t]})}},{key:"lineJoin",set:function(t){this.actions.push({method:"setLineJoin",data:[t]})}},{key:"lineWidth",set:function(t){this.actions.push({method:"setLineWidth",data:[t]})}},{key:"miterLimit",set:function(t){this.actions.push({method:"setMiterLimit",data:[t]})}},{key:"textBaseline",set:function(t){this.actions.push({method:"setTextBaseline",data:[t]})}}]),t}();function O(e,n){if(n)return new C(e,n.$page.id);var i=getApp();if(i.$route&&i.$route.params.__id__)return new C(e,i.$route.params.__id__);t.emit("onError","createCanvasContext:fail")}[].concat(S,k).forEach(function(t){function e(t){switch(t){case"fill":case"stroke":return function(){this.actions.push({method:t+"Path",data:s(this.path)})};case"fillRect":return function(t,e,n,i){this.actions.push({method:"fillPath",data:[{method:"rect",data:[t,e,n,i]}]})};case"strokeRect":return function(t,e,n,i){this.actions.push({method:"strokePath",data:[{method:"rect",data:[t,e,n,i]}]})};case"fillText":case"strokeText":return function(e,n,i,r){var a=[e.toString(),n,i];"number"===typeof r&&a.push(r),this.actions.push({method:t,data:a})};case"drawImage":return function(e,n,i,r,a,o,s,c,u){var l;function h(t){return"number"===typeof t}void 0===u&&(o=n,s=i,c=r,u=a,n=void 0,i=void 0,r=void 0,a=void 0),l=h(n)&&h(i)&&h(r)&&h(a)?[e,o,s,c,u,n,i,r,a]:h(c)&&h(u)?[e,o,s,c,u]:[e,o,s],this.actions.push({method:t,data:l})};default:return function(){for(var e=arguments.length,n=new Array(e),i=0;i2&&void 0!==arguments[2]&&arguments[2],i=document.getElementById(e);i&&n&&(i.parentNode.removeChild(i),i=null),i||(i=document.createElement("style"),i.type="text/css",e&&(i.id=e),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(t))}n.d(e,"a",function(){return i})},eaa4:function(t,e,n){},ed1a:function(t,e,n){"use strict";n.d(e,"b",function(){return l}),n.d(e,"a",function(){return h}),n.d(e,"c",function(){return d}),n.d(e,"d",function(){return g});var i=n("f2b3"),r=n("8542"),a=/^\$|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/,o=/^create|Manager$/,s=["request","downloadFile","uploadFile","connectSocket"],c=/^on/;function u(t){return o.test(t)}function l(t){return a.test(t)}function h(t){return c.test(t)}function d(t){return-1!==s.indexOf(t)}function f(t){return t.then(function(t){return[null,t]}).catch(function(t){return[t]})}function p(t){return!(u(t)||l(t)||h(t))}function g(t,e){return p(t)?function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length,o=new Array(a>1?a-1:0),s=1;s should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab")}}}}).call(this,n("3ad9")["default"])},f102:function(t,e,n){"use strict";n.r(e),n.d(e,"makePhoneCall",function(){return i});var i={phoneNumber:{type:String,required:!0,validator:function(t){if(!t)return"makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;"}}}},f10e:function(t,e,n){"use strict";var i=n("53f0"),r=n.n(i);r.a},f11c:function(t,e,n){"use strict";(function(t){var i=n("8af1");function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var a=t,o=a.subscribe,s=a.unsubscribe,c=a.publishHandler,u={SELECTOR:"selector",MULTISELECTOR:"multiSelector",TIME:"time",DATE:"date"},l={YEAR:"year",MONTH:"month",DAY:"day"};e["a"]={name:"Picker",mixins:[i["a"]],props:{name:{type:String,default:""},range:{type:Array,default:function(){return[]}},rangeKey:{type:String,default:""},value:{type:[Number,String,Array],default:0},mode:{type:String,default:u.SELECTOR,validator:function(t){return Object.values(u).indexOf(t)>=0}},fields:{type:String,default:"day",validator:function(t){return Object.values(l).indexOf(t)>=0}},start:{type:String,default:function(){if(this.mode===u.TIME)return"00:00";if(this.mode===u.DATE){var t=(new Date).getFullYear()-100;switch(this.fields){case l.YEAR:return t;case l.MONTH:return t+"-01";case l.DAY:return t+"-01-01"}}return""}},end:{type:String,default:function(){if(this.mode===u.TIME)return"23:59";if(this.mode===u.DATE){var t=(new Date).getFullYear()+100;switch(this.fields){case l.YEAR:return t;case l.MONTH:return t+"-12";case l.DAY:return t+"-12-31"}}return""}},disabled:{type:[Boolean,String],default:!1}},data:function(){return{valueSync:this.value||0,visible:!1,valueChangeSource:""}},watch:{value:function(t){var e=this;Array.isArray(t)?(Array.isArray(this.valueSync)||(this.valueSync=[]),this.valueSync.length=t.length,t.forEach(function(t,n){t!==e.valueSync[n]&&e.$set(e.valueSync,n,t)})):"object"!==r(t)&&(this.valueSync=t)},valueSync:function(t){this.valueChangeSource?this.$emit("update:value",t):this._show()}},created:function(){var t=this;this.$dispatch("Form","uni-form-group-update",{type:"add",vm:this}),Object.keys(this.$props).forEach(function(e){"value"!==e&&"name"!==e&&t.$watch(e,t._show)})},beforeDestroy:function(){this.$dispatch("Form","uni-form-group-update",{type:"remove",vm:this})},destroyed:function(){if(this.visible){var t=this.$page.id;c("hidePicker",{},t)}},methods:{_click:function(){if(!this.disabled){var t=this.$page.id;o("".concat(t,"-picker-change"),this.change),o("".concat(t,"-picker-columnchange"),this.columnchange),o("".concat(t,"-picker-cancel"),this.cancel),this.visible=!0,this._show()}},_show:function(){if(this.visible){var t=this.$page.id,e=Object.assign({},this.$props);e.value=this.valueSync,c("showPicker",e,t)}},change:function(t){this.visible=!1;var e=this.$page.id;if(s("".concat(e,"-picker-change")),s("".concat(e,"-picker-columnchange")),s("".concat(e,"-picker-cancel")),!this.disabled){this.valueChangeSource="click";var n=t.value;this.valueSync=Array.isArray(n)?n.map(function(t){return t}):n,this.$trigger("change",{},{value:n})}},columnchange:function(t){this.$trigger("columnchange",{},t)},cancel:function(t){this.visible=!1;var e=this.$page.id;s("".concat(e,"-picker-change")),s("".concat(e,"-picker-columnchange")),s("".concat(e,"-picker-cancel")),this.$trigger("cancel",{},{})},_getFormData:function(){return{value:this.valueSync,key:this.name}},_resetFormData:function(){this.valueSync=""}}}}).call(this,n("501c"))},f1b2:function(t,e,n){"use strict";n.r(e),n.d(e,"chooseImage",function(){return a});var i=["original","compressed"],r=["album","camera"],a={count:{type:Number,required:!1,default:9,validator:function(t,e){t<=0&&(e.count=9)}},sizeType:{type:Array,required:!1,default:i,validator:function(t,e){var n=t.length;if(n){for(var r=0;r9?t:"0"+t};function c(t){return"function"===typeof t}function u(t){return"[object Object]"===a.call(t)}function l(t,e){return o.call(t,e)}function h(t){return a.call(t).slice(8,-1)}function d(t){var e=Object.create(null);return function(n){var i=e[n];return i||(e[n]=t(n))}}var f=/-(\w)/g;d(function(t){return t.replace(f,function(t,e){return e?e.toUpperCase():""})});function p(t,e,n){e.forEach(function(e){l(n,e)&&(t[e]=n[e])})}function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(""+t).replace(/[^\x00-\xff]/g,"**").length}function m(t){var e=t.date,n=void 0===e?new Date:e,i=t.mode,r=void 0===i?"date":i;return"time"===r?s(n.getHours())+":"+s(n.getMinutes()):n.getFullYear()+"-"+s(n.getMonth()+1)+"-"+s(n.getDate())}function v(t,e){for(var n in e)t.style[n]=e[n]}function b(t){var e,n,i;return t=t.replace("#",""),6===t.length&&(e=t.substring(0,2),n=t.substring(2,4),i=t.substring(4,6),1===e.length&&(e+=e),1===n.length&&(n+=n),1===i.length&&(i+=i),e=parseInt(e,16),n=parseInt(n,16),i=parseInt(i,16),{r:e,g:n,b:i})}decodeURIComponent;n.d(e,"h",function(){return i}),n.d(e,"e",function(){return c}),n.d(e,"f",function(){return u}),n.d(e,"c",function(){return l}),n.d(e,"i",function(){return h}),n.d(e,"g",function(){return p}),n.d(e,"b",function(){return g}),n.d(e,"a",function(){return m}),n.d(e,"j",function(){return v}),n.d(e,"d",function(){return b})},f4e0:function(t,e,n){"use strict";var i=n("ffdb"),r=n.n(i);r.a},f53a:function(t,e,n){"use strict";var i=n("4871"),r=n.n(i);r.a},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(i){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},f7b4:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"onCompassChange",function(){return a}),n.d(e,"startCompass",function(){return o}),n.d(e,"stopCompass",function(){return s});var i,r=[];function a(t){r.push(t),i||o()}function o(){var e=t,n=e.invokeCallbackHandler;if(window.DeviceOrientationEvent)return i=function(t){var e=360-t.alpha;r.forEach(function(t){n(t,{errMsg:"onCompassChange:ok",direction:e||0})})},window.addEventListener("deviceorientation",i,!1),{};throw new Error("device nonsupport deviceorientation")}function s(){return i&&(window.removeEventListener("deviceorientation",i,!1),i=null),{}}}.call(this,n("0dd1"))},f7fd:function(t,e,n){"use strict";var i=n("ac9d"),r=n.n(i);r.a},f8d2:function(t,e,n){},f9d2:function(t,e,n){"use strict";n.r(e),n.d(e,"createInnerAudioContext",function(){return h});var i=n("cb0f");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n0&&(n.currentTime=t)});var o=["canplay","play","pause","ended","timeUpdate","error","waiting","seeking","seeked"],u=["pause","seeking","seeked","timeUpdate"];o.forEach(function(t){n.addEventListener(t.toLowerCase(),function(){e._stoping&&u.indexOf(t)>=0||e._events["on".concat(t.substr(0,1).toUpperCase()).concat(t.substr(1))].forEach(function(t){t()})},!1)})}return o(t,[{key:"play",value:function(){this._stoping=!1,this._audio.play()}},{key:"pause",value:function(){this._audio.pause()}},{key:"stop",value:function(){this._stoping=!0,this._audio.pause(),this._audio.currentTime=0,this._events.onStop.forEach(function(t){t()})}},{key:"seek",value:function(t){this._stoping=!1,t=Number(t),"number"!==typeof t||isNaN(t)||(this._audio.currentTime=t)}},{key:"destroy",value:function(){this.stop()}}]),t}();function h(){return new l}c.forEach(function(t){l.prototype[t]=function(e){"function"===typeof e&&this._events[t].push(e)}}),u.forEach(function(t){l.prototype[t]=function(e){var n=this._events[t.replace("off","on")],i=n.indexOf(e);i>=0&&n.splice(i,1)}})},fa1e:function(t,e,n){"use strict";function i(){var t=document.activeElement;!t||"TEXTAREA"!==t.tagName&&"INPUT"!==t.tagName||t.blur()}n.r(e),n.d(e,"hideKeyboard",function(){return i})},fa89:function(t,e,n){},fae3:function(t,e,n){"use strict";var i;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=i[1]));n("2ef3")},fb61:function(t,e,n){"use strict";var i=n("90c9"),r=n.n(i);r.a},fb79:function(t,e,n){"use strict";(function(t){var i=n("f2b3");function r(t){return s(t)||o(t)||a()}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function o(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function s(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0&&(n=e.map(function(){return 0})),n},endArray:function(){var t=this.mode===c.DATE?"-":":",e=this.mode===c.DATE?this.dateArray:this.timeArray,n=this.end.split(t).map(function(t,n){return e[n].indexOf(t)});return n.indexOf(-1)>=0&&(n=e.map(function(t){return t.length-1})),n},units:function(){switch(this.mode){case c.DATE:return["年","月","日"];case c.TIME:return["时","分"];default:return[]}}},watch:{valueArray:function(e){var n=this;if(this.mode===c.TIME||this.mode===c.DATE){var i=this.mode===c.TIME?this._getTimeValue:this._getDateValue,r=this.valueArray,a=this.startArray,o=this.endArray;if(this.mode===c.DATE){var s=this.dateArray,u=s[2].length,l=s[2][r[2]],h=new Date("".concat(s[0][r[0]],"/").concat(s[1][r[1]],"/").concat(l)).getDate();l=Number(l),hi(o)&&this._cloneArray(r,o)}e.forEach(function(e,i){e!==n.oldValueArray[i]&&(n.oldValueArray[i]=e,n.mode===c.MULTISELECTOR&&t.publishHandler(n.pageId+"-picker-columnchange",{column:i,value:e},n.pageId))})},visible:function(t){var e=this;t||this.$nextTick(function(){return e._setValue()})}},created:function(){this._createTime(),this._createDate(),this._setValue(),this.$watch("value",this._setValue),this.$watch("mode",this._setValue)},methods:{_createTime:function(){var t=[],e=[];t.splice(0,t.length);for(var n=0;n<24;n++)t.push((n<10?"0":"")+n);e.splice(0,e.length);for(var i=0;i<60;i++)e.push((i<10?"0":"")+i);this.timeArray.push(t,e)},_createDate:function(){for(var t=[],e=(new Date).getFullYear(),n=e-150,i=e+150;n<=i;n++)t.push(String(n));for(var r=[],a=1;a<=12;a++)r.push((a<10?"0":"")+a);for(var o=[],s=1;s<=31;s++)o.push((s<10?"0":"")+s);this.dateArray.push(t,r,o)},_getTimeValue:function(t){return 60*t[0]+t[1]},_getDateValue:function(t){return 366*t[0]+31*(t[1]||0)+(t[2]||0)},_cloneArray:function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=getApp();if(n){var s=!1,c=getCurrentPages();if(c.length?c[c.length-1].$page.meta.isTabBar&&(s=!0):n.$children[0].hasTabBar&&(s=!0),!s)return{errMsg:"".concat(t,":fail not TabBar page")};var u=e.index,l=n.$children[0].tabBar;if(u>=__uniConfig.tabBar.list.length)return{errMsg:"".concat(t,":fail tabbar item not found")};switch(t){case"showTabBar":n.$children[0].hideTabBar=!1;break;case"hideTabBar":n.$children[0].hideTabBar=!0;break;case"setTabBarItem":Object(i["g"])(l.list[u],r,e);break;case"setTabBarStyle":Object(i["g"])(l,a,e);break;case"showTabBarRedDot":Object(i["g"])(l.list[u],o,{badge:"",redDot:!0});break;case"setTabBarBadge":Object(i["g"])(l.list[u],o,{badge:e.text,redDot:!0});break;case"hideTabBarRedDot":case"removeTabBarBadge":Object(i["g"])(l.list[u],o,{badge:"",redDot:!1});break}}return{}}function c(t){return s("setTabBarItem",t)}function u(t){return s("setTabBarStyle",t)}function l(t){return s("hideTabBar",t)}function h(t){return s("showTabBar",t)}function d(t){return s("hideTabBarRedDot",t)}function f(t){return s("showTabBarRedDot",t)}function p(t){return s("removeTabBarBadge",t)}function g(t){return s("setTabBarBadge",t)}},fcd8:function(t,e,n){},ff28:function(t,e,n){"use strict";var i=n("23af"),r=n.n(i);r.a},ffdb:function(t,e,n){},ffdc:function(t,e,n){"use strict";function i(t,e,n,i){var r,a=document.createElement("script"),o=e.callback||"callback",s="__callback"+Date.now(),c=e.timeout||3e4;function u(){clearTimeout(r),delete window[s],a.remove()}window[s]=function(t){"function"===typeof n&&n(t),u()},a.onerror=function(){"function"===typeof i&&i(),u()},r=setTimeout(function(){"function"===typeof i&&i(),u()},c),a.src=t+(t.indexOf("?")>=0?"&":"?")+o+"="+s,document.body.appendChild(a)}n.d(e,"a",function(){return i})}})}); \ No newline at end of file diff --git a/src/core/helpers/protocol/network/request.js b/src/core/helpers/protocol/network/request.js index feb2787046..55605715b7 100644 --- a/src/core/helpers/protocol/network/request.js +++ b/src/core/helpers/protocol/network/request.js @@ -1,55 +1,96 @@ -const method = { - OPTIONS: 'OPTIONS', - GET: 'GET', - HEAD: 'HEAD', - POST: 'POST', - PUT: 'PUT', - DELETE: 'DELETE', - TRACE: 'TRACE', - CONNECT: 'CONNECT' -} -const dataType = { - JSON: 'JSON' -} -const responseType = { - TEXT: 'TEXT', - ARRAYBUFFER: 'ARRAYBUFFER' -} -export const request = { - url: { - type: String, - required: true - }, - data: { - type: [Object, String, ArrayBuffer], - validator (value, params) { - params.data = value || '' - } - }, - header: { - type: Object, - validator (value, params) { - params.header = value || {} - } - }, - method: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase() - params.method = Object.values(method).indexOf(value) < 0 ? method.GET : value - } - }, - dataType: { - type: String, - validator (value, params) { - params.dataType = (value || dataType.JSON).toUpperCase() - } - }, - responseType: { - type: String, - validator (value, params) { - value = (value || '').toUpperCase() - params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value - } - } +import { + isPlainObject +} from 'uni-shared' + +const method = { + OPTIONS: 'OPTIONS', + GET: 'GET', + HEAD: 'HEAD', + POST: 'POST', + PUT: 'PUT', + DELETE: 'DELETE', + TRACE: 'TRACE', + CONNECT: 'CONNECT' +} +const dataType = { + JSON: 'JSON' +} +const responseType = { + TEXT: 'TEXT', + ARRAYBUFFER: 'ARRAYBUFFER' +} + +const encode = encodeURIComponent + +function stringifyQuery (url, data) { + let str = url.split('#') + const hash = str[1] || '' + str = str[0].split('?') + let query = str[1] || '' + url = str[0] + const search = query.split('&').filter(item => item) + query = {} + search.forEach(item => { + item = item.split('=') + query[item[0]] = item[1] + }) + for (let key in data) { + if (data.hasOwnProperty(key)) { + if (isPlainObject(data[key])) { + query[encode(key)] = encode(JSON.stringify(data[key])) + } else { + query[encode(key)] = encode(data[key]) + } + } + } + query = Object.keys(query).map(item => `${item}=${query[item]}`).join('&') + return url + (query ? '?' + query : '') + (hash ? '#' + hash : '') +} + +export const request = { + method: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase() + params.method = Object.values(method).indexOf(value) < 0 ? method.GET : value + } + }, + data: { + type: [Object, String, ArrayBuffer], + validator (value, params) { + params.data = value || '' + } + }, + url: { + type: String, + required: true, + validator (value, params) { + if ( + params.method === method.GET && + isPlainObject(params.data) && + Object.keys(params.data).length + ) { // 将 method,data 校验提前,保证 url 校验时,method,data 已被格式化 + params.url = stringifyQuery(value, params.data) + } + } + }, + header: { + type: Object, + validator (value, params) { + params.header = value || {} + } + }, + dataType: { + type: String, + validator (value, params) { + params.dataType = (value || dataType.JSON).toUpperCase() + } + }, + responseType: { + type: String, + validator (value, params) { + value = (value || '').toUpperCase() + params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value + } + } } diff --git a/src/core/service/api/network/request.js b/src/core/service/api/network/request.js new file mode 100644 index 0000000000..72ec265297 --- /dev/null +++ b/src/core/service/api/network/request.js @@ -0,0 +1,113 @@ +import { + isPlainObject +} from 'uni-shared' + +import { + invoke +} from 'uni-core/service/bridge' + +import { + onMethod, + invokeMethod +} from '../../platform' + +const requestTasks = Object.create(null) + +function formatResponse (res, args) { + if ( + typeof res.data === 'string' && + res.data.charCodeAt(0) === 65279 + ) { + res.data = res.data.substr(1) + } + + res.statusCode = parseInt(res.statusCode, 10) + + if (isPlainObject(res.header)) { + res.header = Object.keys(res.header).reduce(function (ret, key) { + const value = res.header[key] + if (Array.isArray(value)) { + ret[key] = value.join(',') + } else if (typeof value === 'string') { + ret[key] = value + } + return ret + }, {}) + } + + if (args.dataType && args.dataType.toLowerCase() === 'json') { + try { + res.data = JSON.parse(res.data) + } catch (e) {} + } + + return res +} + +onMethod('onRequestTaskStateChange', function ({ + requestTaskId, + state, + data, + statusCode, + header, + errMsg +}) { + const { + args, + callbackId + } = requestTasks[requestTaskId] + + if (!callbackId) { + return + } + delete requestTasks[requestTaskId] + switch (state) { + case 'success': + invoke(callbackId, formatResponse({ + data, + statusCode, + header, + errMsg: 'request:ok' + }, args)) + break + case 'fail': + invoke(callbackId, { + errMsg: 'request:fail ' + errMsg + }) + break + } +}) + +class RequestTask { + constructor (id) { + this.id = id + } + + abort () { + invokeMethod('operateRequestTask', { + requestTaskId: this.id, + operationType: 'abort' + }) + } + + offHeadersReceived () { + + } + + onHeadersReceived () { + + } +} + +export function request (args, callbackId) { + const { + requestTaskId + } = invokeMethod('createRequestTask', args) + + requestTasks[requestTaskId] = { + args, + callbackId + } + + return new RequestTask(requestTaskId) +} diff --git a/src/core/service/bridge.js b/src/core/service/bridge.js index 7ceb8c0cf2..3119226fcb 100644 --- a/src/core/service/bridge.js +++ b/src/core/service/bridge.js @@ -1,5 +1,3 @@ -import api from 'uni-platform/service/api' - export function unpack (args) { return args } @@ -7,19 +5,3 @@ export function unpack (args) { export function invoke (...args) { return UniServiceJSBridge.invokeCallbackHandler(...args) } - -/** - * 执行内部平台方法 - */ -export function invokeMethod (name, ...args) { - return api[name].apply(null, args) -} - -/** - * 监听 service 层内部平台方法回调,与 publish 对应 - * @param {Object} name - * @param {Object} callback - */ -export function onMethod (name, callback) { - return UniServiceJSBridge.on('api.' + name, callback) -} diff --git a/src/core/service/platform.js b/src/core/service/platform.js new file mode 100644 index 0000000000..e1f05ff183 --- /dev/null +++ b/src/core/service/platform.js @@ -0,0 +1,16 @@ +import api from 'uni-platform/service/api' + +/** + * 执行内部平台方法 + */ +export function invokeMethod (name, ...args) { + return api[name].apply(null, args) +} +/** + * 监听 service 层内部平台方法回调,与 publish 对应 + * @param {Object} name + * @param {Object} callback + */ +export function onMethod (name, callback) { + return UniServiceJSBridge.on('api.' + name, callback) +} diff --git a/src/platforms/h5/service/uni.js b/src/core/service/uni.js similarity index 100% rename from src/platforms/h5/service/uni.js rename to src/core/service/uni.js diff --git a/src/platforms/app-plus-nvue/service/api.js b/src/platforms/app-plus-nvue/service/api.js index 3fc12d3dce..5790d7606e 100644 --- a/src/platforms/app-plus-nvue/service/api.js +++ b/src/platforms/app-plus-nvue/service/api.js @@ -1,3 +1,4 @@ -import * as api from './api/index' +import * as appApi from '../../app-plus/service/api/index' +import * as nvueApi from './api/index' -export default api +export default Object.assign(Object.create(null), appApi, nvueApi) diff --git a/src/platforms/app-plus-nvue/service/api/route/navigate-back.js b/src/platforms/app-plus-nvue/service/api/route/navigate-back.js index 9d1711a037..4df1febf36 100644 --- a/src/platforms/app-plus-nvue/service/api/route/navigate-back.js +++ b/src/platforms/app-plus-nvue/service/api/route/navigate-back.js @@ -2,35 +2,84 @@ import { ANI_DURATION } from './util' +import { + setStatusBarStyle +} from '../../bridge' + let firstBackTime = 0 -export function navigateBack ({ - delta, - animationType, - animationDuration -}) { - const pages = getCurrentPages() - const len = pages.length - 1 - const page = pages[len] - if (page.$page.meta.isQuit) { - if (!firstBackTime) { - firstBackTime = Date.now() - plus.nativeUI.toast('再按一次退出应用') - setTimeout(() => { - firstBackTime = null - }, 2000) - } else if (Date.now() - firstBackTime < 2000) { - plus.runtime.quit() +function quit() { + if (!firstBackTime) { + firstBackTime = Date.now() + plus.nativeUI.toast('再按一次退出应用') + setTimeout(() => { + firstBackTime = null + }, 2000) + } else if (Date.now() - firstBackTime < 2000) { + plus.runtime.quit() + } +} + +function backWebview(webview, callback) { + if (!webview.__uniapp_webview) { + return callback() + } + const children = webview.children() + if (!children || !children.length) { // 有子 webview + return callback() + } + const childWebview = children[0] + childWebview.canBack(({ + canBack + }) => { + if (canBack) { + childWebview.back() // webview 返回 + } else { + callback() } - } else { - pages.splice(len, 1) + }) +} + +function back(delta, animationType, animationDuration) { + const pages = getCurrentPages() + const len = pages.length + const currentPage = pages[len - 1] + + if (delta > 1) { + // 中间页隐藏 + pages.slice(len - delta, len - 1).reverse().forEach(deltaPage => { + deltaPage.$getAppWebview().close('none') + }) + } + + backWebview(currentPage, () => { if (animationType) { - page.$getAppWebview().close(animationType, animationDuration || ANI_DURATION) + currentPage.$getAppWebview().close(animationType, animationDuration || ANI_DURATION) } else { - page.$getAppWebview().close('auto') + currentPage.$getAppWebview().close('auto') } + // 移除所有 page + pages.splice(len - delta, len) + + setStatusBarStyle() + UniServiceJSBridge.emit('onAppRoute', { type: 'navigateBack' }) - } + }) +} + +export function navigateBack({ + delta, + animationType, + animationDuration +}) { + const pages = getCurrentPages() + const len = pages.length + + uni.hideToast() // 后退时,关闭 toast,loading + + pages[len - 1].$page.meta.isQuit ? + quit() : + back(delta, animationType, animationDuration) } diff --git a/src/platforms/app-plus-nvue/service/api/route/navigate-to.js b/src/platforms/app-plus-nvue/service/api/route/navigate-to.js index 2eea3ce403..260674ad15 100644 --- a/src/platforms/app-plus-nvue/service/api/route/navigate-to.js +++ b/src/platforms/app-plus-nvue/service/api/route/navigate-to.js @@ -1,13 +1,24 @@ +import { + parseQuery +} from 'uni-shared' + import { showWebview } from './util' +import { + setStatusBarStyle +} from '../../bridge' + export function navigateTo ({ url, animationType, animationDuration }) { - const path = url.split('?')[0] + const urls = url.split('?') + const path = urls[0] + + const query = parseQuery(urls[1] || '') UniServiceJSBridge.emit('onAppRoute', { type: 'navigateTo', @@ -16,9 +27,12 @@ export function navigateTo ({ showWebview( __registerPage({ - path + path, + query }), animationType, animationDuration ) + + setStatusBarStyle() } diff --git a/src/platforms/app-plus/service/api/device/system.js b/src/platforms/app-plus/service/api/device/system.js index c862eb31af..84ae08db6e 100644 --- a/src/platforms/app-plus/service/api/device/system.js +++ b/src/platforms/app-plus/service/api/device/system.js @@ -9,7 +9,7 @@ import { TITLEBAR_HEIGHT } from '../../constants' -import tabbar from '../../framework/tabbar' +import tabBar from '../../framework/tab-bar' export function getSystemInfoSync () { return callApiSync(getSystemInfo, Object.create(null), 'getSystemInfo', 'getSystemInfoSync') @@ -48,7 +48,7 @@ export function getSystemInfo () { // TODO screenWidth,screenHeight windowWidth: screenWidth, windowHeight: Math.min(screenHeight - (titleNView ? (statusBarHeight + TITLEBAR_HEIGHT) - : 0) - (isTabBarPage() && tabbar.visible ? TABBAR_HEIGHT : 0), screenHeight), + : 0) - (isTabBarPage() && tabBar.visible ? TABBAR_HEIGHT : 0), screenHeight), statusBarHeight, language: plus.os.language, system: plus.os.version, diff --git a/src/platforms/app-plus/service/api/index.js b/src/platforms/app-plus/service/api/index.js index 3b35a9fb06..9759d198e2 100644 --- a/src/platforms/app-plus/service/api/index.js +++ b/src/platforms/app-plus/service/api/index.js @@ -41,6 +41,7 @@ export * from './plugin/oauth' export * from './plugin/payment' export * from './plugin/push' export * from './plugin/share' +export * from './plugin/event-bus' export * from './ui/keyboard' export * from './ui/navigation-bar' @@ -52,4 +53,4 @@ export { } from './ui/pull-down-refresh' -export * from './ui/tab-bar' +export * from './ui/tab-bar' diff --git a/src/platforms/app-plus/service/api/plugin/event-bus.js b/src/platforms/app-plus/service/api/plugin/event-bus.js new file mode 100644 index 0000000000..589fef7907 --- /dev/null +++ b/src/platforms/app-plus/service/api/plugin/event-bus.js @@ -0,0 +1,21 @@ +const Emitter = new Vue() + +function apply (ctx, method, args) { + return ctx[method].apply(ctx, args) +} + +export function $on () { + return apply(Emitter, '$on', [...arguments]) +} + +export function $off () { + return apply(Emitter, '$off', [...arguments]) +} + +export function $once () { + return apply(Emitter, '$once', [...arguments]) +} + +export function $emit () { + return apply(Emitter, '$emit', [...arguments]) +} diff --git a/src/platforms/app-plus/service/api/ui/tab-bar.js b/src/platforms/app-plus/service/api/ui/tab-bar.js index b7fdc29a45..0628507c68 100644 --- a/src/platforms/app-plus/service/api/ui/tab-bar.js +++ b/src/platforms/app-plus/service/api/ui/tab-bar.js @@ -2,14 +2,14 @@ import { isTabBarPage } from '../util' -import tabbar from '../../framework/tabbar' +import tabBar from '../../framework/tab-bar' export function setTabBarBadge ({ index, text, type }) { - tabbar.setTabBarBadge(type, index, text) + tabBar.setTabBarBadge(type, index, text) return { errMsg: 'setTabBarBadge:ok' } @@ -26,7 +26,7 @@ export function setTabBarItem ({ errMsg: 'setTabBarItem:fail not TabBar page' } } - tabbar.setTabBarItem(index, text, iconPath, selectedIconPath) + tabBar.setTabBarItem(index, text, iconPath, selectedIconPath) return { errMsg: 'setTabBarItem:ok' } @@ -43,7 +43,7 @@ export function setTabBarStyle ({ errMsg: 'setTabBarStyle:fail not TabBar page' } } - tabbar.setTabBarStyle({ + tabBar.setTabBarStyle({ color, selectedColor, backgroundColor, @@ -62,7 +62,7 @@ export function hideTabBar ({ errMsg: 'hideTabBar:fail not TabBar page' } } - tabbar.hideTabBar(animation) + tabBar.hideTabBar(animation) return { errMsg: 'hideTabBar:ok' } @@ -76,7 +76,7 @@ export function showTabBar ({ errMsg: 'showTabBar:fail not TabBar page' } } - tabbar.showTabBar(animation) + tabBar.showTabBar(animation) return { errMsg: 'showTabBar:ok' } diff --git a/src/platforms/app-plus/service/bridge.js b/src/platforms/app-plus/service/bridge.js index d6333bf8c9..c79340c245 100644 --- a/src/platforms/app-plus/service/bridge.js +++ b/src/platforms/app-plus/service/bridge.js @@ -13,4 +13,26 @@ export function requireNativePlugin (name) { */ export function publish (name, res) { return UniServiceJSBridge.emit('api.' + name, res) +} + +let lastStatusBarStyle + +export function setStatusBarStyle (statusBarStyle) { + if (!statusBarStyle) { + const pages = getCurrentPages() + if (!pages.length) { + return + } + statusBarStyle = pages[pages.length - 1].$page.meta.statusBarStyle + if (!statusBarStyle || statusBarStyle === lastStatusBarStyle) { + return + } + } + if (process.env.NODE_ENV !== 'production') { + console.log(`[uni-app] setStatusBarStyle`, statusBarStyle) + } + + lastStatusBarStyle = statusBarStyle + + plus.navigator.setStatusBarStyle(statusBarStyle) } diff --git a/src/platforms/app-plus/service/framework/app.js b/src/platforms/app-plus/service/framework/app.js index 398e998c67..ab40fd5251 100644 --- a/src/platforms/app-plus/service/framework/app.js +++ b/src/platforms/app-plus/service/framework/app.js @@ -2,6 +2,22 @@ import { callAppHook } from 'uni-core/service/plugins/util' +import initOn from 'uni-core/service/bridge/on' + +import { + getCurrentPages +} from './page' + +import { + registerPlusMessage +} from './plus-message' + +import { + isTabBarPage +} from '../api/util' + +import tabBar from './tab-bar' + let appCtx const NETWORK_TYPES = [ @@ -18,14 +34,11 @@ export function getApp () { return appCtx } -function initGlobalListeners ({ - uni, - plus, - UniServiceJSBridge -}) { +function initGlobalListeners () { const emit = UniServiceJSBridge.emit plus.key.addEventListener('backbutton', () => { + // TODO uni? uni.navigateBack({ from: 'backbutton' }) @@ -48,9 +61,7 @@ function initGlobalListeners ({ }) } -function initAppLaunch (appVm, { - __uniConfig -}) { +function initAppLaunch (appVm) { const args = { path: __uniConfig.entryPagePath, query: {}, @@ -61,14 +72,55 @@ function initAppLaunch (appVm, { callAppHook(appVm, 'onShow', args) } -export function registerApp (appVm, instanceContext) { +function initTabBar () { + if (!__uniConfig.tabBar || !__uniConfig.tabBar.list.length) { + return + } + + const currentTab = isTabBarPage(__uniConfig.entryPagePath) + if (currentTab) { + // 取当前 tab 索引值 + __uniConfig.tabBar.selected = __uniConfig.tabBar.list.indexOf(currentTab) + // 如果真实的首页与 condition 都是 tabbar,无需启用 realEntryPagePath 机制 + if (__uniConfig.realEntryPagePath && isTabBarPage(__uniConfig.realEntryPagePath)) { + delete __uniConfig.realEntryPagePath + } + } + + __uniConfig.__ready__ = true + + const onLaunchWebviewReady = function onLaunchWebviewReady () { + const tabBarView = tabBar.init(__uniConfig.tabBar, (item) => { + uni.switchTab({ + url: '/' + item.pagePath, + openType: 'switchTab', + from: 'tabbar' + }) + }) + tabBarView && plus.webview.getLaunchWebview().append(tabBarView) + } + if (plus.webview.getLaunchWebview()) { + onLaunchWebviewReady() + } else { + registerPlusMessage('UniWebviewReady-' + plus.runtime.appid, onLaunchWebviewReady, false) + } +} + +export function registerApp (appVm) { if (process.env.NODE_ENV !== 'production') { console.log(`[uni-app] registerApp`) } appCtx = appVm - initAppLaunch(appVm, instanceContext) + initOn(UniServiceJSBridge.on, { + getApp, + getCurrentPages + }) + + initAppLaunch(appVm) + + initGlobalListeners() - initGlobalListeners(instanceContext) + initTabBar() } diff --git a/src/platforms/app-plus/service/framework/bridge.js b/src/platforms/app-plus/service/framework/bridge.js deleted file mode 100644 index 6a358f6cf6..0000000000 --- a/src/platforms/app-plus/service/framework/bridge.js +++ /dev/null @@ -1,22 +0,0 @@ -import initOn from 'uni-core/service/bridge/on' - -let bridge - -export function initServiceJSBridge (Vue, instanceContext) { - if (bridge) { - return bridge - } - - const Emitter = new Vue() - - bridge = { - on: Emitter.$on.bind(Emitter), - off: Emitter.$off.bind(Emitter), - once: Emitter.$once.bind(Emitter), - emit: Emitter.$emit.bind(Emitter) - } - - initOn(bridge.on, instanceContext) - - return bridge -} diff --git a/src/platforms/app-plus/service/framework/config.js b/src/platforms/app-plus/service/framework/config.js index e6cbd97a1b..c442ef59f7 100644 --- a/src/platforms/app-plus/service/framework/config.js +++ b/src/platforms/app-plus/service/framework/config.js @@ -1,8 +1,5 @@ -export const uniConfig = Object.create(null) -export const uniRoutes = [] - function parseRoutes (config) { - uniRoutes.length = 0 + __uniRoutes.length = 0 /* eslint-disable no-mixed-operators */ const tabBarList = (config.tabBar && config.tabBar.list || []).map(item => item.pagePath) @@ -10,7 +7,7 @@ function parseRoutes (config) { const isTabBar = tabBarList.indexOf(pagePath) !== -1 const isQuit = isTabBar || (config.pages[0] === pagePath) const isNVue = !!config.page[pagePath].nvue - uniRoutes.push({ + __uniRoutes.push({ path: '/' + pagePath, meta: { isQuit, @@ -22,22 +19,20 @@ function parseRoutes (config) { }) } -export function registerConfig (config, { - plus -}) { - Object.assign(uniConfig, config) +export function registerConfig (config) { + Object.assign(__uniConfig, config) - uniConfig.viewport = '' - uniConfig.defaultFontSize = '' + __uniConfig.viewport = '' + __uniConfig.defaultFontSize = '' - if (uniConfig.nvueCompiler === 'uni-app') { - uniConfig.viewport = plus.screen.resolutionWidth - uniConfig.defaultFontSize = uniConfig.viewport / 20 + if (__uniConfig.nvueCompiler === 'uni-app') { + __uniConfig.viewport = plus.screen.resolutionWidth + __uniConfig.defaultFontSize = __uniConfig.viewport / 20 } - parseRoutes(uniConfig) + parseRoutes(__uniConfig) if (process.env.NODE_ENV !== 'production') { - console.log(`[uni-app] registerConfig`, uniConfig) + console.log(`[uni-app] registerConfig`, __uniConfig) } } diff --git a/src/platforms/app-plus/service/framework/create-instance-context.js b/src/platforms/app-plus/service/framework/create-instance-context.js deleted file mode 100644 index 737fd26fea..0000000000 --- a/src/platforms/app-plus/service/framework/create-instance-context.js +++ /dev/null @@ -1,74 +0,0 @@ -import { - getApp, - registerApp -} from './app' - -import { - registerPage, - getCurrentPages -} from './page' - -import { - uniConfig, - uniRoutes, - registerConfig -} from './config' - -import { - createUniInstance -} from './uni' - -import { - initServiceJSBridge -} from './bridge' - -let uni - -export function createInstanceContext (instanceContext) { - const { - weex, - Vue, - WeexPlus - } = instanceContext - const plus = new WeexPlus(weex) - - const UniServiceJSBridge = initServiceJSBridge(Vue, { - plus, - getApp, - getCurrentPages - }) - - function __registerPage (page) { - return registerPage(page, instanceContext) - } - - if (!uni) { - uni = createUniInstance( - weex, - plus, - uniConfig, - uniRoutes, - __registerPage, - UniServiceJSBridge, - getApp, - getCurrentPages - ) - } - - return { - __uniConfig: uniConfig, - __uniRoutes: uniRoutes, - __registerConfig (config) { - return registerConfig(config, instanceContext) - }, - __registerApp (appVm) { - return registerApp(appVm, instanceContext) - }, - __registerPage, - plus, - uni, - getApp, - getCurrentPages, - UniServiceJSBridge - } -} diff --git a/src/platforms/app-plus/service/framework/holder.js b/src/platforms/app-plus/service/framework/holder.js deleted file mode 100644 index 3cf4f5db68..0000000000 --- a/src/platforms/app-plus/service/framework/holder.js +++ /dev/null @@ -1,32 +0,0 @@ -export function createHolder (webview, { - navigationBar -}, { - Vue -}) { - const navigationBarState = Vue.observable(navigationBar) - - /* eslint-disable no-new */ - new Vue({ - created () { - this.$watch(() => navigationBarState.titleText, (val, oldVal) => { - webview.setStyle({ - titleNView: { - titleText: val || '' - } - }) - }) - this.$watch(() => [navigationBarState.textColor, navigationBarState.backgroundColor], (val) => { - webview.setStyle({ - titleNView: { - titleColor: val[0], - backgroundColor: val[1] - } - }) - }) - } - }) - - return { - navigationBar: navigationBarState - } -} diff --git a/src/platforms/app-plus/service/framework/page.js b/src/platforms/app-plus/service/framework/page.js index 5a463cd724..380d52a292 100644 --- a/src/platforms/app-plus/service/framework/page.js +++ b/src/platforms/app-plus/service/framework/page.js @@ -25,33 +25,35 @@ export function getCurrentPages () { * * * - */ + */ /** * 首页需要主动registerPage,二级页面路由跳转时registerPage */ export function registerPage ({ path, + query, webview -}, instanceContext) { - const routeOptions = JSON.parse(JSON.stringify(instanceContext.__uniRoutes.find(route => route.path === path))) +}) { + const routeOptions = JSON.parse(JSON.stringify(__uniRoutes.find(route => route.path === path))) if (!webview) { - webview = createWebview(path, instanceContext, routeOptions) + webview = createWebview(path, routeOptions) } if (process.env.NODE_ENV !== 'production') { console.log(`[uni-app] registerPage`, path, webview.id) } - initWebview(webview, instanceContext, webview.id === '1' && routeOptions) + initWebview(webview, webview.id === '1' && routeOptions) + + const route = path.slice(1) - const route = path.slice(1) - - webview.__uniapp_route = route + webview.__uniapp_route = route pages.push({ route, + options: Object.assign({}, query || {}), $getAppWebview () { return webview }, diff --git a/src/platforms/app-plus/service/framework/tabbar.js b/src/platforms/app-plus/service/framework/tab-bar.js similarity index 94% rename from src/platforms/app-plus/service/framework/tabbar.js rename to src/platforms/app-plus/service/framework/tab-bar.js index 05ee8e5e82..1f337470e0 100644 --- a/src/platforms/app-plus/service/framework/tabbar.js +++ b/src/platforms/app-plus/service/framework/tab-bar.js @@ -59,18 +59,12 @@ let initView = function () { viewStyles.bottom = 0 viewStyles.height += safeArea.bottom } - if (process.env.NODE_ENV !== 'production') { - console.log(`UNIAPP[tabbar]:${JSON.stringify(viewStyles)}`) - } view = new plus.nativeObj.View(TABBAR_VIEW_ID, viewStyles, getDraws()) view.interceptTouchEvent(true) view.addEventListener('click', (e) => { if (!__uniConfig.__ready__) { // 未 ready,不允许点击 - if (process.env.NODE_ENV !== 'production') { - console.log(`UNIAPP[tabbar].prevent`) - } return } const x = e.clientX diff --git a/src/platforms/app-plus/service/framework/webview/index.js b/src/platforms/app-plus/service/framework/webview/index.js index 020d9fbe59..c20c9ea29f 100644 --- a/src/platforms/app-plus/service/framework/webview/index.js +++ b/src/platforms/app-plus/service/framework/webview/index.js @@ -7,10 +7,6 @@ import { parseWebviewStyle } from './parser/webview-style-parser' -import { - parseNavigationBar -} from './parser/navigation-bar-parser' - let id = 2 const WEBVIEW_LISTENERS = { @@ -20,45 +16,39 @@ const WEBVIEW_LISTENERS = { 'titleNViewSearchInputClicked': 'onNavigationBarSearchInputClicked' } -export function createWebview (path, instanceContext, routeOptions) { +export function createWebview (path, routeOptions) { const webviewId = id++ const webviewStyle = parseWebviewStyle( webviewId, path, - routeOptions, - instanceContext + routeOptions ) if (process.env.NODE_ENV !== 'production') { console.log(`[uni-app] createWebview`, webviewId, path, webviewStyle) } - const webview = instanceContext.plus.webview.create('', String(webviewId), webviewStyle) - - webview.$navigationBar = parseNavigationBar(webviewStyle) + const webview = plus.webview.create('', String(webviewId), webviewStyle) return webview } -export function initWebview (webview, instanceContext, routeOptions) { +export function initWebview (webview, routeOptions) { if (isPlainObject(routeOptions)) { const webviewStyle = parseWebviewStyle( parseInt(webview.id), '', - routeOptions, - instanceContext + routeOptions ) if (process.env.NODE_ENV !== 'production') { console.log(`[uni-app] updateWebview`, webviewStyle) } - webview.$navigationBar = parseNavigationBar(webviewStyle) - webview.setStyle(webviewStyle) } const { on, emit - } = instanceContext.UniServiceJSBridge + } = UniServiceJSBridge // TODO subNVues Object.keys(WEBVIEW_LISTENERS).forEach(name => { diff --git a/src/platforms/app-plus/service/framework/webview/parser/pull-to-refresh-parser.js b/src/platforms/app-plus/service/framework/webview/parser/pull-to-refresh-parser.js index 36e2d9a219..bb4e93abd4 100644 --- a/src/platforms/app-plus/service/framework/webview/parser/pull-to-refresh-parser.js +++ b/src/platforms/app-plus/service/framework/webview/parser/pull-to-refresh-parser.js @@ -1,6 +1,4 @@ -export function parsePullToRefresh (routeOptions, { - plus -}) { +export function parsePullToRefresh (routeOptions) { const windowOptions = routeOptions.window if (windowOptions.enablePullDownRefresh) { @@ -34,7 +32,7 @@ export function parsePullToRefresh (routeOptions, { pullToRefreshStyles.snowColor = windowOptions.backgroundTextStyle } - Object.assign(pullToRefreshStyles, windowOptions.pullToRefresh || {}) + Object.assign(pullToRefreshStyles, windowOptions.pullToRefresh || {}) return pullToRefreshStyles } diff --git a/src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js b/src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js index 64b8e369bd..e68fc94d41 100644 --- a/src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js +++ b/src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js @@ -24,6 +24,8 @@ export function parseTitleNView (routeOptions) { titleColor: windowOptions.navigationBarTextStyle === 'black' ? '#000000' : '#ffffff' } + routeOptions.meta.statusBarStyle = windowOptions.navigationBarTextStyle === 'black' ? 'dark' : 'light' + if (isPlainObject(titleNView)) { return Object.assign(ret, titleNView) } diff --git a/src/platforms/app-plus/service/framework/webview/parser/webview-style-parser.js b/src/platforms/app-plus/service/framework/webview/parser/webview-style-parser.js index 49a50b39a0..d53c88f684 100644 --- a/src/platforms/app-plus/service/framework/webview/parser/webview-style-parser.js +++ b/src/platforms/app-plus/service/framework/webview/parser/webview-style-parser.js @@ -23,22 +23,18 @@ const WEBVIEW_STYLE_BLACKLIST = [ 'pullToRefresh' ] -export function parseWebviewStyle (id, path, routeOptions = {}, instanceContext) { - const { - __uniConfig - } = instanceContext - +export function parseWebviewStyle (id, path, routeOptions = {}) { const webviewStyle = Object.create(null) // 合并 - const windowOptions = Object.assign( + routeOptions.window = Object.assign( JSON.parse(JSON.stringify(__uniConfig.window || {})), routeOptions.window || {} ) - Object.keys(windowOptions).forEach(name => { + Object.keys(routeOptions.window).forEach(name => { if (WEBVIEW_STYLE_BLACKLIST.indexOf(name) === -1) { - webviewStyle[name] = windowOptions[name] + webviewStyle[name] = routeOptions.window[name] } }) @@ -50,7 +46,7 @@ export function parseWebviewStyle (id, path, routeOptions = {}, instanceContext) webviewStyle.titleNView = titleNView } - const pullToRefresh = parsePullToRefresh(routeOptions, instanceContext) + const pullToRefresh = parsePullToRefresh(routeOptions) if (pullToRefresh) { if (pullToRefresh.style === 'circle') { webviewStyle.bounce = 'none' diff --git a/src/platforms/app-plus/service/index.js b/src/platforms/app-plus/service/index.js new file mode 100644 index 0000000000..afc6fafe3b --- /dev/null +++ b/src/platforms/app-plus/service/index.js @@ -0,0 +1,33 @@ +import { + getApp, + registerApp +} from './framework/app' + +import { + registerPage, + getCurrentPages +} from './framework/page' + +import { + registerConfig +} from './framework/config' + +import { + uni +} from 'uni-core/service/uni' + +import { + invokeCallbackHandler +} from 'uni-helpers/api' + +UniServiceJSBridge.publishHandler = UniServiceJSBridge.emit // TODO +UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler + +export default { + __registerConfig: registerConfig, + __registerApp: registerApp, + __registerPage: registerPage, + uni, + getApp, + getCurrentPages +} diff --git a/src/platforms/app-plus/service/polyfill.js b/src/platforms/app-plus/service/polyfill.js deleted file mode 100644 index c08b29e8cc..0000000000 --- a/src/platforms/app-plus/service/polyfill.js +++ /dev/null @@ -1,6 +0,0 @@ -import { - invokeCallbackHandler -} from 'uni-helpers/api' - -UniServiceJSBridge.publishHandler = UniServiceJSBridge.emit -UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler diff --git a/src/platforms/app-plus/service/uni.js b/src/platforms/app-plus/service/uni.js deleted file mode 100644 index 159764acee..0000000000 --- a/src/platforms/app-plus/service/uni.js +++ /dev/null @@ -1,27 +0,0 @@ -import './polyfill' - -import apis from 'uni-helpers/apis' - -import { - wrapper, - wrapperUnimplemented -} from 'uni-helpers/api' - -import { - promisify -} from 'uni-helpers/promise' - -import baseApi from 'uni-core/service/api' -import platformApi from 'uni-platform/service/api' - -const api = Object.assign(Object.create(null), baseApi, platformApi) - -const uni = Object.create(null) - -apis.forEach(name => { - if (api[name]) { - uni[name] = promisify(name, wrapper(name, api[name])) - } else { - uni[name] = wrapperUnimplemented(name) - } -}) diff --git a/src/platforms/h5/service/api/network/request.js b/src/platforms/h5/service/api/network/request.js index c8e5b2dc6f..34d7c2fa03 100644 --- a/src/platforms/h5/service/api/network/request.js +++ b/src/platforms/h5/service/api/network/request.js @@ -1,182 +1,155 @@ -/** - * 请求任务类 - */ -class RequestTask { - _xhr - constructor (xhr) { - this._xhr = xhr - } - abort () { - if (this._xhr) { - this._xhr.abort() - delete this._xhr - } - } -} -/** - * 拼接网址和参数 - * @param {string} url 网址 - * @param {any} data 参数 - * @return {string} - */ -function setUrl (url, data) { - var str = url.split('#') - var hash = str[1] || '' - str = str[0].split('?') - var query = str[1] || '' - url = str[0] - var search = query.split('&').filter(item => item) - query = {} - search.forEach(item => { - item = item.split('=') - query[item[0]] = item[1] - }) - for (var key in data) { - if (data.hasOwnProperty(key)) { - query[encodeURIComponent(key)] = encodeURIComponent(data[key]) - } - } - query = Object.keys(query).map(item => `${item}=${query[item]}`).join('&') - return url + (query ? '?' + query : '') + (hash ? '#' + hash : '') -} -/** - * 解析响应头 - * @param {string} headers - * @return {object} - */ -function parseHeaders (headers) { - var headersObject = {} - var headersArray = headers.split('\n') - headersArray.forEach(header => { - var find = header.match(/(\S+\s*):\s*(.*)/) - if (!find || find.length !== 3) { - return - } - var key = find[1] - var val = find[2] - headersObject[key] = val - }) - return headersObject -} -/** - * 发起网络请求 - * @param {object} param0 - * @param {string} callbackId - * @return {RequestTask} - */ -export function request ({ - url, - data, - header, - method, - dataType, - responseType -}, callbackId) { - const { - invokeCallbackHandler: invoke - } = UniServiceJSBridge - var body = null - var timeout = (__uniConfig.networkTimeout && __uniConfig.networkTimeout.request) || 60 * 1000 - // 根据请求类型处理数据 - var contentType - for (const key in header) { - if (header.hasOwnProperty(key)) { - if (key.toLowerCase() === 'content-type') { - contentType = header[key] - if (contentType.indexOf('application/json') === 0) { - contentType = 'json' - } else if (contentType.indexOf('application/x-www-form-urlencoded') === 0) { - contentType = 'urlencoded' - } else { - contentType = 'string' - } - break - } - } - } - if (method === 'GET') { - url = setUrl(url, data) - } else { - if (!contentType) { - /** - * 跨域时部分服务器OPTION响应头Access-Control-Allow-Headers未包含Content-Type会请求失败 - */ - header['Content-Type'] = 'application/json' - contentType = 'json' - } - if (typeof data === 'string' || data instanceof ArrayBuffer) { - body = data - } else { - if (contentType === 'json') { - try { - body = JSON.stringify(data) - } catch (error) { - body = data.toString() - } - } else if (contentType === 'urlencoded') { - let bodyArray = [] - for (let key in data) { - if (data.hasOwnProperty(key)) { - bodyArray.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])) - } - } - body = bodyArray.join('&') - } else { - body = data.toString() - } - } - } - var xhr = new XMLHttpRequest() - var requestTask = new RequestTask(xhr) - xhr.open(method, url) - for (var key in header) { - if (header.hasOwnProperty(key)) { - xhr.setRequestHeader(key, header[key]) - } - } - - var timer = setTimeout(function () { - xhr.onload = xhr.onabort = xhr.onerror = null - requestTask.abort() - invoke(callbackId, { - errMsg: 'request:fail timeout' - }) - }, timeout) - xhr.responseType = responseType.toLowerCase() - xhr.onload = function () { - clearTimeout(timer) - let statusCode = xhr.status - let res = responseType === 'TEXT' ? xhr.responseText : xhr.response - if (responseType === 'TEXT' && dataType === 'JSON') { - try { - res = JSON.parse(res) - } catch (error) { - // 和微信一致解析失败不抛出错误 - // invoke(callbackId, { - // errMsg: 'request:fail json parse error' - // }) - // return - } - } - invoke(callbackId, { - data: res, - statusCode, - header: parseHeaders(xhr.getAllResponseHeaders()), - errMsg: 'request:ok' - }) - } - xhr.onabort = function () { - clearTimeout(timer) - invoke(callbackId, { - errMsg: 'request:fail abort' - }) - } - xhr.onerror = function () { - clearTimeout(timer) - invoke(callbackId, { - errMsg: 'request:fail' - }) - } - xhr.send(body) - return requestTask +/** + * 请求任务类 + */ +class RequestTask { + _xhr + constructor (xhr) { + this._xhr = xhr + } + abort () { + if (this._xhr) { + this._xhr.abort() + delete this._xhr + } + } +} + +/** + * 解析响应头 + * @param {string} headers + * @return {object} + */ +function parseHeaders (headers) { + var headersObject = {} + var headersArray = headers.split('\n') + headersArray.forEach(header => { + var find = header.match(/(\S+\s*):\s*(.*)/) + if (!find || find.length !== 3) { + return + } + var key = find[1] + var val = find[2] + headersObject[key] = val + }) + return headersObject +} +/** + * 发起网络请求 + * @param {object} param0 + * @param {string} callbackId + * @return {RequestTask} + */ +export function request ({ + url, + data, + header, + method, + dataType, + responseType +}, callbackId) { + const { + invokeCallbackHandler: invoke + } = UniServiceJSBridge + var body = null + var timeout = (__uniConfig.networkTimeout && __uniConfig.networkTimeout.request) || 60 * 1000 + // 根据请求类型处理数据 + var contentType + for (const key in header) { + if (header.hasOwnProperty(key)) { + if (key.toLowerCase() === 'content-type') { + contentType = header[key] + if (contentType.indexOf('application/json') === 0) { + contentType = 'json' + } else if (contentType.indexOf('application/x-www-form-urlencoded') === 0) { + contentType = 'urlencoded' + } else { + contentType = 'string' + } + break + } + } + } + if (method !== 'GET') { + if (!contentType) { + /** + * 跨域时部分服务器OPTION响应头Access-Control-Allow-Headers未包含Content-Type会请求失败 + */ + header['Content-Type'] = 'application/json' + contentType = 'json' + } + if (typeof data === 'string' || data instanceof ArrayBuffer) { + body = data + } else { + if (contentType === 'json') { + try { + body = JSON.stringify(data) + } catch (error) { + body = data.toString() + } + } else if (contentType === 'urlencoded') { + let bodyArray = [] + for (let key in data) { + if (data.hasOwnProperty(key)) { + bodyArray.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key])) + } + } + body = bodyArray.join('&') + } else { + body = data.toString() + } + } + } + var xhr = new XMLHttpRequest() + var requestTask = new RequestTask(xhr) + xhr.open(method, url) + for (var key in header) { + if (header.hasOwnProperty(key)) { + xhr.setRequestHeader(key, header[key]) + } + } + + var timer = setTimeout(function () { + xhr.onload = xhr.onabort = xhr.onerror = null + requestTask.abort() + invoke(callbackId, { + errMsg: 'request:fail timeout' + }) + }, timeout) + xhr.responseType = responseType.toLowerCase() + xhr.onload = function () { + clearTimeout(timer) + let statusCode = xhr.status + let res = responseType === 'TEXT' ? xhr.responseText : xhr.response + if (responseType === 'TEXT' && dataType === 'JSON') { + try { + res = JSON.parse(res) + } catch (error) { + // 和微信一致解析失败不抛出错误 + // invoke(callbackId, { + // errMsg: 'request:fail json parse error' + // }) + // return + } + } + invoke(callbackId, { + data: res, + statusCode, + header: parseHeaders(xhr.getAllResponseHeaders()), + errMsg: 'request:ok' + }) + } + xhr.onabort = function () { + clearTimeout(timer) + invoke(callbackId, { + errMsg: 'request:fail abort' + }) + } + xhr.onerror = function () { + clearTimeout(timer) + invoke(callbackId, { + errMsg: 'request:fail' + }) + } + xhr.send(body) + return requestTask } diff --git a/src/platforms/h5/service/api/event-bus.js b/src/platforms/h5/service/api/plugin/event-bus.js similarity index 100% rename from src/platforms/h5/service/api/event-bus.js rename to src/platforms/h5/service/api/plugin/event-bus.js diff --git a/src/platforms/h5/service/index.js b/src/platforms/h5/service/index.js index eaabcd327c..d4343add2b 100644 --- a/src/platforms/h5/service/index.js +++ b/src/platforms/h5/service/index.js @@ -3,7 +3,7 @@ import initSubscribe from 'uni-core/service/bridge/subscribe' import { uni -} from './uni' +} from 'uni-core/service/uni' import { getApp, diff --git a/src/shared/index.js b/src/shared/index.js index 30e1458ea0..c9878146a4 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -1,3 +1,4 @@ export * from './env' export * from './util' export * from './color' +export * from './query' -- GitLab