From da03de392ba1b483b1c940ab9af367e36d6935c6 Mon Sep 17 00:00:00 2001 From: lingxiao7 Date: Thu, 20 Jul 2023 14:58:07 +0800 Subject: [PATCH] fix(uni-mp-weibo): remove uni-h5 modify --- packages/uni-h5/dist/uni-h5.cjs.js | 46 ++++------------- packages/uni-h5/dist/uni-h5.es.js | 82 ++++-------------------------- 2 files changed, 19 insertions(+), 109 deletions(-) diff --git a/packages/uni-h5/dist/uni-h5.cjs.js b/packages/uni-h5/dist/uni-h5.cjs.js index 597cdebb0f4..fbef4efd0ab 100644 --- a/packages/uni-h5/dist/uni-h5.cjs.js +++ b/packages/uni-h5/dist/uni-h5.cjs.js @@ -419,7 +419,7 @@ function initPageInternalInstance(openType, url, pageQuery, meta, eventChannel, meta, openType, eventChannel, - statusBarStyle: titleColor === "#ffffff" ? "light" : "dark" + statusBarStyle: titleColor === "#000000" ? "dark" : "light" }; } function invokeHook(vm, name, args) { @@ -508,21 +508,21 @@ function wrapperEvent(event, evt) { } const invokeOnCallback = (name, res) => UniServiceJSBridge.emit("api." + name, res); let invokeViewMethodId = 1; -function publishViewMethodName(pageId) { - return (pageId || getCurrentPageId()) + "." + INVOKE_VIEW_API; +function publishViewMethodName() { + return getCurrentPageId() + "." + INVOKE_VIEW_API; } const invokeViewMethod = (name, args, pageId, callback) => { const { subscribe, publishHandler } = UniServiceJSBridge; const id = callback ? invokeViewMethodId++ : 0; callback && subscribe(INVOKE_VIEW_API + "." + id, callback, true); - publishHandler(publishViewMethodName(pageId), { id, name, args }, pageId); + publishHandler(publishViewMethodName(), { id, name, args }, pageId); }; const invokeViewMethodKeepAlive = (name, args, callback, pageId) => { const { subscribe, unsubscribe, publishHandler } = UniServiceJSBridge; const id = invokeViewMethodId++; const subscribeName = INVOKE_VIEW_API + "." + id; subscribe(subscribeName, callback); - publishHandler(publishViewMethodName(pageId), { id, name, args }, pageId); + publishHandler(publishViewMethodName(), { id, name, args }, pageId); return () => { unsubscribe(subscribeName); }; @@ -1008,13 +1008,6 @@ const index$A = /* @__PURE__ */ defineBuiltInComponent({ } return; } - if ( - // @ts-ignore - window.weibo && // @ts-ignore - typeof window.weibo.share === "function" && props2.openType === "share" - ) { - window.weibo.share(); - } }); const uniLabel = vue.inject(uniLabelKey, false); if (uniLabel) { @@ -1405,11 +1398,6 @@ function handlePromise(promise) { } function promisify(name, fn) { return (args = {}, ...rest) => { - try { - if (false) - ; - } catch (e2) { - } if (hasCallback(args)) { return wrapperReturnValue(name, invokeApi(name, fn, args, rest)); } @@ -1502,14 +1490,6 @@ function wrapperTaskApi(name, fn, protocol, options) { } function wrapperSyncApi(name, fn, protocol, options) { return (...args) => { - try { - if (window.weibo && window.weibo[name]) { - window.currentWeiboApiName = name; - var value = window.weibo[name](args); - return value; - } - } catch (e2) { - } const errMsg = beforeInvokeApi(name, args, protocol, options); if (errMsg) { throw new Error(errMsg); @@ -2879,19 +2859,11 @@ function useImageState(rootRef, props2) { opts[0] && (position = opts[0]); opts[1] && (size = opts[1]); } - if (window.weibo && props2.src.startsWith("Temp")) { - imgSrc.value = `../../${props2.src}`; - } return `background-image:${imgSrc.value ? 'url("' + imgSrc.value + '")' : "none"};background-position:${position};background-size:${size};`; }); const state = vue.reactive({ rootEl: rootRef, - src: vue.computed(function() { - if (window.weibo && props2.src.startsWith("Temp")) { - return `../../${props2.src}`; - } - return props2.src ? getRealPath(props2.src) : ""; - }), + src: vue.computed(() => props2.src ? getRealPath(props2.src) : ""), origWidth: 0, origHeight: 0, origStyle: { @@ -5402,7 +5374,7 @@ const index$o = /* @__PURE__ */ defineBuiltInComponent({ field } = useRadioInject(radioChecked, radioValue, reset); const _onClick = ($event) => { - if (props2.disabled || radioChecked.value) { + if (props2.disabled) { return; } radioChecked.value = true; @@ -7523,8 +7495,8 @@ function normalizePageMeta(pageMeta) { navigationBar.titleText = navigationBar.titleText || ""; navigationBar.type = navigationBar.type || "default"; navigationBar.titleSize = titleSize || "16px"; - navigationBar.titleColor = titleColor || "#000000"; - navigationBar.backgroundColor = backgroundColor || "#F8F8F8"; + navigationBar.titleColor = titleColor || "#ffffff"; + navigationBar.backgroundColor = backgroundColor || "#F7F7F7"; __UNI_FEATURE_I18N_LOCALE__ && initNavigationBarI18n(navigationBar); } return pageMeta; diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index b3e41df526c..cd090049920 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -1146,7 +1146,7 @@ function initPageInternalInstance(openType, url, pageQuery, meta, eventChannel, meta, openType, eventChannel, - statusBarStyle: titleColor === "#ffffff" ? "light" : "dark" + statusBarStyle: titleColor === "#000000" ? "dark" : "light" }; } function removeHook(vm, name, hook) { @@ -1510,7 +1510,6 @@ function getWxsVm(el) { return el.__vueParentComponent && el.__vueParentComponent.proxy; } } -const isKeyboardEvent = (val) => !val.type.indexOf("key") && val instanceof KeyboardEvent; const isClickEvent = (val) => val.type === "click"; const isMouseEvent = (val) => val.type.indexOf("mouse") === 0 || ["contextmenu"].includes(val.type); const isTouchEvent = (val) => typeof TouchEvent !== "undefined" && val instanceof TouchEvent || val.type.indexOf("touch") === 0 || ["longpress"].indexOf(val.type) >= 0; @@ -1540,15 +1539,6 @@ function $nne(evt, eventValue, instance2) { const top = getWindowTop(); res.touches = normalizeTouchEvent(evt.touches, top); res.changedTouches = normalizeTouchEvent(evt.changedTouches, top); - } else if (isKeyboardEvent(evt)) { - const proxyKeys = ["key", "code"]; - proxyKeys.forEach((key) => { - Object.defineProperty(res, key, { - get() { - return evt[key]; - } - }); - }); } { return wrapperH5WxsEvent( @@ -1653,21 +1643,21 @@ function initViewPlugin(app) { } const invokeOnCallback = (name, res) => UniServiceJSBridge.emit("api." + name, res); let invokeViewMethodId = 1; -function publishViewMethodName(pageId) { - return (pageId || getCurrentPageId()) + "." + INVOKE_VIEW_API; +function publishViewMethodName() { + return getCurrentPageId() + "." + INVOKE_VIEW_API; } const invokeViewMethod = (name, args, pageId, callback) => { const { subscribe, publishHandler } = UniServiceJSBridge; const id2 = callback ? invokeViewMethodId++ : 0; callback && subscribe(INVOKE_VIEW_API + "." + id2, callback, true); - publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); + publishHandler(publishViewMethodName(), { id: id2, name, args }, pageId); }; const invokeViewMethodKeepAlive = (name, args, callback, pageId) => { const { subscribe, unsubscribe, publishHandler } = UniServiceJSBridge; const id2 = invokeViewMethodId++; const subscribeName = INVOKE_VIEW_API + "." + id2; subscribe(subscribeName, callback); - publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); + publishHandler(publishViewMethodName(), { id: id2, name, args }, pageId); return () => { unsubscribe(subscribeName); }; @@ -2312,13 +2302,6 @@ const index$x = /* @__PURE__ */ defineBuiltInComponent({ } return; } - if ( - // @ts-ignore - window.weibo && // @ts-ignore - typeof window.weibo.share === "function" && props2.openType === "share" - ) { - window.weibo.share(); - } }); const uniLabel = inject(uniLabelKey, false); if (uniLabel) { @@ -3008,11 +2991,6 @@ function handlePromise(promise) { } function promisify(name, fn) { return (args = {}, ...rest) => { - try { - if (false) - ; - } catch (e2) { - } if (hasCallback(args)) { return wrapperReturnValue(name, invokeApi(name, fn, args, rest)); } @@ -3143,14 +3121,6 @@ function wrapperTaskApi(name, fn, protocol, options) { } function wrapperSyncApi(name, fn, protocol, options) { return (...args) => { - try { - if (window.weibo && window.weibo[name]) { - window.currentWeiboApiName = name; - var value = window.weibo[name](args); - return value; - } - } catch (e2) { - } const errMsg = beforeInvokeApi(name, args, protocol, options); if (errMsg) { throw new Error(errMsg); @@ -5183,45 +5153,21 @@ function offPageNotFound(hook) { offAppHook(ON_PAGE_NOT_FOUND, hook); } function onError(hook) { - if (window.weibo) { - window.weibo.onError(hook); - return; - } onAppHook(ON_ERROR, hook); } function offError(hook) { - if (window.weibo) { - window.weibo.offError(hook); - return; - } offAppHook(ON_ERROR, hook); } function onAppShow(hook) { - if (window.weibo) { - window.weibo.onAppShow(hook); - return; - } onAppHook(ON_SHOW, hook); } function offAppShow(hook) { - if (window.weibo) { - window.weibo.offAppShow(hook); - return; - } offAppHook(ON_SHOW, hook); } function onAppHide(hook) { - if (window.weibo) { - window.weibo.onAppHide(hook); - return; - } onAppHook(ON_HIDE, hook); } function offAppHide(hook) { - if (window.weibo) { - window.weibo.offAppHide(hook); - return; - } offAppHook(ON_HIDE, hook); } const API_GET_ENTER_OPTIONS_SYNC = "getEnterOptionsSync"; @@ -8980,19 +8926,11 @@ function useImageState(rootRef, props2) { opts[0] && (position = opts[0]); opts[1] && (size = opts[1]); } - if (window.weibo && props2.src.startsWith("Temp")) { - imgSrc.value = `../../${props2.src}`; - } return `background-image:${imgSrc.value ? 'url("' + imgSrc.value + '")' : "none"};background-position:${position};background-size:${size};`; }); const state2 = reactive({ rootEl: rootRef, - src: computed(function() { - if (window.weibo && props2.src.startsWith("Temp")) { - return `../../${props2.src}`; - } - return props2.src ? getRealPath(props2.src) : ""; - }), + src: computed(() => props2.src ? getRealPath(props2.src) : ""), origWidth: 0, origHeight: 0, origStyle: { @@ -12679,7 +12617,7 @@ const index$m = /* @__PURE__ */ defineBuiltInComponent({ field } = useRadioInject(radioChecked, radioValue, reset); const _onClick = ($event) => { - if (props2.disabled || radioChecked.value) { + if (props2.disabled) { return; } radioChecked.value = true; @@ -15180,8 +15118,8 @@ function normalizePageMeta(pageMeta) { navigationBar.titleText = navigationBar.titleText || ""; navigationBar.type = navigationBar.type || "default"; navigationBar.titleSize = titleSize || "16px"; - navigationBar.titleColor = titleColor || "#000000"; - navigationBar.backgroundColor = backgroundColor || "#F8F8F8"; + navigationBar.titleColor = titleColor || "#ffffff"; + navigationBar.backgroundColor = backgroundColor || "#F7F7F7"; __UNI_FEATURE_I18N_LOCALE__ && initNavigationBarI18n(navigationBar); } if (__UNI_FEATURE_PAGES__ && history.state) { @@ -20390,7 +20328,7 @@ function useList(state2) { function pushData(array) { array.forEach((item) => { list2.push({ - name: item.title || item.name, + name: item.title, address: item.address, distance: item._distance || item.distance, latitude: item.location.lat,