feat: 调整界面
|
|
@ -26,14 +26,14 @@ export default defineUniPages({
|
|||
spacing: '3px',
|
||||
list: [
|
||||
{
|
||||
iconPath: '/static/tabBar/news.png',
|
||||
selectedIconPath: '/static/tabBar/news-active.png',
|
||||
iconPath: '/static/tabBar/home.png',
|
||||
selectedIconPath: '/static/tabBar/home-active.png',
|
||||
pagePath: 'pages/evaluation/index/index',
|
||||
text: '测评',
|
||||
text: '首页',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/tabBar/center.png',
|
||||
selectedIconPath: '/static/tabBar/center-active.png',
|
||||
iconPath: '/static/tabBar/user.png',
|
||||
selectedIconPath: '/static/tabBar/user-active.png',
|
||||
pagePath: 'pages/ucenter/index/index',
|
||||
text: '我的',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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的前面补零
|
||||
})
|
||||
}
|
||||
|
|
@ -4,16 +4,16 @@ const tabbarList = ref<TabesItem[]>([
|
|||
{
|
||||
id: 3,
|
||||
path: '/pages/evaluation/index/index',
|
||||
icon: '/static/tabBar/news.png',
|
||||
selectIcon: '/static/tabBar/news-active.png',
|
||||
text: '测评',
|
||||
icon: '/static/tabBar/home.png',
|
||||
selectIcon: '/static/tabBar/home-active.png',
|
||||
text: '首页',
|
||||
centerItem: false,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
path: '/pages/ucenter/index/index',
|
||||
icon: '/static/tabBar/center.png',
|
||||
selectIcon: '/static/tabBar/center-active.png',
|
||||
icon: '/static/tabBar/user.png',
|
||||
selectIcon: '/static/tabBar/user-active.png',
|
||||
text: '我的',
|
||||
centerItem: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,21 +5,22 @@
|
|||
@click="toAiAssistant"
|
||||
v-if="aiShow"
|
||||
>
|
||||
<view
|
||||
class="rounded-[8rpx] border-[#1580FF] border-[2rpx] border-solid w-full py-[14rpx] flex items-center justify-center"
|
||||
<button
|
||||
open-type="share"
|
||||
class="rounded-[8rpx] bg-[#1580FF] border-[#1580FF] border-[2rpx] border-solid w-full flex items-center justify-center"
|
||||
>
|
||||
<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]"
|
||||
></image>
|
||||
<text class="text-[#1580FF] text-[32rpx] font-700">智能AI顾问</text>
|
||||
</view>
|
||||
<text class="text-white text-[32rpx] font-700">报告分享</text>
|
||||
</button>
|
||||
</view>
|
||||
<view v-else class="pb-safe"></view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const aiShow = ref(false)
|
||||
const aiShow = ref(true)
|
||||
|
||||
const props = defineProps({
|
||||
pageId: {
|
||||
|
|
@ -32,9 +33,5 @@ const props = defineProps({
|
|||
},
|
||||
})
|
||||
|
||||
const toAiAssistant = () => {
|
||||
uni.navigateTo({
|
||||
url: `/aiService-sub/index/index?id=${props.pageId}&type=${props.pageType}`,
|
||||
})
|
||||
}
|
||||
const toAiAssistant = () => {}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@
|
|||
"spacing": "3px",
|
||||
"list": [
|
||||
{
|
||||
"iconPath": "/static/tabBar/news.png",
|
||||
"selectedIconPath": "/static/tabBar/news-active.png",
|
||||
"iconPath": "/static/tabBar/home.png",
|
||||
"selectedIconPath": "/static/tabBar/home-active.png",
|
||||
"pagePath": "pages/evaluation/index/index",
|
||||
"text": "测评"
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"iconPath": "/static/tabBar/center.png",
|
||||
"selectedIconPath": "/static/tabBar/center-active.png",
|
||||
"iconPath": "/static/tabBar/user.png",
|
||||
"selectedIconPath": "/static/tabBar/user-active.png",
|
||||
"pagePath": "pages/ucenter/index/index",
|
||||
"text": "我的"
|
||||
}
|
||||
|
|
@ -46,15 +46,6 @@
|
|||
"enableShareTimeline": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/home/index/index",
|
||||
"type": "page",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enableShareAppMessage": true,
|
||||
"enableShareTimeline": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ucenter/index/index",
|
||||
"type": "page",
|
||||
|
|
@ -99,13 +90,6 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "ucenter/evaluate/evaluateList",
|
||||
"type": "page",
|
||||
"style": {
|
||||
"navigationBarTitleText": "测评结果"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "ucenter/setting/about",
|
||||
"type": "page"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -6,47 +6,41 @@
|
|||
}
|
||||
</route>
|
||||
<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="">
|
||||
<Navbar safeAreaInsetTop bg-color="transparent" placeholder :bordered="false"></Navbar>
|
||||
<view
|
||||
class="flex px-[32rpx] gap-[24rpx] items-center justify-center flex-col"
|
||||
@click.stop="goLogin"
|
||||
>
|
||||
<view class="flex items-center justify-center px-[50rpx] pt-[40rpx]" @click.stop="goLogin">
|
||||
<view class="flex gap-[32rpx] items-center flex-auto">
|
||||
<image
|
||||
:src="
|
||||
userStore.userInfo.avatar ||
|
||||
'https://private-zhiyuan.oss-cn-beijing.aliyuncs.com/avatar.png'
|
||||
"
|
||||
class="w-[112rpx] h-[112rpx] rounded-full z-[1]"
|
||||
class="w-[132rpx] h-[132rpx] rounded-full z-[1]"
|
||||
mode="scaleToFill"
|
||||
/>
|
||||
<view class="flex flex-col gap-[6rpx] py-[8rpx] z-[1] text-black">
|
||||
<text class="text-[32rpx] font-semibold">
|
||||
{{ userStore.userInfo.nickname || '未登录' }}
|
||||
</text>
|
||||
|
||||
<view class="flex flex-col">
|
||||
<view class="text-[44rpx] font-600">{{ userStore.userInfo.nickname || '未登录' }}</view>
|
||||
<view class="text-[24rpx] text-[#666] font-400 mt-[4rpx]">
|
||||
已完成 {{ evaluateTotal }} 项测评报告
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="diagonal-lines"></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 class="mx-[32rpx] bg-[#fff] rounded-[8rpx]">
|
||||
<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>
|
||||
<EvaluateList class="flex-1 h-0 mt-[80rpx]" v-model:total="evaluateTotal" />
|
||||
|
||||
<TabBar :current-page="4"></TabBar>
|
||||
<!-- <FabButton :initial-x="0" :initial-y="100" /> -->
|
||||
</view>
|
||||
|
|
@ -55,12 +49,15 @@
|
|||
<script lang="ts" setup>
|
||||
import TabBar from '@/components/bar/TabBar.vue'
|
||||
import Navbar from '@/components/navbar/Navbar.vue'
|
||||
import EvaluateList from '@/components/userInfo/evaluateList.vue'
|
||||
// import FabButton from '@/components/fab/FabButton.vue'
|
||||
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const evaluateTotal = ref(0)
|
||||
|
||||
const goEvaluate = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages-sub/ucenter/evaluate/evaluateList',
|
||||
|
|
@ -95,6 +92,9 @@ const goLogin = () => {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.custom-bg {
|
||||
background: linear-gradient(180deg, #1580ff33 0%, #f8f8f8 574rpx);
|
||||
}
|
||||
.background-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 980 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 747 B |
|
Before Width: | Height: | Size: 760 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -5,11 +5,9 @@
|
|||
|
||||
interface NavigateToOptions {
|
||||
url: "/pages/evaluation/index/index" |
|
||||
"/pages/home/index/index" |
|
||||
"/pages/ucenter/index/index" |
|
||||
"/pages-sub/evaluation/assessmentPage" |
|
||||
"/pages-sub/customerService/index/index" |
|
||||
"/pages-sub/ucenter/evaluate/evaluateList" |
|
||||
"/pages-sub/ucenter/setting/about" |
|
||||
"/pages-sub/ucenter/setting/index" |
|
||||
"/login-sub/index" |
|
||||
|
|
|
|||