feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations

This commit is contained in:
Neo
2026-03-20 01:43:48 +08:00
parent 075caf067f
commit 79f9a0e1da
437 changed files with 118603 additions and 976 deletions

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,32 @@
/**
* service-record-card — 服务记录单条卡片组件
* 用于 task-detail「60天内服务记录」和 customer-service-records 列表
*
* 数据约定(两端统一传原始数字,组件负责格式化):
* hours / hoursRaw — 小时数number组件展示时加 h 后缀
* income — 金额number组件展示时加 ¥ 前缀
*/
Component({
properties: {
/** 时间,如 "2026-02-07 21:30" */
time: { type: String, value: '' },
/** 课程标签文字,如 "基础课" "包厢课" "打赏课" */
courseLabel: { type: String, value: '' },
/** 课程样式 class 后缀basic / vip / tip / recharge */
typeClass: { type: String, value: 'basic' },
/** 卡片类型:默认 courserecharge=充值提成 */
type: { type: String, value: 'course' },
/** 台桌号,如 "A12号台" */
tableNo: { type: String, value: '' },
/** 折算后小时数(原始数字,如 2.5),组件展示时加 h 后缀 */
hours: { type: Number, value: 0 },
/** 折算前小时数(原始数字,如 3.0),组件展示时加 h 后缀 */
hoursRaw: { type: Number, value: 0 },
/** 商品/饮品描述 */
drinks: { type: String, value: '' },
/** 金额(原始数字,如 200组件展示时加 ¥ 前缀 */
income: { type: Number, value: 0 },
/** 是否为预估金额(显示「预估」标签) */
isEstimate: { type: Boolean, value: false },
},
})

View File

@@ -0,0 +1,22 @@
<!-- service-record-card 组件 —— 60天内服务记录单条卡片 -->
<view class="svc-card {{type === 'recharge' ? 'svc-card--recharge' : ''}}" hover-class="svc-card--hover">
<!-- 第一行:左=时间,右=课程+台桌+小时数 -->
<view class="svc-row svc-row1">
<text class="svc-time">{{time}}</text>
<view class="svc-right1">
<text class="svc-course-tag svc-course-{{typeClass}}">{{type === 'recharge' ? '充值' : courseLabel}}</text>
<text class="svc-table-label" wx:if="{{tableNo && type !== 'recharge'}}">{{tableNo}}</text>
<text class="svc-hours" wx:if="{{hours && type !== 'recharge'}}">{{hours}}h</text>
<text class="svc-hours-raw" wx:if="{{hoursRaw && hoursRaw !== hours && type !== 'recharge'}}">折前{{hoursRaw}}h</text>
</view>
</view>
<!-- 第二行:左=商品,右=金额(含预估/提成) -->
<view class="svc-row svc-row2">
<text class="svc-drinks">{{drinks || '—'}}</text>
<view class="svc-income-wrap">
<text class="svc-income-est" wx:if="{{isEstimate && type !== 'recharge'}}">预估</text>
<text class="svc-income-label">{{type === 'recharge' ? '提成' : '到手'}}</text>
<text class="svc-income {{type === 'recharge' ? 'svc-income--recharge' : ''}}">¥{{income}}</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,136 @@
/* service-record-card 组件样式 */
.svc-card {
padding: 22rpx 26rpx;
border-radius: 22rpx;
border: 2rpx solid #eeeeee;
background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
}
.svc-card--hover {
background: #f5f5f5;
}
.svc-card--recharge {
background: linear-gradient(135deg, #fffef0 0%, #fffbeb 100%);
border-color: #fef3c7;
}
/* 行通用 */
.svc-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.svc-row1 {
margin-bottom: 14rpx;
}
/* 第一行左:时间 */
.svc-time {
font-size: 24rpx;
line-height: 32rpx;
color: #8b8b8b;
}
/* 第一行右:课程+台桌+小时 */
.svc-right1 {
display: flex;
align-items: center;
gap: 10rpx;
}
.svc-course-tag {
font-size: 22rpx;
line-height: 29rpx;
font-weight: 500;
padding: 3rpx 12rpx;
border-radius: 8rpx;
}
.svc-course-basic {
background: rgba(0, 168, 112, 0.10);
color: #00a870;
}
.svc-course-vip {
background: rgba(0, 82, 217, 0.10);
color: #0052d9;
}
.svc-course-tip {
background: rgba(237, 123, 47, 0.10);
color: #ed7b2f;
}
.svc-course-recharge {
background: rgba(212, 160, 23, 0.12);
color: #b45309;
}
.svc-table-label {
font-size: 22rpx;
line-height: 29rpx;
color: #5a5a5a;
font-weight: 500;
}
.svc-hours {
font-size: 28rpx;
line-height: 36rpx;
font-weight: 700;
color: #393939;
font-variant-numeric: tabular-nums;
}
.svc-hours-raw {
font-size: 20rpx;
line-height: 29rpx;
color: #b9b9b9;
}
/* 第二行左:商品 */
.svc-drinks {
font-size: 22rpx;
line-height: 29rpx;
color: #8b8b8b;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 340rpx;
}
/* 第二行右:金额 */
.svc-income-wrap {
display: flex;
align-items: baseline;
gap: 20rpx;
flex-shrink: 0;
}
.svc-income-label {
font-size: 20rpx;
line-height: 26rpx;
color: #a6a6a6;
}
.svc-income {
font-size: 30rpx;
line-height: 36rpx;
font-weight: 700;
color: #242424;
font-variant-numeric: tabular-nums;
}
.svc-income--recharge {
color: #b45309;
}
.svc-income-est {
font-size: 20rpx;
line-height: 26rpx;
color: #ed7b2f;
font-weight: 500;
margin-right: -14rpx;
}