ArtList 底座与安全:接入 Flyway 基线、下线 mock 支付、Redis 会话隔离并清理死代码
This commit is contained in:
@@ -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' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<navigation-bar title="预约日历" showBack="{{true}}" fallbackPath="/pages/artist-orders/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
<view class="page-hero">
|
||||
<text class="hero-kicker">未来 7 天</text>
|
||||
<text class="hero-title">{{appointments.length}} 个预约</text>
|
||||
<text class="hero-desc">按时间查看即将服务的客户与项目</text>
|
||||
<view class="hero-action-row">
|
||||
<view class="hero-action secondary" bindtap="openArtistOrders">订单列表</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="page-card empty-card">
|
||||
<text class="empty-title">正在加载日历</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{appointments.length}}">
|
||||
<view wx:for="{{appointments}}" wx:key="orderItemId" class="page-card appointment-card">
|
||||
<view class="day-box">
|
||||
<text>{{item.dayText}}</text>
|
||||
<text>{{item.timeText}}</text>
|
||||
</view>
|
||||
<view class="appointment-main">
|
||||
<text class="appointment-title">{{item.customerNickname || '客户'}} · {{item.productTitle}}</text>
|
||||
<text class="appointment-line">{{item.orderStatusText}} · {{item.shopName || '门店'}}</text>
|
||||
<text class="appointment-line">{{item.amountText}}</text>
|
||||
<view wx:if="{{item.orderStatus == 1}}" class="ghost-btn" data-order-id="{{item.orderId}}" bindtap="completeOrder">完成服务</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<text class="empty-title">未来 7 天暂无预约</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<navigation-bar title="美甲师订单" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
<view class="page-hero">
|
||||
<text class="hero-kicker">服务订单</text>
|
||||
<text class="hero-title">{{orders.length}} 笔相关订单</text>
|
||||
<text class="hero-desc">查看客户预约、项目和服务完成状态</text>
|
||||
<view class="hero-action-row">
|
||||
<view class="hero-action secondary" bindtap="openCalendar">预约日历</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="page-card empty-card">
|
||||
<text class="empty-title">正在加载订单</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{orders.length}}">
|
||||
<view wx:for="{{orders}}" wx:key="id" class="page-card order-card {{item.id == focusOrderId ? 'focus-target' : ''}}">
|
||||
<view class="order-head">
|
||||
<view>
|
||||
<text class="order-no">{{item.orderNo}}</text>
|
||||
<text class="order-line">{{item.customerNickname || '客户'}} {{item.customerPhoneMasked || ''}}</text>
|
||||
</view>
|
||||
<text class="chip">{{item.statusText}}</text>
|
||||
</view>
|
||||
<view wx:for="{{item.items}}" wx:key="id" wx:for-item="orderItem" class="item-row">
|
||||
<image class="item-thumb" src="{{orderItem.productImageUrl}}" mode="aspectFill"></image>
|
||||
<view class="item-main">
|
||||
<text class="item-title">{{orderItem.productTitle}}</text>
|
||||
<text class="item-line">{{orderItem.priceText}} x {{orderItem.quantity}}</text>
|
||||
<text wx:if="{{orderItem.appointmentText}}" class="item-line">预约:{{orderItem.appointmentText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-foot">
|
||||
<text class="order-amount">{{item.amountText}}</text>
|
||||
<view wx:if="{{item.status == 1}}" class="ghost-btn" data-order-id="{{item.id}}" bindtap="completeOrder">完成服务</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<text class="empty-title">暂无相关订单</text>
|
||||
<text class="empty-desc">有客户预约你服务的项目后会出现在这里</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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}`
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
<view class="artist-page">
|
||||
<view class="page-header">
|
||||
<view class="back-btn" bindtap="handleBack">‹</view>
|
||||
<text class="page-title">{{artistName}}</text>
|
||||
<view class="header-spacer"></view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="state-box">
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{loadError}}" class="state-box">
|
||||
<text class="state-title">暂时无法查看个人页</text>
|
||||
<text class="state-desc">{{loadError}}</text>
|
||||
<view class="primary-btn" bindtap="handleRetry">重试</view>
|
||||
</view>
|
||||
|
||||
<scroll-view wx:else scroll-y class="content-scroll">
|
||||
<view class="hero">
|
||||
<image class="hero-image" src="{{heroImage}}" mode="aspectFill"></image>
|
||||
<view class="hero-mask"></view>
|
||||
<view class="artist-card">
|
||||
<image wx:if="{{profile.avatar}}" class="avatar" src="{{profile.avatar}}" mode="aspectFill"></image>
|
||||
<view wx:else class="avatar placeholder">艺</view>
|
||||
<view class="artist-main">
|
||||
<text class="artist-name">{{artistName}}</text>
|
||||
<text class="artist-desc">{{artistDesc}}</text>
|
||||
<view class="shop-link" bindtap="handleOpenShop">{{shopName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="metrics">
|
||||
<view class="metric-item">
|
||||
<text>评分</text>
|
||||
<text class="metric-value">{{ratingText}}</text>
|
||||
</view>
|
||||
<view class="metric-item">
|
||||
<text>服务</text>
|
||||
<text class="metric-value">{{serviceCountText}}</text>
|
||||
</view>
|
||||
<view class="metric-item">
|
||||
<text>工时</text>
|
||||
<text class="metric-value">{{workTimeText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-head">擅长风格</view>
|
||||
<view class="tag-list" wx:if="{{styleTags.length}}">
|
||||
<text class="tag" wx:for="{{styleTags}}" wx:key="*this">{{item}}</text>
|
||||
</view>
|
||||
<text wx:else class="empty-text">暂未设置风格标签</text>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-head">近期可预约</view>
|
||||
<view class="slot-grid" wx:if="{{availability.length}}">
|
||||
<view class="slot" wx:for="{{availability}}" wx:key="startTime">
|
||||
<text>{{item.dateText}}</text>
|
||||
<text class="slot-time">{{item.timeText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text wx:else class="empty-text">近期暂未放出可预约时间</text>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-head">作品</view>
|
||||
<view class="work-grid" wx:if="{{works.length}}">
|
||||
<view class="work-card" wx:for="{{works}}" wx:key="id" data-id="{{item.id}}" bindtap="handleOpenWork">
|
||||
<image src="{{item.coverImageUrl}}" mode="aspectFill"></image>
|
||||
<text class="work-title">{{item.title}}</text>
|
||||
<text class="work-price">{{item.priceText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text wx:else class="empty-text">作品正在整理中</text>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-head">评价 {{reviews.length}}</view>
|
||||
<view class="review-list" wx:if="{{reviews.length}}">
|
||||
<view class="review-card" wx:for="{{reviews}}" wx:key="id">
|
||||
<view class="review-top">
|
||||
<image wx:if="{{item.customerAvatar}}" class="review-avatar" src="{{item.customerAvatar}}" mode="aspectFill"></image>
|
||||
<view wx:else class="review-avatar placeholder">客</view>
|
||||
<view class="review-meta">
|
||||
<text>{{item.customerName}}</text>
|
||||
<text>{{item.submittedAtText}}</text>
|
||||
</view>
|
||||
<text class="review-score">{{item.ratingText}}</text>
|
||||
</view>
|
||||
<text class="review-content">{{item.content}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text wx:else class="empty-text">还没有公开评价</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user