diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a4f20bffe8ff5527af5cf6047f20b911524a148a..26d8e69a1eaef5454985990a8c37e82260a95ced 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -83,7 +83,7 @@ * commands * lib * packages:内置依赖包 - * mp-vue:小程序平台使用的 Vue 依赖,由仓库 [fxy060608/vue](https://github.com/fxy060608/vue) 编译。 + * mp-vue:小程序平台使用的 Vue 依赖,由仓库 [fxy060608/vue#dev](https://github.com/fxy060608/vue) 编译。 * vue-cli-plugin-uni-optimize:Vue CLI 插件,主要处理 H5 平台摇树优化 * webpack-uni-mp-loader:webpack loader,用于生成小程序平台的各种文件 * webpack-uni-pages-loader:webpack loader,用于解析 pages.json @@ -144,4 +144,4 @@ * quickapp-native:快应用平台运行时 * quickapp-webview:快应用平台运行时 * shared -* test:单元测试(运行时) \ No newline at end of file +* test:单元测试(运行时) diff --git a/README.md b/README.md index 5da1b37ba94955a2bf33d4f43452747aea6d8fa0..ac60047618b456b6a4f8cc93eeab5ef3f788f5b4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # uni-app +

+ 简体中文 | English +

+ `uni-app` 是一个使用 `Vue.js` 开发小程序、H5、App的统一前端框架。官网地址:[https://uniapp.dcloud.io](https://uniapp.dcloud.io) 开发者使用 `Vue` 语法编写代码,`uni-app` 框架将其编译到 小程序(微信/支付宝/百度/字节跳动/QQ/快手/钉钉/小红书)、App(iOS/Android)、H5等多个平台,保证其正确运行并达到优秀体验。 + # uni-app的特点 - 开发者和案例更多:HBuilder装机量800万台,开发者社区月活百万,70多个QQ微信群承载10万人。案例众多,uni统计月活超10亿([详见](https://uniapp.dcloud.io/case)) @@ -15,9 +20,11 @@ ## 扫码体验 -开发一次,编译到11个平台。依次扫描11个二维码,亲自体验最全面的跨平台效果! +开发一次,编译到14个平台。依次扫描14个二维码,亲自体验最全面的跨平台效果! - +
+ +
*注: 某些平台不能提交简单demo,补充了一些其他功能。* diff --git a/README_en-US.md b/README_en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..7d70e65978213ade593ea01f6d42700b681dd763 --- /dev/null +++ b/README_en-US.md @@ -0,0 +1,86 @@ +# uni-app + +

+ 简体中文 | English +

+ +`uni-app` is a unified front-end framework that uses `Vue.js` to develop applet, H5, and App. Official website address: [https://uniapp.dcloud.io](https://uniapp.dcloud.io) + +Developers use `Vue` syntax to write code, and `uni-app` framework compiles it into small programs (WeChat/Alipay/Baidu/ByteDance/QQ/Kuishou/Dingding/Xiaohongshu), App (iOS/Android) ), H5 and other platforms to ensure its correct operation and achieve an excellent experience. + +# Features of uni-app + +- More developers and cases: HBuilder has installed 8 million units, the developer community has one million monthly active users, and more than 70 QQ and WeChat groups carry 100,000 people. There are many cases, and the uni statistics exceed 1 billion monthly active users ([see details](https://uniapp.dcloud.io/case)) +- Higher performance (see [Review](https://juejin.im/post/5ca1736af265da30ae314248)) +- Richer surrounding ecology, [Plugin Market](https://ext.dcloud.net.cn/) thousands of plugins +- Provide a better development experience and higher engineering efficiency than the native development of small programs +- The smoothness across the ends is more complete, and the characteristics of each end are more flexible, which can truly achieve multi-end coverage of a set of codes, without the need for multi-end maintenance and upgrades at each end +- Authoritative recognition: Alipay's official tool has built-in uni-app ([see details](https://docs.alipay.com/mini/ide/0.70-stable)), Tencent Classroom's official self-made uni-app training video ([ For details, see](https://ask.dcloud.net.cn/article/35640)) + +## Scan code experience + +Develop once, compile to 3 platforms. Scan 3 QR codes in sequence to experience the most comprehensive cross-platform effect for yourself! + +
+ +
+ +## quick start + +`uni-app` supports two ways to quickly create projects through the `vue-cli` command line and the `HBuilderX` visual interface: + +- [vue-cli command line mode](https://uniapp.dcloud.io/quickstart?id=_2-%E9%80%9A%E8%BF%87vue-cli%E5%91%BD%E4%BB%A4%E8%A1%8C): not limited to IDE, suitable for developers familiar with node, extended reading: [Developing uni-app in vscode](https://ask.dcloud.net.cn/article/36286 ), [Developing uni-app in WebStorm](https://ask.dcloud.net.cn/article/36307) +- [HBuilderX visual interface](https://uniapp.dcloud.io/quickstart?id=_1-%E9%80%9A%E8%BF%87-hbuilderx-%E5%8F%AF%E8%A7%86%E5%8C%96%E7%95%8C%E9%9D%A2): dedicated IDE, built-in related environment, out-of-the-box, and higher development efficiency. + +## Project cases + +Case show: [uniapp.dcloud.io/case](https://uniapp.dcloud.io/case) + +Welcome to submit your application, [uni-app case collection](https://github.com/dcloudio/uni-app/issues/6) + +## Demand Wall + +The function points supported by the `uni-app` plan will be displayed on the demand wall, and the voting opinions of developers will be collected. [Go to Vote](https://dev.dcloud.net.cn/wish/). + +## Changelog + +`uni-app` has always maintained high-frequency update iterations. For details, see [Official version update log](https://uniapp.dcloud.net.cn/release), [Alpha version update log](https://uniapp. dcloud.net.cn/release-note-alpha). + +## Forum + +Since `DCloud` has more than 70 QQ and WeChat groups, the official has been unable to maintain more communication groups. Please go to the official forum to communicate: [https://ask.dcloud.net.cn/explore/](https://ask.dcloud.net.cn/explore/). Forums provide more professional tools and services than issues. + +## Plugin Market + +`uni-app` has a rich plugin ecosystem. Many developers have submitted thousands of components, sdk, and project templates. For details, see: [https://ext.dcloud.net.cn/](https://ext.dcloud.net.cn/) + +In addition to many third-party ui libraries, the official also provides uni-ui, which has stronger advantages in performance and cross-end compatibility. For details, see: [https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) + +## How to migrate existing projects to uni-app system + +- WeChat applet conversion uni-app guide and converter: [https://ask.dcloud.net.cn/article/35786](https://ask.dcloud.net.cn/article/35786) +- Vue h5 project conversion uni-app guide: [https://ask.dcloud.net.cn/article/36174](https://ask.dcloud.net.cn/article/36174) +- mpvue project (component) migration guide, example and resource summary: [https://ask.dcloud.net.cn/article/34945](https://ask.dcloud.net.cn/article/34945) +- wepy to uni-app converter: [https://github.com/zhangdaren/wepy-to-uniapp](https://github.com/zhangdaren/wepy-to-uniapp) + +## Frequently Asked Questions + +- Q: Different terminals have different needs and features, and login and payment are also different. How to unify? +- A: The difference part uses conditional compilation. uni-app provides flexible and powerful [conditional compilation](https://uniapp.dcloud.io/platform). Can perfectly handle the multiplexed part and the difference part. A real set of project source code. When the business is upgraded, multi-terminal maintenance is no longer required. If there is multi-end maintenance, it is often delayed because the traffic on some ends is not large, so that those users cannot enjoy the latest services. In addition, the login payment in the client part has been unified into the same api by uni-app. + + +- Q: Is multi-terminal a compromise and will it cause performance degradation? +- A: good question. It's really hard to be multi-terminal without compromising performance, but uni-app does it. On the h5 side, its performance and package size are consistent with those developed directly using vue.js; on the applet side, its performance is better than most development frameworks. It is better for the user to manually write setdata, just as it is more efficient to use vue.js to update the interface than to manually write js to modify the dom; in App, uni-app supports dual engines for webview rendering and native rendering. When native rendering is enabled, css writing is limited, However, the performance is very close to the effect of native development. In the current mobile phone environment, applications with less than ten million daily activities will not encounter any pressure when using uni-app in the App. Of course, it is also possible to change some pages to uni-app in the native app that has already been done; in addition, we will complete a lot of cross-end processing at the compile time, which will reduce the efficiency impact on the runtime. + + +- Q: Do you not need uni-app if you don't do multi-end? +- A: No. A large number of developers use uni-app as only one end, see [Case](https://uniapp.dcloud.io/case) for details. For developers, with an excellent tool in hand, there is nothing to worry about. + +- Q: Will uni-app change the open source protocol and switch to charging in the future? +- A: The official promise will never change the open source agreement. Regardless of HBuilderX, uni-app, or App, it is always free for Chinese people. + +## more info + +- Evaluation: [Cross-end Development Framework Deep Heng Evaluation 2020 Edition](https://juejin.im/post/5e8e8d5a6fb9a03c6d3d9f42) +- Evaluation: [In-depth testing for a week, mainstream multi-terminal frameworks compete](https://mp.weixin.qq.com/s/jIDEHfuMnED6HTfNgjsW4w) +- [Comparison of uni-app on the App side with flutter and react native](https://ask.dcloud.net.cn/article/36083) diff --git a/lerna.json b/lerna.json index f57907b3109090474b7188f557e52585a59dd25b..72ccb1d069f76c0f4e66ff10ea403b6fdc3563d5 100644 --- a/lerna.json +++ b/lerna.json @@ -12,5 +12,5 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-32920211029001" + "version": "2.0.1-36520221121002" } diff --git a/lib/apis.js b/lib/apis.js index 18215f7b60146c9ece5106966233ddeea442b5f5..867e7e3ad47a6ebfc7cd078fc9528ae99ff414b1 100644 --- a/lib/apis.js +++ b/lib/apis.js @@ -135,7 +135,8 @@ const device = [ 'onThemeChange', 'onUIStyleChange', 'getSystemSetting', - 'getAppAuthorizeSetting' + 'getAppAuthorizeSetting', + 'openAppAuthorizeSetting' ] const keyboard = [ @@ -269,7 +270,7 @@ const plugin = [ 'invokePushCallback', 'getPushClientId', 'onPushMessage', - 'offPushMessage', + 'offPushMessage', 'createPushMessage' ] diff --git a/lib/h5/uni.config.js b/lib/h5/uni.config.js index 60be35d01b94deb343aafabbe21646af88cc27ee..0c1125fa0925bc0f907fe326b8e66b2af7372248 100644 --- a/lib/h5/uni.config.js +++ b/lib/h5/uni.config.js @@ -19,12 +19,13 @@ function transform(content) { } function getIndexCssPath(assetsDir, template) { + const CopyWebpackPluginVersion = Number(require('copy-webpack-plugin/package.json').version.split('.')[0]) const VUE_APP_INDEX_CSS_HASH = process.env.VUE_APP_INDEX_CSS_HASH if (VUE_APP_INDEX_CSS_HASH) { try { const templateContent = fs.readFileSync(getTemplatePath(template)) if (/\bVUE_APP_INDEX_CSS_HASH\b/.test(templateContent)) { - return path.join(assetsDir, `[name].${VUE_APP_INDEX_CSS_HASH}.[ext]`) + return path.join(assetsDir, `[name].${VUE_APP_INDEX_CSS_HASH}${CopyWebpackPluginVersion > 5 ? '' : '.'}[ext]`) } } catch (e) {} } diff --git a/package.json b/package.json index 4e75fe6b4b2fb78a121eac21d1c758c469605887..6e098f2b2cc109f15fcb579fe7f9a3b8b9a9e7fd 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "copy": "^0.3.2", "cross-env": "^7.0.2", "del": "^5.1.0", + "escape-string-regexp": "4", "eslint": "^6.8.0", "eslint-config-standard": "^14.1.0", "eslint-loader": "^3.0.3", @@ -71,6 +72,7 @@ "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "eslint-plugin-vue": "^6.2.2", + "glob-escape": "^0.0.2", "i18n": "^0.13.3", "jest": "^25.1.0", "jsdom": "^16.2.1", @@ -153,4 +155,4 @@ "main": "index.js", "description": "", "author": "" -} \ No newline at end of file +} diff --git a/packages/uni-app-plus-nvue/package.json b/packages/uni-app-plus-nvue/package.json index 4a190a65e2110e988e5018b30e327131ff78c36d..91abc275c44d2d6468572dbdb7cd72fdff4d2973 100644 --- a/packages/uni-app-plus-nvue/package.json +++ b/packages/uni-app-plus-nvue/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-app-plus-nvue", - "version": "2.0.0-32920211029001", + "version": "2.0.1-36520221121002", "description": "uni-app app-plus-nvue", "main": "dist/index.js", "repository": { @@ -13,5 +13,5 @@ }, "author": "fxy060608", "license": "Apache-2.0", - "gitHead": "9e2d0f8e244724fcd64880316c57d837d1778cf8" + "gitHead": "4a974e44466ae58194372e446299cf83c7a3ad2c" } diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 597aa8caaa7fb5239da5e9059de964aaf7c99807..b28c761a86709e2b639d6347c697d3b2203af417 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1,5 +1,5 @@ -import Vue from 'vue'; import { initVueI18n } from '@dcloudio/uni-i18n'; +import Vue from 'vue'; let realAtob; @@ -98,7 +98,7 @@ function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } -function noop () {} +function noop () { } /** * Create a cached version of a pure function. @@ -314,7 +314,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/; + /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/; const CONTEXT_API_RE = /^create|Manager$/; @@ -322,7 +322,7 @@ const CONTEXT_API_RE = /^create|Manager$/; const CONTEXT_API_RE_EXC = ['createBLEConnection']; // 同步例外情况 -const ASYNC_API = ['createBLEConnection']; +const ASYNC_API = ['createBLEConnection', 'createPushMessage']; const CALLBACK_API_RE = /^on|^off/; @@ -427,68 +427,389 @@ function upx2px (number, newDeviceWidth) { return number < 0 ? -result : result } -function getLocale () { - // 优先使用 $locale - const app = getApp({ - allowDefault: true +var en = { + "uni.app.quit": "Press back button again to exit", + "uni.async.error": "The connection timed out, click the screen to try again.", + "uni.showActionSheet.cancel": "Cancel", + "uni.showToast.unpaired": "Please note showToast must be paired with hideToast", + "uni.showLoading.unpaired": "Please note showLoading must be paired with hideLoading", + "uni.showModal.cancel": "Cancel", + "uni.showModal.confirm": "OK", + "uni.chooseImage.cancel": "Cancel", + "uni.chooseImage.sourceType.album": "Album", + "uni.chooseImage.sourceType.camera": "Camera", + "uni.chooseVideo.cancel": "Cancel", + "uni.chooseVideo.sourceType.album": "Album", + "uni.chooseVideo.sourceType.camera": "Camera", + "uni.chooseFile.notUserActivation": "File chooser dialog can only be shown with a user activation", + "uni.previewImage.cancel": "Cancel", + "uni.previewImage.button.save": "Save Image", + "uni.previewImage.save.success": "Saved successfully", + "uni.previewImage.save.fail": "Save failed", + "uni.setClipboardData.success": "Content copied", + "uni.scanCode.title": "Scan code", + "uni.scanCode.album": "Album", + "uni.scanCode.fail": "Recognition failure", + "uni.scanCode.flash.on": "Tap to turn light on", + "uni.scanCode.flash.off": "Tap to turn light off", + "uni.startSoterAuthentication.authContent": "Fingerprint recognition", + "uni.picker.done": "Done", + "uni.picker.cancel": "Cancel", + "uni.video.danmu": "Danmu", + "uni.video.volume": "Volume", + "uni.button.feedback.title": "feedback", + "uni.button.feedback.send": "send", + "uni.chooseLocation.search": "Find Place", + "uni.chooseLocation.cancel": "Cancel" +}; + +var es = { + "uni.app.quit": "Pulse otra vez para salir", + "uni.async.error": "Se agotó el tiempo de conexión, haga clic en la pantalla para volver a intentarlo.", + "uni.showActionSheet.cancel": "Cancelar", + "uni.showToast.unpaired": "Tenga en cuenta que showToast debe estar emparejado con hideToast", + "uni.showLoading.unpaired": "Tenga en cuenta que showLoading debe estar emparejado con hideLoading", + "uni.showModal.cancel": "Cancelar", + "uni.showModal.confirm": "OK", + "uni.chooseImage.cancel": "Cancelar", + "uni.chooseImage.sourceType.album": "Álbum", + "uni.chooseImage.sourceType.camera": "Cámara", + "uni.chooseVideo.cancel": "Cancelar", + "uni.chooseVideo.sourceType.album": "Álbum", + "uni.chooseVideo.sourceType.camera": "Cámara", + "uni.chooseFile.notUserActivation": "El cuadro de diálogo del selector de archivos solo se puede mostrar con la activación del usuario", + "uni.previewImage.cancel": "Cancelar", + "uni.previewImage.button.save": "Guardar imagen", + "uni.previewImage.save.success": "Guardado exitosamente", + "uni.previewImage.save.fail": "Error al guardar", + "uni.setClipboardData.success": "Contenido copiado", + "uni.scanCode.title": "Código de escaneo", + "uni.scanCode.album": "Álbum", + "uni.scanCode.fail": "Échec de la reconnaissance", + "uni.scanCode.flash.on": "Toque para encender la luz", + "uni.scanCode.flash.off": "Toque para apagar la luz", + "uni.startSoterAuthentication.authContent": "Reconocimiento de huellas dactilares", + "uni.picker.done": "OK", + "uni.picker.cancel": "Cancelar", + "uni.video.danmu": "Danmu", + "uni.video.volume": "Volumen", + "uni.button.feedback.title": "realimentación", + "uni.button.feedback.send": "enviar", + "uni.chooseLocation.search": "Encontrar", + "uni.chooseLocation.cancel": "Cancelar" +}; + +var fr = { + "uni.app.quit": "Appuyez à nouveau pour quitter l'application", + "uni.async.error": "La connexion a expiré, cliquez sur l'écran pour réessayer.", + "uni.showActionSheet.cancel": "Annuler", + "uni.showToast.unpaired": "Veuillez noter que showToast doit être associé à hideToast", + "uni.showLoading.unpaired": "Veuillez noter que showLoading doit être associé à hideLoading", + "uni.showModal.cancel": "Annuler", + "uni.showModal.confirm": "OK", + "uni.chooseImage.cancel": "Annuler", + "uni.chooseImage.sourceType.album": "Album", + "uni.chooseImage.sourceType.camera": "Caméra", + "uni.chooseVideo.cancel": "Annuler", + "uni.chooseVideo.sourceType.album": "Album", + "uni.chooseVideo.sourceType.camera": "Caméra", + "uni.chooseFile.notUserActivation": "La boîte de dialogue du sélecteur de fichier ne peut être affichée qu'avec une activation par l'utilisateur", + "uni.previewImage.cancel": "Annuler", + "uni.previewImage.button.save": "Guardar imagen", + "uni.previewImage.save.success": "Enregistré avec succès", + "uni.previewImage.save.fail": "Échec de la sauvegarde", + "uni.setClipboardData.success": "Contenu copié", + "uni.scanCode.title": "Code d’analyse", + "uni.scanCode.album": "Album", + "uni.scanCode.fail": "Fallo de reconocimiento", + "uni.scanCode.flash.on": "Appuyez pour activer l'éclairage", + "uni.scanCode.flash.off": "Appuyez pour désactiver l'éclairage", + "uni.startSoterAuthentication.authContent": "Reconnaissance de l'empreinte digitale", + "uni.picker.done": "OK", + "uni.picker.cancel": "Annuler", + "uni.video.danmu": "Danmu", + "uni.video.volume": "Le Volume", + "uni.button.feedback.title": "retour d'information", + "uni.button.feedback.send": "envoyer", + "uni.chooseLocation.search": "Trouve", + "uni.chooseLocation.cancel": "Annuler" +}; + +var zhHans = { + "uni.app.quit": "再按一次退出应用", + "uni.async.error": "连接服务器超时,点击屏幕重试", + "uni.showActionSheet.cancel": "取消", + "uni.showToast.unpaired": "请注意 showToast 与 hideToast 必须配对使用", + "uni.showLoading.unpaired": "请注意 showLoading 与 hideLoading 必须配对使用", + "uni.showModal.cancel": "取消", + "uni.showModal.confirm": "确定", + "uni.chooseImage.cancel": "取消", + "uni.chooseImage.sourceType.album": "从相册选择", + "uni.chooseImage.sourceType.camera": "拍摄", + "uni.chooseVideo.cancel": "取消", + "uni.chooseVideo.sourceType.album": "从相册选择", + "uni.chooseVideo.sourceType.camera": "拍摄", + "uni.chooseFile.notUserActivation": "文件选择器对话框只能在由用户激活时显示", + "uni.previewImage.cancel": "取消", + "uni.previewImage.button.save": "保存图像", + "uni.previewImage.save.success": "保存图像到相册成功", + "uni.previewImage.save.fail": "保存图像到相册失败", + "uni.setClipboardData.success": "内容已复制", + "uni.scanCode.title": "扫码", + "uni.scanCode.album": "相册", + "uni.scanCode.fail": "识别失败", + "uni.scanCode.flash.on": "轻触照亮", + "uni.scanCode.flash.off": "轻触关闭", + "uni.startSoterAuthentication.authContent": "指纹识别中...", + "uni.picker.done": "完成", + "uni.picker.cancel": "取消", + "uni.video.danmu": "弹幕", + "uni.video.volume": "音量", + "uni.button.feedback.title": "问题反馈", + "uni.button.feedback.send": "发送", + "uni.chooseLocation.search": "搜索地点", + "uni.chooseLocation.cancel": "取消" +}; + +var zhHant = { + "uni.app.quit": "再按一次退出應用", + "uni.async.error": "連接服務器超時,點擊屏幕重試", + "uni.showActionSheet.cancel": "取消", + "uni.showToast.unpaired": "請注意 showToast 與 hideToast 必須配對使用", + "uni.showLoading.unpaired": "請注意 showLoading 與 hideLoading 必須配對使用", + "uni.showModal.cancel": "取消", + "uni.showModal.confirm": "確定", + "uni.chooseImage.cancel": "取消", + "uni.chooseImage.sourceType.album": "從相冊選擇", + "uni.chooseImage.sourceType.camera": "拍攝", + "uni.chooseVideo.cancel": "取消", + "uni.chooseVideo.sourceType.album": "從相冊選擇", + "uni.chooseVideo.sourceType.camera": "拍攝", + "uni.chooseFile.notUserActivation": "文件選擇器對話框只能在由用戶激活時顯示", + "uni.previewImage.cancel": "取消", + "uni.previewImage.button.save": "保存圖像", + "uni.previewImage.save.success": "保存圖像到相冊成功", + "uni.previewImage.save.fail": "保存圖像到相冊失敗", + "uni.setClipboardData.success": "內容已復制", + "uni.scanCode.title": "掃碼", + "uni.scanCode.album": "相冊", + "uni.scanCode.fail": "識別失敗", + "uni.scanCode.flash.on": "輕觸照亮", + "uni.scanCode.flash.off": "輕觸關閉", + "uni.startSoterAuthentication.authContent": "指紋識別中...", + "uni.picker.done": "完成", + "uni.picker.cancel": "取消", + "uni.video.danmu": "彈幕", + "uni.video.volume": "音量", + "uni.button.feedback.title": "問題反饋", + "uni.button.feedback.send": "發送", + "uni.chooseLocation.search": "搜索地點", + "uni.chooseLocation.cancel": "取消" +}; + +const LOCALE_ZH_HANS = 'zh-Hans'; +const LOCALE_ZH_HANT = 'zh-Hant'; +const LOCALE_EN = 'en'; +const LOCALE_FR = 'fr'; +const LOCALE_ES = 'es'; + +const messages = {}; + +{ + Object.assign(messages, { + [LOCALE_EN]: en, + [LOCALE_ES]: es, + [LOCALE_FR]: fr, + [LOCALE_ZH_HANS]: zhHans, + [LOCALE_ZH_HANT]: zhHant }); - if (app && app.$vm) { - return app.$vm.$locale - } - return wx.getSystemInfoSync().language || 'zh-Hans' } -function setLocale (locale) { - const app = getApp(); - if (!app) { - return false - } - const oldLocale = app.$vm.$locale; - if (oldLocale !== locale) { - app.$vm.$locale = locale; - onLocaleChangeCallbacks.forEach((fn) => fn({ - locale - })); - return true +let locale; + +{ + if (typeof weex === 'object') { + locale = weex.requireModule('plus').getLanguage(); + } else { + locale = ''; } - return false } -const onLocaleChangeCallbacks = []; -function onLocaleChange (fn) { - if (onLocaleChangeCallbacks.indexOf(fn) === -1) { - onLocaleChangeCallbacks.push(fn); +function initI18nMessages () { + if (!isEnableLocale()) { + return + } + const localeKeys = Object.keys(__uniConfig.locales); + if (localeKeys.length) { + localeKeys.forEach((locale) => { + const curMessages = messages[locale]; + const userMessages = __uniConfig.locales[locale]; + if (curMessages) { + Object.assign(curMessages, userMessages); + } else { + messages[locale] = userMessages; + } + }); } } -if (typeof global !== 'undefined') { - global.getLocale = getLocale; -} - -const interceptors = { - promiseInterceptor -}; - -var baseApi = /*#__PURE__*/Object.freeze({ - __proto__: null, - upx2px: upx2px, - getLocale: getLocale, - setLocale: setLocale, - onLocaleChange: onLocaleChange, - addInterceptor: addInterceptor, - removeInterceptor: removeInterceptor, - interceptors: interceptors -}); - -const protocols = {}; -const todos = []; -const canIUses = []; - -const CALLBACKS = ['success', 'fail', 'cancel', 'complete']; +initI18nMessages(); -function processCallback (methodName, method, returnValue) { - return function (res) { - return method(processReturnValue(methodName, res, returnValue)) +const i18n = initVueI18n( + locale, + messages +); +const t = i18n.t; +const i18nMixin = (i18n.mixin = { + beforeCreate () { + const unwatch = i18n.i18n.watchLocale(() => { + this.$forceUpdate(); + }); + this.$once('hook:beforeDestroy', function () { + unwatch(); + }); + }, + methods: { + $$t (key, values) { + return t(key, values) + } + } +}); +const setLocale = i18n.setLocale; +const getLocale = i18n.getLocale; + +function initAppLocale (Vue, appVm, locale) { + const state = Vue.observable({ + locale: locale || i18n.getLocale() + }); + const localeWatchers = []; + appVm.$watchLocale = fn => { + localeWatchers.push(fn); + }; + Object.defineProperty(appVm, '$locale', { + get () { + return state.locale + }, + set (v) { + state.locale = v; + localeWatchers.forEach(watch => watch(v)); + } + }); +} + +function isEnableLocale () { + return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length +} + +function include (str, parts) { + return !!parts.find((part) => str.indexOf(part) !== -1) +} + +function startsWith (str, parts) { + return parts.find((part) => str.indexOf(part) === 0) +} + +function normalizeLocale (locale, messages) { + if (!locale) { + return + } + locale = locale.trim().replace(/_/g, '-'); + if (messages && messages[locale]) { + return locale + } + locale = locale.toLowerCase(); + if (locale === 'chinese') { + // 支付宝 + return LOCALE_ZH_HANS + } + if (locale.indexOf('zh') === 0) { + if (locale.indexOf('-hans') > -1) { + return LOCALE_ZH_HANS + } + if (locale.indexOf('-hant') > -1) { + return LOCALE_ZH_HANT + } + if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) { + return LOCALE_ZH_HANT + } + return LOCALE_ZH_HANS + } + const lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]); + if (lang) { + return lang + } +} +// export function initI18n() { +// const localeKeys = Object.keys(__uniConfig.locales || {}) +// if (localeKeys.length) { +// localeKeys.forEach((locale) => +// i18n.add(locale, __uniConfig.locales[locale]) +// ) +// } +// } + +function getLocale$1 () { + // 优先使用 $locale + const app = getApp({ + allowDefault: true + }); + if (app && app.$vm) { + return app.$vm.$locale + } + return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN +} + +function setLocale$1 (locale) { + const app = getApp(); + if (!app) { + return false + } + const oldLocale = app.$vm.$locale; + if (oldLocale !== locale) { + app.$vm.$locale = locale; + onLocaleChangeCallbacks.forEach((fn) => fn({ + locale + })); + return true + } + return false +} + +const onLocaleChangeCallbacks = []; +function onLocaleChange (fn) { + if (onLocaleChangeCallbacks.indexOf(fn) === -1) { + onLocaleChangeCallbacks.push(fn); + } +} + +if (typeof global !== 'undefined') { + global.getLocale = getLocale$1; +} + +const interceptors = { + promiseInterceptor +}; + +var baseApi = /*#__PURE__*/Object.freeze({ + __proto__: null, + upx2px: upx2px, + getLocale: getLocale$1, + setLocale: setLocale$1, + onLocaleChange: onLocaleChange, + addInterceptor: addInterceptor, + removeInterceptor: removeInterceptor, + interceptors: interceptors +}); + +const protocols = {}; +const todos = []; +const canIUses = []; + +const CALLBACKS = ['success', 'fail', 'cancel', 'complete']; + +function processCallback (methodName, method, returnValue) { + return function (res) { + return method(processReturnValue(methodName, res, returnValue)) } } @@ -727,7 +1048,11 @@ const customize = cached((str) => { function initTriggerEvent (mpInstance) { const oldTriggerEvent = mpInstance.triggerEvent; const newTriggerEvent = function (event, ...args) { - return oldTriggerEvent.apply(mpInstance, [customize(event), ...args]) + // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件 + if (this.$vm || (this.dataset && this.dataset.comType)) { + event = customize(event); + } + return oldTriggerEvent.apply(this, [event, ...args]) }; try { // 京东小程序 triggerEvent 为只读 @@ -826,6 +1151,29 @@ function initHooks (mpOptions, hooks, vueOptions) { }); } +function initUnknownHooks (mpOptions, vueOptions, excludes = []) { + findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes)); +} + +function findHooks (vueOptions, hooks = []) { + if (vueOptions) { + Object.keys(vueOptions).forEach((name) => { + if (name.indexOf('on') === 0 && isFn(vueOptions[name])) { + hooks.push(name); + } + }); + } + return hooks +} + +function initHook$1 (mpOptions, hook, excludes) { + if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) { + mpOptions[hook] = function (args) { + return this.$vm && this.$vm.__call_hook(hook, args) + }; + } +} + function initVueComponent (Vue, vueOptions) { vueOptions = vueOptions.default || vueOptions; let VueComponent; @@ -876,7 +1224,7 @@ function initData (vueOptions, context) { try { // 对 data 格式化 data = JSON.parse(JSON.stringify(data)); - } catch (e) {} + } catch (e) { } } if (!isPlainObject(data)) { @@ -963,18 +1311,13 @@ function parsePropType (key, type, defaultValue, file) { return type } -function initProperties (props, isBehavior = false, file = '') { +function initProperties (props, isBehavior = false, file = '', options) { const properties = {}; if (!isBehavior) { properties.vueId = { type: String, value: '' }; - // 用于字节跳动小程序模拟抽象节点 - properties.generic = { - type: Object, - value: null - }; // scopedSlotsCompiler auto properties.scopedSlotsCompiler = { type: String, @@ -1033,7 +1376,7 @@ function wrapper$2 (event) { // TODO 又得兼容 mpvue 的 mp 对象 try { event.mp = JSON.parse(JSON.stringify(event)); - } catch (e) {} + } catch (e) { } event.stopPropagation = noop; event.preventDefault = noop; @@ -1090,499 +1433,226 @@ function getExtraValue (vm, dataPathsArray) { } else if (isPlainObject(vFor)) { context = Object.keys(vFor).find(vForKey => { return vm.__get_value(propPath, vFor[vForKey]) === value - }); - } else { - console.error('v-for 暂不支持循环数据:', vFor); - } - } - - if (valuePath) { - context = vm.__get_value(valuePath, context); - } - } - }); - return context -} - -function processEventExtra (vm, extra, event) { - const extraObj = {}; - - if (Array.isArray(extra) && extra.length) { - /** - *[ - * ['data.items', 'data.id', item.data.id], - * ['metas', 'id', meta.id] - *], - *[ - * ['data.items', 'data.id', item.data.id], - * ['metas', 'id', meta.id] - *], - *'test' - */ - extra.forEach((dataPath, index) => { - if (typeof dataPath === 'string') { - if (!dataPath) { // model,prop.sync - extraObj['$' + index] = vm; - } else { - if (dataPath === '$event') { // $event - extraObj['$' + index] = event; - } else if (dataPath === 'arguments') { - if (event.detail && event.detail.__args__) { - extraObj['$' + index] = event.detail.__args__; - } else { - extraObj['$' + index] = [event]; - } - } else if (dataPath.indexOf('$event.') === 0) { // $event.target.value - extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event); - } else { - extraObj['$' + index] = vm.__get_value(dataPath); - } - } - } else { - extraObj['$' + index] = getExtraValue(vm, dataPath); - } - }); - } - - return extraObj -} - -function getObjByArray (arr) { - const obj = {}; - for (let i = 1; i < arr.length; i++) { - const element = arr[i]; - obj[element[0]] = element[1]; - } - return obj -} - -function processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) { - let isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象 - if (isCustom) { // 自定义事件 - isCustomMPEvent = event.currentTarget && - event.currentTarget.dataset && - event.currentTarget.dataset.comType === 'wx'; - if (!args.length) { // 无参数,直接传入 event 或 detail 数组 - if (isCustomMPEvent) { - return [event] - } - return event.detail.__args__ || event.detail - } - } - - const extraObj = processEventExtra(vm, extra, event); - - const ret = []; - args.forEach(arg => { - if (arg === '$event') { - if (methodName === '__set_model' && !isCustom) { // input v-model value - ret.push(event.target.value); - } else { - if (isCustom && !isCustomMPEvent) { - ret.push(event.detail.__args__[0]); - } else { // wxcomponent 组件或内置组件 - ret.push(event); - } - } - } else { - if (Array.isArray(arg) && arg[0] === 'o') { - ret.push(getObjByArray(arg)); - } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) { - ret.push(extraObj[arg]); - } else { - ret.push(arg); - } - } - }); - - return ret -} - -const ONCE = '~'; -const CUSTOM = '^'; - -function isMatchEventType (eventType, optType) { - return (eventType === optType) || - ( - optType === 'regionchange' && - ( - eventType === 'begin' || - eventType === 'end' - ) - ) -} - -function getContextVm (vm) { - let $parent = vm.$parent; - // 父组件是 scoped slots 或者其他自定义组件时继续查找 - while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) { - $parent = $parent.$parent; - } - return $parent && $parent.$parent -} - -function handleEvent (event) { - event = wrapper$2(event); - - // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]] - const dataset = (event.currentTarget || event.target).dataset; - if (!dataset) { - return console.warn('事件信息不存在') - } - const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰 - if (!eventOpts) { - return console.warn('事件信息不存在') - } - - // [['handle',[1,2,a]],['handle1',[1,2,a]]] - const eventType = event.type; - - const ret = []; - - eventOpts.forEach(eventOpt => { - let type = eventOpt[0]; - const eventsArray = eventOpt[1]; - - const isCustom = type.charAt(0) === CUSTOM; - type = isCustom ? type.slice(1) : type; - const isOnce = type.charAt(0) === ONCE; - type = isOnce ? type.slice(1) : type; - - if (eventsArray && isMatchEventType(eventType, type)) { - eventsArray.forEach(eventArray => { - const methodName = eventArray[0]; - if (methodName) { - let handlerCtx = this.$vm; - if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots - handlerCtx = getContextVm(handlerCtx) || handlerCtx; - } - if (methodName === '$emit') { - handlerCtx.$emit.apply(handlerCtx, - processEventArgs( - this.$vm, - event, - eventArray[1], - eventArray[2], - isCustom, - methodName - )); - return - } - const handler = handlerCtx[methodName]; - if (!isFn(handler)) { - throw new Error(` _vm.${methodName} is not a function`) - } - if (isOnce) { - if (handler.once) { - return - } - handler.once = true; - } - let params = processEventArgs( - this.$vm, - event, - eventArray[1], - eventArray[2], - isCustom, - methodName - ); - params = Array.isArray(params) ? params : []; - // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据 - if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) { - // eslint-disable-next-line no-sparse-arrays - params = params.concat([, , , , , , , , , , event]); - } - ret.push(handler.apply(handlerCtx, params)); - } - }); - } - }); - - if ( - eventType === 'input' && - ret.length === 1 && - typeof ret[0] !== 'undefined' - ) { - return ret[0] - } -} - -var en = { - "uni.app.quit": "Press back button again to exit", - "uni.async.error": "The connection timed out, click the screen to try again.", - "uni.showActionSheet.cancel": "Cancel", - "uni.showToast.unpaired": "Please note showToast must be paired with hideToast", - "uni.showLoading.unpaired": "Please note showLoading must be paired with hideLoading", - "uni.showModal.cancel": "Cancel", - "uni.showModal.confirm": "OK", - "uni.chooseImage.cancel": "Cancel", - "uni.chooseImage.sourceType.album": "Album", - "uni.chooseImage.sourceType.camera": "Camera", - "uni.chooseVideo.cancel": "Cancel", - "uni.chooseVideo.sourceType.album": "Album", - "uni.chooseVideo.sourceType.camera": "Camera", - "uni.chooseFile.notUserActivation": "File chooser dialog can only be shown with a user activation", - "uni.previewImage.cancel": "Cancel", - "uni.previewImage.button.save": "Save Image", - "uni.previewImage.save.success": "Saved successfully", - "uni.previewImage.save.fail": "Save failed", - "uni.setClipboardData.success": "Content copied", - "uni.scanCode.title": "Scan code", - "uni.scanCode.album": "Album", - "uni.scanCode.fail": "Recognition failure", - "uni.scanCode.flash.on": "Tap to turn light on", - "uni.scanCode.flash.off": "Tap to turn light off", - "uni.startSoterAuthentication.authContent": "Fingerprint recognition", - "uni.picker.done": "Done", - "uni.picker.cancel": "Cancel", - "uni.video.danmu": "Danmu", - "uni.video.volume": "Volume", - "uni.button.feedback.title": "feedback", - "uni.button.feedback.send": "send", - "uni.chooseLocation.search": "Find Place", - "uni.chooseLocation.cancel": "Cancel" -}; - -var es = { - "uni.app.quit": "Pulse otra vez para salir", - "uni.async.error": "Se agotó el tiempo de conexión, haga clic en la pantalla para volver a intentarlo.", - "uni.showActionSheet.cancel": "Cancelar", - "uni.showToast.unpaired": "Tenga en cuenta que showToast debe estar emparejado con hideToast", - "uni.showLoading.unpaired": "Tenga en cuenta que showLoading debe estar emparejado con hideLoading", - "uni.showModal.cancel": "Cancelar", - "uni.showModal.confirm": "OK", - "uni.chooseImage.cancel": "Cancelar", - "uni.chooseImage.sourceType.album": "Álbum", - "uni.chooseImage.sourceType.camera": "Cámara", - "uni.chooseVideo.cancel": "Cancelar", - "uni.chooseVideo.sourceType.album": "Álbum", - "uni.chooseVideo.sourceType.camera": "Cámara", - "uni.chooseFile.notUserActivation": "El cuadro de diálogo del selector de archivos solo se puede mostrar con la activación del usuario", - "uni.previewImage.cancel": "Cancelar", - "uni.previewImage.button.save": "Guardar imagen", - "uni.previewImage.save.success": "Guardado exitosamente", - "uni.previewImage.save.fail": "Error al guardar", - "uni.setClipboardData.success": "Contenido copiado", - "uni.scanCode.title": "Código de escaneo", - "uni.scanCode.album": "Álbum", - "uni.scanCode.fail": "Échec de la reconnaissance", - "uni.scanCode.flash.on": "Toque para encender la luz", - "uni.scanCode.flash.off": "Toque para apagar la luz", - "uni.startSoterAuthentication.authContent": "Reconocimiento de huellas dactilares", - "uni.picker.done": "OK", - "uni.picker.cancel": "Cancelar", - "uni.video.danmu": "Danmu", - "uni.video.volume": "Volumen", - "uni.button.feedback.title": "realimentación", - "uni.button.feedback.send": "enviar", - "uni.chooseLocation.search": "Encontrar", - "uni.chooseLocation.cancel": "Cancelar" -}; - -var fr = { - "uni.app.quit": "Appuyez à nouveau pour quitter l'application", - "uni.async.error": "La connexion a expiré, cliquez sur l'écran pour réessayer.", - "uni.showActionSheet.cancel": "Annuler", - "uni.showToast.unpaired": "Veuillez noter que showToast doit être associé à hideToast", - "uni.showLoading.unpaired": "Veuillez noter que showLoading doit être associé à hideLoading", - "uni.showModal.cancel": "Annuler", - "uni.showModal.confirm": "OK", - "uni.chooseImage.cancel": "Annuler", - "uni.chooseImage.sourceType.album": "Album", - "uni.chooseImage.sourceType.camera": "Caméra", - "uni.chooseVideo.cancel": "Annuler", - "uni.chooseVideo.sourceType.album": "Album", - "uni.chooseVideo.sourceType.camera": "Caméra", - "uni.chooseFile.notUserActivation": "La boîte de dialogue du sélecteur de fichier ne peut être affichée qu'avec une activation par l'utilisateur", - "uni.previewImage.cancel": "Annuler", - "uni.previewImage.button.save": "Guardar imagen", - "uni.previewImage.save.success": "Enregistré avec succès", - "uni.previewImage.save.fail": "Échec de la sauvegarde", - "uni.setClipboardData.success": "Contenu copié", - "uni.scanCode.title": "Code d’analyse", - "uni.scanCode.album": "Album", - "uni.scanCode.fail": "Fallo de reconocimiento", - "uni.scanCode.flash.on": "Appuyez pour activer l'éclairage", - "uni.scanCode.flash.off": "Appuyez pour désactiver l'éclairage", - "uni.startSoterAuthentication.authContent": "Reconnaissance de l'empreinte digitale", - "uni.picker.done": "OK", - "uni.picker.cancel": "Annuler", - "uni.video.danmu": "Danmu", - "uni.video.volume": "Le Volume", - "uni.button.feedback.title": "retour d'information", - "uni.button.feedback.send": "envoyer", - "uni.chooseLocation.search": "Trouve", - "uni.chooseLocation.cancel": "Annuler" -}; - -var zhHans = { - "uni.app.quit": "再按一次退出应用", - "uni.async.error": "连接服务器超时,点击屏幕重试", - "uni.showActionSheet.cancel": "取消", - "uni.showToast.unpaired": "请注意 showToast 与 hideToast 必须配对使用", - "uni.showLoading.unpaired": "请注意 showLoading 与 hideLoading 必须配对使用", - "uni.showModal.cancel": "取消", - "uni.showModal.confirm": "确定", - "uni.chooseImage.cancel": "取消", - "uni.chooseImage.sourceType.album": "从相册选择", - "uni.chooseImage.sourceType.camera": "拍摄", - "uni.chooseVideo.cancel": "取消", - "uni.chooseVideo.sourceType.album": "从相册选择", - "uni.chooseVideo.sourceType.camera": "拍摄", - "uni.chooseFile.notUserActivation": "文件选择器对话框只能在由用户激活时显示", - "uni.previewImage.cancel": "取消", - "uni.previewImage.button.save": "保存图像", - "uni.previewImage.save.success": "保存图像到相册成功", - "uni.previewImage.save.fail": "保存图像到相册失败", - "uni.setClipboardData.success": "内容已复制", - "uni.scanCode.title": "扫码", - "uni.scanCode.album": "相册", - "uni.scanCode.fail": "识别失败", - "uni.scanCode.flash.on": "轻触照亮", - "uni.scanCode.flash.off": "轻触关闭", - "uni.startSoterAuthentication.authContent": "指纹识别中...", - "uni.picker.done": "完成", - "uni.picker.cancel": "取消", - "uni.video.danmu": "弹幕", - "uni.video.volume": "音量", - "uni.button.feedback.title": "问题反馈", - "uni.button.feedback.send": "发送", - "uni.chooseLocation.search": "搜索地点", - "uni.chooseLocation.cancel": "取消" -}; - -var zhHant = { - "uni.app.quit": "再按一次退出應用", - "uni.async.error": "連接服務器超時,點擊屏幕重試", - "uni.showActionSheet.cancel": "取消", - "uni.showToast.unpaired": "請注意 showToast 與 hideToast 必須配對使用", - "uni.showLoading.unpaired": "請注意 showLoading 與 hideLoading 必須配對使用", - "uni.showModal.cancel": "取消", - "uni.showModal.confirm": "確定", - "uni.chooseImage.cancel": "取消", - "uni.chooseImage.sourceType.album": "從相冊選擇", - "uni.chooseImage.sourceType.camera": "拍攝", - "uni.chooseVideo.cancel": "取消", - "uni.chooseVideo.sourceType.album": "從相冊選擇", - "uni.chooseVideo.sourceType.camera": "拍攝", - "uni.chooseFile.notUserActivation": "文件選擇器對話框只能在由用戶激活時顯示", - "uni.previewImage.cancel": "取消", - "uni.previewImage.button.save": "保存圖像", - "uni.previewImage.save.success": "保存圖像到相冊成功", - "uni.previewImage.save.fail": "保存圖像到相冊失敗", - "uni.setClipboardData.success": "內容已復制", - "uni.scanCode.title": "掃碼", - "uni.scanCode.album": "相冊", - "uni.scanCode.fail": "識別失敗", - "uni.scanCode.flash.on": "輕觸照亮", - "uni.scanCode.flash.off": "輕觸關閉", - "uni.startSoterAuthentication.authContent": "指紋識別中...", - "uni.picker.done": "完成", - "uni.picker.cancel": "取消", - "uni.video.danmu": "彈幕", - "uni.video.volume": "音量", - "uni.button.feedback.title": "問題反饋", - "uni.button.feedback.send": "發送", - "uni.chooseLocation.search": "搜索地點", - "uni.chooseLocation.cancel": "取消" -}; - -const messages = {}; + }); + } else { + console.error('v-for 暂不支持循环数据:', vFor); + } + } -{ - Object.assign(messages, { - en, - es, - fr, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant + if (valuePath) { + context = vm.__get_value(valuePath, context); + } + } }); + return context } -let locale; - -{ - if (typeof weex === 'object') { - locale = weex.requireModule('plus').getLanguage(); - } else { - locale = ''; - } -} +function processEventExtra (vm, extra, event, __args__) { + const extraObj = {}; -function initI18nMessages () { - if (!isEnableLocale()) { - return - } - const localeKeys = Object.keys(__uniConfig.locales); - if (localeKeys.length) { - localeKeys.forEach((locale) => { - const curMessages = messages[locale]; - const userMessages = __uniConfig.locales[locale]; - if (curMessages) { - Object.assign(curMessages, userMessages); + if (Array.isArray(extra) && extra.length) { + /** + *[ + * ['data.items', 'data.id', item.data.id], + * ['metas', 'id', meta.id] + *], + *[ + * ['data.items', 'data.id', item.data.id], + * ['metas', 'id', meta.id] + *], + *'test' + */ + extra.forEach((dataPath, index) => { + if (typeof dataPath === 'string') { + if (!dataPath) { // model,prop.sync + extraObj['$' + index] = vm; + } else { + if (dataPath === '$event') { // $event + extraObj['$' + index] = event; + } else if (dataPath === 'arguments') { + extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__; + } else if (dataPath.indexOf('$event.') === 0) { // $event.target.value + extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event); + } else { + extraObj['$' + index] = vm.__get_value(dataPath); + } + } } else { - messages[locale] = userMessages; + extraObj['$' + index] = getExtraValue(vm, dataPath); } }); } + + return extraObj } -initI18nMessages(); +function getObjByArray (arr) { + const obj = {}; + for (let i = 1; i < arr.length; i++) { + const element = arr[i]; + obj[element[0]] = element[1]; + } + return obj +} -const i18n = initVueI18n( - locale, - messages -); -const t = i18n.t; -const i18nMixin = (i18n.mixin = { - beforeCreate () { - const unwatch = i18n.i18n.watchLocale(() => { - this.$forceUpdate(); - }); - this.$once('hook:beforeDestroy', function () { - unwatch(); - }); - }, - methods: { - $$t (key, values) { - return t(key, values) +function processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) { + let isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象 + + // fixed 用户直接触发 mpInstance.triggerEvent + const __args__ = isPlainObject(event.detail) + ? event.detail.__args__ || [event.detail] + : [event.detail]; + + if (isCustom) { // 自定义事件 + isCustomMPEvent = event.currentTarget && + event.currentTarget.dataset && + event.currentTarget.dataset.comType === 'wx'; + if (!args.length) { // 无参数,直接传入 event 或 detail 数组 + if (isCustomMPEvent) { + return [event] + } + return __args__ } } -}); -const setLocale$1 = i18n.setLocale; -const getLocale$1 = i18n.getLocale; -function initAppLocale (Vue, appVm, locale) { - const state = Vue.observable({ - locale: locale || i18n.getLocale() - }); - const localeWatchers = []; - appVm.$watchLocale = fn => { - localeWatchers.push(fn); - }; - Object.defineProperty(appVm, '$locale', { - get () { - return state.locale - }, - set (v) { - state.locale = v; - localeWatchers.forEach(watch => watch(v)); + const extraObj = processEventExtra(vm, extra, event, __args__); + + const ret = []; + args.forEach(arg => { + if (arg === '$event') { + if (methodName === '__set_model' && !isCustom) { // input v-model value + ret.push(event.target.value); + } else { + if (isCustom && !isCustomMPEvent) { + ret.push(__args__[0]); + } else { // wxcomponent 组件或内置组件 + ret.push(event); + } + } + } else { + if (Array.isArray(arg) && arg[0] === 'o') { + ret.push(getObjByArray(arg)); + } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) { + ret.push(extraObj[arg]); + } else { + ret.push(arg); + } } }); + + return ret } -function isEnableLocale () { - return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length +const ONCE = '~'; +const CUSTOM = '^'; + +function isMatchEventType (eventType, optType) { + return (eventType === optType) || + ( + optType === 'regionchange' && + ( + eventType === 'begin' || + eventType === 'end' + ) + ) } -// export function initI18n() { -// const localeKeys = Object.keys(__uniConfig.locales || {}) -// if (localeKeys.length) { -// localeKeys.forEach((locale) => -// i18n.add(locale, __uniConfig.locales[locale]) -// ) -// } -// } +function getContextVm (vm) { + let $parent = vm.$parent; + // 父组件是 scoped slots 或者其他自定义组件时继续查找 + while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) { + $parent = $parent.$parent; + } + return $parent && $parent.$parent +} + +function handleEvent (event) { + event = wrapper$2(event); + + // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]] + const dataset = (event.currentTarget || event.target).dataset; + if (!dataset) { + return console.warn('事件信息不存在') + } + const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰 + if (!eventOpts) { + return console.warn('事件信息不存在') + } + + // [['handle',[1,2,a]],['handle1',[1,2,a]]] + const eventType = event.type; + + const ret = []; + + eventOpts.forEach(eventOpt => { + let type = eventOpt[0]; + const eventsArray = eventOpt[1]; + + const isCustom = type.charAt(0) === CUSTOM; + type = isCustom ? type.slice(1) : type; + const isOnce = type.charAt(0) === ONCE; + type = isOnce ? type.slice(1) : type; + + if (eventsArray && isMatchEventType(eventType, type)) { + eventsArray.forEach(eventArray => { + const methodName = eventArray[0]; + if (methodName) { + let handlerCtx = this.$vm; + if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots + handlerCtx = getContextVm(handlerCtx) || handlerCtx; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return + } + const handler = handlerCtx[methodName]; + if (!isFn(handler)) { + const type = this.$vm.mpType === 'page' ? 'Page' : 'Component'; + const path = this.route || this.is; + throw new Error(`${type} "${path}" does not have a method "${methodName}"`) + } + if (isOnce) { + if (handler.once) { + return + } + handler.once = true; + } + let params = processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + ); + params = Array.isArray(params) ? params : []; + // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据 + if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) { + // eslint-disable-next-line no-sparse-arrays + params = params.concat([, , , , , , , , , , event]); + } + ret.push(handler.apply(handlerCtx, params)); + } + }); + } + }); + + if ( + eventType === 'input' && + ret.length === 1 && + typeof ret[0] !== 'undefined' + ) { + return ret[0] + } +} class EventChannel { constructor (id, events) { @@ -1766,9 +1836,10 @@ function parseBaseApp (vm, { }); } - initAppLocale(Vue, vm, wx.getSystemInfoSync().language || 'zh-Hans'); + initAppLocale(Vue, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN); initHooks(appOptions, hooks); + initUnknownHooks(appOptions, vm.$options); return appOptions } @@ -2054,6 +2125,9 @@ function parseBasePage (vuePageOptions, { this.$vm.$mp.query = query; // 兼容 mpvue this.$vm.__call_hook('onLoad', query); }; + { + initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']); + } return pageOptions } diff --git a/packages/uni-app-plus/dist/index.v3.js b/packages/uni-app-plus/dist/index.v3.js index 9672a31a9207ba6d2d23db86346b637ae22fae33..20c01c61c01dde58ed6fb52bfa94394929011288 100644 --- a/packages/uni-app-plus/dist/index.v3.js +++ b/packages/uni-app-plus/dist/index.v3.js @@ -85,6 +85,9 @@ var serviceContext = (function () { const device = [ 'getSystemInfo', 'getSystemInfoSync', + 'getWindowInfo', + 'getDeviceInfo', + 'getAppBaseInfo', 'canIUse', 'onMemoryWarning', 'getNetworkType', @@ -141,7 +144,10 @@ var serviceContext = (function () { 'checkIsSoterEnrolledInDevice', 'startSoterAuthentication', 'onThemeChange', - 'onUIStyleChange' + 'onUIStyleChange', + 'getSystemSetting', + 'getAppAuthorizeSetting', + 'openAppAuthorizeSetting' ]; const keyboard = [ @@ -248,6 +254,7 @@ var serviceContext = (function () { 'requireNativePlugin', 'upx2px', 'restoreGlobal', + 'requireGlobal', 'getSubNVueById', 'getCurrentSubNVue', 'setPageMeta', @@ -258,7 +265,9 @@ var serviceContext = (function () { 'unPreloadPage', 'loadSubPackage', 'sendHostEvent', - 'navigateToMiniProgram' + 'navigateToMiniProgram', + 'getLaunchOptionsSync', + 'getEnterOptionsSync' ]; const ad = [ @@ -270,9 +279,10 @@ var serviceContext = (function () { const plugin = [ 'invokePushCallback', - 'getPushCid', + 'getPushClientId', 'onPushMessage', 'offPushMessage', + 'createPushMessage' ]; const apis = [ @@ -408,7 +418,7 @@ var serviceContext = (function () { return hasOwnProperty.call(obj, key) } - function noop () {} + function noop () { } function toRawType (val) { return _toString.call(val).slice(8, -1) @@ -488,6 +498,16 @@ var serviceContext = (function () { } else { return false } + } + + function sortObject (obj) { + const sortObj = {}; + if (isPlainObject(obj)) { + Object.keys(obj).sort().forEach(key => { + sortObj[key] = obj[key]; + }); + } + return !Object.keys(sortObj) ? obj : sortObj } const encodeReserveRE = /[!'()*]/g; @@ -837,7 +857,7 @@ var serviceContext = (function () { }; const SYNC_API_RE = - /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/; + /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/; const CONTEXT_API_RE = /^create|Manager$/; @@ -847,7 +867,7 @@ var serviceContext = (function () { const TASK_APIS = ['request', 'downloadFile', 'uploadFile', 'connectSocket']; // 同步例外情况 - const ASYNC_API = ['createBLEConnection']; + const ASYNC_API = ['createBLEConnection', 'createPushMessage']; const CALLBACK_API_RE = /^on|^off/; @@ -1226,6 +1246,10 @@ var serviceContext = (function () { sound: { type: String, default: 'none' + }, + autoZoom: { + type: Boolean, + default: true } }; @@ -1746,15 +1770,21 @@ var serviceContext = (function () { "uni.chooseLocation.cancel": "取消" }; + const LOCALE_ZH_HANS$1 = 'zh-Hans'; + const LOCALE_ZH_HANT$1 = 'zh-Hant'; + const LOCALE_EN$1 = 'en'; + const LOCALE_FR$1 = 'fr'; + const LOCALE_ES$1 = 'es'; + const messages = {}; { Object.assign(messages, { - en, - es, - fr, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant + [LOCALE_EN$1]: en, + [LOCALE_ES$1]: es, + [LOCALE_FR$1]: fr, + [LOCALE_ZH_HANS$1]: zhHans, + [LOCALE_ZH_HANT$1]: zhHant }); } @@ -1835,7 +1865,7 @@ var serviceContext = (function () { const locale = uni.getLocale(); const locales = __uniConfig.locales; return ( - locales[locale] || locales[__uniConfig.fallbackLocale] || locales.en || {} + locales[locale] || locales[__uniConfig.fallbackLocale] || locales[LOCALE_EN$1] || {} ) } @@ -1894,7 +1924,6 @@ var serviceContext = (function () { ]) } } - // export function initI18n() { // const localeKeys = Object.keys(__uniConfig.locales || {}) // if (localeKeys.length) { @@ -3766,7 +3795,7 @@ var serviceContext = (function () { } } // 部分 API 直接实现 - const unwrappers = ['getPushCid', 'onPushMessage', 'offPushMessage']; + const unwrappers = ['getPushClientId', 'onPushMessage', 'offPushMessage']; function wrapper (name, invokeMethod, extras = {}) { if (unwrappers.indexOf(name) > -1 || !isFn(invokeMethod)) { @@ -3908,7 +3937,10 @@ var serviceContext = (function () { if (hasOwn(platformSchema, schema)) { return platformSchema[schema] } - return true + if (hasOwn(api$2, schema)) { + return true + } + return false } var require_context_module_1_1 = /*#__PURE__*/Object.freeze({ @@ -6184,7 +6216,6 @@ var serviceContext = (function () { } const TABBAR_HEIGHT = 50; - const isIOS$1 = plus.os.name === 'iOS'; let config; /** @@ -6307,6 +6338,7 @@ var serviceContext = (function () { }); }, indexOf (page) { + const config = this.config; const itemLength = config && config.list && config.list.length; if (itemLength) { for (let i = 0; i < itemLength; i++) { @@ -6347,16 +6379,21 @@ var serviceContext = (function () { } }); }, + get config () { + return config || __uniConfig.tabBar + }, get visible () { return visible }, get height () { + const config = this.config; return (config && config.height ? parseFloat(config.height) : TABBAR_HEIGHT) + plus.navigator.getSafeAreaInsets().deviceBottom }, // tabBar是否遮挡内容区域 get cover () { + const config = this.config; const array = ['extralight', 'light', 'dark']; - return isIOS$1 && array.indexOf(config.blurEffect) >= 0 + return config && array.indexOf(config.blurEffect) >= 0 }, setStyle ({ mask }) { tabBar.setMask({ @@ -6377,6 +6414,84 @@ var serviceContext = (function () { return plus.navigator.isImmersedStatusbar() ? Math.round(plus.os.name === 'iOS' ? plus.navigator.getSafeAreaInsets().top : plus.navigator.getStatusbarHeight()) : 0 } + function getWindowInfo () { + const ios = plus.os.name.toLowerCase() === 'ios'; + + const { + screenWidth, + screenHeight + } = getScreenInfo(); + const statusBarHeight = getStatusbarHeight(); + + let safeAreaInsets; + const titleNView = { + height: 0, + cover: false + }; + const webview = getLastWebview(); + if (webview) { + let style = webview.getStyle(); + style = style && style.titleNView; + if (style && style.type && style.type !== 'none') { + titleNView.height = style.type === 'transparent' ? 0 : (statusBarHeight + NAVBAR_HEIGHT); + titleNView.cover = style.type === 'transparent' || style.type === 'float'; + } + safeAreaInsets = webview.getSafeAreaInsets(); + } else { + safeAreaInsets = plus.navigator.getSafeAreaInsets(); + } + const tabBarView = { + height: 0, + cover: false + }; + if (isTabBarPage()) { + tabBarView.height = tabBar$1.visible ? tabBar$1.height : 0; + tabBarView.cover = tabBar$1.cover; + } + const windowTop = titleNView.cover ? titleNView.height : 0; + const windowBottom = tabBarView.cover ? tabBarView.height : 0; + let windowHeight = screenHeight - titleNView.height - tabBarView.height; + let windowHeightReal = screenHeight - (titleNView.cover ? 0 : titleNView.height) - (tabBarView.cover ? 0 : tabBarView.height); + const windowWidth = screenWidth; + if ((!tabBarView.height || tabBarView.cover) && !safeAreaInsets.bottom && safeAreaInsets.deviceBottom) { + windowHeight -= safeAreaInsets.deviceBottom; + windowHeightReal -= safeAreaInsets.deviceBottom; + } + safeAreaInsets = ios ? safeAreaInsets : { + left: 0, + right: 0, + top: titleNView.height && !titleNView.cover ? 0 : statusBarHeight, + bottom: 0 + }; + const safeArea = { + left: safeAreaInsets.left, + right: windowWidth - safeAreaInsets.right, + top: safeAreaInsets.top, + bottom: windowHeightReal - safeAreaInsets.bottom, + width: windowWidth - safeAreaInsets.left - safeAreaInsets.right, + height: windowHeightReal - safeAreaInsets.top - safeAreaInsets.bottom + }; + + return { + pixelRatio: plus.screen.scale, + screenWidth, + screenHeight, + windowWidth, + windowHeight, + statusBarHeight, + safeArea, + safeAreaInsets: { + top: safeAreaInsets.top, + right: safeAreaInsets.right, + bottom: safeAreaInsets.bottom, + left: safeAreaInsets.left + }, + windowTop, + windowBottom, + screenTop: screenHeight - windowHeight + } + } + let deviceId; function deviceId$1 () { @@ -6384,96 +6499,118 @@ var serviceContext = (function () { return deviceId } - function getSystemInfoSync () { - return callApiSync(getSystemInfo, Object.create(null), 'getSystemInfo', 'getSystemInfoSync') + let systemInfo = {}; + let _initSystemInfo = true; + + function weexGetSystemInfoSync () { + if (!_initSystemInfo) return + const { getSystemInfoSync } = weex.requireModule('plus'); + systemInfo = getSystemInfoSync(); + if (typeof systemInfo === 'string') { + try { + systemInfo = JSON.parse(systemInfo); + } catch (error) {} + } } - function getSystemInfo () { - const platform = plus.os.name.toLowerCase(); - const ios = platform === 'ios'; - const isAndroid = platform === 'android'; + function getDeviceInfo () { + weexGetSystemInfoSync(); const { - screenWidth, - screenHeight - } = getScreenInfo(); - const statusBarHeight = getStatusbarHeight(); + deviceBrand = '', deviceModel, osName, + osVersion, deviceOrientation, deviceType + } = systemInfo; - let safeAreaInsets; - const titleNView = { - height: 0, - cover: false - }; - const webview = getLastWebview(); - if (webview) { - let style = webview.getStyle(); - style = style && style.titleNView; - if (style && style.type && style.type !== 'none') { - titleNView.height = style.type === 'transparent' ? 0 : (statusBarHeight + NAVBAR_HEIGHT); - titleNView.cover = style.type === 'transparent' || style.type === 'float'; - } - safeAreaInsets = webview.getSafeAreaInsets(); - } else { - safeAreaInsets = plus.navigator.getSafeAreaInsets(); + const brand = deviceBrand.toLowerCase(); + const _osName = osName.toLowerCase(); + + return { + brand, + deviceBrand: brand, + deviceModel, + devicePixelRatio: plus.screen.scale, + deviceId: deviceId$1(), + deviceOrientation, + deviceType, + model: deviceModel, + platform: _osName, + system: `${_osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}` } - const tabBarView = { - height: 0, - cover: false - }; - if (isTabBarPage()) { - tabBarView.height = tabBar$1.visible ? tabBar$1.height : 0; - tabBarView.cover = tabBar$1.cover; - } - const windowTop = titleNView.cover ? titleNView.height : 0; - const windowBottom = tabBarView.cover ? tabBarView.height : 0; - let windowHeight = screenHeight - titleNView.height - tabBarView.height; - let windowHeightReal = screenHeight - (titleNView.cover ? 0 : titleNView.height) - (tabBarView.cover ? 0 : tabBarView.height); - const windowWidth = screenWidth; - if ((!tabBarView.height || tabBarView.cover) && !safeAreaInsets.bottom && safeAreaInsets.deviceBottom) { - windowHeight -= safeAreaInsets.deviceBottom; - windowHeightReal -= safeAreaInsets.deviceBottom; - } - safeAreaInsets = ios ? safeAreaInsets : { - left: 0, - right: 0, - top: titleNView.height && !titleNView.cover ? 0 : statusBarHeight, - bottom: 0 - }; - const safeArea = { - left: safeAreaInsets.left, - right: windowWidth - safeAreaInsets.right, - top: safeAreaInsets.top, - bottom: windowHeightReal - safeAreaInsets.bottom, - width: windowWidth - safeAreaInsets.left - safeAreaInsets.right, - height: windowHeightReal - safeAreaInsets.top - safeAreaInsets.bottom - }; + } + + function getAppBaseInfo () { + weexGetSystemInfoSync(); + const { + hostPackageName, hostName, osLanguage, + hostVersion, hostLanguage, hostTheme, + appId, appName, appVersion, appVersionCode, + appWgtVersion + } = systemInfo; + + const appLanguage = uni + ? uni.getLocale + ? uni.getLocale() + : hostLanguage + : hostLanguage; return { - errMsg: 'getSystemInfo:ok', - brand: plus.device.vendor, - model: plus.device.model, - pixelRatio: plus.screen.scale, - screenWidth, - screenHeight, - windowWidth, - windowHeight, - statusBarHeight, - language: plus.os.language, - system: `${ios ? 'iOS' : isAndroid ? 'Android' : ''} ${plus.os.version}`, - version: plus.runtime.innerVersion, - fontSizeSetting: '', - platform, + appId, + appName, + appVersion, + appVersionCode, + appWgtVersion, + appLanguage, + enableDebug: false, + hostSDKVersion: undefined, + hostPackageName, + hostName, + hostVersion, + hostLanguage, + hostTheme, + hostFontSizeSetting: undefined, + language: osLanguage, SDKVersion: '', - windowTop, - windowBottom, - safeArea, - safeAreaInsets: { - top: safeAreaInsets.top, - right: safeAreaInsets.right, - bottom: safeAreaInsets.bottom, - left: safeAreaInsets.left - }, - deviceId: deviceId$1() + theme: undefined, + version: plus.runtime.innerVersion + } + } + + function getSystemInfoSync () { + return callApiSync(getSystemInfo, Object.create(null), 'getSystemInfo', 'getSystemInfoSync') + } + + function getSystemInfo () { + _initSystemInfo = true; + weexGetSystemInfoSync(); + _initSystemInfo = false; + const windowInfo = getWindowInfo(); + const deviceInfo = getDeviceInfo(); + const appBaseInfo = getAppBaseInfo(); + _initSystemInfo = true; + + const extraData = { + errMsg: 'getSystemInfo:ok', + fontSizeSetting: appBaseInfo.hostFontSizeSetting, + osName: systemInfo.osName.toLowerCase() + }; + + if (systemInfo.hostName) { + extraData.hostSDKVersion = systemInfo.uniRuntimeVersion; } + + const _systemInfo = Object.assign( + {}, + systemInfo, + windowInfo, + deviceInfo, + appBaseInfo, + extraData + ); + + delete _systemInfo.screenTop; + delete _systemInfo.enableDebug; + delete _systemInfo.theme; + + return sortObject(_systemInfo) } function vibrateLong () { @@ -6489,6 +6626,48 @@ var serviceContext = (function () { } } + function getSystemSetting () { + const { getSystemSetting } = weex.requireModule('plus'); + let systemSetting = getSystemSetting(); + try { + if (typeof systemSetting === 'string') { systemSetting = JSON.parse(systemSetting); } + } catch (error) { } + + return systemSetting + } + + function getAppAuthorizeSetting () { + const { getAppAuthorizeSetting } = weex.requireModule('plus'); + let appAuthorizeSetting = getAppAuthorizeSetting(); + try { + if (typeof appAuthorizeSetting === 'string') { appAuthorizeSetting = JSON.parse(appAuthorizeSetting); } + } catch (error) { } + + for (const key in appAuthorizeSetting) { + if (Object.hasOwnProperty.call(appAuthorizeSetting, key)) { + const value = appAuthorizeSetting[key]; + if (value === 'undefined') appAuthorizeSetting[key] = undefined; + } + } + + return appAuthorizeSetting + } + + function openAppAuthorizeSetting (options, callbackId) { + const { openAppAuthorizeSetting } = weex.requireModule('plus'); + openAppAuthorizeSetting(ret => { + if (ret.type === 'success') { + invoke$1(callbackId, { + errMsg: 'getClipboardData:ok' + }); + } else { + invoke$1(callbackId, { + errMsg: 'getClipboardData:fail' + }); + } + }); + } + const SAVED_DIR = 'uniapp_save'; const SAVE_PATH = `_doc/${SAVED_DIR}`; @@ -6701,7 +6880,9 @@ var serviceContext = (function () { let result; const page = showPage({ url: '__uniappchooselocation', - data: options, + data: Object.assign({}, options, { + locale: getLocale() + }), style: { animationType: options.animationType || 'slide-in-bottom', titleNView: false, @@ -6874,7 +7055,9 @@ var serviceContext = (function () { function openLocation$2 (data, callbackId) { showPage({ url: '__uniappopenlocation', - data, + data: Object.assign({}, data, { + locale: getLocale() + }), style: { titleNView: { type: 'transparent' @@ -7929,7 +8112,7 @@ var serviceContext = (function () { }) => { provider.push(id); }); - callback(null, provider); + callback(null, provider, services); }, err => { callback(err); }); @@ -7942,7 +8125,7 @@ var serviceContext = (function () { }) => { provider.push(id); }); - callback(null, provider); + callback(null, provider, services); }, err => { callback(err); }); @@ -7955,14 +8138,15 @@ var serviceContext = (function () { }) => { provider.push(id); }); - callback(null, provider); + callback(null, provider, services); }, err => { callback(err); }); }, push (callback) { if (typeof weex !== 'undefined' || typeof plus !== 'undefined') { - callback(null, [plus.push.getClientInfo().id]); + const clientInfo = plus.push.getClientInfo(); + callback(null, [clientInfo.id], [clientInfo]); } else { callback(null, []); } @@ -7973,7 +8157,7 @@ var serviceContext = (function () { service }, callbackId) { if (providers[service]) { - providers[service]((err, provider) => { + providers[service]((err, provider, providers) => { if (err) { invoke$1(callbackId, { errMsg: 'getProvider:fail ' + err.message @@ -7982,7 +8166,16 @@ var serviceContext = (function () { invoke$1(callbackId, { errMsg: 'getProvider:ok', service, - provider + provider, + providers: providers.map((provider) => { + if (typeof provider.serviceReady === 'boolean') { + provider.isAppExist = provider.serviceReady; + } + if (typeof provider.nativeClient === 'boolean') { + provider.isAppExist = provider.nativeClient; + } + return provider + }) }); } }); @@ -8327,6 +8520,22 @@ var serviceContext = (function () { return { errMsg: 'offPush:ok' } + } + + function createPushMessage (params, callbackId) { + const setting = getAppAuthorizeSetting(); + if (setting.notificationAuthorized !== 'authorized') { + return invoke$1(callbackId, { + errMsg: 'createPushMessage:fail notificationAuthorized: ' + setting.notificationAuthorized + }) + } + const options = Object.assign({}, params); + delete options.content; + delete options.payload; + plus.push.createMessage(params.content, params.payload, options); + invoke$1(callbackId, { + errMsg: 'createPushMessage:ok' + }); } function requireNativePlugin$1 (name) { @@ -8563,6 +8772,29 @@ var serviceContext = (function () { __uniConfig.serviceReady = true; } + function requireGlobal () { + const list = [ + 'ArrayBuffer', + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' + ]; + const object = {}; + for (let i = 0; i < list.length; i++) { + const key = list[i]; + object[key] = global[key]; + } + return object + } + function wrapper$1 (webview) { webview.$processed = true; @@ -8807,6 +9039,93 @@ var serviceContext = (function () { ); } + const extend = Object.assign; + + function createLaunchOptions () { + return { + path: '', + query: {}, + scene: 1001, + referrerInfo: { + appId: '', + extraData: {} + } + } + } + + const enterOptions = createLaunchOptions(); + const launchOptions = createLaunchOptions(); + + function getLaunchOptions () { + return launchOptions + } + + function getEnterOptions () { + return enterOptions + } + + function initEnterOptions ({ + path, + query, + referrerInfo + }) { + extend(enterOptions, { + path, + query: query ? parseQuery(query) : {}, + referrerInfo: referrerInfo || {} + }); + } + + function initLaunchOptions ({ + path, + query, + referrerInfo + }) { + extend(launchOptions, { + path, + query: query ? parseQuery(query) : {}, + referrerInfo: referrerInfo || {}, + channel: plus.runtime.channel, + launcher: plus.runtime.launcher + }); + extend(enterOptions, launchOptions); + return launchOptions + } + + function parseRedirectInfo () { + const weexPlus = weex.requireModule('plus'); + if (weexPlus.getRedirectInfo) { + const { + path, + query, + extraData, + userAction, + fromAppid + } = + weexPlus.getRedirectInfo() || {}; + const referrerInfo = { + appId: fromAppid, + extraData: {} + }; + if (extraData) { + referrerInfo.extraData = extraData; + } + return { + path: path || '', + query: query ? '?' + query : '', + referrerInfo, + userAction + } + } + } + + function getLaunchOptionsSync () { + return getLaunchOptions() + } + function getEnterOptionsSync () { + return getEnterOptions() + } + const VD_SYNC_VERSION = 2; const PAGE_CREATE = 2; @@ -9317,10 +9636,12 @@ var serviceContext = (function () { setStatusBarStyle(popStartStatusBarStyle); } else if (e.type === 'end' && e.result) { const pages = getCurrentPages(); + const len = pages.length; const page = pages[pages.length - 1]; page && page.$remove(); setStatusBarStyle(); - if (page && isDirectPage(page)) { + // 仅当存在一个页面,且是直达页面时,才 reLaunch 首页 + if (page && len === 1 && isDirectPage(page)) { reLaunchEntryPage(); } else { UniServiceJSBridge.emit('onAppRoute', { @@ -9862,80 +10183,6 @@ var serviceContext = (function () { return pageVm } - const extend = Object.assign; - - function createLaunchOptions () { - return { - path: '', - query: {}, - scene: 1001, - referrerInfo: { - appId: '', - extraData: {} - } - } - } - - const enterOptions = createLaunchOptions(); - const launchOptions = createLaunchOptions(); - - function getEnterOptions () { - return enterOptions - } - - function initEnterOptions ({ - path, - query, - referrerInfo - }) { - extend(enterOptions, { - path, - query: query ? parseQuery(query) : {}, - referrerInfo: referrerInfo || {} - }); - } - - function initLaunchOptions ({ - path, - query, - referrerInfo - }) { - extend(launchOptions, { - path, - query: query ? parseQuery(query) : {}, - referrerInfo: referrerInfo || {} - }); - extend(enterOptions, launchOptions); - return launchOptions - } - - function parseRedirectInfo () { - const weexPlus = weex.requireModule('plus'); - if (weexPlus.getRedirectInfo) { - const { - path, - query, - extraData, - userAction, - fromAppid - } = - weexPlus.getRedirectInfo() || {}; - const referrerInfo = { - appId: fromAppid, - extraData: {} - }; - if (extraData) { - referrerInfo.extraData = extraData; - } - return { - path: path || '', - query: query ? '?' + query : '', - referrerInfo, - userAction - } - } - } - let isInitEntryPage = false; function initEntryPage () { @@ -11969,10 +12216,16 @@ var serviceContext = (function () { checkIsSupportSoterAuthentication: checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice: checkIsSoterEnrolledInDevice, startSoterAuthentication: startSoterAuthentication, + getDeviceInfo: getDeviceInfo, + getAppBaseInfo: getAppBaseInfo, getSystemInfoSync: getSystemInfoSync, getSystemInfo: getSystemInfo, vibrateLong: vibrateLong, vibrateShort: vibrateShort, + getWindowInfo: getWindowInfo, + getSystemSetting: getSystemSetting, + getAppAuthorizeSetting: getAppAuthorizeSetting, + openAppAuthorizeSetting: openAppAuthorizeSetting, saveFile: saveFile$1, getSavedFileList: getSavedFileList, getFileInfo: getFileInfo$1, @@ -12022,11 +12275,13 @@ var serviceContext = (function () { unsubscribePush: unsubscribePush, onPush: onPush, offPush: offPush, + createPushMessage: createPushMessage, requireNativePlugin: requireNativePlugin$1, shareAppMessageDirectly: shareAppMessageDirectly, share: share, shareWithSystem: shareWithSystem, restoreGlobal: restoreGlobal, + requireGlobal: requireGlobal, getSubNVueById: getSubNVueById, getCurrentSubNVue: getCurrentSubNVue, onHostEventReceive: onHostEventReceive, @@ -12035,6 +12290,8 @@ var serviceContext = (function () { loadSubPackage: loadSubPackage$2, sendHostEvent: sendHostEvent, navigateToMiniProgram: navigateToMiniProgram, + getLaunchOptionsSync: getLaunchOptionsSync, + getEnterOptionsSync: getEnterOptionsSync, navigateBack: navigateBack$1, navigateTo: navigateTo$1, reLaunch: reLaunch$1, @@ -19437,6 +19694,10 @@ var serviceContext = (function () { beginPath () { this.path = []; this.subpath = []; + this.path.push({ + method: 'beginPath', + data: [] + }); } moveTo (x, y) { @@ -21121,6 +21382,8 @@ var serviceContext = (function () { let cid; let cidErrMsg; + let enabled; + let offline; function normalizePushMessage (message) { try { @@ -21132,17 +21395,28 @@ var serviceContext = (function () { function invokePushCallback ( args ) { - if (args.type === 'clientId') { + if (args.type === 'enabled') { + enabled = true; + { + offline = args.offline; + } + } else if (args.type === 'clientId') { cid = args.cid; cidErrMsg = args.errMsg; invokeGetPushCidCallbacks(cid, args.errMsg); } else if (args.type === 'pushMsg') { - onPushMessageCallbacks.forEach((callback) => { - callback({ - type: 'receive', - data: normalizePushMessage(args.message) - }); - }); + const message = { + type: 'receive', + data: normalizePushMessage(args.message) + }; + for (let i = 0; i < onPushMessageCallbacks.length; i++) { + const callback = onPushMessageCallbacks[i]; + callback(message); + // 该消息已被阻止 + if (message.stopped) { + break + } + } } else if (args.type === 'click') { onPushMessageCallbacks.forEach((callback) => { callback({ @@ -21162,7 +21436,7 @@ var serviceContext = (function () { getPushCidCallbacks.length = 0; } - function getPushCid (args) { + function getPushClientId (args) { if (!isPlainObject(args)) { args = {}; } @@ -21174,25 +21448,55 @@ var serviceContext = (function () { const hasSuccess = isFn(success); const hasFail = isFn(fail); const hasComplete = isFn(complete); - getPushCidCallbacks.push((cid, errMsg) => { - let res; - if (cid) { - res = { - errMsg: 'getPushCid:ok', - cid - }; - hasSuccess && success(res); - } else { - res = { - errMsg: 'getPushCid:fail' + (errMsg ? ' ' + errMsg : '') - }; - hasFail && fail(res); + + // App 端且启用离线时,使用 getClientInfoAsync 来调用 + if ( offline) { + plus.push.getClientInfoAsync( + (info) => { + const res = { + errMsg: 'getPushClientId:ok', + cid: info.clientid + }; + hasSuccess && success(res); + hasComplete && complete(res); + }, + (res) => { + res = { + errMsg: 'getPushClientId:fail ' + (res.code + ': ' + res.message) + }; + hasFail && fail(res); + hasComplete && complete(res); + } + ); + return + } + + Promise.resolve().then(() => { + if (typeof enabled === 'undefined') { + enabled = false; + cid = ''; + cidErrMsg = 'uniPush is not enabled'; + } + getPushCidCallbacks.push((cid, errMsg) => { + let res; + if (cid) { + res = { + errMsg: 'getPushClientId:ok', + cid + }; + hasSuccess && success(res); + } else { + res = { + errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') + }; + hasFail && fail(res); + } + hasComplete && complete(res); + }); + if (typeof cid !== 'undefined') { + invokeGetPushCidCallbacks(cid, cidErrMsg); } - hasComplete && complete(res); }); - if (typeof cid !== 'undefined') { - Promise.resolve().then(() => invokeGetPushCidCallbacks(cid, cidErrMsg)); - } } const onPushMessageCallbacks = []; @@ -21217,7 +21521,7 @@ var serviceContext = (function () { var require_context_module_1_22 = /*#__PURE__*/Object.freeze({ __proto__: null, invokePushCallback: invokePushCallback, - getPushCid: getPushCid, + getPushClientId: getPushClientId, onPushMessage: onPushMessage, offPushMessage: offPushMessage }); @@ -21508,6 +21812,7 @@ var serviceContext = (function () { this._page = page; this._queue = []; this._queueCb = []; + this._nodesRef = null; } exec (callback) { @@ -21526,6 +21831,8 @@ var serviceContext = (function () { }); isFn(callback) && callback.call(this, res); }); + + return this._nodesRef } ['in'] (component) { @@ -21535,15 +21842,15 @@ var serviceContext = (function () { } select (selector) { - return new NodesRef(this, this._component, selector, true) + return (this._nodesRef = new NodesRef(this, this._component, selector, true)) } selectAll (selector) { - return new NodesRef(this, this._component, selector, false) + return (this._nodesRef = new NodesRef(this, this._component, selector, false)) } selectViewport () { - return new NodesRef(this, 0, '', true) + return (this._nodesRef = new NodesRef(this, 0, '', true)) } _push (selector, component, single, fields, callback) { diff --git a/packages/uni-app-plus/dist/view.css b/packages/uni-app-plus/dist/view.css index 2fb7f26ccf4ce9342121d07fdf3c4d15caa773f3..b8e498efe614858bf1e0cf95cd591cc73ce79f19 100644 --- a/packages/uni-app-plus/dist/view.css +++ b/packages/uni-app-plus/dist/view.css @@ -1 +1 @@ -*{margin:0;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent}input[type=search]::-webkit-search-cancel-button{display:none}@font-face{font-weight:400;font-style:normal;font-family:uni;src:url("data:application/octet-stream;base64,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") format("truetype")}@font-face{font-weight:400;font-style:normal;font-family:unibtn;src:url("data:application/octet-stream;base64,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") format("truetype")}body,html{-webkit-user-select:none;user-select:none;width:100%}html{height:100%;height:100vh;width:100%;width:100vw}body{overflow-x:hidden;background-color:#fff}[class*=" uni-icon-"],[class^=uni-icon-]{display:inline-block;vertical-align:middle;font:normal normal normal 14px/1 uni;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}[class*=" uni-btn-icon"],[class^=uni-btn-icon]{display:inline-block;font:normal normal normal 14px/1 unibtn;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}[class*=" uni-btn-icon"]:before,[class^=uni-btn-icon]:before{margin:0;box-sizing:border-box}.uni-icon-success-no-circle:before{content:"\EA08"}.uni-icon-error:before{content:"\EA0B"}.uni-loading,uni-button[loading]:before{background:rgba(0,0,0,0) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=") no-repeat}.uni-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:uni-loading 1s steps(12) infinite;animation:uni-loading 1s steps(12) infinite;background-size:100%}@-webkit-keyframes uni-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes uni-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}[nvue] uni-scroll-view,[nvue] uni-swiper-item,[nvue] uni-view{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0;-webkit-flex-basis:auto;flex-basis:auto;-webkit-box-align:stretch;-webkit-align-items:stretch;align-items:stretch;-webkit-align-content:flex-start;align-content:flex-start}[nvue] uni-button{margin:0}[nvue-dir-row] uni-label,[nvue-dir-row] uni-swiper-item,[nvue-dir-row] uni-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}[nvue-dir-column] uni-label,[nvue-dir-column] uni-swiper-item,[nvue-dir-column] uni-view{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}[nvue-dir-row-reverse] uni-label,[nvue-dir-row-reverse] uni-swiper-item,[nvue-dir-row-reverse] uni-view{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}[nvue-dir-column-reverse] uni-label,[nvue-dir-column-reverse] uni-swiper-item,[nvue-dir-column-reverse] uni-view{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse}[nvue] uni-image,[nvue] uni-input,[nvue] uni-scroll-view,[nvue] uni-swiper,[nvue] uni-swiper-item,[nvue] uni-text,[nvue] uni-textarea,[nvue] uni-video,[nvue] uni-view{position:relative;border:0 solid #000;box-sizing:border-box}[nvue] uni-swiper-item{position:absolute}uni-audio{display:none}uni-audio[controls]{display:inline-block}uni-audio[hidden]{display:none}.uni-audio-default{max-width:100%;min-width:302px;height:65px;background:#fcfcfc;border:1px solid #e0e0e0;border-radius:2.5px;display:inline-block;overflow:hidden}.uni-audio-left{width:65px;height:65px;float:left;background-color:#e6e6e6;background-size:100% 100%;background-position:50% 50%}.uni-audio-button{width:24px;height:24px;margin:20.5px;background-size:cover}.uni-audio-button.play{background-image:url(data:image/png;base64,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)}.uni-audio-button.pause{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABatJREFUaAXVWl1IpFUYnllZGUf3wlz6MXER1ES7s83VUDJw6KpdaSTDwMnYFSK6KNirooHullKQCNzQRjZ/wom1u9ALQ0mT1ktFdEBWXLdibaH1jwmx5zme83W+z2Hm+7bZmc8X3jl/73vO837n/z3j9aSBjo6O8lBNC7gZXAUuBxeCz4FJj8APwTHwCngaPOX1evcRZocAuhAcAt8G74KdEnWoyzpobGYIjfnBn4D/BqeLWBfr9Du1wmtXAZXnQPY9cBj8HNhEe3t7sbW1tfn19fW7m5ubD5aXl7dnZmYeUKipqel8dXV1UUlJyfmysrILFRUV9X6/n8PMSveREQYPYHgdWgsTpW0ZAPDPQ3kC/JJeCUEvLi7+NDg4+EskEvldL0sVD4VCz3Z1db1SW1v7egJj7kD/Coy4l6qelAYAfB0quQ02vno8Hr8/OTkZaWtrmzo4ODhK1Uiycp/P5x0fH28JBAKh3Nxcow3osDdaYcRCMv2kBgD8O1D+BuyTlcTn5+cj7e3t0Y2NjX+SVey0rLS09OzY2Fiwvr4+BN1cqX+A8CqM+E6mTwRnTuTIDAn+FpIC/OHh4V+9vb0fNzQ0jKYbPJtknaybbbAtCYNt35JYZJY5SNgDctj8DFEBfnd3d627u/vT4eHhP8zqTybV0dHxTH9//+f5+fkVsgX2xKuJhtMJAwCeE/Y3sBiPBF9XV/fh0tISK8kY1dTU+BYWFvo0IzgnLlontmkIATyXSq42Ajy7kl8+0+D5ldgm29aGEzFNSIwUEWQyADlc59VSGe/r6/ssU8PmGI75l20TA3LjsoTYiNEgYwjBMu6CPKuIr4/Vph+TasyQzGJkbm7ubaxO1yQEDqVyDKU9pvUe+AhpAZ7rPJbKHyjgBuKyTUwSCzESqyBhAL4+D1PXZZ6Hm9STWCpV/U5DYiEmTe+6xOwRQwiJEAq/pQCPB0VFRdf+7w7LutJJ3LG3t7dvaseOdzGMImoIXVaN8WzjNvDERkzEpnAiFJjP4OvzMhJQBTyYqbjdEDov7+/vf4+6pu0wZQcGBi7arV/JWbAFiN2Lnzcg8COFuGkVFBSo2a70UoYEhC5+OqWgJoAv+mdeXt5bWpat6M7Ozk1tc7vMIfSa0lxdXf1VxZ2ETsGz7sfRoV4sFtMxNtOAF1hAugs6jrn3lxcmDV0VDTBuRrxJaYWujFowltMA40LNa6ArUWugLBgLaYByfXjUHVaTd13UgvEcDTjVRAPodBJE74GKuzW0YHxEA+gxE0TXh4q7NbRgfEgDeIQWRL+Nirs1tGCM0YAVBZZOJxV3a2jBuEIDphVYesxU3EnIY4ETeco+jg71LBinacAUWNxueFSlx4yCTmh0dPRLJ4AoOzIy8oWTNihLbNpxmpin1H2AnrcrFJqdnf0KM901tzFiUoQ94M3GxsYPZHoC94FW9gBJnEYZoa8SBy1hGNNuIWIiNg2PwKwbIPYDdhF9lZqgK6LEpA0fYv3PAHQF94IbCikdrcXFxWdVOtsh/abEpOG4ITGbvBI9EBA3f3qJo9FoUFPIapROX81zTYzEKkgNIQ8s4qwOH2d7PPQS9/T0vKjS2QqJQXqsFYSwxCrSpsmK6yVdi7zx0APmoVuvs7Pz/Wx55+jkHRoa+jonJ+cp4gHdAV+CAcbrjckASsCI0+vcpQGw7h6CVrDwRvMCTS8xvwbLM0Fsy+KZJha+1hCbiYw5oOdCkM86V1UejWBXZmJOsA22pXkeCIOvNAmfmk4MIQWaIYZTwiemYDAY3dracsUTU1IDpBGn95FP9Yac2KfzmVUzgkssHxfCYOGGR2gQvXp0jNG3lOyh+wKosrLykmWMq3q4SYXBth+6laLtEL3hqr8a2AZuFYQhrvizR8pJbAWeKA1j6OFuATeDq8D09hWClc+Jp0ceGHn/5hWWt8C0/N3mX15C4bDnCIuAAAAAAElFTkSuQmCC)}.uni-audio-right{box-sizing:border-box;height:65px;margin-left:65px;padding:11px 16.5px 13.5px 15px;overflow:hidden}.uni-audio-time{margin-top:3.5px;height:16.5px;font-size:12px;color:#888;float:right}.uni-audio-info{margin-right:70px;overflow:hidden}.uni-audio-name{height:22.5px;line-height:22.5px;margin-bottom:3.5px;font-size:14px;color:#353535}.uni-audio-author,.uni-audio-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.uni-audio-author{height:14.5px;line-height:14.5px;font-size:12px;color:#888}uni-button{position:relative;display:block;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;box-sizing:border-box;font-size:18px;text-align:center;text-decoration:none;line-height:2.55555556;border-radius:5px;-webkit-tap-highlight-color:transparent;overflow:hidden;color:#000;background-color:#f8f8f8;cursor:pointer}uni-button[hidden]{display:none!important}uni-button:after{content:" ";width:200%;height:200%;position:absolute;top:0;left:0;border:1px solid rgba(0,0,0,.2);-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;box-sizing:border-box;border-radius:10px}uni-button[native]{padding-left:0;padding-right:0}uni-button[native] .uni-button-cover-view-wrapper{border:inherit;border-color:inherit;border-radius:inherit;background-color:inherit}uni-button[native] .uni-button-cover-view-inner{padding-left:14px;padding-right:14px}uni-button uni-cover-view{line-height:inherit;white-space:inherit}uni-button[type=default]{color:#000;background-color:#f8f8f8}uni-button[type=primary]{color:#fff;background-color:#007aff}uni-button[type=warn]{color:#fff;background-color:#e64340}uni-button[disabled]{color:hsla(0,0%,100%,.6);cursor:not-allowed}uni-button[disabled]:not([type]),uni-button[disabled][type=default]{color:rgba(0,0,0,.3);background-color:#f7f7f7}uni-button[disabled][type=primary]{background-color:rgba(0,122,255,.6)}uni-button[disabled][type=warn]{background-color:#ec8b89}uni-button[type=primary][plain]{color:#007aff;border:1px solid #007aff;background-color:rgba(0,0,0,0)}uni-button[type=primary][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=primary][plain]:after{border-width:0}uni-button[type=default][plain]{color:#353535;border:1px solid #353535;background-color:rgba(0,0,0,0)}uni-button[type=default][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=default][plain]:after{border-width:0}uni-button[plain]{color:#353535;border:1px solid #353535;background-color:rgba(0,0,0,0)}uni-button[plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[plain]:after{border-width:0}uni-button[plain][native] .uni-button-cover-view-inner{padding:0}uni-button[type=warn][plain]{color:#e64340;border:1px solid #e64340;background-color:rgba(0,0,0,0)}uni-button[type=warn][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=warn][plain]:after{border-width:0}uni-button[size=mini]{display:inline-block;line-height:2.3;font-size:13px;padding:0 1.34em}uni-button[size=mini][native]{padding:0}uni-button[size=mini][native] .uni-button-cover-view-inner{padding:0 1.34em}uni-button[loading]:not([disabled]){cursor:progress}uni-button[loading]:before{content:" ";display:inline-block;width:18px;height:18px;vertical-align:middle;-webkit-animation:uni-loading 1s steps(12) infinite;animation:uni-loading 1s steps(12) infinite;background-size:100%}uni-button[loading][type=primary]{color:hsla(0,0%,100%,.6);background-color:#0062cc}uni-button[loading][type=primary][plain]{color:#007aff;background-color:rgba(0,0,0,0)}uni-button[loading][type=default]{color:rgba(0,0,0,.6);background-color:#dedede}uni-button[loading][type=default][plain]{color:#353535;background-color:rgba(0,0,0,0)}uni-button[loading][type=warn]{color:hsla(0,0%,100%,.6);background-color:#ce3c39}uni-button[loading][type=warn][plain]{color:#e64340;background-color:rgba(0,0,0,0)}uni-button[loading][native]:before{content:none}.button-hover{color:rgba(0,0,0,.6);background-color:#dedede}.button-hover[plain]{color:rgba(53,53,53,.6);border-color:rgba(53,53,53,.6);background-color:rgba(0,0,0,0)}.button-hover[type=primary]{color:hsla(0,0%,100%,.6);background-color:#0062cc}.button-hover[type=primary][plain]{color:rgba(26,173,25,.6);border-color:rgba(26,173,25,.6);background-color:rgba(0,0,0,0)}.button-hover[type=default]{color:rgba(0,0,0,.6);background-color:#dedede}.button-hover[type=default][plain]{color:rgba(53,53,53,.6);border-color:rgba(53,53,53,.6);background-color:rgba(0,0,0,0)}.button-hover[type=warn]{color:hsla(0,0%,100%,.6);background-color:#ce3c39}.button-hover[type=warn][plain]{color:rgba(230,67,64,.6);border-color:rgba(230,67,64,.6);background-color:rgba(0,0,0,0)}uni-canvas{width:300px;height:150px;display:block;position:relative}uni-canvas>canvas{position:absolute;top:0;left:0;width:100%;height:100%}uni-checkbox-group[hidden]{display:none}uni-checkbox{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-checkbox[hidden]{display:none}uni-checkbox[disabled]{cursor:not-allowed}uni-checkbox .uni-checkbox-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-checkbox .uni-checkbox-input{margin-right:5px;-webkit-appearance:none;appearance:none;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:22px;height:22px;position:relative}uni-checkbox:not([disabled]) .uni-checkbox-input:hover{border-color:#007aff}uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{color:#007aff}uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";font-size:22px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled{background-color:#e1e1e1}uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled:before{color:#adadad}uni-checkbox-group{display:block}.ql-container{display:block;position:relative;box-sizing:border-box;-webkit-user-select:text;user-select:text;outline:none;overflow:hidden;width:100%;height:200px;min-height:200px}.ql-container[hidden]{display:none}.ql-container .ql-editor{position:relative;font-size:inherit;line-height:inherit;font-family:inherit;min-height:inherit;width:100%;height:100%;padding:0;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-overflow-scrolling:touch}.ql-container .ql-editor::-webkit-scrollbar{width:0!important}.ql-container .ql-editor.scroll-disabled{overflow:hidden}.ql-container .ql-image-overlay{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;box-sizing:border-box;border:1px dashed #ccc;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.ql-container .ql-image-overlay .ql-image-size{position:absolute;padding:4px 8px;text-align:center;background-color:#fff;color:#888;border:1px solid #ccc;box-sizing:border-box;opacity:.8;right:4px;top:4px;font-size:12px;display:inline-block;width:auto}.ql-container .ql-image-overlay .ql-image-toolbar{position:relative;text-align:center;box-sizing:border-box;background:#000;border-radius:5px;color:#fff;font-size:0;min-height:24px;z-index:100}.ql-container .ql-image-overlay .ql-image-toolbar span{display:inline-block;cursor:pointer;padding:5px;font-size:12px;border-right:1px solid #fff}.ql-container .ql-image-overlay .ql-image-toolbar span:last-child{border-right:0}.ql-container .ql-image-overlay .ql-image-toolbar span.triangle-up{padding:0;position:absolute;top:-12px;left:50%;-webkit-transform:translatex(-50%);transform:translatex(-50%);width:0;height:0;border-width:6px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.ql-container .ql-image-overlay .ql-image-handle{position:absolute;height:12px;width:12px;border-radius:50%;border:1px solid #ccc;box-sizing:border-box;background:#fff}.ql-container img{display:inline-block;max-width:100%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;height:100%;outline:none;overflow-y:auto;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor ol,.ql-editor p,.ql-editor pre,.ql-editor ul{margin:0;padding:0;counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol>li,.ql-editor ul>li{list-style-type:none}.ql-editor ul>li:before{content:"\2022"}.ql-editor ul[data-checked=false],.ql-editor ul[data-checked=true]{pointer-events:none}.ql-editor ul[data-checked=false]>li *,.ql-editor ul[data-checked=true]>li *{pointer-events:all}.ql-editor ul[data-checked=false]>li:before,.ql-editor ul[data-checked=true]>li:before{color:#777;cursor:pointer;pointer-events:all}.ql-editor ul[data-checked=true]>li:before{content:"\2611"}.ql-editor ul[data-checked=false]>li:before{content:"\2610"}.ql-editor li:before{display:inline-block;white-space:nowrap;width:2em}.ql-editor ol li{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;counter-increment:list-0}.ql-editor ol li:before{content:counter(list-0,decimal) ". "}.ql-editor ol li.ql-indent-1{counter-increment:list-1}.ql-editor ol li.ql-indent-1:before{content:counter(list-1,lower-alpha) ". "}.ql-editor ol li.ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-2{counter-increment:list-2}.ql-editor ol li.ql-indent-2:before{content:counter(list-2,lower-roman) ". "}.ql-editor ol li.ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-3{counter-increment:list-3}.ql-editor ol li.ql-indent-3:before{content:counter(list-3,decimal) ". "}.ql-editor ol li.ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-4{counter-increment:list-4}.ql-editor ol li.ql-indent-4:before{content:counter(list-4,lower-alpha) ". "}.ql-editor ol li.ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-5{counter-increment:list-5}.ql-editor ol li.ql-indent-5:before{content:counter(list-5,lower-roman) ". "}.ql-editor ol li.ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-6{counter-increment:list-6}.ql-editor ol li.ql-indent-6:before{content:counter(list-6,decimal) ". "}.ql-editor ol li.ql-indent-6{counter-reset:list-7 list-8 list-9}.ql-editor ol li.ql-indent-7{counter-increment:list-7}.ql-editor ol li.ql-indent-7:before{content:counter(list-7,lower-alpha) ". "}.ql-editor ol li.ql-indent-7{counter-reset:list-8 list-9}.ql-editor ol li.ql-indent-8{counter-increment:list-8}.ql-editor ol li.ql-indent-8:before{content:counter(list-8,lower-roman) ". "}.ql-editor ol li.ql-indent-8{counter-reset:list-9}.ql-editor ol li.ql-indent-9{counter-increment:list-9}.ql-editor ol li.ql-indent-9:before{content:counter(list-9,decimal) ". "}.ql-editor .ql-indent-1:not(.ql-direction-rtl),.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:2em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:2em}.ql-editor .ql-indent-2:not(.ql-direction-rtl),.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:4em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:4em}.ql-editor .ql-indent-3:not(.ql-direction-rtl),.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:6em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor .ql-indent-4:not(.ql-direction-rtl),.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:8em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:8em}.ql-editor .ql-indent-5:not(.ql-direction-rtl),.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:10em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:10em}.ql-editor .ql-indent-6:not(.ql-direction-rtl),.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:12em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor .ql-indent-7:not(.ql-direction-rtl),.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:14em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:14em}.ql-editor .ql-indent-8:not(.ql-direction-rtl),.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:16em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:16em}.ql-editor .ql-indent-9:not(.ql-direction-rtl),.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:18em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor.ql-blank:before{color:rgba(0,0,0,.6);content:attr(data-placeholder);font-style:italic;pointer-events:none;position:absolute}.ql-container.ql-disabled .ql-editor ul[data-checked]>li:before{pointer-events:none}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}uni-icon{display:inline-block;font-size:0;box-sizing:border-box}uni-icon[hidden]{display:none}uni-icon>i{font:normal normal normal 14px/1 weui}uni-icon>i:before{margin:0;box-sizing:border-box}@font-face{font-weight:400;font-style:normal;font-family:weui;src:url("data:application/octet-stream;base64,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") format("truetype")}.uni-icon-success:before{content:"\EA06"}.uni-icon-success_circle:before{content:"\EA07"}.uni-icon-success_no_circle:before{content:"\EA08"}.uni-icon-safe_success:before{content:"\EA04"}.uni-icon-safe_warn:before{content:"\EA05"}.uni-icon-info:before{content:"\EA03"}.uni-icon-info_circle:before{content:"\EA0C"}.uni-icon-warn:before{content:"\EA0B"}.uni-icon-waiting:before{content:"\EA09"}.uni-icon-waiting_circle:before{content:"\EA0A"}.uni-icon-circle:before{content:"\EA01"}.uni-icon-cancel:before{content:"\EA0D"}.uni-icon-download:before{content:"\EA02"}.uni-icon-search:before{content:"\EA0E"}.uni-icon-clear:before{content:"\EA0F"}.uni-icon-safe_success,.uni-icon-success,.uni-icon-success_circle,.uni-icon-success_no_circle{color:#007aff}.uni-icon-safe_warn{color:#ffbe00}.uni-icon-info{color:#10aeff}.uni-icon-info_circle{color:#007aff}.uni-icon-warn{color:#f76260}.uni-icon-waiting,.uni-icon-waiting_circle{color:#10aeff}.uni-icon-circle{color:#c9c9c9}.uni-icon-cancel{color:#f43530}.uni-icon-download{color:#007aff}.uni-icon-clear,.uni-icon-search{color:#b2b2b2}uni-image{width:320px;height:240px;display:inline-block;overflow:hidden;position:relative}uni-image[hidden]{display:none}uni-image>div,uni-image>img{width:100%;height:100%}uni-image>img{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;display:block;position:absolute;top:0;left:0;opacity:0}uni-image>.uni-image-will-change{will-change:transform}uni-input{display:block;font-size:16px;line-height:1.4em;height:1.4em;min-height:1.4em;overflow:hidden}uni-input[hidden]{display:none}.uni-input-form,.uni-input-input,.uni-input-placeholder,.uni-input-wrapper{outline:none;border:none;padding:0;margin:0;text-decoration:inherit}.uni-input-form,.uni-input-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;width:100%;height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.uni-input-input,.uni-input-placeholder{width:100%}.uni-input-placeholder{position:absolute;top:auto!important;left:0;color:grey;overflow:hidden;text-overflow:clip;white-space:pre;word-break:keep-all;pointer-events:none;line-height:inherit}.uni-input-input{position:relative;display:block;height:100%;background:none;color:inherit;opacity:1;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-indent:inherit;text-transform:inherit;text-shadow:inherit}.uni-input-input[type=search]::-webkit-search-cancel-button,.uni-input-input[type=search]::-webkit-search-decoration{display:none}.uni-input-input::-webkit-inner-spin-button,.uni-input-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.uni-input-input[type=number]{-moz-appearance:textfield}.uni-input-input:disabled{-webkit-text-fill-color:currentcolor}.uni-label-pointer{cursor:pointer}uni-movable-area{display:block;position:relative;width:10px;height:10px}uni-movable-area[hidden]{display:none}uni-movable-view{display:inline-block;width:10px;height:10px;top:0;left:0;position:absolute;cursor:grab}uni-movable-view[hidden]{display:none}uni-navigator{height:auto;width:auto;display:block;cursor:pointer}uni-navigator[hidden]{display:none}.navigator-hover{background-color:rgba(0,0,0,.1);opacity:.7}uni-picker-view-column{-webkit-flex:1;-webkit-box-flex:1;flex:1;position:relative;height:100%;overflow:hidden}uni-picker-view-column[hidden]{display:none}.uni-picker-view-group{height:100%;overflow:hidden}.uni-picker-view-mask{transform:translateZ(0);-webkit-transform:translateZ(0)}.uni-picker-view-indicator,.uni-picker-view-mask{position:absolute;left:0;width:100%;z-index:3;pointer-events:none}.uni-picker-view-mask{top:0;height:100%;margin:0 auto;background:-webkit-linear-gradient(top,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),linear-gradient(0deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-position:top,bottom;background-size:100% 102px;background-repeat:no-repeat}.uni-picker-view-indicator{height:34px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.uni-picker-view-content{position:absolute;top:0;left:0;width:100%;will-change:transform;padding:102px 0;cursor:pointer}.uni-picker-view-content>*{height:34px;overflow:hidden}.uni-picker-view-indicator:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.uni-picker-view-indicator:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.uni-picker-view-indicator:after,.uni-picker-view-indicator:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}uni-picker-view{display:block}uni-picker-view .uni-picker-view-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;overflow:hidden;height:100%}uni-picker-view[hidden]{display:none}uni-progress{display:-webkit-flex;display:-webkit-box;display:flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center}uni-progress[hidden]{display:none}.uni-progress-bar{-webkit-flex:1;-webkit-box-flex:1;flex:1}.uni-progress-inner-bar{width:0;height:100%}.uni-progress-info{margin-top:0;margin-bottom:0;min-width:2em;margin-left:15px;font-size:16px}uni-radio-group[hidden]{display:none}uni-radio{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-radio[hidden]{display:none}uni-radio[disabled]{cursor:not-allowed}uni-radio .uni-radio-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-radio .uni-radio-input{-webkit-appearance:none;appearance:none;margin-right:5px;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:50%;width:22px;height:22px;position:relative}uni-radio:not([disabled]) .uni-radio-input:hover{border-color:#007aff}uni-radio .uni-radio-input.uni-radio-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";color:#fff;font-size:18px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-radio .uni-radio-input.uni-radio-input-disabled{background-color:#e1e1e1;border-color:#d1d1d1}uni-radio .uni-radio-input.uni-radio-input-disabled:before{color:#adadad}uni-radio-group{display:block}@-webkit-keyframes once-show{0%{top:0}}@keyframes once-show{0%{top:0}}uni-resize-sensor,uni-resize-sensor>div{position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden}uni-resize-sensor{display:block;z-index:-1;visibility:hidden;-webkit-animation:once-show 1ms;animation:once-show 1ms}uni-resize-sensor>div>div{position:absolute;left:0;top:0}uni-resize-sensor>div:first-child>div{width:100000px;height:100000px}uni-resize-sensor>div:last-child>div{width:200%;height:200%}uni-scroll-view{display:block;width:100%}uni-scroll-view[hidden]{display:none}.uni-scroll-view{position:relative;-webkit-overflow-scrolling:touch;max-height:inherit}.uni-scroll-view,.uni-scroll-view-content{width:100%;height:100%}.uni-scroll-view-refresher{position:relative;overflow:hidden}.uni-scroll-view-refresh{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}.uni-scroll-view-refresh,.uni-scroll-view-refresh-inner{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.uni-scroll-view-refresh-inner{line-height:0;width:40px;height:40px;border-radius:50%;background-color:#fff;box-shadow:0 1px 6px rgba(0,0,0,.117647),0 1px 4px rgba(0,0,0,.117647)}.uni-scroll-view-refresh__spinner{-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:uni-scroll-view-refresh-rotate 2s linear infinite;animation:uni-scroll-view-refresh-rotate 2s linear infinite}.uni-scroll-view-refresh__spinner>circle{stroke:currentColor;stroke-linecap:round;-webkit-animation:uni-scroll-view-refresh-dash 2s linear infinite;animation:uni-scroll-view-refresh-dash 2s linear infinite}@-webkit-keyframes uni-scroll-view-refresh-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes uni-scroll-view-refresh-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes uni-scroll-view-refresh-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes uni-scroll-view-refresh-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}uni-slider{margin:10px 18px;padding:0;display:block}uni-slider[hidden]{display:none}uni-slider .uni-slider-wrapper{display:-webkit-flex;display:-webkit-box;display:flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;min-height:16px}uni-slider .uni-slider-tap-area{-webkit-flex:1;-webkit-box-flex:1;flex:1;padding:8px 0}uni-slider .uni-slider-handle-wrapper{position:relative;height:2px;border-radius:5px;background-color:#e9e9e9;cursor:pointer;-webkit-tap-highlight-color:transparent}uni-slider .uni-slider-handle-wrapper,uni-slider .uni-slider-track{-webkit-transition:background-color .3s ease;transition:background-color .3s ease}uni-slider .uni-slider-track{height:100%;border-radius:6px;background-color:#007aff}uni-slider .uni-slider-handle,uni-slider .uni-slider-thumb{position:absolute;left:50%;top:50%;cursor:pointer;border-radius:50%;-webkit-transition:border-color .3s ease;transition:border-color .3s ease}uni-slider .uni-slider-handle{width:28px;height:28px;margin-top:-14px;margin-left:-14px;background-color:rgba(0,0,0,0);z-index:3;cursor:grab}uni-slider .uni-slider-thumb{z-index:2;box-shadow:0 0 4px rgba(0,0,0,.2)}uni-slider .uni-slider-step{position:absolute;width:100%;height:2px;background:rgba(0,0,0,0);z-index:1}uni-slider .uni-slider-value{width:3ch;color:#888;font-size:14px;margin-left:1em}uni-slider .uni-slider-disabled .uni-slider-track{background-color:#ccc}uni-slider .uni-slider-disabled .uni-slider-thumb{background-color:#fff;border-color:#ccc}uni-swiper-item{display:block;overflow:hidden;will-change:transform;position:absolute;width:100%;height:100%;cursor:grab}uni-swiper-item[hidden]{display:none}uni-swiper{display:block;height:150px}uni-swiper[hidden]{display:none}uni-swiper .uni-swiper-wrapper{overflow:hidden;position:relative;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0)}uni-swiper .uni-swiper-slides{position:absolute;left:0;top:0;right:0;bottom:0}uni-swiper .uni-swiper-slide-frame{position:absolute;left:0;top:0;width:100%;height:100%;will-change:transform}uni-swiper .uni-swiper-dots{position:absolute;font-size:0}uni-swiper .uni-swiper-dots-horizontal{left:50%;bottom:10px;text-align:center;white-space:nowrap;-webkit-transform:translate(-50%);transform:translate(-50%)}uni-swiper .uni-swiper-dots-horizontal .uni-swiper-dot{margin-right:8px}uni-swiper .uni-swiper-dots-horizontal .uni-swiper-dot:last-child{margin-right:0}uni-swiper .uni-swiper-dots-vertical{right:10px;top:50%;text-align:right;-webkit-transform:translateY(-50%);transform:translateY(-50%)}uni-swiper .uni-swiper-dots-vertical .uni-swiper-dot{display:block;margin-bottom:9px}uni-swiper .uni-swiper-dots-vertical .uni-swiper-dot:last-child{margin-bottom:0}uni-swiper .uni-swiper-dot{display:inline-block;width:8px;height:8px;cursor:pointer;-webkit-transition-property:background-color;transition-property:background-color;-webkit-transition-timing-function:ease;transition-timing-function:ease;background:rgba(0,0,0,.3);border-radius:50%}uni-swiper .uni-swiper-dot-active{background-color:#000}uni-switch{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-switch[hidden]{display:none}uni-switch[disabled]{cursor:not-allowed}uni-switch .uni-switch-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-switch .uni-switch-input{-webkit-appearance:none;appearance:none;position:relative;width:52px;height:32px;margin-right:5px;border:1px solid #dfdfdf;outline:0;border-radius:16px;box-sizing:border-box;background-color:#dfdfdf;-webkit-transition:background-color .1s,border .1s;transition:background-color .1s,border .1s}uni-switch[disabled] .uni-switch-input{opacity:.7}uni-switch .uni-switch-input:before{width:50px;background-color:#fdfdfd}uni-switch .uni-switch-input:after,uni-switch .uni-switch-input:before{content:" ";position:absolute;top:0;left:0;height:30px;border-radius:15px;transition:-webkit-transform .3s;-webkit-transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}uni-switch .uni-switch-input:after{width:30px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}uni-switch .uni-switch-input.uni-switch-input-checked{border-color:#007aff;background-color:#007aff}uni-switch .uni-switch-input.uni-switch-input-checked:before{-webkit-transform:scale(0);transform:scale(0)}uni-switch .uni-switch-input.uni-switch-input-checked:after{-webkit-transform:translateX(20px);transform:translateX(20px)}uni-switch .uni-checkbox-input{margin-right:5px;-webkit-appearance:none;appearance:none;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:22px;height:22px;position:relative;color:#007aff}uni-switch:not([disabled]) .uni-checkbox-input:hover{border-color:#007aff}uni-switch .uni-checkbox-input.uni-checkbox-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";color:inherit;font-size:22px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-switch .uni-checkbox-input.uni-checkbox-input-disabled{background-color:#e1e1e1}uni-switch .uni-checkbox-input.uni-checkbox-input-disabled:before{color:#adadad}uni-text[selectable]{cursor:auto;user-select:text;-webkit-user-select:text}uni-textarea{width:300px;height:150px;display:block;position:relative;font-size:16px;line-height:normal;white-space:pre-wrap;word-break:break-all}uni-textarea[hidden]{display:none}.uni-textarea-compute,.uni-textarea-line,.uni-textarea-placeholder,.uni-textarea-textarea,.uni-textarea-wrapper{outline:none;border:none;padding:0;margin:0;text-decoration:inherit}.uni-textarea-wrapper{display:block;position:relative;width:100%;height:100%;min-height:inherit}.uni-textarea-compute,.uni-textarea-line,.uni-textarea-placeholder,.uni-textarea-textarea{position:absolute;width:100%;height:100%;left:0;top:0;white-space:inherit;word-break:inherit}.uni-textarea-placeholder{color:grey;overflow:hidden}.uni-textarea-compute,.uni-textarea-line{visibility:hidden;height:auto}.uni-textarea-line{width:1em}.uni-textarea-textarea{resize:none;background:none;color:inherit;opacity:1;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-indent:inherit;text-transform:inherit;text-shadow:inherit}.uni-textarea-textarea-fix-margin{width:auto;right:0;margin:0 -3px}.uni-textarea-textarea:disabled{-webkit-text-fill-color:currentcolor}uni-view{display:block}uni-view[hidden]{display:none}uni-ad{display:block;overflow:hidden}uni-ad[hidden]{display:none}uni-ad .uni-ad-container{width:100%;min-height:1px}uni-cover-image{display:block;line-height:1.2;overflow:hidden;height:100%;width:100%;pointer-events:auto}uni-cover-image[hidden]{display:none}uni-cover-image .uni-cover-image{width:100%;height:100%}uni-cover-view{display:block;line-height:1.2;overflow:hidden;white-space:nowrap;pointer-events:auto}uni-cover-view[hidden]{display:none}uni-cover-view .uni-cover-view{width:100%;height:100%;visibility:hidden}uni-live-pusher{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-live-pusher[hidden]{display:none}.uni-live-pusher-container{left:0;background-color:#000}.uni-live-pusher-container,.uni-live-pusher-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-live-pusher-slot{pointer-events:none}uni-map{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-map[hidden]{display:none}.uni-map-container{left:0;background-color:#000}.uni-map-container,.uni-map-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-map-slot{pointer-events:none}uni-picker{display:block}uni-video{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-video[hidden]{display:none}.uni-video-container{left:0;background-color:#000}.uni-video-container,.uni-video-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-video-slot{pointer-events:none}uni-web-view{position:absolute;left:0;right:0;top:0;bottom:0} \ No newline at end of file +*{margin:0;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent}input[type=search]::-webkit-search-cancel-button{display:none}@font-face{font-weight:400;font-style:normal;font-family:uni;src:url("data:application/octet-stream;base64,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") format("truetype")}@font-face{font-weight:400;font-style:normal;font-family:unibtn;src:url("data:application/octet-stream;base64,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") format("truetype")}body,html{-webkit-user-select:none;user-select:none;width:100%}html{height:100%;height:100vh;width:100%;width:100vw}body{overflow-x:hidden;background-color:#fff}[class*=" uni-icon-"],[class^=uni-icon-]{display:inline-block;vertical-align:middle;font:normal normal normal 14px/1 uni;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}[class*=" uni-btn-icon"],[class^=uni-btn-icon]{display:inline-block;font:normal normal normal 14px/1 unibtn;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}[class*=" uni-btn-icon"]:before,[class^=uni-btn-icon]:before{margin:0;box-sizing:border-box}.uni-icon-success-no-circle:before{content:"\EA08"}.uni-icon-error:before{content:"\EA0B"}.uni-loading,uni-button[loading]:before{background:rgba(0,0,0,0) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=") no-repeat}.uni-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:uni-loading 1s steps(12) infinite;animation:uni-loading 1s steps(12) infinite;background-size:100%}@-webkit-keyframes uni-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes uni-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}[nvue] uni-scroll-view,[nvue] uni-swiper-item,[nvue] uni-view{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-shrink:0;flex-shrink:0;-webkit-box-flex:0;-webkit-flex-grow:0;flex-grow:0;-webkit-flex-basis:auto;flex-basis:auto;-webkit-box-align:stretch;-webkit-align-items:stretch;align-items:stretch;-webkit-align-content:flex-start;align-content:flex-start}[nvue] uni-button{margin:0}[nvue-dir-row] uni-label,[nvue-dir-row] uni-swiper-item,[nvue-dir-row] uni-view{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}[nvue-dir-column] uni-label,[nvue-dir-column] uni-swiper-item,[nvue-dir-column] uni-view{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}[nvue-dir-row-reverse] uni-label,[nvue-dir-row-reverse] uni-swiper-item,[nvue-dir-row-reverse] uni-view{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}[nvue-dir-column-reverse] uni-label,[nvue-dir-column-reverse] uni-swiper-item,[nvue-dir-column-reverse] uni-view{-webkit-box-orient:vertical;-webkit-box-direction:reverse;-webkit-flex-direction:column-reverse;flex-direction:column-reverse}[nvue] uni-image,[nvue] uni-input,[nvue] uni-scroll-view,[nvue] uni-swiper,[nvue] uni-swiper-item,[nvue] uni-text,[nvue] uni-textarea,[nvue] uni-video,[nvue] uni-view{position:relative;border:0 solid #000;box-sizing:border-box}[nvue] uni-swiper-item{position:absolute}uni-audio{display:none}uni-audio[controls]{display:inline-block}uni-audio[hidden]{display:none}.uni-audio-default{max-width:100%;min-width:302px;height:65px;background:#fcfcfc;border:1px solid #e0e0e0;border-radius:2.5px;display:inline-block;overflow:hidden}.uni-audio-left{width:65px;height:65px;float:left;background-color:#e6e6e6;background-size:100% 100%;background-position:50% 50%}.uni-audio-button{width:24px;height:24px;margin:20.5px;background-size:cover}.uni-audio-button.play{background-image:url(data:image/png;base64,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)}.uni-audio-button.pause{background-image:url(data:image/png;base64,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)}.uni-audio-right{box-sizing:border-box;height:65px;margin-left:65px;padding:11px 16.5px 13.5px 15px;overflow:hidden}.uni-audio-time{margin-top:3.5px;height:16.5px;font-size:12px;color:#888;float:right}.uni-audio-info{margin-right:70px;overflow:hidden}.uni-audio-name{height:22.5px;line-height:22.5px;margin-bottom:3.5px;font-size:14px;color:#353535}.uni-audio-author,.uni-audio-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.uni-audio-author{height:14.5px;line-height:14.5px;font-size:12px;color:#888}uni-button{position:relative;display:block;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;box-sizing:border-box;font-size:18px;text-align:center;text-decoration:none;line-height:2.55555556;border-radius:5px;-webkit-tap-highlight-color:transparent;overflow:hidden;color:#000;background-color:#f8f8f8;cursor:pointer}uni-button[hidden]{display:none!important}uni-button:after{content:" ";width:200%;height:200%;position:absolute;top:0;left:0;border:1px solid rgba(0,0,0,.2);-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;box-sizing:border-box;border-radius:10px}uni-button[native]{padding-left:0;padding-right:0}uni-button[native] .uni-button-cover-view-wrapper{border:inherit;border-color:inherit;border-radius:inherit;background-color:inherit}uni-button[native] .uni-button-cover-view-inner{padding-left:14px;padding-right:14px}uni-button uni-cover-view{line-height:inherit;white-space:inherit}uni-button[type=default]{color:#000;background-color:#f8f8f8}uni-button[type=primary]{color:#fff;background-color:#007aff}uni-button[type=warn]{color:#fff;background-color:#e64340}uni-button[disabled]{color:hsla(0,0%,100%,.6);cursor:not-allowed}uni-button[disabled]:not([type]),uni-button[disabled][type=default]{color:rgba(0,0,0,.3);background-color:#f7f7f7}uni-button[disabled][type=primary]{background-color:rgba(0,122,255,.6)}uni-button[disabled][type=warn]{background-color:#ec8b89}uni-button[type=primary][plain]{color:#007aff;border:1px solid #007aff;background-color:rgba(0,0,0,0)}uni-button[type=primary][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=primary][plain]:after{border-width:0}uni-button[type=default][plain]{color:#353535;border:1px solid #353535;background-color:rgba(0,0,0,0)}uni-button[type=default][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=default][plain]:after{border-width:0}uni-button[plain]{color:#353535;border:1px solid #353535;background-color:rgba(0,0,0,0)}uni-button[plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[plain]:after{border-width:0}uni-button[plain][native] .uni-button-cover-view-inner{padding:0}uni-button[type=warn][plain]{color:#e64340;border:1px solid #e64340;background-color:rgba(0,0,0,0)}uni-button[type=warn][plain][disabled]{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}uni-button[type=warn][plain]:after{border-width:0}uni-button[size=mini]{display:inline-block;line-height:2.3;font-size:13px;padding:0 1.34em}uni-button[size=mini][native]{padding:0}uni-button[size=mini][native] .uni-button-cover-view-inner{padding:0 1.34em}uni-button[loading]:not([disabled]){cursor:progress}uni-button[loading]:before{content:" ";display:inline-block;width:18px;height:18px;vertical-align:middle;-webkit-animation:uni-loading 1s steps(12) infinite;animation:uni-loading 1s steps(12) infinite;background-size:100%}uni-button[loading][type=primary]{color:hsla(0,0%,100%,.6);background-color:#0062cc}uni-button[loading][type=primary][plain]{color:#007aff;background-color:rgba(0,0,0,0)}uni-button[loading][type=default]{color:rgba(0,0,0,.6);background-color:#dedede}uni-button[loading][type=default][plain]{color:#353535;background-color:rgba(0,0,0,0)}uni-button[loading][type=warn]{color:hsla(0,0%,100%,.6);background-color:#ce3c39}uni-button[loading][type=warn][plain]{color:#e64340;background-color:rgba(0,0,0,0)}uni-button[loading][native]:before{content:none}.button-hover{color:rgba(0,0,0,.6);background-color:#dedede}.button-hover[plain]{color:rgba(53,53,53,.6);border-color:rgba(53,53,53,.6);background-color:rgba(0,0,0,0)}.button-hover[type=primary]{color:hsla(0,0%,100%,.6);background-color:#0062cc}.button-hover[type=primary][plain]{color:rgba(26,173,25,.6);border-color:rgba(26,173,25,.6);background-color:rgba(0,0,0,0)}.button-hover[type=default]{color:rgba(0,0,0,.6);background-color:#dedede}.button-hover[type=default][plain]{color:rgba(53,53,53,.6);border-color:rgba(53,53,53,.6);background-color:rgba(0,0,0,0)}.button-hover[type=warn]{color:hsla(0,0%,100%,.6);background-color:#ce3c39}.button-hover[type=warn][plain]{color:rgba(230,67,64,.6);border-color:rgba(230,67,64,.6);background-color:rgba(0,0,0,0)}uni-canvas{width:300px;height:150px;display:block;position:relative}uni-canvas>canvas{position:absolute;top:0;left:0;width:100%;height:100%}uni-checkbox-group[hidden]{display:none}uni-checkbox{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-checkbox[hidden]{display:none}uni-checkbox[disabled]{cursor:not-allowed}uni-checkbox .uni-checkbox-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-checkbox .uni-checkbox-input{margin-right:5px;-webkit-appearance:none;appearance:none;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:22px;height:22px;position:relative}uni-checkbox:not([disabled]) .uni-checkbox-input:hover{border-color:#007aff}uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked{color:#007aff}uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";font-size:22px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled{background-color:#e1e1e1}uni-checkbox .uni-checkbox-input.uni-checkbox-input-disabled:before{color:#adadad}uni-checkbox-group{display:block}.ql-container{display:block;position:relative;box-sizing:border-box;-webkit-user-select:text;user-select:text;outline:none;overflow:hidden;width:100%;height:200px;min-height:200px}.ql-container[hidden]{display:none}.ql-container .ql-editor{position:relative;font-size:inherit;line-height:inherit;font-family:inherit;min-height:inherit;width:100%;height:100%;padding:0;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-overflow-scrolling:touch}.ql-container .ql-editor::-webkit-scrollbar{width:0!important}.ql-container .ql-editor.scroll-disabled{overflow:hidden}.ql-container .ql-image-overlay{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;box-sizing:border-box;border:1px dashed #ccc;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.ql-container .ql-image-overlay .ql-image-size{position:absolute;padding:4px 8px;text-align:center;background-color:#fff;color:#888;border:1px solid #ccc;box-sizing:border-box;opacity:.8;right:4px;top:4px;font-size:12px;display:inline-block;width:auto}.ql-container .ql-image-overlay .ql-image-toolbar{position:relative;text-align:center;box-sizing:border-box;background:#000;border-radius:5px;color:#fff;font-size:0;min-height:24px;z-index:100}.ql-container .ql-image-overlay .ql-image-toolbar span{display:inline-block;cursor:pointer;padding:5px;font-size:12px;border-right:1px solid #fff}.ql-container .ql-image-overlay .ql-image-toolbar span:last-child{border-right:0}.ql-container .ql-image-overlay .ql-image-toolbar span.triangle-up{padding:0;position:absolute;top:-12px;left:50%;-webkit-transform:translatex(-50%);transform:translatex(-50%);width:0;height:0;border-width:6px;border-style:solid;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #000 rgba(0,0,0,0)}.ql-container .ql-image-overlay .ql-image-handle{position:absolute;height:12px;width:12px;border-radius:50%;border:1px solid #ccc;box-sizing:border-box;background:#fff}.ql-container img{display:inline-block;max-width:100%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;height:100%;outline:none;overflow-y:auto;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor>*{cursor:text}.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6,.ql-editor ol,.ql-editor p,.ql-editor pre,.ql-editor ul{margin:0;padding:0;counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol>li,.ql-editor ul>li{list-style-type:none}.ql-editor ul>li:before{content:"\2022"}.ql-editor ul[data-checked=false],.ql-editor ul[data-checked=true]{pointer-events:none}.ql-editor ul[data-checked=false]>li *,.ql-editor ul[data-checked=true]>li *{pointer-events:all}.ql-editor ul[data-checked=false]>li:before,.ql-editor ul[data-checked=true]>li:before{color:#777;cursor:pointer;pointer-events:all}.ql-editor ul[data-checked=true]>li:before{content:"\2611"}.ql-editor ul[data-checked=false]>li:before{content:"\2610"}.ql-editor li:before{display:inline-block;white-space:nowrap;width:2em}.ql-editor ol li{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;counter-increment:list-0}.ql-editor ol li:before{content:counter(list-0,decimal) ". "}.ql-editor ol li.ql-indent-1{counter-increment:list-1}.ql-editor ol li.ql-indent-1:before{content:counter(list-1,lower-alpha) ". "}.ql-editor ol li.ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-2{counter-increment:list-2}.ql-editor ol li.ql-indent-2:before{content:counter(list-2,lower-roman) ". "}.ql-editor ol li.ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-3{counter-increment:list-3}.ql-editor ol li.ql-indent-3:before{content:counter(list-3,decimal) ". "}.ql-editor ol li.ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-4{counter-increment:list-4}.ql-editor ol li.ql-indent-4:before{content:counter(list-4,lower-alpha) ". "}.ql-editor ol li.ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-5{counter-increment:list-5}.ql-editor ol li.ql-indent-5:before{content:counter(list-5,lower-roman) ". "}.ql-editor ol li.ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}.ql-editor ol li.ql-indent-6{counter-increment:list-6}.ql-editor ol li.ql-indent-6:before{content:counter(list-6,decimal) ". "}.ql-editor ol li.ql-indent-6{counter-reset:list-7 list-8 list-9}.ql-editor ol li.ql-indent-7{counter-increment:list-7}.ql-editor ol li.ql-indent-7:before{content:counter(list-7,lower-alpha) ". "}.ql-editor ol li.ql-indent-7{counter-reset:list-8 list-9}.ql-editor ol li.ql-indent-8{counter-increment:list-8}.ql-editor ol li.ql-indent-8:before{content:counter(list-8,lower-roman) ". "}.ql-editor ol li.ql-indent-8{counter-reset:list-9}.ql-editor ol li.ql-indent-9{counter-increment:list-9}.ql-editor ol li.ql-indent-9:before{content:counter(list-9,decimal) ". "}.ql-editor .ql-indent-1:not(.ql-direction-rtl),.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:2em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:2em}.ql-editor .ql-indent-2:not(.ql-direction-rtl),.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:4em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:4em}.ql-editor .ql-indent-3:not(.ql-direction-rtl),.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:6em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor .ql-indent-4:not(.ql-direction-rtl),.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:8em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:8em}.ql-editor .ql-indent-5:not(.ql-direction-rtl),.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:10em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:10em}.ql-editor .ql-indent-6:not(.ql-direction-rtl),.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:12em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor .ql-indent-7:not(.ql-direction-rtl),.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:14em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:14em}.ql-editor .ql-indent-8:not(.ql-direction-rtl),.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:16em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:16em}.ql-editor .ql-indent-9:not(.ql-direction-rtl),.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:18em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right,.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor.ql-blank:before{color:rgba(0,0,0,.6);content:attr(data-placeholder);font-style:italic;pointer-events:none;position:absolute}.ql-container.ql-disabled .ql-editor ul[data-checked]>li:before{pointer-events:none}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}uni-icon{display:inline-block;font-size:0;box-sizing:border-box}uni-icon[hidden]{display:none}uni-icon>i{font:normal normal normal 14px/1 weui}uni-icon>i:before{margin:0;box-sizing:border-box}@font-face{font-weight:400;font-style:normal;font-family:weui;src:url("data:application/octet-stream;base64,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") format("truetype")}.uni-icon-success:before{content:"\EA06"}.uni-icon-success_circle:before{content:"\EA07"}.uni-icon-success_no_circle:before{content:"\EA08"}.uni-icon-safe_success:before{content:"\EA04"}.uni-icon-safe_warn:before{content:"\EA05"}.uni-icon-info:before{content:"\EA03"}.uni-icon-info_circle:before{content:"\EA0C"}.uni-icon-warn:before{content:"\EA0B"}.uni-icon-waiting:before{content:"\EA09"}.uni-icon-waiting_circle:before{content:"\EA0A"}.uni-icon-circle:before{content:"\EA01"}.uni-icon-cancel:before{content:"\EA0D"}.uni-icon-download:before{content:"\EA02"}.uni-icon-search:before{content:"\EA0E"}.uni-icon-clear:before{content:"\EA0F"}.uni-icon-safe_success,.uni-icon-success,.uni-icon-success_circle,.uni-icon-success_no_circle{color:#007aff}.uni-icon-safe_warn{color:#ffbe00}.uni-icon-info{color:#10aeff}.uni-icon-info_circle{color:#007aff}.uni-icon-warn{color:#f76260}.uni-icon-waiting,.uni-icon-waiting_circle{color:#10aeff}.uni-icon-circle{color:#c9c9c9}.uni-icon-cancel{color:#f43530}.uni-icon-download{color:#007aff}.uni-icon-clear,.uni-icon-search{color:#b2b2b2}uni-image{width:320px;height:240px;display:inline-block;overflow:hidden;position:relative}uni-image[hidden]{display:none}uni-image>div,uni-image>img{width:100%;height:100%}uni-image>img{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;display:block;position:absolute;top:0;left:0;opacity:0}uni-image>.uni-image-will-change{will-change:transform}uni-input{display:block;font-size:16px;line-height:1.4em;height:1.4em;min-height:1.4em;overflow:hidden}uni-input[hidden]{display:none}.uni-input-form,.uni-input-input,.uni-input-placeholder,.uni-input-wrapper{outline:none;border:none;padding:0;margin:0;text-decoration:inherit}.uni-input-form,.uni-input-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;width:100%;height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.uni-input-input,.uni-input-placeholder{width:100%}.uni-input-placeholder{position:absolute;top:auto!important;left:0;color:grey;overflow:hidden;text-overflow:clip;white-space:pre;word-break:keep-all;pointer-events:none;line-height:inherit}.uni-input-input{position:relative;display:block;height:100%;background:none;color:inherit;opacity:1;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-indent:inherit;text-transform:inherit;text-shadow:inherit}.uni-input-input[type=search]::-webkit-search-cancel-button,.uni-input-input[type=search]::-webkit-search-decoration{display:none}.uni-input-input::-webkit-inner-spin-button,.uni-input-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.uni-input-input[type=number]{-moz-appearance:textfield}.uni-input-input:disabled{-webkit-text-fill-color:currentcolor}.uni-label-pointer{cursor:pointer}uni-movable-area{display:block;position:relative;width:10px;height:10px}uni-movable-area[hidden]{display:none}uni-movable-view{display:inline-block;width:10px;height:10px;top:0;left:0;position:absolute;cursor:grab}uni-movable-view[hidden]{display:none}uni-navigator{height:auto;width:auto;display:block;cursor:pointer}uni-navigator[hidden]{display:none}.navigator-hover{background-color:rgba(0,0,0,.1);opacity:.7}uni-picker-view-column{-webkit-flex:1;-webkit-box-flex:1;flex:1;position:relative;height:100%;overflow:hidden}uni-picker-view-column[hidden]{display:none}.uni-picker-view-group{height:100%;overflow:hidden}.uni-picker-view-mask{transform:translateZ(0);-webkit-transform:translateZ(0)}.uni-picker-view-indicator,.uni-picker-view-mask{position:absolute;left:0;width:100%;z-index:3;pointer-events:none}.uni-picker-view-mask{top:0;height:100%;margin:0 auto;background:-webkit-linear-gradient(top,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),linear-gradient(0deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-position:top,bottom;background-size:100% 102px;background-repeat:no-repeat}.uni-picker-view-indicator{height:34px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.uni-picker-view-content{position:absolute;top:0;left:0;width:100%;will-change:transform;padding:102px 0;cursor:pointer}.uni-picker-view-content>*{height:34px;overflow:hidden}.uni-picker-view-indicator:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.uni-picker-view-indicator:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.uni-picker-view-indicator:after,.uni-picker-view-indicator:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}uni-picker-view{display:block}uni-picker-view .uni-picker-view-wrapper{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;overflow:hidden;height:100%}uni-picker-view[hidden]{display:none}uni-progress{display:-webkit-flex;display:-webkit-box;display:flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center}uni-progress[hidden]{display:none}.uni-progress-bar{-webkit-flex:1;-webkit-box-flex:1;flex:1}.uni-progress-inner-bar{width:0;height:100%}.uni-progress-info{margin-top:0;margin-bottom:0;min-width:2em;margin-left:15px;font-size:16px}uni-radio-group[hidden]{display:none}uni-radio{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-radio[hidden]{display:none}uni-radio[disabled]{cursor:not-allowed}uni-radio .uni-radio-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-radio .uni-radio-input{-webkit-appearance:none;appearance:none;margin-right:5px;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:50%;width:22px;height:22px;position:relative}uni-radio:not([disabled]) .uni-radio-input:hover{border-color:#007aff}uni-radio .uni-radio-input.uni-radio-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";color:#fff;font-size:18px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-radio .uni-radio-input.uni-radio-input-disabled{background-color:#e1e1e1;border-color:#d1d1d1}uni-radio .uni-radio-input.uni-radio-input-disabled:before{color:#adadad}uni-radio-group{display:block}@-webkit-keyframes once-show{0%{top:0}}@keyframes once-show{0%{top:0}}uni-resize-sensor,uni-resize-sensor>div{position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden}uni-resize-sensor{display:block;z-index:-1;visibility:hidden;-webkit-animation:once-show 1ms;animation:once-show 1ms}uni-resize-sensor>div>div{position:absolute;left:0;top:0}uni-resize-sensor>div:first-child>div{width:100000px;height:100000px}uni-resize-sensor>div:last-child>div{width:200%;height:200%}uni-scroll-view{display:block;width:100%}uni-scroll-view[hidden]{display:none}.uni-scroll-view{position:relative;-webkit-overflow-scrolling:touch;max-height:inherit}.uni-scroll-view,.uni-scroll-view-content{width:100%;height:100%}.uni-scroll-view-refresher{position:relative;overflow:hidden}.uni-scroll-view-refresh{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row}.uni-scroll-view-refresh,.uni-scroll-view-refresh-inner{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.uni-scroll-view-refresh-inner{line-height:0;width:40px;height:40px;border-radius:50%;background-color:#fff;box-shadow:0 1px 6px rgba(0,0,0,.117647),0 1px 4px rgba(0,0,0,.117647)}.uni-scroll-view-refresh__spinner{-webkit-transform-origin:center center;transform-origin:center center;-webkit-animation:uni-scroll-view-refresh-rotate 2s linear infinite;animation:uni-scroll-view-refresh-rotate 2s linear infinite}.uni-scroll-view-refresh__spinner>circle{stroke:currentColor;stroke-linecap:round;-webkit-animation:uni-scroll-view-refresh-dash 2s linear infinite;animation:uni-scroll-view-refresh-dash 2s linear infinite}@-webkit-keyframes uni-scroll-view-refresh-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes uni-scroll-view-refresh-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes uni-scroll-view-refresh-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes uni-scroll-view-refresh-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}uni-slider{margin:10px 18px;padding:0;display:block}uni-slider[hidden]{display:none}uni-slider .uni-slider-wrapper{display:-webkit-flex;display:-webkit-box;display:flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;min-height:16px}uni-slider .uni-slider-tap-area{-webkit-flex:1;-webkit-box-flex:1;flex:1;padding:8px 0}uni-slider .uni-slider-handle-wrapper{position:relative;height:2px;border-radius:5px;background-color:#e9e9e9;cursor:pointer;-webkit-tap-highlight-color:transparent}uni-slider .uni-slider-handle-wrapper,uni-slider .uni-slider-track{-webkit-transition:background-color .3s ease;transition:background-color .3s ease}uni-slider .uni-slider-track{height:100%;border-radius:6px;background-color:#007aff}uni-slider .uni-slider-handle,uni-slider .uni-slider-thumb{position:absolute;left:50%;top:50%;cursor:pointer;border-radius:50%;-webkit-transition:border-color .3s ease;transition:border-color .3s ease}uni-slider .uni-slider-handle{width:28px;height:28px;margin-top:-14px;margin-left:-14px;background-color:rgba(0,0,0,0);z-index:3;cursor:grab}uni-slider .uni-slider-thumb{z-index:2;box-shadow:0 0 4px rgba(0,0,0,.2)}uni-slider .uni-slider-step{position:absolute;width:100%;height:2px;background:rgba(0,0,0,0);z-index:1}uni-slider .uni-slider-value{width:3ch;color:#888;font-size:14px;margin-left:1em}uni-slider .uni-slider-disabled .uni-slider-track{background-color:#ccc}uni-slider .uni-slider-disabled .uni-slider-thumb{background-color:#fff;border-color:#ccc}uni-swiper-item{display:block;overflow:hidden;will-change:transform;position:absolute;width:100%;height:100%;cursor:grab}uni-swiper-item[hidden]{display:none}uni-swiper{display:block;height:150px}uni-swiper[hidden]{display:none}uni-swiper .uni-swiper-wrapper{overflow:hidden;position:relative;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0)}uni-swiper .uni-swiper-slides{position:absolute;left:0;top:0;right:0;bottom:0}uni-swiper .uni-swiper-slide-frame{position:absolute;left:0;top:0;width:100%;height:100%;will-change:transform}uni-swiper .uni-swiper-dots{position:absolute;font-size:0}uni-swiper .uni-swiper-dots-horizontal{left:50%;bottom:10px;text-align:center;white-space:nowrap;-webkit-transform:translate(-50%);transform:translate(-50%)}uni-swiper .uni-swiper-dots-horizontal .uni-swiper-dot{margin-right:8px}uni-swiper .uni-swiper-dots-horizontal .uni-swiper-dot:last-child{margin-right:0}uni-swiper .uni-swiper-dots-vertical{right:10px;top:50%;text-align:right;-webkit-transform:translateY(-50%);transform:translateY(-50%)}uni-swiper .uni-swiper-dots-vertical .uni-swiper-dot{display:block;margin-bottom:9px}uni-swiper .uni-swiper-dots-vertical .uni-swiper-dot:last-child{margin-bottom:0}uni-swiper .uni-swiper-dot{display:inline-block;width:8px;height:8px;cursor:pointer;-webkit-transition-property:background-color;transition-property:background-color;-webkit-transition-timing-function:ease;transition-timing-function:ease;background:rgba(0,0,0,.3);border-radius:50%}uni-swiper .uni-swiper-dot-active{background-color:#000}uni-switch{-webkit-tap-highlight-color:transparent;display:inline-block;cursor:pointer}uni-switch[hidden]{display:none}uni-switch[disabled]{cursor:not-allowed}uni-switch .uni-switch-wrapper{display:-webkit-inline-flex;display:-webkit-inline-box;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;align-items:center;vertical-align:middle}uni-switch .uni-switch-input{-webkit-appearance:none;appearance:none;position:relative;width:52px;height:32px;margin-right:5px;border:1px solid #dfdfdf;outline:0;border-radius:16px;box-sizing:border-box;background-color:#dfdfdf;-webkit-transition:background-color .1s,border .1s;transition:background-color .1s,border .1s}uni-switch[disabled] .uni-switch-input{opacity:.7}uni-switch .uni-switch-input:before{width:50px;background-color:#fdfdfd}uni-switch .uni-switch-input:after,uni-switch .uni-switch-input:before{content:" ";position:absolute;top:0;left:0;height:30px;border-radius:15px;transition:-webkit-transform .3s;-webkit-transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}uni-switch .uni-switch-input:after{width:30px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}uni-switch .uni-switch-input.uni-switch-input-checked{border-color:#007aff;background-color:#007aff}uni-switch .uni-switch-input.uni-switch-input-checked:before{-webkit-transform:scale(0);transform:scale(0)}uni-switch .uni-switch-input.uni-switch-input-checked:after{-webkit-transform:translateX(20px);transform:translateX(20px)}uni-switch .uni-checkbox-input{margin-right:5px;-webkit-appearance:none;appearance:none;outline:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:22px;height:22px;position:relative;color:#007aff}uni-switch:not([disabled]) .uni-checkbox-input:hover{border-color:#007aff}uni-switch .uni-checkbox-input.uni-checkbox-input-checked:before{font:normal normal normal 14px/1 uni;content:"\EA08";color:inherit;font-size:22px;position:absolute;top:50%;left:50%;transform:translate(-50%,-48%) scale(.73);-webkit-transform:translate(-50%,-48%) scale(.73)}uni-switch .uni-checkbox-input.uni-checkbox-input-disabled{background-color:#e1e1e1}uni-switch .uni-checkbox-input.uni-checkbox-input-disabled:before{color:#adadad}uni-text[selectable]{cursor:auto;user-select:text;-webkit-user-select:text}uni-textarea{width:300px;height:150px;display:block;position:relative;font-size:16px;line-height:normal;white-space:pre-wrap;word-break:break-all}uni-textarea[hidden]{display:none}.uni-textarea-compute,.uni-textarea-line,.uni-textarea-placeholder,.uni-textarea-textarea,.uni-textarea-wrapper{outline:none;border:none;padding:0;margin:0;text-decoration:inherit}.uni-textarea-wrapper{display:block;position:relative;width:100%;height:100%;min-height:inherit}.uni-textarea-compute,.uni-textarea-line,.uni-textarea-placeholder,.uni-textarea-textarea{position:absolute;width:100%;height:100%;left:0;top:0;white-space:inherit;word-break:inherit}.uni-textarea-placeholder{color:grey;overflow:hidden}.uni-textarea-compute,.uni-textarea-line{visibility:hidden;height:auto}.uni-textarea-line{width:1em}.uni-textarea-textarea{resize:none;background:none;color:inherit;opacity:1;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;text-indent:inherit;text-transform:inherit;text-shadow:inherit}.uni-textarea-textarea-fix-margin{width:auto;right:0;margin:0 -3px}.uni-textarea-textarea:disabled{-webkit-text-fill-color:currentcolor}uni-ad{display:block;overflow:hidden}uni-ad[hidden]{display:none}uni-ad .uni-ad-container{width:100%;min-height:1px}uni-cover-image{display:block;line-height:1.2;overflow:hidden;height:100%;width:100%;pointer-events:auto}uni-cover-image[hidden]{display:none}uni-cover-image .uni-cover-image{width:100%;height:100%}uni-cover-view{display:block;line-height:1.2;overflow:hidden;white-space:nowrap;pointer-events:auto}uni-cover-view[hidden]{display:none}uni-cover-view .uni-cover-view{width:100%;height:100%;visibility:hidden;text-overflow:inherit;overflow:hidden;white-space:inherit;-webkit-align-items:inherit;-webkit-box-align:inherit;align-items:inherit;-webkit-justify-content:inherit;-webkit-box-pack:inherit;justify-content:inherit;-webkit-flex-direction:inherit;-webkit-box-orient:inherit;-webkit-box-direction:inherit;flex-direction:inherit;-webkit-flex-wrap:inherit;flex-wrap:inherit;display:inherit;overflow:inherit}uni-live-pusher{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-live-pusher[hidden]{display:none}.uni-live-pusher-container{left:0;background-color:#000}.uni-live-pusher-container,.uni-live-pusher-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-live-pusher-slot{pointer-events:none}uni-map{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-map[hidden]{display:none}.uni-map-container{left:0;background-color:rgba(0,0,0,0)}.uni-map-container,.uni-map-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-map-slot{pointer-events:none}uni-picker{display:block}uni-video{width:300px;height:225px;display:inline-block;line-height:0;overflow:hidden;position:relative}uni-video[hidden]{display:none}.uni-video-container{left:0;background-color:#000}.uni-video-container,.uni-video-slot{width:100%;height:100%;position:absolute;top:0;overflow:hidden}.uni-video-slot{pointer-events:none}uni-view{display:block}uni-view[hidden]{display:none}uni-web-view{position:absolute;left:0;right:0;top:0;bottom:0} \ No newline at end of file diff --git a/packages/uni-app-plus/dist/view.umd.js b/packages/uni-app-plus/dist/view.umd.js index b7800ba147290497eb7838b7cac6ffc9cfa672f1..e1fd4cf440e80d3ceb03fe16cea8a7745892c6ff 100644 --- a/packages/uni-app-plus/dist/view.umd.js +++ b/packages/uni-app-plus/dist/view.umd.js @@ -91,127 +91,31 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 161); +/******/ return __webpack_require__(__webpack_require__.s = 199); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); -/* globals __VUE_SSR_CONTEXT__ */ - -// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). -// This module is a runtime utility for cleaner component module output and will -// be included in the final webpack user bundle. - -function normalizeComponent ( - scriptExports, - render, - staticRenderFns, - functionalTemplate, - injectStyles, - scopeId, - moduleIdentifier, /* server only */ - shadowMode /* vue-cli only */ -) { - // Vue.extend constructor export interop - var options = typeof scriptExports === 'function' - ? scriptExports.options - : scriptExports - - // render functions - if (render) { - options.render = render - options.staticRenderFns = staticRenderFns - options._compiled = true - } - - // functional template - if (functionalTemplate) { - options.functional = true - } - - // scopedId - if (scopeId) { - options._scopeId = 'data-v-' + scopeId - } - - var hook - if (moduleIdentifier) { // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__ - } - // inject component styles - if (injectStyles) { - injectStyles.call(this, context) - } - // register component module identifier for async chunk inferrence - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier) - } - } - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook - } else if (injectStyles) { - hook = shadowMode - ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } - : injectStyles - } - - if (hook) { - if (options.functional) { - // for template-only hot-reload because in that case the render fn doesn't - // go through the normalizer - options._injectStyles = hook - // register for functional component in vue file - var originalRender = options.render - options.render = function renderWithStyleInjection (h, context) { - hook.call(context) - return originalRender(h, context) - } - } else { - // inject component registration as beforeCreate hook - var existing = options.beforeCreate - options.beforeCreate = existing - ? [].concat(existing, hook) - : [hook] - } - } - - return { - exports: scriptExports, - options: options - } -} - - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - "use strict"; // EXPORTS -__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ supportsPassive; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ isFn; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ isPlainObject; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ hasOwn; }); +__webpack_require__.d(__webpack_exports__, "k", function() { return /* reexport */ supportsPassive; }); +__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ isFn; }); +__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ isStr; }); +__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ isPlainObject; }); +__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ hasOwn; }); +__webpack_require__.d(__webpack_exports__, "m", function() { return /* reexport */ toRawType; }); __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ cached; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ kebabCase; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ disableScrollBounce; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ plusReady; }); +__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ camelize; }); +__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ debounce; }); +__webpack_require__.d(__webpack_exports__, "l", function() { return /* reexport */ throttle; }); +__webpack_require__.d(__webpack_exports__, "i", function() { return /* reexport */ kebabCase; }); +__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ deepClone; }); +__webpack_require__.d(__webpack_exports__, "j", function() { return /* reexport */ plusReady; }); -// UNUSED EXPORTS: isStr, isObject, noop, toRawType, camelize, setProperties, getLen, formatDateTime, updateElementStyle, guid, debounce, looseEqual, hexToRgba, parseQuery, stringifyQuery, callback +// UNUSED EXPORTS: isObject, noop, capitalize, setProperties, getLen, formatDateTime, updateElementStyle, guid, looseEqual, uniIdMixin, hexToRgba, parseQuery, stringifyQuery, decodedQuery, callback // CONCATENATED MODULE: ./src/shared/env.js var supportsPassive = false; @@ -227,6 +131,94 @@ try { window.addEventListener('test-passive', null, opts); } catch (e) {} +// CONCATENATED MODULE: ./src/shared/uni-id-mixin.js +var realAtob; +var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; +var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/; + +if (typeof atob !== 'function') { + realAtob = function realAtob(str) { + str = String(str).replace(/[\t\n\f\r ]+/g, ''); + + if (!b64re.test(str)) { + throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."); + } // Adding the padding if missing, for semplicity + + + str += '=='.slice(2 - (str.length & 3)); + var bitmap; + var result = ''; + var r1; + var r2; + var i = 0; + + for (; i < str.length;) { + bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++))); + result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255); + } + + return result; + }; +} else { + // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法 + realAtob = atob; +} + +function b64DecodeUnicode(str) { + return decodeURIComponent(realAtob(str).split('').map(function (c) { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); +} + +function getCurrentUserInfo() { + var token = ( true ? uni : undefined).getStorageSync('uni_id_token') || ''; + var tokenArr = token.split('.'); + + if (!token || tokenArr.length !== 3) { + return { + uid: null, + role: [], + permission: [], + tokenExpired: 0 + }; + } + + var userInfo; + + try { + userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1])); + } catch (error) { + throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message); + } + + userInfo.tokenExpired = userInfo.exp * 1000; + delete userInfo.exp; + delete userInfo.iat; + return userInfo; +} + +function uniIdMixin(Vue) { + Vue.prototype.uniIDHasRole = function (roleId) { + var _getCurrentUserInfo = getCurrentUserInfo(), + role = _getCurrentUserInfo.role; + + return role.indexOf(roleId) > -1; + }; + + Vue.prototype.uniIDHasPermission = function (permissionId) { + var _getCurrentUserInfo2 = getCurrentUserInfo(), + permission = _getCurrentUserInfo2.permission; + + return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1; + }; + + Vue.prototype.uniIDTokenValid = function () { + var _getCurrentUserInfo3 = getCurrentUserInfo(), + tokenExpired = _getCurrentUserInfo3.tokenExpired; + + return tokenExpired > Date.now(); + }; +} // CONCATENATED MODULE: ./src/shared/util.js function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } @@ -277,6 +269,13 @@ var camelize = cached(function (str) { return c ? c.toUpperCase() : ''; }); }); +/** + * Capitalize a string. + */ + +var capitalize = cached(function (str) { + return str.charAt(0).toUpperCase() + str.slice(1); +}); function setProperties(item, props, propsData) { props.forEach(function (name) { if (hasOwn(propsData, name)) { @@ -312,7 +311,8 @@ function guid() { } function debounce(fn, delay) { var timeout; - return function () { + + var newFn = function newFn() { var _arguments = arguments, _this = this; @@ -324,15 +324,63 @@ function debounce(fn, delay) { timeout = setTimeout(timerFn, delay); }; + + newFn.cancel = function () { + clearTimeout(timeout); + }; + + return newFn; +} +function throttle(fn, wait) { + var last = 0; + var timeout; + + var _waitCallback; + + var newFn = function newFn() { + var _this2 = this; + + for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) { + arg[_key] = arguments[_key]; + } + + var now = Date.now(); + clearTimeout(timeout); + + _waitCallback = function waitCallback() { + _waitCallback = null; + last = now; + fn.apply(_this2, arg); + }; + + if (now - last < wait) { + timeout = setTimeout(_waitCallback, wait - (now - last)); + return; + } + + _waitCallback(); + }; + + newFn.cancel = function () { + clearTimeout(timeout); + _waitCallback = null; + }; + + newFn.flush = function () { + clearTimeout(timeout); + _waitCallback && _waitCallback(); + }; + + return newFn; } function kebabCase(string) { return string.replace(/[A-Z]/g, function (str) { return '-' + str.toLowerCase(); }); } -/** - * Check if two values are loosely equal - that is, - * if they are plain objects, do they have the same shape? +/** + * Check if two values are loosely equal - that is, + * if they are plain objects, do they have the same shape? */ function looseEqual(a, b) { @@ -371,6 +419,24 @@ function looseEqual(a, b) { return false; } } +function deepClone(vnodes, createElement) { + function cloneVNode(vnode) { + var clonedChildren = vnode.children && vnode.children.map(cloneVNode); + var cloned = createElement(vnode.tag, vnode.data, clonedChildren); + cloned.text = vnode.text; + cloned.isComment = vnode.isComment; + cloned.componentOptions = vnode.componentOptions; + cloned.elm = vnode.elm; + cloned.context = vnode.context; + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + return cloned; + } + + return vnodes.map(cloneVNode); +} + // CONCATENATED MODULE: ./src/shared/color.js function hexToRgba(hex) { var r; @@ -485,6 +551,18 @@ function stringifyQuery(obj) { }).join('&') : null; return res ? "?".concat(res) : ''; } +function decodedQuery() { + var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var decodedQuery = {}; + Object.keys(query).forEach(function (name) { + try { + decodedQuery[name] = decode(query[name]); + } catch (e) { + decodedQuery[name] = query[name]; + } + }); + return decodedQuery; +} // CONCATENATED MODULE: ./src/shared/platform.js function plusReady(callback) { if (typeof callback !== 'function') { @@ -497,50 +575,6 @@ function plusReady(callback) { document.addEventListener('plusready', callback); } -// CONCATENATED MODULE: ./src/shared/scroll.js - -var view; -var pullToRefreshStyle; -var disabled; -var lastAction = {}; -function disableScrollBounce(_ref) { - var disable = _ref.disable; - - function exec() { - if (!view) { - view = plus.webview.currentWebview(); - } - - if (!disabled) { - pullToRefreshStyle = (view.getStyle() || {}).pullToRefresh || {}; - } - - disabled = disable; - - if (pullToRefreshStyle.support) { - view.setPullToRefresh(Object.assign({}, pullToRefreshStyle, { - support: !disable - })); - } - } - - var time = Date.now(); - - if (disable === lastAction.disable && time - lastAction.time < 20) { - return; - } - - lastAction.disable = disable; - lastAction.time = time; - plusReady(function () { - if (plus.os.name === 'iOS') { - // 延迟执行避免iOS13触摸卡死 - setTimeout(exec, 20); - } else { - exec(); - } - }); -} // CONCATENATED MODULE: ./src/shared/callback.js var id = 0; var callbacks = {}; @@ -593,169 +627,132 @@ var callback = { - /***/ }), -/* 2 */ +/* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); +/* globals __VUE_SSR_CONTEXT__ */ -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ emitter; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ listeners["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ hover["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ subscriber["a" /* default */]; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ keyboard["a" /* default */]; }); +// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). +// This module is a runtime utility for cleaner component module output and will +// be included in the final webpack user bundle. -// UNUSED EXPORTS: interact +function normalizeComponent ( + scriptExports, + render, + staticRenderFns, + functionalTemplate, + injectStyles, + scopeId, + moduleIdentifier, /* server only */ + shadowMode /* vue-cli only */ +) { + // Vue.extend constructor export interop + var options = typeof scriptExports === 'function' + ? scriptExports.options + : scriptExports -// CONCATENATED MODULE: ./src/core/view/mixins/emitter.js -// 暂不提供通知所有 -// function broadcast (componentName, eventName, ...params) { -// this.$children.forEach(child => { -// const name = child.$options.name && child.$options.name.substr(1) -// if (~componentName.indexOf(name)) { -// child.$emit.apply(child, [eventName].concat(params)) -// } else { -// broadcast.apply(child, [componentName, eventName].concat([params])) -// } -// }) -// } -function broadcast(componentName, eventName) { - var children = this.$children; - var len = children.length; - - for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - params[_key - 2] = arguments[_key]; + // render functions + if (render) { + options.render = render + options.staticRenderFns = staticRenderFns + options._compiled = true } - for (var i = 0; i < len; i++) { - var child = children[i]; - var name = child.$options.name && child.$options.name.substr(4); - - if (~componentName.indexOf(name)) { - child.$emit.apply(child, [eventName].concat(params)); - return false; - } else { - if (broadcast.apply(child, [componentName, eventName].concat([params])) === false) { - return false; - } - } + // functional template + if (functionalTemplate) { + options.functional = true } -} - -/* harmony default export */ var emitter = ({ - methods: { - $dispatch: function $dispatch(componentName, eventName) { - if (typeof componentName === 'string') { - componentName = [componentName]; - } - - var parent = this.$parent || this.$root; - var name = parent.$options.name && parent.$options.name.substr(4); - while (parent && (!name || !~componentName.indexOf(name))) { - parent = parent.$parent; + // scopedId + if (scopeId) { + options._scopeId = 'data-v-' + scopeId + } - if (parent) { - name = parent.$options.name && parent.$options.name.substr(4); - } + var hook + if (moduleIdentifier) { // server build + hook = function (context) { + // 2.3 injection + context = + context || // cached call + (this.$vnode && this.$vnode.ssrContext) || // stateful + (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional + // 2.2 with runInNewContext: true + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__ } - - if (parent) { - for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - params[_key2 - 2] = arguments[_key2]; - } - - parent.$emit.apply(parent, [eventName].concat(params)); + // inject component styles + if (injectStyles) { + injectStyles.call(this, context) } - }, - $broadcast: function $broadcast(componentName, eventName) { - if (typeof componentName === 'string') { - componentName = [componentName]; + // register component module identifier for async chunk inferrence + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier) } + } + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook + } else if (injectStyles) { + hook = shadowMode + ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } + : injectStyles + } - for (var _len3 = arguments.length, params = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { - params[_key3 - 2] = arguments[_key3]; + if (hook) { + if (options.functional) { + // for template-only hot-reload because in that case the render fn doesn't + // go through the normalizer + options._injectStyles = hook + // register for functional component in vue file + var originalRender = options.render + options.render = function renderWithStyleInjection (h, context) { + hook.call(context) + return originalRender(h, context) } - - broadcast.apply(this, [componentName, eventName].concat(params)); + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate + options.beforeCreate = existing + ? [].concat(existing, hook) + : [hook] } } -}); -// EXTERNAL MODULE: ./src/core/view/mixins/listeners.js -var listeners = __webpack_require__(69); -// EXTERNAL MODULE: ./src/core/view/mixins/hover.js -var hover = __webpack_require__(17); + return { + exports: scriptExports, + options: options + } +} -// EXTERNAL MODULE: ./src/core/view/mixins/subscriber.js -var subscriber = __webpack_require__(70); -// EXTERNAL MODULE: ./src/core/view/mixins/keyboard.js -var keyboard = __webpack_require__(71); +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -// EXTERNAL MODULE: ./src/shared/index.js + 7 modules -var shared = __webpack_require__(1); +"use strict"; +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _emitter__WEBPACK_IMPORTED_MODULE_0__["a"]; }); -// CONCATENATED MODULE: ./src/core/view/mixins/interact.js +/* harmony import */ var _listeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _listeners__WEBPACK_IMPORTED_MODULE_1__["a"]; }); -var passiveOptions = shared["h" /* supportsPassive */] ? { - passive: true, - capture: true -} : true; -var vms = []; -var userInteract = 0; -var inited; +/* harmony import */ var _hover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _hover__WEBPACK_IMPORTED_MODULE_2__["a"]; }); -function addInteractListener(vm) { - if (!inited) { - var eventNames = ['touchstart', 'touchmove', 'touchend', 'mousedown', 'mouseup']; - eventNames.forEach(function (eventName) { - document.addEventListener(eventName, function () { - vms.forEach(function (vm) { - vm.userInteract = true; - userInteract++; - setTimeout(function () { - userInteract--; - - if (!userInteract) { - vm.userInteract = false; - } - }, 0); - }); - }, passiveOptions); - }); - } +/* harmony import */ var _subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _subscriber__WEBPACK_IMPORTED_MODULE_3__["a"]; }); - vms.push(vm); -} +/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _keyboard__WEBPACK_IMPORTED_MODULE_4__["a"]; }); -function removeInteractListener(vm) { - var index = vms.indexOf(vm); +/* harmony import */ var _field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(86); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _field__WEBPACK_IMPORTED_MODULE_5__["a"]; }); - if (index >= 0) { - vms.splice(index, 1); - } -} +/* harmony import */ var _interact__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26); -/* harmony default export */ var interact = ({ - data: function data() { - return { - /** - * 是否用户交互行为 - */ - userInteract: false - }; - }, - mounted: function mounted() { - addInteractListener(this); - }, - beforeDestroy: function beforeDestroy() { - removeInteractListener(this); - } -}); -// CONCATENATED MODULE: ./src/core/view/mixins/index.js @@ -768,21 +765,25 @@ function removeInteractListener(vm) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* unused harmony export VD_SYNC_VERSION */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PAGE_CREATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MOUNTED_DATA; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return UPDATED_DATA; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return UPDATED_DATA; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return PAGE_CREATED; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return UI_EVENT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return UI_EVENT; }); /* unused harmony export LAYOUT_READY */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return VD_SYNC; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return VD_SYNC; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return APP_SERVICE_ID; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return WEBVIEW_READY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return WEBVIEW_READY; }); /* unused harmony export WEBVIEW_UI_EVENT */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return VD_SYNC_CALLBACK; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return VD_SYNC_CALLBACK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return INVOKE_API; }); /* unused harmony export WEB_INVOKE_APPSERVICE */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return WEBVIEW_INSERTED; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return WEBVIEW_REMOVED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return WEBVIEW_INSERTED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return WEBVIEW_REMOVED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return WEBVIEW_ID_PREFIX; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return SET_LOCALE; }); +var VD_SYNC_VERSION = 2; var PAGE_CREATE = 2; var MOUNTED_DATA = 4; var UPDATED_DATA = 6; @@ -798,6 +799,8 @@ var INVOKE_API = 'invokeApi'; var WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE'; var WEBVIEW_INSERTED = 'webviewInserted'; var WEBVIEW_REMOVED = 'webviewRemoved'; +var WEBVIEW_ID_PREFIX = 'webviewId'; +var SET_LOCALE = 'setLocale'; /***/ }), /* 4 */ @@ -818,7 +821,7 @@ __webpack_require__.d(__webpack_exports__, "subscribeHandler", function() { retu __webpack_require__.d(__webpack_exports__, "publishHandler", function() { return /* reexport */ bridge["a" /* publishHandler */]; }); // EXTERNAL MODULE: ./packages/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js -var vue_runtime_esm = __webpack_require__(8); +var vue_runtime_esm = __webpack_require__(9); // CONCATENATED MODULE: ./src/core/view/bridge/subscribe/api/set-page-meta.js function setPageMeta(_ref) { @@ -832,29 +835,35 @@ function setPageMeta(_ref) { } } // EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-info.js -var request_component_info = __webpack_require__(75); +var request_component_info = __webpack_require__(96); // EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-component-observer.js -var request_component_observer = __webpack_require__(66); +var request_component_observer = __webpack_require__(78); + +// EXTERNAL MODULE: ./src/core/view/bridge/subscribe/api/request-media-query-observer.js +var request_media_query_observer = __webpack_require__(79); // CONCATENATED MODULE: ./src/core/view/bridge/subscribe/api/index.js + /* harmony default export */ var api = ({ setPageMeta: setPageMeta, requestComponentInfo: request_component_info["a" /* requestComponentInfo */], requestComponentObserver: request_component_observer["b" /* requestComponentObserver */], - destroyComponentObserver: request_component_observer["a" /* destroyComponentObserver */] + destroyComponentObserver: request_component_observer["a" /* destroyComponentObserver */], + requestMediaQueryObserver: request_media_query_observer["b" /* requestMediaQueryObserver */], + destroyMediaQueryObserver: request_media_query_observer["a" /* destroyMediaQueryObserver */] }); // EXTERNAL MODULE: ./src/core/view/bridge/subscribe/scroll.js -var subscribe_scroll = __webpack_require__(13); +var subscribe_scroll = __webpack_require__(22); // EXTERNAL MODULE: ./src/core/view/bridge/subscribe/font.js -var font = __webpack_require__(76); +var font = __webpack_require__(97); // EXTERNAL MODULE: ./src/platforms/app-plus/view/bridge/subscribe/index.js -var bridge_subscribe = __webpack_require__(77); +var bridge_subscribe = __webpack_require__(98); // CONCATENATED MODULE: ./src/core/view/bridge/subscribe/index.js @@ -870,7 +879,7 @@ function initSubscribe(subscribe) { Object(bridge_subscribe["a" /* default */])(subscribe); } // EXTERNAL MODULE: ./src/platforms/app-plus/view/bridge.js -var bridge = __webpack_require__(12); +var bridge = __webpack_require__(20); // CONCATENATED MODULE: ./src/core/view/bridge/index.js @@ -898,6 +907,38 @@ initSubscribe(view_bridge_subscribe); /***/ }), /* 5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initScrollBounce; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return disableScrollBounce; }); +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); + +var webview; +var pullToRefreshStyle; +function initScrollBounce() { + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + if (!webview) { + webview = plus.webview.currentWebview(); + } + + if (!pullToRefreshStyle) { + pullToRefreshStyle = (webview.getStyle() || {}).pullToRefresh || {}; + } + }); +} +function disableScrollBounce(_ref) { + var disable = _ref.disable; + + if (pullToRefreshStyle && pullToRefreshStyle.support) { + webview.setPullToRefresh(Object.assign({}, pullToRefreshStyle, { + support: !disable + })); + } +} + +/***/ }), +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1095,76 +1136,13 @@ var safeAreaInsets = { module.exports = safeAreaInsets; //# sourceMappingURL=index.js.map -/***/ }), -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isPage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasLifecycleHook; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return normalizeDataset; }); -/* unused harmony export upx2px */ -var components = ['SystemAsyncLoading', 'SystemAsyncError']; -function isPage(vm) { - if (vm.$parent && vm.$parent.$options.name === 'PageBody') { - if (components.indexOf(vm.$options.name) !== -1) { - return false; - } - - return true; - } - - return false; -} -function hasLifecycleHook() { - var vueOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var hook = arguments.length > 1 ? arguments[1] : undefined; - return Array.isArray(vueOptions[hook]) && vueOptions[hook].length; -} -function normalizeDataset() { - var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - // ios8.x,9.x Object.assign({},dataset) 始终返回 {} - // http://ask.dcloud.net.cn/question/70246 - var result = JSON.parse(JSON.stringify(dataset)); - - if (false) { var _len, key, i, len, keys; } - - return result; -} -function upx2px(str) { - str = str + ''; - - if (str.indexOf('upx') !== -1) { - // upx转换 - return uni.upx2px(parseInt(str) || 0); - } - - return parseInt(str) || 0; -} - /***/ }), /* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -var TITLEBAR_HEIGHT = 44; - -function getStatusbarHeight() { - // 横屏时 iOS 获取的状态栏高度错误,进行纠正 - return plus.navigator.isImmersedStatusbar() ? Math.round(plus.os.name === 'iOS' ? plus.navigator.getSafeAreaInsets().top : plus.navigator.getStatusbarHeight()) : 0; -} - -function getNavigationBarHeight() { - var webview = plus.webview.currentWebview(); - var style = webview.getStyle(); - style = style && style.titleNView; - - if (style && style.type === 'default') { - return TITLEBAR_HEIGHT + getStatusbarHeight(); - } +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75); - return 0; -} function getFixed($el) { var fixed; @@ -1194,20 +1172,28 @@ function getFixed($el) { hidden: false }; }, + provide: function provide() { + return { + parentOnDraw: this._onDraw + }; + }, + inject: { + parentOnDraw: { + default: null + } + }, created: function created() { this.isNative = true; this.onCanInsertCallbacks = []; + this.onDrawCallbacks = []; }, mounted: function mounted() { - var _this = this; - this._updatePosition(); - this.$nextTick(function () { - _this.onCanInsertCallbacks.forEach(function (callback) { - return callback(); - }); + this.onCanInsertCallbacks.forEach(function (callback) { + return callback(); }); + this.onCanInsertCallbacks = null; this.$on('uni-view-update', this._requestPositionUpdate); }, methods: { @@ -1221,39 +1207,181 @@ function getFixed($el) { var keys = ['top', 'left', 'width', 'height']; keys.forEach(function (key) { var val = rect[key]; - val = key === 'top' ? val + (position.position === 'static' ? document.documentElement.scrollTop || document.body.scrollTop || 0 : getNavigationBarHeight()) : val; + val = key === 'top' ? val + (position.position === 'static' ? document.documentElement.scrollTop || document.body.scrollTop || 0 : Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* getNavigationBarHeight */ "a"])()) : val; position[key] = val + 'px'; }); } }, _requestPositionUpdate: function _requestPositionUpdate() { - var _this2 = this; + var _this = this; if (this._positionUpdateRequest) { cancelAnimationFrame(this._positionUpdateRequest); } this._positionUpdateRequest = requestAnimationFrame(function () { - delete _this2._positionUpdateRequest; + delete _this._positionUpdateRequest; - _this2._updatePosition(); + _this._updatePosition(); }); - } - } -}); + }, + _onParentReady: function _onParentReady(parentReadyCallback) { + var _this2 = this; -/***/ }), -/* 8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var callback = function callback(parentPosition) { + parentReadyCallback(parentPosition); -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + _this2.onDrawCallbacks.forEach(function (callback) { + return callback(_this2.position); + }); -/*! - * Vue.js v2.6.11 - * (c) 2014-2020 Evan You - * Released under the MIT License. - */ + _this2.onDrawCallbacks = null; + }; + + this._onSelfReady(function () { + if (_this2.parentOnDraw) { + _this2.parentOnDraw(callback); + } else { + callback({ + top: '0px', + left: '0px', + width: Number.MAX_SAFE_INTEGER + 'px', + height: Number.MAX_SAFE_INTEGER + 'px', + position: 'static' + }); + } + }); + }, + _onSelfReady: function _onSelfReady(callback) { + if (this.onCanInsertCallbacks) { + this.onCanInsertCallbacks.push(callback); + } else { + callback(); + } + }, + _onDraw: function _onDraw(callback) { + if (this.onDrawCallbacks) { + this.onDrawCallbacks.push(callback); + } else { + callback(this.position); + } + } + } +}); + +/***/ }), +/* 8 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export isPage */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasLifecycleHook; }); +/* unused harmony export normalizeDataset */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getTargetDataset; }); +/* unused harmony export upx2px */ +/* unused harmony export findExistsPageIndex */ +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); + +var components = ['SystemAsyncLoading', 'SystemAsyncError']; +function isPage(vm) { + if (vm.$parent && vm.$parent.$options.name === 'PageBody') { + if (components.indexOf(vm.$options.name) !== -1) { + return false; + } + + return true; + } + + return false; +} +function hasLifecycleHook() { + var vueOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var hook = arguments.length > 1 ? arguments[1] : undefined; + return Array.isArray(vueOptions[hook]) && vueOptions[hook].length; +} +function normalizeDataset() { + var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // ios8.x,9.x Object.assign({},dataset) 始终返回 {} + // http://ask.dcloud.net.cn/question/70246 + var result = JSON.parse(JSON.stringify(dataset)); + + if (false) { var _len, key, i, len, keys; } + + return result; +} +function getTargetDataset(target) { + var dataset = {}; + var vm = target.__vue__; + + function updateDataset(vm, force) { + var $attrs = vm.$attrs; + + for (var key in $attrs) { + if (key.startsWith('data-')) { + var newKey = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* camelize */ "b"])(key.substr(5).toLowerCase()); + var value = $attrs[key]; + dataset[newKey] = force ? value : dataset[newKey] || value; + } + } + } + + if (vm) { + var $child = vm; + + while ($child && $child.$el === target) { + updateDataset($child); + $child = $child.$children[0]; + } + + var $parent = vm.$parent; + + while ($parent && $parent.$el === target) { + updateDataset($parent, true); + $parent = $parent.$parent; + } + } else { + dataset = target.dataset || {}; + } + + return normalizeDataset(dataset); +} +function upx2px(str) { + str = str + ''; + + if (str.indexOf('upx') !== -1) { + // upx转换 + return uni.upx2px(parseInt(str) || 0); + } + + return parseInt(str) || 0; +} +function findExistsPageIndex(url) { + var pages = getCurrentPages(); + var len = pages.length; + + while (len--) { + var page = pages[len]; + + if (page.$page && page.$page.fullPath === url) { + return len; + } + } + + return -1; +} + +/***/ }), +/* 9 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/*! + * Vue.js v2.6.11 + * (c) 2014-2021 Evan You + * Released under the MIT License. + */ /* */ var emptyObject = Object.freeze({}); // These helpers produce better VM code in JS engines due to their @@ -1896,6 +2024,11 @@ if (true) { formatComponentName = function formatComponentName(vm, includeFile) { if (vm.$root === vm) { + if (vm.$options && vm.$options.__file) { + // fixed by xxxxxx + return 'at ' + vm.$options.__file; + } + return ''; } @@ -1934,7 +2067,7 @@ if (true) { var tree = []; var currentRecursiveSequence = 0; - while (vm) { + while (vm && vm.$options.name !== 'PageBody') { if (tree.length > 0) { var last = tree[tree.length - 1]; @@ -1948,7 +2081,7 @@ if (true) { } } - tree.push(vm); + !vm.$options.isReserved && tree.push(vm); vm = vm.$parent; } @@ -1970,15 +2103,7 @@ var uid = 0; */ var Dep = function Dep() { - // fixed by xxxxxx (nvue vuex) - - /* eslint-disable no-undef */ - if (typeof SharedObject !== 'undefined') { - this.id = SharedObject.uid++; - } else { - this.id = uid++; - } - + this.id = uid++; this.subs = []; }; @@ -2020,18 +2145,20 @@ Dep.prototype.notify = function notify() { /* eslint-disable no-undef */ -Dep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {}; +Dep.SharedObject = {}; Dep.SharedObject.target = null; Dep.SharedObject.targetStack = []; function pushTarget(target) { Dep.SharedObject.targetStack.push(target); Dep.SharedObject.target = target; + Dep.target = target; } function popTarget() { Dep.SharedObject.targetStack.pop(); Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1]; + Dep.target = Dep.SharedObject.target; } /* */ @@ -3962,7 +4089,7 @@ function renderList(val, render) { var result = iterator.next(); while (!result.done) { - ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx + ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx result = iterator.next(); } @@ -6301,12 +6428,12 @@ function initMixin(Vue) { initEvents(vm); initRender(vm); callHook(vm, 'beforeCreate'); - vm.mpHost !== 'mp-toutiao' && initInjections(vm); // resolve injections before data/props + !vm._$fallback && initInjections(vm); // resolve injections before data/props initState(vm); - vm.mpHost !== 'mp-toutiao' && initProvide(vm); // resolve provide after data/props + !vm._$fallback && initProvide(vm); // resolve provide after data/props - vm.mpHost !== 'mp-toutiao' && callHook(vm, 'created'); + !vm._$fallback && callHook(vm, 'created'); /* istanbul ignore if */ if ( true && config.performance && mark) { @@ -8555,7 +8682,7 @@ function getStyle(vnode, checkChild) { var cssVarRE = /^--/; var importantRE = /\s*!important$/; // upx,rpx 正则匹配 -var unitRE = /([+-]?\d+(\.\d+)?)[r|u]px/g; +var unitRE = /\b([+-]?\d+(\.\d+)?)[r|u]px\b/g; var transformUnit = function transformUnit(val) { if (typeof val === 'string') { @@ -8568,11 +8695,12 @@ var transformUnit = function transformUnit(val) { return val; }; -var urlRE = /url\(\s*'?"?([a-zA-Z0-9\.\-\_\/]+\.(jpg|gif|png))"?'?\s*\)/; +var urlRE1 = /url\(\s*['"](.+?\.(jpg|gif|png))['"]\s*\)/; +var urlRE2 = /url\(\s*([a-zA-Z0-9\.\-\_\/]+?\.(jpg|gif|png))\s*\)/; var transformUrl = function transformUrl(val, ctx) { if (typeof val === 'string' && val.indexOf('url(') !== -1) { - var matches = val.match(urlRE); + var matches = val.match(urlRE1) || val.match(urlRE2); if (matches && matches.length === 3) { val = val.replace(matches[1], ctx._$getRealPath(matches[1])); @@ -9885,10 +10013,316 @@ if (inBrowser) { /* harmony default export */ __webpack_exports__["a"] = (Vue); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(16))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19))) /***/ }), -/* 9 */ +/* 10 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export i18n */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return t; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return i18nMixin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setLocale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getLocale; }); +/* unused harmony export initAppLocale */ +/* unused harmony export I18N_JSON_DELIMITERS */ +/* unused harmony export formatI18n */ +/* unused harmony export defineI18nProperties */ +/* unused harmony export defineI18nProperty */ +/* unused harmony export initNavigationBarI18n */ +/* unused harmony export initPullToRefreshI18n */ +/* unused harmony export initTabBarI18n */ +/* unused harmony export initI18n */ +/* harmony import */ var _dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76); +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); +/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); +/* harmony import */ var _en_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99); +var _en_json__WEBPACK_IMPORTED_MODULE_3___namespace = /*#__PURE__*/__webpack_require__.t(99, 1); +/* harmony import */ var _es_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(100); +var _es_json__WEBPACK_IMPORTED_MODULE_4___namespace = /*#__PURE__*/__webpack_require__.t(100, 1); +/* harmony import */ var _fr_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(101); +var _fr_json__WEBPACK_IMPORTED_MODULE_5___namespace = /*#__PURE__*/__webpack_require__.t(101, 1); +/* harmony import */ var _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(102); +var _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6___namespace = /*#__PURE__*/__webpack_require__.t(102, 1); +/* harmony import */ var _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(103); +var _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7___namespace = /*#__PURE__*/__webpack_require__.t(103, 1); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + + + + + + + +var messages = { + en: _en_json__WEBPACK_IMPORTED_MODULE_3__, + es: _es_json__WEBPACK_IMPORTED_MODULE_4__, + fr: _fr_json__WEBPACK_IMPORTED_MODULE_5__, + 'zh-Hans': _zh_Hans_json__WEBPACK_IMPORTED_MODULE_6__, + 'zh-Hant': _zh_Hant_json__WEBPACK_IMPORTED_MODULE_7__ +}; +var locale; + +if (false) {} else if (true) { + if ((typeof weex === "undefined" ? "undefined" : _typeof(weex)) === 'object') { + locale = weex.requireModule('plus').getLanguage(); + } else { + locale = ''; + } +} else {} + +var i18n = Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* initVueI18n */ "a"])(locale, true ? messages : undefined); +var t = i18n.t; +var i18nMixin = i18n.mixin = { + beforeCreate: function beforeCreate() { + var _this = this; + + var unwatch = i18n.i18n.watchLocale(function () { + _this.$forceUpdate(); + }); + this.$once('hook:beforeDestroy', function () { + unwatch(); + }); + }, + methods: { + $$t: function $$t(key, values) { + return t(key, values); + } + } +}; +var setLocale = i18n.setLocale; +var getLocale = i18n.getLocale; +function initAppLocale(Vue, appVm, locale) { + var state = Vue.observable({ + locale: locale || i18n.getLocale() + }); + var localeWatchers = []; + + appVm.$watchLocale = function (fn) { + localeWatchers.push(fn); + }; + + Object.defineProperty(appVm, '$locale', { + get: function get() { + return state.locale; + }, + set: function set(v) { + state.locale = v; + localeWatchers.forEach(function (watch) { + return watch(v); + }); + } + }); +} +var I18N_JSON_DELIMITERS = ['%', '%']; + +function getLocaleMessage() { + var locale = uni.getLocale(); + var locales = __uniConfig.locales; + return locales[locale] || locales[__uniConfig.fallbackLocale] || locales.en || {}; +} + +function formatI18n(message) { + if (Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* isI18nStr */ "b"])(message, I18N_JSON_DELIMITERS)) { + return i18n.f(message, getLocaleMessage(), I18N_JSON_DELIMITERS); + } + + return message; +} + +function resolveJsonObj(jsonObj, names) { + if (names.length === 1) { + if (jsonObj) { + var value = jsonObj[names[0]]; + + if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_1__[/* isStr */ "h"])(value) && Object(_dcloudio_uni_i18n__WEBPACK_IMPORTED_MODULE_0__[/* isI18nStr */ "b"])(value, I18N_JSON_DELIMITERS)) { + return jsonObj; + } + } + + return; + } + + var name = names.shift(); + return resolveJsonObj(jsonObj && jsonObj[name], names); +} + +function defineI18nProperties(obj, names) { + return names.map(function (name) { + return defineI18nProperty(obj, name); + }); +} +function defineI18nProperty(obj, names) { + var jsonObj = resolveJsonObj(obj, names); + + if (!jsonObj) { + return false; + } + + var prop = names[names.length - 1]; + var value = jsonObj[prop]; + Object.defineProperty(jsonObj, prop, { + get: function get() { + return formatI18n(value); + }, + set: function set(v) { + value = v; + } + }); + return true; +} + +function isEnableLocale() { + return __uniConfig.locales && !!Object.keys(__uniConfig.locales).length; +} + +function initNavigationBarI18n(navigationBar) { + if (isEnableLocale()) { + return defineI18nProperties(navigationBar, [['titleText'], ['searchInput', 'placeholder']]); + } +} +function initPullToRefreshI18n(pullToRefresh) { + if (isEnableLocale()) { + var CAPTION = 'caption'; + return defineI18nProperties(pullToRefresh, [['contentdown', CAPTION], ['contentover', CAPTION], ['contentrefresh', CAPTION]]); + } +} +function initTabBarI18n(tabBar) { + if (isEnableLocale()) { + tabBar.list.forEach(function (item) { + defineI18nProperty(item, ['text']); + }); + } + + return tabBar; +} +function initI18n() { + var localeKeys = Object.keys(__uniConfig.locales || {}); + + if (localeKeys.length) { + localeKeys.forEach(function (locale) { + return i18n.add(locale, __uniConfig.locales[locale]); + }); + } +} + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + +function _has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (_has(source, p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + // Fallback to ordinary array + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var i, l, len, pos, chunk, result; + + // calculate data length + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + + // join chunks + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + + return result; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + return [].concat.apply([], chunks); + } +}; + + +// Enable/Disable typed arrays use, for testing +// +exports.setTyped = function (on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } +}; + +exports.setTyped(TYPED_OK); + + +/***/ }), +/* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9902,6 +10336,7 @@ var addListenerToElement = function addListenerToElement(element, type, callback } } }, { + capture: capture, passive: false }); }; @@ -9913,6 +10348,8 @@ var addListenerToElement = function addListenerToElement(element, type, callback }, methods: { touchtrack: function touchtrack(element, method, useCancel) { + var _this = this; + var self = this; var x0 = 0; var y0 = 0; @@ -9929,8 +10366,8 @@ var addListenerToElement = function addListenerToElement(element, type, callback changedTouches: $event.changedTouches, detail: { state: state, - x0: x, - y0: y, + x: x, + y: y, dx: x - x0, dy: y - y0, ddx: x - x1, @@ -9943,6 +10380,7 @@ var addListenerToElement = function addListenerToElement(element, type, callback }; var $eventOld = null; + var hasClickListenerOld; var hasTouchStart; var hasMouseDown; addListenerToElement(element, 'touchstart', function ($event) { @@ -9973,11 +10411,22 @@ var addListenerToElement = function addListenerToElement(element, type, callback y1 = $event.touches[0].pageY; return res; } - }); + }); // 阻止点击事件传播,处理拖拽和点击冲突,鼠标移动则添加监听,停止移动则移除监听 + + var clickEventListener = this.__clickEventListener = function ($event) { + $event.preventDefault(); + $event.stopPropagation(); + }; var mouseMoveEventListener = this.__mouseMoveEventListener = function ($event) { if (!hasTouchStart && hasMouseDown && $eventOld) { - // TODO target currentTarget touches changedTouches + // 存在鼠标移动,则在 document 上添加点击监听(好处是不用管具体使用拖拽的是什么元素) + if (!hasClickListenerOld && (Math.abs(x1 - x0) > 2 || Math.abs(y1 - y0) > 2)) { + document.addEventListener('click', clickEventListener, true); + hasClickListenerOld = true; + } // TODO target currentTarget touches changedTouches + + var res = fn($event, 'move', $event.pageX, $event.pageY); x1 = $event.pageX; y1 = $event.pageY; @@ -9998,7 +10447,15 @@ var addListenerToElement = function addListenerToElement(element, type, callback hasMouseDown = false; if (!hasTouchStart && $eventOld) { - // TODO target currentTarget touches changedTouches + // 鼠标抬起,存在监听,则 mouseup 结束后移除就监听事件 + if (hasClickListenerOld) { + setTimeout(function () { + document.removeEventListener('click', _this.__clickEventListener, true); + hasClickListenerOld = false; + }, 0); + } // TODO target currentTarget touches changedTouches + + $eventOld = null; return fn($event, 'end', $event.pageX, $event.pageY); } @@ -10018,798 +10475,647 @@ var addListenerToElement = function addListenerToElement(element, type, callback }); /***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindowOffset; }); -function getWindowOffset() { - return { - top: 0, - bottom: 0 - }; -} - -/***/ }), -/* 11 */ +/* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS -__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ processEvent; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ initEvents; }); - -// EXTERNAL MODULE: ./src/shared/index.js + 7 modules -var shared = __webpack_require__(1); - -// EXTERNAL MODULE: ./src/core/helpers/index.js -var helpers = __webpack_require__(6); - -// CONCATENATED MODULE: ./src/core/helpers/patch.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - -/** - * mpvue event - */ +__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getRealPath; }); -function wrapperMPEvent(event) { - return Object.assign({ - mp: event, - _processed: true - }, event); -} -/** - * app-plus titleNView - */ +// CONCATENATED MODULE: ./src/core/helpers/get-real-route.js +function getRealRoute(fromRoute, toRoute) { + if (!toRoute) { + toRoute = fromRoute; -function mergeTitleNView(navigationBar, titleNView) { - if (Object(shared["e" /* isPlainObject */])(titleNView)) { - if (Object(shared["c" /* hasOwn */])(titleNView, 'backgroundColor')) { - navigationBar.backgroundColor = titleNView.backgroundColor; + if (toRoute.indexOf('/') === 0) { + return toRoute; } - if (Object(shared["c" /* hasOwn */])(titleNView, 'buttons')) { - navigationBar.buttons = titleNView.buttons; - } + var pages = getCurrentPages(); - if (Object(shared["c" /* hasOwn */])(titleNView, 'titleColor')) { - navigationBar.textColor = titleNView.titleColor; + if (pages.length) { + fromRoute = pages[pages.length - 1].$page.route; + } else { + fromRoute = ''; } - - if (Object(shared["c" /* hasOwn */])(titleNView, 'titleText')) { - navigationBar.titleText = titleNView.titleText; + } else { + if (toRoute.indexOf('/') === 0) { + return toRoute; } + } - if (Object(shared["c" /* hasOwn */])(titleNView, 'titleSize')) { - navigationBar.titleSize = titleNView.titleSize; - } + if (toRoute.indexOf('./') === 0) { + return getRealRoute(fromRoute, toRoute.substr(2)); + } - if (Object(shared["c" /* hasOwn */])(titleNView, 'type')) { - navigationBar.type = titleNView.type; - } + var toRouteArray = toRoute.split('/'); + var toRouteLength = toRouteArray.length; + var i = 0; - if (Object(shared["c" /* hasOwn */])(titleNView, 'searchInput') && _typeof(titleNView.searchInput) === 'object') { - navigationBar.searchInput = Object.assign({ - autoFocus: false, - align: 'center', - color: '#000000', - backgroundColor: 'rgba(255,255,255,0.5)', - borderRadius: '0px', - placeholder: '', - placeholderColor: '#CCCCCC', - disabled: false - }, titleNView.searchInput); - } + for (; i < toRouteLength && toRouteArray[i] === '..'; i++) {// noop } - return navigationBar; + toRouteArray.splice(0, i); + toRoute = toRouteArray.join('/'); + var fromRouteArray = fromRoute.length > 0 ? fromRoute.split('/') : []; + fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); + return '/' + fromRouteArray.concat(toRouteArray).join('/'); } -// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js -var get_window_offset = __webpack_require__(10); - -// CONCATENATED MODULE: ./src/core/view/plugins/events.js - - +// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/get-real-path.js +var SCHEME_RE = /^([a-z-]+:)?\/\//i; +var DATA_RE = /^data:.*,.*/; // 处理 Android 平台解压与非解压模式下获取的路径不一致的情况 +function handleLocalPath(filePath) { + return plus.io.convertLocalFileSystemURL(filePath).replace(/^\/?apps\//, '/android_asset/apps/').replace(/\/$/, ''); +} -function processTarget(target, detail) { - var checkShadowRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var res = { - id: target.id, - offsetLeft: target.offsetLeft, - offsetTop: target.offsetTop, - dataset: Object(helpers["c" /* normalizeDataset */])(target.dataset) - }; +var wwwPath; - if (detail) { - Object.assign(res, detail); +function addBase(filePath) { + if (!wwwPath) { + // 需要时,初始化一次,外部直接初始化,需要等 plusready + wwwPath = 'file://' + handleLocalPath('_www') + '/'; } - return res; + return wwwPath + filePath; } -function processTouches(touches) { - if (touches) { - var res = []; +function getRealPath(filePath) { + if (filePath.indexOf('/') === 0) { + if (filePath.indexOf('//') === 0) { + return 'https:' + filePath; + } // 平台绝对路径 安卓、iOS - var _getWindowOffset = Object(get_window_offset["a" /* default */])(), - top = _getWindowOffset.top; - for (var i = 0; i < touches.length; i++) { - var touch = touches[i]; - res.push({ - identifier: touch.identifier, - pageX: touch.pageX, - pageY: touch.pageY - top, - clientX: touch.clientX, - clientY: touch.clientY - top, - force: touch.force || 0 - }); + if (filePath.startsWith('/storage/') || filePath.startsWith('/sdcard/') || filePath.includes('/Containers/Data/Application/')) { + return 'file://' + filePath; } - return res; - } - - return []; -} - -function processEvent(name) { - var $event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var target = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var currentTarget = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - - if ($event._processed) { - $event.type = detail.type || name; - return $event; - } // fixed 针对小程序 click(tap)事件,补充事件详情 - + return addBase(filePath.substr(1)); + } // 网络资源或base64 - if (name === 'click') { - var _getWindowOffset2 = Object(get_window_offset["a" /* default */])(), - top = _getWindowOffset2.top; - detail = { - x: $event.x, - y: $event.y - top - }; - $event.touches = $event.changedTouches = [{ - force: 1, - identifier: 0, - clientX: $event.clientX, - clientY: $event.clientY, - pageX: $event.pageX, - pageY: $event.pageY - }]; - } // fixed mp-vue + if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) { + return filePath; + } // _do=>_doc,_documents,_downloads - var ret = wrapperMPEvent({ - type: detail.type || name, - timeStamp: $event.timeStamp || 0, - detail: detail, - target: processTarget(target, detail), - currentTarget: processTarget(currentTarget, false, true), - // 只处理系统事件 - touches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.touches) : $event.touches, - changedTouches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.changedTouches) : $event.changedTouches, - preventDefault: function preventDefault() {}, - stopPropagation: function stopPropagation() {} - }); + if (filePath.indexOf('_www') === 0 || filePath.indexOf('_do') === 0) { + return 'file://' + handleLocalPath(filePath); + } - if (true) { - var nid = currentTarget.getAttribute('_i'); - ret.options = { - nid: nid - }; // 保留原始 currentTarget 方便后续对比 + var pages = getCurrentPages(); - ret.$origCurrentTarget = currentTarget; + if (pages.length) { + return addBase(getRealRoute(pages[pages.length - 1].$page.route, filePath).substr(1)); } - return ret; + return filePath; } -var LONGPRESS_TIMEOUT = 350; -var LONGPRESS_THRESHOLD = 10; -var passiveOptions = shared["h" /* supportsPassive */] ? { - passive: true -} : false; -var longPressTimer = false; -function clearLongPressTimer() { - if (longPressTimer) { - clearTimeout(longPressTimer); - longPressTimer = false; - } +/***/ }), +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindowOffset; }); +function getWindowOffset() { + return { + top: 0, + bottom: 0, + left: 0, + right: 0 + }; } -var startPageX = 0; -var startPageY = 0; +/***/ }), +/* 15 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -function touchstart(evt) { - clearLongPressTimer(); +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pixelRatio; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return wrapper; }); +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); - if (evt.touches.length !== 1) { - return; - } +var pixelRatio = function () { + var canvas = document.createElement('canvas'); + canvas.height = canvas.width = 0; + var context = canvas.getContext('2d'); + var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; + return (window.devicePixelRatio || 1) / backingStore; +}(); - var _evt$touches$ = evt.touches[0], - pageX = _evt$touches$.pageX, - pageY = _evt$touches$.pageY; - startPageX = pageX; - startPageY = pageY; - longPressTimer = setTimeout(function () { - var customEvent = new CustomEvent('longpress', { - bubbles: true, - cancelable: true, - target: evt.target, - currentTarget: evt.currentTarget - }); - customEvent.touches = evt.touches; - customEvent.changedTouches = evt.changedTouches; - evt.target.dispatchEvent(customEvent); - }, LONGPRESS_TIMEOUT); -} +var forEach = function forEach(obj, func) { + for (var key in obj) { + if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "e"])(obj, key)) { + func(obj[key], key); + } + } +}; -function touchmove(evt) { - if (!longPressTimer) { - return; - } - - if (evt.touches.length !== 1) { - return clearLongPressTimer(); - } - - var _evt$touches$2 = evt.touches[0], - pageX = _evt$touches$2.pageX, - pageY = _evt$touches$2.pageY; +var ratioArgs = { + 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] +}; +var proto = CanvasRenderingContext2D.prototype; - if (Math.abs(pageX - startPageX) > LONGPRESS_THRESHOLD || Math.abs(pageY - startPageY) > LONGPRESS_THRESHOLD) { - return clearLongPressTimer(); - } -} +proto.drawImageByCanvas = function (_super) { + return function (canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh, isScale) { + if (!this.__hidpi__) { + return _super.apply(this, arguments); + } -function initEvents() { - window.addEventListener('touchstart', touchstart, passiveOptions); - window.addEventListener('touchmove', touchmove, passiveOptions); - window.addEventListener('touchend', clearLongPressTimer, passiveOptions); - window.addEventListener('touchcancel', clearLongPressTimer, passiveOptions); -} + srcx *= pixelRatio; + srcy *= pixelRatio; + srcw *= pixelRatio; + srch *= pixelRatio; + desx *= pixelRatio; + desy *= pixelRatio; + desw = isScale ? desw * pixelRatio : desw; + desh = isScale ? desh * pixelRatio : desh; -/***/ }), -/* 12 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + _super.call(this, canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh); + }; +}(proto.drawImage); -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return publishHandler; }); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); +if (pixelRatio !== 1) { + forEach(ratioArgs, function (value, key) { + proto[key] = function (_super) { + return function () { + if (!this.__hidpi__) { + return _super.apply(this, arguments); + } + var args = Array.prototype.slice.call(arguments); -function publishHandler(event) { - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - Object(uni_shared__WEBPACK_IMPORTED_MODULE_1__[/* plusReady */ "g"])(function () { - var pageId = plus.webview.currentWebview().id; + if (value === 'all') { + args = args.map(function (a) { + return a * pixelRatio; + }); + } else if (Array.isArray(value)) { + for (var i = 0; i < value.length; i++) { + args[value[i]] *= pixelRatio; + } + } - if (true) { - console.log("[VIEW][".concat(Date.now(), "]:"), event, args, pageId); - } + return _super.apply(this, args); + }; + }(proto[key]); + }); - plus.webview.postMessageToUniNView({ - type: 'subscribeHandler', - args: { - type: event, - data: args, - pageId: pageId + proto.stroke = function (_super) { + return function () { + if (!this.__hidpi__) { + return _super.apply(this, arguments); } - }, _constants__WEBPACK_IMPORTED_MODULE_0__[/* APP_SERVICE_ID */ "a"]); - }); -} -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + this.lineWidth *= pixelRatio; -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return disableScroll; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return pageScrollTo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createScrollListener; }); -/* harmony import */ var uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12); + _super.apply(this, arguments); -function disableScroll(evt) { - evt.preventDefault(); -} -function pageScrollTo(_ref) { - var scrollTop = _ref.scrollTop, - duration = _ref.duration; - var documentElement = document.documentElement; - var clientHeight = documentElement.clientHeight, - scrollHeight = documentElement.scrollHeight; - scrollTop = Math.min(scrollTop, scrollHeight - clientHeight); + this.lineWidth /= pixelRatio; + }; + }(proto.stroke); - if (duration === 0) { - // 部分浏览器(比如微信)中 scrollTop 的值需要通过 document.body 来控制 - documentElement.scrollTop = document.body.scrollTop = scrollTop; - return; - } + proto.fillText = function (_super) { + return function () { + if (!this.__hidpi__) { + return _super.apply(this, arguments); + } - if (window.scrollY === scrollTop) { - return; - } + var args = Array.prototype.slice.call(arguments); + args[1] *= pixelRatio; + args[2] *= pixelRatio; // Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值 - function scrollTo(duration) { - if (duration <= 0) { - window.scrollTo(0, scrollTop); - return; - } + var font = this.__font__ || this.font; + this.font = font.replace(/(\d+\.?\d*)(px|em|rem|pt)/g, function (w, m, u) { + return m * pixelRatio + u; + }); - var distaince = scrollTop - window.scrollY; - requestAnimationFrame(function () { - window.scrollTo(0, window.scrollY + distaince / duration * 10); - scrollTo(duration - 10); - }); - } + _super.apply(this, args); - scrollTo(duration); // TODO 暂不使用 transform 会导致 fixed 元素不可见 - // const body = document.body - // const bodyStyle = body.style - // - // function webkitTransitionEnd() { - // bodyStyle.webkitTransition = '' - // bodyStyle.webkitTransform = '' - // documentElement.scrollTop = scrollTop - // body.removeEventListener('webkitTransitionEnd', webkitTransitionEnd) - // } - // - // body.addEventListener('webkitTransitionEnd', webkitTransitionEnd) - // bodyStyle.webkitTransition = `-webkit-transform ${duration}ms ease-out` - // bodyStyle.webkitTransform = `translateY(${documentElement.scrollTop}px) translateZ(0)` -} -var testReachBottomTimer; -var lastScrollHeight = 0; -function createScrollListener(pageId, _ref2) { - var enablePageScroll = _ref2.enablePageScroll, - enablePageReachBottom = _ref2.enablePageReachBottom, - onReachBottomDistance = _ref2.onReachBottomDistance, - enableTransparentTitleNView = _ref2.enableTransparentTitleNView; - var ticking = false; - var hasReachBottom = false; - var onReachBottom = true; + this.font = font; + }; + }(proto.fillText); - function isReachBottom() { - var scrollHeight = document.documentElement.scrollHeight; // 部分浏览器窗口高度变化后document.documentelement.clientheight不会变化,采用window.innerHeight + proto.strokeText = function (_super) { + return function () { + if (!this.__hidpi__) { + return _super.apply(this, arguments); + } - var windowHeight = window.innerHeight; - var scrollY = window.scrollY; - var isBottom = scrollY > 0 && scrollHeight > windowHeight && scrollY + windowHeight + onReachBottomDistance >= scrollHeight; // 兼容部分浏览器滚动时scroll事件不触发 + var args = Array.prototype.slice.call(arguments); + args[1] *= pixelRatio; // x - var heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance; + args[2] *= pixelRatio; // y + // Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值 - if (isBottom && (!hasReachBottom || heightChanged)) { - lastScrollHeight = scrollHeight; - hasReachBottom = true; - return true; - } + var font = this.__font__ || this.font; + this.font = font.replace(/(\d+\.?\d*)(px|em|rem|pt)/g, function (w, m, u) { + return m * pixelRatio + u; + }); - if (!isBottom && hasReachBottom) { - hasReachBottom = false; - } + _super.apply(this, args); - return false; - } + this.font = font; + }; + }(proto.strokeText); - function trigger() { - var pages = getCurrentPages(); + proto.drawImage = function (_super) { + return function () { + if (!this.__hidpi__) { + return _super.apply(this, arguments); + } - if (!pages.length || pages[pages.length - 1].$page.id !== pageId) { - return; - } // publish + this.scale(pixelRatio, pixelRatio); + _super.apply(this, arguments); - var scrollTop = window.pageYOffset; + this.scale(1 / pixelRatio, 1 / pixelRatio); + }; + }(proto.drawImage); +} - if (enablePageScroll) { - // 向 Service 发送 onPageScroll 事件 - Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onPageScroll', { - scrollTop: scrollTop - }, pageId); - } +function wrapper(canvas) { + canvas.width = canvas.offsetWidth * pixelRatio; + canvas.height = canvas.offsetHeight * pixelRatio; + canvas.__hidpi__ = true; // 避免低版本安卓上 context 实例被回收 - if (enableTransparentTitleNView) { - UniViewJSBridge.emit('onPageScroll', { - scrollTop: scrollTop - }); - } + canvas.__context2d__ = canvas.getContext('2d'); + canvas.__context2d__.__hidpi__ = true; +} - function testReachBottom() { - if (isReachBottom()) { - Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onReachBottom', {}, pageId); - onReachBottom = false; - setTimeout(function () { - onReachBottom = true; - }, 350); - return true; - } - } +/***/ }), +/* 16 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (enablePageReachBottom && onReachBottom) { - if (testReachBottom()) {} else { - // 解决部分浏览器滚动中js获取窗口高度不准确导致的问题 - testReachBottomTimer = setTimeout(testReachBottom, 300); - } - } +"use strict"; +// 暂不提供通知所有 +// function broadcast (componentName, eventName, ...params) { +// this.$children.forEach(child => { +// const name = child.$options.name && child.$options.name.substr(1) +// if (~componentName.indexOf(name)) { +// child.$emit.apply(child, [eventName].concat(params)) +// } else { +// broadcast.apply(child, [componentName, eventName].concat([params])) +// } +// }) +// } +function broadcast(componentName, eventName) { + var children = this.$children; + var len = children.length; - ticking = false; + for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + params[_key - 2] = arguments[_key]; } - return function onScroll() { - clearTimeout(testReachBottomTimer); + for (var i = 0; i < len; i++) { + var child = children[i]; + var name = child.$options.name && child.$options.name.substr(4); - if (!ticking) { - requestAnimationFrame(trigger); + if (~componentName.indexOf(name)) { + child.$emit.apply(child, [eventName].concat(params)); + return false; + } else { + if (broadcast.apply(child, [componentName, eventName].concat([params])) === false) { + return false; + } } - - ticking = true; - }; + } } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -/***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* harmony default export */ __webpack_exports__["a"] = ({ + methods: { + $dispatch: function $dispatch(componentName, eventName) { + if (typeof componentName === 'string') { + componentName = [componentName]; + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return vd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initData; }); -/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57); -/* harmony import */ var _vdom_sync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80); -/* harmony import */ var _page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59); -/* harmony import */ var _page_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58); -var _handleData; + var parent = this.$parent || this.$root; + var name = parent.$options.name && parent.$options.name.substr(4); -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + while (parent && (!name || !~componentName.indexOf(name))) { + parent = parent.$parent; -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + if (parent) { + name = parent.$options.name && parent.$options.name.substr(4); + } + } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + if (parent) { + for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + params[_key2 - 2] = arguments[_key2]; + } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + parent.$emit.apply(parent, [eventName].concat(params)); + } + }, + $broadcast: function $broadcast(componentName, eventName) { + if (typeof componentName === 'string') { + componentName = [componentName]; + } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + for (var _len3 = arguments.length, params = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { + params[_key3 - 2] = arguments[_key3]; + } -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + broadcast.apply(this, [componentName, eventName].concat(params)); + } + } +}); -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +/***/ }), +/* 17 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NAVBAR_HEIGHT; }); +/* unused harmony export TABBAR_HEIGHT */ +/* unused harmony export RESPONSIVE_MIN_WIDTH */ +/* unused harmony export DC_LOCALE */ +var NAVBAR_HEIGHT = 44; +var TABBAR_HEIGHT = 50; // 576:landscape phones,768:tablets,992:desktops,1200:large desktops +var RESPONSIVE_MIN_WIDTH = 768; +var DC_LOCALE = '__DC_LOCALE'; +/***/ }), +/* 18 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +// EXPORTS +__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ processEvent; }); +__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ initEvents; }); +// EXTERNAL MODULE: ./src/shared/index.js + 7 modules +var shared = __webpack_require__(0); -var vd; -var PageVueComponent; -var handleData = (_handleData = {}, _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"], function onPageCreate(data) { - var _data = _slicedToArray(data, 3), - pageId = _data[0], - pagePath = _data[1], - pageOptions = _data[2]; +// EXTERNAL MODULE: ./src/core/helpers/index.js +var helpers = __webpack_require__(8); - document.title = "".concat(pagePath, "[").concat(pageId, "]"); - updateRootFontSize(); // 设置当前页面伪对象,方便其他地方使用 getCurrentPages 获取当前页面 id,route +// CONCATENATED MODULE: ./src/core/helpers/patch.js +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - Object(_page__WEBPACK_IMPORTED_MODULE_4__[/* setCurrentPage */ "b"])(pageId, pagePath); // 通知页面创建,根据当前页面配置信息,初始化部分事件 - UniViewJSBridge.subscribeHandler(_constants__WEBPACK_IMPORTED_MODULE_2__[/* ON_PAGE_CREATE */ "a"], pageOptions, pageId); // 初始化当前页面 VueComponent(生成页面样式代码) +/** + * mpvue event + */ - PageVueComponent = Object(_page_factory__WEBPACK_IMPORTED_MODULE_5__[/* getPageVueComponent */ "b"])(pagePath); // 生成当前页面 vd +function wrapperMPEvent(event) { + event.mp = Object.assign({ + '@warning': 'mp is deprecated' + }, event); + event._processed = true; + return event; +} +/** + * app-plus titleNView + */ - vd = new _vdom_sync__WEBPACK_IMPORTED_MODULE_3__[/* VDomSync */ "a"](pageId); -}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* MOUNTED_DATA */ "c"], function onMounted(data) { - vd.addVData.apply(vd, data); -}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* UPDATED_DATA */ "g"], function onUpdated(data) { - vd.updateVData.apply(vd, data); -}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATED */ "e"], function onPageCreated(data) { - var _data2 = _slicedToArray(data, 2), - pageId = _data2[0], - pagePath = _data2[1]; +function mergeTitleNView(navigationBar, titleNView) { + if (Object(shared["g" /* isPlainObject */])(titleNView)) { + if (Object(shared["e" /* hasOwn */])(titleNView, 'backgroundColor')) { + navigationBar.backgroundColor = titleNView.backgroundColor; + } - var page = getCurrentPages()[0]; - page.$vm = new PageVueComponent({ - mpType: 'page', - pageId: pageId, - pagePath: pagePath - }).$mount('#app'); -}), _handleData); + if (Object(shared["e" /* hasOwn */])(titleNView, 'buttons')) { + navigationBar.buttons = titleNView.buttons; + } -function broadcast(vm, componentName, eventName) { - for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { - params[_key - 3] = arguments[_key]; - } + if (Object(shared["e" /* hasOwn */])(titleNView, 'titleColor')) { + navigationBar.textColor = titleNView.titleColor; + } - vm.$children.forEach(function (child) { - var name = child.$options.name && child.$options.name.replace(/^VUni/, ''); + if (Object(shared["e" /* hasOwn */])(titleNView, 'titleText')) { + navigationBar.titleText = titleNView.titleText; + } - if (~componentName.indexOf(name)) { - child.$emit.apply(child, [eventName].concat(params)); + if (Object(shared["e" /* hasOwn */])(titleNView, 'titleSize')) { + navigationBar.titleSize = titleNView.titleSize; } - broadcast.apply(void 0, [child, componentName, eventName].concat(params)); - }); -} + if (Object(shared["e" /* hasOwn */])(titleNView, 'type')) { + navigationBar.type = titleNView.type; + } -var NATIVE_COMPONENTS = ['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video', 'CoverView', 'CoverImage', 'Ad']; + if (Object(shared["e" /* hasOwn */])(titleNView, 'searchInput') && _typeof(titleNView.searchInput) === 'object') { + navigationBar.searchInput = Object.assign({ + autoFocus: false, + align: 'center', + color: '#000000', + backgroundColor: 'rgba(255,255,255,0.5)', + borderRadius: '0px', + placeholder: '', + placeholderColor: '#CCCCCC', + disabled: false + }, titleNView.searchInput); + } + } -function updateView() { - var pages = getCurrentPages(); - var pageVm = pages[0] && pages[0].$vm; - pageVm && broadcast(pageVm, NATIVE_COMPONENTS, 'uni-view-update'); + return navigationBar; } +// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js +var get_window_offset = __webpack_require__(14); -function updateRootFontSize() { - // 页面存在横竖屏切换时,预加载的 webview 的 fontSize 需要再次校正一下 - var oldFontSize = document.documentElement.style.fontSize; - var newFontSize = document.documentElement.clientWidth / 20 + 'px'; +// CONCATENATED MODULE: ./src/core/view/plugins/events.js - if (oldFontSize !== newFontSize) { - document.documentElement.style.fontSize = newFontSize; - } -} -window.addEventListener('resize', function () { - // TODO 与之前逻辑保持一致,仅当前 webview 未被使用时,校准 fontSize,后续考虑动态旋转,调整rootfontSize - if (!getCurrentPages().length) { - updateRootFontSize(); - } - updateView(); -}); -window.addEventListener('updateview', updateView); -function vdSync(_ref) { - var data = _ref.data, - options = _ref.options; - var isVdCallback = true; - data.forEach(function (data) { - if (data[0] === _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"]) { - // 页面创建无需触发 callback - isVdCallback = false; - } - handleData[data[0]](data[1]); - }); - vd.flush(); - vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].nextTick(function () { - // 清空本次 addBatchData - vd.clearAddBatchVData(); - updateView(); - isVdCallback && UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC_CALLBACK */ "i"]); - }); -} +function processTarget(target, detail) { + var checkShadowRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var res = { + id: target.id, + offsetLeft: target.offsetLeft, + offsetTop: target.offsetTop, + dataset: Object(helpers["a" /* getTargetDataset */])(target) + }; -function getData(id, name) { - try { - return this.$r[id][name]; - } catch (e) { - console.error(this.$options.__file + ":[".concat(this._$id, "]$r[").concat(id, "][").concat(name, "] is undefined")); + if (detail) { + Object.assign(res, detail); } + + return res; } -/** - * wxs change:prop - * @param {Object} id - * @param {Object} name - */ +function processTouches(touches) { + if (touches) { + var res = []; + + var _getWindowOffset = Object(get_window_offset["a" /* default */])(), + top = _getWindowOffset.top; -function getChangeData(id, name) { - try { - var value = this.$r[id][name]; - var wxsPropName = name.replace('change:', ''); - this[wxsPropName] = value; - this.$set(this.wxsProps, wxsPropName, value); - return value; - } catch (e) { - console.error(this.$options.__file + ":[".concat(this._$id, "]$r[").concat(id, "][").concat(name, "] is undefined")); + for (var i = 0; i < touches.length; i++) { + var touch = touches[i]; + res.push({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY - top, + clientX: touch.clientX, + clientY: touch.clientY - top, + force: touch.force || 0 + }); + } + + return res; } + + return []; } -function initData(Vue) { - Vue.prototype._$g = getData; - Vue.prototype._$gc = getChangeData; - UniViewJSBridge.subscribe(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC */ "h"], vdSync); - Object.defineProperty(Vue.prototype, '_$vd', { - get: function get() { - return !this.$options.isReserved && vd; - } - }); - Vue.mixin({ - beforeCreate: function beforeCreate() { - if (this.$options.mpType) { - this.mpType = this.$options.mpType; - } - - if (this._$vd) { - this._$vd.initVm(this); - } - } - }); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - -/***/ }), -/* 15 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return pixelRatio; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return wrapper; }); -/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); - -var pixelRatio = function () { - var canvas = document.createElement('canvas'); - canvas.height = canvas.width = 0; - var context = canvas.getContext('2d'); - var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; - return (window.devicePixelRatio || 1) / backingStore; -}(); - -var forEach = function forEach(obj, func) { - for (var key in obj) { - if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "c"])(obj, key)) { - func(obj[key], key); - } - } -}; - -var ratioArgs = { - 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] -}; -var proto = CanvasRenderingContext2D.prototype; - -proto.drawImageByCanvas = function (_super) { - return function (canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh, isScale) { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } +function processEvent(name) { + var $event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var target = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var currentTarget = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - srcx *= pixelRatio; - srcy *= pixelRatio; - srcw *= pixelRatio; - srch *= pixelRatio; - desx *= pixelRatio; - desy *= pixelRatio; - desw = isScale ? desw * pixelRatio : desw; - desh = isScale ? desh * pixelRatio : desh; + if ($event._processed) { + $event.type = detail.type || name; + return $event; + } // fixed 针对小程序 click(tap)事件,补充事件详情 - _super.call(this, canvas, srcx, srcy, srcw, srch, desx, desy, desw, desh); - }; -}(proto.drawImage); -if (pixelRatio !== 1) { - forEach(ratioArgs, function (value, key) { - proto[key] = function (_super) { - return function () { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } + if (name === 'click') { + var _getWindowOffset2 = Object(get_window_offset["a" /* default */])(), + top = _getWindowOffset2.top; - var args = Array.prototype.slice.call(arguments); + detail = { + x: $event.x, + y: $event.y - top + }; + $event.touches = $event.changedTouches = [{ + force: 1, + identifier: 0, + clientX: $event.clientX, + clientY: $event.clientY, + pageX: $event.pageX, + pageY: $event.pageY + }]; + } // fixed mp-vue - if (value === 'all') { - args = args.map(function (a) { - return a * pixelRatio; - }); - } else if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - args[value[i]] *= pixelRatio; - } - } - return _super.apply(this, args); - }; - }(proto[key]); + var ret = wrapperMPEvent({ + type: detail.type || name, + timeStamp: $event.timeStamp || 0, + detail: detail, + target: processTarget(target, detail), + currentTarget: processTarget(currentTarget, false, true), + // 只处理系统事件 + touches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.touches) : $event.touches, + changedTouches: $event instanceof Event || $event instanceof CustomEvent ? processTouches($event.changedTouches) : $event.changedTouches, + preventDefault: function preventDefault() {}, + stopPropagation: function stopPropagation() {} }); - proto.stroke = function (_super) { - return function () { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } - - this.lineWidth *= pixelRatio; - - _super.apply(this, arguments); - - this.lineWidth /= pixelRatio; - }; - }(proto.stroke); - - proto.fillText = function (_super) { - return function () { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } + if (name.startsWith('mouse')) { + var _getWindowOffset3 = Object(get_window_offset["a" /* default */])(), + _top = _getWindowOffset3.top; - var args = Array.prototype.slice.call(arguments); - args[1] *= pixelRatio; - args[2] *= pixelRatio; - this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) { - return m * pixelRatio + u; - }); + ret.pageX = $event.pageX; + ret.pageY = $event.pageY - _top; + ret.clientX = $event.clientX; + ret.clientY = $event.clientY - _top; + } - _super.apply(this, args); + if (true) { + var nid = currentTarget.getAttribute('_i'); + ret.options = { + nid: nid + }; // 保留原始 currentTarget 方便后续对比 - this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) { - return m / pixelRatio + u; - }); - }; - }(proto.fillText); + ret.$origCurrentTarget = currentTarget; + } - proto.strokeText = function (_super) { - return function () { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } + return ret; +} +var LONGPRESS_TIMEOUT = 350; +var LONGPRESS_THRESHOLD = 10; +var passiveOptions = shared["k" /* supportsPassive */] ? { + passive: true +} : false; +var longPressTimer = false; - var args = Array.prototype.slice.call(arguments); - args[1] *= pixelRatio; // x +function clearLongPressTimer() { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = false; + } +} - args[2] *= pixelRatio; // y +var startPageX = 0; +var startPageY = 0; - this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) { - return m * pixelRatio + u; - }); +function touchstart(evt) { + clearLongPressTimer(); - _super.apply(this, args); + if (evt.touches.length !== 1) { + return; + } - this.font = this.font.replace(/(\d+)(px|em|rem|pt)/g, function (w, m, u) { - return m / pixelRatio + u; - }); - }; - }(proto.strokeText); + var _evt$touches$ = evt.touches[0], + pageX = _evt$touches$.pageX, + pageY = _evt$touches$.pageY; + startPageX = pageX; + startPageY = pageY; + longPressTimer = setTimeout(function () { + var customEvent = new CustomEvent('longpress', { + bubbles: true, + cancelable: true, + target: evt.target, + currentTarget: evt.currentTarget + }); + customEvent.touches = evt.touches; + customEvent.changedTouches = evt.changedTouches; + evt.target.dispatchEvent(customEvent); + }, LONGPRESS_TIMEOUT); +} - proto.drawImage = function (_super) { - return function () { - if (!this.__hidpi__) { - return _super.apply(this, arguments); - } +function touchmove(evt) { + if (!longPressTimer) { + return; + } - this.scale(pixelRatio, pixelRatio); + if (evt.touches.length !== 1) { + return clearLongPressTimer(); + } - _super.apply(this, arguments); + var _evt$touches$2 = evt.touches[0], + pageX = _evt$touches$2.pageX, + pageY = _evt$touches$2.pageY; - this.scale(1 / pixelRatio, 1 / pixelRatio); - }; - }(proto.drawImage); + if (Math.abs(pageX - startPageX) > LONGPRESS_THRESHOLD || Math.abs(pageY - startPageY) > LONGPRESS_THRESHOLD) { + return clearLongPressTimer(); + } } -function wrapper(canvas) { - canvas.width = canvas.offsetWidth * pixelRatio; - canvas.height = canvas.offsetHeight * pixelRatio; - canvas.getContext('2d').__hidpi__ = true; +function initEvents() { + window.addEventListener('touchstart', touchstart, passiveOptions); + window.addEventListener('touchmove', touchmove, passiveOptions); + window.addEventListener('touchend', clearLongPressTimer, passiveOptions); + window.addEventListener('touchcancel', clearLongPressTimer, passiveOptions); } /***/ }), -/* 16 */ +/* 19 */ /***/ (function(module, exports) { var g; @@ -10835,1247 +11141,847 @@ module.exports = g; /***/ }), -/* 17 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony default export */ __webpack_exports__["a"] = ({ - data: function data() { - return { - hovering: false - }; - }, - props: { - hoverClass: { - type: String, - default: 'none' - }, - hoverStopPropagation: { - type: Boolean, - default: false - }, - hoverStartTime: { - type: [Number, String], - default: 50 - }, - hoverStayTime: { - type: [Number, String], - default: 400 +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return publishHandler; }); +/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); + + +function publishHandler(event) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + Object(uni_shared__WEBPACK_IMPORTED_MODULE_1__[/* plusReady */ "j"])(function () { + var pageId = plus.webview.currentWebview().id; + + if (true) { + console.log("[VIEW][".concat(Date.now(), "]:"), event, args, pageId); } - }, - methods: { - _hoverTouchStart: function _hoverTouchStart(evt) { - var _this = this; - // TODO detect scrolling - if (evt._hoverPropagationStopped) { - return; + plus.webview.postMessageToUniNView({ + type: 'subscribeHandler', + args: { + type: event, + data: args, + pageId: pageId } + }, _constants__WEBPACK_IMPORTED_MODULE_0__[/* APP_SERVICE_ID */ "a"]); + }); +} - if (!this.hoverClass || this.hoverClass === 'none' || this.disabled) { - return; - } +/***/ }), +/* 21 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (evt.touches.length > 1) { - return; - } +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return findElm; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return elementMatchesPolyfill; }); +function findVmById(id, vm) { + if (id === vm._$id) { + return vm; + } - if (this.hoverStopPropagation) { - evt._hoverPropagationStopped = true; - } + var childVms = vm.$children; + var len = childVms.length; - this._hoverTouch = true; - this._hoverStartTimer = setTimeout(function () { - _this.hovering = true; + for (var i = 0; i < len; i++) { + var childVm = findVmById(id, childVms[i]); - if (!_this._hoverTouch) { - // 防止在hoverStartTime时间内触发了 touchend 或 touchcancel - _this._hoverReset(); - } - }, this.hoverStartTime); - }, - _hoverTouchEnd: function _hoverTouchEnd(evt) { - this._hoverTouch = false; + if (childVm) { + return childVm; + } + } +} - if (this.hovering) { - this._hoverReset(); +function findElm(component, pageVm) { + if (!pageVm) { + return console.error('page is not ready'); + } + + if (!component) { + return pageVm.$el; + } + + if (true) { + if (typeof component === 'string') { + var componentVm = findVmById(component, pageVm); + + if (!componentVm) { + throw new Error("Not Found\uFF1APage[".concat(pageVm.$page.id, "][").concat(component, "]")); } - }, - _hoverReset: function _hoverReset() { - var _this2 = this; - requestAnimationFrame(function () { - clearTimeout(_this2._hoverStayTimer); - _this2._hoverStayTimer = setTimeout(function () { - _this2.hovering = false; - }, _this2.hoverStayTime); - }); - }, - _hoverTouchCancel: function _hoverTouchCancel(evt) { - this._hoverTouch = false; - this.hovering = false; - clearTimeout(this._hoverStartTimer); + return componentVm.$el; } } -}); -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { + return component.$el; +} +function elementMatchesPolyfill(Element) { + if (!Element.matches) { + Element.matches = Element.matchesSelector || Element.mozMatchesSelector || Element.msMatchesSelector || Element.oMatchesSelector || Element.webkitMatchesSelector || function (s) { + var matches = (this.document || this.ownerDocument).querySelectorAll(s); + var i = matches.length; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + while (--i >= 0 && matches.item(i) !== this) {} + + return i > -1; + }; + } + + return Element; +} /***/ }), -/* 19 */ +/* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return disableScroll; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return pageScrollTo; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createScrollListener; }); +/* harmony import */ var uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20); -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function disableScroll(evt) { + evt.preventDefault(); +} +function pageScrollTo(_ref) { + var scrollTop = _ref.scrollTop, + duration = _ref.duration; + var documentElement = document.documentElement; + var clientHeight = documentElement.clientHeight, + scrollHeight = documentElement.scrollHeight; + scrollTop = Math.min(scrollTop, scrollHeight - clientHeight); -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + if (duration === 0) { + // 部分浏览器(比如微信)中 scrollTop 的值需要通过 document.body 来控制 + documentElement.scrollTop = document.body.scrollTop = scrollTop; + return; + } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + if (window.scrollY === scrollTop) { + return; + } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + function scrollTo(duration) { + if (duration <= 0) { + window.scrollTo(0, scrollTop); + return; + } -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// + var distaince = scrollTop - window.scrollY; + requestAnimationFrame(function () { + window.scrollTo(0, window.scrollY + distaince / duration * 10); + scrollTo(duration - 10); + }); + } + scrollTo(duration); // TODO 暂不使用 transform 会导致 fixed 元素不可见 + // const body = document.body + // const bodyStyle = body.style + // + // function webkitTransitionEnd() { + // bodyStyle.webkitTransition = '' + // bodyStyle.webkitTransform = '' + // documentElement.scrollTop = scrollTop + // body.removeEventListener('webkitTransitionEnd', webkitTransitionEnd) + // } + // + // body.addEventListener('webkitTransitionEnd', webkitTransitionEnd) + // bodyStyle.webkitTransition = `-webkit-transform ${duration}ms ease-out` + // bodyStyle.webkitTransform = `translateY(${documentElement.scrollTop}px) translateZ(0)` +} +var testReachBottomTimer; +var lastScrollHeight = 0; +function createScrollListener(pageId, _ref2) { + var enablePageScroll = _ref2.enablePageScroll, + enablePageReachBottom = _ref2.enablePageReachBottom, + onReachBottomDistance = _ref2.onReachBottomDistance, + enableTransparentTitleNView = _ref2.enableTransparentTitleNView; + var ticking = false; + var hasReachBottom = false; + var onReachBottom = true; + function isReachBottom() { + var scrollHeight = document.documentElement.scrollHeight; // 部分浏览器窗口高度变化后document.documentelement.clientheight不会变化,采用window.innerHeight -function resolveColor(color) { - color = color.slice(0); - color[3] = color[3] / 255; - return 'rgba(' + color.join(',') + ')'; -} + var windowHeight = window.innerHeight; + var scrollY = window.scrollY; + var isBottom = scrollY > 0 && scrollHeight > windowHeight && scrollY + windowHeight + onReachBottomDistance >= scrollHeight; // 兼容部分浏览器滚动时scroll事件不触发 -function processTouches(target, touches) { - return [].map.call(touches, function (touch) { - var boundingClientRect = target.getBoundingClientRect(); - return { - identifier: touch.identifier, - x: touch.clientX - boundingClientRect.left, - y: touch.clientY - boundingClientRect.top - }; - }); -} + var heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance; -var tempCanvas; + if (isBottom && (!hasReachBottom || heightChanged)) { + lastScrollHeight = scrollHeight; + hasReachBottom = true; + return true; + } -function getTempCanvas() { - var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + if (!isBottom && hasReachBottom) { + hasReachBottom = false; + } - if (!tempCanvas) { - tempCanvas = document.createElement('canvas'); + return false; } - tempCanvas.width = width; - tempCanvas.height = height; - return tempCanvas; -} + function trigger() { + var pages = getCurrentPages(); -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Canvas', - mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "e"]], - props: { - canvasId: { - type: String, - default: '' - }, - disableScroll: { - type: [Boolean, String], - default: false - } - }, - data: function data() { - return { - actionsWaiting: false - }; - }, - computed: { - id: function id() { - return this.canvasId; - }, - _listeners: function _listeners() { - var _this = this; + if (!pages.length || pages[pages.length - 1].$page.id !== pageId) { + return; + } // publish - var $listeners = Object.assign({}, this.$listeners); - var events = ['touchstart', 'touchmove', 'touchend']; - events.forEach(function (event) { - var existing = $listeners[event]; - var eventHandler = []; - if (existing) { - eventHandler.push(function ($event) { - _this.$trigger(event, Object.assign({}, $event, { - touches: processTouches($event.currentTarget, $event.touches), - changedTouches: processTouches($event.currentTarget, $event.changedTouches) - })); - }); - } + var scrollTop = window.pageYOffset; - if (_this.disableScroll && event === 'touchmove') { - eventHandler.push(_this._touchmove); - } + if (enablePageScroll) { + // 向 Service 发送 onPageScroll 事件 + Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onPageScroll', { + scrollTop: scrollTop + }, pageId); + } - $listeners[event] = eventHandler; + if (enableTransparentTitleNView) { + UniViewJSBridge.emit('onPageScroll', { + scrollTop: scrollTop }); - return $listeners; } - }, - created: function created() { - this._actionsDefer = []; - this._images = {}; - }, - mounted: function mounted() { - this._resize({ - width: this.$refs.sensor.$el.offsetWidth, - height: this.$refs.sensor.$el.offsetHeight - }); - }, - beforeDestroy: function beforeDestroy() { - var canvas = this.$refs.canvas; - canvas.height = canvas.width = 0; - }, - methods: { - _handleSubscribe: function _handleSubscribe(_ref) { - var type = _ref.type, - _ref$data = _ref.data, - data = _ref$data === void 0 ? {} : _ref$data; - var method = this[type]; - if (type.indexOf('_') !== 0 && typeof method === 'function') { - method(data); + function testReachBottom() { + if (isReachBottom()) { + Object(uni_platform_view_bridge__WEBPACK_IMPORTED_MODULE_0__[/* publishHandler */ "a"])('onReachBottom', {}, pageId); + onReachBottom = false; + setTimeout(function () { + onReachBottom = true; + }, 350); + return true; } - }, - _resize: function _resize() { - var canvas = this.$refs.canvas; + } - if (canvas.width > 0 && canvas.height > 0) { - var context = canvas.getContext('2d'); - var imageData = context.getImageData(0, 0, canvas.width, canvas.height); - Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(this.$refs.canvas); - context.putImageData(imageData, 0, 0); - } else { - Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(this.$refs.canvas); + if (enablePageReachBottom && onReachBottom) { + if (testReachBottom()) {} else { + // 解决部分浏览器滚动中js获取窗口高度不准确导致的问题 + testReachBottomTimer = setTimeout(testReachBottom, 300); } - }, - _touchmove: function _touchmove(event) { - event.preventDefault(); - }, - actionsChanged: function actionsChanged(_ref2) { - var _this2 = this; + } - var actions = _ref2.actions, - reserve = _ref2.reserve, - callbackId = _ref2.callbackId; - var self = this; + ticking = false; + } - if (!actions) { - return; - } + return function onScroll() { + clearTimeout(testReachBottomTimer); - if (this.actionsWaiting) { - this._actionsDefer.push([actions, reserve, callbackId]); + if (!ticking) { + requestAnimationFrame(trigger); + } - return; - } + ticking = true; + }; +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - var canvas = this.$refs.canvas; - var c2d = canvas.getContext('2d'); +/***/ }), +/* 23 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (!reserve) { - c2d.fillStyle = '#000000'; - c2d.strokeStyle = '#000000'; - c2d.shadowColor = '#000000'; - c2d.shadowBlur = 0; - c2d.shadowOffsetX = 0; - c2d.shadowOffsetY = 0; - c2d.setTransform(1, 0, 0, 1, 0, 0); - c2d.clearRect(0, 0, canvas.width, canvas.height); - } +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return vd; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initData; }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67); +/* harmony import */ var _vdom_sync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(106); +/* harmony import */ var _page__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69); +/* harmony import */ var _page_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(68); +var _handleData; - this.preloadImage(actions); +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - var _loop2 = function _loop2(index) { - var action = actions[index]; - var method = action.method; - var data = action.data; +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - if (/^set/.test(method) && method !== 'setTransform') { - var method1 = method[3].toLowerCase() + method.slice(4); - var color; +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - if (method1 === 'fillStyle' || method1 === 'strokeStyle') { - if (data[0] === 'normal') { - color = resolveColor(data[1]); - } else if (data[0] === 'linear') { - var LinearGradient = c2d.createLinearGradient.apply(c2d, _toConsumableArray(data[1])); - data[2].forEach(function (data2) { - var offset = data2[0]; - var color = resolveColor(data2[1]); - LinearGradient.addColorStop(offset, color); - }); - color = LinearGradient; - } else if (data[0] === 'radial') { - var x = data[1][0]; - var y = data[1][1]; - var r = data[1][2]; +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - var _LinearGradient = c2d.createRadialGradient(x, y, 0, x, y, r); +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - data[2].forEach(function (data2) { - var offset = data2[0]; - var color = resolveColor(data2[1]); +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - _LinearGradient.addColorStop(offset, color); - }); - color = _LinearGradient; - } else if (data[0] === 'pattern') { - var loaded = _this2.checkImageLoaded(data[1], actions.slice(index + 1), callbackId, function (image) { - if (image) { - c2d[method1] = c2d.createPattern(image, data[2]); - } - }); +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - if (!loaded) { - return "break"; - } - return "continue"; - } - c2d[method1] = color; - } else if (method1 === 'globalAlpha') { - c2d[method1] = data[0] / 255; - } else if (method1 === 'shadow') { - _ = ['shadowOffsetX', 'shadowOffsetY', 'shadowBlur', 'shadowColor']; - data.forEach(function (color_, method_) { - c2d[_[method_]] = _[method_] === 'shadowColor' ? resolveColor(color_) : color_; - }); - } else { - if (method1 === 'fontSize') { - c2d.font = c2d.font.replace(/\d+\.?\d*px/, data[0] + 'px'); - } else { - if (method1 === 'lineDash') { - c2d.setLineDash(data[0]); - c2d.lineDashOffset = data[1] || 0; - } else { - if (method1 === 'textBaseline') { - if (data[0] === 'normal') { - data[0] = 'alphabetic'; - } - c2d[method1] = data[0]; - } else { - c2d[method1] = data[0]; - } - } - } - } - } else if (method === 'fillPath' || method === 'strokePath') { - method = method.replace(/Path/, ''); - c2d.beginPath(); - data.forEach(function (data_) { - c2d[data_.method].apply(c2d, data_.data); - }); - c2d[method](); - } else if (method === 'fillText') { - c2d.fillText.apply(c2d, data); - } else if (method === 'drawImage') { - A = function () { - var dataArray = _toConsumableArray(data); - var url = dataArray[0]; - var otherData = dataArray.slice(1); - self._images = self._images || {}; - if (!self.checkImageLoaded(url, actions.slice(index + 1), callbackId, function (image) { - if (image) { - c2d.drawImage.apply(c2d, [image].concat(_toConsumableArray(otherData.slice(4, 8)), _toConsumableArray(otherData.slice(0, 4)))); - } - })) return 'break'; - }(); - if (A === 'break') { - return "break"; - } - } else { - if (method === 'clip') { - data.forEach(function (data_) { - c2d[data_.method].apply(c2d, data_.data); - }); - c2d.clip(); - } else { - c2d[method].apply(c2d, data); - } - } - }; - _loop: for (var index = 0; index < actions.length; index++) { - var _; +var vd; +var PageVueComponent; +var handleData = (_handleData = {}, _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"], function onPageCreate(data) { + var _data = _slicedToArray(data, 3), + pageId = _data[0], + pagePath = _data[1], + pageOptions = _data[2]; - var A; - - var _ret = _loop2(index); - - switch (_ret) { - case "break": - break _loop; - - case "continue": - continue; - } - } + document.title = "".concat(pagePath, "[").concat(pageId, "]"); // 设置当前页面伪对象,方便其他地方使用 getCurrentPages 获取当前页面 id,route - if (!this.actionsWaiting && callbackId) { - UniViewJSBridge.publishHandler('onDrawCanvas', { - callbackId: callbackId, - data: { - errMsg: 'drawCanvas:ok' - } - }, this.$page.id); - } - }, - preloadImage: function preloadImage(actions) { - var sefl = this; - actions.forEach(function (action) { - var method = action.method; - var data = action.data; - var src = ''; + Object(_page__WEBPACK_IMPORTED_MODULE_4__[/* setCurrentPage */ "b"])(pageId, pagePath); // 通知页面创建,根据当前页面配置信息,初始化部分事件 - if (method === 'drawImage') { - src = data[0]; - src = sefl.$getRealPath(src); - data[0] = src; - } else if (method === 'setFillStyle' && data[0] === 'pattern') { - src = data[1]; - src = sefl.$getRealPath(src); - data[1] = src; - } + UniViewJSBridge.subscribeHandler(_constants__WEBPACK_IMPORTED_MODULE_2__[/* ON_PAGE_CREATE */ "a"], pageOptions, pageId); // 初始化当前页面 VueComponent(生成页面样式代码) - if (src && !sefl._images[src]) { - loadImage(); - } - /** - * 加载图像 - */ + PageVueComponent = Object(_page_factory__WEBPACK_IMPORTED_MODULE_5__[/* getPageVueComponent */ "b"])(pagePath); // 生成当前页面 vd + vd = new _vdom_sync__WEBPACK_IMPORTED_MODULE_3__[/* VDomSync */ "a"](pageId, { + version: pageOptions.version + }); +}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* MOUNTED_DATA */ "c"], function onMounted(data) { + vd.addVData.apply(vd, data); +}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* UPDATED_DATA */ "h"], function onUpdated(data) { + vd.updateVData.apply(vd, data); +}), _defineProperty(_handleData, _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATED */ "e"], function onPageCreated(data) { + var _data2 = _slicedToArray(data, 3), + pageId = _data2[0], + pagePath = _data2[1], + pageQuery = _data2[2]; - function loadImage() { - sefl._images[src] = new Image(); + var page = getCurrentPages()[0]; + page.options = pageQuery || {}; + page.$vm = new PageVueComponent({ + mpType: 'page', + pageId: pageId, + pagePath: pagePath, + pageQuery: pageQuery + }).$mount('#app'); +}), _handleData); - sefl._images[src].onload = function () { - sefl._images[src].ready = true; - }; - /** - * 从Blob加载 - * @param {Blob} blob - */ +function broadcast(vm, componentName, eventName) { + for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + params[_key - 3] = arguments[_key]; + } + vm.$children.forEach(function (child) { + var name = child.$options.name && child.$options.name.replace(/^VUni/, ''); - function loadBlob(blob) { - sefl._images[src].src = (window.URL || window.webkitURL).createObjectURL(blob); - } - /** - * 从本地文件加载 - * @param {string} path 文件路径 - */ + if (~componentName.indexOf(name)) { + child.$emit.apply(child, [eventName].concat(params)); + } + broadcast.apply(void 0, [child, componentName, eventName].concat(params)); + }); +} - function loadFile(path) { - var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now()); - bitmap.load(path, function () { - sefl._images[src].src = bitmap.toBase64Data(); - bitmap.clear(); - }, function () { - bitmap.clear(); - console.error('preloadImage error'); - }); - } - /** - * 从网络加载 - * @param {string} url 文件地址 - */ +var NATIVE_COMPONENTS = ['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video', 'CoverView', 'CoverImage', 'Ad']; +function updateView() { + var pages = getCurrentPages(); + var pageVm = pages[0] && pages[0].$vm; + pageVm && broadcast(pageVm, NATIVE_COMPONENTS, 'uni-view-update'); +} - function loadUrl(url) { - function plusDownload() { - plus.downloader.createDownload(url, { - filename: '_doc/uniapp_temp/download/' - }, function (d, status) { - if (status === 200) { - loadFile(d.filename); - } else { - sefl._images[src].src = src; - } - }).start(); - } +window.addEventListener('resize', function () { + updateView(); +}); +window.addEventListener('updateview', updateView); - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'blob'; +function vdSync(_ref) { + var data = _ref.data, + options = _ref.options; + var isVdCallback = true; + data.forEach(function (data) { + if (data[0] === _constants__WEBPACK_IMPORTED_MODULE_1__[/* PAGE_CREATE */ "d"]) { + // 页面创建无需触发 callback + isVdCallback = false; + } - xhr.onload = function () { - if (this.status === 200) { - loadBlob(this.response); - } - }; + handleData[data[0]](data[1]); + }); + vd.flush(); + vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].nextTick(function () { + // 清空本次 addBatchData + vd.clearAddBatchVData(); + updateView(); + isVdCallback && UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC_CALLBACK */ "j"]); + }); +} - xhr.onerror = window.plus ? plusDownload : function () { - sefl._images[src].src = src; - }; - xhr.send(); - } +function getData(id, name) { + try { + return this.$r[id][name]; + } catch (e) {// console.error(this.$options.__file + `:[${this._$id}]$r[${id}][${name}] is undefined`) + } +} +/** + * wxs change:prop + * @param {Object} id + * @param {Object} name + */ - if (window.plus && (!window.webkit || !window.webkit.messageHandlers)) { - sefl._images[src].src = src; - } else { - // 解决 PLUS-APP(wkwebview)以及 H5 图像跨域问题(H5图像响应头需包含access-control-allow-origin) - if (window.plus && src.indexOf('http://') !== 0 && src.indexOf('https://') !== 0) { - loadFile(src); - } else if (/^data:.*,.*/.test(src)) { - sefl._images[src].src = src; - } else { - loadUrl(src); - } - } - } - }); - }, - checkImageLoaded: function checkImageLoaded(src, actions, callbackId, fn) { - var self = this; - var image = this._images[src]; - if (image.ready) { - fn(image); - return true; - } else { - this._actionsDefer.unshift([actions, true]); +function getChangeData(id, name) { + try { + var value = this.$r[id][name]; + var wxsPropName = name.replace('change:', ''); + this[wxsPropName] = value; + this.$set(this.wxsProps, wxsPropName, value); + return value; + } catch (e) {// console.error(this.$options.__file + `:[${this._$id}]$r[${id}][${name}] is undefined`) + } +} - this.actionsWaiting = true; +function initData(Vue) { + Vue.prototype._$g = getData; + Vue.prototype._$gc = getChangeData; + UniViewJSBridge.subscribe(_constants__WEBPACK_IMPORTED_MODULE_1__[/* VD_SYNC */ "i"], vdSync); + Object.defineProperty(Vue.prototype, '_$vd', { + get: function get() { + return !this.$options.isReserved && vd; + } + }); + Vue.mixin({ + beforeCreate: function beforeCreate() { + if (this.$options.mpType) { + this.mpType = this.$options.mpType; + } - image.onload = function () { - image.ready = true; - fn(image); - self.actionsWaiting = false; + if (this._$vd) { + this._$vd.initVm(this); + } + } + }); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - var actions = self._actionsDefer.slice(0); +/***/ }), +/* 24 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - self._actionsDefer = []; +"use strict"; +/* harmony default export */ __webpack_exports__["a"] = ({ + data: function data() { + return { + hovering: false + }; + }, + props: { + hoverClass: { + type: String, + default: 'none' + }, + hoverStopPropagation: { + type: Boolean, + default: false + }, + hoverStartTime: { + type: [Number, String], + default: 50 + }, + hoverStayTime: { + type: [Number, String], + default: 400 + } + }, + methods: { + _hoverTouchStart: function _hoverTouchStart(evt) { + var _this = this; - for (var action = actions.shift(); action;) { - self.actionsChanged({ - actions: action[0], - reserve: action[1], - callbackId: callbackId - }); - action = actions.shift(); - } - }; + // TODO detect scrolling + if (evt._hoverPropagationStopped) { + return; + } - return false; + if (!this.hoverClass || this.hoverClass === 'none' || this.disabled) { + return; } - }, - getImageData: function getImageData(_ref3) { - var _ref3$x = _ref3.x, - x = _ref3$x === void 0 ? 0 : _ref3$x, - _ref3$y = _ref3.y, - y = _ref3$y === void 0 ? 0 : _ref3$y, - width = _ref3.width, - height = _ref3.height, - destWidth = _ref3.destWidth, - destHeight = _ref3.destHeight, - _ref3$hidpi = _ref3.hidpi, - hidpi = _ref3$hidpi === void 0 ? true : _ref3$hidpi, - callbackId = _ref3.callbackId; - var imgData; - var canvas = this.$refs.canvas; - if (!width) { - width = canvas.offsetWidth - x; + if (evt.touches.length > 1) { + return; } - if (!height) { - height = canvas.offsetHeight - y; + if (this.hoverStopPropagation) { + evt._hoverPropagationStopped = true; } - try { - if (!hidpi) { - if (!destWidth && !destHeight) { - destWidth = Math.round(width * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]); - destHeight = Math.round(height * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]); - } else if (!destWidth) { - destWidth = Math.round(width / height * destHeight); - } else if (!destHeight) { - destHeight = Math.round(height / width * destWidth); - } - } else { - destWidth = width; - destHeight = height; - } + this._hoverTouch = true; + this._hoverStartTimer = setTimeout(function () { + _this.hovering = true; - var newCanvas = getTempCanvas(destWidth, destHeight); - var context = newCanvas.getContext('2d'); - context.__hidpi__ = true; - context.drawImageByCanvas(canvas, x, y, width, height, 0, 0, destWidth, destHeight, false); - imgData = context.getImageData(0, 0, destWidth, destHeight); - newCanvas.height = newCanvas.width = 0; - context.__hidpi__ = false; - } catch (error) { - if (!callbackId) { - return; + if (!_this._hoverTouch) { + // 防止在hoverStartTime时间内触发了 touchend 或 touchcancel + _this._hoverReset(); } + }, this.hoverStartTime); + }, + _hoverTouchEnd: function _hoverTouchEnd(evt) { + this._hoverTouch = false; - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasGetImageData:fail' - } - }, this.$page.id); - return; - } - - if (!callbackId) { - // fix [...]展开TypedArray在低版本手机报错的问题,使用Array.prototype.slice - return { - data: Array.prototype.slice.call(imgData.data), - width: destWidth, - height: destHeight - }; - } else { - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasGetImageData:ok', - data: _toConsumableArray(imgData.data), - width: destWidth, - height: destHeight - } - }, this.$page.id); - } - }, - putImageData: function putImageData(_ref4) { - var data = _ref4.data, - x = _ref4.x, - y = _ref4.y, - width = _ref4.width, - height = _ref4.height, - callbackId = _ref4.callbackId; - - try { - if (!height) { - height = Math.round(data.length / 4 / width); - } - - var canvas = getTempCanvas(width, height); - var context = canvas.getContext('2d'); - context.putImageData(new ImageData(new Uint8ClampedArray(data), width, height), 0, 0); - this.$refs.canvas.getContext('2d').drawImage(canvas, x, y, width, height); - canvas.height = canvas.width = 0; - } catch (error) { - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasPutImageData:fail' - } - }, this.$page.id); - return; + if (this.hovering) { + this._hoverReset(); } - - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasPutImageData:ok' - } - }, this.$page.id); }, - getDataUrl: function getDataUrl(_ref5) { - var _this3 = this; + _hoverReset: function _hoverReset() { + var _this2 = this; - var _ref5$x = _ref5.x, - x = _ref5$x === void 0 ? 0 : _ref5$x, - _ref5$y = _ref5.y, - y = _ref5$y === void 0 ? 0 : _ref5$y, - width = _ref5.width, - height = _ref5.height, - destWidth = _ref5.destWidth, - destHeight = _ref5.destHeight, - _ref5$hidpi = _ref5.hidpi, - hidpi = _ref5$hidpi === void 0 ? true : _ref5$hidpi, - fileType = _ref5.fileType, - qualit = _ref5.qualit, - callbackId = _ref5.callbackId; - var res = this.getImageData({ - x: x, - y: y, - width: width, - height: height, - destWidth: destWidth, - destHeight: destHeight, - hidpi: hidpi + requestAnimationFrame(function () { + clearTimeout(_this2._hoverStayTimer); + _this2._hoverStayTimer = setTimeout(function () { + _this2.hovering = false; + }, _this2.hoverStayTime); }); + }, + _hoverTouchCancel: function _hoverTouchCancel(evt) { + this._hoverTouch = false; + this.hovering = false; + clearTimeout(this._hoverStartTimer); + } + } +}); - if (!res.data || !res.data.length) { - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasGetDataUrl:fail' - } - }, this.$page.id); - return; - } - - var imgData; +/***/ }), +/* 25 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - try { - imgData = new ImageData(new Uint8ClampedArray(res.data), res.width, res.height); - } catch (error) { - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasGetDataUrl:fail' - } - }, this.$page.id); - return; - } +"use strict"; +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); - destWidth = res.width; - destHeight = res.height; - var canvas = getTempCanvas(destWidth, destHeight); - var c2d = canvas.getContext('2d'); - c2d.putImageData(imgData, 0, 0); - var base64 = canvas.toDataURL('image/png'); - canvas.height = canvas.width = 0; - var img = new Image(); - img.onload = function () { - var canvas = getTempCanvas(destWidth, destHeight); +var resetTimer; +var isAndroid; +var osVersion; +var keyboardHeight; +var keyboardChangeCallback; +var webviewStyle; - if (fileType === 'jpeg' || fileType === 'jpg') { - fileType = 'jpeg'; - c2d.fillStyle = '#fff'; - c2d.fillRect(0, 0, destWidth, destHeight); - } +if (true) { + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + isAndroid = plus.os.name.toLowerCase() === 'android'; + osVersion = plus.os.version; + }); + document.addEventListener('keyboardchange', function (event) { + keyboardHeight = event.height; + keyboardChangeCallback && keyboardChangeCallback(); + }, false); +} +/** + * 保证iOS点击输入框外隐藏键盘 + */ - c2d.drawImage(img, 0, 0); - base64 = canvas.toDataURL("image/".concat(fileType), qualit); - canvas.height = canvas.width = 0; - UniViewJSBridge.publishHandler('onCanvasMethodCallback', { - callbackId: callbackId, - data: { - errMsg: 'canvasGetDataUrl:ok', - base64: base64 - } - }, _this3.$page.id); - }; - img.src = base64; - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) +function iosHideKeyboard() {} -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { +function setSoftinputTemporary(vm, reset) { + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + var MODE_ADJUSTRESIZE = 'adjustResize'; + var MODE_ADJUSTPAN = 'adjustPan'; + var MODE_NOTHING = 'nothing'; + var currentWebview = plus.webview.currentWebview(); // iOS 14.6 调用同步方法导致键盘弹卡顿 -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + var style = webviewStyle || currentWebview.getStyle() || {}; + var options = { + mode: reset || style.softinputMode === MODE_ADJUSTRESIZE ? MODE_ADJUSTRESIZE : vm.adjustPosition ? MODE_ADJUSTPAN : MODE_NOTHING, + position: { + top: 0, + height: 0 + } + }; -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { + if (options.mode === MODE_ADJUSTPAN) { + var rect = vm.$el.getBoundingClientRect(); + options.position.top = rect.top; + options.position.height = rect.height + (Number(vm.cursorSpacing) || 0); + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + currentWebview.setSoftinputTemporary(options); + }); +} -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { +function setSoftinputNavBar(vm) { + if (vm.showConfirmBar === 'auto') { + delete vm.__softinputNavBar; + return; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + var currentWebview = plus.webview.currentWebview(); -/***/ }), -/* 23 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var _ref = currentWebview.getStyle() || {}, + softinputNavBar = _ref.softinputNavBar; -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60); -/* harmony import */ var _formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(83); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + var showConfirmBar = softinputNavBar !== 'none'; -// -// -// -// -// -// -// -// + if (showConfirmBar !== vm.showConfirmBar) { + vm.__softinputNavBar = softinputNavBar || 'auto'; + currentWebview.setStyle({ + softinputNavBar: vm.showConfirmBar ? 'auto' : 'none' + }); + } else { + delete vm.__softinputNavBar; + } + }); +} +function resetSoftinputNavBar(vm) { + var softinputNavBar = vm.__softinputNavBar; + if (softinputNavBar) { + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + var currentWebview = plus.webview.currentWebview(); + currentWebview.setStyle({ + softinputNavBar: softinputNavBar + }); + }); + } +} /* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Editor', - mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "e"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* keyboard */ "c"]], + name: 'Keyboard', + mixins: [_emitter__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]], props: { - id: { - type: String, - default: '' - }, - readOnly: { - type: [Boolean, String], - default: false - }, - placeholder: { - type: String, - default: '' + cursorSpacing: { + type: [Number, String], + default: 0 }, - showImgSize: { + showConfirmBar: { type: [Boolean, String], - default: false + default: 'auto' }, - showImgToolbar: { + adjustPosition: { type: [Boolean, String], - default: false + default: true }, - showImgResize: { + autoBlur: { type: [Boolean, String], default: false } }, - data: function data() { - return { - quillReady: false - }; - }, - computed: {}, - watch: { - readOnly: function readOnly(value) { - if (this.quillReady) { - var quill = this.quill; - quill.enable(!value); - - if (!value) { - quill.blur(); - } - } - }, - placeholder: function placeholder(value) { - if (this.quillReady) { - this.quill.root.setAttribute('data-placeholder', value); + directives: { + keyboard: { + inserted: function inserted(el, binding, vnode) { + vnode.context.initKeyboard(el); } } }, - mounted: function mounted() { - var _this = this; + methods: { + initKeyboard: function initKeyboard(el) { + var _this = this; - var imageResizeModules = []; + var focus; - if (this.showImgSize) { - imageResizeModules.push('DisplaySize'); - } + var keyboardChange = function keyboardChange() { + _this.$trigger('keyboardheightchange', {}, { + height: keyboardHeight, + duration: 0.25 + }); // 安卓切换不同键盘类型时会导致键盘收回,需重新设置 - if (this.showImgToolbar) { - imageResizeModules.push('Toolbar'); - } - if (this.showImgResize) { - imageResizeModules.push('Resize'); - } + if (focus && keyboardHeight === 0) { + setSoftinputTemporary(_this); + } // 安卓/iOS13收起键盘时主动失去焦点 - this.loadQuill(function () { - if (imageResizeModules.length) { - _this.loadImageResizeModule(function () { - _this.initQuill(imageResizeModules); - }); - } else { - _this.initQuill(imageResizeModules); - } - }); - }, - methods: { - _handleSubscribe: function _handleSubscribe(_ref) { - var type = _ref.type, - data = _ref.data; - var options = data.options, - callbackId = data.callbackId; - var quill = this.quill; - var Quill = window.Quill; - var res; - var range; - var errMsg; - if (this.quillReady) { - switch (type) { - case 'format': - { - var _options$name = options.name, - name = _options$name === void 0 ? '' : _options$name, - _options$value = options.value, - value = _options$value === void 0 ? false : _options$value; - range = quill.getSelection(true); - var format = quill.getFormat(range)[name] || false; + if (_this.autoBlur && focus && keyboardHeight === 0 && (isAndroid || parseInt(osVersion) >= 13)) { + document.activeElement.blur(); + } + }; - if (['bold', 'italic', 'underline', 'strike', 'ins'].includes(name)) { - value = !format; - } else if (name === 'direction') { - value = value === 'rtl' && format ? false : value; - var align = quill.getFormat(range).align; + el.addEventListener('focus', function () { + focus = true; + clearTimeout(resetTimer); + document.addEventListener('click', iosHideKeyboard, false); - if (value === 'rtl' && !align) { - quill.format('align', 'right', Quill.sources.USER); - } else if (!value && align === 'right') { - quill.format('align', false, Quill.sources.USER); - } - } else if (name === 'indent') { - var rtl = quill.getFormat(range).direction === 'rtl'; - value = value === '+1'; + if (true) { + keyboardChangeCallback = keyboardChange; - if (rtl) { - value = !value; - } + if (keyboardHeight) { + _this.$trigger('keyboardheightchange', {}, { + height: keyboardHeight, + duration: 0 + }); + } - value = value ? '+1' : '-1'; - } else { - if (name === 'list') { - value = value === 'check' ? 'unchecked' : value; - format = format === 'checked' ? 'unchecked' : format; - } + setSoftinputNavBar(_this); + setSoftinputTemporary(_this); + } + }); - value = format && format !== (value || false) || !format && value ? value : !format; + if (true) { + // 安卓单独隐藏键盘后点击输入框不会触发 focus 事件 + if (isAndroid) { + el.addEventListener('click', function () { + if (!_this.disabled && focus && keyboardHeight === 0) { + setSoftinputTemporary(_this); + } + }); + } + + if (!isAndroid) { + // iOS12 以下系统 focus 事件设置较迟,改在 touchstart 设置 + if (parseInt(osVersion) < 12) { + el.addEventListener('touchstart', function () { + if (!_this.disabled && !focus) { + setSoftinputTemporary(_this); } + }); + } // iOS 14.6 调用同步方法导致键盘弹卡顿 - quill.format(name, value, Quill.sources.USER); - } - break; - case 'insertDivider': - range = quill.getSelection(true); - quill.insertText(range.index, '\n', Quill.sources.USER); - quill.insertEmbed(range.index + 1, 'divider', true, Quill.sources.USER); - quill.setSelection(range.index + 2, Quill.sources.SILENT); - break; + if (parseFloat(osVersion) >= 14.6 && !webviewStyle) { + Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "j"])(function () { + var currentWebview = plus.webview.currentWebview(); + webviewStyle = currentWebview.getStyle() || {}; + }); + } + } + } - case 'insertImage': - { - range = quill.getSelection(true); + var onKeyboardHide = function onKeyboardHide() { + document.removeEventListener('click', iosHideKeyboard, false); - var _options$src = options.src, - src = _options$src === void 0 ? '' : _options$src, - _options$alt = options.alt, - alt = _options$alt === void 0 ? '' : _options$alt, - _options$data = options.data, - _data = _options$data === void 0 ? {} : _options$data; + if (true) { + keyboardChangeCallback = null; - quill.insertEmbed(range.index, 'image', this.$getRealPath(src), Quill.sources.USER); - quill.formatText(range.index, 1, 'alt', alt); - quill.formatText(range.index, 1, 'data-custom', Object.keys(_data).map(function (key) { - return "".concat(key, "=").concat(_data[key]); - }).join('&')); - quill.setSelection(range.index + 1, Quill.sources.SILENT); - } - break; + if (keyboardHeight) { + _this.$trigger('keyboardheightchange', {}, { + height: 0, + duration: 0 + }); + } - case 'insertText': - { - range = quill.getSelection(true); - var _options$text = options.text, - text = _options$text === void 0 ? '' : _options$text; - quill.insertText(range.index, text, Quill.sources.USER); - quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT); - } - break; + resetSoftinputNavBar(_this); - case 'setContents': - { - var delta = options.delta, - html = options.html; + if (isAndroid) { + // 还原安卓软键盘配置,避免影响 web-view 组件 + resetTimer = setTimeout(function () { + setSoftinputTemporary(_this, true); + }, 300); + } + } // 修复ios端显示与点击位置错位的Bug by:wyq - if (_typeof(delta) === 'object') { - quill.setContents(delta, Quill.sources.SILENT); - } else if (typeof html === 'string') { - quill.setContents(this.html2delta(html), Quill.sources.SILENT); - } else { - errMsg = 'contents is missing'; - } - } - break; - case 'getContents': - res = this.getContents(); - break; + if (String(navigator.vendor).indexOf('Apple') === 0) { + document.documentElement.scrollTo(document.documentElement.scrollLeft, document.documentElement.scrollTop); + } + }; - case 'clear': - quill.setContents([]); - break; + el.addEventListener('blur', function () { + // 在iOS设备上,手动调用uni.hideKeyboard(),键盘收起并且触发blur,但实际并没有blur。 + // 此时如果再点击页面其他地方会重新聚焦,此处做处理 + el.blur(); + focus = false; + onKeyboardHide(); + }); + } + } +}); - case 'removeFormat': - { - range = quill.getSelection(true); - var parchment = Quill.import('parchment'); +/***/ }), +/* 26 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (range.length) { - quill.removeFormat(range, Quill.sources.USER); - } else { - Object.keys(quill.getFormat(range)).forEach(function (key) { - if (parchment.query(key, parchment.Scope.INLINE)) { - quill.format(key, false); - } - }); - } - } - break; +"use strict"; +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); - case 'undo': - quill.history.undo(); - break; +var passiveOptions = uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* supportsPassive */ "k"] ? { + passive: true, + capture: true +} : true; +var vms = []; +var userInteract = 0; +var inited; - case 'redo': - quill.history.redo(); - break; +function setInteract(interact) { + vms.forEach(function (vm) { + return vm.userInteract = interact; + }); +} - default: - break; - } +function addInteractListener() { + var vm = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.updateStatus(range); - } else { - errMsg = 'not ready'; - } + if (!inited) { + var eventNames = ['touchstart', 'touchmove', 'touchend', 'mousedown', 'mouseup']; + eventNames.forEach(function (eventName) { + document.addEventListener(eventName, function () { + !userInteract && setInteract(true); + userInteract++; + setTimeout(function () { + ! --userInteract && setInteract(false); + }, 0); + }, passiveOptions); + }); + inited = true; + } - if (callbackId) { - UniViewJSBridge.publishHandler('onEditorMethodCallback', { - callbackId: callbackId, - data: Object.assign({}, res, { - errMsg: "".concat(type, ":").concat(errMsg ? 'fail ' + errMsg : 'ok') - }) - }, this.$page.id); - } - }, - loadQuill: function loadQuill(callback) { - if (typeof window.Quill === 'function') { - if (typeof callback === 'function') { - callback(); - } + vms.push(vm); +} - return; - } +function removeInteractListener(vm) { + var index = vms.indexOf(vm); - var script = document.createElement('script'); - script.src = window.plus ? './__uniappquill.js' : 'https://unpkg.com/quill@1.3.7/dist/quill.min.js'; - document.body.appendChild(script); - script.onload = callback; - }, - loadImageResizeModule: function loadImageResizeModule(callback) { - if (typeof window.ImageResize === 'function') { - if (typeof callback === 'function') { - callback(); - } + if (index >= 0) { + vms.splice(index, 1); + } +} - return; - } +/* harmony default export */ __webpack_exports__["a"] = ({ + data: function data() { + return { + /** + * 是否用户交互行为 + */ + userInteract: false + }; + }, + mounted: function mounted() { + addInteractListener(this); + }, + beforeDestroy: function beforeDestroy() { + removeInteractListener(this); + }, + addInteractListener: addInteractListener, + // true -> interact + getStatus: function getStatus() { + return !!userInteract; + } +}); - var script = document.createElement('script'); - script.src = window.plus ? './__uniappquillimageresize.js' : 'https://unpkg.com/quill-image-resize-mp@3.0.1/image-resize.min.js'; - document.body.appendChild(script); - script.onload = callback; - }, - initQuill: function initQuill(imageResizeModules) { - var _this2 = this; +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { - var Quill = window.Quill; - _formats__WEBPACK_IMPORTED_MODULE_2__[/* register */ "a"](Quill); - var options = { - toolbar: false, - readOnly: this.readOnly, - placeholder: this.placeholder, - modules: {} - }; +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - if (imageResizeModules.length) { - Quill.register('modules/ImageResize', window.ImageResize.default); - options.modules.ImageResize = { - modules: imageResizeModules - }; - } +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { - var quill = this.quill = new Quill(this.$el, options); - var $el = quill.root; - var events = ['focus', 'blur', 'input']; - events.forEach(function (name) { - $el.addEventListener(name, function ($event) { - if (name === 'input') { - $event.stopPropagation(); - } else { - _this2.$trigger(name, $event, _this2.getContents()); - } - }); - }); - quill.on(Quill.events.TEXT_CHANGE, function () { - _this2.$trigger('input', {}, _this2.getContents()); - }); - quill.on(Quill.events.SELECTION_CHANGE, this.updateStatus.bind(this)); - quill.on(Quill.events.SCROLL_OPTIMIZE, function () { - var range = quill.selection.getRange()[0]; +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - _this2.updateStatus(range); - }); - quill.clipboard.addMatcher(Node.ELEMENT_NODE, function (node, delta) { - if (_this2.skipMatcher) { - return delta; - } +/***/ }), +/* 29 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return { - ops: delta.ops.filter(function (_ref2) { - var insert = _ref2.insert; - return typeof insert === 'string'; - }).map(function (_ref3) { - var insert = _ref3.insert; - return { - insert: insert - }; - }) - }; - }); - this.initKeyboard($el); - this.quillReady = true; - this.$trigger('ready', event, {}); - }, - getContents: function getContents() { - var quill = this.quill; - var html = quill.root.innerHTML; - var text = quill.getText(); - var delta = quill.getContents(); - return { - html: html, - text: text, - delta: delta - }; - }, - html2delta: function html2delta(html) { - var tags = ['span', 'strong', 'b', 'ins', 'em', 'i', 'u', 'a', 'del', 's', 'sub', 'sup', 'img', 'div', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'ol', 'ul', 'li']; - var content = ''; - var disable; - Object(uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(html, { - start: function start(tag, attrs, unary) { - if (!tags.includes(tag)) { - disable = !unary; - return; - } - - disable = false; - var arrts = attrs.map(function (_ref4) { - var name = _ref4.name, - value = _ref4.value; - return "".concat(name, "=\"").concat(value, "\""); - }).join(' '); - var start = "<".concat(tag, " ").concat(arrts, " ").concat(unary ? '/' : '', ">"); - content += start; - }, - end: function end(tag) { - if (!disable) { - content += ""); - } - }, - chars: function chars(text) { - if (!disable) { - content += text; - } - } - }); - this.skipMatcher = true; - var delta = this.quill.clipboard.convert(content); - this.skipMatcher = false; - return delta; - }, - updateStatus: function updateStatus(range) { - var _this3 = this; - - var status = range ? this.quill.getFormat(range) : {}; - var keys = Object.keys(status); - - if (keys.length !== Object.keys(this.__status || {}).length || keys.find(function (key) { - return status[key] !== _this3.__status[key]; - })) { - this.__status = status; - this.$trigger('statuschange', {}, status); - } - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); +/* harmony import */ var uni_platform_helpers_save_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(107); +/* harmony import */ var uni_platform_helpers_file__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(108); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -/***/ }), -/* 28 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); // // // @@ -12085,189 +11991,602 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi // // // +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + + + + + +function resolveColor(color) { + color = color.slice(0); + color[3] = color[3] / 255; + return 'rgba(' + color.join(',') + ')'; +} + +function processTouches(target, touches) { + return [].map.call(touches, function (touch) { + var boundingClientRect = target.getBoundingClientRect(); + return { + identifier: touch.identifier, + x: touch.clientX - boundingClientRect.left, + y: touch.clientY - boundingClientRect.top + }; + }); +} + +var tempCanvas; + +function getTempCanvas() { + var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (!tempCanvas) { + tempCanvas = document.createElement('canvas'); + } + + tempCanvas.width = width; + tempCanvas.height = height; + return tempCanvas; +} /* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Label', - mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"]], + name: 'Canvas', + mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"]], props: { - for: { + canvasId: { type: String, default: '' + }, + disableScroll: { + type: [Boolean, String], + default: false } }, + data: function data() { + return { + actionsWaiting: false + }; + }, computed: { - pointer: function pointer() { - return this.for || this.$slots.default && this.$slots.default.length; + id: function id() { + return this.canvasId; + }, + _listeners: function _listeners() { + var _this = this; + + var $listeners = Object.assign({}, this.$listeners); + var events = ['touchstart', 'touchmove', 'touchend']; + events.forEach(function (event) { + var existing = $listeners[event]; + var eventHandler = []; + + if (existing) { + eventHandler.push(function ($event) { + _this.$trigger(event, Object.assign({}, $event, { + touches: processTouches($event.currentTarget, $event.touches), + changedTouches: processTouches($event.currentTarget, $event.changedTouches) + })); + }); + } + + if (_this.disableScroll && event === 'touchmove') { + eventHandler.push(_this._touchmove); + } + + $listeners[event] = eventHandler; + }); + return $listeners; } }, + created: function created() { + this._actionsDefer = []; + this._images = {}; + }, + mounted: function mounted() { + this._resize(); + }, + beforeDestroy: function beforeDestroy() { + var canvas = this.$refs.canvas; + canvas.height = canvas.width = 0; + }, methods: { - _onClick: function _onClick($event) { - var stopPropagation = /^uni-(checkbox|radio|switch)-/.test($event.target.className); - - if (!stopPropagation) { - stopPropagation = /^uni-(checkbox|radio|switch|button)$/i.test($event.target.tagName); - } + _handleSubscribe: function _handleSubscribe(_ref) { + var type = _ref.type, + _ref$data = _ref.data, + data = _ref$data === void 0 ? {} : _ref$data; + var method = this[type]; - if (stopPropagation) { - return; + if (type.indexOf('_') !== 0 && typeof method === 'function') { + method(data); } + }, + _resize: function _resize(size) { + var canvas = this.$refs.canvas; + var hasChanged = !size || canvas.width !== Math.floor(size.width * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]) || canvas.height !== Math.floor(size.height * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]); + if (!hasChanged) return; - if (this.for) { - UniViewJSBridge.emit('uni-label-click-' + this.$page.id + '-' + this.for, $event, true); + if (canvas.width > 0 && canvas.height > 0) { + var context = canvas.getContext('2d'); + var imageData = context.getImageData(0, 0, canvas.width, canvas.height); + Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(canvas); + context.putImageData(imageData, 0, 0); } else { - this.$broadcast(['Checkbox', 'Radio', 'Switch', 'Button'], 'uni-label-click', $event, true); + Object(uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* wrapper */ "b"])(canvas); } - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { + }, + _touchmove: function _touchmove(event) { + event.preventDefault(); + }, + actionsChanged: function actionsChanged(_ref2) { + var _this2 = this; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + var actions = _ref2.actions, + reserve = _ref2.reserve, + callbackId = _ref2.callbackId; + var self = this; -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { + if (!actions) { + return; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (this.actionsWaiting) { + this._actionsDefer.push([actions, reserve, callbackId]); -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { + return; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + var canvas = this.$refs.canvas; + var c2d = canvas.getContext('2d'); -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { + if (!reserve) { + c2d.fillStyle = '#000000'; + c2d.strokeStyle = '#000000'; + c2d.shadowColor = '#000000'; + c2d.shadowBlur = 0; + c2d.shadowOffsetX = 0; + c2d.shadowOffsetY = 0; + c2d.setTransform(1, 0, 0, 1, 0, 0); + c2d.clearRect(0, 0, canvas.width, canvas.height); + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + this.preloadImage(actions); -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { + var _loop2 = function _loop2(index) { + var action = actions[index]; + var method = action.method; + var data = action.data; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (/^set/.test(method) && method !== 'setTransform') { + var method1 = method[3].toLowerCase() + method.slice(4); + var color; -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { + if (method1 === 'fillStyle' || method1 === 'strokeStyle') { + if (data[0] === 'normal') { + color = resolveColor(data[1]); + } else if (data[0] === 'linear') { + var LinearGradient = c2d.createLinearGradient.apply(c2d, _toConsumableArray(data[1])); + data[2].forEach(function (data2) { + var offset = data2[0]; + var color = resolveColor(data2[1]); + LinearGradient.addColorStop(offset, color); + }); + color = LinearGradient; + } else if (data[0] === 'radial') { + var x = data[1][0]; + var y = data[1][1]; + var r = data[1][2]; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + var _LinearGradient = c2d.createRadialGradient(x, y, 0, x, y, r); -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { + data[2].forEach(function (data2) { + var offset = data2[0]; + var color = resolveColor(data2[1]); -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + _LinearGradient.addColorStop(offset, color); + }); + color = _LinearGradient; + } else if (data[0] === 'pattern') { + var loaded = _this2.checkImageLoaded(data[1], actions.slice(index + 1), callbackId, function (image) { + if (image) { + c2d[method1] = c2d.createPattern(image, data[2]); + } + }); -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { + if (!loaded) { + return "break"; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + return "continue"; + } -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { + c2d[method1] = color; + } else if (method1 === 'globalAlpha') { + c2d[method1] = data[0] / 255; + } else if (method1 === 'shadow') { + _ = ['shadowOffsetX', 'shadowOffsetY', 'shadowBlur', 'shadowColor']; + data.forEach(function (color_, method_) { + c2d[_[method_]] = _[method_] === 'shadowColor' ? resolveColor(color_) : color_; + }); + } else if (method1 === 'fontSize') { + var font = c2d.__font__ || c2d.font; + c2d.__font__ = c2d.font = font.replace(/\d+\.?\d*px/, data[0] + 'px'); + } else if (method1 === 'lineDash') { + c2d.setLineDash(data[0]); + c2d.lineDashOffset = data[1] || 0; + } else if (method1 === 'textBaseline') { + if (data[0] === 'normal') { + data[0] = 'alphabetic'; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + c2d[method1] = data[0]; + } else if (method1 === 'font') { + c2d.__font__ = c2d.font = data[0]; + } else { + c2d[method1] = data[0]; + } + } else if (method === 'fillPath' || method === 'strokePath') { + method = method.replace(/Path/, ''); + c2d.beginPath(); + data.forEach(function (data_) { + c2d[data_.method].apply(c2d, data_.data); + }); + c2d[method](); + } else if (method === 'fillText') { + c2d.fillText.apply(c2d, data); + } else if (method === 'drawImage') { + A = function () { + var dataArray = _toConsumableArray(data); -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { + var url = dataArray[0]; + var otherData = dataArray.slice(1); + self._images = self._images || {}; + if (!self.checkImageLoaded(url, actions.slice(index + 1), callbackId, function (image) { + if (image) { + c2d.drawImage.apply(c2d, [image].concat(_toConsumableArray(otherData.slice(4, 8)), _toConsumableArray(otherData.slice(0, 4)))); + } + })) return 'break'; + }(); -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (A === 'break') { + return "break"; + } + } else { + if (method === 'clip') { + data.forEach(function (data_) { + c2d[data_.method].apply(c2d, data_.data); + }); + c2d.clip(); + } else { + c2d[method].apply(c2d, data); + } + } + }; -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { + _loop: for (var index = 0; index < actions.length; index++) { + var _; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + var A; -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { + var _ret = _loop2(index); -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + switch (_ret) { + case "break": + break _loop; -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { + case "continue": + continue; + } + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (!this.actionsWaiting && callbackId) { + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: { + errMsg: 'drawCanvas:ok' + } + }, this.$page.id); + } + }, + preloadImage: function preloadImage(actions) { + var self = this; + actions.forEach(function (action) { + var method = action.method; + var data = action.data; + var src = ''; -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { + if (method === 'drawImage') { + src = data[0]; + src = self.$getRealPath(src); + data[0] = src; + } else if (method === 'setFillStyle' && data[0] === 'pattern') { + src = data[1]; + src = self.$getRealPath(src); + data[1] = src; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (src && !self._images[src]) { + loadImage(); + } + /** + * 加载图像 + */ -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + function loadImage() { + var image = self._images[src] = new Image(); -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { + image.onload = function () { + image.ready = true; + }; // 安卓 WebView 除本地路径无跨域问题 -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { + if ( true && navigator.vendor === 'Google Inc.') { + if (src.indexOf('file://') === 0) { + image.crossOrigin = 'anonymous'; + } -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + image.src = src; + return; + } -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { + Object(uni_platform_helpers_file__WEBPACK_IMPORTED_MODULE_3__[/* getSameOriginUrl */ "a"])(src).then(function (src) { + image.src = src; + }).catch(function () { + image.src = src; + }); + } + }); + }, + checkImageLoaded: function checkImageLoaded(src, actions, callbackId, fn) { + var self = this; + var image = this._images[src]; -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + if (image.ready) { + fn(image); + return true; + } else { + this._actionsDefer.unshift([actions, true]); + + this.actionsWaiting = true; + + image.onload = function () { + image.ready = true; + fn(image); + self.actionsWaiting = false; + + var actions = self._actionsDefer.slice(0); + + self._actionsDefer = []; + + for (var action = actions.shift(); action;) { + self.actionsChanged({ + actions: action[0], + reserve: action[1], + callbackId: callbackId + }); + action = actions.shift(); + } + }; + + return false; + } + }, + getImageData: function getImageData(_ref3) { + var _ref3$x = _ref3.x, + x = _ref3$x === void 0 ? 0 : _ref3$x, + _ref3$y = _ref3.y, + y = _ref3$y === void 0 ? 0 : _ref3$y, + width = _ref3.width, + height = _ref3.height, + destWidth = _ref3.destWidth, + destHeight = _ref3.destHeight, + _ref3$hidpi = _ref3.hidpi, + hidpi = _ref3$hidpi === void 0 ? true : _ref3$hidpi, + dataType = _ref3.dataType, + _ref3$quality = _ref3.quality, + quality = _ref3$quality === void 0 ? 1 : _ref3$quality, + _ref3$type = _ref3.type, + type = _ref3$type === void 0 ? 'png' : _ref3$type, + callbackId = _ref3.callbackId; + var canvas = this.$refs.canvas; + var data; + var maxWidth = canvas.offsetWidth - x; + width = width ? Math.min(width, maxWidth) : maxWidth; + var maxHeight = canvas.offsetHeight - y; + height = height ? Math.min(height, maxHeight) : maxHeight; + + if (!hidpi) { + if (!destWidth && !destHeight) { + destWidth = Math.round(width * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]); + destHeight = Math.round(height * uni_helpers_hidpi__WEBPACK_IMPORTED_MODULE_1__[/* pixelRatio */ "a"]); + } else if (!destWidth) { + destWidth = Math.round(width / height * destHeight); + } else if (!destHeight) { + destHeight = Math.round(height / width * destWidth); + } + } else { + destWidth = width; + destHeight = height; + } + + var newCanvas = getTempCanvas(destWidth, destHeight); + var context = newCanvas.getContext('2d'); + + if (type === 'jpeg' || type === 'jpg') { + type = 'jpeg'; + context.fillStyle = '#fff'; + context.fillRect(0, 0, destWidth, destHeight); + } + + context.__hidpi__ = true; + context.drawImageByCanvas(canvas, x, y, width, height, 0, 0, destWidth, destHeight, false); + var result; + + try { + var compressed; + + if (dataType === 'base64') { + data = newCanvas.toDataURL("image/".concat(type), quality); + } else { + var imgData = context.getImageData(0, 0, destWidth, destHeight); + + if (true) { + var pako = __webpack_require__(87); + + data = pako.deflateRaw(imgData.data, { + to: 'string' + }); + compressed = true; + } else {} + } + + result = { + errMsg: 'canvasGetImageData:ok', + data: data, + compressed: compressed, + width: destWidth, + height: destHeight + }; + } catch (error) { + result = { + errMsg: "canvasGetImageData:fail ".concat(error) + }; + } + + newCanvas.height = newCanvas.width = 0; + context.__hidpi__ = false; + + if (!callbackId) { + return result; + } else { + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: result + }, this.$page.id); + } + }, + putImageData: function putImageData(_ref4) { + var data = _ref4.data, + x = _ref4.x, + y = _ref4.y, + width = _ref4.width, + height = _ref4.height, + compressed = _ref4.compressed, + callbackId = _ref4.callbackId; + + try { + if (!height) { + height = Math.round(data.length / 4 / width); + } + + var canvas = getTempCanvas(width, height); + var context = canvas.getContext('2d'); + + if ( true && compressed) { + var pako = __webpack_require__(87); + + data = pako.inflateRaw(data); + } + + context.putImageData(new ImageData(new Uint8ClampedArray(data), width, height), 0, 0); + this.$refs.canvas.getContext('2d').drawImage(canvas, x, y, width, height); + canvas.height = canvas.width = 0; + } catch (error) { + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: { + errMsg: 'canvasPutImageData:fail' + } + }, this.$page.id); + return; + } + + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: { + errMsg: 'canvasPutImageData:ok' + } + }, this.$page.id); + }, + toTempFilePath: function toTempFilePath(_ref5) { + var _this3 = this; + + var _ref5$x = _ref5.x, + x = _ref5$x === void 0 ? 0 : _ref5$x, + _ref5$y = _ref5.y, + y = _ref5$y === void 0 ? 0 : _ref5$y, + width = _ref5.width, + height = _ref5.height, + destWidth = _ref5.destWidth, + destHeight = _ref5.destHeight, + fileType = _ref5.fileType, + quality = _ref5.quality, + dirname = _ref5.dirname, + callbackId = _ref5.callbackId; + var res = this.getImageData({ + x: x, + y: y, + width: width, + height: height, + destWidth: destWidth, + destHeight: destHeight, + hidpi: false, + dataType: 'base64', + type: fileType, + quality: quality + }); + + if (!res.data || !res.data.length) { + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: { + errMsg: res.errMsg.replace('canvasPutImageData', 'toTempFilePath') + } + }, this.$page.id); + return; + } + + Object(uni_platform_helpers_save_image__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(res.data, dirname, function (error, tempFilePath) { + var errMsg = "toTempFilePath:".concat(error ? 'fail' : 'ok'); + + if (error) { + errMsg += " ".concat(error.message); + } + + UniViewJSBridge.publishHandler('onCanvasMethodCallback', { + callbackId: callbackId, + data: { + errMsg: errMsg, + tempFilePath: tempFilePath + } + }, _this3.$page.id); + }); + } + } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 47 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin @@ -12275,7 +12594,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi /***/ }), -/* 48 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin @@ -12283,7 +12602,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi /***/ }), -/* 49 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin @@ -12291,23 +12610,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi /***/ }), -/* 50 */ +/* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var _mixins_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); -// -// -// -// -// -// -// -// -// -// -// +/* harmony import */ var uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70); +/* harmony import */ var _formats__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(110); +/* harmony import */ var _load_script__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + // // // @@ -12318,479 +12630,443 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi // -var methods = ['getCenterLocation', 'moveToLocation', 'getRegion', 'getScale', '$getAppMap']; // const events = [ -// 'markertap', -// 'callouttap', -// 'controltap', -// 'regionchange', -// 'tap', -// 'updated' -// ] -var _attrs = ['latitude', 'longitude', 'scale', 'markers', 'polyline', 'circles', 'controls', 'show-location']; -var convertCoordinates = function convertCoordinates(lng, lat, callback) { - // plus.maps.Map.convertCoordinates(new plus.maps.Point(lng, lat), { - // coordType: 'gcj02' - // }, callback) - callback({ - coord: { - latitude: lat, - longitude: lng - } - }); -}; -function parseHex(color) { - if (color.indexOf('#') !== 0) { - return { - color: color, - opacity: 1 - }; - } +function isiOS() { + if (true) { + return plus.os.name.toLowerCase() === 'ios'; + } else { var isIPadOS, isMac, isIOS, ua; } - var opacity = color.substr(7, 2); - return { - color: color.substr(0, 7), - opacity: opacity ? Number('0x' + opacity) / 255 : 1 - }; + return false; } +var textChanging = false; /* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Map', - mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "e"], _mixins_native__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]], + name: 'Editor', + mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"], uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* keyboard */ "d"]], props: { id: { type: String, default: '' }, - latitude: { - type: [Number, String], - default: '' + readOnly: { + type: [Boolean, String], + default: false }, - longitude: { - type: [Number, String], + placeholder: { + type: String, default: '' }, - scale: { - type: [String, Number], - default: 16 + showImgSize: { + type: [Boolean, String], + default: false }, - markers: { - type: Array, - default: function _default() { - return []; - } + showImgToolbar: { + type: [Boolean, String], + default: false }, - polyline: { - type: Array, - default: function _default() { - return []; - } - }, - circles: { - type: Array, - default: function _default() { - return []; - } - }, - controls: { - type: Array, - default: function _default() { - return []; - } + showImgResize: { + type: [Boolean, String], + default: false } }, data: function data() { return { - style: { - top: '0px', - left: '0px', - width: '0px', - height: '0px', - position: 'static' - }, - hidden: false + quillReady: false }; }, - computed: { - attrs: function attrs() { - var _this = this; - - var obj = {}; - - _attrs.forEach(function (key) { - var val = _this.$props[key]; - val = key === 'src' ? _this.$getRealPath(val) : val; - obj[key.replace(/[A-Z]/g, function (str) { - return '-' + str.toLowerCase(); - })] = val; - }); - - return obj; - }, - mapControls: function mapControls() { - var _this2 = this; - - var list = this.controls.map(function (control) { - var position = { - position: 'absolute' - }; - ['top', 'left', 'width', 'height'].forEach(function (key) { - if (control.position[key]) { - position[key] = control.position[key] + 'px'; - } - }); - return { - id: control.id, - iconPath: _this2.$getRealPath(control.iconPath), - position: position - }; - }); - return list; - } - }, + computed: {}, watch: { - hidden: function hidden(val) { - this.map && this.map[val ? 'hide' : 'show'](); - }, - scale: function scale(val) { - this.map && this.map.setZoom(val); - }, - latitude: function latitude(val) { - this.map && this.map.setStyles({ - center: new plus.maps.Point(this.longitude, this.latitude) - }); - }, - longitude: function longitude(val) { - this.map && this.map.setStyles({ - center: new plus.maps.Point(this.longitude, this.latitude) - }); - }, - markers: function markers(val) { - this.map && this._addMarkers(val, true); - }, - polyline: function polyline(val) { - this.map && this._addMapLines(val); + readOnly: function readOnly(value) { + if (this.quillReady) { + var quill = this.quill; + quill.enable(!value); + + if (!value) { + quill.blur(); + } + } }, - circles: function circles(val) { - this.map && this._addMapCircles(val); + placeholder: function placeholder(value) { + if (this.quillReady) { + this.setPlaceHolder(value); + } } }, mounted: function mounted() { - var _this3 = this; + var _this = this; - var mapStyle = Object.assign({}, this.attrs, this.position); + var imageResizeModules = []; - if (this.latitude && this.longitude) { - mapStyle.center = new plus.maps.Point(this.longitude, this.latitude); + if (this.showImgSize) { + imageResizeModules.push('DisplaySize'); } - var map = this.map = plus.maps.create(this.$page.id + '-map-' + (this.id || Date.now()), mapStyle); - map.__markers__ = {}; - map.__lines__ = []; - map.__circles__ = []; - map.setZoom(this.scale); - plus.webview.currentWebview().append(map); + if (this.showImgToolbar) { + imageResizeModules.push('Toolbar'); + } - if (this.hidden) { - map.hide(); + if (this.showImgResize) { + imageResizeModules.push('Resize'); } - this.$watch('position', function () { - _this3.map && _this3.map.setStyles(_this3.position); - }, { - deep: true + var quillSrc = true ? './__uniappquill.js' : undefined; + Object(_load_script__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(window.Quill, quillSrc, function () { + if (imageResizeModules.length) { + var imageResizeSrc = true ? './__uniappquillimageresize.js' : undefined; + Object(_load_script__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(window.ImageResize, imageResizeSrc, function () { + _this.initQuill(imageResizeModules); + }); + } else { + _this.initQuill(imageResizeModules); + } }); - - map.onclick = function (e) { - _this3.$trigger('click', {}, e); - }; - - map.onstatuschanged = function (e) { - _this3.$trigger('regionchange', {}, e); - }; - - this._addMarkers(this.markers); - - this._addMapLines(this.polyline); - - this._addMapCircles(this.circles); - }, - beforeDestroy: function beforeDestroy() { - this.map && this.map.close(); - delete this.map; }, methods: { _handleSubscribe: function _handleSubscribe(_ref) { var type = _ref.type, - _ref$data = _ref.data, - data = _ref$data === void 0 ? {} : _ref$data; + data = _ref.data; + var options = data.options, + callbackId = data.callbackId; + var quill = this.quill; + var Quill = window.Quill; + var res; + var range; + var errMsg; - if (!methods.includes(type)) { - return; - } + if (this.quillReady) { + switch (type) { + case 'format': + { + var _options$name = options.name, + name = _options$name === void 0 ? '' : _options$name, + _options$value = options.value, + value = _options$value === void 0 ? false : _options$value; + range = quill.getSelection(true); + var format = quill.getFormat(range)[name] || false; - this.map && this[type](data); - }, - moveToLocation: function moveToLocation(_ref2) { - var callbackId = _ref2.callbackId, - longitude = _ref2.longitude, - latitude = _ref2.latitude; - this.map.setCenter(new plus.maps.Point(longitude || this.longitude, latitude || this.latitude)); + if (['bold', 'italic', 'underline', 'strike', 'ins'].includes(name)) { + value = !format; + } else if (name === 'direction') { + value = value === 'rtl' && format ? false : value; + var align = quill.getFormat(range).align; - this._publishHandler(callbackId, { - errMsg: 'moveToLocation:ok' - }); - }, - getCenterLocation: function getCenterLocation(_ref3) { - var callbackId = _ref3.callbackId; - var center = this.map.getCenter(); + if (value === 'rtl' && !align) { + quill.format('align', 'right', Quill.sources.USER); + } else if (!value && align === 'right') { + quill.format('align', false, Quill.sources.USER); + } + } else if (name === 'indent') { + var rtl = quill.getFormat(range).direction === 'rtl'; + value = value === '+1'; - this._publishHandler(callbackId, { - longitude: center.longitude, - latitude: center.latitude, - errMsg: 'getCenterLocation:ok' - }); - }, - getRegion: function getRegion(_ref4) { - var callbackId = _ref4.callbackId; - var rect = this.map.getBounds(); + if (rtl) { + value = !value; + } - this._publishHandler(callbackId, { - southwest: rect.southwest, - northeast: rect.northeast || rect.northease, - // 5plus API 名字写错了 - errMsg: 'getRegion:ok' - }); - }, - getScale: function getScale(_ref5) { - var callbackId = _ref5.callbackId; + value = value ? '+1' : '-1'; + } else { + if (name === 'list') { + value = value === 'check' ? 'unchecked' : value; + format = format === 'checked' ? 'unchecked' : format; + } - this._publishHandler(callbackId, { - scale: this.map.getZoom(), - errMsg: 'getScale:ok' - }); - }, - controlclick: function controlclick(e) { - this.$trigger('controltap', {}, { - controlId: e.id - }); - }, - _publishHandler: function _publishHandler(callbackId, data) { - UniViewJSBridge.publishHandler('onMapMethodCallback', { - callbackId: callbackId, - data: data - }, this.$page.id); - }, - _addMarker: function _addMarker(nativeMap, marker) { - var _this4 = this; + value = format && format !== (value || false) || !format && value ? value : !format; + } - var id = marker.id, - latitude = marker.latitude, - longitude = marker.longitude, - iconPath = marker.iconPath, - callout = marker.callout, - label = marker.label; - convertCoordinates(longitude, latitude, function (res) { - var _res$coord = res.coord, - latitude = _res$coord.latitude, - longitude = _res$coord.longitude; - var nativeMarker = new plus.maps.Marker(new plus.maps.Point(longitude, latitude)); + quill.format(name, value, Quill.sources.USER); + } + break; - if (iconPath) { - nativeMarker.setIcon(_this4.$getRealPath(iconPath)); - } + case 'insertDivider': + range = quill.getSelection(true); + quill.insertText(range.index, '\n', Quill.sources.USER); + quill.insertEmbed(range.index + 1, 'divider', true, Quill.sources.USER); + quill.setSelection(range.index + 2, Quill.sources.SILENT); + break; - if (label && label.content) { - nativeMarker.setLabel(label.content); - } + case 'insertImage': + { + range = quill.getSelection(true); - var nativeBubble = false; + var _options$src = options.src, + src = _options$src === void 0 ? '' : _options$src, + _options$alt = options.alt, + alt = _options$alt === void 0 ? '' : _options$alt, + _options$width = options.width, + width = _options$width === void 0 ? '' : _options$width, + _options$height = options.height, + height = _options$height === void 0 ? '' : _options$height, + _options$extClass = options.extClass, + extClass = _options$extClass === void 0 ? '' : _options$extClass, + _options$data = options.data, + _data = _options$data === void 0 ? {} : _options$data; - if (callout && callout.content) { - nativeBubble = new plus.maps.Bubble(callout.content); - } + var path = this.$getRealPath(src); + quill.insertEmbed(range.index, 'image', path, Quill.sources.USER); + var local = /^(file|blob):/.test(path) ? path : false; // 防止 formatText 多次触发 Quill.events.TEXT_CHANGE 事件 - if (nativeBubble) { - nativeMarker.setBubble(nativeBubble); - } + textChanging = true; + quill.formatText(range.index, 1, 'data-local', local); + quill.formatText(range.index, 1, 'alt', alt); + quill.formatText(range.index, 1, 'width', width); + quill.formatText(range.index, 1, 'height', height); + quill.formatText(range.index, 1, 'class', extClass); + textChanging = false; + quill.formatText(range.index, 1, 'data-custom', Object.keys(_data).map(function (key) { + return "".concat(key, "=").concat(_data[key]); + }).join('&')); + quill.setSelection(range.index + 1, Quill.sources.SILENT); + } + break; - if (id || id === 0) { - nativeMarker.onclick = function (e) { - _this4.$trigger('markertap', {}, { - markerId: id - }); - }; + case 'insertText': + { + range = quill.getSelection(true); + var _options$text = options.text, + text = _options$text === void 0 ? '' : _options$text; + quill.insertText(range.index, text, Quill.sources.USER); + quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT); + } + break; - if (nativeBubble) { - nativeBubble.onclick = function () { - _this4.$trigger('callouttap', {}, { - markerId: id - }); - }; - } - } + case 'setContents': + { + var delta = options.delta, + html = options.html; - nativeMap.addOverlay(nativeMarker); - nativeMap.__markers__[id + ''] = nativeMarker; - }); - }, - _addMarkers: function _addMarkers(markers, clear) { - var _this5 = this; + if (_typeof(delta) === 'object') { + quill.setContents(delta, Quill.sources.SILENT); + } else if (typeof html === 'string') { + quill.setContents(this.html2delta(html), Quill.sources.SILENT); + } else { + errMsg = 'contents is missing'; + } + } + break; - if (this.map) { - if (clear) { - this.map.clearOverlays(); - this.map.__markers__ = {}; - } + case 'getContents': + res = this.getContents(); + break; - markers.forEach(function (marker) { - _this5._addMarker(_this5.map, marker); - }); - return { - errMsg: 'addMapMarkers:ok' - }; - } + case 'clear': + quill.setContents([]); + break; - return { - errMsg: 'addMapMarkers:fail:请先创建地图元素' - }; - }, - _translateMapMarker: function _translateMapMarker(_ref6) { - var autoRotate = _ref6.autoRotate, - callbackId = _ref6.callbackId, - destination = _ref6.destination, - duration = _ref6.duration, - markerId = _ref6.markerId; + case 'removeFormat': + { + range = quill.getSelection(true); + var parchment = Quill.import('parchment'); - if (this.map) { - var nativeMarker = this.map.__markers__[markerId + '']; + if (range.length) { + quill.removeFormat(range, Quill.sources.USER); + } else { + Object.keys(quill.getFormat(range)).forEach(function (key) { + if (parchment.query(key, parchment.Scope.INLINE)) { + quill.format(key, false); + } + }); + } + } + break; - if (nativeMarker) { - nativeMarker.setPoint(new plus.maps.Point(destination.longitude, destination.latitude)); - } - } + case 'undo': + quill.history.undo(); + break; - return { - errMsg: 'translateMapMarker:ok' - }; - }, - _addMapLines: function _addMapLines(lines) { - var nativeMap = this.map; + case 'redo': + quill.history.redo(); + break; - if (!nativeMap) { - return { - errMsg: 'addMapLines:fail:请先创建地图元素' - }; - } + case 'blur': + quill.blur(); + break; - if (nativeMap.__lines__.length > 0) { - nativeMap.__lines__.forEach(function (circle) { - nativeMap.removeOverlay(circle); - }); + case 'getSelectionText': + range = quill.selection.savedRange; + res = { + text: '' + }; - nativeMap.__lines__ = []; - } + if (range && range.length !== 0) { + res.text = quill.getText(range.index, range.length); + } - lines.forEach(function (line) { - var color = line.color, - width = line.width; - var points = line.points.map(function (point) { - return new plus.maps.Point(point.longitude, point.latitude); - }); - var polyline = new plus.maps.Polyline(points); + break; - if (color) { - var strokeStyle = parseHex(color); - polyline.setStrokeColor(strokeStyle.color); - polyline.setStrokeOpacity(strokeStyle.opacity); - } + case 'scrollIntoView': + quill.scrollIntoView(); + break; - if (width) { - polyline.setLineWidth(width); + default: + break; } - nativeMap.addOverlay(polyline); + this.updateStatus(range); + } else { + errMsg = 'not ready'; + } - nativeMap.__lines__.push(polyline); - }); - return { - errMsg: 'addMapLines:ok' - }; + if (callbackId) { + UniViewJSBridge.publishHandler('onEditorMethodCallback', { + callbackId: callbackId, + data: Object.assign({}, res, { + errMsg: "".concat(type, ":").concat(errMsg ? 'fail ' + errMsg : 'ok') + }) + }, this.$page.id); + } }, - _addMapCircles: function _addMapCircles(circles) { - var nativeMap = this.map; + setPlaceHolder: function setPlaceHolder(value) { + var placeHolderAttrName = 'data-placeholder'; + var QuillRoot = this.quill.root; + QuillRoot.getAttribute(placeHolderAttrName) !== value && QuillRoot.setAttribute(placeHolderAttrName, value); + }, + initQuill: function initQuill(imageResizeModules) { + var _this2 = this; - if (!nativeMap) { - return { - errMsg: 'addMapCircles:fail:请先创建地图元素' + var Quill = window.Quill; + _formats__WEBPACK_IMPORTED_MODULE_2__[/* register */ "a"](Quill); + var options = { + toolbar: false, + readOnly: this.readOnly, + placeholder: this.placeholder, + modules: {} + }; + + if (imageResizeModules.length) { + Quill.register('modules/ImageResize', window.ImageResize.default); + options.modules.ImageResize = { + modules: imageResizeModules }; } - if (nativeMap.__circles__.length > 0) { - nativeMap.__circles__.forEach(function (circle) { - nativeMap.removeOverlay(circle); - }); - - nativeMap.__circles__ = []; - } + var quill = this.quill = new Quill(this.$el, options); + var $el = quill.root; + var events = ['focus', 'blur', 'input']; + events.forEach(function (name) { + $el.addEventListener(name, function ($event) { + var contents = _this2.getContents(); - circles.forEach(function (circle) { - var latitude = circle.latitude, - longitude = circle.longitude, - color = circle.color, - fillColor = circle.fillColor, - radius = circle.radius, - strokeWidth = circle.strokeWidth; - var nativeCircle = new plus.maps.Circle(new plus.maps.Point(longitude, latitude), radius); + if (name === 'input') { + if (isiOS()) { + var regExpContent = (contents.html.match(/([\s\S]*)<\/span>/) || [])[1]; + var placeholder = regExpContent && regExpContent.replace(/\s/g, '') ? '' : _this2.placeholder; - if (color) { - var strokeStyle = parseHex(color); - nativeCircle.setStrokeColor(strokeStyle.color); - nativeCircle.setStrokeOpacity(strokeStyle.opacity); - } + _this2.setPlaceHolder(placeholder); + } - if (fillColor) { - var fillStyle = parseHex(fillColor); - nativeCircle.setFillColor(fillStyle.color); - nativeCircle.setFillOpacity(fillStyle.opacity); + $event.stopPropagation(); + } else { + _this2.$trigger(name, $event, contents); + } + }); + }); + quill.on(Quill.events.TEXT_CHANGE, function () { + if (!textChanging) { + _this2.$trigger('input', {}, _this2.getContents()); } + }); + quill.on(Quill.events.SELECTION_CHANGE, this.updateStatus.bind(this)); + quill.on(Quill.events.SCROLL_OPTIMIZE, function () { + var range = quill.selection.getRange()[0]; - if (strokeWidth) { - nativeCircle.setLineWidth(strokeWidth); + _this2.updateStatus(range); + }); + quill.clipboard.addMatcher(Node.ELEMENT_NODE, function (node, delta) { + if (_this2.skipMatcher) { + return delta; } - nativeMap.addOverlay(nativeCircle); - - nativeMap.__circles__.push(nativeCircle); + delta.ops = delta.ops.filter(function (_ref2) { + var insert = _ref2.insert; + return typeof insert === 'string'; + }).map(function (_ref3) { + var insert = _ref3.insert; + return { + insert: insert + }; + }); + return delta; }); + this.initKeyboard($el); + this.quillReady = true; + this.$trigger('ready', event, {}); + }, + getContents: function getContents() { + var quill = this.quill; + var html = quill.root.innerHTML; + var text = quill.getText(); + var delta = quill.getContents(); return { - errMsg: 'addMapCircles:ok' + html: html, + text: text, + delta: delta }; - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -// extracted by mini-css-extract-plugin - if(false) { var cssReload; } - + }, + html2delta: function html2delta(html) { + var tags = ['span', 'strong', 'b', 'ins', 'em', 'i', 'u', 'a', 'del', 's', 'sub', 'sup', 'img', 'div', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'ol', 'ul', 'li', 'br']; + var content = ''; + var disable; + Object(uni_helpers_html_parser__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(html, { + start: function start(tag, attrs, unary) { + if (!tags.includes(tag)) { + disable = !unary; + return; + } -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { + disable = false; + var arrts = attrs.map(function (_ref4) { + var name = _ref4.name, + value = _ref4.value; + return "".concat(name, "=\"").concat(value, "\""); + }).join(' '); + var start = "<".concat(tag, " ").concat(arrts, " ").concat(unary ? '/' : '', ">"); + content += start; + }, + end: function end(tag) { + if (!disable) { + content += ""); + } + }, + chars: function chars(text) { + if (!disable) { + content += text; + } + } + }); + this.skipMatcher = true; + var delta = this.quill.clipboard.convert(content); + this.skipMatcher = false; + return delta; + }, + updateStatus: function updateStatus(range) { + var _this3 = this; + + var status = range ? this.quill.getFormat(range) : {}; + var keys = Object.keys(status); + + if (keys.length !== Object.keys(this.__status || {}).length || keys.find(function (key) { + return status[key] !== _this3.__status[key]; + })) { + this.__status = status; + this.$trigger('statuschange', {}, status); + } + } + } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin if(false) { var cssReload; } /***/ }), -/* 53 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin @@ -12798,122 +13074,75 @@ function parseHex(color) { /***/ }), -/* 54 */ +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + + +/***/ }), +/* 38 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +// +// +// +// +// +// // // // - -var webview = false; - -var insertHTMLWebView = function insertHTMLWebView(_ref) { - var htmlId = _ref.htmlId; - var parentWebview = plus.webview.currentWebview(); // fixed by hxy web-view 组件所在的 webview 不注入 uni-app 框架 - - var styles = { - 'uni-app': 'none' - }; - var parentTitleNView = parentWebview.getTitleNView(); - - if (parentTitleNView) { - if (plus.navigator.isImmersedStatusbar()) { - styles.top = 44 + plus.navigator.getStatusbarHeight(); - } else { - styles.top = 44; - } - - styles.bottom = 0; - } - - webview = plus.webview.create('', htmlId, styles); - - if (parentTitleNView) { - webview.addEventListener('titleUpdate', function () { - var title = webview.getTitle(); - parentWebview.setStyle({ - titleNView: { - titleText: !title || title === 'null' ? '' : title - } - }); - }); - } - - plus.webview.currentWebview().append(webview); -}; - -var updateHTMLWebView = function updateHTMLWebView(_ref2) { - var htmlId = _ref2.htmlId, - src = _ref2.src, - webviewStyles = _ref2.webviewStyles; - // fixed by xxx 非空时才执行更新操作 - var realPath = src || ''; - - if (!realPath) { - return; - } - - if (/^(http|https):\/\//.test(realPath) && webviewStyles.progress) { - webview.setStyle({ - progress: { - color: webviewStyles.progress.color - } - }); - } - - webview.loadURL(realPath); -}; - -var removeHTMLWebView = function removeHTMLWebView() { - plus.webview.currentWebview().remove(webview); - webview.close('none'); - webview = false; -}; /* harmony default export */ __webpack_exports__["a"] = ({ - name: 'WebView', + name: 'Label', + mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* emitter */ "a"]], props: { - src: { + for: { type: String, default: '' - }, - webviewStyles: { - type: Object, - default: function _default() { - return {}; - } } }, - watch: { - src: function src(val, oldVal) { - webview && updateHTMLWebView({ - src: this.$getRealPath(val), - webviewStyles: this.webviewStyles - }); + computed: { + pointer: function pointer() { + return this.for || this.$slots.default && this.$slots.default.length; } }, - mounted: function mounted() { - this.htmlId = 'webviewId' + this.$page.id; - insertHTMLWebView({ - htmlId: this.htmlId - }); - updateHTMLWebView({ - src: this.$getRealPath(this.src), - webviewStyles: this.webviewStyles - }); - UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_INSERTED */ "j"], {}, this.$page.id); - }, - beforeDestroy: function beforeDestroy() { - removeHTMLWebView(); - UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_REMOVED */ "l"], {}, this.$page.id); + methods: { + _onClick: function _onClick($event) { + var stopPropagation = /^uni-(checkbox|radio|switch)-/.test($event.target.className); + + if (!stopPropagation) { + stopPropagation = /^uni-(checkbox|radio|switch|button)$/i.test($event.target.tagName); + } + + if (stopPropagation) { + return; + } + + if (this.for) { + UniViewJSBridge.emit('uni-label-click-' + this.$page.id + '-' + this.for, $event, true); + } else { + this.$broadcast(['Checkbox', 'Radio', 'Switch', 'Button'], 'uni-label-click', $event, true); + } + } } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 55 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin @@ -12921,2691 +13150,3210 @@ var removeHTMLWebView = function removeHTMLWebView() { /***/ }), -/* 56 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findElm; }); -function findVmById(id, vm) { - if (id === vm._$id) { - return vm; - } +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { - var childVms = vm.$children; - var len = childVms.length; +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - for (var i = 0; i < len; i++) { - var childVm = findVmById(id, childVms[i]); +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { - if (childVm) { - return childVm; - } - } -} +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + -function findElm(component, pageVm) { - if (!pageVm) { - return console.error('page is not ready'); - } +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { - if (!component) { - return pageVm.$el; - } +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - if (true) { - if (typeof component === 'string') { - var componentVm = findVmById(component, pageVm); +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { - if (!componentVm) { - throw new Error("Not Found\uFF1APage[".concat(pageVm.$page.id, "][").concat(component, "]")); - } +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - return componentVm.$el; - } - } +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { - return component.$el; -} +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), -/* 57 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ON_PAGE_CREATE; }); -var ON_PAGE_CREATE = 'onPageCreate'; +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), -/* 58 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return definePage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getPageVueComponent; }); -/* unused harmony export createPage */ -/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + -var pageFactory = Object.create(null); -function definePage(name, createPageVueComponent) { - pageFactory[name] = createPageVueComponent; -} -var getPageVueComponent = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* cached */ "a"])(function (pagePath) { - return pageFactory[pagePath](); -}); -function createPage(pagePath, pageId, pageQuery, pageInstance) { - if (!pageFactory[pagePath]) { - console.error("".concat(pagePath, " not found")); - } +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { - var startTime = Date.now(); - var pageVm = new (getPageVueComponent(pagePath))({ - mpType: 'page', - pageId: pageId, - pagePath: pagePath, - pageQuery: pageQuery, - pageInstance: pageInstance - }); +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - if (true) { - console.log("new ".concat(pagePath), Date.now() - startTime); - } +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { - return pageVm; -} +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), -/* 59 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCurrentPages; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setCurrentPage; }); -var pages = []; -function getCurrentPages() { - return pages; -} -function setCurrentPage(pageId, pagePath) { - pages.length = 0; - pages.push({ - $page: { - id: pageId, - route: pagePath - } - }); -} +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), -/* 60 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HTMLParser; }); -/* - * HTML5 Parser By Sam Blowes - * - * Designed for HTML5 documents - * - * Original code by John Resig (ejohn.org) - * http://ejohn.org/blog/pure-javascript-html-parser/ - * Original code by Erik Arvidsson, Mozilla Public License - * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js - * - * ---------------------------------------------------------------------------- - * License - * ---------------------------------------------------------------------------- - * - * This code is triple licensed using Apache Software License 2.0, - * Mozilla Public License or GNU Public License - * - * //////////////////////////////////////////////////////////////////////////// - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy - * of the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * //////////////////////////////////////////////////////////////////////////// - * - * The contents of this file are subject to the Mozilla Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * The Original Code is Simple HTML Parser. - * - * The Initial Developer of the Original Code is Erik Arvidsson. - * Portions created by Erik Arvidssson are Copyright (C) 2004. All Rights - * Reserved. - * - * //////////////////////////////////////////////////////////////////////////// - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * ---------------------------------------------------------------------------- - * Usage - * ---------------------------------------------------------------------------- - * - * // Use like so: - * HTMLParser(htmlString, { - * start: function(tag, attrs, unary) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * // or to get an XML string: - * HTMLtoXML(htmlString); - * - * // or to get an XML DOM Document - * HTMLtoDOM(htmlString); - * - * // or to inject into an existing document/DOM node - * HTMLtoDOM(htmlString, document); - * HTMLtoDOM(htmlString, document.body); - * - */ -// Regular Expressions for parsing tags and attributes -var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/; -var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; -var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5 +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + -var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5 -// fixed by xxx 将 ins 标签从块级名单中移除 +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { -var block = makeMap('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'); // Inline Elements - HTML 5 +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + -var inline = makeMap('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'); // Elements that you can, intentionally, leave open -// (and which close themselves) +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { -var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled" +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + -var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything) +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { -var special = makeMap('script,style'); -function HTMLParser(html, handler) { - var index; - var chars; - var match; - var stack = []; - var last = html; +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - stack.last = function () { - return this[this.length - 1]; - }; +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { - while (html) { - chars = true; // Make sure we're not in a script or style element +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - if (!stack.last() || !special[stack.last()]) { - // Comment - if (html.indexOf(''); +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { - if (index >= 0) { - if (handler.comment) { - handler.comment(html.substring(4, index)); - } +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - html = html.substring(index + 3); - chars = false; - } // end tag +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { - } else if (html.indexOf(']*>'), function (all, text) { - text = text.replace(/|/g, '$1$2'); +var _attrs = ['adpid', 'data']; +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'Ad', + mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], _mixins_native__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]], + props: { + adpid: { + type: [Number, String], + default: '' + }, + data: { + type: Object, + default: null + }, + dataCount: { + type: Number, + default: 5 + }, + channel: { + type: String, + default: '' + } + }, + data: function data() { + return { + hidden: false + }; + }, + computed: { + attrs: function attrs() { + var _this = this; - if (handler.chars) { - handler.chars(text); - } + var obj = {}; - return ''; + _attrs.forEach(function (key) { + var val = _this.$props[key]; + val = key === 'src' ? _this.$getRealPath(val) : val; + obj[key.replace(/[A-Z]/g, function (str) { + return '-' + str.toLowerCase(); + })] = val; }); - parseEndTag('', stack.last()); - } - if (html == last) { - throw 'Parse Error: ' + html; + return obj; } + }, + watch: { + hidden: function hidden(val) { + this.adView && this.adView[val ? 'hide' : 'show'](); + }, + adpid: function adpid(val) { + if (val) { + this._loadData(val); + } + }, + data: function data(val) { + if (val) { + this._fillData(val); + } + } + }, + mounted: function mounted() { + var _this2 = this; - last = html; - } // Clean up any remaining tags - + this._onParentReady(function () { + _this2._adId = 'AdView-' + _this2._newGUID(); + var adStyle = Object.assign({ + id: _this2._adId + }, _this2.position); + var adView = _this2.adView = plus.ad.createAdView(adStyle); + adView.interceptTouchEvent(false); + plus.webview.currentWebview().append(adView); - parseEndTag(); + if (_this2.hidden) { + adView.hide(); + } - function parseStartTag(tag, tagName, rest, unary) { - tagName = tagName.toLowerCase(); + _this2.$watch('attrs', function () { + _this2._request(); + }, { + deep: true + }); - if (block[tagName]) { - while (stack.last() && inline[stack.last()]) { - parseEndTag('', stack.last()); - } - } + _this2.$watch('position', function () { + _this2.adView && _this2.adView.setStyle(_this2.position); + }, { + deep: true + }); // 模板渲染有效 - if (closeSelf[tagName] && stack.last() == tagName) { - parseEndTag('', tagName); - } - unary = empty[tagName] || !!unary; + adView.setDislikeListener && adView.setDislikeListener(function (data) { + _this2.adView && _this2.adView.close(); + _this2.$refs.container.style.height = '0px'; - if (!unary) { - stack.push(tagName); - } + _this2._updateView(); - if (handler.start) { - var attrs = []; - rest.replace(attr, function (match, name) { - var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : ''; - attrs.push({ - name: name, - value: value, - escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // " + _this2.$trigger('close', {}, data); + }); + adView.setRenderingListener && adView.setRenderingListener(function (data) { + if (data.result === 0) { + _this2.$refs.container.style.height = data.height + 'px'; - }); + _this2._updateView(); + } else { + _this2.$trigger('error', {}, { + errCode: data.result + }); + } }); + adView.setAdClickedListener(function (data) { + _this2.$trigger('adclicked', {}, data); + }); + _this2._callbackId = _this2.$page.id + _this2._adId; + UniViewJSBridge.subscribe(_this2._callbackId, _this2._handleAdData.bind(_this2)); - if (handler.start) { - handler.start(tagName, attrs, unary); - } - } - } + _this2._request(); + }); + }, + beforeDestroy: function beforeDestroy() { + this.adView && this.adView.close(); + delete this.adView; + }, + methods: { + _handleAdData: function _handleAdData(_ref) { + var type = _ref.type, + _ref$data = _ref.data, + data = _ref$data === void 0 ? {} : _ref$data; - function parseEndTag(tag, tagName) { - // If no tag name is provided, clean shop - if (!tagName) { - var pos = 0; - } // Find the closest opened tag of the same type - else { - for (var pos = stack.length - 1; pos >= 0; pos--) { - if (stack[pos] == tagName) { - break; - } - } + switch (type) { + case 'success': + this._fillData(data); + + break; + + case 'fail': + this.$trigger('error', {}, data); + break; + } + }, + _request: function _request() { + if (!this.adView) { + return; } - if (pos >= 0) { - // Close all the open elements, up the stack - for (var i = stack.length - 1; i >= pos; i--) { - if (handler.end) { - handler.end(stack[i]); + if (this.data) { + this._fillData(this.data); + } else if (this.adpid) { + this._loadData(); + } + }, + _loadData: function _loadData(adpid) { + var data = { + adpid: adpid || this.adpid, + width: this.position.width, + count: this.dataCount, + ext: { + channel: this.channel } - } // Remove the open elements from the stack + }; + UniViewJSBridge.publishHandler('onAdMethodCallback', { + callbackId: this._callbackId, + data: data + }, this.$page.id); + }, + _fillData: function _fillData(data) { + this.adView.renderingBind(data); + this.$trigger('load', {}, {}); + }, + _updateView: function _updateView() { + window.dispatchEvent(new CustomEvent('updateview')); + }, + _newGUID: function _newGUID() { + var guid = ''; + var format = 'xxxxxxxx-xxxx'; + for (var i = 0; i < format.length; i++) { + if (format[i] === 'x') { + guid += (Math.random() * 16 | 0).toString(16); + } else { + guid += format[i]; + } + } - stack.length = pos; + return guid.toUpperCase(); } } -} -; +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -function makeMap(str) { - var obj = {}; - var items = str.split(','); +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { - for (var i = 0; i < items.length; i++) { - obj[items[i]] = true; - } +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - return obj; -} +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), /* 61 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Friction; }); -function Friction(e) { - this._drag = e; - this._dragLog = Math.log(e); - this._x = 0; - this._v = 0; - this._startTime = 0; -} +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _mixins_native__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// -Friction.prototype.set = function (e, t) { - this._x = e; - this._v = t; - this._startTime = new Date().getTime(); -}; -Friction.prototype.setVelocityByEnd = function (e) { - this._v = (e - this._x) * this._dragLog / (Math.pow(this._drag, 100) - 1); -}; +var methods = ['getCenterLocation', 'moveToLocation', 'getRegion', 'getScale', '$getAppMap']; // const events = [ +// 'markertap', +// 'callouttap', +// 'controltap', +// 'regionchange', +// 'tap', +// 'updated' +// ] -Friction.prototype.x = function (e) { - if (e === undefined) { - e = (new Date().getTime() - this._startTime) / 1e3; - } +var _attrs = ['latitude', 'longitude', 'scale', 'markers', 'polyline', 'circles', 'controls', 'show-location']; - var t; - t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e); - this._dt = e; - return this._x + this._v * t / this._dragLog - this._v / this._dragLog; +var convertCoordinates = function convertCoordinates(lng, lat, callback) { + // plus.maps.Map.convertCoordinates(new plus.maps.Point(lng, lat), { + // coordType: 'gcj02' + // }, callback) + callback({ + coord: { + latitude: lat, + longitude: lng + } + }); }; -Friction.prototype.dx = function (e) { - if (e === undefined) { - e = (new Date().getTime() - this._startTime) / 1e3; +function parseHex(color) { + if (color.indexOf('#') !== 0) { + return { + color: color, + opacity: 1 + }; } - var t; - t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e); - this._dt = e; - return this._v * t; -}; - -Friction.prototype.done = function () { - return Math.abs(this.dx()) < 3; -}; - -Friction.prototype.reconfigure = function (e) { - var t = this.x(); - var n = this.dx(); - this._drag = e; - this._dragLog = Math.log(e); - this.set(t, n); -}; + var opacity = color.substr(7, 2); + return { + color: color.substr(0, 7), + opacity: opacity ? Number('0x' + opacity) / 255 : 1 + }; +} -Friction.prototype.configuration = function () { - var e = this; - return [{ - label: 'Friction', - read: function read() { - return e._drag; +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'Map', + mixins: [uni_mixins__WEBPACK_IMPORTED_MODULE_0__[/* subscriber */ "f"], _mixins_native__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]], + props: { + id: { + type: String, + default: '' }, - write: function write(t) { - e.reconfigure(t); + latitude: { + type: [Number, String], + default: '' }, - min: 0.001, - max: 0.1, - step: 0.001 - }]; -}; - -/***/ }), -/* 62 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + longitude: { + type: [Number, String], + default: '' + }, + scale: { + type: [String, Number], + default: 16 + }, + markers: { + type: Array, + default: function _default() { + return []; + } + }, + polyline: { + type: Array, + default: function _default() { + return []; + } + }, + circles: { + type: Array, + default: function _default() { + return []; + } + }, + controls: { + type: Array, + default: function _default() { + return []; + } + } + }, + data: function data() { + return { + style: { + top: '0px', + left: '0px', + width: '0px', + height: '0px', + position: 'static' + }, + hidden: false + }; + }, + computed: { + attrs: function attrs() { + var _this = this; -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Spring; }); -function o(e, t, n) { - return e > t - n && e < t + n; -} + var obj = {}; -function a(e, t) { - return o(e, 0, t); -} + _attrs.forEach(function (key) { + var val = _this.$props[key]; + val = key === 'src' ? _this.$getRealPath(val) : val; + obj[key.replace(/[A-Z]/g, function (str) { + return '-' + str.toLowerCase(); + })] = val; + }); -function Spring(e, t, n) { - this._m = e; - this._k = t; - this._c = n; - this._solution = null; - this._endPosition = 0; - this._startTime = 0; -} + return obj; + }, + mapControls: function mapControls() { + var _this2 = this; -Spring.prototype._solve = function (e, t) { - var n = this._c; - var i = this._m; - var r = this._k; - var o = n * n - 4 * i * r; + var list = this.controls.map(function (control) { + var position = { + position: 'absolute' + }; + ['top', 'left', 'width', 'height'].forEach(function (key) { + if (control.position[key]) { + position[key] = control.position[key] + 'px'; + } + }); + return { + id: control.id, + iconPath: _this2.$getRealPath(control.iconPath), + position: position + }; + }); + return list; + } + }, + watch: { + hidden: function hidden(val) { + this.map && this.map[val ? 'hide' : 'show'](); + }, + scale: function scale(val) { + this.map && this.map.setZoom(parseInt(val)); + }, + latitude: function latitude(val) { + this.map && this.map.setStyles({ + center: new plus.maps.Point(this.longitude, this.latitude) + }); + }, + longitude: function longitude(val) { + this.map && this.map.setStyles({ + center: new plus.maps.Point(this.longitude, this.latitude) + }); + }, + markers: function markers(val) { + this.map && this._addMarkers(val, true); + }, + polyline: function polyline(val) { + this.map && this._addMapLines(val); + }, + circles: function circles(val) { + this.map && this._addMapCircles(val); + } + }, + mounted: function mounted() { + var _this3 = this; - if (o === 0) { - var _a = -n / (2 * i); + this._onParentReady(function () { + var mapStyle = Object.assign({}, _this3.attrs, _this3.position); - var _s = e; + if (_this3.latitude && _this3.longitude) { + mapStyle.center = new plus.maps.Point(_this3.longitude, _this3.latitude); + } - var _l = t / (_a * e); + var map = _this3.map = plus.maps.create(_this3.$page.id + '-map-' + (_this3.id || Date.now()), mapStyle); + map.__markers__ = []; + map.__markers_map__ = {}; + map.__lines__ = []; + map.__circles__ = []; + map.setZoom(parseInt(_this3.scale)); + plus.webview.currentWebview().append(map); - return { - x: function x(e) { - return (_s + _l * e) * Math.pow(Math.E, _a * e); - }, - dx: function dx(e) { - var t = Math.pow(Math.E, _a * e); - return _a * (_s + _l * e) * t + _l * t; + if (_this3.hidden) { + map.hide(); } - }; - } - if (o > 0) { - var c = (-n - Math.sqrt(o)) / (2 * i); - var u = (-n + Math.sqrt(o)) / (2 * i); - - var _l2 = (t - c * e) / (u - c); + _this3.$watch('position', function () { + _this3.map && _this3.map.setStyles(_this3.position); + }, { + deep: true + }); - var _s2 = e - _l2; + map.onclick = function (e) { + _this3.$trigger('click', {}, e); + }; - return { - x: function x(e) { - var t; - var n; + map.onstatuschanged = function (e) { + _this3.$trigger('regionchange', {}, {}); + }; - if (e === this._t) { - t = this._powER1T; - n = this._powER2T; - } + _this3._addMarkers(_this3.markers); - this._t = e; + _this3._addMapLines(_this3.polyline); - if (!t) { - t = this._powER1T = Math.pow(Math.E, c * e); - } + _this3._addMapCircles(_this3.circles); + }); + }, + beforeDestroy: function beforeDestroy() { + this.map && this.map.close(); + delete this.map; + }, + methods: { + _handleSubscribe: function _handleSubscribe(_ref) { + var type = _ref.type, + _ref$data = _ref.data, + data = _ref$data === void 0 ? {} : _ref$data; - if (!n) { - n = this._powER2T = Math.pow(Math.E, u * e); - } + if (!methods.includes(type)) { + return; + } - return _s2 * t + _l2 * n; - }, - dx: function dx(e) { - var t; - var n; + this.map && this[type](data); + }, + moveToLocation: function moveToLocation(_ref2) { + var callbackId = _ref2.callbackId, + longitude = _ref2.longitude, + latitude = _ref2.latitude; + this.map.setCenter(new plus.maps.Point(longitude || this.longitude, latitude || this.latitude)); - if (e === this._t) { - t = this._powER1T; - n = this._powER2T; - } + this._publishHandler(callbackId, { + errMsg: 'moveToLocation:ok' + }); + }, + getCenterLocation: function getCenterLocation(_ref3) { + var _this4 = this; - this._t = e; + var callbackId = _ref3.callbackId; + this.map.getCurrentCenter(function (state, point) { + _this4._publishHandler(callbackId, { + longitude: point.longitude, + latitude: point.latitude, + errMsg: 'getCenterLocation:ok' + }); + }); + }, + getRegion: function getRegion(_ref4) { + var callbackId = _ref4.callbackId; + var rect = this.map.getBounds(); - if (!t) { - t = this._powER1T = Math.pow(Math.E, c * e); + this._publishHandler(callbackId, { + southwest: rect.southwest, + northeast: rect.northeast || rect.northease, + // 5plus API 名字写错了 + errMsg: 'getRegion:ok' + }); + }, + getScale: function getScale(_ref5) { + var callbackId = _ref5.callbackId; + + this._publishHandler(callbackId, { + scale: this.map.getZoom(), + errMsg: 'getScale:ok' + }); + }, + controlclick: function controlclick(e) { + this.$trigger('controltap', {}, { + controlId: e.id + }); + }, + _publishHandler: function _publishHandler(callbackId, data) { + UniViewJSBridge.publishHandler('onMapMethodCallback', { + callbackId: callbackId, + data: data + }, this.$page.id); + }, + _addMarker: function _addMarker(nativeMap, marker) { + var _this5 = this; + + var id = marker.id, + latitude = marker.latitude, + longitude = marker.longitude, + iconPath = marker.iconPath, + callout = marker.callout, + label = marker.label; + convertCoordinates(longitude, latitude, function (res) { + var _res$coord = res.coord, + latitude = _res$coord.latitude, + longitude = _res$coord.longitude; + var nativeMarker = new plus.maps.Marker(new plus.maps.Point(longitude, latitude)); + + if (iconPath) { + nativeMarker.setIcon(_this5.$getRealPath(iconPath)); } - if (!n) { - n = this._powER2T = Math.pow(Math.E, u * e); + if (label && label.content) { + nativeMarker.setLabel(label.content); } - return _s2 * c * t + _l2 * u * n; - } - }; - } + var nativeBubble = false; - var d = Math.sqrt(4 * i * r - n * n) / (2 * i); - var a = -n / 2 * i; - var s = e; - var l = (t - a * e) / d; - return { - x: function x(e) { - return Math.pow(Math.E, a * e) * (s * Math.cos(d * e) + l * Math.sin(d * e)); - }, - dx: function dx(e) { - var t = Math.pow(Math.E, a * e); - var n = Math.cos(d * e); - var i = Math.sin(d * e); - return t * (l * d * n - s * d * i) + a * t * (l * i + s * n); - } - }; -}; + if (callout && callout.content) { + nativeBubble = new plus.maps.Bubble(callout.content); + } -Spring.prototype.x = function (e) { - if (e === undefined) { - e = (new Date().getTime() - this._startTime) / 1e3; - } + if (nativeBubble) { + nativeMarker.setBubble(nativeBubble); + } - return this._solution ? this._endPosition + this._solution.x(e) : 0; -}; + if (id || id === 0) { + nativeMarker.onclick = function (e) { + _this5.$trigger('markertap', {}, { + markerId: id + }); + }; -Spring.prototype.dx = function (e) { - if (e === undefined) { - e = (new Date().getTime() - this._startTime) / 1e3; - } + if (nativeBubble) { + nativeBubble.onclick = function () { + _this5.$trigger('callouttap', {}, { + markerId: id + }); + }; + } + } - return this._solution ? this._solution.dx(e) : 0; -}; + nativeMap.addOverlay(nativeMarker); -Spring.prototype.setEnd = function (e, t, n) { - if (!n) { - n = new Date().getTime(); - } + nativeMap.__markers__.push(nativeMarker); - if (e !== this._endPosition || !a(t, 0.4)) { - t = t || 0; - var i = this._endPosition; + nativeMap.__markers_map__[id + ''] = nativeMarker; + }); + }, + _clearMarkers: function _clearMarkers() { + var map = this.map; + var markers = map.__markers__; + markers.forEach(function (marker) { + map.removeOverlay(marker); + }); + map.__markers__ = []; + map.__markers_map__ = {}; + }, + _addMarkers: function _addMarkers(markers, clear) { + var _this6 = this; - if (this._solution) { - if (a(t, 0.4)) { - t = this._solution.dx((n - this._startTime) / 1e3); + if (clear) { + this._clearMarkers(); } - i = this._solution.x((n - this._startTime) / 1e3); + markers.forEach(function (marker) { + _this6._addMarker(_this6.map, marker); + }); + }, + _translateMapMarker: function _translateMapMarker(_ref6) { + var autoRotate = _ref6.autoRotate, + callbackId = _ref6.callbackId, + destination = _ref6.destination, + duration = _ref6.duration, + markerId = _ref6.markerId; + var nativeMarker = this.map.__markers_map__[markerId + '']; - if (a(t, 0.4)) { - t = 0; + if (nativeMarker) { + nativeMarker.setPoint(new plus.maps.Point(destination.longitude, destination.latitude)); } + }, + _addMapLines: function _addMapLines(lines) { + var nativeMap = this.map; - if (a(i, 0.4)) { - i = 0; - } + if (nativeMap.__lines__.length > 0) { + nativeMap.__lines__.forEach(function (circle) { + nativeMap.removeOverlay(circle); + }); - i += this._endPosition; - } + nativeMap.__lines__ = []; + } - if (!(this._solution && a(i - e, 0.4) && a(t, 0.4))) { - this._endPosition = e; - this._solution = this._solve(i - this._endPosition, t); - this._startTime = n; - } - } -}; + lines.forEach(function (line) { + var color = line.color, + width = line.width; + var points = line.points.map(function (point) { + return new plus.maps.Point(point.longitude, point.latitude); + }); + var polyline = new plus.maps.Polyline(points); -Spring.prototype.snap = function (e) { - this._startTime = new Date().getTime(); - this._endPosition = e; - this._solution = { - x: function x() { - return 0; - }, - dx: function dx() { - return 0; - } - }; -}; + if (color) { + var strokeStyle = parseHex(color); + polyline.setStrokeColor(strokeStyle.color); + polyline.setStrokeOpacity(strokeStyle.opacity); + } -Spring.prototype.done = function (e) { - if (!e) { - e = new Date().getTime(); - } + if (width) { + polyline.setLineWidth(width); + } - return o(this.x(), this._endPosition, 0.4) && a(this.dx(), 0.4); -}; + nativeMap.addOverlay(polyline); -Spring.prototype.reconfigure = function (e, t, n) { - this._m = e; - this._k = t; - this._c = n; + nativeMap.__lines__.push(polyline); + }); + }, + _addMapCircles: function _addMapCircles(circles) { + var nativeMap = this.map; - if (!this.done()) { - this._solution = this._solve(this.x() - this._endPosition, this.dx()); - this._startTime = new Date().getTime(); - } -}; + if (nativeMap.__circles__.length > 0) { + nativeMap.__circles__.forEach(function (circle) { + nativeMap.removeOverlay(circle); + }); -Spring.prototype.springConstant = function () { - return this._k; -}; + nativeMap.__circles__ = []; + } -Spring.prototype.damping = function () { - return this._c; -}; + circles.forEach(function (circle) { + var latitude = circle.latitude, + longitude = circle.longitude, + color = circle.color, + fillColor = circle.fillColor, + radius = circle.radius, + strokeWidth = circle.strokeWidth; + var nativeCircle = new plus.maps.Circle(new plus.maps.Point(longitude, latitude), radius); -Spring.prototype.configuration = function () { - function e(e, t) { - e.reconfigure(1, t, e.damping()); - } + if (color) { + var strokeStyle = parseHex(color); + nativeCircle.setStrokeColor(strokeStyle.color); + nativeCircle.setStrokeOpacity(strokeStyle.opacity); + } - function t(e, t) { - e.reconfigure(1, e.springConstant(), t); + if (fillColor) { + var fillStyle = parseHex(fillColor); + nativeCircle.setFillColor(fillStyle.color); + nativeCircle.setFillOpacity(fillStyle.opacity); + } + + if (strokeWidth) { + nativeCircle.setLineWidth(strokeWidth); + } + + nativeMap.addOverlay(nativeCircle); + + nativeMap.__circles__.push(nativeCircle); + }); + } } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - return [{ - label: 'Spring Constant', - read: this.springConstant.bind(this), - write: e.bind(this, this), - min: 100, - max: 1e3 - }, { - label: 'Damping', - read: this.damping.bind(this), - write: t.bind(this, this), - min: 1, - max: 500 - }]; -}; +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + /***/ }), /* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + + +/***/ }), +/* 65 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -var base = ['borderRadius', 'borderColor', 'borderWidth', 'backgroundColor']; -var text = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'color', 'textAlign', 'lineHeight', 'fontSize', 'fontWeight', 'textOverflow', 'whiteSpace']; -var image = []; -var textAlign = { - start: 'left', - end: 'right' -}; -var index = 0; -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Cover', - data: function data() { - return { - style: {} - }; - }, - computed: { - viewPosition: function viewPosition() { - var position = {}; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17); +// +// +// - for (var key in this.position) { - var val = this.position[key]; - var valNumber = parseFloat(val); - var parentValNumber = parseFloat(this._nativeParent.position[key]); - if (key === 'top' || key === 'left') { - val = Math.max(valNumber, parentValNumber) + 'px'; - } else if (key === 'width' || key === 'height') { - var _base = key === 'width' ? 'left' : 'left'; +var webview = false; - var parentStart = parseFloat(this._nativeParent.position[_base]); - var viewStart = parseFloat(this.position[_base]); - var diff1 = Math.max(parentStart - viewStart, 0); - var diff2 = Math.max(viewStart + valNumber - (parentStart + parentValNumber), 0); - val = Math.max(valNumber - diff1 - diff2, 0) + 'px'; - } +var insertHTMLWebView = function insertHTMLWebView(_ref) { + var htmlId = _ref.htmlId; + var parentWebview = plus.webview.currentWebview(); // fixed by hxy web-view 组件所在的 webview 不注入 uni-app 框架 - position[key] = val; - } + var styles = { + 'uni-app': 'none', + isUniH5: true + }; + var parentTitleNView = parentWebview.getTitleNView(); - return position; - }, - tags: function tags() { - var position = this._getTagPosition(); + if (parentTitleNView) { + if (plus.navigator.isImmersedStatusbar()) { + styles.top = uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* NAVBAR_HEIGHT */ "a"] + plus.navigator.getStatusbarHeight(); + } else { + styles.top = uni_helpers_constants__WEBPACK_IMPORTED_MODULE_1__[/* NAVBAR_HEIGHT */ "a"]; + } - var style = this.style; - var tags = [{ - tag: 'rect', - position: position, - rectStyles: { - color: style.backgroundColor, - radius: style.borderRadius, - borderColor: style.borderColor, - borderWidth: style.borderWidth + styles.bottom = 0; + } + + webview = plus.webview.create('', htmlId, styles); + + if (parentTitleNView) { + webview.addEventListener('titleUpdate', function () { + var title = webview.getTitle(); + parentWebview.setStyle({ + titleNView: { + // iOS titleText 为空字符串时 按钮会隐藏 + titleText: !title || title === 'null' ? ' ' : title } - }]; + }); + }); + } - if (this.coverType === 'image') { - tags.push({ - tag: 'img', - position: position, - src: this.coverContent - }); - } else { - var lineSpacing = parseFloat(style.lineHeight) - parseFloat(style.fontSize); - var width = parseFloat(position.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight); - width = width < 0 ? 0 : width; - var height = parseFloat(position.height) - parseFloat(style.paddingTop) - lineSpacing / 2 - parseFloat(style.paddingBottom); - height = height < 0 ? 0 : height; - tags.push({ - tag: 'font', - position: { - top: "".concat(parseFloat(position.top) + parseFloat(style.paddingTop) + lineSpacing / 2, "px"), - left: "".concat(parseFloat(position.left) + parseFloat(style.paddingLeft), "px"), - width: "".concat(width, "px"), - height: "".concat(height, "px") - }, - textStyles: { - align: textAlign[style.textAlign] || style.textAlign, - color: style.color, - decoration: 'none', - lineSpacing: "".concat(lineSpacing, "px"), - margin: '0px', - overflow: style.textOverflow, - size: style.fontSize, - verticalAlign: 'top', - weight: style.fontWeight, - whiteSpace: style.whiteSpace - }, - text: this.coverContent - }); + plus.webview.currentWebview().append(webview); +}; + +var updateHTMLWebView = function updateHTMLWebView(_ref2) { + var htmlId = _ref2.htmlId, + src = _ref2.src, + webviewStyles = _ref2.webviewStyles; + // fixed by xxx 非空时才执行更新操作 + var realPath = src || ''; + + if (!realPath) { + return; + } + + if (/^(http|https):\/\//.test(realPath) && webviewStyles.progress) { + webview.setStyle({ + progress: { + color: webviewStyles.progress.color } + }); + } - return tags; + webview.loadURL(realPath); +}; + +var removeHTMLWebView = function removeHTMLWebView() { + plus.webview.currentWebview().remove(webview); + webview.close('none'); + webview = false; +}; + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'WebView', + props: { + src: { + type: String, + default: '' + }, + webviewStyles: { + type: Object, + default: function _default() { + return {}; + } } }, - created: function created() { - var $parent = this.$parent; - - while (!$parent.isNative && $parent !== this.$root) { - $parent = $parent.$parent; + watch: { + src: function src(val, oldVal) { + webview && updateHTMLWebView({ + src: this.$getRealPath(val), + webviewStyles: this.webviewStyles + }); } - - this._nativeParent = $parent; }, mounted: function mounted() { var _this = this; - this._updateStyle(); - - var $nativeParent = this._nativeParent; - - if ($nativeParent.isNative) { - if ($nativeParent._isMounted) { - this._onCanInsert(); - } else { - $nativeParent.onCanInsertCallbacks.push(function () { - _this._onCanInsert(); - }); - } - - this.$watch('hidden', function (val) { - _this.cover && _this.cover[val ? 'hide' : 'show'](); - }); - this.$watch('viewPosition', function (val) { - _this.cover && _this.cover.setStyle(val); - }, { - deep: true + this._onParentReady(function () { + _this.htmlId = _constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_ID_PREFIX */ "k"] + _this.$page.id; + insertHTMLWebView({ + htmlId: _this.htmlId }); - this.$watch('tags', function () { - var cover = _this.cover; - - if (cover) { - cover.reset(); - cover.draw(_this.tags); - } - }, { - deep: true + updateHTMLWebView({ + src: _this.$getRealPath(_this.src), + webviewStyles: _this.webviewStyles }); - this.$on('uni-view-update', this._requestStyleUpdate); - } + UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_INSERTED */ "l"], {}, _this.$page.id); + }); }, beforeDestroy: function beforeDestroy() { - if (this._nativeParent.isNative) { - this.cover && this.cover.close(); - delete this.cover; - } - }, - methods: { - _onCanInsert: function _onCanInsert() { - var _this2 = this; + removeHTMLWebView(); + UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* WEBVIEW_REMOVED */ "n"], {}, this.$page.id); + } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - var cover = this.cover = new plus.nativeObj.View("cover-".concat(Date.now(), "-").concat(index++), this.viewPosition, this.tags); - plus.webview.currentWebview().append(cover); +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { - if (this.hidden) { - cover.hide(); - } +// extracted by mini-css-extract-plugin + if(false) { var cssReload; } + - cover.addEventListener('click', function () { - _this2.$trigger('click', {}, {}); - }); - }, - _getTagPosition: function _getTagPosition() { - var position = {}; +/***/ }), +/* 67 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - for (var key in this.position) { - var val = this.position[key]; +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ON_PAGE_CREATE; }); +var ON_PAGE_CREATE = 'onPageCreate'; - if (key === 'top' || key === 'left') { - val = Math.min(parseFloat(val) - parseFloat(this._nativeParent.position[key]), 0) + 'px'; - } +/***/ }), +/* 68 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - position[key] = val; - } +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return definePage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getPageVueComponent; }); +/* unused harmony export createPage */ +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); - return position; - }, - _updateStyle: function _updateStyle() { - var _this3 = this; +var pageFactory = Object.create(null); +function definePage(name, createPageVueComponent) { + pageFactory[name] = createPageVueComponent; +} +var getPageVueComponent = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* cached */ "a"])(function (pagePath) { + return pageFactory[pagePath](); +}); +function createPage(pagePath, pageId, pageQuery, pageInstance) { + if (!pageFactory[pagePath]) { + console.error("".concat(pagePath, " not found")); + } - var style = getComputedStyle(this.$el); - base.concat(text, image).forEach(function (key) { - _this3.style[key] = style[key]; - }); - }, - _requestStyleUpdate: function _requestStyleUpdate() { - var _this4 = this; + var startTime = Date.now(); + var pageVm = new (getPageVueComponent(pagePath))({ + mpType: 'page', + pageId: pageId, + pagePath: pagePath, + pageQuery: pageQuery, + pageInstance: pageInstance + }); - if (this._styleUpdateRequest) { - cancelAnimationFrame(this._styleUpdateRequest); - } + if (true) { + console.log("new ".concat(pagePath, "[").concat(pageId, "]:time(").concat(Date.now() - startTime, ")")); + } - this._styleUpdateRequest = requestAnimationFrame(function () { - delete _this4._styleUpdateRequest; + return pageVm; +} - _this4._updateStyle(); - }); +/***/ }), +/* 69 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCurrentPages; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setCurrentPage; }); +var pages = []; +function getCurrentPages() { + return pages; +} +function setCurrentPage(pageId, pagePath) { + pages.length = 0; + pages.push({ + $page: { + id: pageId, + route: pagePath } - } -}); + }); +} /***/ }), -/* 64 */ +/* 70 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return HTMLParser; }); +/* + * HTML5 Parser By Sam Blowes + * + * Designed for HTML5 documents + * + * Original code by John Resig (ejohn.org) + * http://ejohn.org/blog/pure-javascript-html-parser/ + * Original code by Erik Arvidsson, Mozilla Public License + * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js + * + * ---------------------------------------------------------------------------- + * License + * ---------------------------------------------------------------------------- + * + * This code is triple licensed using Apache Software License 2.0, + * Mozilla Public License or GNU Public License + * + * //////////////////////////////////////////////////////////////////////////// + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * //////////////////////////////////////////////////////////////////////////// + * + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * + * The Original Code is Simple HTML Parser. + * + * The Initial Developer of the Original Code is Erik Arvidsson. + * Portions created by Erik Arvidssson are Copyright (C) 2004. All Rights + * Reserved. + * + * //////////////////////////////////////////////////////////////////////////// + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ---------------------------------------------------------------------------- + * Usage + * ---------------------------------------------------------------------------- + * + * // Use like so: + * HTMLParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + * // or to get an XML string: + * HTMLtoXML(htmlString); + * + * // or to get an XML DOM Document + * HTMLtoDOM(htmlString); + * + * // or to inject into an existing document/DOM node + * HTMLtoDOM(htmlString, document); + * HTMLtoDOM(htmlString, document.body); + * + */ +// Regular Expressions for parsing tags and attributes +var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/; +var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; +var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5 -// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Friction.js -var Friction = __webpack_require__(61); - -// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Spring.js -var Spring = __webpack_require__(62); +var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5 +// fixed by xxx 将 ins 标签从块级名单中移除 -// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroll.js +var block = makeMap('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'); // Inline Elements - HTML 5 +var inline = makeMap('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'); // Elements that you can, intentionally, leave open +// (and which close themselves) -function Scroll(extent, friction, spring) { - this._extent = extent; - this._friction = friction || new Friction["a" /* Friction */](0.01); - this._spring = spring || new Spring["a" /* Spring */](1, 90, 20); - this._startTime = 0; - this._springing = false; - this._springOffset = 0; -} +var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled" -Scroll.prototype.snap = function (e, t) { - this._springOffset = 0; - this._springing = true; +var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything) - this._spring.snap(e); +var special = makeMap('script,style'); +function HTMLParser(html, handler) { + var index; + var chars; + var match; + var stack = []; + var last = html; - this._spring.setEnd(t); -}; + stack.last = function () { + return this[this.length - 1]; + }; -Scroll.prototype.set = function (e, t) { - this._friction.set(e, t); + while (html) { + chars = true; // Make sure we're not in a script or style element - if (e > 0 && t >= 0) { - this._springOffset = 0; - this._springing = true; + if (!stack.last() || !special[stack.last()]) { + // Comment + if (html.indexOf(''); - this._spring.snap(e); + if (index >= 0) { + if (handler.comment) { + handler.comment(html.substring(4, index)); + } - this._spring.setEnd(0); - } else { - if (e < -this._extent && t <= 0) { - this._springOffset = 0; - this._springing = true; + html = html.substring(index + 3); + chars = false; + } // end tag - this._spring.snap(e); + } else if (html.indexOf(']*>'), function (all, text) { + text = text.replace(/|/g, '$1$2'); - if (t > 0 && n >= 0 || t < -this._extent && n <= 0) { - this._springing = true; + if (handler.chars) { + handler.chars(text); + } - this._spring.setEnd(0, n); + return ''; + }); + parseEndTag('', stack.last()); + } - if (t < -this._extent) { - this._springOffset = -this._extent; - } else { - this._springOffset = 0; + if (html == last) { + throw 'Parse Error: ' + html; } - t = this._spring.x() + this._springOffset; - } + last = html; + } // Clean up any remaining tags - return t; -}; -Scroll.prototype.dx = function (e) { - var t = 0; - t = this._lastTime === e ? this._lastDx : this._springing ? this._spring.dx(e) : this._friction.dx(e); - this._lastTime = e; - this._lastDx = t; - return t; -}; + parseEndTag(); -Scroll.prototype.done = function () { - return this._springing ? this._spring.done() : this._friction.done(); -}; + function parseStartTag(tag, tagName, rest, unary) { + tagName = tagName.toLowerCase(); -Scroll.prototype.setVelocityByEnd = function (e) { - this._friction.setVelocityByEnd(e); -}; + if (block[tagName]) { + while (stack.last() && inline[stack.last()]) { + parseEndTag('', stack.last()); + } + } -Scroll.prototype.configuration = function () { - var e = this._friction.configuration(); + if (closeSelf[tagName] && stack.last() == tagName) { + parseEndTag('', tagName); + } - e.push.apply(e, this._spring.configuration()); - return e; -}; -// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroller.js + unary = empty[tagName] || !!unary; + if (!unary) { + stack.push(tagName); + } -function i(scroll, t, n) { - function i(t, scroll, r, o) { - if (!t || !t.cancelled) { - r(scroll); - var a = scroll.done(); + if (handler.start) { + var attrs = []; + rest.replace(attr, function (match, name) { + var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : ''; + attrs.push({ + name: name, + value: value, + escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // " - if (!a) { - if (!t.cancelled) { - t.id = requestAnimationFrame(i.bind(null, t, scroll, r, o)); - } - } + }); + }); - if (a && o) { - o(scroll); + if (handler.start) { + handler.start(tagName, attrs, unary); } } } - function r(scroll) { - if (scroll && scroll.id) { - cancelAnimationFrame(scroll.id); - } + function parseEndTag(tag, tagName) { + // If no tag name is provided, clean shop + if (!tagName) { + var pos = 0; + } // Find the closest opened tag of the same type + else { + for (var pos = stack.length - 1; pos >= 0; pos--) { + if (stack[pos] == tagName) { + break; + } + } + } - if (scroll) { - scroll.cancelled = true; + if (pos >= 0) { + // Close all the open elements, up the stack + for (var i = stack.length - 1; i >= pos; i--) { + if (handler.end) { + handler.end(stack[i]); + } + } // Remove the open elements from the stack + + + stack.length = pos; } } - - var o = { - id: 0, - cancelled: false - }; - i(o, scroll, t, n); - return { - cancel: r.bind(null, o), - model: scroll - }; } +; -function Scroller(element, options) { - options = options || {}; - this._element = element; - this._options = options; - this._enableSnap = options.enableSnap || false; - this._itemSize = options.itemSize || 0; - this._enableX = options.enableX || false; - this._enableY = options.enableY || false; - this._shouldDispatchScrollEvent = !!options.onScroll; +function makeMap(str) { + var obj = {}; + var items = str.split(','); - if (this._enableX) { - this._extent = (options.scrollWidth || this._element.offsetWidth) - this._element.parentElement.offsetWidth; - this._scrollWidth = options.scrollWidth; - } else { - this._extent = (options.scrollHeight || this._element.offsetHeight) - this._element.parentElement.offsetHeight; - this._scrollHeight = options.scrollHeight; + for (var i = 0; i < items.length; i++) { + obj[items[i]] = true; } - this._position = 0; - this._scroll = new Scroll(this._extent, options.friction, options.spring); - this._onTransitionEnd = this.onTransitionEnd.bind(this); - this.updatePosition(); + return obj; } -Scroller.prototype.onTouchStart = function () { - this._startPosition = this._position; - this._lastChangePos = this._startPosition; - - if (this._startPosition > 0) { - this._startPosition /= 0.5; - } else { - if (this._startPosition < -this._extent) { - this._startPosition = (this._startPosition + this._extent) / 0.5 - this._extent; - } - } - - if (this._animation) { - this._animation.cancel(); +/***/ }), +/* 71 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - this._scrolling = false; - } +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Friction; }); +function Friction(e) { + this._drag = e; + this._dragLog = Math.log(e); + this._x = 0; + this._v = 0; + this._startTime = 0; +} - this.updatePosition(); +Friction.prototype.set = function (e, t) { + this._x = e; + this._v = t; + this._startTime = new Date().getTime(); }; -Scroller.prototype.onTouchMove = function (x, y) { - var startPosition = this._startPosition; +Friction.prototype.setVelocityByEnd = function (e) { + this._v = (e - this._x) * this._dragLog / (Math.pow(this._drag, 100) - 1); +}; - if (this._enableX) { - startPosition += x; - } else if (this._enableY) { - startPosition += y; +Friction.prototype.x = function (e) { + if (e === undefined) { + e = (new Date().getTime() - this._startTime) / 1e3; } - if (startPosition > 0) { - startPosition *= 0.5; - } else if (startPosition < -this._extent) { - startPosition = 0.5 * (startPosition + this._extent) - this._extent; + var t; + t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e); + this._dt = e; + return this._x + this._v * t / this._dragLog - this._v / this._dragLog; +}; + +Friction.prototype.dx = function (e) { + if (e === undefined) { + e = (new Date().getTime() - this._startTime) / 1e3; } - this._position = startPosition; - this.updatePosition(); - this.dispatchScroll(); + var t; + t = e === this._dt && this._powDragDt ? this._powDragDt : this._powDragDt = Math.pow(this._drag, e); + this._dt = e; + return this._v * t; }; -Scroller.prototype.onTouchEnd = function (e, r, o) { - var _this = this; +Friction.prototype.done = function () { + return Math.abs(this.dx()) < 3; +}; - if (this._enableSnap && this._position > -this._extent && this._position < 0) { - if (this._enableY && (Math.abs(r) < this._itemSize && Math.abs(o.y) < 300 || Math.abs(o.y) < 150)) { - this.snap(); - return; - } +Friction.prototype.reconfigure = function (e) { + var t = this.x(); + var n = this.dx(); + this._drag = e; + this._dragLog = Math.log(e); + this.set(t, n); +}; - if (this._enableX && (Math.abs(e) < this._itemSize && Math.abs(o.x) < 300 || Math.abs(o.x) < 150)) { - this.snap(); - return; - } - } +Friction.prototype.configuration = function () { + var e = this; + return [{ + label: 'Friction', + read: function read() { + return e._drag; + }, + write: function write(t) { + e.reconfigure(t); + }, + min: 0.001, + max: 0.1, + step: 0.001 + }]; +}; - if (this._enableX) { - this._scroll.set(this._position, o.x); - } else if (this._enableY) { - this._scroll.set(this._position, o.y); - } +/***/ }), +/* 72 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (this._enableSnap) { - var s = this._scroll._friction.x(100); +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Spring; }); +function o(e, t, n) { + return e > t - n && e < t + n; +} - var l = s % this._itemSize; - var c = Math.abs(l) > this._itemSize / 2 ? s - (this._itemSize - Math.abs(l)) : s - l; +function a(e, t) { + return o(e, 0, t); +} - if (c <= 0 && c >= -this._extent) { - this._scroll.setVelocityByEnd(c); - } - } +function Spring(e, t, n) { + this._m = e; + this._k = t; + this._c = n; + this._solution = null; + this._endPosition = 0; + this._startTime = 0; +} - this._lastTime = Date.now(); - this._lastDelay = 0; - this._scrolling = true; - this._lastChangePos = this._position; - this._lastIdx = Math.floor(Math.abs(this._position / this._itemSize)); - this._animation = i(this._scroll, function () { - var e = Date.now(); - var i = (e - _this._scroll._startTime) / 1e3; +Spring.prototype._solve = function (e, t) { + var n = this._c; + var i = this._m; + var r = this._k; + var o = n * n - 4 * i * r; - var r = _this._scroll.x(i); + if (o === 0) { + var _a = -n / (2 * i); - _this._position = r; + var _s = e; - _this.updatePosition(); + var _l = t / (_a * e); - var o = _this._scroll.dx(i); + return { + x: function x(e) { + return (_s + _l * e) * Math.pow(Math.E, _a * e); + }, + dx: function dx(e) { + var t = Math.pow(Math.E, _a * e); + return _a * (_s + _l * e) * t + _l * t; + } + }; + } - if (_this._shouldDispatchScrollEvent && e - _this._lastTime > _this._lastDelay) { - _this.dispatchScroll(); + if (o > 0) { + var c = (-n - Math.sqrt(o)) / (2 * i); + var u = (-n + Math.sqrt(o)) / (2 * i); - _this._lastDelay = Math.abs(2e3 / o); - _this._lastTime = e; - } - }, function () { - if (_this._enableSnap) { - if (c <= 0 && c >= -_this._extent) { - _this._position = c; + var _l2 = (t - c * e) / (u - c); - _this.updatePosition(); - } + var _s2 = e - _l2; - if (typeof _this._options.onSnap === 'function') { - _this._options.onSnap(Math.floor(Math.abs(_this._position) / _this._itemSize)); - } - } + return { + x: function x(e) { + var t; + var n; - if (_this._shouldDispatchScrollEvent) { - _this.dispatchScroll(); - } + if (e === this._t) { + t = this._powER1T; + n = this._powER2T; + } - _this._scrolling = false; - }); -}; + this._t = e; -Scroller.prototype.onTransitionEnd = function () { - this._element.style.transition = ''; - this._element.style.webkitTransition = ''; + if (!t) { + t = this._powER1T = Math.pow(Math.E, c * e); + } - this._element.removeEventListener('transitionend', this._onTransitionEnd); + if (!n) { + n = this._powER2T = Math.pow(Math.E, u * e); + } - this._element.removeEventListener('webkitTransitionEnd', this._onTransitionEnd); + return _s2 * t + _l2 * n; + }, + dx: function dx(e) { + var t; + var n; - if (this._snapping) { - this._snapping = false; - } + if (e === this._t) { + t = this._powER1T; + n = this._powER2T; + } - this.dispatchScroll(); -}; + this._t = e; -Scroller.prototype.snap = function () { - var e = this._itemSize; - var t = this._position % e; - var i = Math.abs(t) > this._itemSize / 2 ? this._position - (e - Math.abs(t)) : this._position - t; + if (!t) { + t = this._powER1T = Math.pow(Math.E, c * e); + } - if (this._position !== i) { - this._snapping = true; - this.scrollTo(-i); + if (!n) { + n = this._powER2T = Math.pow(Math.E, u * e); + } - if (typeof this._options.onSnap === 'function') { - this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize)); - } + return _s2 * c * t + _l2 * u * n; + } + }; } -}; -Scroller.prototype.scrollTo = function (e, t) { - if (this._animation) { - this._animation.cancel(); + var d = Math.sqrt(4 * i * r - n * n) / (2 * i); + var a = -n / 2 * i; + var s = e; + var l = (t - a * e) / d; + return { + x: function x(e) { + return Math.pow(Math.E, a * e) * (s * Math.cos(d * e) + l * Math.sin(d * e)); + }, + dx: function dx(e) { + var t = Math.pow(Math.E, a * e); + var n = Math.cos(d * e); + var i = Math.sin(d * e); + return t * (l * d * n - s * d * i) + a * t * (l * i + s * n); + } + }; +}; - this._scrolling = false; +Spring.prototype.x = function (e) { + if (e === undefined) { + e = (new Date().getTime() - this._startTime) / 1e3; } - if (typeof e === 'number') { - this._position = -e; + return this._solution ? this._endPosition + this._solution.x(e) : 0; +}; + +Spring.prototype.dx = function (e) { + if (e === undefined) { + e = (new Date().getTime() - this._startTime) / 1e3; } - if (this._position < -this._extent) { - this._position = -this._extent; - } else { - if (this._position > 0) { - this._position = 0; - } + return this._solution ? this._solution.dx(e) : 0; +}; + +Spring.prototype.setEnd = function (e, t, n) { + if (!n) { + n = new Date().getTime(); } - this._element.style.transition = 'transform ' + (t || 0.2) + 's ease-out'; - this._element.style.webkitTransition = '-webkit-transform ' + (t || 0.2) + 's ease-out'; - this.updatePosition(); + if (e !== this._endPosition || !a(t, 0.4)) { + t = t || 0; + var i = this._endPosition; - this._element.addEventListener('transitionend', this._onTransitionEnd); + if (this._solution) { + if (a(t, 0.4)) { + t = this._solution.dx((n - this._startTime) / 1e3); + } - this._element.addEventListener('webkitTransitionEnd', this._onTransitionEnd); -}; + i = this._solution.x((n - this._startTime) / 1e3); -Scroller.prototype.dispatchScroll = function () { - if (typeof this._options.onScroll === 'function' && Math.round(this._lastPos) !== Math.round(this._position)) { - this._lastPos = this._position; - var e = { - 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 + if (a(t, 0.4)) { + t = 0; } - }; - this._options.onScroll(e); - } -}; + if (a(i, 0.4)) { + i = 0; + } -Scroller.prototype.update = function (e, t, n) { - var i = 0; - var r = this._position; + i += this._endPosition; + } - if (this._enableX) { - i = this._element.childNodes.length ? (t || this._element.offsetWidth) - this._element.parentElement.offsetWidth : 0; - this._scrollWidth = t; - } else { - i = this._element.childNodes.length ? (t || this._element.offsetHeight) - this._element.parentElement.offsetHeight : 0; - this._scrollHeight = t; + if (!(this._solution && a(i - e, 0.4) && a(t, 0.4))) { + this._endPosition = e; + this._solution = this._solve(i - this._endPosition, t); + this._startTime = n; + } } +}; - if (typeof e === 'number') { - this._position = -e; - } - - if (this._position < -i) { - this._position = -i; - } else { - if (this._position > 0) { - this._position = 0; +Spring.prototype.snap = function (e) { + this._startTime = new Date().getTime(); + this._endPosition = e; + this._solution = { + x: function x() { + return 0; + }, + dx: function dx() { + return 0; } + }; +}; + +Spring.prototype.done = function (e) { + if (!e) { + e = new Date().getTime(); } - this._itemSize = n || this._itemSize; - this.updatePosition(); + return o(this.x(), this._endPosition, 0.4) && a(this.dx(), 0.4); +}; - if (r !== this._position) { - this.dispatchScroll(); +Spring.prototype.reconfigure = function (e, t, n) { + this._m = e; + this._k = t; + this._c = n; - if (typeof this._options.onSnap === 'function') { - this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize)); - } + if (!this.done()) { + this._solution = this._solve(this.x() - this._endPosition, this.dx()); + this._startTime = new Date().getTime(); } +}; - this._extent = i; - this._scroll._extent = i; +Spring.prototype.springConstant = function () { + return this._k; }; -Scroller.prototype.updatePosition = function () { - var transform = ''; +Spring.prototype.damping = function () { + return this._c; +}; - if (this._enableX) { - transform = 'translateX(' + this._position + 'px) translateZ(0)'; - } else { - if (this._enableY) { - transform = 'translateY(' + this._position + 'px) translateZ(0)'; - } +Spring.prototype.configuration = function () { + function e(e, t) { + e.reconfigure(1, t, e.damping()); } - this._element.style.webkitTransform = transform; - this._element.style.transform = transform; + function t(e, t) { + e.reconfigure(1, e.springConstant(), t); + } + + return [{ + label: 'Spring Constant', + read: this.springConstant.bind(this), + write: e.bind(this, this), + min: 100, + max: 1e3 + }, { + label: 'Damping', + read: this.damping.bind(this), + write: t.bind(this, this), + min: 1, + max: 500 + }]; }; -Scroller.prototype.isScrolling = function () { - return this._scrolling || this._snapping; +/***/ }), +/* 73 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var base = ['borderRadius', 'borderColor', 'borderWidth', 'backgroundColor']; +var text = ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'color', 'textAlign', 'lineHeight', 'fontSize', 'fontWeight', 'textOverflow', 'whiteSpace']; +var image = []; +var textAlign = { + start: 'left', + end: 'right' }; -// CONCATENATED MODULE: ./src/core/view/mixins/scroller/index.js +var index = 0; +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'Cover', + data: function data() { + return { + style: {}, + parentPosition: {} + }; + }, + computed: { + viewPosition: function viewPosition() { + var position = {}; -/* harmony default export */ var scroller = __webpack_exports__["a"] = ({ - methods: { - initScroller: function initScroller(element, options) { - this._touchInfo = { - trackingID: -1, - maxDy: 0, - maxDx: 0 - }; - this._scroller = new Scroller(element, options); - this.__handleTouchStart = this._handleTouchStart.bind(this); - this.__handleTouchMove = this._handleTouchMove.bind(this); - this.__handleTouchEnd = this._handleTouchEnd.bind(this); - this._initedScroller = true; - }, - _findDelta: function _findDelta(event) { - var touchInfo = this._touchInfo; - return event.detail.state === 'move' || event.detail.state === 'end' ? { - x: event.detail.dx, - y: event.detail.dy - } : { - x: event.screenX - touchInfo.x, - y: event.screenY - touchInfo.y - }; - }, - _handleTouchStart: function _handleTouchStart(e) { - var t = this._touchInfo; - var n = this._scroller; + for (var key in this.position) { + var val = this.position[key]; + var valNumber = parseFloat(val); + var parentValNumber = parseFloat(this.parentPosition[key]); - if (n) { - if (e.detail.state === 'start') { - t.trackingID = 'touch'; - t.x = e.detail.x; - t.y = e.detail.y; - } else { - t.trackingID = 'mouse'; - t.x = e.screenX; - t.y = e.screenY; + if (key === 'top' || key === 'left') { + val = Math.max(valNumber, parentValNumber) + 'px'; + } else if (key === 'width' || key === 'height') { + var _base = key === 'width' ? 'left' : 'top'; + + var parentStart = parseFloat(this.parentPosition[_base]); + var viewStart = parseFloat(this.position[_base]); + var diff1 = Math.max(parentStart - viewStart, 0); + var diff2 = Math.max(viewStart + valNumber - (parentStart + parentValNumber), 0); + val = Math.max(valNumber - diff1 - diff2, 0) + 'px'; } - t.maxDx = 0; - t.maxDy = 0; - t.historyX = [0]; - t.historyY = [0]; - t.historyTime = [e.detail.timeStamp]; - t.listener = n; + position[key] = val; + } - if (n.onTouchStart) { - n.onTouchStart(); + return position; + }, + tags: function tags() { + var position = this._getTagPosition(); + + var style = this.style; + var tags = [{ + tag: 'rect', + position: position, + rectStyles: { + color: style.backgroundColor, + radius: style.borderRadius, + borderColor: style.borderColor, + borderWidth: style.borderWidth } + }]; - event.preventDefault(); + if (this.coverType === 'image') { + tags.push({ + tag: 'img', + position: position, + src: this.coverContent + }); + } else { + var lineSpacing = parseFloat(style.lineHeight) - parseFloat(style.fontSize); + var width = parseFloat(position.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight); + width = width < 0 ? 0 : width; + var height = parseFloat(position.height) - parseFloat(style.paddingTop) - lineSpacing / 2 - parseFloat(style.paddingBottom); + height = height < 0 ? 0 : height; + tags.push({ + tag: 'font', + position: { + top: "".concat(parseFloat(position.top) + parseFloat(style.paddingTop) + lineSpacing / 2, "px"), + left: "".concat(parseFloat(position.left) + parseFloat(style.paddingLeft), "px"), + width: "".concat(width, "px"), + height: "".concat(height, "px") + }, + textStyles: { + align: textAlign[style.textAlign] || style.textAlign, + color: style.color, + decoration: 'none', + lineSpacing: "".concat(lineSpacing, "px"), + margin: '0px', + overflow: style.textOverflow, + size: style.fontSize, + verticalAlign: 'top', + weight: style.fontWeight, + whiteSpace: style.whiteSpace + }, + text: this.coverContent + }); } - }, - _handleTouchMove: function _handleTouchMove(event) { - var touchInfo = this._touchInfo; - if (touchInfo.trackingID !== -1) { - event.preventDefault(); + return tags; + } + }, + created: function created() { + var $parent = this.$parent; - var delta = this._findDelta(event); + while (!$parent.isNative && $parent !== this.$root) { + $parent = $parent.$parent; + } - if (delta) { - for (touchInfo.maxDy = Math.max(touchInfo.maxDy, Math.abs(delta.y)), touchInfo.maxDx = Math.max(touchInfo.maxDx, Math.abs(delta.x)), touchInfo.historyX.push(delta.x), touchInfo.historyY.push(delta.y), touchInfo.historyTime.push(event.detail.timeStamp); touchInfo.historyTime.length > 10;) { - touchInfo.historyTime.shift(); - touchInfo.historyX.shift(); - touchInfo.historyY.shift(); - } + this._nativeParent = $parent; + }, + mounted: function mounted() { + var _this = this; - if (touchInfo.listener && touchInfo.listener.onTouchMove) { - touchInfo.listener.onTouchMove(delta.x, delta.y, event.detail.timeStamp); - } - } - } - }, - _handleTouchEnd: function _handleTouchEnd(event) { - var touchInfo = this._touchInfo; + this._onParentReady(function (parentPosition) { + _this.parentPosition = _this._nativeParent.position || parentPosition; - if (touchInfo.trackingID !== -1) { - event.preventDefault(); + _this._updateStyle(); - var delta = this._findDelta(event); + _this._onCanInsert(); - if (delta) { - var listener = touchInfo.listener; - touchInfo.trackingID = -1; - touchInfo.listener = null; - var r = touchInfo.historyTime.length; - var o = { - x: 0, - y: 0 - }; + _this.$watch('hidden', function (val) { + _this.cover && _this.cover[val ? 'hide' : 'show'](); + }); - if (r > 2) { - for (var a = touchInfo.historyTime.length - 1, s = touchInfo.historyTime[a], l = touchInfo.historyX[a], c = touchInfo.historyY[a]; a > 0;) { - a--; - var u = touchInfo.historyTime[a]; - var d = s - u; + _this.$watch('viewPosition', function (val) { + _this.cover && _this.cover.setStyle(val); + }, { + deep: true + }); - if (d > 30 && d < 50) { - o.x = (l - touchInfo.historyX[a]) / (d / 1e3); - o.y = (c - touchInfo.historyY[a]) / (d / 1e3); - break; - } - } - } + _this.$watch('tags', function () { + var cover = _this.cover; - touchInfo.historyTime = []; - touchInfo.historyX = []; - touchInfo.historyY = []; + if (cover) { + cover.reset(); + cover.draw(_this.tags); + } + }, { + deep: true + }); - if (listener && listener.onTouchEnd) { - listener.onTouchEnd(delta.x, delta.y, o); - } + _this.$on('uni-view-update', _this._requestStyleUpdate); + }); + }, + beforeDestroy: function beforeDestroy() { + if (this._nativeParent.isNative) { + this.cover && this.cover.close(); + delete this.cover; + } + }, + methods: { + _onCanInsert: function _onCanInsert() { + var _this2 = this; + + var cover = this.cover = new plus.nativeObj.View("cover-".concat(Date.now(), "-").concat(index++), this.viewPosition, this.tags); + plus.webview.currentWebview().append(cover); + + if (this.hidden) { + cover.hide(); + } + + cover.addEventListener('click', function () { + _this2.$trigger('click', {}, {}); + }); + }, + _getTagPosition: function _getTagPosition() { + var position = {}; + + for (var key in this.position) { + var val = this.position[key]; + + if (key === 'top' || key === 'left') { + val = Math.min(parseFloat(val) - parseFloat(this.parentPosition[key]), 0) + 'px'; } + + position[key] = val; + } + + return position; + }, + _updateStyle: function _updateStyle() { + var _this3 = this; + + var style = getComputedStyle(this.$el); + base.concat(text, image).forEach(function (key) { + _this3.$set(_this3.style, key, style[key]); + }); + }, + _requestStyleUpdate: function _requestStyleUpdate() { + var _this4 = this; + + if (this._styleUpdateRequest) { + cancelAnimationFrame(this._styleUpdateRequest); } + + this._styleUpdateRequest = requestAnimationFrame(function () { + delete _this4._styleUpdateRequest; + + _this4._updateStyle(); + }); } } }); /***/ }), -/* 65 */ +/* 74 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getRealPath; }); - -// CONCATENATED MODULE: ./src/core/helpers/get-real-route.js -function getRealRoute(fromRoute, toRoute) { - if (!toRoute) { - toRoute = fromRoute; +// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Friction.js +var Friction = __webpack_require__(71); - if (toRoute.indexOf('/') === 0) { - return toRoute; - } +// EXTERNAL MODULE: ./src/core/view/mixins/scroller/Spring.js +var Spring = __webpack_require__(72); - var pages = getCurrentPages(); +// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroll.js - 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)); - } +function Scroll(extent, friction, spring) { + this._extent = extent; + this._friction = friction || new Friction["a" /* Friction */](0.01); + this._spring = spring || new Spring["a" /* Spring */](1, 90, 20); + this._startTime = 0; + this._springing = false; + this._springOffset = 0; +} - var toRouteArray = toRoute.split('/'); - var toRouteLength = toRouteArray.length; - var i = 0; +Scroll.prototype.snap = function (e, t) { + this._springOffset = 0; + this._springing = true; - for (; i < toRouteLength && toRouteArray[i] === '..'; i++) {// noop - } + this._spring.snap(e); - toRouteArray.splice(0, i); - toRoute = toRouteArray.join('/'); - var fromRouteArray = fromRoute.length > 0 ? fromRoute.split('/') : []; - fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); - return '/' + fromRouteArray.concat(toRouteArray).join('/'); -} -// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + this._spring.setEnd(t); +}; -var SCHEME_RE = /^([a-z-]+:)?\/\//i; -var DATA_RE = /^data:.*,.*/; // 处理 Android 平台解压与非解压模式下获取的路径不一致的情况 +Scroll.prototype.set = function (e, t) { + this._friction.set(e, t); -function handleLocalPath(filePath) { - return plus.io.convertLocalFileSystemURL(filePath).replace(/^\/?apps\//, '/android_asset/apps/').replace(/\/$/, ''); -} + if (e > 0 && t >= 0) { + this._springOffset = 0; + this._springing = true; -var wwwPath; + this._spring.snap(e); -function addBase(filePath) { - if (!wwwPath) { - // 需要时,初始化一次,外部直接初始化,需要等 plusready - wwwPath = 'file://' + handleLocalPath('_www') + '/'; - } + this._spring.setEnd(0); + } else { + if (e < -this._extent && t <= 0) { + this._springOffset = 0; + this._springing = true; - return wwwPath + filePath; -} + this._spring.snap(e); -function getRealPath(filePath) { - if (filePath.indexOf('/') === 0) { - if (filePath.indexOf('//') === 0) { - filePath = 'https:' + filePath; + this._spring.setEnd(-this._extent); } else { - return addBase(filePath.substr(1)); + this._springing = false; } - } // 网络资源或base64 + } + this._startTime = new Date().getTime(); +}; - if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf('blob:') === 0) { - return filePath; - } // _do=>_doc,_documents,_downloads +Scroll.prototype.x = function (e) { + if (!this._startTime) { + return 0; + } + if (!e) { + e = (new Date().getTime() - this._startTime) / 1e3; + } - if (filePath.indexOf('_www') === 0 || filePath.indexOf('_do') === 0) { - return 'file://' + handleLocalPath(filePath); + if (this._springing) { + return this._spring.x() + this._springOffset; } - var pages = getCurrentPages(); + var t = this._friction.x(e); - if (pages.length) { - return addBase(getRealRoute(pages[pages.length - 1].$page.route, filePath).substr(1)); - } + var n = this.dx(e); - return filePath; -} + if (t > 0 && n >= 0 || t < -this._extent && n <= 0) { + this._springing = true; -/***/ }), -/* 66 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + this._spring.setEnd(0, n); -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requestComponentObserver; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return destroyComponentObserver; }); -/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87); -/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(intersection_observer__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56); + if (t < -this._extent) { + this._springOffset = -this._extent; + } else { + this._springOffset = 0; + } + t = this._spring.x() + this._springOffset; + } + return t; +}; +Scroll.prototype.dx = function (e) { + var t = 0; + t = this._lastTime === e ? this._lastDx : this._springing ? this._spring.dx(e) : this._friction.dx(e); + this._lastTime = e; + this._lastDx = t; + return t; +}; -function getRect(rect) { - return { - bottom: rect.bottom, - height: rect.height, - left: rect.left, - right: rect.right, - top: rect.top, - width: rect.width - }; -} +Scroll.prototype.done = function () { + return this._springing ? this._spring.done() : this._friction.done(); +}; -var intersectionObservers = {}; -function requestComponentObserver(_ref, pageId) { - var reqId = _ref.reqId, - component = _ref.component, - options = _ref.options; - var pages = getCurrentPages(); - var page = pages.find(function (page) { - return page.$page.id === pageId; - }); +Scroll.prototype.setVelocityByEnd = function (e) { + this._friction.setVelocityByEnd(e); +}; - if (!page) { - throw new Error("Not Found\uFF1APage[".concat(pageId, "]")); - } +Scroll.prototype.configuration = function () { + var e = this._friction.configuration(); - var pageVm = page.$vm; - var $el = Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* findElm */ "a"])(component, pageVm); - var root = options.relativeToSelector ? $el.querySelector(options.relativeToSelector) : null; - var intersectionObserver = intersectionObservers[reqId] = new IntersectionObserver(function (entries, observer) { - entries.forEach(function (entrie) { - UniViewJSBridge.publishHandler('onRequestComponentObserver', { - reqId: reqId, - res: { - intersectionRatio: entrie.intersectionRatio, - intersectionRect: getRect(entrie.intersectionRect), - boundingClientRect: getRect(entrie.boundingClientRect), - relativeRect: getRect(entrie.rootBounds), - time: Date.now(), - dataset: Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__[/* normalizeDataset */ "c"])(entrie.target.dataset || {}), - id: entrie.target.id + e.push.apply(e, this._spring.configuration()); + return e; +}; +// CONCATENATED MODULE: ./src/core/view/mixins/scroller/Scroller.js + + +function i(scroll, t, n) { + function i(t, scroll, r, o) { + if (!t || !t.cancelled) { + r(scroll); + var a = scroll.done(); + + if (!a) { + if (!t.cancelled) { + t.id = requestAnimationFrame(i.bind(null, t, scroll, r, o)); } - }, pageVm.$page.id); - }); - }, { - root: root, - rootMargin: options.rootMargin, - threshold: options.thresholds - }); + } - if (options.observeAll) { - intersectionObserver.USE_MUTATION_OBSERVER = true; - Array.prototype.map.call($el.querySelectorAll(options.selector), function (el) { - intersectionObserver.observe(el); - }); - } else { - intersectionObserver.USE_MUTATION_OBSERVER = false; - intersectionObserver.observe($el.querySelector(options.selector)); + if (a && o) { + o(scroll); + } + } } -} -function destroyComponentObserver(_ref2) { - var reqId = _ref2.reqId; - var intersectionObserver = intersectionObservers[reqId]; - if (intersectionObserver) { - intersectionObserver.disconnect(); - UniViewJSBridge.publishHandler('onRequestComponentObserver', { - reqId: reqId, - reqEnd: true - }); + function r(scroll) { + if (scroll && scroll.id) { + cancelAnimationFrame(scroll.id); + } + + if (scroll) { + scroll.cancelled = true; + } } + + var o = { + id: 0, + cancelled: false + }; + i(o, scroll, t, n); + return { + cancel: r.bind(null, o), + model: scroll + }; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -/***/ }), -/* 67 */ -/***/ (function(module, exports) { +function Scroller(element, options) { + options = options || {}; + this._element = element; + this._options = options; + this._enableSnap = options.enableSnap || false; + this._itemSize = options.itemSize || 0; + this._enableX = options.enableX || false; + this._enableY = options.enableY || false; + this._shouldDispatchScrollEvent = !!options.onScroll; -module.exports = ['uni-app', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-toast', 'uni-resize-sensor', 'uni-shadow-root', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', 'uni-editor', 'uni-form', 'uni-functional-page-navigator', 'uni-icon', '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']; + if (this._enableX) { + this._extent = (options.scrollWidth || this._element.offsetWidth) - this._element.parentElement.offsetWidth; + this._scrollWidth = options.scrollWidth; + } else { + this._extent = (options.scrollHeight || this._element.offsetHeight) - this._element.parentElement.offsetHeight; + this._scrollHeight = options.scrollHeight; + } -/***/ }), -/* 68 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + this._position = 0; + this._scroll = new Scroll(this._extent, options.friction, options.spring); + this._onTransitionEnd = this.onTransitionEnd.bind(this); + this.updatePosition(); +} -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge, global) {/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); -/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88); -/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58); -/* harmony import */ var uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59); -/* harmony import */ var uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84); -/* harmony import */ var _view_api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(74); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["a"]; }); +Scroller.prototype.onTouchStart = function () { + this._startPosition = this._position; + this._lastChangePos = this._startPosition; -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["b"]; }); + if (this._startPosition > 0) { + this._startPosition /= 0.5; + } else { + if (this._startPosition < -this._extent) { + this._startPosition = (this._startPosition + this._extent) / 0.5 - this._extent; + } + } -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["c"]; }); + if (this._animation) { + this._animation.cancel(); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["d"]; }); + this._scrolling = false; + } -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["e"]; }); + this.updatePosition(); +}; -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["f"]; }); +Scroller.prototype.onTouchMove = function (x, y) { + var startPosition = this._startPosition; -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["g"]; }); + if (this._enableX) { + startPosition += x; + } else if (this._enableY) { + startPosition += y; + } -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "h", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["h"]; }); + if (startPosition > 0) { + startPosition *= 0.5; + } else if (startPosition < -this._extent) { + startPosition = 0.5 * (startPosition + this._extent) - this._extent; + } + this._position = startPosition; + this.updatePosition(); + this.dispatchScroll(); +}; +Scroller.prototype.onTouchEnd = function (e, r, o) { + var _this = this; + if (this._enableSnap && this._position > -this._extent && this._position < 0) { + if (this._enableY && (Math.abs(r) < this._itemSize && Math.abs(o.y) < 300 || Math.abs(o.y) < 150)) { + this.snap(); + return; + } + if (this._enableX && (Math.abs(e) < this._itemSize && Math.abs(o.x) < 300 || Math.abs(o.x) < 150)) { + this.snap(); + return; + } + } + if (this._enableX) { + this._scroll.set(this._position, o.x); + } else if (this._enableY) { + this._scroll.set(this._position, o.y); + } -global.UniViewJSBridge = { - publishHandler: UniViewJSBridge.publishHandler, - subscribeHandler: UniViewJSBridge.subscribeHandler -}; -global.getCurrentPages = uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__[/* getCurrentPages */ "a"]; -global.__definePage = uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__[/* definePage */ "a"]; -global.Vue = vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]; -vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].use(uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]); + if (this._enableSnap) { + var s = this._scroll._friction.x(100); -__webpack_require__(152); + var l = s % this._itemSize; + var c = Math.abs(l) > this._itemSize / 2 ? s - (this._itemSize - Math.abs(l)) : s - l; + if (c <= 0 && c >= -this._extent) { + this._scroll.setVelocityByEnd(c); + } + } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(16))) + this._lastTime = Date.now(); + this._lastDelay = 0; + this._scrolling = true; + this._lastChangePos = this._position; + this._lastIdx = Math.floor(Math.abs(this._position / this._itemSize)); + this._animation = i(this._scroll, function () { + var e = Date.now(); + var i = (e - _this._scroll._startTime) / 1e3; -/***/ }), -/* 69 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + var r = _this._scroll.x(i); -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + _this._position = r; -/* harmony default export */ __webpack_exports__["a"] = ({ - props: { - id: { - type: String, - default: '' - } - }, - created: function created() { - var _this = this; + _this.updatePosition(); - this._addListeners(this.id); // 初始化监听 + var o = _this._scroll.dx(i); + if (_this._shouldDispatchScrollEvent && e - _this._lastTime > _this._lastDelay) { + _this.dispatchScroll(); - this.$watch('id', function (newId, oldId) { - // watch id - _this._removeListeners(oldId, true); + _this._lastDelay = Math.abs(2e3 / o); + _this._lastTime = e; + } + }, function () { + if (_this._enableSnap) { + if (c <= 0 && c >= -_this._extent) { + _this._position = c; - _this._addListeners(newId, true); - }); - }, - beforeDestroy: function beforeDestroy() { - // 销毁时移除 - this._removeListeners(this.id); - }, - methods: { - _addListeners: function _addListeners(id, watch) { - var _this2 = this; + _this.updatePosition(); + } - if (watch && !id) { - // id被置空 - return; + if (typeof _this._options.onSnap === 'function') { + _this._options.onSnap(Math.floor(Math.abs(_this._position) / _this._itemSize)); } + } - var listeners = this.$options.listeners; + if (_this._shouldDispatchScrollEvent) { + _this.dispatchScroll(); + } - if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "e"])(listeners)) { - return; - } + _this._scrolling = false; + }); +}; - Object.keys(listeners).forEach(function (name) { - if (watch) { - // watch id - if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) { - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]); - } - } else { - if (name.indexOf('@') === 0) { - /* eslint-disable standard/computed-property-even-spacing */ - _this2.$on("uni-".concat(name.substr(1)), _this2[listeners[name]]); - } else if (name.indexOf('uni-') === 0) { - // 完全限定 +Scroller.prototype.onTransitionEnd = function () { + this._element.style.transition = ''; + this._element.style.webkitTransition = ''; - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.on(name, _this2[listeners[name]]); - } else if (id) { - // scoped + this._element.removeEventListener('transitionend', this._onTransitionEnd); - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]); - } - } - }); - }, - _removeListeners: function _removeListeners(id, watch) { - var _this3 = this; - - if (watch && !id) { - // id之前不存在 - return; - } + this._element.removeEventListener('webkitTransitionEnd', this._onTransitionEnd); - var listeners = this.$options.listeners; + if (this._snapping) { + this._snapping = false; + } - if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "e"])(listeners)) { - return; - } + this.dispatchScroll(); +}; - Object.keys(listeners).forEach(function (name) { - if (watch) { - // watch id - if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) { - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]); - } - } else { - if (name.indexOf('@') === 0) { - /* eslint-disable standard/computed-property-even-spacing */ - _this3.$off("uni-".concat(name.substr(1)), _this3[listeners[name]]); - } else if (name.indexOf('uni-') === 0) { - // 完全限定 +Scroller.prototype.snap = function () { + var e = this._itemSize; + var t = this._position % e; + var i = Math.abs(t) > this._itemSize / 2 ? this._position - (e - Math.abs(t)) : this._position - t; - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.off(name, _this3[listeners[name]]); - } else if (id) { - // scoped + if (this._position !== i) { + this._snapping = true; + this.scrollTo(-i); - /* eslint-disable standard/computed-property-even-spacing */ - UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]); - } - } - }); + if (typeof this._options.onSnap === 'function') { + this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize)); } } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) +}; -/***/ }), -/* 70 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Scroller.prototype.scrollTo = function (e, t) { + if (this._animation) { + this._animation.cancel(); -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + this._scrolling = false; + } -/* harmony default export */ __webpack_exports__["a"] = ({ - // 取消id的定义,某些组件(canvas)内不在props内定义id - // props: { - // id: { - // type: String, - // default: '' - // } - // }, - mounted: function mounted() { - var _this = this; + if (typeof e === 'number') { + this._position = -e; + } - this._toggleListeners('subscribe', this.id); // 初始化监听 + if (this._position < -this._extent) { + this._position = -this._extent; + } else { + if (this._position > 0) { + this._position = 0; + } + } + this._element.style.transition = 'transform ' + (t || 0.2) + 's ease-out'; + this._element.style.webkitTransition = '-webkit-transform ' + (t || 0.2) + 's ease-out'; + this.updatePosition(); - this.$watch('id', function (newId, oldId) { - // watch id - _this._toggleListeners('unsubscribe', oldId, true); + this._element.addEventListener('transitionend', this._onTransitionEnd); - _this._toggleListeners('subscribe', newId, true); - }); - }, - beforeDestroy: function beforeDestroy() { - // 销毁时移除 - this._toggleListeners('unsubscribe', this.id); + this._element.addEventListener('webkitTransitionEnd', this._onTransitionEnd); +}; - if (this._contextId) { - this._toggleListeners('unsubscribe', this._contextId); - } - }, - methods: { - _toggleListeners: function _toggleListeners(type, id, watch) { - if (watch && !id) { - // id被置空 - return; +Scroller.prototype.dispatchScroll = function () { + if (typeof this._options.onScroll === 'function' && Math.round(this._lastPos) !== Math.round(this._position)) { + this._lastPos = this._position; + var e = { + 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 } + }; - if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isFn */ "d"])(this._handleSubscribe)) { - return; - } // 纠正VUniVideo等组件命名为Video - + this._options.onScroll(e); + } +}; - UniViewJSBridge[type](this.$page.id + '-' + this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase() + '-' + id, this._handleSubscribe); - }, - _getContextInfo: function _getContextInfo() { - var id = "context-".concat(this._uid); +Scroller.prototype.update = function (e, t, n) { + var i = 0; + var r = this._position; - if (!this._contextId) { - this._toggleListeners('subscribe', id); + if (this._enableX) { + i = this._element.childNodes.length ? (t || this._element.offsetWidth) - this._element.parentElement.offsetWidth : 0; + this._scrollWidth = t; + } else { + i = this._element.childNodes.length ? (t || this._element.offsetHeight) - this._element.parentElement.offsetHeight : 0; + this._scrollHeight = t; + } - this._contextId = id; - } + if (typeof e === 'number') { + this._position = -e; + } - return { - name: this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase(), - id: id, - page: this.$page.id - }; + if (this._position < -i) { + this._position = -i; + } else { + if (this._position > 0) { + this._position = 0; } } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - -/***/ }), -/* 71 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); + this._itemSize = n || this._itemSize; + this.updatePosition(); + if (r !== this._position) { + this.dispatchScroll(); -function hideKeyboard() { - document.activeElement.blur(); -} -/** - * 保证iOS点击输入框外隐藏键盘 - */ + if (typeof this._options.onSnap === 'function') { + this._options.onSnap(Math.floor(Math.abs(this._position) / this._itemSize)); + } + } + this._extent = i; + this._scroll._extent = i; +}; -function iosHideKeyboard() {} +Scroller.prototype.updatePosition = function () { + var transform = ''; -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Keyboard', - props: { - cursorSpacing: { - type: [Number, String], - default: 0 - }, - showConfirmBar: { - type: [Boolean, String], - default: 'auto' - }, - adjustPosition: { - type: Boolean, - default: true - } - }, - watch: { - focus: function focus(val) { - if (val) { - this.showSoftKeybord(); - } - } - }, - mounted: function mounted() { - if (this.autoFocus || this.focus) { - this.showSoftKeybord(); + if (this._enableX) { + transform = 'translateX(' + this._position + 'px) translateZ(0)'; + } else { + if (this._enableY) { + transform = 'translateY(' + this._position + 'px) translateZ(0)'; } - }, - beforeDestroy: function beforeDestroy() { - this.onKeyboardHide(); - }, - methods: { - initKeyboard: function initKeyboard(el) { - var _this = this; - - el.addEventListener('focus', function () { - _this.hideKeyboardTemp = function () { - hideKeyboard(); - }; + } - UniViewJSBridge.subscribe('hideKeyboard', _this.hideKeyboardTemp); - document.addEventListener('click', iosHideKeyboard, false); + this._element.style.webkitTransform = transform; + this._element.style.transform = transform; +}; - _this.setSoftinputNavBar(); +Scroller.prototype.isScrolling = function () { + return this._scrolling || this._snapping; +}; +// CONCATENATED MODULE: ./src/core/view/mixins/scroller/index.js - _this.setSoftinputTemporary(); - }); - el.addEventListener('blur', this.onKeyboardHide.bind(this)); +/* harmony default export */ var scroller = __webpack_exports__["a"] = ({ + methods: { + initScroller: function initScroller(element, options) { + this._touchInfo = { + trackingID: -1, + maxDy: 0, + maxDx: 0 + }; + this._scroller = new Scroller(element, options); + this.__handleTouchStart = this._handleTouchStart.bind(this); + this.__handleTouchMove = this._handleTouchMove.bind(this); + this.__handleTouchEnd = this._handleTouchEnd.bind(this); + this._initedScroller = true; }, - showSoftKeybord: function showSoftKeybord() { - Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "g"])(function () { - plus.key.showSoftKeybord(); - }); + _findDelta: function _findDelta(event) { + var touchInfo = this._touchInfo; + return event.detail.state === 'move' || event.detail.state === 'end' ? { + x: event.detail.dx, + y: event.detail.dy + } : { + x: event.screenX - touchInfo.x, + y: event.screenY - touchInfo.y + }; }, - setSoftinputTemporary: function setSoftinputTemporary() { - var _this2 = this; - - Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "g"])(function () { - var currentWebview = plus.webview.currentWebview(); - var style = currentWebview.getStyle() || {}; - - var rect = _this2.$el.getBoundingClientRect(); + _handleTouchStart: function _handleTouchStart(e) { + var t = this._touchInfo; + var n = this._scroller; - currentWebview.setSoftinputTemporary && currentWebview.setSoftinputTemporary({ - mode: style.softinputMode === 'adjustResize' ? 'adjustResize' : _this2.adjustPosition ? 'adjustPan' : 'nothing', - position: { - top: rect.top, - height: rect.height + (Number(_this2.cursorSpacing) || 0) - } - }); - }); - }, - setSoftinputNavBar: function setSoftinputNavBar() { - var _this3 = this; + if (n) { + if (e.detail.state === 'start') { + t.trackingID = 'touch'; + t.x = e.detail.x; + t.y = e.detail.y; + } else { + t.trackingID = 'mouse'; + t.x = e.screenX; + t.y = e.screenY; + } - if (this.showConfirmBar === 'auto') { - delete this.__softinputNavBar; - return; + t.maxDx = 0; + t.maxDy = 0; + t.historyX = [0]; + t.historyY = [0]; + t.historyTime = [e.detail.timeStamp]; + t.listener = n; + + if (n.onTouchStart) { + n.onTouchStart(); + } + + e.preventDefault(); } + }, + _handleTouchMove: function _handleTouchMove(event) { + var touchInfo = this._touchInfo; - Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "g"])(function () { - var currentWebview = plus.webview.currentWebview(); + if (touchInfo.trackingID !== -1) { + event.preventDefault(); - var _ref = currentWebview.getStyle() || {}, - softinputNavBar = _ref.softinputNavBar; + var delta = this._findDelta(event); - var showConfirmBar = softinputNavBar !== 'none'; + if (delta) { + for (touchInfo.maxDy = Math.max(touchInfo.maxDy, Math.abs(delta.y)), touchInfo.maxDx = Math.max(touchInfo.maxDx, Math.abs(delta.x)), touchInfo.historyX.push(delta.x), touchInfo.historyY.push(delta.y), touchInfo.historyTime.push(event.detail.timeStamp); touchInfo.historyTime.length > 10;) { + touchInfo.historyTime.shift(); + touchInfo.historyX.shift(); + touchInfo.historyY.shift(); + } - if (showConfirmBar !== _this3.showConfirmBar) { - _this3.__softinputNavBar = softinputNavBar || 'auto'; - currentWebview.setStyle({ - softinputNavBar: _this3.showConfirmBar ? 'auto' : 'none' - }); - } else { - delete _this3.__softinputNavBar; + if (touchInfo.listener && touchInfo.listener.onTouchMove) { + touchInfo.listener.onTouchMove(delta.x, delta.y, event.detail.timeStamp); + } } - }); - }, - resetSoftinputNavBar: function resetSoftinputNavBar() { - var softinputNavBar = this.__softinputNavBar; - - if (softinputNavBar) { - Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* plusReady */ "g"])(function () { - var currentWebview = plus.webview.currentWebview(); - currentWebview.setStyle({ - softinputNavBar: softinputNavBar - }); - }); } }, - onKeyboardHide: function onKeyboardHide() { - UniViewJSBridge.unsubscribe('hideKeyboard', this.hideKeyboardTemp); - document.removeEventListener('click', iosHideKeyboard, false); - this.resetSoftinputNavBar(); - } - } -}); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) + _handleTouchEnd: function _handleTouchEnd(event) { + var touchInfo = this._touchInfo; -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { + if (touchInfo.trackingID !== -1) { + event.preventDefault(); -exports.nextTick = function nextTick(fn) { - var args = Array.prototype.slice.call(arguments); - args.shift(); - setTimeout(function () { - fn.apply(null, args); - }, 0); -}; + var delta = this._findDelta(event); -exports.platform = exports.arch = -exports.execPath = exports.title = 'browser'; -exports.pid = 1; -exports.browser = true; -exports.env = {}; -exports.argv = []; + if (delta) { + var listener = touchInfo.listener; + touchInfo.trackingID = -1; + touchInfo.listener = null; + var r = touchInfo.historyTime.length; + var o = { + x: 0, + y: 0 + }; -exports.binding = function (name) { - throw new Error('No such module. (Possibly not yet loaded)') -}; + if (r > 2) { + for (var a = touchInfo.historyTime.length - 1, s = touchInfo.historyTime[a], l = touchInfo.historyX[a], c = touchInfo.historyY[a]; a > 0;) { + a--; + var u = touchInfo.historyTime[a]; + var d = s - u; -(function () { - var cwd = '/'; - var path; - exports.cwd = function () { return cwd }; - exports.chdir = function (dir) { - if (!path) path = __webpack_require__(121); - cwd = path.resolve(dir, cwd); - }; -})(); + if (d > 30 && d < 50) { + o.x = (l - touchInfo.historyX[a]) / (d / 1e3); + o.y = (c - touchInfo.historyY[a]) / (d / 1e3); + break; + } + } + } -exports.exit = exports.kill = -exports.umask = exports.dlopen = -exports.uptime = exports.memoryUsage = -exports.uvCounters = function() {}; -exports.features = {}; + touchInfo.historyTime = []; + touchInfo.historyX = []; + touchInfo.historyY = []; + if (listener && listener.onTouchEnd) { + listener.onTouchEnd(delta.x, delta.y, o); + } + } + } + } + } +}); /***/ }), -/* 73 */ +/* 75 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return navigateTo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return navigateBack; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return reLaunch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return redirectTo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return switchTab; }); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +// EXPORTS +__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getNavigationBarHeight; }); -function invokeApi(method) { - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* INVOKE_API */ "b"], { - data: { - method: method, - args: args - }, - options: { - timestamp: Date.now() - } - }); +// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/status-bar.js +function getStatusbarHeight() { + // 横屏时 iOS 获取的状态栏高度错误,进行纠正 + return plus.navigator.isImmersedStatusbar() ? Math.round(plus.os.name === 'iOS' ? plus.navigator.getSafeAreaInsets().top : plus.navigator.getStatusbarHeight()) : 0; } +// EXTERNAL MODULE: ./src/core/helpers/constants.js +var constants = __webpack_require__(17); -function navigateTo(args) { - invokeApi('navigateTo', args); -} -function navigateBack(args) { - invokeApi('navigateBack', args); -} -function reLaunch(args) { - invokeApi('reLaunch', args); -} -function redirectTo(args) { - invokeApi('redirectTo', args); -} -function switchTab(args) { - invokeApi('switchTab', args); +// CONCATENATED MODULE: ./src/platforms/app-plus/view/utils.js + + +function getNavigationBarHeight() { + var webview = plus.webview.currentWebview(); + var style = webview.getStyle(); + style = style && style.titleNView; + + if (style && style.type === 'default') { + return constants["a" /* NAVBAR_HEIGHT */] + getStatusbarHeight(); + } + + return 0; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 74 */ +/* 76 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Formatter */ +/* unused harmony export I18n */ +/* unused harmony export LOCALE_EN */ +/* unused harmony export LOCALE_ES */ +/* unused harmony export LOCALE_FR */ +/* unused harmony export LOCALE_ZH_HANS */ +/* unused harmony export LOCALE_ZH_HANT */ +/* unused harmony export compileI18nJsonStr */ +/* unused harmony export hasI18nJson */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initVueI18n; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isI18nStr; }); +/* unused harmony export isString */ +/* unused harmony export normalizeLocale */ +/* unused harmony export parseI18nJson */ +/* unused harmony export resolveLocale */ +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -// EXPORTS -__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ upx2px; }); -__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ api["b" /* navigateTo */]; }); -__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ api["a" /* navigateBack */]; }); -__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ api["c" /* reLaunch */]; }); -__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ api["d" /* redirectTo */]; }); -__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ api["e" /* switchTab */]; }); -__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ getSystemInfoSync; }); -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ canIUse; }); +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -// CONCATENATED MODULE: ./src/core/service/api/base/upx2px.js -var EPS = 1e-4; -var BASE_DEVICE_WIDTH = 750; -var isIOS = false; -var deviceWidth = 0; -var deviceDPR = 0; +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function checkDeviceWidth() { - var _uni$getSystemInfoSyn = uni.getSystemInfoSync(), - platform = _uni$getSystemInfoSyn.platform, - pixelRatio = _uni$getSystemInfoSyn.pixelRatio, - windowWidth = _uni$getSystemInfoSyn.windowWidth; +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - deviceWidth = windowWidth; - deviceDPR = pixelRatio; - isIOS = platform === 'ios'; -} +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } -function upx2px(number, newDeviceWidth) { - if (deviceWidth === 0) { - checkDeviceWidth(); - } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - number = Number(number); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (number === 0) { - return 0; - } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth); +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - if (result < 0) { - result = -result; +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +var isArray = Array.isArray; + +var isObject = function isObject(val) { + return val !== null && _typeof(val) === 'object'; +}; + +var defaultDelimiters = ['{', '}']; + +var BaseFormatter = /*#__PURE__*/function () { + function BaseFormatter() { + _classCallCheck(this, BaseFormatter); + + this._caches = Object.create(null); } - result = Math.floor(result + EPS); + _createClass(BaseFormatter, [{ + key: "interpolate", + value: function interpolate(message, values) { + var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters; - if (result === 0) { - if (deviceDPR === 1 || !isIOS) { - return 1; - } else { - return 0.5; + if (!values) { + return [message]; + } + + var tokens = this._caches[message]; + + if (!tokens) { + tokens = parse(message, delimiters); + this._caches[message] = tokens; + } + + return compile(tokens, values); } - } + }]); - return number < 0 ? -result : result; -} -// EXTERNAL MODULE: ./src/platforms/app-plus/view/api/index.js -var api = __webpack_require__(73); + return BaseFormatter; +}(); -// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js -var get_window_offset = __webpack_require__(10); +var RE_TOKEN_LIST_VALUE = /^(?:\d)+/; +var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/; -// EXTERNAL MODULE: ./node_modules/safe-area-insets/out/index.js -var out = __webpack_require__(5); -var out_default = /*#__PURE__*/__webpack_require__.n(out); +function parse(format, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + startDelimiter = _ref2[0], + endDelimiter = _ref2[1]; -// CONCATENATED MODULE: ./src/platforms/h5/service/api/device/get-system-info.js + var tokens = []; + var position = 0; + var text = ''; + while (position < format.length) { + var _char = format[position++]; -var ua = navigator.userAgent; -/** - * 是否安卓设备 - */ + if (_char === startDelimiter) { + if (text) { + tokens.push({ + type: 'text', + value: text + }); + } -var isAndroid = /android/i.test(ua); -/** - * 是否iOS设备 - */ + text = ''; + var sub = ''; + _char = format[position++]; -var get_system_info_isIOS = /iphone|ipad|ipod/i.test(ua); -/** - * 获取系统信息-同步 - */ + while (_char !== undefined && _char !== endDelimiter) { + sub += _char; + _char = format[position++]; + } -function getSystemInfoSync() { - var screen = window.screen; - var pixelRatio = window.devicePixelRatio; - var screenWidth = screen.width; - var screenHeight = screen.height; - var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth, screenWidth); - var windowHeight = window.innerHeight; - var language = navigator.language; - var statusBarHeight = out_default.a.top; - var osname; - var osversion; - var model; - - if (get_system_info_isIOS) { - osname = 'iOS'; - var osversionFind = ua.match(/OS\s([\w_]+)\slike/); - - if (osversionFind) { - osversion = osversionFind[1].replace(/_/g, '.'); - } + var isClosed = _char === endDelimiter; + var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown'; + tokens.push({ + value: sub, + type: type + }); + } // else if (char === '%') { + // // when found rails i18n syntax, skip text capture + // if (format[position] !== '{') { + // text += char + // } + // } + else { + text += _char; + } + } - var modelFind = ua.match(/\(([a-zA-Z]+);/); + text && tokens.push({ + type: 'text', + value: text + }); + return tokens; +} - if (modelFind) { - model = modelFind[1]; - } - } else if (isAndroid) { - osname = 'Android'; // eslint-disable-next-line no-useless-escape +function compile(tokens, values) { + var compiled = []; + var index = 0; + var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown'; - var _osversionFind = ua.match(/Android[\s/]([\w\.]+)[;\s]/); + if (mode === 'unknown') { + return compiled; + } - if (_osversionFind) { - osversion = _osversionFind[1]; - } + while (index < tokens.length) { + var token = tokens[index]; - var infoFind = ua.match(/\((.+?)\)/); - var infos = infoFind ? infoFind[1].split(';') : ua.split(' '); // eslint-disable-next-line no-useless-escape + switch (token.type) { + case 'text': + compiled.push(token.value); + break; - var otherInfo = [/\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]; + case 'list': + compiled.push(values[parseInt(token.value, 10)]); + break; - for (var i = 0; i < infos.length; i++) { - var info = infos[i]; + case 'named': + if (mode === 'named') { + compiled.push(values[token.value]); + } else { + if (true) { + console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!")); + } + } - if (info.indexOf('Build') > 0) { - model = info.split('Build')[0].trim(); break; - } - - var other = void 0; - for (var o = 0; o < otherInfo.length; o++) { - if (otherInfo[o].test(info)) { - other = true; - break; + case 'unknown': + if (true) { + console.warn("Detect 'unknown' type of token!"); } - } - if (!other) { - model = info.trim(); break; - } } - } else { - osname = 'Other'; - osversion = '0'; - } - - var system = "".concat(osname, " ").concat(osversion); - var platform = osname.toLocaleLowerCase(); - var safeArea = { - left: out_default.a.left, - right: windowWidth - out_default.a.right, - top: out_default.a.top, - bottom: windowHeight - out_default.a.bottom, - width: windowWidth - out_default.a.left - out_default.a.right, - height: windowHeight - out_default.a.top - out_default.a.bottom - }; - var _getWindowOffset = Object(get_window_offset["a" /* default */])(), - windowTop = _getWindowOffset.top, - windowBottom = _getWindowOffset.bottom; + index++; + } - windowHeight -= windowTop; - windowHeight -= windowBottom; - return { - windowTop: windowTop, - windowBottom: windowBottom, - windowWidth: windowWidth, - windowHeight: windowHeight, - pixelRatio: pixelRatio, - screenWidth: screenWidth, - screenHeight: screenHeight, - language: language, - statusBarHeight: statusBarHeight, - system: system, - platform: platform, - model: model, - safeArea: safeArea, - safeAreaInsets: { - top: out_default.a.top, - right: out_default.a.right, - bottom: out_default.a.bottom, - left: out_default.a.left - } - }; + return compiled; } -/** - * 获取系统信息-异步 - */ -function getSystemInfo() { - return getSystemInfoSync(); -} -// CONCATENATED MODULE: ./lib/app-plus/view-api.js +var LOCALE_ZH_HANS = 'zh-Hans'; +var LOCALE_ZH_HANT = 'zh-Hant'; +var LOCALE_EN = 'en'; +var LOCALE_FR = 'fr'; +var LOCALE_ES = 'es'; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var hasOwn = function hasOwn(val, key) { + return hasOwnProperty.call(val, key); +}; +var defaultFormatter = new BaseFormatter(); -function canIUse(schema) { - if (schema === 'css.var') { - return window.CSS && window.CSS.supports && window.CSS.supports('--a:0'); - } +function include(str, parts) { + return !!parts.find(function (part) { + return str.indexOf(part) !== -1; + }); +} - return true; +function startsWith(str, parts) { + return parts.find(function (part) { + return str.indexOf(part) === 0; + }); } -/***/ }), -/* 75 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function normalizeLocale(locale, messages) { + if (!locale) { + return; + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return requestComponentInfo; }); -/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var uni_platform_helpers_get_window_offset__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); -/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56); + locale = locale.trim().replace(/_/g, '-'); + if (messages && messages[locale]) { + return locale; + } + locale = locale.toLowerCase(); + if (locale.indexOf('zh') === 0) { + if (locale.indexOf('-hans') > -1) { + return LOCALE_ZH_HANS; + } -function getRootInfo(fields) { - var info = {}; + if (locale.indexOf('-hant') > -1) { + return LOCALE_ZH_HANT; + } - if (fields.id) { - info.id = ''; - } + if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) { + return LOCALE_ZH_HANT; + } - if (fields.dataset) { - info.dataset = {}; + return LOCALE_ZH_HANS; } - if (fields.rect) { - info.left = 0; - info.right = 0; - info.top = 0; - info.bottom = 0; - } + var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]); - if (fields.size) { - info.width = document.documentElement.clientWidth; - info.height = document.documentElement.clientHeight; + if (lang) { + return lang; } +} - if (fields.scrollOffset) { - info.scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft || 0; - info.scrollTop = document.documentElement.scrollTop || document.body.scrollTop || 0; - } +var I18n = /*#__PURE__*/function () { + function I18n(_ref3) { + var locale = _ref3.locale, + fallbackLocale = _ref3.fallbackLocale, + messages = _ref3.messages, + watcher = _ref3.watcher, + formater = _ref3.formater; - return info; -} + _classCallCheck(this, I18n); -function getNodeInfo(el, fields) { - var info = {}; + this.locale = LOCALE_EN; + this.fallbackLocale = LOCALE_EN; + this.message = {}; + this.messages = {}; + this.watchers = []; - var _getWindowOffset = Object(uni_platform_helpers_get_window_offset__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(), - top = _getWindowOffset.top; + if (fallbackLocale) { + this.fallbackLocale = fallbackLocale; + } - if (fields.id) { - info.id = el.id; - } + this.formater = formater || defaultFormatter; + this.messages = messages || {}; + this.setLocale(locale || LOCALE_EN); - if (fields.dataset) { - info.dataset = Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__[/* normalizeDataset */ "c"])(el.dataset || {}); + if (watcher) { + this.watchLocale(watcher); + } } - if (fields.rect || fields.size) { - var rect = el.getBoundingClientRect(); + _createClass(I18n, [{ + key: "setLocale", + value: function setLocale(locale) { + var _this = this; - if (fields.rect) { - info.left = rect.left; - info.right = rect.right; - info.top = rect.top - top; - info.bottom = rect.bottom - top; + var oldLocale = this.locale; + this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale; + + if (!this.messages[this.locale]) { + // 可能初始化时不存在 + this.messages[this.locale] = {}; + } + + this.message = this.messages[this.locale]; // 仅发生变化时,通知 + + if (oldLocale !== this.locale) { + this.watchers.forEach(function (watcher) { + watcher(_this.locale, oldLocale); + }); + } + } + }, { + key: "getLocale", + value: function getLocale() { + return this.locale; } + }, { + key: "watchLocale", + value: function watchLocale(fn) { + var _this2 = this; - if (fields.size) { - info.width = rect.width; - info.height = rect.height; + var index = this.watchers.push(fn) - 1; + return function () { + _this2.watchers.splice(index, 1); + }; } - } // TODO 组件 props + }, { + key: "add", + value: function add(locale, message) { + var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + var curMessages = this.messages[locale]; + + if (curMessages) { + if (override) { + Object.assign(curMessages, message); + } else { + Object.keys(message).forEach(function (key) { + if (!hasOwn(curMessages, key)) { + curMessages[key] = message[key]; + } + }); + } + } else { + this.messages[locale] = message; + } + } + }, { + key: "f", + value: function f(message, values, delimiters) { + return this.formater.interpolate(message, values, delimiters).join(''); + } + }, { + key: "t", + value: function t(key, locale, values) { + var message = this.message; + if (typeof locale === 'string') { + locale = normalizeLocale(locale, this.messages); + locale && (message = this.messages[locale]); + } else { + values = locale; + } - if (fields.properties) { - fields.properties.forEach(function (prop) { - prop = prop.replace(/-([a-z])/g, function (e, t) { - return t.toUpperCase(); - }); // props - }); - } + if (!hasOwn(message, key)) { + console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default.")); + return key; + } - if (fields.scrollOffset) { - if (el.tagName === 'UNI-SCROLL-VIEW' && el.__vue__ && el.__vue__.getScrollPosition) { - Object.assign(info, el.__vue__.getScrollPosition()); - } else { - info.scrollLeft = 0; - info.scrollTop = 0; + return this.formater.interpolate(message[key], values).join(''); } - } + }]); - if (fields.context) { - if (el.__vue__ && el.__vue__._getContextInfo) { - info.context = el.__vue__._getContextInfo(); - } - } + return I18n; +}(); - return info; +function watchAppLocale(appVm, i18n) { + // 需要保证 watch 的触发在组件渲染之前 + if (appVm.$watchLocale) { + // vue2 + appVm.$watchLocale(function (newLocale) { + i18n.setLocale(newLocale); + }); + } else { + appVm.$watch(function () { + return appVm.$locale; + }, function (newLocale) { + i18n.setLocale(newLocale); + }); + } } -function getNodesInfo(pageVm, component, selector, single, fields) { - var $el = Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* findElm */ "a"])(component, pageVm); - - if (!$el || $el && $el.nodeType === 8) { - // Comment - return single ? null : []; - } +function getDefaultLocale() { + if (typeof uni !== 'undefined' && uni.getLocale) { + return uni.getLocale(); + } // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale - if (single) { - var node = $el.matches(selector) ? $el : $el.querySelector(selector); - if (node) { - return getNodeInfo(node, fields); - } + if (typeof global !== 'undefined' && global.getLocale) { + return global.getLocale(); + } - return null; - } else { - var infos = []; - var nodeList = $el.querySelectorAll(selector); + return LOCALE_EN; +} - if (nodeList && nodeList.length) { - infos = [].map.call(nodeList, function (node) { - return getNodeInfo(node, fields); - }); - } +function initVueI18n(locale) { + var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined; + var watcher = arguments.length > 3 ? arguments[3] : undefined; - if ($el.matches(selector)) { - infos.unshift(getNodeInfo($el, fields)); - } + // 兼容旧版本入参 + if (typeof locale !== 'string') { + var _ref4 = [messages, locale]; + locale = _ref4[0]; + messages = _ref4[1]; + } - return infos; + if (typeof locale !== 'string') { + // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined + locale = getDefaultLocale(); } -} -function requestComponentInfo(_ref, pageId) { - var reqId = _ref.reqId, - reqs = _ref.reqs; - var pages = getCurrentPages(); // 跨平台时,View 层也应该实现该方法,举例 App 上,View 层的 getCurrentPages 返回长度为1的当前页面数组 + if (typeof fallbackLocale !== 'string') { + fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN; + } - var page = pages.find(function (page) { - return page.$page.id === pageId; + var i18n = new I18n({ + locale: locale, + fallbackLocale: fallbackLocale, + messages: messages, + watcher: watcher }); - if (!page) { - throw new Error("Not Found\uFF1APage[".concat(pageId, "]")); - } + var _t = function t(key, values) { + if (typeof getApp !== 'function') { + // app view - var pageVm = page.$vm; - var result = []; - reqs.forEach(function (_ref2) { - var component = _ref2.component, - selector = _ref2.selector, - single = _ref2.single, - fields = _ref2.fields; + /* eslint-disable no-func-assign */ + _t = function t(key, values) { + return i18n.t(key, values); + }; + } else { + var isWatchedAppLocale = false; + + _t = function t(key, values) { + var appVm = getApp().$vm; // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化 + // options: { + // type: Array, + // default () { + // return [{ + // icon: 'shop', + // text: t("uni-goods-nav.options.shop"), + // }, { + // icon: 'cart', + // text: t("uni-goods-nav.options.cart") + // }] + // } + // }, + + if (appVm) { + // 触发响应式 + appVm.$locale; + + if (!isWatchedAppLocale) { + isWatchedAppLocale = true; + watchAppLocale(appVm, i18n); + } + } - if (component === 0) { - result.push(getRootInfo(fields)); + return i18n.t(key, values); + }; + } + + return _t(key, values); + }; + + return { + i18n: i18n, + f: function f(message, values, delimiters) { + return i18n.f(message, values, delimiters); + }, + t: function t(key, values) { + return _t(key, values); + }, + add: function add(locale, message) { + var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + return i18n.add(locale, message, override); + }, + watch: function watch(fn) { + return i18n.watchLocale(fn); + }, + getLocale: function getLocale() { + return i18n.getLocale(); + }, + setLocale: function setLocale(newLocale) { + return i18n.setLocale(newLocale); + } + }; +} + +var isString = function isString(val) { + return typeof val === 'string'; +}; + +var formater; + +function hasI18nJson(jsonObj, delimiters) { + if (!formater) { + formater = new BaseFormatter(); + } + + return walkJsonObj(jsonObj, function (jsonObj, key) { + var value = jsonObj[key]; + + if (isString(value)) { + if (isI18nStr(value, delimiters)) { + return true; + } } else { - result.push(getNodesInfo(pageVm, component, selector, single, fields)); + return hasI18nJson(value, delimiters); } }); - UniViewJSBridge.publishHandler('onRequestComponentInfo', { - reqId: reqId, - res: result - }, pageVm.$page.id); } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -/***/ }), -/* 76 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function parseI18nJson(jsonObj, values, delimiters) { + if (!formater) { + formater = new BaseFormatter(); + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadFontFace; }); -function loadFontFace(_ref) { - var options = _ref.options, - callbackId = _ref.callbackId; - var family = options.family, - source = options.source, - _options$desc = options.desc, - desc = _options$desc === void 0 ? {} : _options$desc; - var fonts = document.fonts; + walkJsonObj(jsonObj, function (jsonObj, key) { + var value = jsonObj[key]; - if (fonts) { - var fontFace = new FontFace(family, source, desc); - fontFace.load().then(function () { - fonts.add(fontFace); - UniViewJSBridge.publishHandler('onLoadFontFaceCallback', { - callbackId: callbackId, - data: { - errMsg: 'loadFontFace:ok' - } - }); - }).catch(function (error) { - UniViewJSBridge.publishHandler('onLoadFontFaceCallback', { - callbackId: callbackId, - data: { - errMsg: "loadFontFace:fail ".concat(error) - } - }); - }); - } else { - var style = document.createElement('style'); - style.innerText = "@font-face{font-family:\"".concat(family, "\";src:").concat(source, ";font-style:").concat(desc.style, ";font-weight:").concat(desc.weight, ";font-stretch:").concat(desc.stretch, ";unicode-range:").concat(desc.unicodeRange, ";font-variant:").concat(desc.variant, ";font-feature-settings:").concat(desc.featureSettings, ";}"); - document.head.appendChild(style); - UniViewJSBridge.publishHandler('onLoadFontFaceCallback', { - callbackId: callbackId, - data: { - errMsg: 'loadFontFace:ok' + if (isString(value)) { + if (isI18nStr(value, delimiters)) { + jsonObj[key] = compileStr(value, values, delimiters); } - }); - } + } else { + parseI18nJson(value, values, delimiters); + } + }); + return jsonObj; } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -/***/ }), -/* 77 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function compileI18nJsonStr(jsonStr, _ref5) { + var locale = _ref5.locale, + locales = _ref5.locales, + delimiters = _ref5.delimiters; -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initSubscribe; }); -/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3); + if (!isI18nStr(jsonStr, delimiters)) { + return jsonStr; + } + + if (!formater) { + formater = new BaseFormatter(); + } + + var localeValues = []; + Object.keys(locales).forEach(function (name) { + if (name !== locale) { + localeValues.push({ + locale: name, + values: locales[name] + }); + } + }); + localeValues.unshift({ + locale: locale, + values: locales[locale] + }); + try { + return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2); + } catch (e) {} + return jsonStr; +} +function isI18nStr(value, delimiters) { + return value.indexOf(delimiters[0]) > -1; +} -var passiveOptions = uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* supportsPassive */ "h"] ? { - passive: false -} : false; +function compileStr(value, values, delimiters) { + return formater.interpolate(value, values, delimiters).join(''); +} -function onCssVar(_ref) { - var statusbarHeight = _ref.statusbarHeight, - windowTop = _ref.windowTop, - windowBottom = _ref.windowBottom; - global.__WINDOW_TOP = windowTop; - global.__WINDOW_BOTTOM = windowBottom; +function compileValue(jsonObj, key, localeValues, delimiters) { + var value = jsonObj[key]; - if (uni.canIUse('css.var')) { - var style = document.documentElement.style; - style.setProperty('--window-top', windowTop + 'px'); - style.setProperty('--window-bottom', windowBottom + 'px'); - style.setProperty('--status-bar-height', statusbarHeight + 'px'); + if (isString(value)) { + // 存在国际化 + if (isI18nStr(value, delimiters)) { + jsonObj[key] = compileStr(value, localeValues[0].values, delimiters); - if (true) { - console.log("--status-bar-height=".concat(statusbarHeight)); - console.log("--window-top=".concat(windowTop)); - console.log("--window-bottom=".concat(windowBottom)); + if (localeValues.length > 1) { + // 格式化国际化语言 + var valueLocales = jsonObj[key + 'Locales'] = {}; + localeValues.forEach(function (localValue) { + valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters); + }); + } } + } else { + compileJsonObj(value, localeValues, delimiters); } } -function onPageCreate(_ref2, pageId) { - var statusbarHeight = _ref2.statusbarHeight, - windowTop = _ref2.windowTop, - windowBottom = _ref2.windowBottom, - disableScroll = _ref2.disableScroll, - onPageScroll = _ref2.onPageScroll, - onPageReachBottom = _ref2.onPageReachBottom, - onReachBottomDistance = _ref2.onReachBottomDistance; - onCssVar({ - statusbarHeight: statusbarHeight, - windowTop: windowTop, - windowBottom: windowBottom +function compileJsonObj(jsonObj, localeValues, delimiters) { + walkJsonObj(jsonObj, function (jsonObj, key) { + compileValue(jsonObj, key, localeValues, delimiters); }); + return jsonObj; +} - if (disableScroll) { - document.addEventListener('touchmove', uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_1__[/* disableScroll */ "b"], passiveOptions); - } else if (onPageScroll || onPageReachBottom) { - requestAnimationFrame(function () { - // 避免监听太早,直接触发了 scroll - document.addEventListener('scroll', Object(uni_core_view_bridge_subscribe_scroll__WEBPACK_IMPORTED_MODULE_1__[/* createScrollListener */ "a"])(pageId, { - enablePageScroll: onPageScroll, - enablePageReachBottom: onPageReachBottom, - onReachBottomDistance: onReachBottomDistance - })); - }); +function walkJsonObj(jsonObj, walk) { + if (isArray(jsonObj)) { + for (var i = 0; i < jsonObj.length; i++) { + if (walk(jsonObj, i)) { + return true; + } + } + } else if (isObject(jsonObj)) { + for (var key in jsonObj) { + if (walk(jsonObj, key)) { + return true; + } + } } -} -function onWebviewReady() { - // service 主动发起检测 - UniViewJSBridge.publishHandler('webviewReady'); + return false; } -function initSubscribe(subscribe) { - subscribe(_constants__WEBPACK_IMPORTED_MODULE_3__[/* WEBVIEW_READY */ "k"], onWebviewReady); - subscribe(_constants__WEBPACK_IMPORTED_MODULE_2__[/* ON_PAGE_CREATE */ "a"], onPageCreate); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(16), __webpack_require__(4))) +function resolveLocale(locales) { + return function (locale) { + if (!locale) { + return locale; + } -/***/ }), -/* 78 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + locale = normalizeLocale(locale) || locale; + return resolveLocaleChain(locale).find(function (locale) { + return locales.indexOf(locale) > -1; + }); + }; +} -"use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); -/* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(11); -/* harmony import */ var _behaviors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85); -/* harmony import */ var _wxs_component_descriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79); +function resolveLocaleChain(locale) { + var chain = []; + var tokens = locale.split('-'); + while (tokens.length) { + chain.push(tokens.join('-')); + tokens.pop(); + } + return chain; +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19))) -function pageMounted() { - // 通知 Service,View 层已 ready - UniViewJSBridge.publishHandler('onPageReady', {}, this.$page.id); -} -/** - * View 层 Vue 插件 - * 1.init events - * 2.$trigger - * 3.$handleProxy - */ +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -/* harmony default export */ __webpack_exports__["a"] = ({ - install: function install(Vue) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - routes = _ref.routes; - Object(_events__WEBPACK_IMPORTED_MODULE_1__[/* initEvents */ "a"])(); +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; - var findUniTarget = function findUniTarget($event, $el) { - var target = $event.target; - for (; target && target !== $el; target = target.parentNode) { - if (target.tagName && target.tagName.indexOf('UNI-') === 0) { - break; - } - } +/***/ }), +/* 78 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - return target; - }; +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requestComponentObserver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return destroyComponentObserver; }); +/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(114); +/* harmony import */ var intersection_observer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(intersection_observer__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21); - Vue.prototype.$handleEvent = function ($event) { - if ($event instanceof Event) { - // 未处理的 event 对象 需要对 target 校正及包装 - // 查找 uniTarget - var target = findUniTarget($event, this.$el); - $event = _events__WEBPACK_IMPORTED_MODULE_1__[/* processEvent */ "b"].call(this, $event.type, $event, {}, target || $event.target, $event.currentTarget); - } - return $event; - }; - Vue.prototype.$getComponentDescriptor = function (vm, isOwnerInstance) { - return Object(_wxs_component_descriptor__WEBPACK_IMPORTED_MODULE_3__[/* createComponentDescriptor */ "a"])(vm || this, isOwnerInstance); - }; - Vue.prototype.$handleWxsEvent = function ($event) { - if ($event instanceof Event) { - // 未处理的 event 对象 需要对 target 校正及包装 - var currentTarget = $event.currentTarget; +function getRect(rect) { + return { + bottom: rect.bottom, + height: rect.height, + left: rect.left, + right: rect.right, + top: rect.top, + width: rect.width + }; +} // 在相交比很小的情况下,Chrome会返回相交为0 - var instance = currentTarget && currentTarget.__vue__ && currentTarget.__vue__.$getComponentDescriptor(currentTarget.__vue__, false); - $event = _events__WEBPACK_IMPORTED_MODULE_1__[/* processEvent */ "b"].call(this, $event.type, $event, {}, findUniTarget($event, this.$el) || $event.target, $event.currentTarget); - $event.instance = instance; - } +function rectifyIntersectionRatio(entrie) { + var intersectionRatio = entrie.intersectionRatio, + _entrie$boundingClien = entrie.boundingClientRect, + overAllHeight = _entrie$boundingClien.height, + overAllWidth = _entrie$boundingClien.width, + _entrie$intersectionR = entrie.intersectionRect, + intersectionHeight = _entrie$intersectionR.height, + intersectionWidth = _entrie$intersectionR.width; + if (intersectionRatio !== 0) return intersectionRatio; + return intersectionHeight === overAllHeight ? intersectionWidth / overAllWidth : intersectionHeight / overAllHeight; +} - return $event; - }; +var intersectionObservers = {}; +function requestComponentObserver(_ref, pageId) { + var reqId = _ref.reqId, + component = _ref.component, + options = _ref.options; + var pageVm; - Vue.mixin({ - beforeCreate: function beforeCreate() { - var _this = this; + if (pageId._isVue) { + pageVm = pageId; + } else { + var pages = getCurrentPages(); // 跨平台时,View 层也应该实现该方法,举例 App 上,View 层的 getCurrentPages 返回长度为1的当前页面数组 - var options = this.$options; - var wxs = options.wxs; + var page = pages.find(function (page) { + return page.$page.id === pageId; + }); - if (wxs) { - Object.keys(wxs).forEach(function (module) { - _this[module] = wxs[module]; - }); - } + if (!page) { + throw new Error("Not Found\uFF1APage[".concat(pageId, "]")); + } - if (options.behaviors && options.behaviors.length) { - Object(_behaviors__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(options, this); - } + pageVm = page.$vm; + } - if (Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_0__[/* isPage */ "b"])(this)) { - options.mounted = options.mounted ? [].concat(pageMounted, options.mounted) : [pageMounted]; + var $el = Object(_util__WEBPACK_IMPORTED_MODULE_2__[/* findElm */ "b"])(component, pageVm); + var root = options.relativeToSelector ? $el.querySelector(options.relativeToSelector) : null; + var intersectionObserver = intersectionObservers[reqId] = new IntersectionObserver(function (entries, observer) { + entries.forEach(function (entrie) { + UniViewJSBridge.publishHandler('onRequestComponentObserver', { + reqId: reqId, + res: { + intersectionRatio: rectifyIntersectionRatio(entrie), + intersectionRect: getRect(entrie.intersectionRect), + boundingClientRect: getRect(entrie.boundingClientRect), + relativeRect: getRect(entrie.rootBounds), + time: Date.now(), + dataset: Object(uni_helpers_index__WEBPACK_IMPORTED_MODULE_1__[/* getTargetDataset */ "a"])(entrie.target), + id: entrie.target.id } + }); + }); + }, { + root: root, + rootMargin: options.rootMargin, + threshold: options.thresholds + }); + + if (options.observeAll) { + intersectionObserver.USE_MUTATION_OBSERVER = true; + Array.prototype.map.call($el.querySelectorAll(options.selector), function (el) { + if (!el) { + console.warn("Node ".concat(options.selector, " is not found. Intersection observer will not trigger.")); + return; } - }); // TODO 跨平台时,View 层需要注入$page属性 + + intersectionObserver.observe(el); + }); + } else { + intersectionObserver.USE_MUTATION_OBSERVER = false; + var el = $el.querySelector(options.selector); + + if (!el) { + console.warn("Node ".concat(options.selector, " is not found. Intersection observer will not trigger.")); + return; + } + + intersectionObserver.observe(el); } -}); +} +function destroyComponentObserver(_ref2) { + var reqId = _ref2.reqId; + var intersectionObserver = intersectionObservers[reqId]; + + if (intersectionObserver) { + intersectionObserver.disconnect(); + delete intersectionObservers[reqId]; + UniViewJSBridge.publishHandler('onRequestComponentObserver', { + reqId: reqId, + reqEnd: true + }); + } +} /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), @@ -15613,3551 +16361,12085 @@ function pageMounted() { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createComponentDescriptor; }); -/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return requestMediaQueryObserver; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return destroyMediaQueryObserver; }); +var mediaQueryObservers = {}; +var listeners = {}; // 用公用对象存储监听器 +// 拼接媒体查询条件 -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function handleMediaQueryStr($props) { + var mediaQueryStr = []; + var propsMenu = ['width', 'minWidth', 'maxWidth', 'height', 'minHeight', 'maxHeight', 'orientation']; -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + for (var _i = 0, _propsMenu = propsMenu; _i < _propsMenu.length; _i++) { + var item = _propsMenu[_i]; + if (item !== 'orientation' && $props[item] !== '' && Number($props[item]) >= 0) { + mediaQueryStr.push("(".concat(humpToLine(item), ": ").concat(Number($props[item]), "px)")); + } -var CLASS_RE = /^\s+|\s+$/g; -var WXS_CLASS_RE = /\s+/; + if (item === 'orientation' && $props[item]) { + mediaQueryStr.push("(".concat(humpToLine(item), ": ").concat($props[item], ")")); + } + } -function getWxsClsArr(clsArr, classList, isAdd) { - var wxsClsArr = []; + mediaQueryStr = mediaQueryStr.join(' and '); + return mediaQueryStr; +} - var _checkClassList = function checkClassList(cls) { - if (isAdd) { - _checkClassList = function checkClassList(cls) { - return !classList.contains(cls); - }; - } else { - _checkClassList = function checkClassList(cls) { - return classList.contains(cls); - }; - } +function humpToLine(name) { + return name.replace(/([A-Z])/g, '-$1').toLowerCase(); +} // 请求媒体查询对象 - return _checkClassList(cls); + +function requestMediaQueryObserver(_ref) { + var reqId = _ref.reqId, + options = _ref.options; + // 创建一个媒体查询对象 + var mediaQueryObserver = mediaQueryObservers[reqId] = window.matchMedia(handleMediaQueryStr(options)); // 创建一个监听器 + + var listener = listeners[reqId] = function (e) { + UniViewJSBridge.publishHandler('onRequestMediaQueryObserver', { + reqId: reqId, + res: e.matches + }); }; - clsArr.forEach(function (cls) { - cls = cls.replace(CLASS_RE, ''); - _checkClassList(cls) && wxsClsArr.push(cls); - }); - return wxsClsArr; + listener(mediaQueryObserver); // 监听前执行一次媒体查询 + + mediaQueryObserver.addListener(listener); +} // 销毁媒体查询对象 + +function destroyMediaQueryObserver(_ref2) { + var reqId = _ref2.reqId; + var listener = listeners[reqId]; // 需要移除的某个监听 + + var mediaQueryObserver = mediaQueryObservers[reqId]; + + if (mediaQueryObserver) { + mediaQueryObserver.removeListener(listener); // 移除监听 + + delete mediaQueryObservers[reqId]; + UniViewJSBridge.publishHandler('onRequestMediaQueryObserver', { + reqId: reqId, + reqEnd: true + }); + } } +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) -function parseStyleText(cssText) { - var res = {}; - var listDelimiter = /;(?![^(]*\))/g; - var propertyDelimiter = /:(.+)/; - cssText.split(listDelimiter).forEach(function (item) { - if (item) { - var tmp = item.split(propertyDelimiter); - tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +module.exports = ['uni-app', 'uni-layout', 'uni-content', 'uni-main', 'uni-top-window', 'uni-left-window', 'uni-right-window', 'uni-tabbar', 'uni-page', 'uni-page-head', 'uni-page-wrapper', 'uni-page-body', 'uni-page-refresh', 'uni-actionsheet', 'uni-modal', 'uni-toast', 'uni-resize-sensor', 'uni-shadow-root', 'uni-ad', 'uni-audio', 'uni-button', 'uni-camera', 'uni-canvas', 'uni-checkbox', 'uni-checkbox-group', 'uni-cover-image', 'uni-cover-view', 'uni-editor', 'uni-form', 'uni-functional-page-navigator', 'uni-icon', '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']; + +/***/ }), +/* 81 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generateId; }); +/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); + +function generateId(vm, parent, version) { + if (!vm.$parent) { + return '-1'; + } + + var vnode = vm.$vnode; + var context = vnode.context; + var id = vnode.data.attrs._i; + + if (version && Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasOwn */ "e"])(vnode.data, 'key')) { + // 补充 key 值 + id = id + ';' + vnode.data.key; + } // slot 内的组件,需要补充 context 的 id,否则可能与内部组件索引值一致,导致 id 冲突 + + + if (context && context !== parent && context._$id) { + if (true) { + console.log('generateId:' + context._$id + ';' + parent._$id + ',' + id); } - }); - return res; + + return context._$id + ';' + parent._$id + ',' + id; + } + + return parent._$id + ',' + id; } -var ComponentDescriptor = /*#__PURE__*/function () { - function ComponentDescriptor(vm) { - _classCallCheck(this, ComponentDescriptor); +/***/ }), +/* 82 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - this.$vm = vm; - this.$el = vm.$el; +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadScript; }); +var scripts = {}; +function loadScript(globalName, src, callback) { + var globalObject = typeof globalName === 'string' ? window[globalName] : globalName; + + if (globalObject) { + callback(); + return; } - _createClass(ComponentDescriptor, [{ - key: "selectComponent", - value: function selectComponent(selector) { - if (!this.$el || !selector) { - return; - } + var callbacks = scripts[src]; - var el = this.$el.querySelector(selector); - return el && el.__vue__ && createComponentDescriptor(el.__vue__, false); - } - }, { - key: "selectAllComponents", - value: function selectAllComponents(selector) { - if (!this.$el || !selector) { - return []; - } + if (!callbacks) { + callbacks = scripts[src] = []; + var script = document.createElement('script'); + script.src = src; + document.body.appendChild(script); - var descriptors = []; - var els = this.$el.querySelectorAll(selector); + script.onload = function () { + callbacks.forEach(function (callback) { + return callback(); + }); + delete scripts[src]; + }; + } - for (var i = 0; i < els.length; i++) { - var el = els[i]; - el.__vue__ && descriptors.push(createComponentDescriptor(el.__vue__, false)); - } + callbacks.push(callback); +} - return descriptors; - } - }, { - key: "setStyle", - value: function setStyle(style) { - if (!this.$el || !style) { - return this; - } +/***/ }), +/* 83 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (typeof style === 'string') { - style = parseStyleText(style); - } +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge, global) {/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(115); +/* harmony import */ var uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(uni_platform_view_index_css__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68); +/* harmony import */ var uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69); +/* harmony import */ var uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(111); +/* harmony import */ var _view_api_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["a"]; }); - if (Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "e"])(style)) { - this.$el.__wxsStyle = style; - this.$vm.$forceUpdate(); - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["b"]; }); - return this; - } - }, { - key: "addClass", - value: function addClass() { - for (var _len = arguments.length, clsArr = new Array(_len), _key = 0; _key < _len; _key++) { - clsArr[_key] = arguments[_key]; - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["c"]; }); - if (!this.$el || !clsArr.length) { - return this; - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["d"]; }); - var wxsClsArr = getWxsClsArr(clsArr, this.$el.classList, true); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["e"]; }); - if (wxsClsArr.length) { - var wxsClass = this.$el.__wxsAddClass || ''; - this.$el.__wxsAddClass = wxsClass + (wxsClass ? ' ' : '') + wxsClsArr.join(' '); - this.$vm.$forceUpdate(); - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["f"]; }); - return this; - } - }, { - key: "removeClass", - value: function removeClass() { - for (var _len2 = arguments.length, clsArr = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - clsArr[_key2] = arguments[_key2]; - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["g"]; }); - if (!this.$el || !clsArr.length) { - return this; - } +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "h", function() { return _view_api_js__WEBPACK_IMPORTED_MODULE_5__["h"]; }); - var classList = this.$el.classList; - var addWxsClsArr = this.$el.__wxsAddClass ? this.$el.__wxsAddClass.split(WXS_CLASS_RE) : []; - var wxsClsArr = getWxsClsArr(clsArr, classList, false); - if (wxsClsArr.length) { - var removeWxsClsArr = []; - wxsClsArr.forEach(function (cls) { - var clsIndex = addWxsClsArr.findIndex(function (oldCls) { - return oldCls === cls; - }); - if (clsIndex !== -1) { - // 在 addWxsClass 中 - addWxsClsArr.splice(clsIndex, 1); - } - removeWxsClsArr.push(cls); - }); - this.$el.__wxsRemoveClass = removeWxsClsArr; - this.$el.__wxsAddClass = addWxsClsArr.join(' '); - this.$vm.$forceUpdate(); - } - return this; - } - }, { - key: "hasClass", - value: function hasClass(cls) { - return this.$el && this.$el.classList.contains(cls); - } - }, { - key: "getDataset", - value: function getDataset() { - return this.$el && this.$el.dataset; - } - }, { - key: "callMethod", - value: function callMethod(funcName) { - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (this.$vm[funcName]) { - this.$vm[funcName](JSON.parse(JSON.stringify(args))); - } else if (this.$vm._$id) { - UniViewJSBridge.publishHandler('onWxsInvokeCallMethod', { - cid: this.$vm._$id, - method: funcName, - args: args - }); - } - } - }, { - key: "requestAnimationFrame", - value: function requestAnimationFrame(callback) { - return global.requestAnimationFrame(callback), this; - } - }, { - key: "getState", - value: function getState() { - return this.$el && (this.$el.__wxsState || (this.$el.__wxsState = {})); - } - }, { - key: "triggerEvent", - value: function triggerEvent(eventName) { - var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - // TODO options - return this.$vm.$emit(eventName, detail), this; - } - }]); - - return ComponentDescriptor; -}(); - -function createComponentDescriptor(vm) { - var isOwnerInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; +global.UniViewJSBridge = { + subscribe: UniViewJSBridge.subscribe, + publishHandler: UniViewJSBridge.publishHandler, + subscribeHandler: UniViewJSBridge.subscribeHandler +}; +global.getCurrentPages = uni_platform_view_framework_page__WEBPACK_IMPORTED_MODULE_3__[/* getCurrentPages */ "a"]; +global.__definePage = uni_platform_page_factory__WEBPACK_IMPORTED_MODULE_2__[/* definePage */ "a"]; +global.Vue = vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]; +vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].use(uni_platform_view_framework_plugins_index__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]); - if (isOwnerInstance && vm && vm.$options.name && vm.$options.name.indexOf('VUni') === 0) { - // ownerInstance 内置组件需要使用父 vm - vm = vm.$parent; - } +__webpack_require__(191); - if (vm && vm.$el) { - if (!vm.$el.__wxsComponentDescriptor) { - vm.$el.__wxsComponentDescriptor = new ComponentDescriptor(vm); - } - return vm.$el.__wxsComponentDescriptor; - } -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(16))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4), __webpack_require__(19))) /***/ }), -/* 80 */ +/* 84 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VDomSync; }); -/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); -/* harmony import */ var _helpers_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81); -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +/* harmony default export */ __webpack_exports__["a"] = ({ + props: { + id: { + type: String, + default: '' + } + }, + created: function created() { + var _this = this; -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + this._addListeners(this.id); // 初始化监听 + this.$watch('id', function (newId, oldId) { + // watch id + _this._removeListeners(oldId, true); + _this._addListeners(newId, true); + }); + }, + beforeDestroy: function beforeDestroy() { + // 销毁时移除 + this._removeListeners(this.id); + }, + methods: { + _addListeners: function _addListeners(id, watch) { + var _this2 = this; -function findParent(vm) { - var parent = vm.$parent; + if (watch && !id) { + // id被置空 + return; + } - while (parent) { - if (parent._$id) { - return parent; - } + var listeners = this.$options.listeners; - parent = parent.$parent; - } -} + if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "g"])(listeners)) { + return; + } -var VDomSync = /*#__PURE__*/function () { - function VDomSync(pageId) { - _classCallCheck(this, VDomSync); + Object.keys(listeners).forEach(function (name) { + if (watch) { + // watch id + if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) { + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]); + } + } else { + if (name.indexOf('@') === 0) { + /* eslint-disable standard/computed-property-even-spacing */ + _this2.$on("uni-".concat(name.substr(1)), _this2[listeners[name]]); + } else if (name.indexOf('uni-') === 0) { + // 完全限定 - this.pageId = pageId; - this.addBatchVData = Object.create(null); - this.updateBatchVData = []; - this.vms = Object.create(null); - } + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.on(name, _this2[listeners[name]]); + } else if (id) { + // scoped - _createClass(VDomSync, [{ - key: "addVData", - value: function addVData(cid) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - this.addBatchVData[cid] = [data, options]; - } - }, { - key: "updateVData", - value: function updateVData(cid) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - this.updateBatchVData.push([cid, data]); - } - }, { - key: "initVm", - value: function initVm(vm) { - vm._$id = Object(_helpers_util__WEBPACK_IMPORTED_MODULE_1__[/* generateId */ "a"])(vm, findParent(vm)); - var vData = this.addBatchVData[vm._$id]; + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.on("uni-".concat(name, "-").concat(_this2.$page.id, "-").concat(id), _this2[listeners[name]]); + } + } + }); + }, + _removeListeners: function _removeListeners(id, watch) { + var _this3 = this; - if (!vData) { - console.error('cid unmatched', vm); - vData = { - data: {}, - options: {} - }; - } else { - delete this.addBatchVData[vm._$id]; + if (watch && !id) { + // id之前不存在 + return; } - var _vData = vData, - _vData2 = _slicedToArray(_vData, 2), - data = _vData2[0], - options = _vData2[1]; + var listeners = this.$options.listeners; - Object.assign(vm.$options, options); - vm.$r = data || Object.create(null); - this.vms[vm._$id] = vm; - } - }, { - key: "sendUIEvent", - value: function sendUIEvent(cid, nid, event) { - UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* VD_SYNC */ "h"], { - data: [[_constants__WEBPACK_IMPORTED_MODULE_0__[/* UI_EVENT */ "f"], [[cid, nid, event]]]], - options: { - timestamp: Date.now() - } - }); - } - }, { - key: "clearAddBatchVData", - value: function clearAddBatchVData() { - if (true) { - if (Object.keys(this.addBatchVData).length) { - console.error('this.addBatchVData...=' + JSON.stringify(this.addBatchVData)); - } + if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isPlainObject */ "g"])(listeners)) { + return; } - this.addBatchVData = Object.create(null); - } - }, { - key: "flush", - value: function flush() { - var _this = this; - - this.updateBatchVData.forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - cid = _ref2[0], - data = _ref2[1]; + Object.keys(listeners).forEach(function (name) { + if (watch) { + // watch id + if (name.indexOf('@') !== 0 && name.indexOf('uni-') !== 0) { + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]); + } + } else { + if (name.indexOf('@') === 0) { + /* eslint-disable standard/computed-property-even-spacing */ + _this3.$off("uni-".concat(name.substr(1)), _this3[listeners[name]]); + } else if (name.indexOf('uni-') === 0) { + // 完全限定 - var vm = _this.vms[cid]; + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.off(name, _this3[listeners[name]]); + } else if (id) { + // scoped - if (!vm) { - return console.error("Not found ".concat(cid)); + /* eslint-disable standard/computed-property-even-spacing */ + UniViewJSBridge.off("uni-".concat(name, "-").concat(_this3.$page.id, "-").concat(id), _this3[listeners[name]]); + } } - - Object.keys(data).forEach(function (cid) { - Object.assign(vm.$r[cid] || (vm.$r[cid] = Object.create(null)), data[cid]); - }); - vm.$forceUpdate(); }); - this.updateBatchVData.length = 0; } - }]); - - return VDomSync; -}(); + } +}); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) /***/ }), -/* 81 */ +/* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generateId; }); -function generateId(vm, parent) { - if (!vm.$parent) { - return '-1'; - } +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); - var vnode = vm.$vnode; - var context = vnode.context; // slot 内的组件,需要补充 context 的 id,否则可能与内部组件索引值一致,导致 id 冲突 +/* harmony default export */ __webpack_exports__["a"] = ({ + // 取消id的定义,某些组件(canvas)内不在props内定义id + // props: { + // id: { + // type: String, + // default: '' + // } + // }, + mounted: function mounted() { + var _this = this; - if (context && context !== parent && context._$id) { - if (true) { - console.log('generateId:' + context._$id + ';' + parent._$id + ',' + vnode.data.attrs._i); - } - - return context._$id + ';' + parent._$id + ',' + vnode.data.attrs._i; - } - - return parent._$id + ',' + vnode.data.attrs._i; -} - -/***/ }), -/* 82 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + this._toggleListeners('subscribe', this.id); // 初始化监听 -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return showPage; }); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + this.$watch('id', function (newId, oldId) { + // watch id + _this._toggleListeners('unsubscribe', oldId, true); -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + _this._toggleListeners('subscribe', newId, true); + }); + }, + beforeDestroy: function beforeDestroy() { + // 销毁时移除 + this._toggleListeners('unsubscribe', this.id); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + if (this._contextId) { + this._toggleListeners('unsubscribe', this._contextId); + } + }, + methods: { + _toggleListeners: function _toggleListeners(type, id, watch) { + if (watch && !id) { + // id被置空 + return; + } -var plus_; -var weex_; -var BroadcastChannel_; + if (!Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* isFn */ "f"])(this._handleSubscribe)) { + return; + } // 纠正VUniVideo等组件命名为Video -function getRuntime() { - return (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' ? 'webview' : 'v8'; -} -function getPageId() { - return plus_.webview.currentWebview().id; -} + UniViewJSBridge[type](this.$page.id + '-' + this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase() + '-' + id, this._handleSubscribe); + }, + _getContextInfo: function _getContextInfo() { + var id = "context-".concat(this._uid); -var channel; -var globalEvent; -var callbacks = {}; + if (!this._contextId) { + this._toggleListeners('subscribe', id); -function onPlusMessage(res) { - var message = res.data && res.data.__message; + this._contextId = id; + } - if (!message || !message.__page) { - return; + return { + name: this.$options.name.replace(/VUni([A-Z])/, '$1').toLowerCase(), + id: id, + page: this.$page.id + }; + } } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - var pageId = message.__page; - var callback = callbacks[pageId]; - callback && callback(message); +/***/ }), +/* 86 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (!message.keep) { - delete callbacks[pageId]; - } -} +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony import */ var uni_shared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); +/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25); +/* harmony import */ var _interact__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26); -function addEventListener(pageId, callback) { - if (getRuntime() === 'v8') { - if (BroadcastChannel_) { - channel && channel.close(); - channel = new BroadcastChannel_(getPageId()); - channel.onmessage = onPlusMessage; - } else if (!globalEvent) { - globalEvent = weex_.requireModule('globalEvent'); - globalEvent.addEventListener('plusMessage', onPlusMessage); - } - } else { - window.__plusMessage = onPlusMessage; - } - callbacks[pageId] = callback; -} -var Page = /*#__PURE__*/function () { - function Page(webview) { - _classCallCheck(this, Page); - this.webview = webview; +UniViewJSBridge.subscribe('getSelectedTextRange', function (_ref) { + var pageId = _ref.pageId, + callbackId = _ref.callbackId; + var activeElement = document.activeElement; + var tagName = activeElement.tagName.toLowerCase(); + var tagNames = ['input', 'textarea']; + var data = {}; + + if (tagNames.includes(tagName)) { + data.errMsg = 'getSelectedTextRange:ok'; + data.start = activeElement.selectionStart; + data.end = activeElement.selectionEnd; + } else { + data.errMsg = 'getSelectedTextRange:fail no focused'; } - _createClass(Page, [{ - key: "sendMessage", - value: function sendMessage(data) { - var message = { - __message: { - data: data - } - }; - var id = this.webview.id; + UniViewJSBridge.publishHandler('onGetSelectedTextRange', { + callbackId: callbackId, + data: data + }, pageId); +}); // App 延迟获取焦点 - if (BroadcastChannel_) { - var _channel = new BroadcastChannel_(id); +var FOCUS_DELAY = 200; +var startTime; +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'Field', + mixins: [_emitter__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], _keyboard__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], _interact__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]], + model: { + prop: 'value', + event: 'update:value' + }, + props: { + value: { + type: [String, Number], + default: '' + }, - _channel.postMessage(message); + /** + * 已废弃属性,用于历史兼容 + */ + autoFocus: { + type: [Boolean, String], + default: false + }, + focus: { + type: [Boolean, String], + default: false + }, + cursor: { + type: [Number, String], + default: -1 + }, + selectionStart: { + type: [Number, String], + default: -1 + }, + selectionEnd: { + type: [Number, String], + default: -1 + } + }, + data: function data() { + return { + composing: false, + valueSync: this._getValueString(this.value), + focusSync: this.focus, + // Safari 14 以上修正禁用状态颜色 + fixColor: String(navigator.vendor).indexOf('Apple') === 0 && CSS.supports('image-orientation:from-image') + }; + }, + watch: { + focus: function focus(val) { + if (val) { + this._focus(); } else { - plus_.webview.postMessageToUniNView(message, id); + this._blur(); } + }, + focusSync: function focusSync(val) { + this.$emit('update:focus', val); + }, + cursorNumber: function cursorNumber() { + this._checkCursor(); + }, + selectionStartNumber: function selectionStartNumber() { + this._checkSelection(); + }, + selectionEndNumber: function selectionEndNumber() { + this._checkSelection(); } - }, { - key: "close", - value: function close() { - this.webview.close(); + }, + computed: { + needFocus: function needFocus() { + return this.autoFocus || this.focus; + }, + cursorNumber: function cursorNumber() { + var cursor = Number(this.cursor); + return isNaN(cursor) ? -1 : cursor; + }, + selectionStartNumber: function selectionStartNumber() { + var selectionStart = Number(this.selectionStart); + return isNaN(selectionStart) ? -1 : selectionStart; + }, + selectionEndNumber: function selectionEndNumber() { + var selectionEnd = Number(this.selectionEnd); + return isNaN(selectionEnd) ? -1 : selectionEnd; } - }]); + }, + created: function created() { + var _this = this; - return Page; -}(); + var valueChange = this.__valueChange = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* debounce */ "c"])(function (val) { + _this.valueSync = _this._getValueString(val); + }, 100); + this.$watch('value', valueChange); + this.__triggerInput = Object(uni_shared__WEBPACK_IMPORTED_MODULE_0__[/* throttle */ "l"])(function ($event, detail) { + _this.__valueChange.cancel(); -function showPage(_ref) { - var _ref$context = _ref.context, - context = _ref$context === void 0 ? {} : _ref$context, - url = _ref.url, - _ref$data = _ref.data, - data = _ref$data === void 0 ? {} : _ref$data, - _ref$style = _ref.style, - style = _ref$style === void 0 ? {} : _ref$style, - onMessage = _ref.onMessage, - onClose = _ref.onClose; - // eslint-disable-next-line - plus_ = context.plus || plus; // eslint-disable-next-line + _this.$emit('update:value', detail.value); - weex_ = context.weex || ((typeof weex === "undefined" ? "undefined" : _typeof(weex)) === 'object' ? weex : null); // eslint-disable-next-line + _this.$trigger('input', $event, detail); + }, 100); - BroadcastChannel_ = context.BroadcastChannel || ((typeof BroadcastChannel === "undefined" ? "undefined" : _typeof(BroadcastChannel)) === 'object' ? BroadcastChannel : null); - var titleNView = { - autoBackButton: true, - titleSize: '17px' - }; - var pageId = "page".concat(Date.now()); - style = Object.assign({}, style); + this.$triggerInput = function ($event, detail, force) { + _this.__valueChange.cancel(); - if (style.titleNView !== false && style.titleNView !== 'none') { - style.titleNView = Object.assign(titleNView, style.titleNView); - } + _this.__triggerInput($event, detail); - var defaultStyle = { - top: 0, - bottom: 0, - usingComponents: {}, - popGesture: 'close', - scrollIndicator: 'none', - animationType: 'pop-in', - animationDuration: 200, - uniNView: { - path: "".concat((typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && Object({"NODE_ENV":"development","BASE_URL":"/"}) && Object({"NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_TEMPLATE_PATH || '', "/").concat(url, ".js"), - defaultFontSize: plus_.screen.resolutionWidth / 20, - viewport: plus_.screen.resolutionWidth - } - }; - style = Object.assign(defaultStyle, style); - var page = plus_.webview.create('', pageId, style, { - extras: { - from: getPageId(), - runtime: getRuntime(), - data: data, - useGlobalEvent: !BroadcastChannel_ - } - }); - page.addEventListener('close', onClose); - addEventListener(pageId, function (message) { - if (typeof onMessage === 'function') { - onMessage(message.data); - } + if (force) { + _this.__triggerInput.flush(); + } + }; + }, + beforeDestroy: function beforeDestroy() { + this.__valueChange.cancel(); - if (!message.keep) { - page.close('auto'); + this.__triggerInput.cancel(); + }, + directives: { + field: { + inserted: function inserted(el, binding, vnode) { + vnode.context._initField(el); + } } - }); - page.show(style.animationType, style.animationDuration); - return new Page(page); -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(72))) - -/***/ }), -/* 83 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + }, + methods: { + _getValueString: function _getValueString(value) { + return value === null ? '' : String(value); + }, + _initField: function _initField(el) { + var _this2 = this; -"use strict"; + this._field = el; + startTime = startTime || Date.now(); -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ register; }); + if (this.needFocus) { + setTimeout(function () { + _this2._focus(); + }); + } + }, + _focus: function _focus() { + if (!this.needFocus) { + return; + } -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/divider.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + var field = this._field; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (!field || true && !window.plus) { + setTimeout(this._focus.bind(this), 100); + return; + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + if (false) {} else { + var timeout = FOCUS_DELAY - (Date.now() - startTime); -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + if (timeout > 0) { + setTimeout(this._focus.bind(this), timeout); + return; + } -function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + field.focus(); // 无用户交互的 webview 需主动显示键盘(安卓) -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + if (!this.userInteract) { + plus.key.showSoftKeybord(); + } + } + }, + _blur: function _blur() { + var field = this._field; + field && field.blur(); + }, + _onFocus: function _onFocus($event) { + this.focusSync = true; + this.$trigger('focus', $event, { + value: this.valueSync + }); // 从 watch:focusSync 中移出到这里。在watcher中如果focus初始值为ture,则不会执行以下逻辑 -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + this._checkSelection(); -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + this._checkCursor(); + }, + _onBlur: function _onBlur($event) { + // iOS 输入法 compositionend 事件可能晚于 blur + if (this.composing) { + this.composing = false; -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + this._onInput($event, true); + } -/* harmony default export */ var divider = (function (Quill) { - var BlockEmbed = Quill.import('blots/block/embed'); + this.focusSync = false; + var field = $event.target; + var cursor; - var Divider = /*#__PURE__*/function (_BlockEmbed) { - _inherits(Divider, _BlockEmbed); + if (field.type === 'number') { + field.type = 'text'; + cursor = field.selectionEnd; + field.type = 'number'; + } else { + cursor = field.selectionEnd; + } - var _super = _createSuper(Divider); + this.$trigger('blur', $event, { + value: this.valueSync, + cursor: cursor + }); + }, + _checkSelection: function _checkSelection() { + var field = this._field; - function Divider() { - _classCallCheck(this, Divider); + if (this.focusSync && this.selectionStartNumber > -1 && this.selectionEndNumber > -1 && field.type !== 'number') { + field.selectionStart = this.selectionStartNumber; + field.selectionEnd = this.selectionEndNumber; + } + }, + _checkCursor: function _checkCursor() { + var field = this._field; - return _super.apply(this, arguments); + if (this.focusSync && this.selectionStartNumber < 0 && this.selectionEndNumber < 0 && this.cursorNumber > -1 && field.type !== 'number') { + field.selectionEnd = field.selectionStart = this.cursorNumber; + } } + } +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) - return Divider; - }(BlockEmbed); +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { - Divider.blotName = 'divider'; - Divider.tagName = 'HR'; - return { - 'formats/divider': Divider - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/ins.js -function ins_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ins_typeof = function _typeof(obj) { return typeof obj; }; } else { ins_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ins_typeof(obj); } +"use strict"; +// Top level file is just a mixin of submodules & constants -function ins_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function ins_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ins_setPrototypeOf(subClass, superClass); } +var assign = __webpack_require__(11).assign; -function ins_setPrototypeOf(o, p) { ins_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ins_setPrototypeOf(o, p); } +var deflate = __webpack_require__(120); +var inflate = __webpack_require__(123); +var constants = __webpack_require__(92); -function ins_createSuper(Derived) { return function () { var Super = ins_getPrototypeOf(Derived), result; if (ins_isNativeReflectConstruct()) { var NewTarget = ins_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ins_possibleConstructorReturn(this, result); }; } +var pako = {}; -function ins_possibleConstructorReturn(self, call) { if (call && (ins_typeof(call) === "object" || typeof call === "function")) { return call; } return ins_assertThisInitialized(self); } +assign(pako, deflate, inflate, constants); -function ins_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +module.exports = pako; -function ins_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } -function ins_getPrototypeOf(o) { ins_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ins_getPrototypeOf(o); } +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { -/* harmony default export */ var ins = (function (Quill) { - var Inline = Quill.import('blots/inline'); +"use strict"; - var Ins = /*#__PURE__*/function (_Inline) { - ins_inherits(Ins, _Inline); - var _super = ins_createSuper(Ins); +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It isn't worth it to make additional optimizations as in original. +// Small size is preferable. - function Ins() { - ins_classCallCheck(this, Ins); +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. - return _super.apply(this, arguments); - } +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; - return Ins; - }(Inline); + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; - Ins.blotName = 'ins'; - Ins.tagName = 'INS'; - return { - 'formats/ins': Ins - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/align.js -/* harmony default export */ var align = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope, - Attributor = _Quill$import.Attributor; + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); - var config = { - scope: Scope.BLOCK, - whitelist: ['left', 'right', 'center', 'justify'] - }; - var AlignStyle = new Attributor.Style('align', 'text-align', config); - return { - 'formats/align': AlignStyle - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/direction.js -/* harmony default export */ var direction = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope, - Attributor = _Quill$import.Attributor; + s1 %= 65521; + s2 %= 65521; + } - var config = { - scope: Scope.BLOCK, - whitelist: ['rtl'] - }; - var DirectionStyle = new Attributor.Style('direction', 'direction', config); - return { - 'formats/direction': DirectionStyle - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/list.js -function list_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { list_typeof = function _typeof(obj) { return typeof obj; }; } else { list_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return list_typeof(obj); } + return (s1 | (s2 << 16)) |0; +} -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function list_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +module.exports = adler32; -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { -function list_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) list_setPrototypeOf(subClass, superClass); } +"use strict"; -function list_setPrototypeOf(o, p) { list_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return list_setPrototypeOf(o, p); } -function list_createSuper(Derived) { return function () { var Super = list_getPrototypeOf(Derived), result; if (list_isNativeReflectConstruct()) { var NewTarget = list_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return list_possibleConstructorReturn(this, result); }; } +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. -function list_possibleConstructorReturn(self, call) { if (call && (list_typeof(call) === "object" || typeof call === "function")) { return call; } return list_assertThisInitialized(self); } +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. -function list_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; -function list_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } -function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } + return table; +} -function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = list_getPrototypeOf(object); if (object === null) break; } return object; } +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); -function list_getPrototypeOf(o) { list_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return list_getPrototypeOf(o); } -/* harmony default export */ var list = (function (Quill) { - var Parchment = Quill.import('parchment'); - var Container = Quill.import('blots/container'); - var ListItem = Quill.import('formats/list/item'); +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; - var List = /*#__PURE__*/function (_Container) { - list_inherits(List, _Container); + crc ^= -1; - var _super = list_createSuper(List); + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } - _createClass(List, null, [{ - key: "create", - value: function create(value) { - var tagName = value === 'ordered' ? 'OL' : 'UL'; + return (crc ^ (-1)); // >>> 0; +} - var node = _get(list_getPrototypeOf(List), "create", this).call(this, tagName); - if (value === 'checked' || value === 'unchecked') { - node.setAttribute('data-checked', value === 'checked'); - } +module.exports = crc32; - return node; - } - }, { - key: "formats", - value: function formats(domNode) { - if (domNode.tagName === 'OL') return 'ordered'; - if (domNode.tagName === 'UL') { - if (domNode.hasAttribute('data-checked')) { - return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; - } else { - return 'bullet'; - } - } +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { - return undefined; - } - }]); +"use strict"; +// String encode/decode helpers - function List(domNode) { - var _this; - list_classCallCheck(this, List); - _this = _super.call(this, domNode); +var utils = __webpack_require__(11); - var listEventHandler = function listEventHandler(e) { - if (e.target.parentNode !== domNode) return; - var format = _this.statics.formats(domNode); +// Quick check if we can use fast array to bin string conversion +// +// - apply(Array) can fail on Android 2.2 +// - apply(Uint8Array) can fail on iOS 5.1 Safari +// +var STR_APPLY_OK = true; +var STR_APPLY_UIA_OK = true; - var blot = Parchment.find(e.target); +try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } +try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } - if (format === 'checked') { - blot.format('list', 'unchecked'); - } else if (format === 'unchecked') { - blot.format('list', 'checked'); - } - }; - domNode.addEventListener('click', listEventHandler); - return _this; - } +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new utils.Buf8(256); +for (var q = 0; q < 256; q++) { + _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start - _createClass(List, [{ - key: "format", - value: function format(name, value) { - if (this.children.length > 0) { - this.children.tail.format(name, value); - } - } - }, { - key: "formats", - value: function formats() { - // We don't inherit from FormatBlot - return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; } - }, { - key: "insertBefore", - value: function insertBefore(blot, ref) { - if (blot instanceof ListItem) { - _get(list_getPrototypeOf(List.prototype), "insertBefore", this).call(this, blot, ref); - } else { - var index = ref == null ? this.length() : ref.offset(this); - var after = this.split(index); - after.parent.insertBefore(blot, after); - } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; } - }, { - key: "optimize", - value: function optimize(context) { - _get(list_getPrototypeOf(List.prototype), "optimize", this).call(this, context); + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } - var next = this.next; + return buf; +}; - if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { - next.moveChildren(this); - next.remove(); - } - } - }, { - key: "replace", - value: function replace(target) { - if (target.statics.blotName !== this.statics.blotName) { - var item = Parchment.create(this.statics.defaultChild); - target.moveChildren(item); - this.appendChild(item); - } +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // On Chrome, the arguments in a function call that are allowed is `65534`. + // If the length of the buffer is smaller than that, we can use this optimization, + // otherwise we will take a slower path. + if (len < 65534) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } - _get(list_getPrototypeOf(List.prototype), "replace", this).call(this, target); - } - }]); + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} - return List; - }(Container); - List.blotName = 'list'; - List.scope = Parchment.Scope.BLOCK_BLOT; - List.tagName = ['OL', 'UL']; - List.defaultChild = 'list-item'; - List.allowedChildren = [ListItem]; - return { - 'formats/list': List - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/background.js -/* harmony default export */ var background = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope; +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; - var BackgroundStyle = Quill.import('formats/background'); - var BackgroundColorStyle = new BackgroundStyle.constructor('backgroundColor', 'background-color', { - scope: Scope.INLINE - }); - return { - 'formats/backgroundColor': BackgroundColorStyle - }; -}); -// EXTERNAL MODULE: ./src/shared/index.js + 7 modules -var shared = __webpack_require__(1); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/box.js +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; -/* harmony default export */ var box = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope, - Attributor = _Quill$import.Attributor; - var config = { - scope: Scope.BLOCK - }; - var margin = ['margin', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight']; - var padding = ['padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight']; - var result = {}; - margin.concat(padding).forEach(function (name) { - result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["f" /* kebabCase */])(name), config); - }); - return result; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/font.js +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; -/* harmony default export */ var formats_font = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope, - Attributor = _Quill$import.Attributor; + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); - var config = { - scope: Scope.INLINE - }; - var font = ['font', 'fontSize', 'fontStyle', 'fontVariant', 'fontWeight', 'fontFamily']; - var result = {}; - font.forEach(function (name) { - result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["f" /* kebabCase */])(name), config); - }); - return result; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/text.js + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } -/* harmony default export */ var formats_text = (function (Quill) { - var _Quill$import = Quill.import('parchment'), - Scope = _Quill$import.Scope, - Attributor = _Quill$import.Attributor; + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } - var text = [{ - name: 'lineHeight', - scope: Scope.BLOCK - }, { - name: 'letterSpacing', - scope: Scope.INLINE - }, { - name: 'textDecoration', - scope: Scope.INLINE - }, { - name: 'textIndent', - scope: Scope.BLOCK - }]; - var result = {}; - text.forEach(function (_ref) { - var name = _ref.name, - scope = _ref.scope; - result["formats/".concat(name)] = new Attributor.Style(name, Object(shared["f" /* kebabCase */])(name), { - scope: scope - }); - }); - return result; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/image.js -/* harmony default export */ var formats_image = (function (Quill) { - var Image = Quill.import('formats/image'); + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } - Image.sanitize = function (url) { - return url; - }; -}); -// CONCATENATED MODULE: ./src/core/view/components/editor/formats/index.js + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + return buf2binstring(utf16buf, out); +}; +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; -function register(Quill) { - var formats = { - divider: divider, - ins: ins, - align: align, - direction: direction, - list: list, - background: background, - box: box, - font: formats_font, - text: formats_text, - image: formats_image - }; - var options = {}; - Object.values(formats).forEach(function (value) { - return Object.assign(options, value(Quill)); - }); - Quill.register(options, true); -} /***/ }), -/* 84 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -// EXTERNAL MODULE: ./src/core/helpers/tags.js -var tags = __webpack_require__(67); -var tags_default = /*#__PURE__*/__webpack_require__.n(tags); - -// EXTERNAL MODULE: ./src/core/helpers/index.js -var helpers = __webpack_require__(6); - -// CONCATENATED MODULE: ./src/core/vue.js -// 使用白名单过滤(前期有一批自定义组件使用了 uni-) +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; -function initVue(Vue) { - Vue.config.errorHandler = function (err) { - var app = typeof getApp === 'function' && getApp(); - if (app && Object(helpers["a" /* hasLifecycleHook */])(app.$options, 'onError')) { - app.__call_hook('onError', err); - } else { - console.error(err); - } - }; +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { - var oldIsReservedTag = Vue.config.isReservedTag; +"use strict"; - Vue.config.isReservedTag = function (tag) { - return tags_default.a.indexOf(tag) !== -1 || oldIsReservedTag(tag); - }; - Vue.config.ignoredElements = tags_default.a; - var oldGetTagNamespace = Vue.config.getTagNamespace; - var conflictTags = ['switch', 'image', 'text', 'view']; +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; - Vue.config.getTagNamespace = function (tag) { - if (~conflictTags.indexOf(tag)) { - // svg 部分标签名称与 uni 标签冲突 - return false; - } - return oldGetTagNamespace(tag) || false; - }; -} -// EXTERNAL MODULE: ./src/core/view/plugins/index.js -var plugins = __webpack_require__(78); +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { -// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-real-path.js + 1 modules -var get_real_path = __webpack_require__(65); +exports.nextTick = function nextTick(fn) { + var args = Array.prototype.slice.call(arguments); + args.shift(); + setTimeout(function () { + fn.apply(null, args); + }, 0); +}; -// EXTERNAL MODULE: ./src/platforms/app-plus/view/framework/plugins/data.js -var data = __webpack_require__(14); +exports.platform = exports.arch = +exports.execPath = exports.title = 'browser'; +exports.pid = 1; +exports.browser = true; +exports.env = {}; +exports.argv = []; -// CONCATENATED MODULE: ./src/platforms/app-plus/view/framework/plugins/event.js +exports.binding = function (name) { + throw new Error('No such module. (Possibly not yet loaded)') +}; -function initEvent(Vue) { - // 部分组件内部使用了$page - Object.defineProperty(Vue.prototype, '$page', { - get: function get() { - return getCurrentPages()[0].$page; - } - }); +(function () { + var cwd = '/'; + var path; + exports.cwd = function () { return cwd }; + exports.chdir = function (dir) { + if (!path) path = __webpack_require__(158); + cwd = path.resolve(dir, cwd); + }; +})(); - Vue.prototype.$handleVModelEvent = function (nid, value) { - data["b" /* vd */].sendUIEvent(this._$id, nid, { - type: 'input', - target: { - value: value - } - }); - }; +exports.exit = exports.kill = +exports.umask = exports.dlopen = +exports.uptime = exports.memoryUsage = +exports.uvCounters = function() {}; +exports.features = {}; - Vue.prototype.$handleViewEvent = function ($vueEvent) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // const isCustomEvent = $vueEvent._processed // 自定义事件已提前处理过 - if (options.stop) { - $vueEvent.stopPropagation(); - } +/***/ }), +/* 94 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - if (options.prevent) { - $vueEvent.preventDefault(); - } +"use strict"; +/* WEBPACK VAR INJECTION */(function(UniViewJSBridge) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return navigateTo; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return navigateBack; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return reLaunch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return redirectTo; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return switchTab; }); +/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); - var $event = this.$handleEvent($vueEvent); - var cid = this._$id; - var currentTarget = $vueEvent.$origCurrentTarget || $vueEvent.currentTarget; // 当自定义组件根节点触发事件时,nid 补充前缀,避免与组件内部 nid 冲突(根组件page不需要) - var nid = (currentTarget === this.$el && this.$options.mpType !== 'page' ? 'r-' : '') + $event.options.nid; +function invokeApi(method) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + UniViewJSBridge.publishHandler(_constants__WEBPACK_IMPORTED_MODULE_0__[/* INVOKE_API */ "b"], { + data: { + method: method, + args: args + }, + options: { + timestamp: Date.now() + } + }); +} - if (typeof nid === 'undefined') { - return console.error("[".concat(cid, "] nid not found")); - } // 移除无用属性 +function navigateTo(args) { + invokeApi('navigateTo', args); +} +function navigateBack(args) { + invokeApi('navigateBack', args); +} +function reLaunch(args) { + invokeApi('reLaunch', args); +} +function redirectTo(args) { + invokeApi('redirectTo', args); +} +function switchTab(args) { + invokeApi('switchTab', args); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4))) +/***/ }), +/* 95 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { - delete $event._processed; - delete $event.mp; - delete $event.preventDefault; - delete $event.stopPropagation; - delete $event.options; - delete $event.$origCurrentTarget; // 实时发送,延迟的话,会导致 touch 类事件被合并,影响实际业务逻辑,比如 touchstart 中修改变量为 true,touchend 修改为 false +"use strict"; - data["b" /* vd */].sendUIEvent(cid, nid, $event); - }; +// EXPORTS +__webpack_require__.d(__webpack_exports__, "h", function() { return /* reexport */ upx2px; }); +__webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ api["b" /* navigateTo */]; }); +__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ api["a" /* navigateBack */]; }); +__webpack_require__.d(__webpack_exports__, "e", function() { return /* reexport */ api["c" /* reLaunch */]; }); +__webpack_require__.d(__webpack_exports__, "f", function() { return /* reexport */ api["d" /* redirectTo */]; }); +__webpack_require__.d(__webpack_exports__, "g", function() { return /* reexport */ api["e" /* switchTab */]; }); +__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ getSystemInfoSync; }); +__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ canIUse; }); + +// CONCATENATED MODULE: ./src/core/service/api/base/upx2px.js +var EPS = 1e-4; +var BASE_DEVICE_WIDTH = 750; +var isIOS = false; +var deviceWidth = 0; +var deviceDPR = 0; + +function checkDeviceWidth() { + var _uni$getSystemInfoSyn = uni.getSystemInfoSync(), + platform = _uni$getSystemInfoSyn.platform, + pixelRatio = _uni$getSystemInfoSyn.pixelRatio, + windowWidth = _uni$getSystemInfoSyn.windowWidth; + + deviceWidth = windowWidth; + deviceDPR = pixelRatio; + isIOS = platform === 'ios'; +} + +function checkValue(value, defaultValue) { + value = Number(value); + return isNaN(value) ? defaultValue : value; } -// CONCATENATED MODULE: ./src/platforms/app-plus/view/framework/plugins/index.js +function upx2px(number, newDeviceWidth) { + if (deviceWidth === 0) { + checkDeviceWidth(); + } + number = Number(number); + if (number === 0) { + return 0; + } + var config = __uniConfig.globalStyle || __uniConfig.window || {}; + var maxWidth = checkValue(config.rpxCalcMaxDeviceWidth, 960); + var baseWidth = checkValue(config.rpxCalcBaseDeviceWidth, 375); + var includeWidth = checkValue(config.rpxCalcIncludeWidth, 750); + var width = newDeviceWidth || deviceWidth; + width = number === includeWidth || width <= maxWidth ? width : baseWidth; + var result = number / BASE_DEVICE_WIDTH * width; -/* harmony default export */ var framework_plugins = __webpack_exports__["a"] = ({ - install: function install(Vue, options) { - if (true) { - Vue.config.productionTip = false; - Vue.config.performance = true; - } + if (result < 0) { + result = -result; + } - Vue.prototype._$getRealPath = get_real_path["a" /* default */]; - initVue(Vue); - plugins["a" /* default */].install(Vue, options); - Object(data["a" /* initData */])(Vue); - initEvent(Vue); + result = Math.floor(result + EPS); + + if (result === 0) { + if (deviceDPR === 1 || !isIOS) { + result = 1; + } else { + result = 0.5; + } } + + return number < 0 ? -result : result; +} +// EXTERNAL MODULE: ./src/platforms/app-plus/view/api/index.js +var api = __webpack_require__(94); + +// EXTERNAL MODULE: ./src/platforms/app-plus/helpers/get-window-offset.js +var get_window_offset = __webpack_require__(14); + +// CONCATENATED MODULE: ./src/platforms/app-plus/helpers/uuid.js +var deviceId; +/* harmony default export */ var uuid = (function () { + deviceId = deviceId || plus.device.uuid; + return deviceId; }); +// EXTERNAL MODULE: ./node_modules/safe-area-insets/out/index.js +var out = __webpack_require__(6); +var out_default = /*#__PURE__*/__webpack_require__.n(out); -/***/ }), -/* 85 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./src/platforms/h5/service/api/device/get-system-info.js -"use strict"; -// EXPORTS -__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ initBehaviors; }); -// EXTERNAL MODULE: ./src/shared/index.js + 7 modules -var shared = __webpack_require__(1); +var ua = navigator.userAgent; +/** + * 是否安卓设备 + */ -// EXTERNAL MODULE: ./src/core/view/mixins/index.js + 2 modules -var mixins = __webpack_require__(2); +var isAndroid = /android/i.test(ua); +/** + * 是否iOS设备 + */ -// CONCATENATED MODULE: ./src/core/view/plugins/behaviors/form-field.js +var get_system_info_isIOS = /iphone|ipad|ipod/i.test(ua); /** - * uni://form-field + * 是否是Windows设备 */ +var isWindows = ua.match(/Windows NT ([\d|\d.\d]*)/i); +/** + * 是否是Mac设备 + */ +var isMac = /Macintosh|Mac/i.test(ua); +/** + * 是否是Linux设备 + */ -function created() { - this.$dispatch('Form', 'uni-form-group-update', { - type: 'add', - vm: this - }); -} +var isLinux = /Linux|X11/i.test(ua); +/** + * 是否是iPadOS + */ -function beforeDestroy() { - this.$dispatch('Form', 'uni-form-group-update', { - type: 'remove', - vm: this - }); -} +var isIPadOS = isMac && navigator.maxTouchPoints > 0; +/** + * 获取系统信息-同步 + */ -/* harmony default export */ var form_field = ({ - name: 'uni://form-field', - init: function init(options, vm) { - if (!vm.constructor.options.props || !vm.constructor.options.props.name || !vm.constructor.options.props.value) { - // 未初始化 props - if (!vm.constructor.options.props) { - vm.constructor.options.props = {}; - } +function getSystemInfoSync() { + var screen = window.screen; + var pixelRatio = window.devicePixelRatio; // 横屏时 iOS 获取的屏幕宽高颠倒,进行纠正 - if (!vm.constructor.options.props.name) { - vm.constructor.options.props.name = options.props.name = { - type: String - }; - } + var screenFix = /^Apple/.test(navigator.vendor) && typeof window.orientation === 'number'; + var landscape = screenFix && Math.abs(window.orientation) === 90; + var screenWidth = screenFix ? Math[landscape ? 'max' : 'min'](screen.width, screen.height) : screen.width; + var screenHeight = screenFix ? Math[landscape ? 'min' : 'max'](screen.height, screen.width) : screen.height; + var windowWidth = Math.min(window.innerWidth, document.documentElement.clientWidth, screenWidth) || screenWidth; + var windowHeight = window.innerHeight; + var language = navigator.language; + var statusBarHeight = out_default.a.top; + var osname; + var osversion; + var model; - if (!vm.constructor.options.props.value) { - vm.constructor.options.props.value = options.props.value = { - type: null - }; - } - } + if (get_system_info_isIOS) { + osname = 'iOS'; + var osversionFind = ua.match(/OS\s([\w_]+)\slike/); - if (!options.propsData) { - options.propsData = {}; + if (osversionFind) { + osversion = osversionFind[1].replace(/_/g, '.'); } - var $vnode = vm.$vnode; + var modelFind = ua.match(/\(([a-zA-Z]+);/); - if ($vnode && $vnode.data && $vnode.data.attrs) { - if (Object(shared["c" /* hasOwn */])($vnode.data.attrs, 'name')) { - options.propsData.name = $vnode.data.attrs.name; - } + if (modelFind) { + model = modelFind[1]; + } + } else if (isAndroid) { + osname = 'Android'; // eslint-disable-next-line no-useless-escape - if (Object(shared["c" /* hasOwn */])($vnode.data.attrs, 'value')) { - options.propsData.value = $vnode.data.attrs.value; - } + var _osversionFind = ua.match(/Android[\s/]([\w\.]+)[;\s]/); + + if (_osversionFind) { + osversion = _osversionFind[1]; } - if (!vm.constructor.options.methods || !vm.constructor.options.methods._getFormData) { - // 未初始化 methods - if (!vm.constructor.options.methods) { - vm.constructor.options.methods = {}; - } + var infoFind = ua.match(/\((.+?)\)/); + var infos = infoFind ? infoFind[1].split(';') : ua.split(' '); // eslint-disable-next-line no-useless-escape - if (!options.methods) { - options.methods = {}; + var otherInfo = [/\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]; + + for (var i = 0; i < infos.length; i++) { + var info = infos[i]; + + if (info.indexOf('Build') > 0) { + model = info.split('Build')[0].trim(); + break; } - var formMethods = { - _getFormData: function _getFormData() { - return this.name ? { - key: this.name, - value: this.value - } : {}; - }, - _resetFormData: function _resetFormData() { - this.value = ''; + var other = void 0; + + for (var o = 0; o < otherInfo.length; o++) { + if (otherInfo[o].test(info)) { + other = true; + break; } - }; - Object.assign(vm.constructor.options.methods, formMethods); - Object.assign(options.methods, formMethods); // add $dispatch + } - Object.assign(vm.constructor.options.methods, mixins["a" /* emitter */].methods); - Object.assign(options.methods, mixins["a" /* emitter */].methods); - var createdHooks = options.created; - vm.constructor.options.created = options.created = createdHooks ? [].concat(created, createdHooks) : [created]; - var beforeDestroyHooks = options.beforeDestroy; - vm.constructor.options.beforeDestroy = options.beforeDestroy = beforeDestroyHooks ? [].concat(beforeDestroy, beforeDestroyHooks) : [beforeDestroy]; + if (!other) { + model = info.trim(); + break; + } } - } -}); -// CONCATENATED MODULE: ./src/core/view/plugins/behaviors/index.js -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + } else if (isIPadOS) { + model = 'iPad'; + osname = 'iOS'; + osversion = typeof window.BigInt === 'function' ? '14.0' : '13.0'; + } else if (isWindows || isMac || isLinux) { + model = 'PC'; + var _osversionFind2 = ua.match(/\((.+?)\)/)[1]; + + if (isWindows) { + osname = 'Windows'; + osversion = ''; + + switch (isWindows[1]) { + case '5.1': + osversion = 'XP'; + break; + case '6.0': + osversion = 'Vista'; + break; + case '6.1': + osversion = '7'; + break; -var behaviors = _defineProperty({}, form_field.name, form_field); - -function initBehaviors(options, vm) { - options.behaviors.forEach(function (name) { - var behavior = behaviors[name]; - behavior && behavior.init(options, vm); - }); -} + case '6.2': + osversion = '8'; + break; -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { + case '6.3': + osversion = '8.1'; + break; -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// addapted from the document.currentScript polyfill by Adam Miller -// MIT license -// source: https://github.com/amiller-gh/currentScript-polyfill + case '10.0': + osversion = '10'; + break; + } -// added support for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1620505 + var framework = _osversionFind2.match(/[Win|WOW]([\d]+)/); -(function (root, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}(typeof self !== 'undefined' ? self : this, function () { - function getCurrentScript () { - if (document.currentScript) { - return document.currentScript - } - - // IE 8-10 support script readyState - // IE 11+ & Firefox support stack trace - try { - throw new Error(); - } - catch (err) { - // Find the second match for the "at" string to get file src url from stack. - var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, - ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, - stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), - scriptLocation = (stackDetails && stackDetails[1]) || false, - line = (stackDetails && stackDetails[2]) || false, - currentLocation = document.location.href.replace(document.location.hash, ''), - pageSource, - inlineScriptSourceRegExp, - inlineScriptSource, - scripts = document.getElementsByTagName('script'); // Live NodeList collection - - if (scriptLocation === currentLocation) { - pageSource = document.documentElement.outerHTML; - inlineScriptSourceRegExp = new RegExp('(?:[^\\n]+?\\n){0,' + (line - 2) + '}[^<]* diff --git a/src/platforms/h5/components/app/customTabBar.vue b/src/platforms/h5/components/app/customTabBar.vue index 2cf0d9738931c0e4a043880295310b74b98831ec..ad59518986097aa534cddb1d601dafc6d8dc1e4c 100644 --- a/src/platforms/h5/components/app/customTabBar.vue +++ b/src/platforms/h5/components/app/customTabBar.vue @@ -1,49 +1,51 @@ @@ -140,4 +142,4 @@ export default { + diff --git a/src/platforms/h5/components/system-routes/choose-location/index.vue b/src/platforms/h5/components/system-routes/choose-location/index.vue index 42d3840cd8559dcf3254d489cc9b8c2cc92fe491..6bf292a0f2a1a2bc8a27b904ec336e607a55711f 100644 --- a/src/platforms/h5/components/system-routes/choose-location/index.vue +++ b/src/platforms/h5/components/system-routes/choose-location/index.vue @@ -198,7 +198,7 @@ export default { this.list.push({ name: item.title, address: item.address, - distance: item._distance, + distance: item._distance || item.distance, latitude: item.location.lat, longitude: item.location.lng }) @@ -265,6 +265,28 @@ export default { }, () => { this.loading = false }) + } else if (mapInfo.type === MapType.AMAP) { + const self = this + + window.AMap.plugin('AMap.PlaceSearch', function () { + const placeSearch = new window.AMap.PlaceSearch({ + city: '全国', + pageSize: 10, + pageIndex: self.pageIndex + }) + const keyword = self.searching ? self.keyword : '' + const radius = self.searching ? 50000 : 5000 + placeSearch.searchNearBy(keyword, [self.longitude, self.latitude], radius, function (status, result) { + if (status === 'error') { + console.error(result) + } else if (status === 'no_data') { + self.hasNextPage = false + } else { + self.pushData(result.poiList.pois) + } + }) + self.loading = false + }) } }, loadMore () { diff --git a/src/platforms/h5/components/system-routes/open-location/index.vue b/src/platforms/h5/components/system-routes/open-location/index.vue index c595186e1dc0badffa5015e3a32ba7e7901c8b16..139c5cca86534452e568b8e9d84e3f7dadc71137 100644 --- a/src/platforms/h5/components/system-routes/open-location/index.vue +++ b/src/platforms/h5/components/system-routes/open-location/index.vue @@ -7,29 +7,29 @@ :markers="[marker, location]" @regionchange="onRegionChange" > -
-
{{ name }}
-
{{ address }}
-
- @@ -147,6 +147,11 @@ export default { }%2C${this.longitude}&from=${encodeURIComponent( '我的位置' )}&to=${encodeURIComponent(this.name || '目的地')}&ref=${mapInfo.key}` + } else if (mapInfo.type === MapType.AMAP) { + url = `https://m.amap.com/navi/?dest=${this.longitude},${this.latitude}&key=${mapInfo.key}` + if (this.name) { + url += `&destName=${this.name}` + } } window.open(url) } diff --git a/src/platforms/h5/helpers/location.js b/src/platforms/h5/helpers/location.js index ab61ef7ddc099b8a8c2cb3284d5b24a42aec0dcd..f00476e9368485db04908553d1a7960d674bb9e2 100644 --- a/src/platforms/h5/helpers/location.js +++ b/src/platforms/h5/helpers/location.js @@ -6,21 +6,35 @@ export const ICON_PATH_TARGET = export const MapType = { QQ: 'qq', GOOGLE: 'google', + AMAP: 'AMap', UNKNOWN: '' } export function getMapInfo () { - let type = MapType.UNKNOWN - let key = '' if (__uniConfig.qqMapKey) { - type = MapType.QQ - key = __uniConfig.qqMapKey - } else if (__uniConfig.googleMapKey) { - type = MapType.GOOGLE - key = __uniConfig.googleMapKey + return { + type: MapType.QQ, + key: __uniConfig.qqMapKey + } + } + if (__uniConfig.googleMapKey) { + return { + type: MapType.GOOGLE, + key: __uniConfig.googleMapKey + } + } + if (__uniConfig.aMapKey) { + return { + type: MapType.AMAP, + key: __uniConfig.aMapKey, + securityJsCode: __uniConfig.aMapSecurityJsCode, + serviceHost: __uniConfig.aMapServiceHost + } } return { - type, - key + type: MapType.UNKNOWN, + key: '' } } + +export const IS_AMAP = getMapInfo().type === MapType.AMAP diff --git a/src/platforms/h5/service/api/device/clipboard.js b/src/platforms/h5/service/api/device/clipboard.js index cb5d416ef11551afb269c213ca9cb0dcd8664dd8..4f473b41be85fbd74758295237ad08783ec24954 100644 --- a/src/platforms/h5/service/api/device/clipboard.js +++ b/src/platforms/h5/service/api/device/clipboard.js @@ -26,8 +26,8 @@ export function setClipboardData ({ textarea.style.zIndex = '-9999' document.body.appendChild(textarea) textarea.value = data - textarea.focus() textarea.select() + textarea.setSelectionRange(0, textarea.value.length) const result = document.execCommand('Copy', false, null) textarea.blur() if (result) { diff --git a/src/platforms/h5/service/api/location/get-location.js b/src/platforms/h5/service/api/location/get-location.js index 7a77e83dc67ebfb35f0fda7d48aeddbfbfdc8f14..64f40c434eccaf3a8a8e7e0cb6ba3bfbb97f4936 100644 --- a/src/platforms/h5/service/api/location/get-location.js +++ b/src/platforms/h5/service/api/location/get-location.js @@ -5,6 +5,7 @@ import { MapType, getMapInfo } from '../../../helpers/location' +import { loadMaps } from '../../../view/components/map/maps' /** * 获取定位信息 @@ -72,24 +73,52 @@ export function getLocation ({ } }) }).then((coords, skip) => { - if (type.toUpperCase() === 'WGS84' || mapInfo.type !== MapType.QQ || skip) { + const wgs84Map = [MapType.GOOGLE] + if (type.toUpperCase() === 'WGS84' || wgs84Map.includes(mapInfo.type) || skip) { return coords } - return new Promise((resolve, reject) => { - getJSONP(`https://apis.map.qq.com/jsapi?qt=translate&type=1&points=${coords.longitude},${coords.latitude}&key=${mapInfo.key}&output=jsonp&pf=jsapi&ref=jsapi`, { - callback: 'cb' - }, (res) => { - if ('detail' in res && 'points' in res.detail && res.detail.points.length) { - const location = res.detail.points[0] - resolve(Object.assign({}, coords, { - longitude: location.lng, - latitude: location.lat - })) - } else { - resolve(coords) - } - }, () => resolve(coords)) - }) + + if (mapInfo.type === MapType.QQ) { + return new Promise((resolve) => { + getJSONP(`https://apis.map.qq.com/jsapi?qt=translate&type=1&points=${coords.longitude},${coords.latitude}&key=${mapInfo.key}&output=jsonp&pf=jsapi&ref=jsapi`, { + callback: 'cb' + }, (res) => { + if ('detail' in res && 'points' in res.detail && res.detail.points.length) { + const location = res.detail.points[0] + resolve(Object.assign({}, coords, { + longitude: location.lng, + latitude: location.lat + })) + } else { + resolve(coords) + } + }, () => resolve(coords)) + }) + } + + if (mapInfo.type === MapType.AMAP) { + return new Promise((resolve) => { + loadMaps([], () => { + window.AMap.convertFrom( + [coords.longitude, coords.latitude], + 'gps', + (_, res) => { + if (res.info === 'ok' && res.locations.length) { + const { lat, lng } = res.locations[0] + resolve( + Object.assign({}, coords, { + longitude: lng, + latitude: lat + }) + ) + } else { + resolve(coords) + } + } + ) + }) + }) + } }).then(coords => { invoke(callbackId, Object.assign(coords, { errMsg: 'getLocation:ok', diff --git a/src/platforms/h5/view/components/map/index.vue b/src/platforms/h5/view/components/map/index.vue index 6cb7368c64850d318cc3d293e64901d28cc2d67a..e7ed397fb670df598281ca4b798bd22a3ac9a1ca 100644 --- a/src/platforms/h5/view/components/map/index.vue +++ b/src/platforms/h5/view/components/map/index.vue @@ -1,6 +1,7 @@