提交 1a97104c 编写于 作者: inkwalk's avatar inkwalk

fix(weixin): protocol showActionSheet, title -> alertText

上级 459c0452
......@@ -4,5 +4,6 @@ export { getSystemInfo } from './getSystemInfo'
export { getSystemInfoSync } from './getSystemInfoSync'
export { redirectTo } from './redirectTo'
export { previewImage } from './previewImage'
export { showActionSheet } from './showActionSheet'
export { navigateTo, initEventChannel, getEventChannel } from './navigateTo'
export * from './types'
import { MPProtocol } from './types'
export const showActionSheet: MPProtocol = {
args(
fromArgs: UniApp.ShowActionSheetOptions,
toArgs: WechatMiniprogram.ShowActionSheetOption
) {
toArgs.alertText = fromArgs.title
},
}
......@@ -52,6 +52,7 @@ export {
getSystemInfoSync,
addSafeAreaInsets,
useDeviceId,
showActionSheet,
} from './api/protocols'
// types
export { MiniProgramAppOptions, MiniProgramAppInstance } from './runtime/app'
......
......@@ -17,10 +17,6 @@ function invokeCreateVueAppHook(app) {
createVueAppHooks.forEach((hook) => hook(app));
}
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
......@@ -72,6 +68,10 @@ E.prototype = {
};
var E$1 = E;
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -958,6 +958,12 @@ const previewImage = {
},
};
const showActionSheet = {
args(fromArgs, toArgs) {
toArgs.alertText = fromArgs.title;
},
};
const mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
const getProvider = initGetProvider({
......@@ -988,17 +994,18 @@ function createSelectorQuery() {
}
var shims = /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider,
createSelectorQuery: createSelectorQuery
__proto__: null,
getProvider: getProvider,
createSelectorQuery: createSelectorQuery
});
var protocols = /*#__PURE__*/Object.freeze({
__proto__: null,
redirectTo: redirectTo,
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfoSync
__proto__: null,
redirectTo: redirectTo,
previewImage: previewImage,
getSystemInfo: getSystemInfo,
getSystemInfoSync: getSystemInfoSync,
showActionSheet: showActionSheet
});
var index = initUni(shims, protocols);
......
......@@ -21,13 +21,11 @@ const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
......@@ -50,7 +48,7 @@ function once(fn, ctx = null) {
}
return res;
});
}
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
......@@ -70,8 +68,7 @@ function stringifyQuery(obj, encodeStr = encode) {
.join('&')
: null;
return res ? `?${res}` : '';
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
......@@ -862,12 +859,12 @@ function handleLink(event) {
}
var parseOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
......
......@@ -3,4 +3,5 @@ export {
previewImage,
getSystemInfo,
getSystemInfoSync,
showActionSheet,
} from '@dcloudio/uni-mp-core'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册