lrj
9 小时以前 ae3349d2ff53767b5bc9cb30e1bf7e15f9e814ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!--pages/registration/registration.wxml-->
<view class="container">
  <!-- 加载状态 -->
  <view wx:if="{{loading}}" class="loading-wrapper">
    <view class="loading"></view>
    <text class="loading-text">加载中...</text>
  </view>
 
  <view wx:else class="form-container">
    <!-- 个人信息卡片 -->
    <view class="card">
      <view class="card-title">个人信息</view>
 
      <!-- 头像 -->
      <view class="form-item" bindtap="onChooseAvatar">
        <text class="label">照片</text>
        <view class="input-wrapper avatar-wrapper">
          <image 
            class="avatar-image" 
            src="{{localAvatarPath || formData.avatarUrl || '../../images/default-avatar.png'}}" 
            mode="aspectFill"
          />
          <text></text>
        </view>
      </view>
 
      <!-- 姓名 -->
      <view class="form-item {{errors.name ? 'error' : ''}}">
        <text class="label required">姓名</text>
        <view class="input-wrapper">
          <input 
            class="input" 
            placeholder-class="placeholder-class"
            placeholder="请输入真实姓名"
            value="{{formData.name}}"
            data-field="name"
            bindinput="onInputChange"
          />
        </view>
        <text wx:if="{{errors.name}}" class="error-text">{{errors.name}}</text>
      </view>
 
      <!-- 手机号 -->
      <view class="form-item {{errors.phone ? 'error' : ''}}">
        <text class="label required">手机号</text>
        <view class="input-wrapper">
          <view class="phone-container">
            <block wx:if="{{formData.phone}}">
              <view class="phone-display">{{formData.phone}}</view>
              <button class="phone-change-btn" bindtap="onClearPhone">修改</button>
            </block>
            <block wx:else>
              <view class="phone-display placeholder">点击授权获取手机号</view>
              <button 
                class="phone-auth-btn" 
                open-type="getPhoneNumber" 
                bindgetphonenumber="onGetPhoneNumber"
              >授权</button>
            </block>
          </view>
        </view>
        <text wx:if="{{errors.phone}}" class="error-text">{{errors.phone}}</text>
      </view>
 
      <!-- 性别 -->
      <view class="form-item {{errors.gender ? 'error' : ''}}">
        <text class="label required">性别</text>
        <view class="input-wrapper">
          <picker 
            class="picker" 
            mode="selector" 
            range="{{genderOptions}}" 
            value="{{genderIndex}}"
            bindchange="onGenderChange"
          >
            <view class="picker-text {{formData.gender === null ? 'placeholder' : ''}}">
              {{formData.gender !== null ? genderOptions[formData.gender] : '请选择性别'}}
            </view>
          </picker>
        </view>
        <text wx:if="{{errors.gender}}" class="error-text">{{errors.gender}}</text>
      </view>
 
      <!-- 生日 -->
      <view class="form-item {{errors.birthDate ? 'error' : ''}}">
        <text class="label">生日</text>
        <view class="input-wrapper">
          <picker 
            class="picker" 
            mode="date" 
            value="{{formData.birthDate}}"
            bindchange="onBirthDateChange"
            end="{{today}}"
          >
            <view class="picker-text {{!formData.birthDate ? 'placeholder' : ''}}">
              {{formData.birthDate || '请选择生日'}}
            </view>
          </picker>
        </view>
        <text wx:if="{{errors.birthDate}}" class="error-text">{{errors.birthDate}}</text>
      </view>
 
      <!-- 所在区域 -->
      <view class="form-item {{errors.regionId ? 'error' : ''}}">
        <text class="label">所在区域</text>
        <view class="input-wrapper">
          <picker 
            class="picker" 
            mode="selector" 
            range="{{regions}}" 
            range-key="name"
            value="{{regionIndex}}"
            bindchange="onRegionChange"
          >
            <view class="picker-text {{formData.regionId === null ? 'placeholder' : ''}}">
              {{formData.regionId !== null && regionIndex >= 0 ? regions[regionIndex].name : '请选择所在区域'}}
            </view>
          </picker>
        </view>
        <text wx:if="{{errors.regionId}}" class="error-text">{{errors.regionId}}</text>
      </view>
 
      <!-- 教育背景 -->
      <view class="form-item {{errors.education ? 'error' : ''}}">
        <text class="label">教育背景</text>
        <view class="input-wrapper">
          <picker 
            class="picker" 
            mode="selector" 
            range="{{educationOptions}}" 
            value="{{educationIndex}}"
            bindchange="onEducationChange"
          >
            <view class="picker-text {{!formData.education ? 'placeholder' : ''}}">
              {{formData.education || '请选择教育背景'}}
            </view>
          </picker>
        </view>
        <text wx:if="{{errors.education}}" class="error-text">{{errors.education}}</text>
      </view>
 
      <!-- 简介 -->
      <view class="form-item vertical-layout {{errors.introduction ? 'error' : ''}}">
        <text class="label">简介</text>
        <view class="input-wrapper">
          <textarea 
            class="textarea" 
            placeholder-class="placeholder-class"
            placeholder="请简要介绍自己的背景、技能和经验"
            value="{{formData.introduction}}"
            data-field="introduction"
            bindinput="onInputChange"
            maxlength="500"
          />
        </view>
        <text wx:if="{{errors.introduction}}" class="error-text">{{errors.introduction}}</text>
      </view>
    </view>
 
    <!-- 项目信息卡片 -->
    <view class="card">
      <view class="card-title">项目信息</view>
      <!-- 项目名称 -->
      <view class="form-item {{errors.projectName ? 'error' : ''}}">
        <text class="label required">项目名称</text>
        <view class="input-wrapper">
          <input 
            class="input" 
            placeholder-class="placeholder-class"
            placeholder="请输入项目名称"
            value="{{formData.projectName}}"
            data-field="projectName"
            bindinput="onInputChange"
          />
        </view>
        <text wx:if="{{errors.projectName}}" class="error-text">{{errors.projectName}}</text>
      </view>
 
      <!-- 项目描述 -->
      <view class="form-item vertical-layout {{errors.description ? 'error' : ''}}">
        <text class="label required">项目描述</text>
        <view class="input-wrapper">
          <textarea 
            class="textarea" 
            placeholder-class="placeholder-class"
            placeholder="请详细描述您的项目内容、目标和特色"
            value="{{formData.description}}"
            data-field="description"
            bindinput="onInputChange"
            maxlength="1000"
          />
        </view>
        <text wx:if="{{errors.description}}" class="error-text">{{errors.description}}</text>
      </view>
    </view>
 
    <!-- 附件资料卡片 -->
    <view class="card">
      <view class="card-title">附件资料</view>
      <view class="attachment-upload-area">
        <!-- 附件列表 -->
        <view wx:if="{{attachments.length > 0}}" class="attachment-list">
          <view wx:for="{{attachments}}" wx:key="id" class="attachment-item">
            <view class="attachment-info">
              <view class="attachment-icon">
                <text wx:if="{{item.type === 'image'}}">🖼️</text>
                <text wx:elif="{{item.type === 'video'}}">🎬</text>
                <text wx:elif="{{item.type === 'pdf'}}">📄</text>
                <text wx:elif="{{item.type === 'word'}}">📝</text>
                <text wx:else>📎</text>
              </view>
              <view class="attachment-details">
                <text class="attachment-name">{{item.name}}</text>
                <text class="attachment-size">{{item.sizeText}}</text>
              </view>
            </view>
            <view class="attachment-actions">
              <text class="delete-btn" bindtap="onDeleteAttachment" data-index="{{index}}">删除</text>
            </view>
          </view>
        </view>
        
        <!-- 上传按钮 -->
        <view wx:if="{{attachments.length < maxAttachments}}" class="upload-btn" bindtap="onChooseAttachment">
          <view class="upload-icon">📎</view>
          <text class="upload-text">添加附件</text>
          <view class="upload-hint">
            支持视频/图片/PDF/Word等,最多{{maxAttachments}}个
          </view>
        </view>
      </view>
      <text wx:if="{{errors.attachments}}" class="error-text" style="padding: 0 30rpx 30rpx;">{{errors.attachments}}</text>
    </view>
  </view>
 
  <!-- 底部操作栏 -->
  <view class="bottom-actions">
    <button class="submit-btn {{(isSubmitting || submitDisabled) ? 'disabled' : ''}}" bindtap="onSubmit" disabled="{{isSubmitting || submitDisabled}}">
      {{isSubmitting ? '提交中...' : submitText}}
    </button>
  </view>
</view>