-
@@ -471,7 +470,6 @@ const orderPaymentStatus = (order: any) => String(order.paymentStatus || order.p
const isOrderPaid = (order: any) => orderPaymentStatus(order) === 'PAID'
const orderNeedsPayment = (order: any) => Number(order.status) === 1 && !isOrderPaid(order)
const canPreparePayment = (order: any) => orderNeedsPayment(order) && orderPaymentStatus(order) !== 'PAYING'
-const canMockPay = (order: any) => Number(order.status) === 1 && orderPaymentStatus(order) === 'PAYING'
const canApplyAfterSale = (order: any) => !isQuoteConfirming(order) && (Number(order.status) === 2 || isOrderPaid(order))
/**
@@ -779,18 +777,6 @@ const preparePayment = async (order: any) => {
}
}
-const mockPay = async (order: any) => {
- try {
- await runWithGlobalLoading(async () => {
- await paymentApi.mockSuccess(order.id)
- await loadOrders()
- })
- message.success('支付成功')
- } catch (error: any) {
- message.error(error?.message || '支付失败')
- }
-}
-
const submitQuoteReply = async (order: any) => {
const key = quoteOrderKey(order)
const remark = String(quoteReplyForms[key] || '').trim()
diff --git a/JC-ArtList-WeChat/api/payment.js b/JC-ArtList-WeChat/api/payment.js
index b551479f..89caf52d 100644
--- a/JC-ArtList-WeChat/api/payment.js
+++ b/JC-ArtList-WeChat/api/payment.js
@@ -7,13 +7,5 @@ module.exports = {
method: 'POST',
data: {}
})
- },
-
- mockOrderPaymentSuccess(orderId) {
- return request({
- url: `/payment/order/${orderId}/mock-success`,
- method: 'POST',
- data: {}
- })
}
}
diff --git a/JC-ArtList-WeChat/api/vnext.test.js b/JC-ArtList-WeChat/api/vnext.test.js
index 95d3a12a..154b78bc 100644
--- a/JC-ArtList-WeChat/api/vnext.test.js
+++ b/JC-ArtList-WeChat/api/vnext.test.js
@@ -19,7 +19,6 @@ const afterSaleApi = require('./after-sale')
const growthApi = require('./growth')
paymentApi.prepareOrderPayment(12)
-paymentApi.mockOrderPaymentSuccess(12)
afterSaleApi.applyAfterSale({ orderId: 12, reason: 'need refund' })
afterSaleApi.getMyAfterSales({ page: 2, size: 5 })
growthApi.getGrowthSummary()
@@ -32,19 +31,14 @@ assert.deepStrictEqual(calls[0], {
data: {}
})
assert.deepStrictEqual(calls[1], {
- url: '/payment/order/12/mock-success',
- method: 'POST',
- data: {}
-})
-assert.deepStrictEqual(calls[2], {
url: '/after-sale/apply',
method: 'POST',
data: { orderId: 12, reason: 'need refund' }
})
-assert.deepStrictEqual(calls[3], {
+assert.deepStrictEqual(calls[2], {
url: '/after-sale/my',
params: { page: 2, size: 5 }
})
-assert.deepStrictEqual(calls[4], {
+assert.deepStrictEqual(calls[3], {
url: '/growth/summary'
})
diff --git a/JC-ArtList-WeChat/app.json b/JC-ArtList-WeChat/app.json
index 945da678..64a16f58 100644
--- a/JC-ArtList-WeChat/app.json
+++ b/JC-ArtList-WeChat/app.json
@@ -7,7 +7,6 @@
"pages/profile/index",
"pages/auth/index",
"pages/product-detail/index",
- "pages/artist-profile/index",
"pages/shop-detail/index",
"pages/orders/index",
"pages/order-detail/index",
@@ -15,8 +14,6 @@
"pages/after-sale-apply/index",
"pages/service-progress/index",
"pages/help/index",
- "pages/artist-orders/index",
- "pages/artist-calendar/index",
"pages/account-settings/index",
"pages/password-settings/index",
"pages/wishlist/index",
diff --git a/JC-ArtList-WeChat/pages/artist-calendar/index.js b/JC-ArtList-WeChat/pages/artist-calendar/index.js
deleted file mode 100644
index 5d32fb83..00000000
--- a/JC-ArtList-WeChat/pages/artist-calendar/index.js
+++ /dev/null
@@ -1,76 +0,0 @@
-const orderApi = require('../../api/order')
-const auth = require('../../utils/auth')
-const navigation = require('../../utils/navigation')
-const theme = require('../../utils/theme')
-const { formatDateTime, formatPrice } = require('../../utils/format')
-const { runWithLoading } = require('../../utils/loading')
-
-function safeList(value) {
- return Array.isArray(value) ? value : []
-}
-
-function formatClock(value) {
- return value ? String(value).replace('T', ' ').slice(11, 16) : '--'
-}
-
-function formatAppointment(item) {
- return {
- ...item,
- dayText: String(item.appointmentStartTime || '').slice(5, 10),
- timeText: `${formatClock(item.appointmentStartTime)}-${formatClock(item.appointmentEndTime)}`,
- amountText: `¥${formatPrice(item.actualAmount || item.totalAmount)}`,
- dateTimeText: formatDateTime(item.appointmentStartTime)
- }
-}
-
-Page({
- data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
- loading: false,
- isLoggedIn: false,
- appointments: []
- }),
-
- onShow() {
- this.loadAppointments()
- },
-
- handleBack() {
- navigation.goBack('/pages/artist-orders/index')
- },
-
- async loadAppointments() {
- const isLoggedIn = auth.isLoggedIn()
- this.setData({ isLoggedIn })
- if (!isLoggedIn) {
- navigation.openAuth(navigation.getCurrentPageUrl())
- return
- }
- this.setData({ loading: true })
- try {
- const list = safeList(await orderApi.getArtistCalendarRecent(7))
- this.setData({
- appointments: list.map(formatAppointment)
- })
- } catch (error) {
- wx.showToast({ title: error.message || '预约日历加载失败', icon: 'none' })
- } finally {
- this.setData({ loading: false })
- }
- },
-
- openArtistOrders() {
- navigation.navigate('/pages/artist-orders/index')
- },
-
- async completeOrder(event) {
- const orderId = event.currentTarget.dataset.orderId
- if (!orderId) return
- try {
- await runWithLoading(() => orderApi.completeArtistOrder(orderId))
- wx.showToast({ title: '服务已完成', icon: 'none' })
- await this.loadAppointments()
- } catch (error) {
- wx.showToast({ title: error.message || '完成服务失败', icon: 'none' })
- }
- }
-})
diff --git a/JC-ArtList-WeChat/pages/artist-calendar/index.json b/JC-ArtList-WeChat/pages/artist-calendar/index.json
deleted file mode 100644
index 8632c9b0..00000000
--- a/JC-ArtList-WeChat/pages/artist-calendar/index.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {
- "navigation-bar": "/components/navigation-bar/navigation-bar"
- }
-}
diff --git a/JC-ArtList-WeChat/pages/artist-calendar/index.wxml b/JC-ArtList-WeChat/pages/artist-calendar/index.wxml
deleted file mode 100644
index 52ab222e..00000000
--- a/JC-ArtList-WeChat/pages/artist-calendar/index.wxml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- 未来 7 天
- {{appointments.length}} 个预约
- 按时间查看即将服务的客户与项目
-
- 订单列表
-
-
-
-
- 正在加载日历
-
-
-
-
-
- {{item.dayText}}
- {{item.timeText}}
-
-
- {{item.customerNickname || '客户'}} · {{item.productTitle}}
- {{item.orderStatusText}} · {{item.shopName || '门店'}}
- {{item.amountText}}
- 完成服务
-
-
-
-
-
- 未来 7 天暂无预约
-
-
-
diff --git a/JC-ArtList-WeChat/pages/artist-calendar/index.wxss b/JC-ArtList-WeChat/pages/artist-calendar/index.wxss
deleted file mode 100644
index 77c57625..00000000
--- a/JC-ArtList-WeChat/pages/artist-calendar/index.wxss
+++ /dev/null
@@ -1,49 +0,0 @@
-.appointment-card {
- display: flex;
- gap: 18rpx;
- margin-top: 22rpx;
- padding: 24rpx;
-}
-
-.day-box {
- width: 136rpx;
- flex: 0 0 auto;
- display: flex;
- flex-direction: column;
- justify-content: center;
- gap: 8rpx;
- padding: 20rpx 12rpx;
- border-radius: 24rpx;
- background: var(--theme-primary-soft);
- color: var(--theme-primary);
- text-align: center;
- font-weight: 800;
-}
-
-.appointment-main {
- flex: 1;
- min-width: 0;
-}
-
-.appointment-title,
-.appointment-line {
- display: block;
-}
-
-.appointment-title {
- color: var(--text-primary);
- font-size: 29rpx;
- font-weight: 800;
- line-height: 1.45;
-}
-
-.appointment-line {
- margin-top: 8rpx;
- color: #504444;
- font-size: 24rpx;
- line-height: 1.6;
-}
-
-.ghost-btn {
- margin-top: 16rpx;
-}
diff --git a/JC-ArtList-WeChat/pages/artist-orders/index.js b/JC-ArtList-WeChat/pages/artist-orders/index.js
deleted file mode 100644
index 6142f28b..00000000
--- a/JC-ArtList-WeChat/pages/artist-orders/index.js
+++ /dev/null
@@ -1,92 +0,0 @@
-const orderApi = require('../../api/order')
-const auth = require('../../utils/auth')
-const navigation = require('../../utils/navigation')
-const theme = require('../../utils/theme')
-const { resolveLegacyImage } = require('../../utils/file')
-const { formatDateTime, formatPrice, getOrderStatusClass, getOrderStatusText } = require('../../utils/format')
-const { runWithLoading } = require('../../utils/loading')
-
-function safeList(value) {
- return Array.isArray(value) ? value : []
-}
-
-async function formatOrder(order) {
- return {
- ...order,
- statusText: getOrderStatusText(order),
- statusClass: getOrderStatusClass(order),
- amountText: `¥${formatPrice(order && order.actualAmount)}`,
- items: await Promise.all(safeList(order && order.items).map(async item => ({
- ...item,
- productImageUrl: await resolveLegacyImage(item.productImage),
- priceText: `¥${formatPrice(item.price)}`,
- appointmentText: formatDateTime(item.appointmentTime)
- })))
- }
-}
-
-Page({
- data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
- loading: false,
- isLoggedIn: false,
- orders: [],
- focusOrderId: ''
- }),
-
- onLoad(options) {
- this.setData({
- focusOrderId: (options && options.orderId) || ''
- })
- },
-
- onShow() {
- this.loadOrders()
- },
-
- handleBack() {
- navigation.goBack('/pages/profile/index')
- },
-
- async loadOrders() {
- const isLoggedIn = auth.isLoggedIn()
- this.setData({ isLoggedIn })
- if (!isLoggedIn) {
- navigation.openAuth(navigation.getCurrentPageUrl())
- return
- }
- this.setData({ loading: true })
- try {
- const list = safeList(await orderApi.getArtistOrders())
- const orders = await Promise.all(list.map(formatOrder))
- this.setData({ orders })
- } catch (error) {
- wx.showToast({ title: error.message || '美甲师订单加载失败', icon: 'none' })
- } finally {
- this.setData({ loading: false })
- }
- },
-
- openCalendar() {
- navigation.navigate('/pages/artist-calendar/index')
- },
-
- async completeOrder(event) {
- const orderId = event.currentTarget.dataset.orderId
- if (!orderId) return
- const confirmed = await new Promise(resolve => {
- wx.showModal({
- title: '完成服务',
- content: '确认这笔订单已经完成服务吗?',
- success: res => resolve(Boolean(res.confirm))
- })
- })
- if (!confirmed) return
- try {
- await runWithLoading(() => orderApi.completeArtistOrder(orderId))
- wx.showToast({ title: '服务已完成', icon: 'none' })
- await this.loadOrders()
- } catch (error) {
- wx.showToast({ title: error.message || '完成订单失败', icon: 'none' })
- }
- }
-})
diff --git a/JC-ArtList-WeChat/pages/artist-orders/index.json b/JC-ArtList-WeChat/pages/artist-orders/index.json
deleted file mode 100644
index 8632c9b0..00000000
--- a/JC-ArtList-WeChat/pages/artist-orders/index.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "usingComponents": {
- "navigation-bar": "/components/navigation-bar/navigation-bar"
- }
-}
diff --git a/JC-ArtList-WeChat/pages/artist-orders/index.wxml b/JC-ArtList-WeChat/pages/artist-orders/index.wxml
deleted file mode 100644
index 777e3522..00000000
--- a/JC-ArtList-WeChat/pages/artist-orders/index.wxml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
- 服务订单
- {{orders.length}} 笔相关订单
- 查看客户预约、项目和服务完成状态
-
- 预约日历
-
-
-
-
- 正在加载订单
-
-
-
-
-
-
- {{item.orderNo}}
- {{item.customerNickname || '客户'}} {{item.customerPhoneMasked || ''}}
-
- {{item.statusText}}
-
-
-
-
- {{orderItem.productTitle}}
- {{orderItem.priceText}} x {{orderItem.quantity}}
- 预约:{{orderItem.appointmentText}}
-
-
-
-
-
-
-
- 暂无相关订单
- 有客户预约你服务的项目后会出现在这里
-
-
-
diff --git a/JC-ArtList-WeChat/pages/artist-orders/index.wxss b/JC-ArtList-WeChat/pages/artist-orders/index.wxss
deleted file mode 100644
index 8e46a19c..00000000
--- a/JC-ArtList-WeChat/pages/artist-orders/index.wxss
+++ /dev/null
@@ -1,70 +0,0 @@
-.order-card {
- margin-top: 22rpx;
- padding: 26rpx;
-}
-
-.order-card.focus-target {
- border-color: var(--theme-primary);
-}
-
-.order-head,
-.order-foot {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 18rpx;
-}
-
-.order-no,
-.order-line,
-.order-amount {
- display: block;
-}
-
-.order-no {
- color: var(--text-primary);
- font-size: 28rpx;
- font-weight: 800;
-}
-
-.order-line {
- margin-top: 8rpx;
- color: #504444;
- font-size: 24rpx;
- line-height: 1.6;
-}
-
-.item-row {
- display: flex;
- gap: 18rpx;
- margin-top: 22rpx;
-}
-
-.item-thumb {
- width: 116rpx;
- height: 116rpx;
- border-radius: 22rpx;
- background: var(--theme-primary-soft);
-}
-
-.item-main {
- flex: 1;
- min-width: 0;
-}
-
-.item-title {
- display: block;
- color: var(--text-primary);
- font-size: 28rpx;
- font-weight: 800;
-}
-
-.order-foot {
- margin-top: 24rpx;
-}
-
-.order-amount {
- color: var(--text-primary);
- font-size: 28rpx;
- font-weight: 800;
-}
diff --git a/JC-ArtList-WeChat/pages/artist-profile/index.js b/JC-ArtList-WeChat/pages/artist-profile/index.js
deleted file mode 100644
index 848d8c7b..00000000
--- a/JC-ArtList-WeChat/pages/artist-profile/index.js
+++ /dev/null
@@ -1,136 +0,0 @@
-const nailArtistApi = require('../../api/nail-artist')
-const navigation = require('../../utils/navigation')
-const { DEFAULT_PRODUCT_IMAGE } = require('../../utils/config')
-
-function formatPrice(price) {
- const value = Number(price || 0)
- return value > 0 ? `¥${value.toFixed(2)}` : '到店确认'
-}
-
-function formatDateTime(value) {
- if (!value) {
- return ''
- }
- return String(value).replace('T', ' ').slice(0, 16)
-}
-
-Page({
- data: {
- loading: true,
- loadError: '',
- artistId: '',
- profile: null,
- works: [],
- reviews: [],
- availability: [],
- heroImage: DEFAULT_PRODUCT_IMAGE,
- artistName: '美甲师',
- artistDesc: '专注细节与稳定出品',
- shopName: '门店待确认',
- styleTags: [],
- ratingText: '0.0',
- serviceCountText: '0',
- workTimeText: '到店确认'
- },
-
- onLoad(options) {
- this.setData({
- artistId: options && options.id ? options.id : ''
- })
- this.loadArtistProfile()
- },
-
- async onPullDownRefresh() {
- await this.loadArtistProfile()
- wx.stopPullDownRefresh()
- },
-
- async loadArtistProfile() {
- if (!this.data.artistId) {
- this.setData({
- loading: false,
- loadError: '缺少美甲师信息'
- })
- return
- }
-
- this.setData({
- loading: true,
- loadError: ''
- })
-
- try {
- const [profile, availability, reviews] = await Promise.all([
- nailArtistApi.getPublicProfile(this.data.artistId),
- nailArtistApi.getAvailability(this.data.artistId),
- nailArtistApi.listReviews(this.data.artistId)
- ])
- const works = (profile.works || []).map(work => ({
- ...work,
- title: work.title || '美甲作品',
- coverImageUrl: work.coverImageUrl || DEFAULT_PRODUCT_IMAGE,
- priceText: formatPrice(work.price)
- }))
- const formattedReviews = (reviews || profile.reviews || []).map(review => ({
- ...review,
- customerName: review.customerName || '匿名用户',
- content: review.content || '这位用户没有填写文字评价',
- submittedAtText: formatDateTime(review.submittedAt),
- ratingText: Number(review.rating || 0).toFixed(1)
- }))
- const start = profile.workStartTime ? String(profile.workStartTime).slice(0, 5) : ''
- const end = profile.workEndTime ? String(profile.workEndTime).slice(0, 5) : ''
-
- this.setData({
- profile,
- works,
- reviews: formattedReviews,
- availability: availability || profile.availability || [],
- heroImage: (works.find(work => work.coverImageUrl) || {}).coverImageUrl || DEFAULT_PRODUCT_IMAGE,
- artistName: profile.artistName || '美甲师',
- artistDesc: profile.identity || profile.signature || '专注细节与稳定出品',
- shopName: profile.shopName || '门店待确认',
- styleTags: (profile.styleTags || []).filter(Boolean),
- ratingText: Number(profile.rating || 0).toFixed(1),
- serviceCountText: String(profile.serviceCount || 0),
- workTimeText: start && end ? `${start}-${end}` : '到店确认'
- })
- } catch (error) {
- this.setData({
- loadError: error.message || '美甲师个人页加载失败'
- })
- } finally {
- this.setData({
- loading: false
- })
- }
- },
-
- handleBack() {
- navigation.goBack('/pages/home/index')
- },
-
- handleRetry() {
- this.loadArtistProfile()
- },
-
- handleOpenShop() {
- const profile = this.data.profile
- if (!profile || !profile.shopId) {
- return
- }
- wx.navigateTo({
- url: `/pages/shop-detail/index?id=${profile.shopId}`
- })
- },
-
- handleOpenWork(event) {
- const id = event.currentTarget.dataset.id
- if (!id) {
- return
- }
- wx.navigateTo({
- url: `/pages/product-detail/index?id=${id}`
- })
- }
-})
diff --git a/JC-ArtList-WeChat/pages/artist-profile/index.json b/JC-ArtList-WeChat/pages/artist-profile/index.json
deleted file mode 100644
index b16ef3e3..00000000
--- a/JC-ArtList-WeChat/pages/artist-profile/index.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "navigationStyle": "custom",
- "usingComponents": {}
-}
diff --git a/JC-ArtList-WeChat/pages/artist-profile/index.wxml b/JC-ArtList-WeChat/pages/artist-profile/index.wxml
deleted file mode 100644
index 8386784f..00000000
--- a/JC-ArtList-WeChat/pages/artist-profile/index.wxml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
- 加载中...
-
-
-
- 暂时无法查看个人页
- {{loadError}}
- 重试
-
-
-
-
-
-
-
-
- 艺
-
- {{artistName}}
- {{artistDesc}}
- {{shopName}}
-
-
-
-
-
-
- 评分
- {{ratingText}}
-
-
- 服务
- {{serviceCountText}}
-
-
- 工时
- {{workTimeText}}
-
-
-
-
- 擅长风格
-
- {{item}}
-
- 暂未设置风格标签
-
-
-
- 近期可预约
-
-
- {{item.dateText}}
- {{item.timeText}}
-
-
- 近期暂未放出可预约时间
-
-
-
- 作品
-
-
-
- {{item.title}}
- {{item.priceText}}
-
-
- 作品正在整理中
-
-
-
- 评价 {{reviews.length}}
-
-
-
-
- 客
-
- {{item.customerName}}
- {{item.submittedAtText}}
-
- {{item.ratingText}}
-
- {{item.content}}
-
-
- 还没有公开评价
-
-
-
diff --git a/JC-ArtList-WeChat/pages/artist-profile/index.wxss b/JC-ArtList-WeChat/pages/artist-profile/index.wxss
deleted file mode 100644
index 5c153ac2..00000000
--- a/JC-ArtList-WeChat/pages/artist-profile/index.wxss
+++ /dev/null
@@ -1,336 +0,0 @@
-.artist-page {
- min-height: 100vh;
- background: #f6f7fb;
- color: #1f2933;
-}
-
-.page-header {
- position: sticky;
- top: 0;
- z-index: 5;
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 96rpx;
- padding: 0 24rpx;
- background: rgba(255, 255, 255, 0.95);
- border-bottom: 1rpx solid #e6e9ef;
-}
-
-.back-btn,
-.header-spacer {
- width: 64rpx;
- height: 64rpx;
- line-height: 58rpx;
- text-align: center;
- font-size: 48rpx;
-}
-
-.page-title {
- flex: 1;
- overflow: hidden;
- text-align: center;
- font-size: 32rpx;
- font-weight: 700;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.content-scroll {
- height: calc(100vh - 96rpx);
-}
-
-.state-box {
- display: flex;
- min-height: 60vh;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 20rpx;
- padding: 40rpx;
- color: #65717f;
-}
-
-.state-title {
- color: #1f2933;
- font-size: 34rpx;
- font-weight: 700;
-}
-
-.state-desc {
- text-align: center;
- line-height: 1.6;
-}
-
-.primary-btn {
- padding: 18rpx 36rpx;
- color: #fff;
- background: var(--theme-primary-action);
- border-radius: 12rpx;
-}
-
-.hero {
- position: relative;
- height: 520rpx;
- margin: 20rpx;
- overflow: hidden;
- background: #222831;
- border-radius: 16rpx;
-}
-
-.hero-image,
-.hero-mask {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-
-.hero-mask {
- background: linear-gradient(180deg, rgba(10, 14, 20, 0.08), rgba(10, 14, 20, 0.72));
-}
-
-.artist-card {
- position: absolute;
- right: 28rpx;
- bottom: 28rpx;
- left: 28rpx;
- display: flex;
- gap: 22rpx;
- align-items: center;
- color: #fff;
-}
-
-.avatar {
- width: 112rpx;
- height: 112rpx;
- flex: 0 0 auto;
- overflow: hidden;
- border: 3rpx solid rgba(255, 255, 255, 0.8);
- border-radius: 56rpx;
-}
-
-.placeholder {
- display: flex;
- align-items: center;
- justify-content: center;
- background: #d8dde6;
- color: #5f6b7a;
- font-weight: 700;
-}
-
-.artist-main {
- min-width: 0;
-}
-
-.artist-name,
-.artist-desc,
-.shop-link {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.artist-name {
- font-size: 44rpx;
- font-weight: 800;
-}
-
-.artist-desc {
- margin-top: 10rpx;
- color: rgba(255, 255, 255, 0.88);
- font-size: 26rpx;
-}
-
-.shop-link {
- max-width: 440rpx;
- margin-top: 16rpx;
- padding: 12rpx 18rpx;
- background: rgba(255, 255, 255, 0.18);
- border: 1rpx solid rgba(255, 255, 255, 0.28);
- border-radius: 12rpx;
-}
-
-.metrics {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 16rpx;
- margin: 0 20rpx 20rpx;
-}
-
-.metric-item {
- display: flex;
- min-height: 132rpx;
- flex-direction: column;
- justify-content: center;
- gap: 10rpx;
- padding: 20rpx;
- background: #fff;
- border: 1rpx solid #e6e9ef;
- border-radius: 16rpx;
-}
-
-.metric-item text:first-child {
- color: #65717f;
- font-size: 24rpx;
-}
-
-.metric-value {
- overflow-wrap: anywhere;
- font-size: 34rpx;
- font-weight: 800;
-}
-
-.section {
- margin: 20rpx;
- padding: 28rpx;
- background: #fff;
- border: 1rpx solid #e6e9ef;
- border-radius: 16rpx;
-}
-
-.section-head {
- margin-bottom: 20rpx;
- font-size: 32rpx;
- font-weight: 800;
-}
-
-.tag-list {
- display: flex;
- flex-wrap: wrap;
- gap: 14rpx;
-}
-
-.tag {
- padding: 10rpx 18rpx;
- color: #394554;
- background: #eef1f5;
- border-radius: 999rpx;
-}
-
-.empty-text {
- color: #7b8794;
- line-height: 1.6;
-}
-
-.slot-grid,
-.work-grid {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 16rpx;
-}
-
-.slot {
- display: flex;
- min-height: 104rpx;
- flex-direction: column;
- justify-content: center;
- gap: 8rpx;
- padding: 18rpx;
- background: #f6f7fb;
- border: 1rpx solid #dfe4ea;
- border-radius: 14rpx;
-}
-
-.slot text:first-child {
- color: #65717f;
- font-size: 24rpx;
-}
-
-.slot-time {
- font-size: 32rpx;
- font-weight: 800;
-}
-
-.work-card {
- overflow: hidden;
- background: #fff;
- border: 1rpx solid #e6e9ef;
- border-radius: 14rpx;
-}
-
-.work-card image {
- width: 100%;
- height: 210rpx;
- background: #eef1f5;
-}
-
-.work-title,
-.work-price {
- display: block;
- overflow: hidden;
- padding: 0 16rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.work-title {
- margin-top: 14rpx;
- font-weight: 700;
-}
-
-.work-price {
- margin: 8rpx 0 16rpx;
- color: var(--theme-primary-action);
- font-weight: 800;
-}
-
-.review-list {
- display: flex;
- flex-direction: column;
- gap: 18rpx;
-}
-
-.review-card {
- padding: 22rpx;
- background: #f8fafc;
- border: 1rpx solid #e6e9ef;
- border-radius: 14rpx;
-}
-
-.review-top {
- display: flex;
- align-items: center;
- gap: 16rpx;
-}
-
-.review-avatar {
- width: 72rpx;
- height: 72rpx;
- border-radius: 36rpx;
-}
-
-.review-meta {
- flex: 1;
- min-width: 0;
-}
-
-.review-meta text {
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.review-meta text:last-child {
- margin-top: 4rpx;
- color: #7b8794;
- font-size: 22rpx;
-}
-
-.review-score {
- color: var(--theme-primary-action);
- font-weight: 800;
-}
-
-.review-content {
- display: block;
- margin-top: 18rpx;
- color: #3f4a56;
- line-height: 1.7;
- white-space: pre-wrap;
-}
diff --git a/JC-ArtList-WeChat/pages/orders/index.js b/JC-ArtList-WeChat/pages/orders/index.js
index f2a444cd..c92e8e46 100644
--- a/JC-ArtList-WeChat/pages/orders/index.js
+++ b/JC-ArtList-WeChat/pages/orders/index.js
@@ -862,23 +862,8 @@ Page({
await runWithLoading(() => paymentApi.prepareOrderPayment(orderId), {
title: '准备支付'
})
- const confirmed = await new Promise(resolve => {
- wx.showModal({
- title: '模拟支付',
- content: `本次需支付 ${order.paymentInfo.amountText},确认模拟支付成功吗?`,
- confirmText: '确认支付',
- success: res => resolve(Boolean(res.confirm)),
- fail: () => resolve(false)
- })
- })
- if (!confirmed) {
- return
- }
- await runWithLoading(() => paymentApi.mockOrderPaymentSuccess(orderId), {
- title: '确认支付'
- })
wx.showToast({
- title: '支付已确认',
+ title: '支付单已准备,请完成支付',
icon: 'none'
})
await this.loadOrders()
diff --git a/JC-ArtList-WeChat/utils/navigation.js b/JC-ArtList-WeChat/utils/navigation.js
index 46ca891c..8b823d0e 100644
--- a/JC-ArtList-WeChat/utils/navigation.js
+++ b/JC-ArtList-WeChat/utils/navigation.js
@@ -113,14 +113,6 @@ function normalizeActionPath(value) {
return `/pages/help/index${query}`
}
- if (pathOnly === '/artist-orders') {
- return `/pages/artist-orders/index${query}`
- }
-
- if (pathOnly === '/artist-calendar') {
- return `/pages/artist-calendar/index${query}`
- }
-
if (pathOnly === '/settings/account') {
return `/pages/account-settings/index${query}`
}
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/controller/admin/AdminOrderController.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/controller/admin/AdminOrderController.java
index c809518a..d3372f7d 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/controller/admin/AdminOrderController.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/controller/admin/AdminOrderController.java
@@ -3,6 +3,8 @@ package com.xiaowang.jayucloud.salon.core.modules.order.controller.admin;
import com.xiaowang.jayucloud.salon.core.annotation.RequirePermission;
import com.xiaowang.jayucloud.salon.core.annotation.OperationGuard;
import com.xiaowang.jayucloud.salon.core.common.Result;
+import com.xiaowang.jayucloud.salon.core.common.BusinessException;
+import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderOfflinePaymentDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteSubmitDTO;
import com.xiaowang.jayucloud.salon.core.modules.user.entity.UserDO;
import com.xiaowang.jayucloud.salon.core.modules.order.service.OrderService;
@@ -160,4 +162,21 @@ public class AdminOrderController {
UserDO currentUser = adminScopeHelper.getCurrentUser(request);
return Result.success(orderService.confirmShopQuote(id, currentUser.getId(), currentUser.getType()));
}
+
+ /**
+ * 店长登记线下收款。当前仅支持 payMethod=OFFLINE,实收金额必须等于订单应付金额。
+ */
+ @PostMapping("/{orderId}/offline-payment")
+ @RequirePermission("order:process")
+ @OperationGuard(action = "admin-order-offline-payment", ttlSeconds = 10, message = "收款登记处理中,请勿重复提交")
+ public Result
registerOfflinePayment(HttpServletRequest request,
+ @PathVariable Long orderId,
+ @RequestBody OrderOfflinePaymentDTO dto) {
+ UserDO currentUser = adminScopeHelper.getCurrentUser(request);
+ if (Integer.valueOf(3).equals(currentUser.getType())) {
+ throw new BusinessException(403, "美甲师账号不能登记线下收款");
+ }
+ Long scopedShopId = adminScopeHelper.resolveShopScope(currentUser, null);
+ return Result.success(orderService.registerOfflinePayment(orderId, currentUser.getId(), scopedShopId, dto));
+ }
}
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/dto/OrderOfflinePaymentDTO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/dto/OrderOfflinePaymentDTO.java
new file mode 100644
index 00000000..1f1bd70f
--- /dev/null
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/dto/OrderOfflinePaymentDTO.java
@@ -0,0 +1,18 @@
+package com.xiaowang.jayucloud.salon.core.modules.order.dto;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 线下收款登记入参。
+ * 当前仅支持 payMethod=OFFLINE,paidAmount 必须与订单应付金额一致。
+ */
+@Data
+public class OrderOfflinePaymentDTO {
+ private String payMethod;
+ private BigDecimal paidAmount;
+ private LocalDateTime paidAt;
+ private String paidRemark;
+}
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/entity/OrderDO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/entity/OrderDO.java
index 221ab3b1..7f355301 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/entity/OrderDO.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/entity/OrderDO.java
@@ -56,6 +56,9 @@ public class OrderDO extends BaseEntity {
private String paymentMethod;
private String paymentOrderNo;
private String refundStatus;
+ private Long paidBy;
+ private String paidByType;
+ private String paidRemark;
private String customerRemark;
private String cancelReason;
private String customerNameSnapshot;
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/mapper/OrderMapper.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/mapper/OrderMapper.java
index d45cc85e..3aaf1ffe 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/mapper/OrderMapper.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/mapper/OrderMapper.java
@@ -21,6 +21,9 @@ public interface OrderMapper extends BaseMapper {
@Select("SELECT * FROM t_order WHERE order_no = #{orderNo}")
OrderDO selectByOrderNo(@Param("orderNo") String orderNo);
+ @Select("SELECT * FROM t_order WHERE id = #{orderId} FOR UPDATE")
+ OrderDO selectByIdForUpdate(@Param("orderId") Long orderId);
+
@Select("SELECT DISTINCT o.* FROM t_order o " +
"INNER JOIN t_order_item oi ON o.id = oi.order_id " +
"WHERE oi.artist_id = #{artistId} AND o.is_delete = 0 " +
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/OrderService.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/OrderService.java
index f07dae11..f8c81f1a 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/OrderService.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/OrderService.java
@@ -4,6 +4,7 @@ import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistChangeRejectDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistChangeRequestDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistReviewSubmitDTO;
+import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderOfflinePaymentDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteReplyDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteSubmitDTO;
import com.xiaowang.jayucloud.salon.core.modules.artist.vo.ArtistCalendarAppointmentVO;
@@ -130,6 +131,11 @@ public interface OrderService {
OrderVO confirmShopQuote(Long orderId, Long operatorId, Integer operatorType);
+ /**
+ * 登记线下收款。operatorShopId 为当前操作人的门店作用域,为空表示平台管理员。
+ */
+ OrderVO registerOfflinePayment(Long orderId, Long operatorId, Long operatorShopId, OrderOfflinePaymentDTO dto);
+
OrderVO replyQuote(Long orderId, Long userId, OrderQuoteReplyDTO dto);
OrderVO confirmUserQuote(Long orderId, Long userId);
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImpl.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImpl.java
index 6f9e4e74..2e705d4d 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImpl.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImpl.java
@@ -9,6 +9,7 @@ import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistChangeReje
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistChangeRequestDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderArtistReviewSubmitDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderItemDTO;
+import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderOfflinePaymentDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteItemDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteReplyDTO;
import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderQuoteSubmitDTO;
@@ -133,6 +134,10 @@ public class OrderServiceImpl implements OrderService {
*/
private static final String COUPON_SOURCE_SYSTEM_VIP = "SYSTEM_VIP";
private static final int BOOKING_UNAVAILABLE_CODE = 409;
+ private static final String PAYMENT_STATUS_UNPAID = "UNPAID";
+ private static final String PAYMENT_STATUS_PAID = "PAID";
+ private static final String PAYMENT_METHOD_OFFLINE = "OFFLINE";
+ private static final String PAID_BY_TYPE_SHOP_MANAGER = "SHOP_MANAGER";
private static final String ISSUE_ORDER_ITEM = "ORDER_ITEM";
private static final String ISSUE_PRODUCT_UNAVAILABLE = "PRODUCT_UNAVAILABLE";
private static final String ISSUE_SHOP_MISMATCH = "SHOP_MISMATCH";
@@ -1454,6 +1459,9 @@ public class OrderServiceImpl implements OrderService {
&& !"HISTORICAL_BACKFILL".equals(order.getOrderSource())) {
throw new RuntimeException("普通预约不能进入服务中状态");
}
+ if (targetStatus == OrderStatus.COMPLETED) {
+ ensurePaidBeforeCompletion(order);
+ }
if (!Integer.valueOf(OrderStatus.PENDING_SERVICE.getCode()).equals(order.getStatus())
&& !(Integer.valueOf(OrderStatus.IN_SERVICE.getCode()).equals(order.getStatus())
&& (status == OrderStatus.COMPLETED.getCode() || status == OrderStatus.CANCELLED.getCode()))
@@ -1534,6 +1542,7 @@ public class OrderServiceImpl implements OrderService {
*/
throw new RuntimeException("当前订单状态不允许完成");
}
+ ensurePaidBeforeCompletion(order);
List activeItems = orderItemMapper.selectByOrderId(orderId).stream()
.filter(item -> !Integer.valueOf(1).equals(item.getIsDelete()))
@@ -1808,6 +1817,75 @@ public class OrderServiceImpl implements OrderService {
return buildOrderVO(orderMapper.selectById(order.getId()));
}
+ @Override
+ @Transactional
+ public OrderVO registerOfflinePayment(Long orderId, Long operatorId, Long operatorShopId, OrderOfflinePaymentDTO dto) {
+ if (orderId == null) {
+ throw new RuntimeException("订单ID不能为空");
+ }
+ if (dto == null) {
+ throw new RuntimeException("收款登记信息不能为空");
+ }
+ String payMethod = dto.getPayMethod() == null ? "" : dto.getPayMethod().trim().toUpperCase();
+ if (!PAYMENT_METHOD_OFFLINE.equals(payMethod)) {
+ throw new RuntimeException("当前仅支持线下收款,payMethod 只能为 OFFLINE");
+ }
+ if (dto.getPaidAmount() == null) {
+ throw new RuntimeException("实收金额不能为空");
+ }
+ if (dto.getPaidAmount().compareTo(BigDecimal.ZERO) < 0) {
+ throw new RuntimeException("实收金额不能小于0");
+ }
+ String paidRemark = trimToNull(dto.getPaidRemark());
+ if (paidRemark != null && paidRemark.length() > 500) {
+ throw new RuntimeException("收款备注不能超过500个字符");
+ }
+
+ OrderDO order = orderMapper.selectByIdForUpdate(orderId);
+ if (order == null || Integer.valueOf(1).equals(order.getIsDelete())) {
+ throw new RuntimeException("订单不存在");
+ }
+ if (operatorShopId != null && !operatorShopId.equals(order.getShopId())) {
+ throw new BusinessException(403, "无权处理其他店铺订单");
+ }
+ if (Integer.valueOf(OrderStatus.CANCELLED.getCode()).equals(order.getStatus())) {
+ throw new RuntimeException("订单已取消,不能登记收款");
+ }
+
+ BigDecimal expectedAmount = order.getPayAmount() == null ? order.getActualAmount() : order.getPayAmount();
+ if (expectedAmount == null) {
+ expectedAmount = BigDecimal.ZERO;
+ }
+ if (dto.getPaidAmount().compareTo(expectedAmount) != 0) {
+ throw new RuntimeException("实收金额必须等于订单应付金额 "
+ + expectedAmount.stripTrailingZeros().toPlainString() + " 元");
+ }
+
+ LocalDateTime paidAt = (dto.getPaidAt() == null ? LocalDateTime.now() : dto.getPaidAt()).withNano(0);
+ if (PAYMENT_STATUS_PAID.equals(order.getPaymentStatus())) {
+ boolean sameMethod = PAYMENT_METHOD_OFFLINE.equals(order.getPaymentMethod());
+ boolean sameAmount = order.getPaidAmount() != null && order.getPaidAmount().compareTo(dto.getPaidAmount()) == 0;
+ boolean sameTime = order.getPayTime() != null && order.getPayTime().withNano(0).equals(paidAt);
+ if (sameMethod && sameAmount && sameTime) {
+ return buildOrderVO(order);
+ }
+ throw new RuntimeException("该订单已登记线下收款,金额或收款时间与首次登记不一致,不能重复登记");
+ }
+ if (order.getPaymentStatus() != null && !PAYMENT_STATUS_UNPAID.equals(order.getPaymentStatus())) {
+ throw new RuntimeException("订单当前支付状态为 " + order.getPaymentStatus() + ",不能登记线下收款");
+ }
+
+ order.setPaymentStatus(PAYMENT_STATUS_PAID);
+ order.setPaymentMethod(PAYMENT_METHOD_OFFLINE);
+ order.setPaidAmount(dto.getPaidAmount());
+ order.setPayTime(paidAt);
+ order.setPaidBy(operatorId);
+ order.setPaidByType(PAID_BY_TYPE_SHOP_MANAGER);
+ order.setPaidRemark(paidRemark);
+ orderMapper.updateById(order);
+ return buildOrderVO(order);
+ }
+
@Override
@Transactional
public OrderVO replyQuote(Long orderId, Long userId, OrderQuoteReplyDTO dto) {
@@ -2258,9 +2336,18 @@ public class OrderServiceImpl implements OrderService {
}
/**
- * Purpose: trimToNull supports OrderServiceImpl.java by holding or executing the trim to null business role.
+ * 完成订单前强制校验收款状态:未收款不得完成,不设任何豁免。
* Usage: reference this method from the owning layer and pass validated inputs before reading or updating related state.
*/
+ /**
+ * 完成订单前强制校验收款状态:未收款不得完成,不设任何豁免。
+ */
+ private void ensurePaidBeforeCompletion(OrderDO order) {
+ if (!PAYMENT_STATUS_PAID.equals(order.getPaymentStatus())) {
+ throw new RuntimeException("订单未收款,不能完成;请先登记线下收款");
+ }
+ }
+
private String trimToNull(String value) {
if (!StringUtils.hasText(value)) {
return null;
@@ -3284,6 +3371,13 @@ public class OrderServiceImpl implements OrderService {
orderVO.setPaymentMethod(order.getPaymentMethod());
orderVO.setPaymentOrderNo(order.getPaymentOrderNo());
orderVO.setRefundStatus(order.getRefundStatus());
+ orderVO.setPaidBy(order.getPaidBy());
+ orderVO.setPaidByType(order.getPaidByType());
+ orderVO.setPaidRemark(order.getPaidRemark());
+ if (order.getPaidBy() != null) {
+ UserDO payer = getUserFromCache(order.getPaidBy(), userCache);
+ orderVO.setPaidByName(payer == null ? null : payer.getNickname());
+ }
orderVO.setCustomerRemark(order.getCustomerRemark());
orderVO.setQuoteStatus(order.getQuoteStatus());
orderVO.setQuoteStatusText(resolveQuoteStatusText(order.getQuoteStatus(), order.getStatus()));
diff --git a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/vo/OrderVO.java b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/vo/OrderVO.java
index e25bed5f..dffd286b 100644
--- a/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/vo/OrderVO.java
+++ b/JC-Salon-Core/src/main/java/com/xiaowang/jayucloud/salon/core/modules/order/vo/OrderVO.java
@@ -64,6 +64,10 @@ public class OrderVO {
private String paymentMethod;
private String paymentOrderNo;
private String refundStatus;
+ private Long paidBy;
+ private String paidByName;
+ private String paidByType;
+ private String paidRemark;
private String customerRemark;
private String quoteStatus;
private String orderSource;
diff --git a/JC-Salon-Core/src/main/resources/db/migration/V16__订单线下收款登记_20261104.sql b/JC-Salon-Core/src/main/resources/db/migration/V16__订单线下收款登记_20261104.sql
new file mode 100644
index 00000000..c968c9e2
--- /dev/null
+++ b/JC-Salon-Core/src/main/resources/db/migration/V16__订单线下收款登记_20261104.sql
@@ -0,0 +1,41 @@
+-- 订单线下收款登记:记录收款人、收款人类型与收款备注
+-- 说明:pay_time、payment_method、paid_amount、payment_status 已存在,本次不重复新增。
+
+SET @column_exists = (
+ SELECT COUNT(1) FROM information_schema.columns
+ WHERE table_schema = DATABASE() AND table_name = 't_order' AND column_name = 'paid_by'
+);
+SET @migration_sql = IF(
+ @column_exists = 0,
+ 'ALTER TABLE t_order ADD COLUMN paid_by BIGINT UNSIGNED NULL COMMENT ''收款登记人用户ID'' AFTER refund_status',
+ 'SELECT 1'
+);
+PREPARE migration_statement FROM @migration_sql;
+EXECUTE migration_statement;
+DEALLOCATE PREPARE migration_statement;
+
+SET @column_exists = (
+ SELECT COUNT(1) FROM information_schema.columns
+ WHERE table_schema = DATABASE() AND table_name = 't_order' AND column_name = 'paid_by_type'
+);
+SET @migration_sql = IF(
+ @column_exists = 0,
+ 'ALTER TABLE t_order ADD COLUMN paid_by_type VARCHAR(20) NULL COMMENT ''收款登记人类型,线下收款固定为 SHOP_MANAGER'' AFTER paid_by',
+ 'SELECT 1'
+);
+PREPARE migration_statement FROM @migration_sql;
+EXECUTE migration_statement;
+DEALLOCATE PREPARE migration_statement;
+
+SET @column_exists = (
+ SELECT COUNT(1) FROM information_schema.columns
+ WHERE table_schema = DATABASE() AND table_name = 't_order' AND column_name = 'paid_remark'
+);
+SET @migration_sql = IF(
+ @column_exists = 0,
+ 'ALTER TABLE t_order ADD COLUMN paid_remark VARCHAR(500) NULL COMMENT ''收款登记备注'' AFTER paid_by_type',
+ 'SELECT 1'
+);
+PREPARE migration_statement FROM @migration_sql;
+EXECUTE migration_statement;
+DEALLOCATE PREPARE migration_statement;
diff --git a/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImplOfflinePaymentTest.java b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImplOfflinePaymentTest.java
new file mode 100644
index 00000000..d23ee5ba
--- /dev/null
+++ b/JC-Salon-Core/src/test/java/com/xiaowang/jayucloud/salon/core/modules/order/service/impl/OrderServiceImplOfflinePaymentTest.java
@@ -0,0 +1,111 @@
+package com.xiaowang.jayucloud.salon.core.modules.order.service.impl;
+
+import com.xiaowang.jayucloud.salon.core.modules.order.dto.OrderOfflinePaymentDTO;
+import com.xiaowang.jayucloud.salon.core.modules.order.entity.OrderDO;
+import com.xiaowang.jayucloud.salon.core.modules.order.mapper.OrderMapper;
+import com.xiaowang.jayucloud.salon.core.modules.order.support.OrderStatus;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.mockito.Mockito.when;
+
+@ExtendWith(MockitoExtension.class)
+class OrderServiceImplOfflinePaymentTest {
+
+ @Mock
+ private OrderMapper orderMapper;
+
+ @InjectMocks
+ private OrderServiceImpl service;
+
+ @Test
+ void rejectsNonOfflinePaymentMethod() {
+ OrderOfflinePaymentDTO dto = offlinePayment(new BigDecimal("100"), LocalDateTime.now());
+ dto.setPayMethod("WECHAT");
+
+ RuntimeException error = assertThrows(RuntimeException.class,
+ () -> service.registerOfflinePayment(1L, 9L, 2L, dto));
+
+ assertEquals("当前仅支持线下收款,payMethod 只能为 OFFLINE", error.getMessage());
+ }
+
+ @Test
+ void rejectsAmountMismatch() {
+ OrderDO order = order(1L, OrderStatus.PENDING_SERVICE.getCode(), "UNPAID");
+ order.setPayAmount(new BigDecimal("100.00"));
+ when(orderMapper.selectByIdForUpdate(1L)).thenReturn(order);
+ OrderOfflinePaymentDTO dto = offlinePayment(new BigDecimal("90"), LocalDateTime.now());
+
+ RuntimeException error = assertThrows(RuntimeException.class,
+ () -> service.registerOfflinePayment(1L, 9L, 2L, dto));
+
+ assertEquals("实收金额必须等于订单应付金额 100 元", error.getMessage());
+ }
+
+ @Test
+ void rejectsCancelledOrder() {
+ OrderDO order = order(1L, OrderStatus.CANCELLED.getCode(), "UNPAID");
+ order.setPayAmount(new BigDecimal("100"));
+ when(orderMapper.selectByIdForUpdate(1L)).thenReturn(order);
+ OrderOfflinePaymentDTO dto = offlinePayment(new BigDecimal("100"), LocalDateTime.now());
+
+ RuntimeException error = assertThrows(RuntimeException.class,
+ () -> service.registerOfflinePayment(1L, 9L, 2L, dto));
+
+ assertEquals("订单已取消,不能登记收款", error.getMessage());
+ }
+
+ @Test
+ void rejectsRepeatedRegistrationWithDifferentTime() {
+ OrderDO order = order(1L, OrderStatus.PENDING_SERVICE.getCode(), "PAID");
+ order.setPayAmount(new BigDecimal("100"));
+ order.setPaymentMethod("OFFLINE");
+ order.setPaidAmount(new BigDecimal("100"));
+ order.setPayTime(LocalDateTime.of(2026, 11, 4, 10, 0, 0));
+ when(orderMapper.selectByIdForUpdate(1L)).thenReturn(order);
+ OrderOfflinePaymentDTO dto = offlinePayment(new BigDecimal("100"), LocalDateTime.of(2026, 11, 4, 11, 0, 0));
+
+ RuntimeException error = assertThrows(RuntimeException.class,
+ () -> service.registerOfflinePayment(1L, 9L, 2L, dto));
+
+ assertEquals("该订单已登记线下收款,金额或收款时间与首次登记不一致,不能重复登记", error.getMessage());
+ }
+
+ @Test
+ void rejectsCompletingUnpaidOrder() {
+ OrderDO order = order(1L, OrderStatus.PENDING_SERVICE.getCode(), "UNPAID");
+ order.setOrderSource("NORMAL");
+ when(orderMapper.selectById(1L)).thenReturn(order);
+
+ RuntimeException error = assertThrows(RuntimeException.class,
+ () -> service.processOrder(1L, OrderStatus.COMPLETED.getCode()));
+
+ assertEquals("订单未收款,不能完成;请先登记线下收款", error.getMessage());
+ }
+
+ private OrderOfflinePaymentDTO offlinePayment(BigDecimal amount, LocalDateTime paidAt) {
+ OrderOfflinePaymentDTO dto = new OrderOfflinePaymentDTO();
+ dto.setPayMethod("OFFLINE");
+ dto.setPaidAmount(amount);
+ dto.setPaidAt(paidAt);
+ return dto;
+ }
+
+ private OrderDO order(Long id, Integer status, String paymentStatus) {
+ OrderDO order = new OrderDO();
+ order.setId(id);
+ order.setShopId(2L);
+ order.setStatus(status);
+ order.setPaymentStatus(paymentStatus);
+ order.setIsDelete(0);
+ return order;
+ }
+}
diff --git a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
index d0661038..caf41043 100644
--- a/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
+++ b/JC-Salon-Frontend/src/views/admin/SystemSettingsView.vue
@@ -1,236 +1,330 @@
-
-
-
-