chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* 红娘服务进度页 U35
|
||||
*/
|
||||
const api = require('../../utils/api');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
service: null,
|
||||
loading: true
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const lastServiceId = wx.getStorageSync('lastServiceId');
|
||||
if (lastServiceId) {
|
||||
this.loadService(lastServiceId);
|
||||
} else {
|
||||
this.loadMyServices();
|
||||
}
|
||||
},
|
||||
|
||||
async loadService(serviceId) {
|
||||
this.setData({ loading: true });
|
||||
try {
|
||||
const token = wx.getStorageSync('accessToken');
|
||||
const res = await api.get(`/matchmaker/services/${serviceId}`, {}, { Authorization: `Bearer ${token}` });
|
||||
this.setData({ service: res, loading: false });
|
||||
} catch (err) {
|
||||
this.setData({ loading: false });
|
||||
}
|
||||
},
|
||||
|
||||
async loadMyServices() {
|
||||
this.setData({ loading: true });
|
||||
try {
|
||||
const token = wx.getStorageSync('accessToken');
|
||||
const res = await api.get('/matchmaker/services', {}, { Authorization: `Bearer ${token}` });
|
||||
if (res && res.length > 0) {
|
||||
this.setData({ service: res[0], loading: false });
|
||||
} else {
|
||||
this.setData({ loading: false });
|
||||
}
|
||||
} catch (err) {
|
||||
this.setData({ loading: false });
|
||||
}
|
||||
},
|
||||
|
||||
getStatusText(status) {
|
||||
const map = {
|
||||
'submitted': '已提交,等待分配',
|
||||
'assigned': '已分配红娘',
|
||||
'in_service': '红娘正在服务中',
|
||||
'waiting_user': '等待您确认',
|
||||
'completed': '服务已完成',
|
||||
'cancelled': '已取消'
|
||||
};
|
||||
return map[status] || status;
|
||||
},
|
||||
|
||||
getStatusColor(status) {
|
||||
const map = {
|
||||
'submitted': '#E59A32',
|
||||
'assigned': '#17A2B8',
|
||||
'in_service': '#E96B6B',
|
||||
'waiting_user': '#E59A32',
|
||||
'completed': '#2E9B68',
|
||||
'cancelled': '#999'
|
||||
};
|
||||
return map[status] || '#999';
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "服务进度",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<!-- 红娘服务进度页 U35 -->
|
||||
<view class="page" wx:if="{{service}}">
|
||||
<view class="status-card">
|
||||
<view class="status-dot" style="background: {{getStatusColor(service.status)}}"></view>
|
||||
<text class="status-text">{{getStatusText(service.status)}}</text>
|
||||
</view>
|
||||
|
||||
<view class="info-card">
|
||||
<view class="info-row">
|
||||
<text class="info-label">服务类型</text>
|
||||
<text class="info-value">{{getServiceTypeText(service.serviceType)}}</text>
|
||||
</view>
|
||||
<view class="info-row" wx:if="{{service.description}}">
|
||||
<text class="info-label">您的需求</text>
|
||||
<text class="info-value desc">{{service.description}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">提交时间</text>
|
||||
<text class="info-value">{{formatTime(service.createdAt)}}</text>
|
||||
</view>
|
||||
<view class="info-row" wx:if="{{service.assignedAt}}">
|
||||
<text class="info-label">分配时间</text>
|
||||
<text class="info-value">{{formatTime(service.assignedAt)}}</text>
|
||||
</view>
|
||||
<view class="info-row" wx:if="{{service.completedAt}}">
|
||||
<text class="info-label">完成时间</text>
|
||||
<text class="info-value">{{formatTime(service.completedAt)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="notice">
|
||||
<text class="notice-title">服务流程</text>
|
||||
<view class="steps">
|
||||
<view class="step {{getStepStatus('submitted', service.status)}}">
|
||||
<text class="step-num">1</text>
|
||||
<text class="step-text">提交申请</text>
|
||||
</view>
|
||||
<view class="step {{getStepStatus('assigned', service.status)}}">
|
||||
<text class="step-num">2</text>
|
||||
<text class="step-text">分配红娘</text>
|
||||
</view>
|
||||
<view class="step {{getStepStatus('in_service', service.status)}}">
|
||||
<text class="step-num">3</text>
|
||||
<text class="step-text">红娘服务</text>
|
||||
</view>
|
||||
<view class="step {{getStepStatus('completed', service.status)}}">
|
||||
<text class="step-num">4</text>
|
||||
<text class="step-text">服务完成</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!loading && !service}}" class="empty">
|
||||
<text>暂无服务记录</text>
|
||||
<text class="empty-desc">您可以重新申请红娘服务</text>
|
||||
<button class="btn-apply" bindtap="onApply">申请红娘服务</button>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="loading">
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
@@ -0,0 +1,142 @@
|
||||
.page {
|
||||
padding: 32rpx;
|
||||
background: #FFF8F7;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.status-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.info-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
text-align: right;
|
||||
max-width: 55%;
|
||||
}
|
||||
|
||||
.info-value.desc {
|
||||
text-align: right;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.notice {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 24rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.step {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.step-num {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
background: #EEE;
|
||||
color: #999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.step.active .step-num, .step.done .step-num {
|
||||
background: #E96B6B;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.step-text {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.step.active .step-text, .step.done .step-text {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 120rpx 40rpx;
|
||||
}
|
||||
|
||||
.empty-desc {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin: 16rpx 0 40rpx;
|
||||
}
|
||||
|
||||
.btn-apply {
|
||||
background: #E96B6B;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
padding: 120rpx;
|
||||
color: #999;
|
||||
}
|
||||
Reference in New Issue
Block a user