chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* 红娘服务申请页 U34
|
||||
*/
|
||||
const api = require('../../utils/api');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
serviceTypes: [
|
||||
{ code: 'recommend_partner', name: '帮我推荐合适的人', icon: '👤' },
|
||||
{ code: 'review_preference', name: '帮我看看择偶条件', icon: '📋' },
|
||||
{ code: 'contact_intention', name: '帮我联系意向对象', icon: '💬' },
|
||||
{ code: 'join_activity', name: '想参加线下活动', icon: '🎉' },
|
||||
{ code: 'no_match_help', name: '匹配很久没有结果', icon: '😟' },
|
||||
{ code: 'chat_help', name: '不知道怎么开始聊天', icon: '✉️' },
|
||||
{ code: 'other', name: '其他', icon: '❓' }
|
||||
],
|
||||
selectedType: '',
|
||||
description: '',
|
||||
submitting: false
|
||||
},
|
||||
|
||||
onTypeSelect(e) {
|
||||
this.setData({ selectedType: e.currentTarget.dataset.type });
|
||||
},
|
||||
|
||||
onDescriptionInput(e) {
|
||||
this.setData({ description: e.detail.value });
|
||||
},
|
||||
|
||||
async onSubmit() {
|
||||
if (!this.data.selectedType) {
|
||||
wx.showToast({ title: '请选择服务类型', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.setData({ submitting: true });
|
||||
try {
|
||||
const token = wx.getStorageSync('accessToken');
|
||||
const res = await api.post('/matchmaker/services', {
|
||||
serviceType: this.data.selectedType,
|
||||
description: this.data.description
|
||||
}, { Authorization: `Bearer ${token}` });
|
||||
wx.setStorageSync('lastServiceId', res.serviceId);
|
||||
wx.redirectTo({ url: '/pages/matchmaker-progress/matchmaker-progress' });
|
||||
} catch (err) {
|
||||
wx.showToast({ title: err.message || '提交失败', icon: 'none' });
|
||||
} finally {
|
||||
this.setData({ submitting: false });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "申请红娘服务",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<!-- 红娘服务申请页 U34 -->
|
||||
<view class="page">
|
||||
<view class="section">
|
||||
<text class="section-title">选择服务类型</text>
|
||||
<view class="type-grid">
|
||||
<view
|
||||
wx:for="{{serviceTypes}}"
|
||||
wx:key="code"
|
||||
class="type-item {{selectedType === item.code ? 'selected' : ''}}"
|
||||
bindtap="onTypeSelect"
|
||||
data-type="{{item.code}}"
|
||||
>
|
||||
<text class="type-icon">{{item.icon}}</text>
|
||||
<text class="type-name">{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<text class="section-title">补充说明(可选)</text>
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="请描述您的情况或需求,方便红娘更好地为您服务"
|
||||
value="{{description}}"
|
||||
bindinput="onDescriptionInput"
|
||||
maxlength="500"
|
||||
/>
|
||||
<text class="char-count">{{description.length}}/500</text>
|
||||
</view>
|
||||
|
||||
<button class="submit-btn" loading="{{submitting}}" bindtap="onSubmit">提交申请</button>
|
||||
</view>
|
||||
@@ -0,0 +1,82 @@
|
||||
.page {
|
||||
padding: 32rpx;
|
||||
background: #FFF8F7;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.section {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #1A1A1A;
|
||||
margin-bottom: 24rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.type-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.type-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 28rpx 16rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #F8F8F8;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.type-item.selected {
|
||||
background: #FFF3F2;
|
||||
border-color: #E96B6B;
|
||||
}
|
||||
|
||||
.type-icon {
|
||||
font-size: 48rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.type-name {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
background: #F8F8F8;
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
display: block;
|
||||
text-align: right;
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
background: #E96B6B;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user