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 })
app.$mount()
import { router } from './router'
router.afterEach((to) => {
const page = to.meta?.page
// 统一设置浏览器标签标题
document.title = page?.navigationBar?.titleText || 'Paip.AI'
})
// #endif
// #ifdef VUE3

View File

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

View File

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

View File

@@ -1,88 +1,31 @@
<template>
<view class="page">
<!-- 内容区 -->
<view class="maincontent">
<!-- <Postpage /> -->
<!-- <Videopage /> -->
<News />
</view>
<!-- Findmore组件 -->
<Findmore />
<view class="loading-container">
<text>页面加载中...</text>
</view>
</template>
<script setup>
import Postpage from '@/pages/components/postpage/postpage.vue'
import Videopage from '@/pages/components/videopage/videopage.vue';
import News from '@/pages/components/news/news.vue';
import Findmore from '@/pages/components/findmore/findmore.vue';
import { onLoad } from '@dcloudio/uni-app';
// 跳转
const redirectTo = (url) => {
uni.redirectTo({
url: url
})
}
// 页面加载时自动跳转
onLoad(() => {
// 自动跳转
setTimeout(() => {
redirectTo('/pages/post');
}); // 自动跳转
})
</script>
<style scoped>
page,
.page {
width: 100%;
max-width: 430px;
height: auto;
.loading-container {
display: flex;
flex-direction: column;
margin: 0 auto;
position: relative;
}
.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;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>

View File

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

View File

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

View File

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