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

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

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