diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index c499196b9643a396e84778a5f6d7b5f1b90111ad..5d14111e99aa7f0c86086cecc716706eef7b010a 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -1136,6 +1136,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index 7848bc284ba011d83cc15fd3a1f6bfb43fcbd7ff..741537389fea209b91b5ef64ea0b2ab4e570431b 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -639,9 +639,23 @@ const protocols = { // 需要做转换的 API 列表 }, scanCode: { name: 'scan', - args: { - onlyFromCamera: 'hideAlbum', - scanType: false + args (fromArgs) { + if (fromArgs.scanType === 'qrCode') { + fromArgs.type = 'qr'; + return { + onlyFromCamera: 'hideAlbum' + } + } else if (fromArgs.scanType === 'barCode') { + fromArgs.type = 'bar'; + return { + onlyFromCamera: 'hideAlbum' + } + } else { + return { + scanType: false, + onlyFromCamera: 'hideAlbum' + } + } }, returnValue: { code: 'result' @@ -1523,6 +1537,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index dfc0744230a6b1b57484a0ae7a9895b135b6e956..ad818b63098eac710dbe3ea6589908f1e4ac1b82 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -1282,6 +1282,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index c652f30d648a53f4b9793a00bc3c54bf4fba8898..34ae0d814c7d65e72ae59614ef23c273a7e24d99 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -1200,6 +1200,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 3b05a63eaa50026e142bfdf71a29a99960cbf9f8..c3e2995381ca575248cd2bfa8d017f7a80072f03 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -1292,6 +1292,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index edf83377285768c3fecbc71fb0773ae133b185e8..8225c9260afe829c7f05bcb2a234d5910cd6fb97 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -231,7 +231,7 @@ const promiseInterceptor = { }; const SYNC_API_RE = - /^\$|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; + /^\$|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/; const CONTEXT_API_RE = /^create|Manager$/; @@ -1140,6 +1140,10 @@ function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this); initMocks(this, mocks); + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store; + } } } }); diff --git a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js index 2f001597c1d41fc9bab0e894440d4a9d331518ce..8a0b759cdd62e3a68869e69b5a3dd3a7397ef6e3 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js @@ -39,6 +39,10 @@ export default function parseBaseApp (vm, { if (this.mpType !== 'app') { initRefs(this) initMocks(this, mocks) + } else { + if (this.$options.store) { // vuex store + Vue.prototype.$store = this.$options.store + } } } })