feat: 新首页的搭建
This commit is contained in:
14
src/pages/Discovery/index.vue
Normal file
14
src/pages/Discovery/index.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<AiTabSwitch v-model="tabIndex" :list="['探索发现', 'AI伴游']" @change="handleChange" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import AiTabSwitch from "@/components/AiTabSwitch/index.vue";
|
||||
|
||||
const tabIndex = ref(0);
|
||||
|
||||
const handleChange = (i) => {
|
||||
console.log("切换:", i);
|
||||
};
|
||||
</script>
|
||||
20
src/pages/Home/components/HomeNavBar.vue
Normal file
20
src/pages/Home/components/HomeNavBar.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<view class="border-box h-44 flex flex-items-center pl-12 pr-12">
|
||||
<uni-icons type="bars" size="24" color="#333" @click="showDrawer" />
|
||||
<view class="w-24 h-24"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, defineExpose } from "vue";
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
const showDrawer = () => uni.$emit("SHOW_DRAWER");
|
||||
|
||||
defineExpose({ show });
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
75
src/pages/Home/index.vue
Normal file
75
src/pages/Home/index.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="relative flex flex-col h-screen">
|
||||
<view class="absolute top-0 left-0 w-full z-10" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<HomeNavBar />
|
||||
</view>
|
||||
|
||||
<view class="content relative flex-1">
|
||||
<view class="relative">
|
||||
<image class="w-full" src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80"
|
||||
mode="widthFix" />
|
||||
<view class="absolute bottom-0 left-0 right-0 w-full head-content ">
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<AiTabSwitch v-model="tabIndex" :list="['探索发现', 'AI伴游']" @change="handleChange" />
|
||||
|
||||
<view>
|
||||
<view class="absolute top-0 left-0 w-full h-full flex flex-col items-center justify-center">
|
||||
<text class="font-size-24 font-bold color-white mb-4">欢迎来到AI助手</text>
|
||||
<text class="font-size-16 color-white mb-8">您的智能聊天伴侣,随时为您提供帮助</text>
|
||||
<view class="flex space-x-4">
|
||||
<view class="px-6 py-2 bg-green-500 text-white rounded-lg">开始聊天</view>
|
||||
<view class="px-6 py-2 bg-gray-300 text-gray-700 rounded-lg">了解更多</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
|
||||
import HomeNavBar from "./components/HomeNavBar.vue";
|
||||
|
||||
import AiTabSwitch from "@/components/AiTabSwitch/index.vue";
|
||||
|
||||
|
||||
const tabIndex = ref(0);
|
||||
|
||||
const handleChange = (i) => {
|
||||
console.log("切换:", i);
|
||||
};
|
||||
|
||||
/// 导航栏相关
|
||||
const statusBarHeight = ref(20);
|
||||
|
||||
/// =============生命周期函数↓================
|
||||
onLoad(() => {
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
statusBarHeight.value = res.statusBarHeight || 20;
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.head-content {
|
||||
background: red;
|
||||
height: 104px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="w-full h-screen bg-liner">
|
||||
<ChatMainList />
|
||||
<Home />
|
||||
</view>
|
||||
|
||||
<!-- 日历组件 -->
|
||||
@@ -29,6 +29,7 @@ import ChatMainList from "../ChatMain/ChatMainList/index.vue";
|
||||
import MoreService from "../ChatModule/MoreService/index.vue";
|
||||
import DrawerSection from "../DrawerSection/index.vue";
|
||||
import Calender from "@/components/Calender/index.vue";
|
||||
import Home from "../Home/index.vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
|
||||
@@ -83,4 +84,8 @@ onUnmounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
.top {
|
||||
margin-top: 150px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user