提交 882dc3f5 编写于 作者: fxy060608's avatar fxy060608

fix(v3): remove promisify logic (wx) https://ask.dcloud.net.cn/question/90807

上级 951bd143
...@@ -1446,8 +1446,12 @@ var serviceContext = (function () { ...@@ -1446,8 +1446,12 @@ var serviceContext = (function () {
} }
}, },
protocols: { protocols: {
type: Array, // 微信文档虽然写的是数组,但是可以正常传递字符串
type: [Array, String],
validator (value, params) { validator (value, params) {
if (typeof value === 'string') {
value = [value];
}
params.protocols = (value || []).filter(str => typeof str === 'string'); params.protocols = (value || []).filter(str => typeof str === 'string');
} }
} }
...@@ -8543,6 +8547,10 @@ var serviceContext = (function () { ...@@ -8543,6 +8547,10 @@ var serviceContext = (function () {
plus.navigator.setStatusBarStyle(frontColor === '#000000' ? 'dark' : 'light'); plus.navigator.setStatusBarStyle(frontColor === '#000000' ? 'dark' : 'light');
const style = webview.getStyle(); const style = webview.getStyle();
if (style && style.titleNView) { if (style && style.titleNView) {
if (style.titleNView.autoBackButton) {
styles.backButton = styles.backButton || {};
styles.backButton.color = frontColor;
}
webview.setStyle({ webview.setStyle({
titleNView: styles titleNView: styles
}); });
...@@ -8708,7 +8716,8 @@ var serviceContext = (function () { ...@@ -8708,7 +8716,8 @@ var serviceContext = (function () {
}, callbackId) { }, callbackId) {
const options = { const options = {
buttons: itemList.map(item => ({ buttons: itemList.map(item => ({
title: item title: item,
color: itemColor
})) }))
}; };
if (title) { if (title) {
...@@ -12006,6 +12015,16 @@ var serviceContext = (function () { ...@@ -12006,6 +12015,16 @@ var serviceContext = (function () {
}); });
} }
const wx = Object.create(null);
apis_1.forEach(name => {
if (api$2[name]) {
wx[name] = wrapper(name, api$2[name]);
} else {
wx[name] = wrapperUnimplemented(name);
}
});
function callHook (vm, hook, params) { function callHook (vm, hook, params) {
vm = vm.$vm || vm; vm = vm.$vm || vm;
return vm.__call_hook && vm.__call_hook(hook, params) return vm.__call_hook && vm.__call_hook(hook, params)
...@@ -13488,6 +13507,9 @@ var serviceContext = (function () { ...@@ -13488,6 +13507,9 @@ var serviceContext = (function () {
} }
}; };
// 挂靠在uni上,暂不做全局导出
uni$1.__$wx__ = wx;
UniServiceJSBridge.publishHandler = publishHandler; UniServiceJSBridge.publishHandler = publishHandler;
UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler; UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler;
......
...@@ -26,7 +26,7 @@ function hasOwn (obj, key) { ...@@ -26,7 +26,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key) return hasOwnProperty.call(obj, key)
} }
function noop () { } function noop () {}
/** /**
* Create a cached version of a pure function. * Create a cached version of a pure function.
...@@ -807,5 +807,7 @@ function Behavior (options) { ...@@ -807,5 +807,7 @@ function Behavior (options) {
const nextTick = Vue.nextTick; const nextTick = Vue.nextTick;
export default uni; var index = uni.__$wx__;
export default index;
export { Behavior, Component, Page, nextTick }; export { Behavior, Component, Page, nextTick };
...@@ -49,4 +49,4 @@ export function Behavior (options) { ...@@ -49,4 +49,4 @@ export function Behavior (options) {
export const nextTick = Vue.nextTick export const nextTick = Vue.nextTick
export default uni export default uni.__$wx__
...@@ -10,6 +10,10 @@ import { ...@@ -10,6 +10,10 @@ import {
publishHandler publishHandler
} from 'uni-platform/service/publish-handler' } from 'uni-platform/service/publish-handler'
import {
wx
} from './wx'
import { import {
definePage definePage
} from '../page-factory' } from '../page-factory'
...@@ -26,6 +30,9 @@ import { ...@@ -26,6 +30,9 @@ import {
import vuePlugin from './framework/plugins' import vuePlugin from './framework/plugins'
// 挂靠在uni上,暂不做全局导出
uni.__$wx__ = wx
UniServiceJSBridge.publishHandler = publishHandler UniServiceJSBridge.publishHandler = publishHandler
UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler
......
import apis from '../../../../lib/apis'
import {
wrapper,
wrapperUnimplemented
} from 'uni-helpers/api'
import api from 'uni-service-api'
export const wx = Object.create(null)
apis.forEach(name => {
if (api[name]) {
wx[name] = wrapper(name, api[name])
} else {
wx[name] = wrapperUnimplemented(name)
}
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册