杂务:更新 YumiNail 工作区
This commit is contained in:
@@ -35,6 +35,12 @@ module.exports = {
|
||||
})
|
||||
},
|
||||
|
||||
getOrderDetail(orderId) {
|
||||
return request({
|
||||
url: `/order/detail/${orderId}`
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Purpose: listMyPendingReviews supports order.js by holding or executing the list my pending reviews page or API role.
|
||||
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -145,5 +151,36 @@ module.exports = {
|
||||
url: `/order/cancel/${orderId}`,
|
||||
method: 'PUT'
|
||||
})
|
||||
},
|
||||
|
||||
getArtistOrders() {
|
||||
return request({
|
||||
url: '/order/artist/list'
|
||||
})
|
||||
},
|
||||
|
||||
completeArtistOrder(orderId) {
|
||||
return request({
|
||||
url: `/order/artist/complete/${orderId}`,
|
||||
method: 'PUT'
|
||||
})
|
||||
},
|
||||
|
||||
getArtistCalendarRecent(days) {
|
||||
return request({
|
||||
url: '/order/artist/calendar/recent',
|
||||
params: {
|
||||
days: days || 7
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getArtistCalendarDay(date) {
|
||||
return request({
|
||||
url: '/order/artist/calendar/day',
|
||||
params: {
|
||||
date
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,13 @@ module.exports = {
|
||||
getOrderArtistContact(orderId, artistId) {
|
||||
return request({
|
||||
url: `/contact-info/order/${orderId}/artist`,
|
||||
data: artistId ? { artistId } : {}
|
||||
params: artistId ? { artistId } : {}
|
||||
})
|
||||
},
|
||||
|
||||
getPlatformContact() {
|
||||
return request({
|
||||
url: '/contact-info/platform'
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
+13
-4
@@ -10,6 +10,15 @@
|
||||
"pages/artist-profile/index",
|
||||
"pages/shop-detail/index",
|
||||
"pages/orders/index",
|
||||
"pages/order-detail/index",
|
||||
"pages/after-sales/index",
|
||||
"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",
|
||||
"pages/coupons/index",
|
||||
"pages/vip-center/index",
|
||||
@@ -20,12 +29,12 @@
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundTextStyle": "light",
|
||||
"backgroundColor": "#fff7f9"
|
||||
"backgroundColor": "#fff8f4"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#8f7b83",
|
||||
"selectedColor": "#c6597d",
|
||||
"backgroundColor": "#fff7f9",
|
||||
"color": "#504444",
|
||||
"selectedColor": "#7c5357",
|
||||
"backgroundColor": "#fff8f4",
|
||||
"borderStyle": "black",
|
||||
"position": "bottom",
|
||||
"list": [
|
||||
|
||||
+76
-24
@@ -1,16 +1,22 @@
|
||||
page {
|
||||
--theme-primary: #c6597d;
|
||||
--theme-secondary: #e9b7c7;
|
||||
--theme-accent: #9f4967;
|
||||
--theme-page-bg: #fff7f9;
|
||||
--theme-primary: #E8B4B8;
|
||||
--theme-secondary: #C5A059;
|
||||
--theme-accent: #4A443F;
|
||||
--theme-neutral: #4A443F;
|
||||
--theme-tertiary: #FDFBF9;
|
||||
--theme-primary-action: #766361;
|
||||
--theme-page-bg: #FDFBF9;
|
||||
--theme-card-bg: #ffffff;
|
||||
--theme-border: #efd8e0;
|
||||
--theme-primary-soft: #fbf1f4;
|
||||
--theme-gradient: linear-gradient(135deg, #c6597d 0%, #e9b7c7 100%);
|
||||
--theme-gradient-soft: linear-gradient(145deg, #ffffff 0%, #fff1f5 58%, #ffe8ef 100%);
|
||||
--theme-border: #F9EAEC;
|
||||
--theme-primary-soft: #FAEFF0;
|
||||
--theme-secondary-soft: #EADCC2;
|
||||
--theme-gradient: linear-gradient(135deg, #766361 0%, #C5A059 100%);
|
||||
--theme-gradient-soft: linear-gradient(145deg, #ffffff 0%, #EADCC2 58%, #F5E0E0 100%);
|
||||
--text-primary: #4A443F;
|
||||
--text-secondary: #6B6662;
|
||||
min-height: 100vh;
|
||||
background: var(--theme-page-bg);
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
@@ -49,6 +55,17 @@ button::after {
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.yumi-page {
|
||||
min-height: 100vh;
|
||||
padding: 28rpx 28rpx calc(env(safe-area-inset-bottom) + 96rpx);
|
||||
color: var(--text-primary);
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.yumi-page--no-nav {
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 36rpx);
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 24rpx 24rpx 44rpx;
|
||||
}
|
||||
@@ -68,6 +85,41 @@ button::after {
|
||||
box-shadow: 0 22rpx 56rpx rgba(122, 67, 88, 0.08);
|
||||
}
|
||||
|
||||
.yumi-glass-card {
|
||||
overflow: hidden;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.92);
|
||||
border-radius: 36rpx;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
box-shadow: 0 24rpx 58rpx rgba(74, 68, 63, 0.1);
|
||||
}
|
||||
|
||||
.yumi-status-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 44rpx;
|
||||
padding: 0 22rpx;
|
||||
border: 1rpx solid var(--theme-border);
|
||||
border-radius: 999rpx;
|
||||
color: var(--theme-primary-action);
|
||||
background: var(--theme-primary-soft);
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.yumi-bottom-action {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
margin: 32rpx -28rpx -28rpx;
|
||||
padding: 22rpx 28rpx calc(env(safe-area-inset-bottom) + 22rpx);
|
||||
border-top: 1rpx solid var(--theme-border);
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.page-hero {
|
||||
overflow: hidden;
|
||||
padding: 34rpx 30rpx;
|
||||
@@ -91,7 +143,7 @@ button::after {
|
||||
font-size: 46rpx;
|
||||
line-height: 1.24;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.hero-desc {
|
||||
@@ -99,7 +151,7 @@ button::after {
|
||||
margin-top: 16rpx;
|
||||
font-size: 25rpx;
|
||||
line-height: 1.8;
|
||||
color: #7d6872;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.hero-action-row {
|
||||
@@ -128,7 +180,7 @@ button::after {
|
||||
|
||||
.hero-action.secondary {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
color: #7a5262;
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.section-block {
|
||||
@@ -160,7 +212,7 @@ button::after {
|
||||
display: block;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.section-subtitle {
|
||||
@@ -168,7 +220,7 @@ button::after {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.section-link {
|
||||
@@ -194,7 +246,7 @@ button::after {
|
||||
.summary-label {
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #99858e;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.summary-value {
|
||||
@@ -203,7 +255,7 @@ button::after {
|
||||
font-size: 30rpx;
|
||||
line-height: 1.35;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.summary-note {
|
||||
@@ -211,7 +263,7 @@ button::after {
|
||||
margin-top: 8rpx;
|
||||
font-size: 21rpx;
|
||||
line-height: 1.6;
|
||||
color: #a6929b;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
@@ -236,7 +288,7 @@ button::after {
|
||||
border-radius: 999rpx;
|
||||
border: 2rpx solid var(--theme-border);
|
||||
background: var(--theme-card-bg);
|
||||
color: #7a5262;
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -259,7 +311,7 @@ button::after {
|
||||
display: block;
|
||||
margin-bottom: 14rpx;
|
||||
font-size: 26rpx;
|
||||
color: #5d4b55;
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -274,7 +326,7 @@ button::after {
|
||||
border-radius: 24rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
border: 1rpx solid var(--theme-border);
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
@@ -284,7 +336,7 @@ button::after {
|
||||
}
|
||||
|
||||
.field-placeholder {
|
||||
color: #b9a8af;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.status-text {
|
||||
@@ -323,13 +375,13 @@ button::after {
|
||||
.empty-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.empty-desc {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.8;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.chip,
|
||||
@@ -350,7 +402,7 @@ button::after {
|
||||
|
||||
.soft-chip {
|
||||
background: var(--theme-primary-soft);
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.divider-line {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.weui-navigation-bar {
|
||||
--weui-FG-0: rgba(0, 0, 0, 0.92);
|
||||
--weui-FG-0: var(--theme-neutral);
|
||||
--height: 44px;
|
||||
--left: 20rpx;
|
||||
color: var(--weui-FG-0);
|
||||
@@ -27,6 +27,9 @@
|
||||
padding-top: env(safe-area-inset-top);
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
color: var(--theme-neutral);
|
||||
border-bottom: 1rpx solid var(--theme-border);
|
||||
backdrop-filter: blur(20rpx);
|
||||
}
|
||||
|
||||
.weui-navigation-bar__left,
|
||||
@@ -64,7 +67,8 @@
|
||||
border-radius: 999rpx;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.94);
|
||||
box-shadow: 0 10rpx 28rpx rgba(45, 36, 48, 0.08);
|
||||
color: var(--theme-neutral);
|
||||
box-shadow: 0 10rpx 28rpx rgba(74, 68, 63, 0.08);
|
||||
}
|
||||
|
||||
.weui-navigation-bar__action--active {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 28rpx;
|
||||
background: var(--theme-card-bg);
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
border: 1rpx solid var(--theme-border);
|
||||
box-shadow: 0 18rpx 42rpx rgba(122, 67, 88, 0.08);
|
||||
box-shadow: 0 18rpx 42rpx rgba(74, 68, 63, 0.08);
|
||||
}
|
||||
|
||||
.product-cover-wrap {
|
||||
@@ -36,7 +36,7 @@
|
||||
padding: 8rpx 14rpx;
|
||||
border-radius: 999rpx;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #7a5262;
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 19rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -54,7 +54,7 @@
|
||||
font-size: 27rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.38;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
.product-meta {
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
margin-top: 6rpx;
|
||||
font-size: 20rpx;
|
||||
line-height: 1.4;
|
||||
color: #9d8a92;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.product-quick-add {
|
||||
@@ -133,7 +133,7 @@
|
||||
height: 64rpx;
|
||||
border-radius: 22rpx;
|
||||
background: var(--theme-gradient);
|
||||
box-shadow: 0 14rpx 30rpx rgba(198, 89, 125, 0.22);
|
||||
box-shadow: 0 14rpx 30rpx rgba(232, 180, 184, 0.26);
|
||||
}
|
||||
|
||||
.product-quick-add-icon {
|
||||
@@ -218,7 +218,7 @@
|
||||
|
||||
.product-shop {
|
||||
margin-top: 6rpx;
|
||||
color: #8f6e7a;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
line-height: 1.45;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
const userApi = require('../../api/user')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
const { runWithLoading } = require('../../utils/loading')
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
loading: false,
|
||||
saving: false,
|
||||
isLoggedIn: false,
|
||||
userInfo: null,
|
||||
form: {
|
||||
nickname: '',
|
||||
signature: ''
|
||||
}
|
||||
}),
|
||||
|
||||
onShow() {
|
||||
this.loadProfile()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/settings/index')
|
||||
},
|
||||
|
||||
async loadProfile() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const userInfo = await userApi.getUserInfo()
|
||||
this.setData({
|
||||
userInfo,
|
||||
'form.nickname': userInfo.nickname || '',
|
||||
'form.signature': userInfo.signature || ''
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '资料加载失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
handleInput(event) {
|
||||
const field = event.currentTarget.dataset.field
|
||||
this.setData({
|
||||
[`form.${field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
async saveProfile() {
|
||||
const nickname = String(this.data.form.nickname || '').trim()
|
||||
if (!nickname) {
|
||||
wx.showToast({ title: '请输入昵称', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ saving: true })
|
||||
try {
|
||||
await runWithLoading(() => userApi.updateUserInfo({
|
||||
nickname,
|
||||
signature: String(this.data.form.signature || '').trim()
|
||||
}))
|
||||
wx.showToast({ title: '资料已更新', icon: 'none' })
|
||||
await this.loadProfile()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '资料更新失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ saving: false })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<navigation-bar title="账号资料" showBack="{{true}}" fallbackPath="/pages/settings/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">Account</text>
|
||||
<text class="hero-title">账号资料</text>
|
||||
<text class="hero-desc">维护昵称、个性签名和基础资料�?/text>
|
||||
</view>
|
||||
|
||||
<view class="page-card form-card">
|
||||
<view class="field-block">
|
||||
<text class="field-label">昵称</text>
|
||||
<input class="field-input" value="{{form.nickname}}" data-field="nickname" bindinput="handleInput" placeholder="请输入昵�? placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">个��签�?/text>
|
||||
<textarea class="field-textarea" maxlength="120" value="{{form.signature}}" data-field="signature" bindinput="handleInput" placeholder="写一句介绍自�? placeholder-class="field-placeholder"></textarea>
|
||||
</view>
|
||||
<button class="primary-btn" loading="{{saving}}" bindtap="saveProfile">保存资料</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,12 @@
|
||||
.form-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.field-block + .field-block {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
const orderApi = require('../../api/order')
|
||||
const afterSaleApi = require('../../api/after-sale')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
const { formatPrice } = require('../../utils/format')
|
||||
const { runWithLoading } = require('../../utils/loading')
|
||||
|
||||
function safeList(value) {
|
||||
return Array.isArray(value) ? value : []
|
||||
}
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
orderId: '',
|
||||
loading: false,
|
||||
submitting: false,
|
||||
isLoggedIn: false,
|
||||
order: null,
|
||||
items: [],
|
||||
typeOptions: ['退款', '售后服务'],
|
||||
form: {
|
||||
orderItemId: '',
|
||||
type: 'REFUND',
|
||||
typeIndex: 0,
|
||||
reason: '',
|
||||
refundAmount: ''
|
||||
}
|
||||
}),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
orderId: (options && options.orderId) || '',
|
||||
'form.orderItemId': (options && options.orderItemId) || ''
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadOrder()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/orders/index')
|
||||
},
|
||||
|
||||
async loadOrder() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
if (!this.data.orderId) return
|
||||
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const order = await orderApi.getOrderDetail(this.data.orderId)
|
||||
const items = safeList(order && order.items)
|
||||
const selectedItem = items.find(item => String(item.id) === String(this.data.form.orderItemId)) || items[0]
|
||||
this.setData({
|
||||
order,
|
||||
items,
|
||||
'form.orderItemId': selectedItem ? selectedItem.id : '',
|
||||
'form.refundAmount': String(order && (order.actualAmount || order.totalAmount || '')),
|
||||
amountText: `¥${formatPrice(order && (order.actualAmount || order.totalAmount))}`
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title: error.message || '订单信息加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
handleItemChange(event) {
|
||||
const index = Number(event.detail.value)
|
||||
const item = this.data.items[index]
|
||||
this.setData({
|
||||
'form.orderItemId': item ? item.id : ''
|
||||
})
|
||||
},
|
||||
|
||||
handleTypeChange(event) {
|
||||
const index = Number(event.detail.value)
|
||||
this.setData({
|
||||
'form.typeIndex': index,
|
||||
'form.type': index === 0 ? 'REFUND' : 'AFTER_SALE'
|
||||
})
|
||||
},
|
||||
|
||||
handleInput(event) {
|
||||
const field = event.currentTarget.dataset.field
|
||||
this.setData({
|
||||
[`form.${field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
async submit() {
|
||||
if (!this.data.orderId) {
|
||||
wx.showToast({ title: '缺少订单信息', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const reason = String(this.data.form.reason || '').trim()
|
||||
if (!reason) {
|
||||
wx.showToast({ title: '请填写售后原因', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ submitting: true })
|
||||
try {
|
||||
await runWithLoading(() => afterSaleApi.applyAfterSale({
|
||||
orderId: this.data.orderId,
|
||||
orderItemId: this.data.form.orderItemId || undefined,
|
||||
type: this.data.form.type,
|
||||
reason,
|
||||
refundAmount: this.data.form.refundAmount ? Number(this.data.form.refundAmount) : undefined
|
||||
}), { title: '提交售后' })
|
||||
wx.showToast({ title: '售后申请已提交', icon: 'none' })
|
||||
wx.redirectTo({
|
||||
url: `/pages/after-sales/index?orderId=${encodeURIComponent(this.data.orderId)}`
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title: error.message || '售后申请提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.setData({ submitting: false })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<navigation-bar title="申请售后" showBack="{{true}}" fallbackPath="/pages/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">售后申请</text>
|
||||
<text class="hero-title">{{order && order.orderNo || '选择订单'}}</text>
|
||||
<text class="hero-desc">{{order ? '可申请金�?' + amountText : '从订单详情进入可自动带入订单信息'}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!orderId}}" class="page-card empty-card">
|
||||
<text class="empty-title">缺少订单信息</text>
|
||||
<text class="empty-desc">请从订单详情或订单中心发起售后��?/text>
|
||||
<view class="ghost-btn" bindtap="handleBack">返回订单</view>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card form-card">
|
||||
<view class="field-block">
|
||||
<text class="field-label">订单项目</text>
|
||||
<picker mode="selector" range="{{items}}" range-key="productTitle" bindchange="handleItemChange">
|
||||
<view class="field-picker">{{form.orderItemId ? '已��择项目' : '默认整单'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">售后类型</text>
|
||||
<picker mode="selector" range="{{typeOptions}}" value="{{form.typeIndex}}" bindchange="handleTypeChange">
|
||||
<view class="field-picker">{{typeOptions[form.typeIndex]}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">逢�款金�?/text>
|
||||
<input class="field-input" type="digit" value="{{form.refundAmount}}" data-field="refundAmount" bindinput="handleInput" placeholder="可��? placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">原因说明</text>
|
||||
<textarea class="field-textarea" maxlength="300" value="{{form.reason}}" data-field="reason" bindinput="handleInput" placeholder="请说明���款或售后原因" placeholder-class="field-placeholder"></textarea>
|
||||
</view>
|
||||
<button class="primary-btn" loading="{{submitting}}" bindtap="submit">提交申请</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,12 @@
|
||||
.form-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.field-block + .field-block {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
const afterSaleApi = require('../../api/after-sale')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
const { formatDateTime, formatPrice } = require('../../utils/format')
|
||||
|
||||
function safeList(value) {
|
||||
if (Array.isArray(value)) return value
|
||||
if (value && Array.isArray(value.list)) return value.list
|
||||
if (value && Array.isArray(value.records)) return value.records
|
||||
return []
|
||||
}
|
||||
|
||||
function statusText(status) {
|
||||
const value = String(status || '').toUpperCase()
|
||||
if (value === 'PENDING') return '审核中'
|
||||
if (value === 'APPROVED') return '已通过'
|
||||
if (value === 'REJECTED') return '已拒绝'
|
||||
return status || '处理中'
|
||||
}
|
||||
|
||||
function typeText(type) {
|
||||
return type === 'REFUND' ? '退款' : (type || '售后')
|
||||
}
|
||||
|
||||
function formatRecord(item) {
|
||||
return {
|
||||
...item,
|
||||
typeText: typeText(item.type),
|
||||
statusText: statusText(item.status),
|
||||
amountText: item.refundAmount === undefined || item.refundAmount === null ? '--' : `¥${formatPrice(item.refundAmount)}`,
|
||||
createdText: formatDateTime(item.createTime)
|
||||
}
|
||||
}
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
orderId: '',
|
||||
loading: false,
|
||||
isLoggedIn: false,
|
||||
records: []
|
||||
}),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
orderId: (options && options.orderId) || ''
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadRecords()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/profile/index')
|
||||
},
|
||||
|
||||
async loadRecords() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const payload = await afterSaleApi.getMyAfterSales({ page: 1, size: 50 })
|
||||
let records = safeList(payload)
|
||||
if (this.data.orderId) {
|
||||
records = records.filter(item => String(item.orderId) === String(this.data.orderId))
|
||||
}
|
||||
this.setData({
|
||||
records: records.map(formatRecord)
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title: error.message || '售后记录加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
openOrder(event) {
|
||||
navigation.navigate('/pages/order-detail/index', {
|
||||
id: event.currentTarget.dataset.orderId
|
||||
})
|
||||
},
|
||||
|
||||
openProgress(event) {
|
||||
navigation.navigate('/pages/service-progress/index', {
|
||||
orderId: event.currentTarget.dataset.orderId
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<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">{{records.length}} 条记�?/text>
|
||||
<text class="hero-desc">{{orderId ? '当前订单的售后进�? : '逢�款��售后和审核记录集中查看'}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="page-card empty-card">
|
||||
<text class="empty-title">正在加载售后记录</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{records.length}}">
|
||||
<view wx:for="{{records}}" wx:key="id" class="page-card record-card">
|
||||
<view class="record-head">
|
||||
<view>
|
||||
<text class="record-label">{{item.typeText}}</text>
|
||||
<text class="record-title">{{item.afterSaleNo || item.id}}</text>
|
||||
</view>
|
||||
<text class="chip">{{item.statusText}}</text>
|
||||
</view>
|
||||
<view class="record-grid">
|
||||
<view>
|
||||
<text class="summary-label">订单</text>
|
||||
<text class="summary-value">{{item.orderId}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="summary-label">金额</text>
|
||||
<text class="summary-value">{{item.amountText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<text wx:if="{{item.reason}}" class="record-line">原因:{{item.reason}}</text>
|
||||
<text wx:if="{{item.auditReason}}" class="record-line">处理说明:{{item.auditReason}}</text>
|
||||
<text class="record-line">提交时间:{{item.createdText}}</text>
|
||||
<view class="record-actions">
|
||||
<view class="ghost-btn" data-order-id="{{item.orderId}}" bindtap="openOrder">订单详情</view>
|
||||
<view class="ghost-btn" data-order-id="{{item.orderId}}" bindtap="openProgress">服务进度</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>
|
||||
@@ -0,0 +1,57 @@
|
||||
.record-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 26rpx;
|
||||
}
|
||||
|
||||
.record-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.record-label,
|
||||
.record-title,
|
||||
.record-line {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.record-label {
|
||||
color: var(--theme-primary);
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.record-title {
|
||||
margin-top: 8rpx;
|
||||
color: var(--text-primary);
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.record-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14rpx;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
|
||||
.record-grid view {
|
||||
padding: 18rpx;
|
||||
border-radius: 22rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.record-line {
|
||||
margin-top: 14rpx;
|
||||
color: #504444;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.record-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<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>
|
||||
@@ -0,0 +1,49 @@
|
||||
.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;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<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>
|
||||
@@ -0,0 +1,70 @@
|
||||
.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,4 +1,4 @@
|
||||
.artist-page {
|
||||
.artist-page {
|
||||
min-height: 100vh;
|
||||
background: #f6f7fb;
|
||||
color: #1f2933;
|
||||
@@ -65,7 +65,7 @@
|
||||
.primary-btn {
|
||||
padding: 18rpx 36rpx;
|
||||
color: #fff;
|
||||
background: #c6597d;
|
||||
background: var(--theme-primary-action);
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
|
||||
.work-price {
|
||||
margin: 8rpx 0 16rpx;
|
||||
color: #c6597d;
|
||||
color: var(--theme-primary-action);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
}
|
||||
|
||||
.review-score {
|
||||
color: #c6597d;
|
||||
color: var(--theme-primary-action);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="auth-page-root" style="{{themeVars}}">
|
||||
<navigation-bar title="账号中心" showBack="{{true}}" fallbackPath="/pages/home/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="账号中心" showBack="{{true}}" fallbackPath="/pages/home/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<scroll-view class="auth-scroll" scroll-y="true" enhanced="true" show-scrollbar="false">
|
||||
<view class="page-shell auth-page-shell auth-page">
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
flex: 1;
|
||||
height: 76rpx;
|
||||
border-radius: 999rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -89,7 +89,7 @@
|
||||
border-radius: 28rpx;
|
||||
background: var(--theme-gradient-soft);
|
||||
border: 1rpx solid var(--theme-border);
|
||||
box-shadow: 0 18rpx 38rpx rgba(122, 67, 88, 0.1);
|
||||
box-shadow: 0 18rpx 38rpx rgba(74, 68, 63, 0.1);
|
||||
}
|
||||
|
||||
.wechat-login-copy {
|
||||
@@ -102,14 +102,14 @@
|
||||
display: block;
|
||||
font-size: 29rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.wechat-login-desc {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.wechat-login-btn {
|
||||
@@ -118,13 +118,13 @@
|
||||
|
||||
.wechat-login-btn.primary-btn {
|
||||
background: var(--theme-gradient);
|
||||
box-shadow: 0 16rpx 36rpx rgba(122, 67, 88, 0.16);
|
||||
box-shadow: 0 16rpx 36rpx rgba(74, 68, 63, 0.16);
|
||||
}
|
||||
|
||||
.wechat-login-btn-disabled {
|
||||
color: var(--theme-accent);
|
||||
border-color: var(--theme-border);
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
background: var(--theme-card-bg);
|
||||
}
|
||||
|
||||
.wechat-login-hint {
|
||||
@@ -157,8 +157,8 @@
|
||||
}
|
||||
|
||||
.traditional-entry-btn {
|
||||
color: #7a5262;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: var(--theme-primary-action);
|
||||
background: var(--theme-card-bg);
|
||||
}
|
||||
|
||||
.traditional-login-panel {
|
||||
@@ -175,14 +175,14 @@
|
||||
.login-divider-text {
|
||||
flex-shrink: 0;
|
||||
font-size: 22rpx;
|
||||
color: #99858e;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.auth-helper {
|
||||
margin-bottom: 4rpx;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.6;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.field-block {
|
||||
@@ -214,8 +214,8 @@
|
||||
}
|
||||
|
||||
.code-btn.disabled {
|
||||
background: #f3e7eb;
|
||||
color: #a998a0;
|
||||
background: var(--theme-secondary-soft);
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.aux-row {
|
||||
@@ -247,7 +247,7 @@
|
||||
align-items: flex-start;
|
||||
gap: 14rpx;
|
||||
margin-top: 22rpx;
|
||||
color: #7a6871;
|
||||
color: var(--text-secondary);
|
||||
font-size: 23rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -259,9 +259,9 @@
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
margin-top: 2rpx;
|
||||
border: 2rpx solid #d9b8c4;
|
||||
border: 2rpx solid var(--theme-border);
|
||||
border-radius: 10rpx;
|
||||
color: #ffffff;
|
||||
color: var(--theme-card-bg);
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
flex-shrink: 0;
|
||||
@@ -300,7 +300,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 28rpx;
|
||||
background: rgba(45, 36, 48, 0.42);
|
||||
background: rgba(74, 68, 63, 0.42);
|
||||
}
|
||||
|
||||
.agreement-modal {
|
||||
@@ -309,20 +309,20 @@
|
||||
max-height: 82vh;
|
||||
padding: 30rpx 28rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
}
|
||||
|
||||
.agreement-modal-title {
|
||||
font-size: 32rpx;
|
||||
line-height: 1.35;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.agreement-modal-meta {
|
||||
margin-top: 10rpx;
|
||||
font-size: 22rpx;
|
||||
color: #9a8590;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.agreement-modal-body {
|
||||
@@ -332,7 +332,7 @@
|
||||
padding: 20rpx;
|
||||
border-radius: 22rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #5a4a52;
|
||||
color: var(--text-primary);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.85;
|
||||
box-sizing: border-box;
|
||||
@@ -350,7 +350,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24rpx;
|
||||
background: rgba(45, 36, 48, 0.34);
|
||||
background: rgba(74, 68, 63, 0.34);
|
||||
}
|
||||
|
||||
.mini-shop-modal {
|
||||
@@ -358,7 +358,7 @@
|
||||
max-width: 680rpx;
|
||||
padding: 30rpx 28rpx;
|
||||
border-radius: 36rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
}
|
||||
|
||||
.mini-shop-kicker {
|
||||
@@ -375,7 +375,7 @@
|
||||
font-size: 34rpx;
|
||||
line-height: 1.35;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.mini-shop-desc {
|
||||
@@ -383,7 +383,7 @@
|
||||
margin-top: 14rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.75;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.mini-shop-field {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="购物车" showBack="{{false}}" isTabPage="{{true}}" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="购物车" showBack="{{false}}" isTabPage="{{true}}" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell cart-page" style="{{themeVars}}">
|
||||
<view class="page-content cart-content">
|
||||
@@ -111,14 +111,14 @@
|
||||
|
||||
<radio-group bindchange="handleCouponChange">
|
||||
<label class="coupon-option">
|
||||
<radio value="NONE" checked="{{selectedCouponKey === 'NONE'}}" color="{{navThemeColor || '#C6597D'}}"></radio>
|
||||
<radio value="NONE" checked="{{selectedCouponKey === 'NONE'}}" color="{{navThemeColor || '#E8B4B8'}}"></radio>
|
||||
<view class="coupon-texts">
|
||||
<view class="coupon-name">不使用优惠</view>
|
||||
</view>
|
||||
</label>
|
||||
|
||||
<label wx:for="{{availableCoupons}}" wx:key="key" wx:for-item="coupon" class="coupon-option {{selectedCouponKey === coupon.key ? 'active' : ''}}">
|
||||
<radio value="{{coupon.key}}" checked="{{selectedCouponKey === coupon.key}}" color="{{navThemeColor || '#C6597D'}}"></radio>
|
||||
<radio value="{{coupon.key}}" checked="{{selectedCouponKey === coupon.key}}" color="{{navThemeColor || '#E8B4B8'}}"></radio>
|
||||
<view class="coupon-texts">
|
||||
<view class="coupon-name">{{coupon.displayText}}</view>
|
||||
<view class="coupon-desc">{{coupon.savingText || (coupon.sourceType === 'SYSTEM_VIP' ? 'VIP 自动折扣' : '用户优惠券')}}</view>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
padding: 22rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.issue-title {
|
||||
@@ -43,13 +43,13 @@
|
||||
.recovery-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.recovery-desc {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.recovery-actions {
|
||||
@@ -66,9 +66,9 @@
|
||||
height: 60rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-neutral);
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -76,7 +76,7 @@
|
||||
.recovery-btn.primary {
|
||||
background: var(--theme-primary);
|
||||
border-color: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-tertiary);
|
||||
}
|
||||
|
||||
.cart-item-card + .cart-item-card,
|
||||
@@ -100,7 +100,7 @@
|
||||
height: 34rpx;
|
||||
margin-top: 8rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #d8c4cc;
|
||||
border: 4rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
.select-dot.active {
|
||||
@@ -132,13 +132,13 @@
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.5;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.cart-price {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.cart-meta-row {
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
.cart-meta {
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.selector-group {
|
||||
@@ -186,17 +186,17 @@
|
||||
}
|
||||
|
||||
.selector-row.issue {
|
||||
background: var(--theme-primary-soft);
|
||||
background: var(--theme-secondary-soft);
|
||||
}
|
||||
|
||||
.selector-label {
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.selector-value {
|
||||
font-size: 24rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
.appointment-preview {
|
||||
margin-top: 14rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.cart-item-foot {
|
||||
@@ -237,7 +237,7 @@
|
||||
height: 56rpx;
|
||||
border-radius: 50%;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
@@ -246,12 +246,12 @@
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.remove-btn {
|
||||
font-size: 24rpx;
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-primary-action);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
gap: 18rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx solid #f6eaee;
|
||||
border-top: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
.coupon-option:first-child {
|
||||
@@ -285,13 +285,13 @@
|
||||
.coupon-name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.coupon-desc {
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.coupon-tag {
|
||||
@@ -311,13 +311,13 @@
|
||||
.unavailable-coupon-list {
|
||||
margin-top: 22rpx;
|
||||
padding-top: 18rpx;
|
||||
border-top: 2rpx solid #f6eaee;
|
||||
border-top: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
.unavailable-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.unavailable-coupon {
|
||||
@@ -327,13 +327,13 @@
|
||||
gap: 18rpx;
|
||||
margin-top: 14rpx;
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.unavailable-coupon text:first-child {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: #5d4b55;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.unavailable-coupon text:last-child {
|
||||
@@ -347,7 +347,7 @@
|
||||
padding: 16rpx 18rpx;
|
||||
border-radius: 18rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-neutral);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -363,16 +363,16 @@
|
||||
justify-content: space-between;
|
||||
padding: 10rpx 0;
|
||||
font-size: 26rpx;
|
||||
color: #5d4b55;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.summary-row.total {
|
||||
margin-top: 10rpx;
|
||||
padding-top: 18rpx;
|
||||
border-top: 2rpx solid #f3e7eb;
|
||||
border-top: 2rpx solid var(--theme-border);
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.checkout-bar {
|
||||
@@ -398,13 +398,13 @@
|
||||
.checkout-total {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.checkout-meta {
|
||||
margin-top: 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.checkout-btn {
|
||||
@@ -416,7 +416,7 @@
|
||||
padding: 0 26rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--theme-gradient);
|
||||
color: #ffffff;
|
||||
color: var(--theme-tertiary);
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="我的优惠券" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="我的优惠券" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell coupons-page" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.coupons-hero {
|
||||
.coupons-hero {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
border-radius: 999rpx;
|
||||
background: var(--theme-card-bg);
|
||||
border: 1rpx solid var(--theme-border);
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -49,13 +49,13 @@
|
||||
.coupon-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.coupon-source {
|
||||
margin-top: 10rpx;
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.coupon-status {
|
||||
@@ -82,5 +82,5 @@
|
||||
.coupon-period {
|
||||
margin-top: 18rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
const userApi = require('../../api/user')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
loading: false,
|
||||
contact: null
|
||||
}),
|
||||
|
||||
onShow() {
|
||||
this.loadContact()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/profile/index')
|
||||
},
|
||||
|
||||
async loadContact() {
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const contact = await userApi.getPlatformContact()
|
||||
this.setData({ contact })
|
||||
} catch (error) {
|
||||
this.setData({ contact: null })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
openRoute(event) {
|
||||
const route = event.currentTarget.dataset.route
|
||||
const pureRoute = String(route || '').split('?')[0]
|
||||
if (navigation.isTabPage(pureRoute)) {
|
||||
navigation.switchTab(pureRoute)
|
||||
return
|
||||
}
|
||||
navigation.navigate(route)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<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">YumiNail Support</text>
|
||||
<text class="hero-title">帮助与客�?/text>
|
||||
<text class="hero-desc">订单、预约��售后和账号问题都可以从这里继续处理�?/text>
|
||||
</view>
|
||||
|
||||
<view class="page-card contact-card">
|
||||
<text class="section-title">平台联系信息</text>
|
||||
<block wx:if="{{contact}}">
|
||||
<text wx:if="{{contact.contactName}}" class="contact-line">{{contact.contactName}} {{contact.roleLabel || ''}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable && contact.phone}}" class="contact-line">电话:{{contact.phone}}</text>
|
||||
<text wx:if="{{contact.wechatAvailable && contact.wechatId}}" class="contact-line">微信:{{contact.wechatId}}</text>
|
||||
<text wx:if="{{contact.platformContactText}}" class="contact-line">{{contact.platformContactText}}</text>
|
||||
</block>
|
||||
<text wx:else class="contact-line">暂无可展示的客服信息,请稍后重试或从订单详情联系服务人员�?/text>
|
||||
</view>
|
||||
|
||||
<view class="quick-grid">
|
||||
<view class="page-card quick-card" data-route="/pages/orders/index" bindtap="openRoute">
|
||||
<text class="quick-title">订单中心</text>
|
||||
<text class="quick-desc">查看预约、支付��评�?/text>
|
||||
</view>
|
||||
<view class="page-card quick-card" data-route="/pages/after-sales/index" bindtap="openRoute">
|
||||
<text class="quick-title">售后记录</text>
|
||||
<text class="quick-desc">查看逢�款和处理进度</text>
|
||||
</view>
|
||||
<view class="page-card quick-card" data-route="/pages/notifications/index" bindtap="openRoute">
|
||||
<text class="quick-title">消息中心</text>
|
||||
<text class="quick-desc">查看系统通知</text>
|
||||
</view>
|
||||
<view class="page-card quick-card" data-route="/pages/settings/index" bindtap="openRoute">
|
||||
<text class="quick-title">账号设置</text>
|
||||
<text class="quick-desc">修改资料、手机号和密�?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,42 @@
|
||||
.contact-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 26rpx;
|
||||
}
|
||||
|
||||
.contact-line,
|
||||
.quick-title,
|
||||
.quick-desc {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.contact-line {
|
||||
margin-top: 12rpx;
|
||||
color: #504444;
|
||||
font-size: 25rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.quick-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 18rpx;
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
|
||||
.quick-card {
|
||||
min-height: 180rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.quick-title {
|
||||
color: var(--text-primary);
|
||||
font-size: 29rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.quick-desc {
|
||||
margin-top: 12rpx;
|
||||
color: #504444;
|
||||
font-size: 23rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="home-page-root" style="{{themeVars}}">
|
||||
<navigation-bar title="{{navTitle}}" showBack="{{false}}" isTabPage="{{true}}" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<view class="home-page-root yumi-page" style="{{themeVars}}">
|
||||
<navigation-bar title="{{navTitle}}" showBack="{{false}}" isTabPage="{{true}}" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="home-scroll">
|
||||
<view class="page-shell home-page {{keyboardVisible ? 'keyboard-active' : ''}}">
|
||||
@@ -70,7 +70,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{bannerImages.length}}" class="banner-box page-card">
|
||||
<view wx:if="{{bannerImages.length}}" class="banner-box page-card yumi-glass-card">
|
||||
<swiper class="banner-swiper" indicator-dots autoplay circular interval="3200">
|
||||
<swiper-item wx:for="{{bannerImages}}" wx:key="id">
|
||||
<view class="banner-item" data-shop-id="{{item.shopId}}" bindtap="handleBannerTap">
|
||||
@@ -85,7 +85,7 @@
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<view wx:else class="page-card yumi-glass-card empty-card">
|
||||
<text class="empty-title">门店内容正在补充中</text>
|
||||
<text class="empty-desc">先看看作品。</text>
|
||||
</view>
|
||||
@@ -111,7 +111,7 @@
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<view wx:else class="page-card yumi-glass-card empty-card">
|
||||
<text class="empty-title">精选作品正在整理中</text>
|
||||
<text class="empty-desc">稍后再来看看。</text>
|
||||
</view>
|
||||
@@ -136,11 +136,11 @@
|
||||
<text class="section-load-text">{{loadingMore ? '正在加载更多热门作品...' : '已经到底了'}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{loading}}" class="page-card empty-card">
|
||||
<view wx:elif="{{loading}}" class="page-card yumi-glass-card empty-card">
|
||||
<text class="empty-title">正在加载首页内容</text>
|
||||
</view>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<view wx:else class="page-card yumi-glass-card empty-card">
|
||||
<text class="empty-title">还没有热门作品</text>
|
||||
<text class="empty-desc">稍后再来看看。</text>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
.home-page-root {
|
||||
min-height: 100vh;
|
||||
padding: 0;
|
||||
color: var(--text-primary);
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.home-scroll {
|
||||
@@ -17,6 +20,34 @@
|
||||
|
||||
.home-hero {
|
||||
background: var(--theme-gradient-soft);
|
||||
box-shadow: 0 28rpx 64rpx rgba(74, 68, 63, 0.1);
|
||||
}
|
||||
|
||||
.home-hero .hero-kicker,
|
||||
.section-kicker {
|
||||
color: var(--theme-secondary);
|
||||
}
|
||||
|
||||
.home-hero .hero-title,
|
||||
.section-title,
|
||||
.summary-value,
|
||||
.empty-title {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.home-hero .hero-desc,
|
||||
.section-subtitle,
|
||||
.summary-label,
|
||||
.summary-note,
|
||||
.empty-desc,
|
||||
.field-placeholder {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.home-hero .hero-action.secondary {
|
||||
border: 1rpx solid var(--theme-border);
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.search-box {
|
||||
@@ -25,8 +56,10 @@
|
||||
gap: 16rpx;
|
||||
margin-top: 30rpx;
|
||||
padding: 10rpx;
|
||||
border: 1rpx solid var(--theme-border);
|
||||
border-radius: 999rpx;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
box-shadow: 0 18rpx 42rpx rgba(74, 68, 63, 0.08);
|
||||
}
|
||||
|
||||
.search-input {
|
||||
@@ -34,7 +67,7 @@
|
||||
height: 72rpx;
|
||||
padding: 0 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
@@ -54,8 +87,9 @@
|
||||
margin-top: 24rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border-radius: 22rpx;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
color: #8d7a84;
|
||||
background: rgba(255, 255, 255, 0.86);
|
||||
border: 1rpx solid var(--theme-border);
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
}
|
||||
@@ -87,7 +121,9 @@
|
||||
bottom: 24rpx;
|
||||
padding: 22rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.92);
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
box-shadow: 0 18rpx 42rpx rgba(74, 68, 63, 0.1);
|
||||
}
|
||||
|
||||
.announcement-strip {
|
||||
@@ -104,7 +140,7 @@
|
||||
line-height: 58rpx;
|
||||
padding: 0 22rpx;
|
||||
font-size: 24rpx;
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-neutral);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
@@ -126,13 +162,13 @@
|
||||
margin-top: 14rpx;
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.banner-desc {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.featured-panel {
|
||||
@@ -173,7 +209,7 @@
|
||||
|
||||
.section-load-text {
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.keyboard-light-spacer {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="{{navTitle}}" showBack="{{false}}" color="#2d2430" background="#fff7f8"></navigation-bar>
|
||||
<navigation-bar title="{{navTitle}}" showBack="{{false}}" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
<view class="redirect-page">
|
||||
<view class="redirect-card">
|
||||
<view class="redirect-title">正在进入首页</view>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
page {
|
||||
page {
|
||||
min-height: 100vh;
|
||||
background: #fff7f8;
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
.redirect-page {
|
||||
@@ -22,12 +22,12 @@ page {
|
||||
.redirect-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.redirect-desc {
|
||||
margin-top: 18rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="消息通知" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="#fff7f8"></navigation-bar>
|
||||
<navigation-bar title="消息通知" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="notifications-page">
|
||||
<view class="summary-card">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.notifications-page {
|
||||
.notifications-page {
|
||||
min-height: 100vh;
|
||||
padding: 176rpx 28rpx 40rpx;
|
||||
background: #fff7f8;
|
||||
background: var(--theme-page-bg);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
.summary-title {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 38rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
|
||||
.message-title {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -118,7 +118,7 @@
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 34rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
@@ -148,5 +148,5 @@
|
||||
max-height: 760rpx;
|
||||
margin-top: 24rpx;
|
||||
border-radius: 18rpx;
|
||||
background: #fff7f8;
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
const orderApi = require('../../api/order')
|
||||
const afterSaleApi = require('../../api/after-sale')
|
||||
const userApi = require('../../api/user')
|
||||
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 : []
|
||||
}
|
||||
|
||||
function sameId(left, right) {
|
||||
return left !== undefined && left !== null && right !== undefined && right !== null && String(left) === String(right)
|
||||
}
|
||||
|
||||
function formatMoney(value) {
|
||||
return `¥${formatPrice(value)}`
|
||||
}
|
||||
|
||||
function buildTimeline(order, reviews, changes, afterSales) {
|
||||
const items = safeList(order && order.items)
|
||||
const firstAppointment = items.map(item => item && item.appointmentTime).find(Boolean)
|
||||
const status = Number(order && order.status)
|
||||
return [
|
||||
{ key: 'created', title: '已创建', text: formatDateTime(order && order.createTime) || '已提交', done: true, active: false },
|
||||
{ key: 'appointment', title: '预约时间', text: formatDateTime(firstAppointment) || '待确认', done: Boolean(firstAppointment), active: status === 1 },
|
||||
{ key: 'service', title: status === 3 ? '已取消' : '服务完成', text: formatDateTime(order && (order.completeTime || order.cancelTime || order.updateTime)) || '等待服务', done: status === 2 || status === 3, active: status === 2 || status === 3 },
|
||||
{ key: 'change', title: '改派记录', text: changes.length ? `${changes.length} 条记录` : '暂无改派', done: changes.length > 0, active: changes.some(item => String(item.status || '').toUpperCase() === 'PENDING') },
|
||||
{ key: 'after-sale', title: '售后/评价', text: afterSales.length ? `${afterSales.length} 条售后` : (reviews.length ? `${reviews.length} 条评价` : '暂无记录'), done: afterSales.length > 0 || reviews.length > 0, active: afterSales.some(item => String(item.status || '').toUpperCase() === 'PENDING') }
|
||||
]
|
||||
}
|
||||
|
||||
async function formatOrder(order, reviews, changes, afterSales) {
|
||||
const items = await Promise.all(safeList(order && order.items).map(async item => ({
|
||||
...item,
|
||||
productImageUrl: await resolveLegacyImage(item.productImage),
|
||||
priceText: formatMoney(item.price),
|
||||
appointmentText: formatDateTime(item.appointmentTime)
|
||||
})))
|
||||
return {
|
||||
...order,
|
||||
items,
|
||||
statusText: getOrderStatusText(order),
|
||||
statusClass: getOrderStatusClass(order),
|
||||
amountText: formatMoney(order && (order.actualAmount || order.totalAmount)),
|
||||
canApplyAfterSale: Number(order && order.status) === 2 || String(order && order.paymentStatus || '').toUpperCase() === 'PAID',
|
||||
timeline: buildTimeline(order, reviews, changes, afterSales)
|
||||
}
|
||||
}
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
id: '',
|
||||
loading: false,
|
||||
order: null,
|
||||
reviews: [],
|
||||
changes: [],
|
||||
afterSales: [],
|
||||
contact: null,
|
||||
isLoggedIn: false
|
||||
}),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
id: (options && (options.id || options.orderId)) || ''
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadOrder()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/orders/index')
|
||||
},
|
||||
|
||||
async loadOrder() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
if (!this.data.id) {
|
||||
return
|
||||
}
|
||||
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const [order, reviews, changes, afterSalePage, contact] = await Promise.all([
|
||||
orderApi.getOrderDetail(this.data.id),
|
||||
orderApi.listOrderReviews(this.data.id).catch(() => []),
|
||||
orderApi.listOrderArtistChangeRequests(this.data.id).catch(() => []),
|
||||
afterSaleApi.getMyAfterSales({ page: 1, size: 50 }).catch(() => ({ list: [] })),
|
||||
userApi.getOrderArtistContact(this.data.id).catch(() => null)
|
||||
])
|
||||
const afterSales = safeList(afterSalePage && afterSalePage.list).filter(item => sameId(item.orderId, this.data.id))
|
||||
this.setData({
|
||||
order: await formatOrder(order, reviews || [], changes || [], afterSales),
|
||||
reviews: reviews || [],
|
||||
changes: changes || [],
|
||||
afterSales,
|
||||
contact
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title: error.message || '订单详情加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
openProgress() {
|
||||
navigation.navigate('/pages/service-progress/index', { orderId: this.data.id })
|
||||
},
|
||||
|
||||
openAfterSaleApply(event) {
|
||||
const orderItemId = event.currentTarget.dataset.itemId || ''
|
||||
navigation.navigate('/pages/after-sale-apply/index', {
|
||||
orderId: this.data.id,
|
||||
orderItemId
|
||||
})
|
||||
},
|
||||
|
||||
openAfterSales() {
|
||||
navigation.navigate('/pages/after-sales/index', { orderId: this.data.id })
|
||||
},
|
||||
|
||||
async handleCancelOrder() {
|
||||
const confirmed = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '取消订单',
|
||||
content: '确认取消这笔订单吗?',
|
||||
success: res => resolve(Boolean(res.confirm))
|
||||
})
|
||||
})
|
||||
if (!confirmed) return
|
||||
try {
|
||||
await runWithLoading(() => orderApi.cancelOrder(this.data.id))
|
||||
wx.showToast({ title: '订单已取消', icon: 'none' })
|
||||
await this.loadOrder()
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '取消订单失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<navigation-bar title="订单详情" showBack="{{true}}" fallbackPath="/pages/orders/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell detail-page" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
<view wx:if="{{!isLoggedIn}}" class="page-card empty-card">
|
||||
<text class="empty-title">登录后查看订�?/text>
|
||||
<text class="empty-desc">订单详情霢�要先登录�?/text>
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{loading}}" class="page-card empty-card">
|
||||
<text class="empty-title">正在加载订单</text>
|
||||
</view>
|
||||
|
||||
<block wx:elif="{{order}}">
|
||||
<view class="page-hero">
|
||||
<text class="hero-kicker">预约订单</text>
|
||||
<text class="hero-title">{{order.orderNo}}</text>
|
||||
<text class="hero-desc">{{order.shopName || '当前门店'}} · {{order.statusText}}</text>
|
||||
<view class="summary-strip">
|
||||
<view class="summary-metric">
|
||||
<text class="summary-label">订单金额</text>
|
||||
<text class="summary-value">{{order.amountText}}</text>
|
||||
</view>
|
||||
<view class="summary-metric">
|
||||
<text class="summary-label">项目�?/text>
|
||||
<text class="summary-value">{{order.items.length}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-card timeline-card">
|
||||
<view wx:for="{{order.timeline}}" wx:key="key" class="timeline-node {{item.done ? 'done' : ''}} {{item.active ? 'active' : ''}}">
|
||||
<text class="timeline-title">{{item.title}}</text>
|
||||
<text class="timeline-text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-card detail-card">
|
||||
<view wx:for="{{order.items}}" wx:key="id" class="item-row">
|
||||
<image class="item-thumb" src="{{item.productImageUrl}}" mode="aspectFill"></image>
|
||||
<view class="item-main">
|
||||
<text class="item-title">{{item.productTitle}}</text>
|
||||
<text class="item-line">{{item.priceText}} x {{item.quantity}}</text>
|
||||
<text wx:if="{{item.artistName}}" class="item-line">美甲师:{{item.artistName}}</text>
|
||||
<text wx:if="{{item.appointmentText}}" class="item-line">预约:{{item.appointmentText}}</text>
|
||||
<view wx:if="{{order.canApplyAfterSale}}" class="soft-chip" data-item-id="{{item.id}}" bindtap="openAfterSaleApply">申请售后</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{contact}}" class="page-card contact-card">
|
||||
<text class="section-title">联系信息</text>
|
||||
<text class="contact-line">{{contact.contactName || contact.roleLabel || '服务联系�?}}</text>
|
||||
<text wx:if="{{contact.phoneAvailable && contact.phone}}" class="contact-line">电话:{{contact.phone}}</text>
|
||||
<text wx:if="{{contact.wechatAvailable && contact.wechatId}}" class="contact-line">微信:{{contact.wechatId}}</text>
|
||||
<text wx:if="{{contact.platformContactText}}" class="contact-line">{{contact.platformContactText}}</text>
|
||||
</view>
|
||||
|
||||
<view class="action-row">
|
||||
<view class="secondary-btn" bindtap="openProgress">服务进度</view>
|
||||
<view class="secondary-btn" bindtap="openAfterSales">售后记录</view>
|
||||
<view wx:if="{{order.status == 1}}" class="secondary-btn danger" bindtap="handleCancelOrder">取消订单</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<text class="empty-title">未找到订�?/text>
|
||||
<text class="empty-desc">请从订单中心重新进入�?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,103 @@
|
||||
.timeline-card,
|
||||
.detail-card,
|
||||
.contact-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.timeline-card {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.timeline-node {
|
||||
min-width: 0;
|
||||
padding: 12rpx 8rpx;
|
||||
border-radius: 14rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #504444;
|
||||
}
|
||||
|
||||
.timeline-node.done,
|
||||
.timeline-node.active {
|
||||
color: var(--theme-primary);
|
||||
}
|
||||
|
||||
.timeline-title,
|
||||
.timeline-text,
|
||||
.contact-line {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.timeline-title,
|
||||
.timeline-text {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.timeline-title {
|
||||
font-size: 21rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.timeline-text {
|
||||
margin-top: 6rpx;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.item-row {
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
.item-row:first-child {
|
||||
padding-top: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.item-thumb {
|
||||
width: 132rpx;
|
||||
height: 132rpx;
|
||||
border-radius: 24rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.item-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
display: block;
|
||||
color: var(--text-primary);
|
||||
font-size: 29rpx;
|
||||
font-weight: 800;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.item-line,
|
||||
.contact-line {
|
||||
display: block;
|
||||
margin-top: 10rpx;
|
||||
color: #504444;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.soft-chip {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.action-row {
|
||||
display: grid;
|
||||
gap: 16rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.secondary-btn.danger {
|
||||
color: var(--theme-accent);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="我的订单" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="我的订单" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell orders-page" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
.recovery-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.recovery-desc {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.recovery-actions {
|
||||
@@ -36,9 +36,9 @@
|
||||
height: 60rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -46,7 +46,7 @@
|
||||
.recovery-btn.primary {
|
||||
background: var(--theme-primary);
|
||||
border-color: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.order-card + .order-card {
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
.order-card.focus-target {
|
||||
border-color: var(--theme-primary);
|
||||
box-shadow: 0 18rpx 48rpx rgba(224, 105, 92, 0.18);
|
||||
box-shadow: 0 18rpx 48rpx rgba(197, 160, 89, 0.18);
|
||||
}
|
||||
|
||||
.order-head,
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
.order-shop {
|
||||
margin: 14rpx 0 0;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@@ -103,13 +103,13 @@
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 6rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 26rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.payment-amount text:last-child {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -118,7 +118,7 @@
|
||||
margin-top: 16rpx;
|
||||
padding: 18rpx 20rpx;
|
||||
border-radius: 18rpx;
|
||||
background: rgba(255, 247, 249, 0.82);
|
||||
background: var(--theme-secondary-soft);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
padding: 12rpx 10rpx;
|
||||
border-radius: 12rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.timeline-node.done {
|
||||
@@ -158,7 +158,7 @@
|
||||
.timeline-title {
|
||||
font-size: 21rpx;
|
||||
font-weight: 800;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.timeline-text,
|
||||
@@ -175,7 +175,7 @@
|
||||
.order-label {
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.order-no {
|
||||
@@ -183,7 +183,7 @@
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
color: #5d4b55;
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.order-status {
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
.order-status.pending {
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-tertiary);
|
||||
}
|
||||
|
||||
.order-status.completed {
|
||||
@@ -210,7 +210,7 @@
|
||||
|
||||
.order-status.cancelled {
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-tertiary);
|
||||
}
|
||||
|
||||
.order-item {
|
||||
@@ -222,7 +222,7 @@
|
||||
.order-item.focus-target {
|
||||
padding: 12rpx;
|
||||
border-radius: 18rpx;
|
||||
background: rgba(255, 247, 249, 0.9);
|
||||
background: var(--theme-primary-soft);
|
||||
outline: 2rpx solid var(--theme-primary);
|
||||
}
|
||||
|
||||
@@ -241,14 +241,14 @@
|
||||
.order-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.order-line {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
.order-amount {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.pay-btn,
|
||||
@@ -287,23 +287,23 @@
|
||||
|
||||
.pay-btn {
|
||||
background: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.after-sale-btn {
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.rebook-btn {
|
||||
background: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-tertiary);
|
||||
}
|
||||
|
||||
.review-summary,
|
||||
@@ -312,7 +312,7 @@
|
||||
margin-top: 18rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 18rpx;
|
||||
background: rgba(255, 247, 249, 0.82);
|
||||
background: var(--theme-secondary-soft);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
|
||||
.assist-label {
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -339,14 +339,14 @@
|
||||
margin-top: 8rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.assist-desc {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -378,9 +378,9 @@
|
||||
width: 72rpx;
|
||||
height: 52rpx;
|
||||
border-radius: 999rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -388,7 +388,7 @@
|
||||
.score-chip.active {
|
||||
background: var(--theme-primary);
|
||||
border-color: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.review-textarea {
|
||||
@@ -398,15 +398,15 @@
|
||||
margin-top: 16rpx;
|
||||
padding: 16rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.textarea-placeholder {
|
||||
color: #b49da9;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.review-submit-btn,
|
||||
@@ -424,7 +424,7 @@
|
||||
.review-submit-btn {
|
||||
margin-top: 16rpx;
|
||||
background: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
.change-actions {
|
||||
@@ -435,13 +435,13 @@
|
||||
}
|
||||
|
||||
.change-btn {
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
color: #5d4b55;
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.change-btn.primary {
|
||||
background: var(--theme-primary);
|
||||
border-color: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-neutral);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
const userApi = require('../../api/user')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
const { runWithLoading } = require('../../utils/loading')
|
||||
|
||||
const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
loading: false,
|
||||
saving: false,
|
||||
isLoggedIn: false,
|
||||
userInfo: null,
|
||||
form: {
|
||||
verificationCode: '',
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
}
|
||||
}),
|
||||
|
||||
onShow() {
|
||||
this.loadProfile()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/settings/index')
|
||||
},
|
||||
|
||||
async loadProfile() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
this.setData({
|
||||
userInfo: await userApi.getUserInfo()
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '账号信息加载失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
handleInput(event) {
|
||||
const field = event.currentTarget.dataset.field
|
||||
this.setData({
|
||||
[`form.${field}`]: event.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
async sendCode() {
|
||||
const phone = String(this.data.userInfo && this.data.userInfo.phone || '').trim()
|
||||
if (!phone) {
|
||||
wx.showToast({ title: '请先绑定手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
try {
|
||||
await runWithLoading(() => userApi.sendVerificationCode({
|
||||
phone,
|
||||
sceneCode: 'USER_CHANGE_PASSWORD_SMS_CODE'
|
||||
}))
|
||||
wx.showToast({ title: '验证码已发送', icon: 'none' })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '验证码发送失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
async savePassword() {
|
||||
const verificationCode = String(this.data.form.verificationCode || '').trim()
|
||||
const password = String(this.data.form.password || '')
|
||||
const confirmPassword = String(this.data.form.confirmPassword || '')
|
||||
if (!verificationCode) {
|
||||
wx.showToast({ title: '请输入验证码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!passwordRegex.test(password)) {
|
||||
wx.showToast({ title: '密码至少8位且包含字母和数字', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (password !== confirmPassword) {
|
||||
wx.showToast({ title: '两次密码不一致', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ saving: true })
|
||||
try {
|
||||
await runWithLoading(() => userApi.updatePassword({
|
||||
password,
|
||||
verificationCode
|
||||
}))
|
||||
auth.setNeedSetPassword(false)
|
||||
wx.showToast({ title: '密码已更新', icon: 'none' })
|
||||
navigation.goBack('/pages/settings/index')
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '密码更新失败', icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ saving: false })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<navigation-bar title="修改密码" showBack="{{true}}" fallbackPath="/pages/settings/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">Security</text>
|
||||
<text class="hero-title">修改密码</text>
|
||||
<text class="hero-desc">使用绑定手机号验证码完成密码更新�?/text>
|
||||
</view>
|
||||
|
||||
<view class="page-card form-card">
|
||||
<view class="field-block">
|
||||
<text class="field-label">验证�?/text>
|
||||
<view class="code-row">
|
||||
<input class="field-input" value="{{form.verificationCode}}" data-field="verificationCode" bindinput="handleInput" placeholder="请输入验证码" placeholder-class="field-placeholder" />
|
||||
<view class="ghost-btn" bindtap="sendCode">发��?/view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">新密�?/text>
|
||||
<input class="field-input" password value="{{form.password}}" data-field="password" bindinput="handleInput" placeholder="至少8位,含字母和数字" placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<text class="field-label">确认密码</text>
|
||||
<input class="field-input" password value="{{form.confirmPassword}}" data-field="confirmPassword" bindinput="handleInput" placeholder="再次输入新密�? placeholder-class="field-placeholder" />
|
||||
</view>
|
||||
<button class="primary-btn" loading="{{saving}}" bindtap="savePassword">更新密码</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,22 @@
|
||||
.form-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 28rpx;
|
||||
}
|
||||
|
||||
.field-block + .field-block {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.code-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.code-row .field-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
margin-top: 28rpx;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="{{product ? product.displayTitle : '作品详情'}}" showBack="{{true}}" fallbackPath="/pages/products/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="{{product ? product.displayTitle : '作品详情'}}" showBack="{{true}}" fallbackPath="/pages/products/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell detail-page" style="{{themeVars}}">
|
||||
<view wx:if="{{loadError}}" class="page-content">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.detail-page {
|
||||
.detail-page {
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 160rpx);
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
@@ -46,7 +46,7 @@
|
||||
font-size: 42rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.product-price {
|
||||
@@ -60,7 +60,7 @@
|
||||
margin-top: 14rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.8;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.detail-summary {
|
||||
@@ -89,7 +89,7 @@
|
||||
.shop-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.shop-link {
|
||||
@@ -101,7 +101,7 @@
|
||||
.shop-meta {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
min-height: 120rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.7;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.comment-actions {
|
||||
@@ -256,7 +256,7 @@
|
||||
.comment-name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.comment-text {
|
||||
@@ -285,7 +285,7 @@
|
||||
}
|
||||
|
||||
.reply-name {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="作品库" showBack="{{false}}" isTabPage="{{true}}" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="作品库" showBack="{{false}}" isTabPage="{{true}}" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell product-page {{keyboardVisible ? 'keyboard-active' : ''}}" style="{{themeVars}}">
|
||||
<view class="page-content product-page-content" style="{{keyboardVisible ? 'padding-bottom: ' + keyboardInsetRpx + 'rpx;' : ''}}">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
border-radius: 24rpx;
|
||||
border: 1rpx solid var(--theme-border);
|
||||
background: var(--theme-card-bg);
|
||||
box-shadow: 0 18rpx 40rpx rgba(122, 67, 88, 0.08);
|
||||
box-shadow: 0 18rpx 40rpx rgba(74, 68, 63, 0.08);
|
||||
}
|
||||
|
||||
.search-row {
|
||||
@@ -34,7 +34,7 @@
|
||||
padding: 0 22rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
@@ -77,8 +77,9 @@
|
||||
height: 50rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 999rpx;
|
||||
border: 1rpx solid var(--theme-border);
|
||||
background: var(--theme-primary-soft);
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -91,14 +92,15 @@
|
||||
}
|
||||
|
||||
.filter-group-title {
|
||||
color: #a4939c;
|
||||
color: var(--theme-primary-action);
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.category-item.active {
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-primary);
|
||||
border-color: var(--theme-secondary);
|
||||
background: var(--theme-secondary-soft);
|
||||
color: var(--theme-primary-action);
|
||||
}
|
||||
|
||||
.results-head {
|
||||
@@ -120,7 +122,7 @@
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
color: #5d4b55;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.filter-summary-chip {
|
||||
@@ -169,5 +171,5 @@
|
||||
|
||||
.load-state-text {
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="profile-page-root" style="{{themeVars}}">
|
||||
<navigation-bar title="个人中心" showBack="{{false}}" isTabPage="{{true}}" color="#ffffff" background="transparent" safeAreaMode="overlay"></navigation-bar>
|
||||
<navigation-bar title="个人中心" showBack="{{false}}" isTabPage="{{true}}" color="#FDFBF9" background="transparent" safeAreaMode="overlay"></navigation-bar>
|
||||
<view class="profile-bg"></view>
|
||||
|
||||
<view class="profile-scroll">
|
||||
|
||||
@@ -51,13 +51,13 @@
|
||||
.guest-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.guest-desc {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.profile-top {
|
||||
@@ -79,14 +79,14 @@
|
||||
.nickname {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.account,
|
||||
.signature {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
padding: 20rpx 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
margin-top: 22rpx;
|
||||
padding: 22rpx 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #ffffff;
|
||||
background: var(--theme-card-bg);
|
||||
border: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
}
|
||||
|
||||
.growth-label {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@
|
||||
}
|
||||
|
||||
.growth-metrics text:first-child {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.growth-metrics text:last-child {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
@@ -175,14 +175,14 @@
|
||||
|
||||
.shop-label {
|
||||
font-size: 22rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.shop-name {
|
||||
margin-top: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.shop-link {
|
||||
@@ -195,8 +195,8 @@
|
||||
margin-top: 22rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border-radius: 20rpx;
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-accent);
|
||||
background: var(--theme-secondary-soft);
|
||||
color: var(--theme-neutral);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
}
|
||||
@@ -214,9 +214,9 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 92rpx;
|
||||
border-bottom: 2rpx solid #f3e7eb;
|
||||
border-bottom: 2rpx solid var(--theme-border);
|
||||
font-size: 28rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.menu-item:first-of-type {
|
||||
@@ -228,7 +228,7 @@
|
||||
}
|
||||
|
||||
.menu-arrow {
|
||||
color: #c3aab4;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.menu-badge {
|
||||
@@ -238,7 +238,7 @@
|
||||
padding: 0 10rpx;
|
||||
border-radius: 18rpx;
|
||||
background: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
color: var(--theme-tertiary);
|
||||
font-size: 22rpx;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
@@ -249,10 +249,10 @@
|
||||
}
|
||||
|
||||
.logout-item {
|
||||
color: var(--theme-accent);
|
||||
color: var(--theme-neutral);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.logout-item .menu-arrow {
|
||||
color: #e0a7b5;
|
||||
color: var(--theme-primary);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
const orderApi = require('../../api/order')
|
||||
const afterSaleApi = require('../../api/after-sale')
|
||||
const auth = require('../../utils/auth')
|
||||
const navigation = require('../../utils/navigation')
|
||||
const theme = require('../../utils/theme')
|
||||
const { formatDateTime } = require('../../utils/format')
|
||||
|
||||
function safeList(value) {
|
||||
if (Array.isArray(value)) return value
|
||||
if (value && Array.isArray(value.list)) return value.list
|
||||
return []
|
||||
}
|
||||
|
||||
function buildNodes(order, reviews, changes, afterSales) {
|
||||
const items = safeList(order && order.items)
|
||||
const appointment = items.map(item => item && item.appointmentTime).find(Boolean)
|
||||
const status = Number(order && order.status)
|
||||
return [
|
||||
{ key: 'created', title: '订单创建', text: formatDateTime(order && order.createTime) || '已提交', done: true, active: false },
|
||||
{ key: 'appointment', title: '预约确认', text: formatDateTime(appointment) || '待确认', done: Boolean(appointment), active: status === 1 },
|
||||
{ key: 'artist', title: '服务安排', text: changes.length ? `${changes.length} 条改派记录` : '按预约安排服务', done: changes.length > 0 || items.some(item => item.artistName), active: changes.some(item => String(item.status || '').toUpperCase() === 'PENDING') },
|
||||
{ key: 'service', title: status === 3 ? '订单取消' : '服务完成', text: formatDateTime(order && (order.completeTime || order.cancelTime || order.updateTime)) || '等待服务', done: status === 2 || status === 3, active: status === 2 || status === 3 },
|
||||
{ key: 'after-sale', title: '售后/评价', text: afterSales.length ? `${afterSales.length} 条售后` : (reviews.length ? `${reviews.length} 条评价` : '暂无记录'), done: afterSales.length > 0 || reviews.length > 0, active: afterSales.some(item => String(item.status || '').toUpperCase() === 'PENDING') }
|
||||
]
|
||||
}
|
||||
|
||||
Page({
|
||||
data: Object.assign(theme.pageThemeData(getApp().globalData.shopTheme), {
|
||||
orderId: '',
|
||||
loading: false,
|
||||
isLoggedIn: false,
|
||||
order: null,
|
||||
nodes: [],
|
||||
items: [],
|
||||
reviews: [],
|
||||
changes: [],
|
||||
afterSales: []
|
||||
}),
|
||||
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
orderId: (options && (options.orderId || options.id)) || ''
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadProgress()
|
||||
},
|
||||
|
||||
handleBack() {
|
||||
navigation.goBack('/pages/orders/index')
|
||||
},
|
||||
|
||||
async loadProgress() {
|
||||
const isLoggedIn = auth.isLoggedIn()
|
||||
this.setData({ isLoggedIn })
|
||||
if (!isLoggedIn) {
|
||||
navigation.openAuth(navigation.getCurrentPageUrl())
|
||||
return
|
||||
}
|
||||
if (!this.data.orderId) return
|
||||
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
const [order, reviews, changes, afterSalePage] = await Promise.all([
|
||||
orderApi.getOrderDetail(this.data.orderId),
|
||||
orderApi.listOrderReviews(this.data.orderId).catch(() => []),
|
||||
orderApi.listOrderArtistChangeRequests(this.data.orderId).catch(() => []),
|
||||
afterSaleApi.getMyAfterSales({ page: 1, size: 50 }).catch(() => ({ list: [] }))
|
||||
])
|
||||
const afterSales = safeList(afterSalePage).filter(item => String(item.orderId) === String(this.data.orderId))
|
||||
this.setData({
|
||||
order,
|
||||
items: safeList(order && order.items).map(item => ({
|
||||
...item,
|
||||
appointmentText: formatDateTime(item.appointmentTime)
|
||||
})),
|
||||
reviews,
|
||||
changes,
|
||||
afterSales,
|
||||
nodes: buildNodes(order, reviews || [], changes || [], afterSales)
|
||||
})
|
||||
} catch (error) {
|
||||
wx.showToast({
|
||||
title: error.message || '服务进度加载失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
openOrder() {
|
||||
navigation.navigate('/pages/order-detail/index', { id: this.data.orderId })
|
||||
},
|
||||
|
||||
openAfterSaleApply() {
|
||||
navigation.navigate('/pages/after-sale-apply/index', { orderId: this.data.orderId })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigation-bar": "/components/navigation-bar/navigation-bar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<navigation-bar title="服务进度" showBack="{{true}}" fallbackPath="/pages/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">进度追踪</text>
|
||||
<text class="hero-title">{{order && order.orderNo || '订单进度'}}</text>
|
||||
<text class="hero-desc">{{order && order.shopName || '查看预约、服务��评价与售后节点'}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="page-card empty-card">
|
||||
<text class="empty-title">正在加载进度</text>
|
||||
</view>
|
||||
|
||||
<block wx:elif="{{order}}">
|
||||
<view class="page-card progress-card">
|
||||
<view wx:for="{{nodes}}" wx:key="key" class="progress-node {{item.done ? 'done' : ''}} {{item.active ? 'active' : ''}}">
|
||||
<view class="node-dot"></view>
|
||||
<view class="node-copy">
|
||||
<text class="node-title">{{item.title}}</text>
|
||||
<text class="node-text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{items.length}}" class="page-card record-card">
|
||||
<text class="section-title">项目进度</text>
|
||||
<text wx:for="{{items}}" wx:key="id" class="record-line">{{item.productTitle}}:{{item.artistName || '待安�?}} · {{item.appointmentText || '待确�?}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{changes.length}}" class="page-card record-card">
|
||||
<text class="section-title">改派记录</text>
|
||||
<text wx:for="{{changes}}" wx:key="id" class="record-line">{{item.statusText || item.status || '已记�?}}:{{item.reason || item.timeImpactText || ''}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{afterSales.length}}" class="page-card record-card">
|
||||
<text class="section-title">售后记录</text>
|
||||
<text wx:for="{{afterSales}}" wx:key="id" class="record-line">{{item.afterSaleNo || item.id}}:{{item.status}}</text>
|
||||
</view>
|
||||
|
||||
<view class="action-row">
|
||||
<view class="secondary-btn" bindtap="openOrder">订单详情</view>
|
||||
<view class="primary-btn" bindtap="openAfterSaleApply">申请售后</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view wx:else class="page-card empty-card">
|
||||
<text class="empty-title">未找到订单进�?/text>
|
||||
<text class="empty-desc">请从订单中心重新进入�?/text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,61 @@
|
||||
.progress-card,
|
||||
.record-card {
|
||||
margin-top: 22rpx;
|
||||
padding: 26rpx;
|
||||
}
|
||||
|
||||
.progress-node {
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx solid var(--theme-border);
|
||||
}
|
||||
|
||||
.progress-node:first-child {
|
||||
padding-top: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
.node-dot {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
margin-top: 6rpx;
|
||||
border-radius: 999rpx;
|
||||
background: var(--theme-border);
|
||||
box-shadow: 0 0 0 10rpx var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.progress-node.done .node-dot,
|
||||
.progress-node.active .node-dot {
|
||||
background: var(--theme-primary);
|
||||
}
|
||||
|
||||
.node-copy {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.node-title,
|
||||
.node-text,
|
||||
.record-line {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.node-title {
|
||||
color: var(--text-primary);
|
||||
font-size: 29rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.node-text,
|
||||
.record-line {
|
||||
margin-top: 8rpx;
|
||||
color: #504444;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.action-row {
|
||||
display: grid;
|
||||
gap: 16rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="settings-page-root" style="{{themeVars}}">
|
||||
<navigation-bar title="设置中心" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="设置中心" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="settings-scroll">
|
||||
<view class="page-shell settings-page-shell {{keyboardVisible ? 'keyboard-active' : ''}}">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.settings-page-root {
|
||||
.settings-page-root {
|
||||
min-height: 100vh;
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
@@ -50,14 +50,14 @@
|
||||
.preview-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.preview-account,
|
||||
.preview-phone {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@@ -122,14 +122,14 @@
|
||||
.setting-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.setting-desc {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.7;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.setting-action {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.shop-page {
|
||||
.shop-page {
|
||||
background: var(--theme-page-bg);
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
font-size: 42rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.shop-address {
|
||||
margin-top: 16rpx;
|
||||
font-size: 26rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
|
||||
.trust-label {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
line-height: 1.35;
|
||||
}
|
||||
@@ -96,13 +96,13 @@
|
||||
|
||||
.detail-label {
|
||||
font-size: 24rpx;
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
margin-top: 12rpx;
|
||||
font-size: 28rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
}
|
||||
|
||||
.contact-copy {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 24rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
|
||||
.featured-title {
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
.featured-hint,
|
||||
.review-time {
|
||||
color: #8d7a84;
|
||||
color: var(--text-secondary);
|
||||
font-size: 22rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@@ -217,7 +217,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
color: #2d2430;
|
||||
color: var(--text-primary);
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="VIP 中心" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="#fff7f8"></navigation-bar>
|
||||
<navigation-bar title="VIP 中心" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
<view class="vip-page">
|
||||
<view class="vip-hero">
|
||||
<text class="vip-kicker">会员等级</text>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<navigation-bar title="我的收藏" showBack="{{true}}" fallbackPath="/pages/profile/index" color="#2d2430" background="{{navThemeBackground || '#FFF7F9'}}"></navigation-bar>
|
||||
<navigation-bar title="我的收藏" showBack="{{true}}" fallbackPath="/pages/profile/index" color="{{navThemeColor || '#4A443F'}}" background="{{navThemeBackground || '#FDFBF9'}}"></navigation-bar>
|
||||
|
||||
<view class="page-shell wishlist-page" style="{{themeVars}}">
|
||||
<view class="page-content">
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const root = path.join(__dirname, '..')
|
||||
const appWxss = fs.readFileSync(path.join(root, 'app.wxss'), 'utf8')
|
||||
const productCardWxss = fs.readFileSync(path.join(root, 'components', 'product-card', 'product-card.wxss'), 'utf8')
|
||||
const navigationBarWxss = fs.readFileSync(path.join(root, 'components', 'navigation-bar', 'navigation-bar.wxss'), 'utf8')
|
||||
const pageRoot = path.join(root, 'pages')
|
||||
const legacyThemeColorPattern = /#(?:2d2430|1f1b17|8d7a84|7a5262|c6597d|C6597D|FFF7F9|FFF8F4)\b/
|
||||
|
||||
function readPageSources(dir) {
|
||||
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
||||
const fullPath = path.join(dir, entry.name)
|
||||
if (entry.isDirectory()) {
|
||||
return readPageSources(fullPath)
|
||||
}
|
||||
if (!/\.(?:wxml|wxss)$/.test(entry.name)) {
|
||||
return []
|
||||
}
|
||||
return [{ file: path.relative(root, fullPath), source: fs.readFileSync(fullPath, 'utf8') }]
|
||||
})
|
||||
}
|
||||
|
||||
assert.ok(appWxss.includes('--theme-neutral: #4A443F;'))
|
||||
assert.ok(appWxss.includes('--theme-tertiary: #FDFBF9;'))
|
||||
assert.ok(appWxss.includes('.yumi-page'))
|
||||
assert.ok(appWxss.includes('.yumi-glass-card'))
|
||||
assert.ok(appWxss.includes('.yumi-status-chip'))
|
||||
assert.ok(appWxss.includes('.yumi-bottom-action'))
|
||||
assert.ok(!/--theme-primary:\s*#7c5357/i.test(appWxss))
|
||||
|
||||
assert.ok(productCardWxss.includes('background: rgba(255, 255, 255, 0.86);'))
|
||||
assert.ok(productCardWxss.includes('color: var(--text-primary);'))
|
||||
assert.ok(productCardWxss.includes('color: var(--text-secondary);'))
|
||||
assert.ok(navigationBarWxss.includes('backdrop-filter: blur(20rpx);'))
|
||||
assert.ok(navigationBarWxss.includes('color: var(--theme-neutral);'))
|
||||
|
||||
for (const { file, source } of [{ file: 'app.wxss', source: appWxss }, ...readPageSources(pageRoot)]) {
|
||||
assert.ok(!legacyThemeColorPattern.test(source), `${file} should use Luminous theme variables instead of legacy hardcoded theme colors`)
|
||||
}
|
||||
@@ -84,13 +84,51 @@ function normalizeActionPath(value) {
|
||||
if (!rawPath || !rawPath.startsWith('/') || rawPath.startsWith('//')) {
|
||||
return ''
|
||||
}
|
||||
const queryIndex = rawPath.indexOf('?')
|
||||
const pathOnly = queryIndex >= 0 ? rawPath.slice(0, queryIndex) : rawPath
|
||||
const query = queryIndex >= 0 ? rawPath.slice(queryIndex) : ''
|
||||
|
||||
if (rawPath.startsWith('/orders')) {
|
||||
const queryIndex = rawPath.indexOf('?')
|
||||
const query = queryIndex >= 0 ? rawPath.slice(queryIndex) : ''
|
||||
if (pathOnly.startsWith('/orders/')) {
|
||||
const id = pathOnly.split('/')[2] || ''
|
||||
return buildUrl('/pages/order-detail/index', { id })
|
||||
}
|
||||
|
||||
if (pathOnly === '/orders') {
|
||||
return `/pages/orders/index${query}`
|
||||
}
|
||||
|
||||
if (pathOnly === '/after-sales') {
|
||||
return `/pages/after-sales/index${query}`
|
||||
}
|
||||
|
||||
if (pathOnly === '/after-sale/apply') {
|
||||
return `/pages/after-sale-apply/index${query}`
|
||||
}
|
||||
|
||||
if (pathOnly === '/service-progress') {
|
||||
return `/pages/service-progress/index${query}`
|
||||
}
|
||||
|
||||
if (pathOnly === '/help') {
|
||||
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}`
|
||||
}
|
||||
|
||||
if (pathOnly === '/settings/password') {
|
||||
return `/pages/password-settings/index${query}`
|
||||
}
|
||||
|
||||
if (rawPath.startsWith('/product/')) {
|
||||
const id = rawPath.split('/')[2] || ''
|
||||
return buildUrl('/pages/product-detail/index', { id })
|
||||
@@ -135,9 +173,18 @@ function buildMessageActionPath(message) {
|
||||
|
||||
const businessType = String(message.businessType || '').toUpperCase()
|
||||
const businessId = message.businessId || ''
|
||||
if (businessType === 'ORDER' && businessId) {
|
||||
return buildUrl('/pages/order-detail/index', { id: businessId })
|
||||
}
|
||||
if (businessType === 'ORDER_ARTIST_CHANGE' && businessId) {
|
||||
return buildUrl('/pages/service-progress/index', { orderId: businessId })
|
||||
}
|
||||
if (businessType === 'ORDER_ARTIST_REVIEW' || businessType === 'ORDER_ARTIST_CHANGE' || businessType === 'ORDER') {
|
||||
return buildUrl('/pages/orders/index', businessId ? { orderId: businessId } : {})
|
||||
}
|
||||
if (businessType === 'AFTER_SALE') {
|
||||
return buildUrl('/pages/after-sales/index', businessId ? { orderId: businessId } : {})
|
||||
}
|
||||
if (businessType === 'PRODUCT') {
|
||||
return buildUrl('/pages/product-detail/index', businessId ? { id: businessId } : {})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
const assert = require('assert')
|
||||
const navigation = require('./navigation')
|
||||
const { TAB_PAGES } = require('./config')
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.normalizeActionPath('/orders/10'),
|
||||
'/pages/order-detail/index?id=10'
|
||||
)
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.normalizeActionPath('/after-sales?orderId=10'),
|
||||
'/pages/after-sales/index?orderId=10'
|
||||
)
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.normalizeActionPath('/after-sale/apply?orderId=10&orderItemId=99'),
|
||||
'/pages/after-sale-apply/index?orderId=10&orderItemId=99'
|
||||
)
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.normalizeActionPath('/service-progress?orderId=10'),
|
||||
'/pages/service-progress/index?orderId=10'
|
||||
)
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.buildMessageActionPath({ businessType: 'ORDER', businessId: 10 }),
|
||||
'/pages/order-detail/index?id=10'
|
||||
)
|
||||
|
||||
assert.strictEqual(
|
||||
navigation.buildMessageActionPath({ businessType: 'AFTER_SALE', businessId: 10 }),
|
||||
'/pages/after-sales/index?orderId=10'
|
||||
)
|
||||
|
||||
assert.ok(TAB_PAGES.includes('/pages/home/index'))
|
||||
@@ -69,12 +69,18 @@ function buildStyleVars(theme) {
|
||||
`--theme-primary: ${theme.primaryColor};`,
|
||||
`--theme-secondary: ${theme.secondaryColor};`,
|
||||
`--theme-accent: ${theme.accentColor};`,
|
||||
`--theme-neutral: ${theme.neutralColor || theme.accentColor};`,
|
||||
`--theme-tertiary: ${theme.tertiaryColor || theme.pageBgColor};`,
|
||||
`--theme-primary-action: ${theme.primaryActionColor};`,
|
||||
`--theme-page-bg: ${theme.pageBgColor};`,
|
||||
`--theme-card-bg: ${theme.cardBgColor};`,
|
||||
`--theme-border: ${theme.borderColor};`,
|
||||
`--theme-primary-soft: ${theme.primarySoftColor};`,
|
||||
`--theme-secondary-soft: ${theme.secondarySoftColor};`,
|
||||
`--theme-gradient: ${theme.gradient};`,
|
||||
`--theme-gradient-soft: ${theme.softGradient};`
|
||||
`--theme-gradient-soft: ${theme.softGradient};`,
|
||||
`--text-primary: ${theme.textPrimary};`,
|
||||
`--text-secondary: ${theme.textSecondary};`
|
||||
]
|
||||
if (theme.backgroundImageUrl) {
|
||||
styleVars.push(
|
||||
@@ -95,15 +101,21 @@ function resolveShopTheme(source) {
|
||||
const normalizedPrimaryColor = normalizeHexColor(themeSource.themePrimaryColor)
|
||||
const primaryColor = normalizedPrimaryColor || DEFAULT_SHOP_THEME.primaryColor
|
||||
const secondaryColor = normalizeHexColor(themeSource.themeSecondaryColor)
|
||||
|| (normalizedPrimaryColor ? mixColor(primaryColor, '#FFFFFF', 0.68) : DEFAULT_SHOP_THEME.secondaryColor)
|
||||
const accentColor = normalizeHexColor(themeSource.themeAccentColor)
|
||||
|| (normalizedPrimaryColor ? mixColor(primaryColor, '#7A3F56', 0.38) : DEFAULT_SHOP_THEME.accentColor)
|
||||
const pageBgColor = normalizeHexColor(themeSource.themePageBgColor) || DEFAULT_SHOP_THEME.pageBgColor
|
||||
|| (normalizedPrimaryColor ? mixColor(primaryColor, DEFAULT_SHOP_THEME.secondaryColor, 0.35) : DEFAULT_SHOP_THEME.secondaryColor)
|
||||
const neutralColor = normalizeHexColor(themeSource.themeAccentColor)
|
||||
|| (normalizedPrimaryColor ? mixColor(DEFAULT_SHOP_THEME.neutralColor, primaryColor, 0.14) : DEFAULT_SHOP_THEME.neutralColor)
|
||||
const accentColor = neutralColor
|
||||
const tertiaryColor = normalizeHexColor(themeSource.themePageBgColor) || DEFAULT_SHOP_THEME.tertiaryColor
|
||||
const pageBgColor = tertiaryColor
|
||||
const cardBgColor = normalizeHexColor(themeSource.themeCardBgColor) || DEFAULT_SHOP_THEME.cardBgColor
|
||||
const borderColor = mixColor(primaryColor, cardBgColor, 0.82)
|
||||
const primarySoftColor = mixColor(primaryColor, cardBgColor, 0.88)
|
||||
const gradient = `linear-gradient(135deg, ${primaryColor} 0%, ${secondaryColor} 100%)`
|
||||
const softGradient = `linear-gradient(145deg, ${cardBgColor} 0%, ${mixColor(secondaryColor, pageBgColor, 0.55)} 58%, ${mixColor(primaryColor, pageBgColor, 0.82)} 100%)`
|
||||
const textPrimary = neutralColor
|
||||
const textSecondary = mixColor(neutralColor, cardBgColor, 0.18)
|
||||
const borderColor = mixColor(primaryColor, cardBgColor, 0.72)
|
||||
const primarySoftColor = mixColor(primaryColor, cardBgColor, 0.78)
|
||||
const secondarySoftColor = mixColor(secondaryColor, pageBgColor, 0.66)
|
||||
const primaryActionColor = mixColor(neutralColor, primaryColor, 0.28)
|
||||
const gradient = `linear-gradient(135deg, ${primaryActionColor} 0%, ${secondaryColor} 100%)`
|
||||
const softGradient = `linear-gradient(145deg, ${cardBgColor} 0%, ${secondarySoftColor} 58%, ${mixColor(primaryColor, pageBgColor, 0.62)} 100%)`
|
||||
const backgroundImageFileId = themeSource.themeBackgroundImageFileId
|
||||
? String(themeSource.themeBackgroundImageFileId).trim()
|
||||
: ''
|
||||
@@ -114,10 +126,16 @@ function resolveShopTheme(source) {
|
||||
primaryColor,
|
||||
secondaryColor,
|
||||
accentColor,
|
||||
tertiaryColor,
|
||||
neutralColor,
|
||||
pageBgColor,
|
||||
cardBgColor,
|
||||
textPrimary,
|
||||
textSecondary,
|
||||
borderColor,
|
||||
primarySoftColor,
|
||||
secondarySoftColor,
|
||||
primaryActionColor,
|
||||
gradient,
|
||||
softGradient,
|
||||
backgroundImageFileId,
|
||||
@@ -132,15 +150,21 @@ function resolveShopTheme(source) {
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const DEFAULT_SHOP_THEME = {
|
||||
primaryColor: '#C6597D',
|
||||
secondaryColor: '#E9B7C7',
|
||||
accentColor: '#9F4967',
|
||||
pageBgColor: '#FFF7F9',
|
||||
primaryColor: '#E8B4B8',
|
||||
secondaryColor: '#C5A059',
|
||||
accentColor: '#4A443F',
|
||||
tertiaryColor: '#FDFBF9',
|
||||
neutralColor: '#4A443F',
|
||||
pageBgColor: '#FDFBF9',
|
||||
cardBgColor: '#FFFFFF',
|
||||
borderColor: '#EFD8E0',
|
||||
primarySoftColor: '#FBF1F4',
|
||||
gradient: 'linear-gradient(135deg, #C6597D 0%, #E9B7C7 100%)',
|
||||
softGradient: 'linear-gradient(145deg, #FFFFFF 0%, #FFF1F5 58%, #FFE8EF 100%)',
|
||||
textPrimary: '#4A443F',
|
||||
textSecondary: '#6B6662',
|
||||
borderColor: '#F9EAEC',
|
||||
primarySoftColor: '#FAEFF0',
|
||||
secondarySoftColor: '#EADCC2',
|
||||
primaryActionColor: '#766361',
|
||||
gradient: 'linear-gradient(135deg, #766361 0%, #C5A059 100%)',
|
||||
softGradient: 'linear-gradient(145deg, #FFFFFF 0%, #EADCC2 58%, #F5E0E0 100%)',
|
||||
backgroundImageFileId: '',
|
||||
backgroundImageUrl: ''
|
||||
}
|
||||
|
||||
@@ -9,6 +9,13 @@ const assert = require('assert')
|
||||
*/
|
||||
const theme = require('./theme')
|
||||
|
||||
assert.strictEqual(theme.DEFAULT_SHOP_THEME.primaryColor, '#E8B4B8')
|
||||
assert.strictEqual(theme.DEFAULT_SHOP_THEME.secondaryColor, '#C5A059')
|
||||
assert.strictEqual(theme.DEFAULT_SHOP_THEME.accentColor, '#4A443F')
|
||||
assert.strictEqual(theme.DEFAULT_SHOP_THEME.pageBgColor, '#FDFBF9')
|
||||
assert.ok(theme.DEFAULT_SHOP_THEME.styleVars.includes('--theme-neutral: #4A443F;'))
|
||||
assert.ok(theme.DEFAULT_SHOP_THEME.styleVars.includes('--theme-tertiary: #FDFBF9;'))
|
||||
|
||||
/**
|
||||
* Purpose: customized supports theme.test.js by holding or executing the customized page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
@@ -29,7 +36,9 @@ assert.strictEqual(customized.pageBgColor, '#FFF8FA')
|
||||
assert.strictEqual(customized.cardBgColor, '#FFFFFF')
|
||||
assert.strictEqual(customized.backgroundImageFileId, 'bg-file')
|
||||
assert.ok(customized.styleVars.includes('--theme-primary: #8B4F65;'))
|
||||
assert.ok(customized.styleVars.includes('--theme-gradient: linear-gradient(135deg, #8B4F65 0%, #F2C9D4 100%);'))
|
||||
assert.ok(customized.styleVars.includes('--theme-neutral: #B86F84;'))
|
||||
assert.ok(customized.styleVars.includes('--theme-primary-action: #AB667B;'))
|
||||
assert.ok(customized.styleVars.includes('--theme-gradient: linear-gradient(135deg, #AB667B 0%, #F2C9D4 100%);'))
|
||||
|
||||
/**
|
||||
* Purpose: themedPageData supports theme.test.js by holding or executing the themed page data page or API role.
|
||||
|
||||
Reference in New Issue
Block a user