@dcloudio/uni-app-plus 3.0.0-alpha-3021020211027001 → 3.0.0-alpha-3021220211105004

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,6 +146,54 @@ var serviceContext = (function (vue) {
146
146
  */
147
147
  const capitalize = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1));
148
148
 
149
+ const LINEFEED = '\n';
150
+ const NAVBAR_HEIGHT = 44;
151
+ const TABBAR_HEIGHT = 50;
152
+ const ON_REACH_BOTTOM_DISTANCE = 50;
153
+ const I18N_JSON_DELIMITERS = ['%', '%'];
154
+ const PRIMARY_COLOR = '#007aff';
155
+ const BACKGROUND_COLOR = '#f7f7f7'; // 背景色,如标题栏默认背景色
156
+ const SCHEME_RE = /^([a-z-]+:)?\/\//i;
157
+ const DATA_RE = /^data:.*,.*/;
158
+ const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE';
159
+ const WXS_PROTOCOL = 'wxs://';
160
+ const WXS_MODULES = 'wxsModules';
161
+ const RENDERJS_MODULES = 'renderjsModules';
162
+ // lifecycle
163
+ // App and Page
164
+ const ON_SHOW = 'onShow';
165
+ const ON_HIDE = 'onHide';
166
+ //App
167
+ const ON_LAUNCH = 'onLaunch';
168
+ const ON_ERROR = 'onError';
169
+ const ON_THEME_CHANGE = 'onThemeChange';
170
+ const ON_KEYBOARD_HEIGHT_CHANGE = 'onKeyboardHeightChange';
171
+ const ON_PAGE_NOT_FOUND = 'onPageNotFound';
172
+ const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
173
+ //Page
174
+ const ON_LOAD = 'onLoad';
175
+ const ON_READY = 'onReady';
176
+ const ON_UNLOAD = 'onUnload';
177
+ const ON_RESIZE = 'onResize';
178
+ const ON_BACK_PRESS = 'onBackPress';
179
+ const ON_PAGE_SCROLL = 'onPageScroll';
180
+ const ON_TAB_ITEM_TAP = 'onTabItemTap';
181
+ const ON_REACH_BOTTOM = 'onReachBottom';
182
+ const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
183
+ const ON_SHARE_TIMELINE = 'onShareTimeline';
184
+ const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
185
+ const ON_SHARE_APP_MESSAGE = 'onShareAppMessage';
186
+ // navigationBar
187
+ const ON_NAVIGATION_BAR_BUTTON_TAP = 'onNavigationBarButtonTap';
188
+ const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = 'onNavigationBarSearchInputClicked';
189
+ const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = 'onNavigationBarSearchInputChanged';
190
+ const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = 'onNavigationBarSearchInputConfirmed';
191
+ const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = 'onNavigationBarSearchInputFocusChanged';
192
+ // framework
193
+ const ON_APP_ENTER_FOREGROUND = 'onAppEnterForeground';
194
+ const ON_APP_ENTER_BACKGROUND = 'onAppEnterBackground';
195
+ const ON_WXS_INVOKE_CALL_METHOD = 'onWxsInvokeCallMethod';
196
+
149
197
  let lastLogTime = 0;
150
198
  function formatLog(module, ...args) {
151
199
  const now = Date.now();
@@ -545,54 +593,6 @@ var serviceContext = (function (vue) {
545
593
  return newFn;
546
594
  }
547
595
 
548
- const LINEFEED = '\n';
549
- const NAVBAR_HEIGHT = 44;
550
- const TABBAR_HEIGHT = 50;
551
- const ON_REACH_BOTTOM_DISTANCE = 50;
552
- const I18N_JSON_DELIMITERS = ['%', '%'];
553
- const PRIMARY_COLOR = '#007aff';
554
- const BACKGROUND_COLOR = '#f7f7f7'; // 背景色,如标题栏默认背景色
555
- const SCHEME_RE = /^([a-z-]+:)?\/\//i;
556
- const DATA_RE = /^data:.*,.*/;
557
- const WEB_INVOKE_APPSERVICE = 'WEB_INVOKE_APPSERVICE';
558
- const WXS_PROTOCOL = 'wxs://';
559
- const WXS_MODULES = 'wxsModules';
560
- const RENDERJS_MODULES = 'renderjsModules';
561
- // lifecycle
562
- // App and Page
563
- const ON_SHOW = 'onShow';
564
- const ON_HIDE = 'onHide';
565
- //App
566
- const ON_LAUNCH = 'onLaunch';
567
- const ON_ERROR = 'onError';
568
- const ON_THEME_CHANGE = 'onThemeChange';
569
- const ON_KEYBOARD_HEIGHT_CHANGE = 'onKeyboardHeightChange';
570
- const ON_PAGE_NOT_FOUND = 'onPageNotFound';
571
- const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
572
- //Page
573
- const ON_LOAD = 'onLoad';
574
- const ON_READY = 'onReady';
575
- const ON_UNLOAD = 'onUnload';
576
- const ON_RESIZE = 'onResize';
577
- const ON_BACK_PRESS = 'onBackPress';
578
- const ON_PAGE_SCROLL = 'onPageScroll';
579
- const ON_TAB_ITEM_TAP = 'onTabItemTap';
580
- const ON_REACH_BOTTOM = 'onReachBottom';
581
- const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
582
- const ON_SHARE_TIMELINE = 'onShareTimeline';
583
- const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
584
- const ON_SHARE_APP_MESSAGE = 'onShareAppMessage';
585
- // navigationBar
586
- const ON_NAVIGATION_BAR_BUTTON_TAP = 'onNavigationBarButtonTap';
587
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED = 'onNavigationBarSearchInputClicked';
588
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED = 'onNavigationBarSearchInputChanged';
589
- const ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED = 'onNavigationBarSearchInputConfirmed';
590
- const ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED = 'onNavigationBarSearchInputFocusChanged';
591
- // framework
592
- const ON_APP_ENTER_FOREGROUND = 'onAppEnterForeground';
593
- const ON_APP_ENTER_BACKGROUND = 'onAppEnterBackground';
594
- const ON_WXS_INVOKE_CALL_METHOD = 'onWxsInvokeCallMethod';
595
-
596
596
  class EventChannel {
597
597
  constructor(id, events) {
598
598
  this.id = id;
@@ -1272,6 +1272,10 @@ var serviceContext = (function (vue) {
1272
1272
  }, page.$page.id, callback);
1273
1273
  }
1274
1274
 
1275
+ function setCurrentPageMeta(page, options) {
1276
+ UniServiceJSBridge.invokeViewMethod('setPageMeta', options, page.$page.id);
1277
+ }
1278
+
1275
1279
  const isArray = Array.isArray;
1276
1280
  const isObject = (val) => val !== null && typeof val === 'object';
1277
1281
  const defaultDelimiters = ['{', '}'];
@@ -1395,6 +1399,10 @@ var serviceContext = (function (vue) {
1395
1399
  return locale;
1396
1400
  }
1397
1401
  locale = locale.toLowerCase();
1402
+ if (locale === 'chinese') {
1403
+ // 支付宝
1404
+ return LOCALE_ZH_HANS;
1405
+ }
1398
1406
  if (locale.indexOf('zh') === 0) {
1399
1407
  if (locale.indexOf('-hans') > -1) {
1400
1408
  return LOCALE_ZH_HANS;
@@ -4467,6 +4475,11 @@ var serviceContext = (function (vue) {
4467
4475
  return false;
4468
4476
  });
4469
4477
 
4478
+ const API_SET_PAGE_META = 'setPageMeta';
4479
+ const setPageMeta = defineAsyncApi(API_SET_PAGE_META, (options, { resolve }) => {
4480
+ resolve(setCurrentPageMeta(getCurrentPageVm(), options));
4481
+ });
4482
+
4470
4483
  const API_GET_SELECTED_TEXT_RANGE = 'getSelectedTextRange';
4471
4484
 
4472
4485
  const getSelectedTextRange = defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
@@ -4917,7 +4930,7 @@ var serviceContext = (function (vue) {
4917
4930
  return 'param extension should not be empty.';
4918
4931
  }
4919
4932
  if (!extension)
4920
- params.extension = [''];
4933
+ params.extension = ['*'];
4921
4934
  },
4922
4935
  },
4923
4936
  };
@@ -9345,7 +9358,7 @@ var serviceContext = (function (vue) {
9345
9358
  plus.nativeUI.closeWaiting();
9346
9359
  resolve();
9347
9360
  });
9348
- function setPageMeta(statusBarStyle) {
9361
+ function setPageStatusBarStyle(statusBarStyle) {
9349
9362
  const pages = getCurrentPages();
9350
9363
  if (!pages.length) {
9351
9364
  return;
@@ -9366,7 +9379,7 @@ var serviceContext = (function (vue) {
9366
9379
  const statusBarStyle = frontColor === '#000000' ? 'dark' : 'light';
9367
9380
  plus.navigator.setStatusBarStyle(statusBarStyle);
9368
9381
  // 用户调用api时同时改变当前页配置,这样在系统调用设置时,可以避免覆盖用户设置
9369
- setPageMeta(statusBarStyle);
9382
+ setPageStatusBarStyle(statusBarStyle);
9370
9383
  const style = webview.getStyle();
9371
9384
  if (style && style.titleNView) {
9372
9385
  if (style.titleNView.autoBackButton) {
@@ -12748,6 +12761,7 @@ var serviceContext = (function (vue) {
12748
12761
  $emit: $emit,
12749
12762
  onAppLaunch: onAppLaunch,
12750
12763
  onLocaleChange: onLocaleChange,
12764
+ setPageMeta: setPageMeta,
12751
12765
  setStorageSync: setStorageSync,
12752
12766
  setStorage: setStorage,
12753
12767
  getStorageSync: getStorageSync,