feat: 调整界面

master
DavidMorgan 2026-04-02 11:58:18 +08:00
parent a8ee21b558
commit b3e7e7e844
19 changed files with 176 additions and 319 deletions

View File

@ -26,14 +26,14 @@ export default defineUniPages({
spacing: '3px', spacing: '3px',
list: [ list: [
{ {
iconPath: '/static/tabBar/news.png', iconPath: '/static/tabBar/home.png',
selectedIconPath: '/static/tabBar/news-active.png', selectedIconPath: '/static/tabBar/home-active.png',
pagePath: 'pages/evaluation/index/index', pagePath: 'pages/evaluation/index/index',
text: '测评', text: '首页',
}, },
{ {
iconPath: '/static/tabBar/center.png', iconPath: '/static/tabBar/user.png',
selectedIconPath: '/static/tabBar/center-active.png', selectedIconPath: '/static/tabBar/user-active.png',
pagePath: 'pages/ucenter/index/index', pagePath: 'pages/ucenter/index/index',
text: '我的', text: '我的',
}, },

View File

@ -0,0 +1,95 @@
<template>
<view class="flex flex-col h-full">
<view class="flex items-center mx-[30rpx] mb-[30rpx]">
<image
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/cp-img/wd_baogao.png"
mode="scaleToFill"
class="w-[44rpx] h-[44rpx]"
/>
<text class="text-[40rpx] font-500">我的测评报告</text>
</view>
<scroll-view scroll-y class="flex-1">
<view class="px-[30rpx] flex flex-col gap-[16rpx] h-full">
<view
v-for="(item, index) in list"
:key="index"
class="flex gap-[20rpx] wish-border justify-between p-[32rpx] rounded-[16rpx]"
@click="useRouterDetail(item)"
>
<view class="flex flex-col gap-[14rpx]">
<text class="text-[#303030] text-[32rpx] font-600">
{{ item.title }}
</text>
<text class="text-[22rpx] text-[#303030]">
{{ useFormatTime(item.createTime, 'YYYY.MM.DD hh:mm') || '时间消失了' }}
</text>
</view>
</view>
<view class="flex flex-col items-center justify-center my-auto" v-if="list.length === 0">
<image
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/cp-img/wd_kongzhuangtai.png"
mode="scaleToFill"
class="w-[352rpx] h-[352rpx]"
/>
<text class="text-[#666] text-[24rpx] font-400">去完成首次测评生成你的专属报告</text>
<view
@click="navigateToHome"
class="rounded-full mx-[96rpx] bg-[#1580FF] w-full flex items-center justify-center py-[22rpx] text-[32rpx] font-500 text-white mt-[46rpx]"
>
<text>前往测评</text>
<image
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/cp-img/wd_qianwang.png"
mode="scaleToFill"
class="w-[40rpx] h-[40rpx] ml-[10rpx]"
/>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup lang="ts">
import { getMyBusReports } from '@/service/index/api'
import { useUserStore } from '@/store'
import { useRouterDetail } from './useRouterDetail'
import useFormatTime from './useTime'
const userStore = useUserStore()
const list = ref([])
const props = defineProps({
total: {
default: 0,
},
})
const emits = defineEmits(['update:total'])
const total = computed({
get: () => props.total,
set: (val) => {
emits('update:total', val)
},
})
onShow(() => {
getMyBusReports({ CustomId: userStore.userInfo?.estimatedAchievement.wxId }).then((res) => {
if (res.code === 200) {
list.value = (res.result as { customReports: any[] }).customReports
total.value = list.value.length
}
})
})
const navigateToHome = () => {
uni.switchTab({ url: '/pages/evaluation/index/index' })
}
</script>
<style lang="scss" scoped>
.wish-border {
background-color: #ffffff;
border-radius: 8rpx;
}
</style>

View File

@ -0,0 +1,23 @@
export default function formatDate(date: Date | string, format: string): string {
// 将输入转换为 Date 对象
const parsedDate = new Date(date)
// 检查是否是有效的日期
if (isNaN(parsedDate.getTime())) {
throw new Error('Invalid date')
}
const map: { [key: string]: string | number } = {
YYYY: parsedDate.getFullYear(), // 四位年份
MM: parsedDate.getMonth() + 1, // 月份1-12
DD: parsedDate.getDate(), // 日期1-31
hh: parsedDate.getHours(), // 小时0-23
mm: parsedDate.getMinutes(), // 分钟0-59
ss: parsedDate.getSeconds(), // 秒0-59
}
return format.replace(/YYYY|MM|DD|hh|mm|ss/g, (match) => {
const value = map[match as keyof typeof map]
return Number(value) < 10 ? `0${value}` : value.toString() // 小于10的前面补零
})
}

View File

@ -4,16 +4,16 @@ const tabbarList = ref<TabesItem[]>([
{ {
id: 3, id: 3,
path: '/pages/evaluation/index/index', path: '/pages/evaluation/index/index',
icon: '/static/tabBar/news.png', icon: '/static/tabBar/home.png',
selectIcon: '/static/tabBar/news-active.png', selectIcon: '/static/tabBar/home-active.png',
text: '测评', text: '首页',
centerItem: false, centerItem: false,
}, },
{ {
id: 4, id: 4,
path: '/pages/ucenter/index/index', path: '/pages/ucenter/index/index',
icon: '/static/tabBar/center.png', icon: '/static/tabBar/user.png',
selectIcon: '/static/tabBar/center-active.png', selectIcon: '/static/tabBar/user-active.png',
text: '我的', text: '我的',
centerItem: false, centerItem: false,
}, },

View File

@ -5,21 +5,22 @@
@click="toAiAssistant" @click="toAiAssistant"
v-if="aiShow" v-if="aiShow"
> >
<view <button
class="rounded-[8rpx] border-[#1580FF] border-[2rpx] border-solid w-full py-[14rpx] flex items-center justify-center" open-type="share"
class="rounded-[8rpx] bg-[#1580FF] border-[#1580FF] border-[2rpx] border-solid w-full flex items-center justify-center"
> >
<image <image
src="https://api.static.ycymedu.com/images/btn-bottom.png" src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/cp-img/baogao_fenxiang.png"
class="w-[52rpx] h-[52rpx] mr-[10rpx]" class="w-[52rpx] h-[52rpx] mr-[10rpx]"
></image> ></image>
<text class="text-[#1580FF] text-[32rpx] font-700">智能AI顾问</text> <text class="text-white text-[32rpx] font-700">报告分享</text>
</view> </button>
</view> </view>
<view v-else class="pb-safe"></view> <view v-else class="pb-safe"></view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const aiShow = ref(false) const aiShow = ref(true)
const props = defineProps({ const props = defineProps({
pageId: { pageId: {
@ -32,9 +33,5 @@ const props = defineProps({
}, },
}) })
const toAiAssistant = () => { const toAiAssistant = () => {}
uni.navigateTo({
url: `/aiService-sub/index/index?id=${props.pageId}&type=${props.pageType}`,
})
}
</script> </script>

File diff suppressed because one or more lines are too long

View File

@ -23,14 +23,14 @@
"spacing": "3px", "spacing": "3px",
"list": [ "list": [
{ {
"iconPath": "/static/tabBar/news.png", "iconPath": "/static/tabBar/home.png",
"selectedIconPath": "/static/tabBar/news-active.png", "selectedIconPath": "/static/tabBar/home-active.png",
"pagePath": "pages/evaluation/index/index", "pagePath": "pages/evaluation/index/index",
"text": "测评" "text": "首页"
}, },
{ {
"iconPath": "/static/tabBar/center.png", "iconPath": "/static/tabBar/user.png",
"selectedIconPath": "/static/tabBar/center-active.png", "selectedIconPath": "/static/tabBar/user-active.png",
"pagePath": "pages/ucenter/index/index", "pagePath": "pages/ucenter/index/index",
"text": "我的" "text": "我的"
} }
@ -46,15 +46,6 @@
"enableShareTimeline": true "enableShareTimeline": true
} }
}, },
{
"path": "pages/home/index/index",
"type": "page",
"style": {
"navigationStyle": "custom",
"enableShareAppMessage": true,
"enableShareTimeline": true
}
},
{ {
"path": "pages/ucenter/index/index", "path": "pages/ucenter/index/index",
"type": "page", "type": "page",
@ -99,13 +90,6 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "ucenter/evaluate/evaluateList",
"type": "page",
"style": {
"navigationBarTitleText": "测评结果"
}
},
{ {
"path": "ucenter/setting/about", "path": "ucenter/setting/about",
"type": "page" "type": "page"

View File

@ -1,180 +0,0 @@
<route lang="json5" type="page">
{
style: {
navigationStyle: 'custom',
enableShareAppMessage: true,
enableShareTimeline: true,
},
}
</route>
<template>
<view class="flex flex-col relative">
<view class="sticky top-0 z-99">
<Navbar
safeAreaInsetTop
:bg-color="`rgba(255, 255, 255, ${opacity})`"
placeholder
:bordered="false"
>
<template #left>
<navigator open-type="navigate" class="left-icon" url="/pages-sub/home/city/index">
<view>
<text
class="color-[#303030] font-[28rpx] font-medium"
:selectable="false"
:decode="false"
>
{{ userStore.userInfo.city.provincename ?? '城市' }}
</text>
<view class="i-carbon-chevron-down"></view>
</view>
</navigator>
</template>
<template #title>
<view class="title">
<image
class="w-[198rpx] h-[32rpx]"
src="https://api.static.ycymedu.com/src/images/home/app-logo.svg"
></image>
</view>
</template>
</Navbar>
</view>
<view class="h-[700rpx] w-full custom-background absolute top-0 left-0 z-[-1]"></view>
<scroll-view class="flex-1" :scroll-y="true">
<view class="h-full mt-[38rpx]">
<Banner />
<HomeSubMenu />
<HotRank />
<Consultation />
<FabButton :initial-x="0" :initial-y="100" />
</view>
</scroll-view>
<TabBar :current-page="0"></TabBar>
</view>
</template>
<script setup lang="ts">
import TabBar from '@/components/bar/TabBar.vue'
import Navbar from '@/components/navbar/Navbar.vue'
import { useCityInfo } from '@/hooks/useCityInfoHook'
import { useUserStore } from '@/store'
import { ref } from 'vue'
import Banner from '@/components/home/Banner.vue'
import HomeSubMenu from '@/components/home/SubMenu.vue'
import HotRank from '@/components/home/HotRank.vue'
import Consultation from '@/components/home/Consultation.vue'
import FabButton from '@/components/fab/FabButton.vue'
import { getWxUserInfo } from '@/service/index/api'
const userStore = useUserStore()
useCityInfo()
const opacity = ref(0)
onPageScroll((e) => {
const scrollTop = e.scrollTop
opacity.value = Math.min(scrollTop / 100, 1)
})
onShow(() => {
if (userStore.userInfo.token) {
getWxUserInfo().then((resp) => {
const infoData = resp.result as unknown as {
userExtend: { provinceCode: string }
batchName: string
batchDataUrl: string
}
if (userStore.userInfo.city.code === infoData.userExtend.provinceCode) {
userStore.setEstimatedAchievement(infoData.userExtend)
userStore.setBatchName(infoData.batchName)
userStore.setBatchDataUrl(infoData.batchDataUrl)
return
}
})
}
})
onShareAppMessage(() => {
return {
title: '六维生涯',
path: '/pages/home/index/index',
imageUrl: 'https://api.static.ycymedu.com/images/share.png',
}
})
onShareTimeline(() => {
return {
title: '六维生涯',
}
})
onLoad(() => {
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
//
if (res.hasUpdate) {
uni.showToast({
title: '更新提示',
content: '新版本已经准备好,将进行更新',
})
}
})
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// applyUpdate
updateManager.applyUpdate()
}
},
})
})
updateManager.onUpdateFailed(function () {
//
uni.showToast({
title: '更新失败',
icon: 'none',
})
})
})
</script>
<style lang="scss" scoped>
.left-icon {
position: absolute;
left: 32rpx;
width: max-content;
height: 40rpx;
color: #000;
}
.title {
display: flex;
align-items: center;
justify-content: center;
height: 44px;
font-size: 32rpx;
color: #000;
}
.custom-background {
background-image: linear-gradient(
173deg,
rgb(177, 221, 250) 0,
rgb(177, 221, 250) 23%,
rgba(255, 255, 255, 1) 90%,
rgba(255, 255, 255, 1) 100%
);
background-position: 50% 50%;
background-origin: padding-box;
background-clip: border-box;
background-size: auto auto;
}
</style>

View File

@ -6,47 +6,41 @@
} }
</route> </route>
<template> <template>
<view class="bg-[#F8F8F8] h-screen flex flex-col gap-[32rpx]"> <view class="custom-bg h-screen flex flex-col gap-[32rpx]">
<view class=""> <view class="">
<Navbar safeAreaInsetTop bg-color="transparent" placeholder :bordered="false"></Navbar> <Navbar safeAreaInsetTop bg-color="transparent" placeholder :bordered="false"></Navbar>
<view <view class="flex items-center justify-center px-[50rpx] pt-[40rpx]" @click.stop="goLogin">
class="flex px-[32rpx] gap-[24rpx] items-center justify-center flex-col" <view class="flex gap-[32rpx] items-center flex-auto">
@click.stop="goLogin" <image
> :src="
<image userStore.userInfo.avatar ||
:src=" 'https://private-zhiyuan.oss-cn-beijing.aliyuncs.com/avatar.png'
userStore.userInfo.avatar || "
'https://private-zhiyuan.oss-cn-beijing.aliyuncs.com/avatar.png' class="w-[132rpx] h-[132rpx] rounded-full z-[1]"
" mode="scaleToFill"
class="w-[112rpx] h-[112rpx] rounded-full z-[1]" />
mode="scaleToFill"
/> <view class="flex flex-col">
<view class="flex flex-col gap-[6rpx] py-[8rpx] z-[1] text-black"> <view class="text-[44rpx] font-600">{{ userStore.userInfo.nickname || '未登录' }}</view>
<text class="text-[32rpx] font-semibold"> <view class="text-[24rpx] text-[#666] font-400 mt-[4rpx]">
{{ userStore.userInfo.nickname || '未登录' }} 已完成 {{ evaluateTotal }} 项测评报告
</text> </view>
</view>
</view>
<view class="flex flex-col items-center" @click="toSetting">
<image
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/cp-img/wd_shezhi.png"
mode="scaleToFill"
class="h-[48rpx] w-[48rpx] mb-[10rpx]"
/>
<view class="text-[#333] text-[30rpx]">设置</view>
</view> </view>
</view> </view>
<!-- <view class="diagonal-lines"></view> -->
</view> </view>
<view class="mx-[32rpx] bg-[#fff] rounded-[8rpx]"> <EvaluateList class="flex-1 h-0 mt-[80rpx]" v-model:total="evaluateTotal" />
<view
class="flex items-center justify-between mx-[32rpx] py-[28rpx] not-last-child"
@click="goEvaluate"
>
<text>测评结果</text>
<view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view>
</view>
<view
class="flex items-center justify-between mx-[32rpx] py-[28rpx] not-last-child"
@click="toSetting"
>
<text>设置</text>
<view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view>
</view>
</view>
<TabBar :current-page="4"></TabBar> <TabBar :current-page="4"></TabBar>
<!-- <FabButton :initial-x="0" :initial-y="100" /> --> <!-- <FabButton :initial-x="0" :initial-y="100" /> -->
</view> </view>
@ -55,12 +49,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import TabBar from '@/components/bar/TabBar.vue' import TabBar from '@/components/bar/TabBar.vue'
import Navbar from '@/components/navbar/Navbar.vue' import Navbar from '@/components/navbar/Navbar.vue'
import EvaluateList from '@/components/userInfo/evaluateList.vue'
// import FabButton from '@/components/fab/FabButton.vue' // import FabButton from '@/components/fab/FabButton.vue'
import { useUserStore } from '@/store' import { useUserStore } from '@/store'
const userStore = useUserStore() const userStore = useUserStore()
const evaluateTotal = ref(0)
const goEvaluate = () => { const goEvaluate = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pages-sub/ucenter/evaluate/evaluateList', url: '/pages-sub/ucenter/evaluate/evaluateList',
@ -95,6 +92,9 @@ const goLogin = () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-bg {
background: linear-gradient(180deg, #1580ff33 0%, #f8f8f8 574rpx);
}
.background-wrapper { .background-wrapper {
position: relative; position: relative;
width: 100%; width: 100%;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
src/static/tabBar/home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/static/tabBar/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -5,11 +5,9 @@
interface NavigateToOptions { interface NavigateToOptions {
url: "/pages/evaluation/index/index" | url: "/pages/evaluation/index/index" |
"/pages/home/index/index" |
"/pages/ucenter/index/index" | "/pages/ucenter/index/index" |
"/pages-sub/evaluation/assessmentPage" | "/pages-sub/evaluation/assessmentPage" |
"/pages-sub/customerService/index/index" | "/pages-sub/customerService/index/index" |
"/pages-sub/ucenter/evaluate/evaluateList" |
"/pages-sub/ucenter/setting/about" | "/pages-sub/ucenter/setting/about" |
"/pages-sub/ucenter/setting/index" | "/pages-sub/ucenter/setting/index" |
"/login-sub/index" | "/login-sub/index" |