diff --git a/.cursorrules b/.cursorrules
index e0371d6..c19918b 100644
--- a/.cursorrules
+++ b/.cursorrules
@@ -16,4 +16,13 @@
- `views/`: 页面视图组件
- `open_live/`: 直播相关视图,包括点歌系统
- `obs/`: OBS相关视图组件
-- `public/`: 公共静态资源
\ No newline at end of file
+- `public/`: 公共静态资源
+
+## 项目使用的库
+
+- @vueuse/core: 提供了一系列的 Vue 3 的实用函数
+- @vicons/fluent: 图标
+- naive-ui: 组件库
+- pinia: 状态管理
+- vue-router: 路由
+- vue-echarts: 图表
diff --git a/src/api/api-models.ts b/src/api/api-models.ts
index f9cc960..4bdd17d 100644
--- a/src/api/api-models.ts
+++ b/src/api/api-models.ts
@@ -772,7 +772,7 @@ export interface ResponsePointOrder2OwnerModel {
type: GoodsTypes
customer: BiliAuthModel
address?: AddressInfo
- goodsId: number
+ goods: ResponsePointGoodModel
count: number
createAt: number
updateAt: number
diff --git a/src/components.d.ts b/src/components.d.ts
index 74e9605..5c3037f 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -22,6 +22,7 @@ declare module 'vue' {
NAvatar: typeof import('naive-ui')['NAvatar']
NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
+ NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NFlex: typeof import('naive-ui')['NFlex']
NFormItemGi: typeof import('naive-ui')['NFormItemGi']
@@ -29,6 +30,7 @@ declare module 'vue' {
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
+ NModal: typeof import('naive-ui')['NModal']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSpace: typeof import('naive-ui')['NSpace']
diff --git a/src/components/manage/AddressDisplay.vue b/src/components/manage/AddressDisplay.vue
index 933d7e7..63cb91b 100644
--- a/src/components/manage/AddressDisplay.vue
+++ b/src/components/manage/AddressDisplay.vue
@@ -15,33 +15,72 @@ const { height } = useElementSize(elementRef.value)
- 未知
-
-
+
+ 未知
+
+
+
{{ address.province }}
- 省
+
+ 省
+
{{ address.city }}
- 市
+
+ 市
+
{{ address.district }}
- 区
+
+ 区
+
{{ address.street }}
- 详细地址
- {{ address.address }}
+
+ 详细地址
+
+
+ {{ address.address }}
+
-
+
- 收货人
+
+ 收货人
+
{{ address.phone }} {{ address.name }}
-
-
+
+
diff --git a/src/components/manage/PointGoodsItem.vue b/src/components/manage/PointGoodsItem.vue
index 9a17829..87a96e2 100644
--- a/src/components/manage/PointGoodsItem.vue
+++ b/src/components/manage/PointGoodsItem.vue
@@ -7,6 +7,7 @@ import { NCard, NEllipsis, NEmpty, NFlex, NIcon, NImage, NTag, NText } from 'nai
const props = defineProps<{
goods: ResponsePointGoodModel | undefined;
contentStyle?: string | undefined;
+ size?: 'small' | 'default';
}>();
// 默认封面图片
diff --git a/src/components/manage/PointOrderCard.vue b/src/components/manage/PointOrderCard.vue
index 4a16900..c044590 100644
--- a/src/components/manage/PointOrderCard.vue
+++ b/src/components/manage/PointOrderCard.vue
@@ -2,9 +2,8 @@
import {
GoodsTypes,
PointOrderStatus,
- ResponsePointGoodModel,
ResponsePointOrder2OwnerModel,
- ResponsePointOrder2UserModel,
+ ResponsePointOrder2UserModel
} from '@/api/api-models'
import { QueryPostAPI } from '@/api/query'
import { POINT_API_URL } from '@/data/constants'
@@ -12,10 +11,13 @@ import { Info24Filled } from '@vicons/fluent'
import {
DataTableColumns,
DataTableRowKey,
+ NAlert,
NAutoComplete,
NButton,
+ NCard,
NDataTable,
NDivider,
+ NEllipsis,
NEmpty,
NFlex,
NIcon,
@@ -24,6 +26,7 @@ import {
NInputGroupLabel,
NModal,
NScrollbar,
+ NSpace,
NStep,
NSteps,
NTag,
@@ -32,9 +35,6 @@ import {
NTooltip,
useDialog,
useMessage,
- NCard,
- NSpace,
- NAlert,
} from 'naive-ui'
import { computed, h, onMounted, ref, watch } from 'vue'
import AddressDisplay from './AddressDisplay.vue'
@@ -45,10 +45,10 @@ type OrderType = ResponsePointOrder2UserModel | ResponsePointOrder2OwnerModel
const props = defineProps<{
order: ResponsePointOrder2UserModel[] | ResponsePointOrder2OwnerModel[]
type: 'user' | 'owner'
- goods?: ResponsePointGoodModel[]
loading?: boolean
}>()
+
const message = useMessage()
const dialog = useDialog()
const emit = defineEmits(['selectedItem'])
@@ -71,11 +71,7 @@ const orderAsOwner = computed(() => props.order as ResponsePointOrder2OwnerModel
const currentGoods = computed(() => {
if (!orderDetail.value) return null
- if (props.type === 'user') {
- return (orderDetail.value as ResponsePointOrder2UserModel).goods
- } else {
- return props.goods?.find((g) => g.id === (orderDetail.value as ResponsePointOrder2OwnerModel).goodsId)
- }
+ return orderDetail.value.goods
})
const expressOptions = computed(() => {
@@ -143,6 +139,7 @@ const orderColumn: DataTableColumns = [
},
{
title: '订单号',
+ minWidth: 70,
key: 'id',
},
{
@@ -173,11 +170,9 @@ const orderColumn: DataTableColumns = [
{
title: '礼物名',
key: 'giftName',
+ minWidth: 150,
render: (row: OrderType) => {
- if (row.instanceOf === 'user') {
- return (row as ResponsePointOrder2UserModel).goods.name
- }
- return props.goods?.find((g) => g.id === row.goodsId)?.name || '未知礼物'
+ return row.goods?.name
},
},
{
@@ -249,9 +244,7 @@ const orderColumn: DataTableColumns = [
key: 'address',
minWidth: 250,
render: (row: OrderType) => {
- const goodsCollectUrl = row.instanceOf === 'user'
- ? (row as ResponsePointOrder2UserModel).goods.collectUrl
- : props.goods?.find((g) => g.id === row.goodsId)?.collectUrl
+ const goodsCollectUrl = row.goods.collectUrl
if (row.type === GoodsTypes.Physical) {
return goodsCollectUrl
@@ -262,7 +255,7 @@ const orderColumn: DataTableColumns = [
text: true,
type: 'info'
}, () => h(NText, { italic: true }, () => '通过站外链接收集'))
- : h(AddressDisplay, { address: row.address })
+ : h(AddressDisplay, { address: row.address, size: 'small' })
} else {
return h(NText, { depth: 3, italic: true }, () => '无需发货')
}
@@ -277,7 +270,7 @@ const orderColumn: DataTableColumns = [
if (row.trackingNumber) {
return h(NFlex, { align: 'center', gap: 8 }, () => [
h(NTag, { size: 'tiny', bordered: false }, () => row.expressCompany),
- h(NText, { depth: 3 }, () => row.trackingNumber),
+ h(NEllipsis, { style: { maxWidth: '100px' } }, () => h(NText, { depth: 3 }, () => row.trackingNumber)),
])
}
return h(NText, { depth: 3, italic: true }, () => '尚未发货')
@@ -728,7 +721,10 @@ onMounted(() => {
size="small"
class="address-info-card"
>
-
+
diff --git a/src/views/BiliAuthView.vue b/src/views/BiliAuthView.vue
index 43c33ae..5180670 100644
--- a/src/views/BiliAuthView.vue
+++ b/src/views/BiliAuthView.vue
@@ -2,7 +2,7 @@
import { QueryGetAPI } from '@/api/query'
import { BILI_AUTH_API_URL, CURRENT_HOST } from '@/data/constants'
import { useBiliAuth } from '@/store/useBiliAuth'
-import { useStorage } from '@vueuse/core'
+import { useStorage, useBreakpoints as useVueUseBreakpoints, breakpointsTailwind } from '@vueuse/core'
import {
NAlert,
NButton,
@@ -17,7 +17,7 @@ import {
NStep,
NSteps,
NText,
- useMessage
+ useMessage,
} from 'naive-ui'
import { v4 as uuidv4 } from 'uuid'
import { computed, onMounted, ref } from 'vue'
@@ -30,6 +30,8 @@ type AuthStartModel = {
}
const message = useMessage()
+const breakpoints = useVueUseBreakpoints(breakpointsTailwind)
+const isSmallScreen = breakpoints.smaller('sm')
const guidKey = useStorage('Bili.Auth.Key', uuidv4())
const currentToken = useStorage('Bili.Auth.Selected', null)
@@ -97,11 +99,15 @@ function checkTimeLeft() {
}
}
function copyCode() {
- if (navigator.clipboard) {
- navigator.clipboard.writeText(startModel.value?.code ?? '')
- message.success('已复制认证码到剪切板')
+ const textToCopy = currentStep.value === 2
+ ? `${CURRENT_HOST}bili-user?auth=${currentToken.value}`
+ : startModel.value?.code ?? ''
+
+ if (navigator.clipboard && textToCopy) {
+ navigator.clipboard.writeText(textToCopy)
+ message.success(currentStep.value === 2 ? '已复制登陆链接到剪切板' : '已复制认证码到剪切板')
} else {
- message.warning('当前环境不支持自动复制, 请手动选择并复制')
+ message.warning('无法复制内容, 请手动选择并复制')
}
}
@@ -119,20 +125,25 @@ onMounted(async () => {
- Bilibili 身份验证
+
+ Bilibili 身份验证
+
-
+
{
description="现在就已经通过了认证!"
/>
-
-
-
-
- 剩余
-
-
-
- 复制认证码
-
-
-
- 前往直播间
-
-
-
+
+
- 认证超时
- {
- currentStep = 0
- timeOut = false
- }
- "
- >
- 重新开始
-
-
-
-
-
-
-
-
- 点击
+
+
+
+ 剩余时间:
+
+ 请复制下方的认证码,并前往指定直播间发送:
+
+
+
+
+ 复制
+
+
+
+ 前往直播间
+
+
+
+
+ {
+ currentStep = 0
+ timeOut = false
+ }
+ "
+ >
+ 重新开始认证
+
+
+
+
+
+
+
+
+
+ 点击
+
+ 开始认证
+
+ 后请在 5 分钟之内使用
+
+ 需要认证的账户
+
+ 在指定的直播间直播间内发送给出的验证码
+
+
+
+
开始认证
-
- 后请在 5 分钟之内使用
-
- 需要认证的账户
-
- 在指定的直播间直播间内发送给出的验证码
+
+
+
+
+
+
+
+ 你已完成验证! 请妥善保存你的登陆链接, 请勿让其他人获取. 丢失后可以再次通过认证流程获得.
+
+ 要在其他地方登陆, 或者需要重新登陆的话把这个链接复制到浏览器地址栏打开即可
+
+
+ 你的登陆链接为:
-
-
- 准备好了吗?
-
-
- 开始认证
-
-
-
-
-
-
- 你已完成验证! 请妥善保存你的登陆链接, 请勿让其他人获取. 丢失后可以再次通过认证流程获得.
-
- 要在其他地方登陆, 或者需要重新登陆的话把这个链接复制到浏览器地址栏打开即可
-
- 你的登陆链接为:
-
-
- 复制登陆链接
-
-
-
-
+ 复制登陆链接
+
+
+
- 前往个人中心
-
- {
- currentStep = 0
- //@ts-ignore
- currentToken = null
- guidKey = uuidv4()
- }
- "
- >
-
-
- 认证其他账号
-
-
- 这将会登出当前已认证的账号, 请先在认证其他账号前保存你的登陆链接
-
-
-
-
+
+ 前往个人中心
+
+ {
+ currentStep = 0
+ //@ts-ignore
+ currentToken = null
+ guidKey = uuidv4()
+ }
+ "
+ >
+
+
+ 认证其他账号
+
+
+ 这将会登出当前已认证的账号, 请先在认证其他账号前保存你的登陆链接
+
+
+
+
+
diff --git a/src/views/manage/point/PointOrderManage.vue b/src/views/manage/point/PointOrderManage.vue
index 968625b..44cb620 100644
--- a/src/views/manage/point/PointOrderManage.vue
+++ b/src/views/manage/point/PointOrderManage.vue
@@ -1,6 +1,6 @@