mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-07-27 12:30:41 +08:00
feat: 新增点赞、游客评论、分享等核心功能,重构页面逻辑
1. 新增全局点赞状态管理,使用metadata.name做key并持久化存储 2. 新增游客信息存储与评论面板,支持游客评论互动 3. 新增全局分享hook,为多个页面配置分享功能 4. 重构登录页面,支持登录/注册切换与游客访问模式 5. 合并注册页到登录页,简化路由结构 6. 优化剪贴板工具函数,支持自定义提示文本 7. 重构个人中心页面,支持游客信息管理 8. 修复相册页面标题与样式问题 9. 移除无用的备份文件与测试代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useAppShare } from '@/hooks/useShare'
|
||||
import { useRequest } from '@/hooks/useRequest'
|
||||
import { random } from '@/utils/base/random'
|
||||
import { queryLinkGroups, queryLinks } from '@/api/halo-plugin/link'
|
||||
@@ -26,9 +27,16 @@ definePage({
|
||||
},
|
||||
})
|
||||
|
||||
const { setShareOptions } = useAppShare()
|
||||
|
||||
const { config } = storeToRefs(useUniHaloConfigStore())
|
||||
const { reset } = useUniHaloConfigStore()
|
||||
|
||||
setShareOptions({
|
||||
title: '友情链接',
|
||||
path: '/pages/links/links',
|
||||
})
|
||||
|
||||
const { loading: loadingGroups, error: errorGroups, data: dataGroups, run: runGroups } = useRequest<ILinkGroup[]>(queryLinkGroups, { loadingToast: false, loadingToastContent: '加载中...', loadingToastMask: true })
|
||||
const { loading, error, data, run } = useRequest<IHaloListResponseBase<ILink>, IPaginationParams>(queryLinks, { loadingToast: false, loadingToastContent: '加载中...', loadingToastMask: true })
|
||||
|
||||
@@ -165,7 +173,7 @@ onLoad(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="bg-page3 min-h-screen w-full flex flex-col">
|
||||
<view class="min-h-screen w-full flex flex-col bg-page3">
|
||||
<!-- 分组列表 -->
|
||||
<view v-if="linkGroups.length !== 0" class="box-border w-full flex flex-col gap-y-6 overflow-hidden p-4 pb-0">
|
||||
<view v-for="(item, index) in linkGroups" :key="item.name" class="flex flex-col gap-y-4">
|
||||
@@ -223,7 +231,7 @@ onLoad(async () => {
|
||||
<view v-if="false" class="shrink-0">
|
||||
<view
|
||||
class="uh-shadow-md rounded-xl bg-gray-900 px-4 py-1.5 text-xs text-white"
|
||||
@click="copy(link.spec.url, true)"
|
||||
@click="copy(link.spec.url, '链接已复制')"
|
||||
>
|
||||
复制
|
||||
</view>
|
||||
@@ -258,7 +266,7 @@ onLoad(async () => {
|
||||
<button
|
||||
v-if="config.base.isIndividual"
|
||||
class="uh-shadow-md rounded-lg bg-gray-900 px-4 py-2 text-xs text-white outline-0 border-none!"
|
||||
@click="copy(link.spec.url, true)"
|
||||
@click="copy(link.spec.url, '链接已复制')"
|
||||
>
|
||||
<wd-icon name="copy" :size="14" /> 复制
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user