useredirectto

This commit is contained in:
WanP
2025-10-20 14:55:15 +08:00
parent c5a7840d43
commit 45ceb9c77d
9 changed files with 78 additions and 116 deletions

View File

@@ -9,12 +9,6 @@ App.mpType = 'app'
const app = new Vue({ ...App }) const app = new Vue({ ...App })
app.$mount() app.$mount()
import { router } from './router'
router.afterEach((to) => {
const page = to.meta?.page
// 统一设置浏览器标签标题
document.title = page?.navigationBar?.titleText || 'Paip.AI'
})
// #endif // #endif
// #ifdef VUE3 // #ifdef VUE3

View File

@@ -7,37 +7,37 @@
} }
}, },
{ {
"path": "pages/components/videopage/videopage", "path": "pages/post",
"style": {
"navigationBarTitleText": "视频"
}
},
{
"path": "pages/components/postpage/postpage",
"style": { "style": {
"navigationBarTitleText": "帖子" "navigationBarTitleText": "帖子"
} }
}, },
{ {
"path": "pages/components/head/head", "path": "pages/video",
"style": {
"navigationBarTitleText": "视频"
}
},
{
"path": "pages/head/head",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path": "pages/components/findmore/findmore", "path": "pages/findmore/findmore",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path": "pages/components/comments/comments", "path": "pages/comments/comments",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, },
{ {
"path": "pages/components/news/news", "path": "pages/news",
"style": { "style": {
"navigationBarTitleText": "新闻" "navigationBarTitleText": "新闻"
} }

View File

@@ -173,7 +173,13 @@ const totalCommentCount = computed(() =>
} }
.comment { .comment {
width: 100%;
max-width: 430px;
padding: 16px; padding: 16px;
display: flex;
flex-direction: column;
margin: 0 auto;
box-sizing: border-box;
} }
.commenthead { .commenthead {
@@ -398,6 +404,7 @@ const totalCommentCount = computed(() =>
.interaction { .interaction {
width: 100%; width: 100%;
max-width: 430px;
border: solid 1px #faf9fb; border: solid 1px #faf9fb;
background-color: #faf9fb; background-color: #faf9fb;
display: flex; display: flex;
@@ -405,6 +412,7 @@ const totalCommentCount = computed(() =>
padding: 11.5px 16px; padding: 11.5px 16px;
flex-direction: row; flex-direction: row;
box-sizing: border-box; box-sizing: border-box;
margin: 0 auto;
} }
.editarea { .editarea {

View File

@@ -1,88 +1,31 @@
<template> <template>
<view class="page"> <view class="loading-container">
<!-- 内容区 --> <text>页面加载中...</text>
<view class="maincontent">
<!-- <Postpage /> -->
<!-- <Videopage /> -->
<News />
</view>
<!-- Findmore组件 -->
<Findmore />
</view> </view>
</template> </template>
<script setup> <script setup>
import Postpage from '@/pages/components/postpage/postpage.vue' import { onLoad } from '@dcloudio/uni-app';
import Videopage from '@/pages/components/videopage/videopage.vue';
import News from '@/pages/components/news/news.vue';
import Findmore from '@/pages/components/findmore/findmore.vue';
// 跳转
const redirectTo = (url) => {
uni.redirectTo({
url: url
})
}
// 页面加载时自动跳转
onLoad(() => {
// 自动跳转
setTimeout(() => {
redirectTo('/pages/post');
}); // 自动跳转
})
</script> </script>
<style scoped> <style scoped>
page, .loading-container {
.page {
width: 100%;
max-width: 430px;
height: auto;
display: flex; display: flex;
flex-direction: column; justify-content: center;
margin: 0 auto; align-items: center;
position: relative; height: 100vh;
}
.head {
width: 100%;
padding: 14px 16px;
box-sizing: border-box;
border-bottom: 1px solid rgba(0, 0, 0, .08);
flex-shrink: 0;
}
.applogo {
width: 128px;
height: 33px;
display: inline-block;
vertical-align: middle;
}
.spacerview {
display: inline-block;
width: 0;
height: 0;
pointer-events: none;
}
.download {
width: 97px;
height: 35px;
border-radius: 29px;
background-image: linear-gradient(156deg, #7c45ed -1%, #7c68ef 19%, #7bd8f8 97%);
color: #fff;
font-size: 14px;
display: inline-block;
text-align: center;
line-height: 35px;
vertical-align: middle;
}
.maincontent {
width: 100%;
flex: 1;
height: auto;
min-height: auto;
display: flex;
flex-direction: column;
position: relative;
overflow-y: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
/* Webkit浏览器隐藏滚动条 */
.maincontent::-webkit-scrollbar {
display: none;
} }
</style> </style>

View File

@@ -58,15 +58,18 @@
<!-- 评论区域 + 互动区域 --> <!-- 评论区域 + 互动区域 -->
<Comments :comments="post.comments" :showInteraction="true" :collectsum="post.collectsum" :likesum="post.likesum" /> <Comments :comments="post.comments" :showInteraction="true" :collectsum="post.collectsum" :likesum="post.likesum" />
<!-- Findmore -->
<Findmore />
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useCommonStore } from '@/stores/common.js' import { useCommonStore } from '@/stores/common.js'
import Head from '@/pages/components/head/head.vue' import Head from '@/pages/head/head.vue'
import Comments from '@/pages/components/comments/comments.vue' import Comments from '@/pages/comments/comments.vue'
import Findmore from '@/pages/findmore/findmore.vue'
const common = useCommonStore() const common = useCommonStore()
// dot // dot
@@ -173,7 +176,7 @@ const handleInteraction = () => {
common.openapp(); common.openapp();
} }
// //
onMounted(() => { onLoad(() => {
fetchPostData() fetchPostData()
}) })
@@ -182,11 +185,13 @@ onMounted(() => {
<style scoped> <style scoped>
page, page,
.page { .page {
width: 100%;
max-width: 430px;
height: auto;
display: flex; display: flex;
position: relative;
flex-direction: column; flex-direction: column;
margin: 0; margin: 0 auto;
height: 100vh; position: relative;
} }
.content { .content {

View File

@@ -49,15 +49,19 @@
<!-- 评论区域 + 互动区域 --> <!-- 评论区域 + 互动区域 -->
<Comments :comments="post.comments" :showInteraction="true" :collectsum="post.collectsum" :likesum="post.likesum" /> <Comments :comments="post.comments" :showInteraction="true" :collectsum="post.collectsum" :likesum="post.likesum" />
<!-- Findmore -->
<Findmore />
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useCommonStore } from '@/stores/common.js' import { useCommonStore } from '@/stores/common.js'
import Head from '@/pages/components/head/head.vue' import Head from '@/pages/head/head.vue'
import Comments from '@/pages/components/comments/comments.vue' import Comments from '@/pages/comments/comments.vue'
import Findmore from '@/pages/findmore/findmore.vue'
const common = useCommonStore() const common = useCommonStore()
// dot // dot
@@ -160,7 +164,7 @@ const fetchPostData = async () => {
} }
// //
onMounted(() => { onLoad(() => {
fetchPostData() fetchPostData()
}) })
@@ -169,11 +173,13 @@ onMounted(() => {
<style scoped> <style scoped>
page, page,
.page { .page {
width: 100%;
max-width: 430px;
height: auto;
display: flex; display: flex;
position: relative;
flex-direction: column; flex-direction: column;
margin: 0; margin: 0 auto;
height: 100vh; position: relative;
} }
.content { .content {

View File

@@ -65,14 +65,18 @@
<Comments :comments="videoData.comments" :showInteraction="true" :collectsum="videoData.collectsum" <Comments :comments="videoData.comments" :showInteraction="true" :collectsum="videoData.collectsum"
:likesum="videoData.likesum" /> :likesum="videoData.likesum" />
<!-- Findmore -->
<Findmore />
</template> </template>
<script setup> <script setup>
import { ref, reactive, getCurrentInstance } from 'vue' import { ref, reactive, getCurrentInstance } from 'vue'
import { useCommonStore } from '@/stores/common.js' import { useCommonStore } from '@/stores/common.js'
import Head from '@/pages/components/head/head.vue' import Head from '@/pages/head/head.vue'
import Comments from '@/pages/components/comments/comments.vue' import Comments from '@/pages/comments/comments.vue'
import Findmore from '@/pages/findmore/findmore.vue'
const common = useCommonStore() const common = useCommonStore()
const formatCount = common.formatCount const formatCount = common.formatCount
@@ -227,18 +231,20 @@ const toggleMute = () => {
<style scoped> <style scoped>
.videopage { .videopage {
width: 100%; width: 100%;
max-width: 430px;
height: 100vh; height: 100vh;
min-height: 684px;
max-height: 932px;
max-height: 932px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 auto;
position: relative; position: relative;
} }
.videopage video { .videopage video {
width: 100%; width: 100%;
flex: 1; max-width: 430px;
height: 100%;
min-height: 680px;
max-height: 980px;
object-fit: cover; object-fit: cover;
} }