mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
feat: 更新API模型和组件以支持备注功能
- 在api-models.ts中为订单模型添加备注字段 - 在PointOrderCard.vue中新增备注列并调整显示逻辑 - 在PointOrderManage.vue中导出数据时包含备注信息 - 在PointGoodsView.vue中添加备注输入框以供用户填写
This commit is contained in:
@@ -777,7 +777,7 @@ export interface ResponsePointOrder2OwnerModel {
|
||||
createAt: number
|
||||
updateAt: number
|
||||
status: PointOrderStatus
|
||||
|
||||
remark?: string
|
||||
trackingNumber?: string
|
||||
expressCompany?: string
|
||||
}
|
||||
@@ -791,6 +791,7 @@ export interface ResponsePointOrder2UserModel {
|
||||
goods: ResponsePointGoodModel
|
||||
status: PointOrderStatus
|
||||
createAt: number
|
||||
remark?: string
|
||||
|
||||
trackingNumber?: string
|
||||
expressCompany?: string
|
||||
|
||||
@@ -239,6 +239,17 @@ const orderColumn: DataTableColumns<OrderType> = [
|
||||
}, () => row.type === GoodsTypes.Physical ? '实体礼物' : '虚拟礼物')
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'remark',
|
||||
minWidth: 100,
|
||||
render: (row: OrderType) => {
|
||||
if (!row.remark) {
|
||||
return h(NText, { depth: 3, italic: true }, () => '无')
|
||||
}
|
||||
return h(NEllipsis, { style: { maxWidth: '100px' } }, () => row.remark)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
key: 'address',
|
||||
@@ -281,6 +292,7 @@ const orderColumn: DataTableColumns<OrderType> = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
render: (row: OrderType) => {
|
||||
return h(
|
||||
NButton,
|
||||
@@ -462,8 +474,6 @@ onMounted(() => {
|
||||
trigger="none"
|
||||
>
|
||||
<div class="order-detail-content">
|
||||
<!-- 用户视图 -->
|
||||
<template v-if="orderDetail.instanceOf === 'user'">
|
||||
<NDivider style="margin-top: 0">
|
||||
礼物快照
|
||||
<NTooltip>
|
||||
@@ -482,6 +492,23 @@ onMounted(() => {
|
||||
/>
|
||||
</NFlex>
|
||||
|
||||
<!-- 移动并修改备注信息 -->
|
||||
<template v-if="orderDetail.remark">
|
||||
<NAlert
|
||||
title="备注信息"
|
||||
type="info"
|
||||
style="margin-top: 16px; margin-bottom: 16px;"
|
||||
closable
|
||||
>
|
||||
<template #icon>
|
||||
<NIcon :component="Info24Filled" />
|
||||
</template>
|
||||
<NText>{{ orderDetail.remark }}</NText>
|
||||
</NAlert>
|
||||
</template>
|
||||
|
||||
<!-- 用户视图 -->
|
||||
<template v-if="orderDetail.instanceOf === 'user'">
|
||||
<!-- 虚拟礼物内容 -->
|
||||
<template v-if="orderDetail.type === GoodsTypes.Virtual">
|
||||
<NDivider>虚拟礼物内容</NDivider>
|
||||
@@ -531,14 +558,6 @@ onMounted(() => {
|
||||
|
||||
<!-- 主播视图 -->
|
||||
<template v-else-if="orderDetail.instanceOf === 'owner'">
|
||||
<NFlex justify="center">
|
||||
<PointGoodsItem
|
||||
v-if="currentGoods"
|
||||
class="goods-item"
|
||||
:goods="currentGoods"
|
||||
/>
|
||||
</NFlex>
|
||||
|
||||
<NDivider>订单状态管理</NDivider>
|
||||
|
||||
<!-- 虚拟礼物提示 -->
|
||||
|
||||
@@ -188,6 +188,7 @@ function exportData() {
|
||||
礼物总价: s.point,
|
||||
快递公司: s.expressCompany,
|
||||
快递单号: s.trackingNumber,
|
||||
备注: s.remark ?? '',
|
||||
创建时间: format(s.createAt, 'yyyy-MM-dd HH:mm:ss'),
|
||||
更新时间: s.updateAt ? format(s.updateAt, 'yyyy-MM-dd HH:mm:ss') : '未更新',
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ const showAddressSelect = ref(false)
|
||||
const currentGoods = ref<ResponsePointGoodModel>() // 当前选中的礼物
|
||||
const buyCount = ref(1) // 购买数量
|
||||
const selectedAddress = ref<AddressInfo>() // 选中的地址
|
||||
const remark = ref('') // 新增:用于存储用户备注
|
||||
|
||||
// 筛选相关状态
|
||||
const selectedTag = ref<string>() // 选中的标签
|
||||
@@ -217,6 +218,7 @@ function resetBuyModalState() {
|
||||
selectedAddress.value = undefined
|
||||
buyCount.value = 1
|
||||
currentGoods.value = undefined
|
||||
remark.value = '' // 新增:重置备注
|
||||
}
|
||||
|
||||
// 处理模态框显示状态变化
|
||||
@@ -260,6 +262,7 @@ async function buyGoods() {
|
||||
goodsId: currentGoods.value?.id,
|
||||
count: buyCount.value,
|
||||
addressId: selectedAddress.value?.id ?? null, // 如果地址未选择,则传 null
|
||||
remark: remark.value, // 新增:将备注添加到请求中
|
||||
})
|
||||
|
||||
if (data.code === 200) {
|
||||
@@ -638,7 +641,7 @@ onMounted(async () => {
|
||||
/>
|
||||
|
||||
<!-- 兑换选项 (仅对实物或需要数量选择的礼物显示) -->
|
||||
<template v-if="currentGoods.type === GoodsTypes.Physical || (currentGoods.maxBuyCount ?? 1) > 1">
|
||||
<template v-if="currentGoods.type === GoodsTypes.Physical || (currentGoods.maxBuyCount ?? 1) > 1 || true">
|
||||
<NDivider style="margin-top: 12px; margin-bottom: 12px;">
|
||||
兑换选项
|
||||
</NDivider>
|
||||
@@ -689,6 +692,17 @@ onMounted(async () => {
|
||||
管理地址
|
||||
</NButton>
|
||||
</NFormItem>
|
||||
<!-- 备注输入 -->
|
||||
<NFormItem label="备注">
|
||||
<NInput
|
||||
v-model:value="remark"
|
||||
type="textarea"
|
||||
placeholder="可以在这里留下备注信息(可选)"
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
maxlength="100"
|
||||
show-count
|
||||
/>
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user