diff --git a/packages/uni-h5/dist/uni-h5.esm.js b/packages/uni-h5/dist/uni-h5.esm.js
index c5064ced3c8d1dec27d06446b5181c393b60a38c..e893a1826b6f5ce1298d708675bc2de8e94cddc8 100644
--- a/packages/uni-h5/dist/uni-h5.esm.js
+++ b/packages/uni-h5/dist/uni-h5.esm.js
@@ -8082,6 +8082,7 @@ var PageHead = defineComponent({
name: "PageHead",
setup() {
const pageMeta = usePageMeta();
+ UniServiceJSBridge.emit("onNavigationBarChange", pageMeta.navigationBar.titleText);
return () => (openBlock(), createBlock("uni-page-head", null, pageMeta.navigationBar.titleText));
}
});
@@ -8380,7 +8381,7 @@ function createPageHeadVNode() {
return createVNode(PageHead);
}
function createPageBodyVNode(ctx) {
- return openBlock(), createBlock(PageBody, {key: 1}, {
+ return openBlock(), createBlock(PageBody, {key: 0}, {
default: withCtx(() => [renderSlot(ctx.slots, "page")]),
_: 3
});
diff --git a/packages/uni-h5/src/framework/components/page/index.vue b/packages/uni-h5/src/framework/components/page/index.vue
deleted file mode 100644
index 45a7470a5f92999ea777f461e573daa40d9812ec..0000000000000000000000000000000000000000
--- a/packages/uni-h5/src/framework/components/page/index.vue
+++ /dev/null
@@ -1,249 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/uni-h5/src/framework/components/page/merge-title-nview.js b/packages/uni-h5/src/framework/components/page/merge-title-nview.js
deleted file mode 100644
index d8009e48d14d085b1270a9fb9eca84b9a3fa5a11..0000000000000000000000000000000000000000
--- a/packages/uni-h5/src/framework/components/page/merge-title-nview.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import { hasOwn, isPlainObject } from '@vue/shared'
-
-/**
- * app-plus titleNView
- */
-export function mergeTitleNView(navigationBar, titleNView) {
- if (isPlainObject(titleNView)) {
- if (hasOwn(titleNView, 'backgroundColor')) {
- navigationBar.backgroundColor = titleNView.backgroundColor
- }
- if (hasOwn(titleNView, 'buttons')) {
- navigationBar.buttons = titleNView.buttons
- }
- if (hasOwn(titleNView, 'titleColor')) {
- navigationBar.textColor = titleNView.titleColor
- }
- if (hasOwn(titleNView, 'titleText')) {
- navigationBar.titleText = titleNView.titleText
- }
- if (hasOwn(titleNView, 'titleSize')) {
- navigationBar.titleSize = titleNView.titleSize
- }
- if (hasOwn(titleNView, 'type')) {
- navigationBar.type = titleNView.type
- }
- if (
- hasOwn(titleNView, 'searchInput') &&
- typeof titleNView.searchInput === 'object'
- ) {
- navigationBar.searchInput = Object.assign(
- {
- autoFocus: false,
- align: 'center',
- color: '#000000',
- backgroundColor: 'rgba(255,255,255,0.5)',
- borderRadius: '0px',
- placeholder: '',
- placeholderColor: '#CCCCCC',
- disabled: false,
- },
- titleNView.searchInput
- )
- }
- }
- return navigationBar
-}
diff --git a/packages/uni-h5/src/framework/components/page/pageRefresh/index.vue b/packages/uni-h5/src/framework/components/page/page-refresh/component.vue
similarity index 100%
rename from packages/uni-h5/src/framework/components/page/pageRefresh/index.vue
rename to packages/uni-h5/src/framework/components/page/page-refresh/component.vue
diff --git a/packages/uni-h5/src/framework/components/page/pageRefresh/index.ts b/packages/uni-h5/src/framework/components/page/page-refresh/index.ts
similarity index 100%
rename from packages/uni-h5/src/framework/components/page/pageRefresh/index.ts
rename to packages/uni-h5/src/framework/components/page/page-refresh/index.ts
diff --git a/packages/uni-h5/src/framework/components/page/pageBody.ts b/packages/uni-h5/src/framework/components/page/pageBody.ts
index 07c99505418ae29f5ba2a6a9c3280dee291eb652..5e4e910e8a9b59b7dad74051dc4a096e4c94f02e 100644
--- a/packages/uni-h5/src/framework/components/page/pageBody.ts
+++ b/packages/uni-h5/src/framework/components/page/pageBody.ts
@@ -12,9 +12,9 @@ import {
import { usePageMeta } from '../../plugin/provide'
-import PageRefresh from './pageRefresh/index.vue'
+import PageRefresh from './page-refresh/component.vue'
-import { usePageRefresh } from './pageRefresh'
+import { usePageRefresh } from './page-refresh'
export default defineComponent({
name: 'PageBody',
diff --git a/packages/uni-h5/src/framework/components/page/pageBody.vue b/packages/uni-h5/src/framework/components/page/pageBody.vue
deleted file mode 100644
index bf00267ac92fb17c0e4e0948840b5614f944191f..0000000000000000000000000000000000000000
--- a/packages/uni-h5/src/framework/components/page/pageBody.vue
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/uni-h5/src/framework/components/page/pageHead.ts b/packages/uni-h5/src/framework/components/page/pageHead.ts
index 1355192a78d951276249449d02fe84762c4b4fef..26842c57a621c55542e7201e09a87555be2eb05e 100644
--- a/packages/uni-h5/src/framework/components/page/pageHead.ts
+++ b/packages/uni-h5/src/framework/components/page/pageHead.ts
@@ -15,6 +15,10 @@ export default defineComponent({
name: 'PageHead',
setup() {
const pageMeta = usePageMeta()
+ UniServiceJSBridge.emit(
+ 'onNavigationBarChange',
+ pageMeta.navigationBar.titleText
+ )
return () => (
openBlock(),
createBlock('uni-page-head', null, pageMeta.navigationBar.titleText)
diff --git a/packages/uni-h5/src/framework/components/page/pageHead.vue b/packages/uni-h5/src/framework/components/page/pageHead.vue
deleted file mode 100644
index e72dd6f9680be122c8d144c1e7b0808385f7d8c4..0000000000000000000000000000000000000000
--- a/packages/uni-h5/src/framework/components/page/pageHead.vue
+++ /dev/null
@@ -1,599 +0,0 @@
-
-
-
-
-
-
-
-
![]()
-
- {{ titleText }}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/uni-h5/src/framework/components/page/pull-to-refresh.js b/packages/uni-h5/src/framework/components/page/pull-to-refresh.js
deleted file mode 100644
index eb19890d3f397bf712e56e1c02e132d505fc71b5..0000000000000000000000000000000000000000
--- a/packages/uni-h5/src/framework/components/page/pull-to-refresh.js
+++ /dev/null
@@ -1,252 +0,0 @@
-function processDeltaY(evt, identifier, startY) {
- const touch = Array.prototype.slice
- .call(evt.changedTouches)
- .filter((touch) => touch.identifier === identifier)[0]
- if (!touch) {
- return false
- }
- evt.deltaY = touch.pageY - startY
- return true
-}
-
-// const ratio = 2.2
-
-const PULLING = 'pulling'
-const REACHED = 'reached'
-
-const ABORTING = 'aborting'
-const REFRESHING = 'refreshing'
-const RESTORING = 'restoring'
-
-export default {
- mounted() {
- if (this.enablePullDownRefresh) {
- this.refreshContainerElem = this.$refs.refresh.$el
- this.refreshControllerElem = this.refreshContainerElem.querySelector(
- '.uni-page-refresh'
- )
- this.refreshInnerElemStyle = this.refreshControllerElem.querySelector(
- '.uni-page-refresh-inner'
- ).style
-
- UniServiceJSBridge.on(
- this.$route.params.__id__ + '.startPullDownRefresh',
- () => {
- if (!this.state) {
- this.state = REFRESHING
- this._addClass()
- setTimeout(() => {
- this._refreshing()
- }, 50)
- }
- }
- )
-
- UniServiceJSBridge.on(
- this.$route.params.__id__ + '.stopPullDownRefresh',
- () => {
- if (this.state === REFRESHING) {
- this._removeClass()
- this.state = RESTORING
- this._addClass()
-
- this._restoring(() => {
- this._removeClass()
- this.state = this.distance = this.offset = null
- })
- }
- }
- )
- }
- },
- methods: {
- _touchstart(evt) {
- const touch = evt.changedTouches[0]
- this.touchId = touch.identifier
- this.startY = touch.pageY
- if ([ABORTING, REFRESHING, RESTORING].indexOf(this.state) >= 0) {
- this.canRefresh = false
- } else {
- this.canRefresh = true
- }
- },
- _touchmove(evt) {
- if (!this.canRefresh) {
- return
- }
- if (!processDeltaY(evt, this.touchId, this.startY)) {
- return
- }
-
- let { deltaY } = evt
-
- if (
- (document.documentElement.scrollTop || document.body.scrollTop) !== 0
- ) {
- this.touchId = null
- return
- }
-
- if (deltaY < 0 && !this.state) {
- return
- }
-
- evt.preventDefault()
-
- if (this.distance == null) {
- this.offset = deltaY
- this.state = PULLING
- this._addClass()
- }
-
- deltaY = deltaY - this.offset
-
- if (deltaY < 0) {
- deltaY = 0
- }
-
- this.distance = deltaY
-
- const reached =
- deltaY >= this.refreshOptions.range && this.state !== REACHED
- const pulling =
- deltaY < this.refreshOptions.range && this.state !== PULLING
-
- if (reached || pulling) {
- this._removeClass()
- this.state = this.state === REACHED ? PULLING : REACHED
- this._addClass()
- }
-
- this._pulling(deltaY)
- },
- _touchend(evt) {
- if (!processDeltaY(evt, this.touchId, this.startY)) {
- return
- }
- if (this.state === null) {
- return
- }
- if (this.state === PULLING) {
- this._removeClass()
- this.state = ABORTING
- this._addClass()
- this._aborting(() => {
- this._removeClass()
- this.state = this.distance = this.offset = null
- })
- } else if (this.state === REACHED) {
- this._removeClass()
- this.state = REFRESHING
- this._addClass()
- this._refreshing()
- }
- },
- _toggleClass(type) {
- if (!this.state) {
- return
- }
- const elem = this.refreshContainerElem
- if (elem) {
- elem.classList[type]('uni-page-refresh--' + this.state)
- }
- },
- _addClass() {
- this._toggleClass('add')
- },
- _removeClass() {
- this._toggleClass('remove')
- },
- _pulling(deltaY) {
- const elem = this.refreshControllerElem
- if (!elem) {
- return
- }
-
- const style = elem.style
-
- let rotate = deltaY / this.refreshOptions.range
-
- if (rotate > 1) {
- rotate = 1
- } else {
- rotate = rotate * rotate * rotate
- }
-
- const y = Math.round(
- deltaY / (this.refreshOptions.range / this.refreshOptions.height)
- )
-
- const transform = y ? 'translate3d(-50%, ' + y + 'px, 0)' : 0
-
- style.webkitTransform = transform
- style.clip = 'rect(' + (45 - y) + 'px,45px,45px,-5px)'
-
- this.refreshInnerElemStyle.webkitTransform =
- 'rotate(' + 360 * rotate + 'deg)'
- },
- _aborting(callback) {
- const elem = this.refreshControllerElem
- if (!elem) {
- return
- }
-
- const style = elem.style
-
- if (style.webkitTransform) {
- style.webkitTransition = '-webkit-transform 0.3s'
- style.webkitTransform = 'translate3d(-50%, 0, 0)'
- const abortTransitionEnd = function () {
- timeout && clearTimeout(timeout)
- elem.removeEventListener('webkitTransitionEnd', abortTransitionEnd)
- style.webkitTransition = ''
- callback()
- }
- elem.addEventListener('webkitTransitionEnd', abortTransitionEnd)
- const timeout = setTimeout(abortTransitionEnd, 350) // 部分手机,部分情况webkitTransitionEnd不触发
- } else {
- callback()
- }
- },
- _refreshing() {
- const elem = this.refreshControllerElem
- if (!elem) {
- return
- }
-
- const style = elem.style
- style.webkitTransition = '-webkit-transform 0.2s'
- style.webkitTransform =
- 'translate3d(-50%, ' + this.refreshOptions.height + 'px, 0)'
-
- // Service 执行 refresh
- UniServiceJSBridge.emit(
- 'onPullDownRefresh',
- {},
- this.$route.params.__id__
- )
- },
- _restoring(callback) {
- const elem = this.refreshControllerElem
- if (!elem) {
- return
- }
-
- const style = elem.style
-
- style.webkitTransition = '-webkit-transform 0.3s'
- style.webkitTransform += ' scale(0.01)'
-
- const restoreTransitionEnd = function () {
- timeout && clearTimeout(timeout)
- elem.removeEventListener('webkitTransitionEnd', restoreTransitionEnd)
- style.webkitTransition = ''
- style.webkitTransform = 'translate3d(-50%, 0, 0)'
- callback()
- }
-
- elem.addEventListener('webkitTransitionEnd', restoreTransitionEnd)
- const timeout = setTimeout(restoreTransitionEnd, 350) // 部分手机,部分情况webkitTransitionEnd不触发
- },
- },
-}