diff --git a/docs/NOTE.md b/docs/NOTE.md index 36181b0..25960f4 100644 --- a/docs/NOTE.md +++ b/docs/NOTE.md @@ -9,3 +9,4 @@ - 双指缩放 - AutoInput组件,在真机上无法输入 +- 真机上100vh显示异常的问题 diff --git a/env.d.ts b/env.d.ts index 122e4eb..3f2474a 100644 --- a/env.d.ts +++ b/env.d.ts @@ -3,6 +3,10 @@ declare const LATEST_COMMIT_HASH: string declare global { + interface Window { + isMoved: boolean + } + interface Navigator { control: any webkitGetUserMedia: any diff --git a/public/data/posts.json b/public/data/posts.json index ae32145..415acfe 100644 --- a/public/data/posts.json +++ b/public/data/posts.json @@ -137,6 +137,9 @@ }, "interact_info": { "liked_count": "2147", "liked": false }, "cover": { "url_default": "daZ662BX0lVMTq0Y6hIwR.png" }, + "image_list": [ + { "info_list": [{ "url": "daZ662BX0lVMTq0Y6hIwR.png" }] } + ], "type": "normal", "display_title": "无所谓了,互联网没有我在乎的人" }, @@ -176,7 +179,10 @@ "nickname": "芙•" }, "interact_info": { "liked": false, "liked_count": "1966" }, - "cover": { "url_default": "4a4TtExpq7RXnKK3hylKU.png" } + "cover": { "url_default": "4a4TtExpq7RXnKK3hylKU.png" }, + "image_list": [ + { "info_list": [{ "url": "4a4TtExpq7RXnKK3hylKU.png" }] } + ] }, "track_id": "2d0udv0xvhqne0t0nmd83", "ignore": false, @@ -233,6 +239,9 @@ }, "interact_info": { "liked": false, "liked_count": "1005" }, "cover": { "url_default": "dg16eh25m2SSI9Hc1fJuE.png" }, + "image_list": [ + { "info_list": [{ "url": "dg16eh25m2SSI9Hc1fJuE.png" }] } + ], "type": "normal", "display_title": "拍旗袍没人看 办公室随手拍就有流量是吧" }, @@ -321,7 +330,10 @@ "nick_name": "林木婷子" }, "interact_info": { "liked": false, "liked_count": "2700" }, - "cover": { "url_default": "z-XSh-g9MhKpYrFDHcxQT.png" } + "cover": { "url_default": "z-XSh-g9MhKpYrFDHcxQT.png" }, + "image_list": [ + { "info_list": [{ "url": "z-XSh-g9MhKpYrFDHcxQT.png" }] } + ] }, "track_id": "2d0udv0xvhqne0t0nmd83" }, @@ -629,7 +641,10 @@ "user_id": "5bf37f6651783a194c1e1da2" }, "interact_info": { "liked": false, "liked_count": "119" }, - "cover": { "url_default": "UaxqkI4aZ5LDu7k8KLw48.png" } + "cover": { "url_default": "UaxqkI4aZ5LDu7k8KLw48.png" }, + "image_list": [ + { "info_list": [{ "url": "UaxqkI4aZ5LDu7k8KLw48.png" }] } + ] } }, { @@ -888,6 +903,7 @@ }, "interact_info": { "liked": false, "liked_count": "1786" }, "cover": { "url_default": "n0SAcEY5gLucU7Ik7yP2P.png" }, + "image_list": [{ "info_list": [{ "url": "n0SAcEY5gLucU7Ik7yP2P.png" }] }], "type": "normal" }, "track_id": "2d0udv0xvhqne0t0nmd83", @@ -936,6 +952,9 @@ "model_type": "note", "note_card": { "cover": { "url_default": "Sf5mzf68e2GwZHZv7h1G2.png" }, + "image_list": [ + { "info_list": [{ "url": "Sf5mzf68e2GwZHZv7h1G2.png" }] } + ], "type": "normal", "display_title": "行吧,我重发 ", "user": { diff --git a/public/data/posts.md b/public/data/posts.md index 1eb7d97..b1f626e 100644 Binary files a/public/data/posts.md and b/public/data/posts.md differ diff --git a/src/App.vue b/src/App.vue index 289a969..a25cdae 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,16 +6,17 @@ - -
- -
-

切换至手机模式才可正常使用

-

1. 按 F12 调出控制台

-

2. 按 Ctrl+Shift+M,或点击下面图标

-
- + +
+ + +
+

切换至手机模式获取最佳体验

+

1. 按 F12 调出控制台

+

2. 按 Ctrl+Shift+M,或点击下面图标

+ +
@@ -127,9 +131,9 @@ function touchEnd(e: TouchEvent) {
@@ -141,16 +145,16 @@ function touchEnd(e: TouchEvent) { position: absolute; bottom: 10rem; z-index: 2; - left: 0; + left: 50%; + transform: translateX(-50%); display: flex; justify-content: center; - width: 100%; + gap: 7rem; .bullet { @width: 5rem; width: @width; height: @width; - margin: 0 3rem; border-radius: 50%; background: var(--second-btn-color); diff --git a/src/components/slide/SlideVertical.vue b/src/components/slide/SlideVertical.vue index f5d66fd..acfef10 100644 --- a/src/components/slide/SlideVertical.vue +++ b/src/components/slide/SlideVertical.vue @@ -6,8 +6,8 @@ import { slideInit, slideReset, slideTouchEnd, - slidePointerMove, - slidePointerDown + slideTouchMove, + slideTouchStart } from '@/utils/slide' import { SlideType } from '@/utils/const_var' @@ -22,21 +22,34 @@ const props = defineProps({ changeActiveIndexUseAnim: { type: Boolean, default: true + }, + name: { + type: String, + default: () => 'SlideVertical' } }) const emit = defineEmits(['update:index']) +//slide-list的ref引用 const wrapperEl = ref(null) + const state = reactive({ - judgeValue: 20, - type: SlideType.HORIZONTAL, - name: 'SlideVertical', - localIndex: props.index, - needCheck: true, - next: false, - start: { x: 0, y: 0, time: 0 }, - move: { x: 0, y: 0 }, - wrapper: { width: 0, height: 0, childrenLength: 0 } + judgeValue: 20, //一个用于判断滑动朝向的固定值 + type: SlideType.VERTICAL, //组件类型 + name: props.name, + localIndex: props.index, //当前下标 + needCheck: true, //是否需要检测,每次按下都需要检测,up事件会重置为true + next: false, //能否滑动 + isDown: false, //是否按下,用于move事件判断 + start: { x: 0, y: 0, time: 0 }, //按下时的起点坐标 + move: { x: 0, y: 0 }, //移动时的坐标 + //slide-list的宽度和子元素数量 + wrapper: { + width: 0, + height: 0, + //childrenLength用于canNext方法判断当前页是否是最后一页,是则不能滑动,不捕获事件 + childrenLength: 0 + } }) watch( @@ -61,16 +74,16 @@ onMounted(() => { }) function touchStart(e) { - slidePointerDown(e, wrapperEl.value, state) + slideTouchStart(e, wrapperEl.value, state) } function touchMove(e) { - slidePointerMove(e, wrapperEl.value, state) + slideTouchMove(e, wrapperEl.value, state) } function touchEnd(e) { slideTouchEnd(e, state) - slideReset(wrapperEl.value, state, emit) + slideReset(e, wrapperEl.value, state, emit) } @@ -79,9 +92,9 @@ function touchEnd(e) {
diff --git a/src/components/slide/SlideVerticalInfinite.vue b/src/components/slide/SlideVerticalInfinite.vue index 58909e3..2bfe522 100644 --- a/src/components/slide/SlideVerticalInfinite.vue +++ b/src/components/slide/SlideVerticalInfinite.vue @@ -1,4 +1,4 @@ - diff --git a/src/pages/home/slide/LongVideo.vue b/src/pages/home/slide/LongVideo.vue index 6839fd5..9675c97 100644 --- a/src/pages/home/slide/LongVideo.vue +++ b/src/pages/home/slide/LongVideo.vue @@ -1,6 +1,6 @@