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

chore(h5): update pageHead

上级 ea759fb2
......@@ -10721,7 +10721,7 @@ function usePageHeadButton(pageId, index2, btn, isTransparent) {
badgeText: btn.badgeText,
iconStyle,
onClick() {
invokeHook(pageId, "onNavigationBarButtonTap", shared.extend({
invokeHook(pageId, uniShared.ON_NAVIGATION_BAR_BUTTON_TAP, shared.extend({
index: index2
}, btn));
}
......@@ -10741,7 +10741,7 @@ function usePageHeadSearchInput({
} = searchInput;
if (disabled) {
const onClick = () => {
invokeHook(id, "onNavigationBarSearchInputClicked");
invokeHook(id, uniShared.ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED);
};
return {
focus,
......@@ -10752,25 +10752,25 @@ function usePageHeadSearchInput({
}
const onFocus = () => {
focus.value = true;
invokeHook(id, "onNavigationBarSearchInputFocusChanged", {
invokeHook(id, uniShared.ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: true
});
};
const onBlur = () => {
focus.value = false;
invokeHook(id, "onNavigationBarSearchInputFocusChanged", {
invokeHook(id, uniShared.ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: false
});
};
const onInput = (evt) => {
text.value = evt.detail.value;
invokeHook(id, "onNavigationBarSearchInputChanged", {
invokeHook(id, uniShared.ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, {
text: text.value
});
};
const onKeyup = (evt) => {
if (evt.key === "Enter" || evt.keyCode === 13) {
invokeHook(id, "onNavigationBarSearchInputConfirmed", {
invokeHook(id, uniShared.ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, {
text: text.value
});
}
......
import { withModifiers, createVNode, getCurrentInstance, ref, defineComponent, openBlock, createElementBlock, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, mergeProps, injectHook, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, onBeforeActivate, onBeforeDeactivate, createBlock, renderList, onDeactivated, createApp, Transition, effectScope, withCtx, KeepAlive, resolveDynamicComponent, createElementVNode, normalizeStyle, renderSlot } from "vue";
import { isString, extend, stringifyStyle, parseStringStyle, isPlainObject, isFunction, capitalize, camelize, isArray, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, hyphenate, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, passive, initCustomDataset, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, passive, initCustomDataset, addLeadingSlash, invokeArrayFns, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, normalizeTarget, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, SCHEME_RE, DATA_RE, getCustomDataset, LINEFEED, ON_ERROR, callOptions, ON_LAUNCH, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, ON_LOAD, UniLifecycleHooks, NAVBAR_HEIGHT, parseQuery, ON_UNLOAD, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, updateElementStyle, ON_BACK_PRESS, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH } from "@dcloudio/uni-shared";
import { initVueI18n, isI18nStr, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
const isEnableLocale = once(() => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length);
......@@ -21527,7 +21527,7 @@ function usePageHeadButton(pageId, index2, btn, isTransparent) {
badgeText: btn.badgeText,
iconStyle,
onClick() {
invokeHook(pageId, "onNavigationBarButtonTap", extend({
invokeHook(pageId, ON_NAVIGATION_BAR_BUTTON_TAP, extend({
index: index2
}, btn));
}
......@@ -21547,7 +21547,7 @@ function usePageHeadSearchInput({
} = searchInput;
if (disabled) {
const onClick = () => {
invokeHook(id2, "onNavigationBarSearchInputClicked");
invokeHook(id2, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED);
};
return {
focus,
......@@ -21558,25 +21558,25 @@ function usePageHeadSearchInput({
}
const onFocus = () => {
focus.value = true;
invokeHook(id2, "onNavigationBarSearchInputFocusChanged", {
invokeHook(id2, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: true
});
};
const onBlur = () => {
focus.value = false;
invokeHook(id2, "onNavigationBarSearchInputFocusChanged", {
invokeHook(id2, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: false
});
};
const onInput = (evt) => {
text2.value = evt.detail.value;
invokeHook(id2, "onNavigationBarSearchInputChanged", {
invokeHook(id2, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, {
text: text2.value
});
};
const onKeyup = (evt) => {
if (evt.key === "Enter" || evt.keyCode === 13) {
invokeHook(id2, "onNavigationBarSearchInputConfirmed", {
invokeHook(id2, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, {
text: text2.value
});
}
......
......@@ -10,6 +10,13 @@ import {
ICON_PATH_BACK,
ICON_PATH_CLOSE,
} from '@dcloudio/uni-core'
import {
ON_NAVIGATION_BAR_BUTTON_TAP,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED,
} from '@dcloudio/uni-shared'
import { usePageMeta } from '../../setup/provide'
import {
usePageHeadTransparent,
......@@ -357,7 +364,7 @@ function usePageHeadButton(
badgeText: btn.badgeText,
iconStyle,
onClick() {
invokeHook(pageId, 'onNavigationBarButtonTap', extend({ index }, btn))
invokeHook(pageId, ON_NAVIGATION_BAR_BUTTON_TAP, extend({ index }, btn))
},
}
}
......@@ -374,7 +381,7 @@ function usePageHeadSearchInput({
const { disabled } = searchInput!
if (disabled) {
const onClick = () => {
invokeHook(id!, 'onNavigationBarSearchInputClicked')
invokeHook(id!, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED)
}
return {
focus,
......@@ -385,19 +392,25 @@ function usePageHeadSearchInput({
}
const onFocus = () => {
focus.value = true
invokeHook(id!, 'onNavigationBarSearchInputFocusChanged', { focus: true })
invokeHook(id!, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: true,
})
}
const onBlur = () => {
focus.value = false
invokeHook(id!, 'onNavigationBarSearchInputFocusChanged', { focus: false })
invokeHook(id!, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, {
focus: false,
})
}
const onInput = (evt: { detail: { value: string } }) => {
text.value = evt.detail.value
invokeHook(id!, 'onNavigationBarSearchInputChanged', { text: text.value })
invokeHook(id!, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, {
text: text.value,
})
}
const onKeyup = (evt: KeyboardEvent) => {
if (evt.key === 'Enter' || evt.keyCode === 13) {
invokeHook(id!, 'onNavigationBarSearchInputConfirmed', {
invokeHook(id!, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, {
text: text.value,
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册