1&&void 0!==arguments[1]?arguments[1]:{},n=getApp();if(n){var s=!1,c=getCurrentPages();if(c.length?c[c.length-1].$page.meta.isTabBar&&(s=!0):n.$children[0].hasTabBar&&(s=!0),!s)return{errMsg:"".concat(t,":fail not TabBar page")};var u=e.index,l=n.$children[0].tabBar;if(u>=__uniConfig.tabBar.list.length)return{errMsg:"".concat(t,":fail tabbar item not found")};switch(t){case"showTabBar":n.$children[0].hideTabBar=!1;break;case"hideTabBar":n.$children[0].hideTabBar=!0;break;case"setTabBarItem":Object(i["g"])(l.list[u],r,e);break;case"setTabBarStyle":Object(i["g"])(l,a,e);break;case"showTabBarRedDot":Object(i["g"])(l.list[u],o,{badge:"",redDot:!0});break;case"setTabBarBadge":Object(i["g"])(l.list[u],o,{badge:e.text,redDot:!0});break;case"hideTabBarRedDot":case"removeTabBarBadge":Object(i["g"])(l.list[u],o,{badge:"",redDot:!1});break}}return{}}function c(t){return s("setTabBarItem",t)}function u(t){return s("setTabBarStyle",t)}function l(t){return s("hideTabBar",t)}function h(t){return s("showTabBar",t)}function f(t){return s("hideTabBarRedDot",t)}function d(t){return s("showTabBarRedDot",t)}function p(t){return s("removeTabBarBadge",t)}function g(t){return s("setTabBarBadge",t)}},fcd8:function(t,e,n){},ff28:function(t,e,n){"use strict";var i=n("23af"),r=n.n(i);r.a},ffdb:function(t,e,n){},ffdc:function(t,e,n){"use strict";function i(t,e,n,i){var r,a=document.createElement("script"),o=e.callback||"callback",s="__callback"+Date.now(),c=e.timeout||3e4;function u(){clearTimeout(r),delete window[s],a.remove()}window[s]=function(t){"function"===typeof n&&n(t),u()},a.onerror=function(){"function"===typeof i&&i(),u()},r=setTimeout(function(){"function"===typeof i&&i(),u()},c),a.src=t+(t.indexOf("?")>=0?"&":"?")+o+"="+s,document.body.appendChild(a)}n.d(e,"a",function(){return i})}})});
\ No newline at end of file
diff --git a/packages/uni-h5/package.json b/packages/uni-h5/package.json
index 1c8cd2c6b359552e62fbc436f6e5d28551a9a70c..b259e3416c8ba073c4f2b5bc93cc63759833bff0 100644
--- a/packages/uni-h5/package.json
+++ b/packages/uni-h5/package.json
@@ -1,8 +1,13 @@
{
"name": "@dcloudio/uni-h5",
- "version": "0.9.0",
+ "version": "2.0.0-23320190923002",
"description": "uni-app h5",
"main": "dist/index.umd.min.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-h5"
+ },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -13,5 +18,5 @@
"intersection-observer": "^0.7.0",
"safe-area-insets": "^1.4.1"
},
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-mp-alipay/package.json b/packages/uni-mp-alipay/package.json
index a8bd4a34a014481519cc773f03b6c3c8fbbea6bf..b02961ba4d8c22589d529b88ffaaa7046fcea8c4 100644
--- a/packages/uni-mp-alipay/package.json
+++ b/packages/uni-mp-alipay/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/uni-mp-alipay",
- "version": "0.0.827",
- "description": "uni-app mp-alipay",
- "main": "dist/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-mp-alipay",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app mp-alipay",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-mp-alipay"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-mp-baidu/package.json b/packages/uni-mp-baidu/package.json
index d5169d74f31378d2ab577f1a579d55f34a778af8..696f59896ab313ae9276c3604bd119514db19411 100644
--- a/packages/uni-mp-baidu/package.json
+++ b/packages/uni-mp-baidu/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/uni-mp-baidu",
- "version": "0.0.857",
- "description": "uni-app mp-baidu",
- "main": "dist/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-mp-baidu",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app mp-baidu",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-mp-baidu"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-mp-qq/package.json b/packages/uni-mp-qq/package.json
index 25d28440e60a53ea100f0131ef2cbca1fd11afb8..2819b9d5606b3975ac07d98e45a1280672997ca1 100644
--- a/packages/uni-mp-qq/package.json
+++ b/packages/uni-mp-qq/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/uni-mp-qq",
- "version": "0.0.112",
- "description": "uni-app mp-qq",
- "main": "dist/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-mp-qq",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app mp-qq",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-mp-qq"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js
index e421bd56694cf715c9f0c66e1c4fcfbca5777b70..22e409e02f9de00a38f3aeae935ae2942d2da092 100644
--- a/packages/uni-mp-toutiao/dist/index.js
+++ b/packages/uni-mp-toutiao/dist/index.js
@@ -386,21 +386,16 @@ var previewImage = {
// 不支持的 API 列表
const todos = [
- 'getBackgroundAudioManager',
'createCameraContext',
'createLivePlayerContext',
'getSavedFileInfo',
- 'openDocument',
- 'chooseLocation',
'createMapContext',
- 'canIUse',
'onMemoryWarning',
'onGyroscopeChange',
'startGyroscope',
'stopGyroscope',
'setScreenBrightness',
'getScreenBrightness',
- 'onUserCaptureScreen',
'addPhoneContact',
'openBluetoothAdapter',
'startBluetoothDevicesDiscovery',
@@ -439,8 +434,6 @@ const todos = [
'setBackgroundColor',
'setBackgroundTextStyle',
'chooseInvoiceTitle',
- 'navigateToMiniProgram',
- 'navigateBackMiniProgram',
'addTemplate',
'deleteTemplate',
'getTemplateLibraryById',
@@ -450,13 +443,12 @@ const todos = [
'setEnableDebug',
'onWindowResize',
'offWindowResize',
- 'compressImage',
'createOffscreenCanvas',
'vibrate'
];
// 存在兼容性的 API 列表
-// 头条小程序不支持canIUses
+// 头条小程序自1.35.0+支持canIUses
const canIUses = [
// 'createIntersectionObserver',
// 'getSavedFileList',
@@ -472,6 +464,13 @@ const canIUses = [
// 'onSocketClose',
// 'getExtConfig',
// 'getExtConfigSync',
+ // 'navigateToMiniProgram',
+ // 'navigateBackMiniProgram',
+ // 'compressImage',
+ // 'chooseLocation',
+ // 'openDocument',
+ // 'onUserCaptureScreen',
+ // 'getBackgroundAudioManager',
];
// 需要做转换的 API 列表
@@ -1376,21 +1375,45 @@ function isPage () {
function initRefs (vm) {
const mpInstance = vm.$scope;
- mpInstance.selectAllComponents('.vue-ref', (components) => {
- components.forEach(component => {
- const ref = component.dataset.ref;
- vm.$refs[ref] = component.$vm || component;
- });
- });
- mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
- forComponents.forEach(component => {
- const ref = component.dataset.ref;
- if (!vm.$refs[ref]) {
- vm.$refs[ref] = [];
+ /* eslint-disable no-undef */
+ const minorVersion = parseInt(tt.getSystemInfoSync().SDKVersion.split('.')[1]);
+ if (minorVersion > 16) {
+ Object.defineProperty(vm, '$refs', {
+ get () {
+ const $refs = {};
+ const components = mpInstance.selectAllComponents('.vue-ref');
+ components.forEach(component => {
+ const ref = component.dataset.ref;
+ $refs[ref] = component.$vm || component;
+ });
+ const forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
+ forComponents.forEach(component => {
+ const ref = component.dataset.ref;
+ if (!$refs[ref]) {
+ $refs[ref] = [];
+ }
+ $refs[ref].push(component.$vm || component);
+ });
+ return $refs
}
- vm.$refs[ref].push(component.$vm || component);
});
- });
+ } else {
+ mpInstance.selectAllComponents('.vue-ref', (components) => {
+ components.forEach(component => {
+ const ref = component.dataset.ref;
+ vm.$refs[ref] = component.$vm || component;
+ });
+ });
+ mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
+ forComponents.forEach(component => {
+ const ref = component.dataset.ref;
+ if (!vm.$refs[ref]) {
+ vm.$refs[ref] = [];
+ }
+ vm.$refs[ref].push(component.$vm || component);
+ });
+ });
+ }
}
const instances = Object.create(null);
diff --git a/packages/uni-mp-toutiao/package.json b/packages/uni-mp-toutiao/package.json
index 4f917c3e6863e0e0a2140c68d8ecaeecdb0ee2b0..d535e9e10526cbcb55000fd8ca2c9e968300935d 100644
--- a/packages/uni-mp-toutiao/package.json
+++ b/packages/uni-mp-toutiao/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/uni-mp-toutiao",
- "version": "0.0.352",
- "description": "uni-app mp-toutiao",
- "main": "dist/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-mp-toutiao",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app mp-toutiao",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-mp-toutiao"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json
index 37b2b8f5998d0f964726bda8f271e1380bdbea4f..1deae936ae269b7b1e3108578a39b30f6dd301b8 100644
--- a/packages/uni-mp-weixin/package.json
+++ b/packages/uni-mp-weixin/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/uni-mp-weixin",
- "version": "0.0.973",
- "description": "uni-app mp-weixin",
- "main": "dist/index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-mp-weixin",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app mp-weixin",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-mp-weixin"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/uni-stat/dist/index.js b/packages/uni-stat/dist/index.js
index e97f0a6e45517294a03718b2830ba7520a3916d0..43dfe1ec97ae98e7c69c6e677ed95db7c40eb32b 100644
--- a/packages/uni-stat/dist/index.js
+++ b/packages/uni-stat/dist/index.js
@@ -652,12 +652,9 @@ class Util {
// }
},
fail: (e) => {
- // if (process.env.NODE_ENV === 'development') {
- // console.log('stat request fail', e);
- // }
if (++this._retry < 3) {
setTimeout(() => {
- this.request(data);
+ this._sendRequest(optionsData);
}, 1000);
}
}
@@ -836,7 +833,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
- stat.load(options, this);
+ stat.load(options, this);
+ // 重写分享,获取分享上报事件
+ if (this.$scope && this.$scope.onShareAppMessage) {
+ let oldShareAppMessage = this.$scope.onShareAppMessage;
+ this.$scope.onShareAppMessage = function(options) {
+ stat.interceptShare(false);
+ return oldShareAppMessage.call(this, options)
+ };
+ }
},
onShow() {
isHide = false;
@@ -855,17 +860,14 @@ const lifecycle = {
},
onError(e) {
stat.error(e);
- },
- onShareAppMessage() {
- stat.interceptShare(false);
}
};
function main() {
- const Vue = require('vue');
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
+ const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
diff --git a/packages/uni-stat/package.json b/packages/uni-stat/package.json
index a96db93befa30e3d43d9deda84125a1b28f953e1..f8d1cc21da318c9a2f2b999e5bb0a3103d458f8a 100644
--- a/packages/uni-stat/package.json
+++ b/packages/uni-stat/package.json
@@ -1,32 +1,38 @@
-{
- "name": "@dcloudio/uni-stat",
- "version": "0.0.113",
- "description": "",
- "main": "dist/index.js",
- "scripts": {
- "dev": "NODE_ENV=development rollup -w -c rollup.config.js",
- "build": "NODE_ENV=production rollup -c rollup.config.js"
- },
- "files": [
- "dist",
- "package.json",
- "LICENSE"
- ],
- "author": "",
- "license": "Apache-2.0",
- "devDependencies": {
- "@babel/core": "^7.5.5",
- "@babel/preset-env": "^7.5.5",
- "eslint": "^6.1.0",
- "rollup": "^1.19.3",
- "rollup-plugin-babel": "^4.3.3",
- "rollup-plugin-clear": "^2.0.7",
- "rollup-plugin-commonjs": "^10.0.2",
- "rollup-plugin-copy": "^3.1.0",
- "rollup-plugin-eslint": "^7.0.0",
- "rollup-plugin-json": "^4.0.0",
- "rollup-plugin-node-resolve": "^5.2.0",
- "rollup-plugin-replace": "^2.2.0",
- "rollup-plugin-uglify": "^6.0.2"
- }
-}
+{
+ "name": "@dcloudio/uni-stat",
+ "version": "2.0.0-23320190923002",
+ "description": "",
+ "main": "dist/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-stat"
+ },
+ "scripts": {
+ "dev": "NODE_ENV=development rollup -w -c rollup.config.js",
+ "build": "NODE_ENV=production rollup -c rollup.config.js"
+ },
+ "files": [
+ "dist",
+ "package.json",
+ "LICENSE"
+ ],
+ "author": "",
+ "license": "Apache-2.0",
+ "devDependencies": {
+ "@babel/core": "^7.5.5",
+ "@babel/preset-env": "^7.5.5",
+ "eslint": "^6.1.0",
+ "rollup": "^1.19.3",
+ "rollup-plugin-babel": "^4.3.3",
+ "rollup-plugin-clear": "^2.0.7",
+ "rollup-plugin-commonjs": "^10.0.2",
+ "rollup-plugin-copy": "^3.1.0",
+ "rollup-plugin-eslint": "^7.0.0",
+ "rollup-plugin-json": "^4.0.0",
+ "rollup-plugin-node-resolve": "^5.2.0",
+ "rollup-plugin-replace": "^2.2.0",
+ "rollup-plugin-uglify": "^6.0.2"
+ },
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
+}
diff --git a/packages/uni-stat/src/index.js b/packages/uni-stat/src/index.js
index ba2b4026cb3ba23bda3265d53c54c12cfd62b0d9..c5eb42fef38b4bdf39f4d022db32ed006758194a 100644
--- a/packages/uni-stat/src/index.js
+++ b/packages/uni-stat/src/index.js
@@ -9,7 +9,15 @@ const lifecycle = {
stat.ready(this);
},
onLoad(options) {
- stat.load(options, this);
+ stat.load(options, this);
+ // 重写分享,获取分享上报事件
+ if (this.$scope && this.$scope.onShareAppMessage) {
+ let oldShareAppMessage = this.$scope.onShareAppMessage;
+ this.$scope.onShareAppMessage = function(options) {
+ stat.interceptShare(false);
+ return oldShareAppMessage.call(this, options)
+ }
+ }
},
onShow() {
isHide = false
@@ -28,17 +36,14 @@ const lifecycle = {
},
onError(e) {
stat.error(e)
- },
- onShareAppMessage() {
- stat.interceptShare(false)
}
}
function main() {
- const Vue = require('vue');
if (process.env.NODE_ENV === 'development') {
uni.report = function(type, options) {};
}else{
+ const Vue = require('vue');
(Vue.default || Vue).mixin(lifecycle);
uni.report = function(type, options) {
stat.sendEvent(type, options);
diff --git a/packages/uni-stat/src/stat.js b/packages/uni-stat/src/stat.js
index 23b514ed54a988a158da587fa1c74d98b91db2f4..88a74f7b80562449a2b070b9e85fd5668bb9a9af 100644
--- a/packages/uni-stat/src/stat.js
+++ b/packages/uni-stat/src/stat.js
@@ -387,12 +387,9 @@ class Util {
// }
},
fail: (e) => {
- // if (process.env.NODE_ENV === 'development') {
- // console.log('stat request fail', e);
- // }
if (++this._retry < 3) {
setTimeout(() => {
- this.request(data);
+ this._sendRequest(optionsData);
}, 1000);
}
}
diff --git a/packages/uni-template-compiler/package.json b/packages/uni-template-compiler/package.json
index 9a47fee8f952ebd4859b27c8a116fb31c0467ad4..0a1c1b2e28b07c8bc974eeba7fed8055a07f3356 100644
--- a/packages/uni-template-compiler/package.json
+++ b/packages/uni-template-compiler/package.json
@@ -1,21 +1,26 @@
{
- "name": "@dcloudio/uni-template-compiler",
- "version": "0.9.183",
- "description": "uni-template-compiler",
- "main": "lib/index.js",
- "files": [
- "lib"
- ],
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "dependencies": {
- "@babel/parser": "^7.3.3",
- "@babel/traverse": "^7.3.3",
- "@babel/types": "^7.3.3",
- "vue-template-compiler": "^2.6.10"
- },
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/uni-template-compiler",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-template-compiler",
+ "main": "lib/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/uni-template-compiler"
+ },
+ "files": [
+ "lib"
+ ],
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@babel/parser": "^7.3.3",
+ "@babel/traverse": "^7.3.3",
+ "@babel/types": "^7.3.3",
+ "vue-template-compiler": "^2.6.10"
+ },
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/vue-cli-plugin-hbuilderx/package.json b/packages/vue-cli-plugin-hbuilderx/package.json
index 70fa263d9d0710a1abf57e05dff88c19930b8d38..6b5dc8bd3260d023527b807d2673ec343481c19b 100644
--- a/packages/vue-cli-plugin-hbuilderx/package.json
+++ b/packages/vue-cli-plugin-hbuilderx/package.json
@@ -1,17 +1,22 @@
{
- "name": "@dcloudio/vue-cli-plugin-hbuilderx",
- "version": "1.0.137",
- "description": "HBuilderX plugin for vue-cli 3",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "dependencies": {
- "acorn": "^5.2.1",
- "css": "~2.2.1",
- "escodegen": "^1.8.1"
- },
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/vue-cli-plugin-hbuilderx",
+ "version": "2.0.0-23320190923002",
+ "description": "HBuilderX plugin for vue-cli 3",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/vue-cli-plugin-hbuilderx"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "acorn": "^5.2.1",
+ "css": "~2.2.1",
+ "escodegen": "^1.8.1"
+ },
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/vue-cli-plugin-uni-optimize/package.json b/packages/vue-cli-plugin-uni-optimize/package.json
index f16664da52b06c1ac32d2660a1113878b8529bfc..0c0547b4a4cf556eb5dfa547fffb0400a51cfbde 100644
--- a/packages/vue-cli-plugin-uni-optimize/package.json
+++ b/packages/vue-cli-plugin-uni-optimize/package.json
@@ -1,12 +1,17 @@
{
- "name": "@dcloudio/vue-cli-plugin-uni-optimize",
- "version": "0.1.9",
- "description": "uni-app optimize plugin for vue-cli 3",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/vue-cli-plugin-uni-optimize",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app optimize plugin for vue-cli 3",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/vue-cli-plugin-uni-optimize"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/vue-cli-plugin-uni/commands/build.js b/packages/vue-cli-plugin-uni/commands/build.js
index d3b38143750207b189c1f5fff659f8bce3c394f7..4032c1cc1939be191dba22b056998c90b911a0ce 100644
--- a/packages/vue-cli-plugin-uni/commands/build.js
+++ b/packages/vue-cli-plugin-uni/commands/build.js
@@ -54,9 +54,11 @@ async function build (args, api, options) {
stopSpinner
} = require('@vue/cli-shared-utils')
+ const runByAliIde = process.env.BUILD_ENV === 'ali-ide'
+
log()
- if (!runByHBuilderX) {
+ if (!runByHBuilderX && !runByAliIde) {
logWithSpinner(`开始编译当前项目至 ${process.env.UNI_PLATFORM} 平台...`)
}
@@ -107,7 +109,7 @@ async function build (args, api, options) {
return new Promise((resolve, reject) => {
webpack(webpackConfigs, (err, stats) => {
- if (!runByHBuilderX) {
+ if (!runByHBuilderX && !runByAliIde) {
stopSpinner(false)
}
if (err) {
diff --git a/packages/vue-cli-plugin-uni/commands/info.js b/packages/vue-cli-plugin-uni/commands/info.js
index 4a0329bb0482deece1b81c985a5b7de29a223aa5..c2b5983c02f51fc43f3fd0fe46320264e765b91b 100644
--- a/packages/vue-cli-plugin-uni/commands/info.js
+++ b/packages/vue-cli-plugin-uni/commands/info.js
@@ -1,4 +1,5 @@
-console.log('uni-app v' + require('../package.json').version)
+console.log('uni-app v' + require('@dcloudio/webpack-uni-pages-loader/package.json')['uni-app']['compilerVersion'])
+console.log('uni-app cli v' + require('../package.json').version)
console.log(require('chalk').bold('\nEnvironment Info:'))
require('envinfo').run({
System: ['OS', 'CPU'],
diff --git a/packages/vue-cli-plugin-uni/index.js b/packages/vue-cli-plugin-uni/index.js
index 07b4d2b42383c0119df3a88d5286200fb354cdf5..b33a74372576df5e2f461ab7b08c83a8634805f7 100644
--- a/packages/vue-cli-plugin-uni/index.js
+++ b/packages/vue-cli-plugin-uni/index.js
@@ -18,7 +18,7 @@ module.exports = (api, options) => {
const platformOptions = require('./lib/' + process.env.UNI_PLATFORM)
- Object.assign(options, {
+ Object.assign(options, { // TODO 考虑非 HBuilderX 运行时,可以支持自定义输出目录
outputDir: process.env.UNI_OUTPUT_TMP_DIR || process.env.UNI_OUTPUT_DIR,
assetsDir
}, platformOptions.vueConfig)
diff --git a/packages/vue-cli-plugin-uni/lib/chain-webpack.js b/packages/vue-cli-plugin-uni/lib/chain-webpack.js
index 956c8bb6846a9cfbdec1d59db103d48600c42385..5044e042b3e62bc1a849ab31e2468ab0a08e47a2 100644
--- a/packages/vue-cli-plugin-uni/lib/chain-webpack.js
+++ b/packages/vue-cli-plugin-uni/lib/chain-webpack.js
@@ -91,5 +91,8 @@ module.exports = function chainWebpack (platformOptions) {
webpackConfig.plugins.delete('progress')
webpackConfig.plugins.delete('friendly-errors')
}
+ if (process.env.BUILD_ENV === 'ali-ide') {
+ webpackConfig.plugins.delete('progress')
+ }
}
}
diff --git a/packages/vue-cli-plugin-uni/lib/check-update.js b/packages/vue-cli-plugin-uni/lib/check-update.js
index 317dae0ce1efac9f637f38f79d75f6b94ca492eb..d0170a2da68ed3a2b5f7ebec1ac6e1bd0b6884ff 100644
--- a/packages/vue-cli-plugin-uni/lib/check-update.js
+++ b/packages/vue-cli-plugin-uni/lib/check-update.js
@@ -23,12 +23,12 @@ module.exports = async function checkUpdate () {
if (update) {
if (pkg.version.split('.')[0] !== update.latest.split('.')[0]) {
- console.log(`发现 uni-app 新版本 ${update.latest}`)
+ console.log(`发现 uni-app cli 新版本 ${update.latest}`)
console.log(`1.修改 package.json 中 @dcloudio 相关包版本为 ^${update.latest}`)
console.log('2.删除 package-lock.json 或 yarn.lock')
console.log('3.执行 npm install 或 yarn')
} else {
- console.log(`发现 uni-app 新版本 ${update.latest}. 请执行 npm update 升级`)
+ console.log(`发现 uni-app cli 新版本 ${update.latest}. 请执行 npm update 升级`)
}
}
}
diff --git a/packages/vue-cli-plugin-uni/lib/env.js b/packages/vue-cli-plugin-uni/lib/env.js
index 404a4d8d278e96defda0678f6659c904ae9e99c6..8f8cc7d0f09651243e9845631f791461cad7e242 100644
--- a/packages/vue-cli-plugin-uni/lib/env.js
+++ b/packages/vue-cli-plugin-uni/lib/env.js
@@ -29,7 +29,7 @@ process.UNI_LIBRARIES = process.UNI_LIBRARIES || ['@dcloudio/uni-ui']
const {
isSupportSubPackages,
runByHBuilderX,
- isInHBuilderXAlpha,
+ // isInHBuilderXAlpha,
getPagesJson,
getManifestJson
} = require('@dcloudio/uni-cli-shared')
@@ -65,12 +65,14 @@ process.UNI_STAT_CONFIG = {
appid: manifestJsonObj.appid
}
-// fixed by hxy alpha 版默认启用新的框架
-if (isInHBuilderXAlpha) {
- if (!platformOptions.hasOwnProperty('usingComponents')) {
- platformOptions.usingComponents = true
- }
+// 默认启用 自定义组件模式
+// if (isInHBuilderXAlpha) {
+let usingComponentsAbsent = false
+if (!platformOptions.hasOwnProperty('usingComponents')) {
+ usingComponentsAbsent = true
+ platformOptions.usingComponents = true
}
+// }
if (process.env.UNI_PLATFORM === 'h5') {
const optimization = platformOptions.optimization
@@ -169,8 +171,13 @@ if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化
}
}
}
-
-const warningMsg = `uni-app将于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
+
+const warningMsg =
+ usingComponentsAbsent
+ ? `该应用之前可能是非自定义组件模式,目前以自定义组件模式运行。非自定义组件将于2019年11月1日起停止支持。详见:https://ask.dcloud.net.cn/article/36385`
+ : `uni-app将于2019年11月1日起停止支持非自定义组件模式 [详情](https://ask.dcloud.net.cn/article/36385)`
+
+const needWarning = !platformOptions.usingComponents || usingComponentsAbsent
// 输出编译器版本等信息
if (process.env.UNI_PLATFORM !== 'h5') {
try {
@@ -190,21 +197,21 @@ if (process.env.UNI_PLATFORM !== 'h5') {
}).length) {
console.log(info)
console.log(modeText)
- if (!platformOptions.usingComponents) {
+ if (needWarning) {
console.log(warningMsg)
}
console.log('当前nvue编译模式:' + (isNVueCompiler ? 'uni-app' : 'weex') +
' 。编译模式差异见:https://ask.dcloud.net.cn/article/36074')
} else {
console.log(info + ',' + modeText)
- if (!platformOptions.usingComponents) {
- console.log(warningMsg)
+ if (needWarning) {
+ console.log(warningMsg)
}
}
} else {
- console.log(modeText)
- if (!platformOptions.usingComponents) {
- console.log(warningMsg)
+ console.log(modeText)
+ if (needWarning) {
+ console.log(warningMsg)
}
}
} catch (e) {}
diff --git a/packages/vue-cli-plugin-uni/package.json b/packages/vue-cli-plugin-uni/package.json
index da3654f062223ac20cef99f665145e9476dce57c..84118991135cbfbf1635b4a31a302c2ce9eed4b3 100644
--- a/packages/vue-cli-plugin-uni/package.json
+++ b/packages/vue-cli-plugin-uni/package.json
@@ -1,8 +1,13 @@
{
"name": "@dcloudio/vue-cli-plugin-uni",
- "version": "0.9.538",
+ "version": "2.0.0-23320190923002",
"description": "uni-app plugin for vue-cli 3",
"main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/vue-cli-plugin-uni"
+ },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
@@ -12,7 +17,7 @@
"author": "fxy060608",
"license": "Apache-2.0",
"dependencies": {
- "@dcloudio/uni-stat": "*",
+ "@dcloudio/uni-stat": "^2.0.0-23320190923002",
"copy-webpack-plugin": "^4.6.0",
"cross-env": "^5.2.0",
"envinfo": "^6.0.1",
@@ -29,5 +34,5 @@
"wrap-loader": "^0.2.0",
"xregexp": "4.0.0"
},
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/webpack-uni-mp-loader/package.json b/packages/webpack-uni-mp-loader/package.json
index 51488b3ea3929394f439d4688b2bc4f49efd4c48..68a1fbc74241fd0f4a5fc2e7e347aa2121fd44b4 100644
--- a/packages/webpack-uni-mp-loader/package.json
+++ b/packages/webpack-uni-mp-loader/package.json
@@ -1,15 +1,20 @@
{
- "name": "@dcloudio/webpack-uni-mp-loader",
- "version": "0.3.644",
- "description": "webpack-uni-mp-loader",
- "main": "index.js",
- "files": [
- "lib"
- ],
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/webpack-uni-mp-loader",
+ "version": "2.0.0-23320190923002",
+ "description": "webpack-uni-mp-loader",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/webpack-uni-mp-loader"
+ },
+ "files": [
+ "lib"
+ ],
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
index b048939ad23330dbceee0b30d5dc444f6d1d5dec..eaa787d07fc72444fe8601eb4c8f4d0fce0dd5de 100644
--- a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
+++ b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
@@ -390,6 +390,10 @@ module.exports = function (pagesJson, userManifestJson) {
}
}
+ if (!process.env.UNI_USING_COMPONENTS) {
+ manifestJson.plus.launchwebview.kernel = 'UIWebview'
+ }
+
manifest.content = manifestJson
// 分包合并
diff --git a/packages/webpack-uni-pages-loader/package.json b/packages/webpack-uni-pages-loader/package.json
index 9b857ea4b8a5814bd8d64f8d6ee4cdea0e6da463..7432c8c3fcac23d3bde3214f000f5907aceff44a 100644
--- a/packages/webpack-uni-pages-loader/package.json
+++ b/packages/webpack-uni-pages-loader/package.json
@@ -1,22 +1,27 @@
{
- "name": "@dcloudio/webpack-uni-pages-loader",
- "version": "0.2.875",
- "description": "uni-app pages.json loader",
- "main": "lib/index.js",
- "files": [
- "lib"
- ],
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "author": "fxy060608",
- "license": "Apache-2.0",
- "dependencies": {
- "merge": "^1.2.1",
- "strip-json-comments": "^2.0.1"
- },
- "uni-app": {
- "compilerVersion": "2.2.4"
- },
- "gitHead": "08ea04b669e93f0db3acb2dfa38138298edd5789"
+ "name": "@dcloudio/webpack-uni-pages-loader",
+ "version": "2.0.0-23320190923002",
+ "description": "uni-app pages.json loader",
+ "main": "lib/index.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dcloudio/uni-app.git",
+ "directory": "packages/webpack-uni-pages-loader"
+ },
+ "files": [
+ "lib"
+ ],
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "fxy060608",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "merge": "^1.2.1",
+ "strip-json-comments": "^2.0.1"
+ },
+ "uni-app": {
+ "compilerVersion": "2.3.3"
+ },
+ "gitHead": "10184426b19cb76e01c93fb25c982c72887557e8"
}
diff --git a/src/core/helpers/protocol/network/request.js b/src/core/helpers/protocol/network/request.js
index 6709d0e15baa9c93860e707514bd6722a05a4187..0d2c7021699e8da4a69427b51a301c8666af0b39 100644
--- a/src/core/helpers/protocol/network/request.js
+++ b/src/core/helpers/protocol/network/request.js
@@ -77,8 +77,12 @@ export const request = {
header: {
type: Object,
validator (value, params) {
- params.header = value || {}
- params.header['content-type'] = params.header['content-type'] || 'application/json'
+ const header = params.header = value || {}
+ if (params.method !== method.GET) {
+ if (!Object.keys(header).find(key => key.toLowerCase() === 'content-type')) {
+ header['Content-Type'] = 'application/json'
+ }
+ }
}
},
dataType: {
@@ -94,4 +98,4 @@ export const request = {
params.responseType = Object.values(responseType).indexOf(value) < 0 ? responseType.TEXT : value
}
}
-}
+}
diff --git a/src/core/view/bridge/subscribe/index.js b/src/core/view/bridge/subscribe/index.js
index a047a87336df7504e1c616959b431db268037fd7..6cbe94bd59087e2c826dc3bac8735687eed25a91 100644
--- a/src/core/view/bridge/subscribe/index.js
+++ b/src/core/view/bridge/subscribe/index.js
@@ -39,7 +39,7 @@ function updateCssVar (vm) {
}
}
-export default function initSubscribe (subscribe) {
+export default function initSubscribe (subscribe) {
Object.keys(subscribeApis).forEach(name => {
subscribe(name, subscribeApis[name])
})
@@ -88,10 +88,10 @@ export default function initSubscribe (subscribe) {
onReachBottomDistance,
enableTransparentTitleNView
})
- setTimeout(function () { // 避免监听太早,直接触发了 scroll
+ requestAnimationFrame(function () { // 避免监听太早,直接触发了 scroll
document.addEventListener('scroll', scrollListener)
- }, 10)
+ })
}
})
}
-}
+}
diff --git a/src/core/view/bridge/subscribe/scroll.js b/src/core/view/bridge/subscribe/scroll.js
index c0d3dfe911de5b001f2a28e91979d904881a4342..a148d8a3298fb3c419072d0695397f037023cd79 100644
--- a/src/core/view/bridge/subscribe/scroll.js
+++ b/src/core/view/bridge/subscribe/scroll.js
@@ -91,6 +91,10 @@ export function createScrollListener (pageId, {
}
function trigger () {
+ const pages = getCurrentPages()
+ if (!pages.length || pages[pages.length - 1].$page.id !== pageId) {
+ return
+ }
// publish
const scrollTop = window.pageYOffset
if (enablePageScroll) { // 向 Service 发送 onPageScroll 事件
@@ -121,4 +125,4 @@ export function createScrollListener (pageId, {
}
ticking = true
}
-}
+}
diff --git a/src/core/view/plugins/events.js b/src/core/view/plugins/events.js
index ff44b3bcae271886c0c20422d6e3cd266c7edd9e..09a2a3a3f046e7e5ef1863b8bb29b7ff67ef14f7 100644
--- a/src/core/view/plugins/events.js
+++ b/src/core/view/plugins/events.js
@@ -83,8 +83,8 @@ export function processEvent (name, $event = {}, detail = {}, target = {}, curre
target: processTarget(target, detail),
currentTarget: processTarget(currentTarget),
// 只处理系统事件
- touches: $event instanceof Event ? processTouches($event.touches) : $event.touches,
- changedTouches: $event instanceof Event ? processTouches($event.changedTouches) : $event.changedTouches,
+ 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 () { },
stopPropagation () { }
})
@@ -124,15 +124,16 @@ function touchstart (evt) {
startPageX = pageX
startPageY = pageY
- longPressTimer = setTimeout(function () {
- evt.target.dispatchEvent(new CustomEvent('longpress', {
+ longPressTimer = setTimeout(function () {
+ let customEvent = new CustomEvent('longpress', {
bubbles: true,
cancelable: true,
target: evt.target,
- currentTarget: evt.currentTarget,
- touches: evt.touches,
- changedTouches: evt.changedTouches
- }))
+ currentTarget: evt.currentTarget
+ })
+ customEvent.touches = evt.touches
+ customEvent.changedTouches = evt.changedTouches
+ evt.target.dispatchEvent(customEvent)
}, LONGPRESS_TIMEOUT)
}
diff --git a/src/platforms/app-plus/service/api/device/bluetooth.js b/src/platforms/app-plus/service/api/device/bluetooth.js
index 02f755e5e804e3339b609881b40c351f617fba1b..c36dfdc00fdf4e4394446006fab8e3bdb02292aa 100644
--- a/src/platforms/app-plus/service/api/device/bluetooth.js
+++ b/src/platforms/app-plus/service/api/device/bluetooth.js
@@ -1,14 +1,14 @@
import {
invoke,
- publish,
- pack,
- unpack
+ publish,
+ arrayBufferToBase64,
+ base64ToArrayBuffer
} from '../../bridge'
/**
* 执行蓝牙相关方法
*/
-function bluetoothExec (method, callbackId, data = {}) {
+function bluetoothExec (method, callbackId, data = {}, beforeSuccess) {
var deviceId = data.deviceId
if (deviceId) {
data.deviceId = deviceId.toUpperCase()
@@ -20,7 +20,10 @@ function bluetoothExec (method, callbackId, data = {}) {
plus.bluetooth[method.replace('Changed', 'Change')](Object.assign(data, {
success (data) {
- invoke(callbackId, Object.assign({}, pack(data), {
+ if (typeof beforeSuccess === 'function') {
+ beforeSuccess(data)
+ }
+ invoke(callbackId, Object.assign({}, data, {
errMsg: `${method}:ok`,
code: undefined,
message: undefined
@@ -37,9 +40,12 @@ function bluetoothExec (method, callbackId, data = {}) {
/**
* 监听蓝牙相关事件
*/
-function bluetoothOn (method) {
+function bluetoothOn (method, beforeSuccess) {
plus.bluetooth[method.replace('Changed', 'Change')](function (data) {
- publish(method, Object.assign({}, pack(data), {
+ if (typeof beforeSuccess === 'function') {
+ beforeSuccess(data)
+ }
+ publish(method, Object.assign({}, data, {
code: undefined,
message: undefined
}))
@@ -47,6 +53,16 @@ function bluetoothOn (method) {
return true
}
+function checkDevices (data) {
+ data.devices = data.devices.map(device => {
+ var advertisData = device.advertisData
+ if (advertisData && typeof advertisData !== 'string') {
+ device.advertisData = arrayBufferToBase64(advertisData)
+ }
+ return device
+ })
+}
+
var onBluetoothAdapterStateChange
var onBluetoothDeviceFound
var onBLEConnectionStateChange
@@ -67,7 +83,7 @@ export function getBluetoothAdapterState (data, callbackId) {
}
export function startBluetoothDevicesDiscovery (data, callbackId) {
- onBluetoothDeviceFound = onBluetoothDeviceFound || bluetoothOn('onBluetoothDeviceFound')
+ onBluetoothDeviceFound = onBluetoothDeviceFound || bluetoothOn('onBluetoothDeviceFound', checkDevices)
bluetoothExec('startBluetoothDevicesDiscovery', callbackId, data)
}
@@ -76,7 +92,7 @@ export function stopBluetoothDevicesDiscovery (data, callbackId) {
}
export function getBluetoothDevices (data, callbackId) {
- bluetoothExec('getBluetoothDevices', callbackId, {})
+ bluetoothExec('getBluetoothDevices', callbackId, {}, checkDevices)
}
export function getConnectedBluetoothDevices (data, callbackId) {
@@ -102,12 +118,18 @@ export function getBLEDeviceCharacteristics (data, callbackId) {
}
export function notifyBLECharacteristicValueChange (data, callbackId) {
- onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange')
+ onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange',
+ data => {
+ data.value = arrayBufferToBase64(data.value)
+ })
bluetoothExec('notifyBLECharacteristicValueChange', callbackId, data)
}
export function notifyBLECharacteristicValueChanged (data, callbackId) {
- onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange')
+ onBLECharacteristicValueChange = onBLECharacteristicValueChange || bluetoothOn('onBLECharacteristicValueChange',
+ data => {
+ data.value = arrayBufferToBase64(data.value)
+ })
bluetoothExec('notifyBLECharacteristicValueChanged', callbackId, data)
}
@@ -116,5 +138,6 @@ export function readBLECharacteristicValue (data, callbackId) {
}
export function writeBLECharacteristicValue (data, callbackId) {
- bluetoothExec('writeBLECharacteristicValue', callbackId, unpack(data))
+ data.value = base64ToArrayBuffer(data.value)
+ bluetoothExec('writeBLECharacteristicValue', callbackId, data)
}
diff --git a/src/platforms/app-plus/service/api/network/request.js b/src/platforms/app-plus/service/api/network/request.js
index 189ad1f48cb7b6e6abf3e89fb02171d4bfd8b613..fcc30c06197864a40cfd7c8eb1b00d511d1fafe1 100644
--- a/src/platforms/app-plus/service/api/network/request.js
+++ b/src/platforms/app-plus/service/api/network/request.js
@@ -17,7 +17,8 @@ export function createRequestTaskById (requestTaskId, {
data,
header,
method = 'GET',
- responseType
+ responseType,
+ sslVerify = true
} = {}) {
const stream = requireNativePlugin('stream')
const headers = {}
@@ -57,7 +58,9 @@ export function createRequestTaskById (requestTaskId, {
headers,
type: responseType === 'arraybuffer' ? 'base64' : 'text',
// weex 官方文档未说明实际支持 timeout,单位:ms
- timeout: timeout || 6e5
+ timeout: timeout || 6e5,
+ // 配置和weex模块内相反
+ sslVerify: !sslVerify
}
if (method !== 'GET') {
options.body = data
diff --git a/src/platforms/h5/components/page/pageHead.vue b/src/platforms/h5/components/page/pageHead.vue
index d1ec0cf2b415eefd352d8e8022ed50e55d159dfb..f8be0f9e5d44dfb50e03dd1c8430d4ca409c7f0c 100644
--- a/src/platforms/h5/components/page/pageHead.vue
+++ b/src/platforms/h5/components/page/pageHead.vue
@@ -36,7 +36,7 @@
v-if="!searchInput"
class="uni-page-head-bd">
{
- components.forEach(component => {
- const ref = component.dataset.ref
- vm.$refs[ref] = component.$vm || component
- })
- })
- mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
- forComponents.forEach(component => {
- const ref = component.dataset.ref
- if (!vm.$refs[ref]) {
- vm.$refs[ref] = []
+ /* eslint-disable no-undef */
+ const minorVersion = parseInt(tt.getSystemInfoSync().SDKVersion.split('.')[1])
+ if (minorVersion > 16) {
+ Object.defineProperty(vm, '$refs', {
+ get () {
+ const $refs = {}
+ const components = mpInstance.selectAllComponents('.vue-ref')
+ components.forEach(component => {
+ const ref = component.dataset.ref
+ $refs[ref] = component.$vm || component
+ })
+ const forComponents = mpInstance.selectAllComponents('.vue-ref-in-for')
+ forComponents.forEach(component => {
+ const ref = component.dataset.ref
+ if (!$refs[ref]) {
+ $refs[ref] = []
+ }
+ $refs[ref].push(component.$vm || component)
+ })
+ return $refs
}
- vm.$refs[ref].push(component.$vm || component)
})
- })
+ } else {
+ mpInstance.selectAllComponents('.vue-ref', (components) => {
+ components.forEach(component => {
+ const ref = component.dataset.ref
+ vm.$refs[ref] = component.$vm || component
+ })
+ })
+ mpInstance.selectAllComponents('.vue-ref-in-for', (forComponents) => {
+ forComponents.forEach(component => {
+ const ref = component.dataset.ref
+ if (!vm.$refs[ref]) {
+ vm.$refs[ref] = []
+ }
+ vm.$refs[ref].push(component.$vm || component)
+ })
+ })
+ }
}
const instances = Object.create(null)
@@ -77,4 +101,4 @@ export function handleLink ({
vm._isMounted = true
vm.__call_hook('mounted')
vm.__call_hook('onReady')
-}
+}
diff --git a/yarn.lock b/yarn.lock
index af5fd04e488de8bf25b5a69d53901b3e4887b8c8..6948c2fd2160b1ba939db8a0ed299cd3364e9a6d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7934,6 +7934,10 @@ shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
+shell-exec@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.npm.taobao.org/shell-exec/download/shell-exec-1.0.2.tgz#2e9361b0fde1d73f476c4b6671fa17785f696756"
+
shell-quote@^1.6.1:
version "1.6.1"
resolved "https://registry.npm.taobao.org/shell-quote/download/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767"