lrj
昨天 9f8395fab13ca4b230a0f7d62636e209745c91d4
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!--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 wx:if="{{activity}}" class="activity-info">
      <text class="activity-title">{{activity.name}}</text>
      <text class="activity-desc">{{activity.description}}</text>
    </view>
 
    <!-- 基本信息 -->
    <view class="form-section">
      <view class="section-title">基本信息</view>
      
      <!-- 姓名 -->
      <view class="form-item {{errors.name ? 'error' : ''}}">
        <text class="label required">姓名</text>
        <view class="input-wrapper">
          <input 
            class="input" 
            placeholder="请输入真实姓名"
            value="{{formData.name}}"
            data-field="name"
            bindinput="onInputChange"
          />
          <text wx:if="{{errors.name}}" class="error-text">{{errors.name}}</text>
        </view>
      </view>
 
      <!-- 手机号 -->
      <view class="form-item {{errors.phone ? 'error' : ''}}">
        <text class="label required">手机号</text>
        <view class="input-wrapper">
          <view class="phone-container">
            <view class="phone-display {{!formData.phone ? 'placeholder' : ''}}">
              {{formData.phone || '点击授权获取手机号'}}
            </view>
            <button 
              class="phone-auth-btn" 
              open-type="getPhoneNumber" 
              bindgetphonenumber="onGetPhoneNumber"
              wx:if="{{!formData.phone}}"
            >
              授权获取
            </button>
            <button 
              class="phone-change-btn" 
              bindtap="onClearPhone"
              wx:else
            >
              重新获取
            </button>
          </view>
          <text wx:if="{{errors.phone}}" class="error-text">{{errors.phone}}</text>
        </view>
      </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 ? genderOptions[formData.gender] : '请选择性别'}}
            </view>
          </picker>
          <text wx:if="{{errors.gender}}" class="error-text">{{errors.gender}}</text>
        </view>
      </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 || '请选择生日'}}
            </view>
          </picker>
          <text wx:if="{{errors.birthDate}}" class="error-text">{{errors.birthDate}}</text>
        </view>
      </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 && regionIndex >= 0 ? regions[regionIndex].name : '请选择所在区域'}}
            </view>
          </picker>
          <text wx:if="{{errors.regionId}}" class="error-text">{{errors.regionId}}</text>
        </view>
      </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 || '请选择教育背景'}}
            </view>
          </picker>
          <text wx:if="{{errors.education}}" class="error-text">{{errors.education}}</text>
        </view>
      </view>
 
      <!-- 头像上传 -->
      <view class="form-item vertical-layout {{errors.avatar ? 'error' : ''}}">
        <text class="label">头像</text>
        <view class="avatar-upload-container">
          <!-- 未选择状态 -->
          <view wx:if="{{!localAvatarPath && !formData.avatarUrl && !avatarUploading}}" 
                class="avatar-upload-btn" 
                bindtap="onChooseAvatar">
            <text class="upload-icon ic-add"></text>
            <text class="upload-text">点击选择头像</text>
          </view>
          
          <!-- 上传中状态 -->
          <view wx:if="{{avatarUploading}}" class="avatar-upload-btn uploading">
            <view class="avatar-uploading-indicator"></view>
            <text class="upload-text">上传中 {{avatarUploadProgress}}%</text>
            <view class="upload-progress">
              <view class="progress-bar">
                <view class="progress-fill" style="width: {{avatarUploadProgress}}%"></view>
              </view>
            </view>
          </view>
          
          <!-- 已选择状态(本地预览) -->
          <view wx:if="{{localAvatarPath && !avatarUploading}}" class="avatar-preview">
            <image class="avatar-image" src="{{localAvatarPath}}" mode="aspectFill"></image>
            <view class="avatar-actions">
              <text class="action-btn" bindtap="onChooseAvatar">重新选择</text>
              <text class="action-btn delete" bindtap="onDeleteAvatar">删除</text>
            </view>
          </view>
          
          <!-- 已上传状态(服务器图片) -->
          <view wx:if="{{formData.avatarUrl && !localAvatarPath && !avatarUploading}}" class="avatar-preview">
            <image class="avatar-image" src="{{formData.avatarUrl}}" mode="aspectFill"></image>
            <view class="avatar-actions">
              <text class="action-btn" bindtap="onChooseAvatar">重新选择</text>
              <text class="action-btn delete" bindtap="onDeleteAvatar">删除</text>
            </view>
          </view>
          
          <!-- 提示文字 -->
          <view class="avatar-upload-hint">
            <text wx:if="{{!localAvatarPath && !formData.avatarUrl}}">支持JPG、PNG、WebP格式,建议尺寸200x200以上,文件大小不超过5MB</text>
            <text wx:elif="{{localAvatarPath}}">头像已选择,提交时将自动上传</text>
            <text wx:else>头像上传成功,可重新选择或删除</text>
          </view>
        </view>
        <text wx:if="{{errors.avatar}}" class="error-text">{{errors.avatar}}</text>
      </view>
 
      <!-- 简介 -->
      <view class="form-item vertical-layout {{errors.introduction ? 'error' : ''}}">
        <text class="label">简介</text>
        <textarea 
          class="textarea" 
          placeholder="请简要介绍自己的背景、技能和经验"
          value="{{formData.introduction}}"
          data-field="introduction"
          bindinput="onInputChange"
          maxlength="500"
        />
        <text wx:if="{{errors.introduction}}" class="error-text">{{errors.introduction}}</text>
      </view>
 
    </view>
 
    <!-- 个人介绍 -->
    <view class="form-section">
      <view class="section-title">个人介绍</view>
      
      <!-- 项目名称 -->
      <view class="form-item {{errors.projectName ? 'error' : ''}}">
        <text class="label required">项目名称</text>
        <view class="input-wrapper">
          <input 
            class="input" 
            placeholder="请输入项目名称"
            value="{{formData.projectName}}"
            data-field="projectName"
            bindinput="onInputChange"
          />
          <text wx:if="{{errors.projectName}}" class="error-text">{{errors.projectName}}</text>
        </view>
      </view>
 
      <!-- 项目描述 -->
      <view class="form-item vertical-layout {{errors.description ? 'error' : ''}}">
        <text class="label required">项目描述</text>
        <textarea 
          class="textarea" 
          placeholder="请详细描述您的项目内容、目标和特色"
          value="{{formData.description}}"
          data-field="description"
          bindinput="onInputChange"
          maxlength="1000"
        />
        <text wx:if="{{errors.description}}" class="error-text">{{errors.description}}</text>
      </view>
 
    </view>
 
    <!-- 附件上传 -->
    <view class="form-section vertical-layout">
      <view class="section-title">附件资料</view>
      <view class="section-subtitle">支持上传相关资料,最多8个文件</view>
      
      <!-- 上传按钮 -->
      <view class="attachment-upload-area">
        <view wx:if="{{attachments.length < 8}}" class="upload-btn" bindtap="onChooseAttachment">
          <view class="upload-icon">📎</view>
          <text class="upload-text">选择文件</text>
          <view class="upload-hint">
            支持视频(≤200MB)、图片(≤10MB)、PDF、Word等文档
          </view>
        </view>
        
        <!-- 附件列表 -->
        <view wx:if="{{attachments.length > 0}}" class="attachment-list">
          <view wx:for="{{attachments}}" wx:key="index" class="attachment-item {{item.uploading ? 'uploading' : ''}}">
            <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 wx:if="{{item.uploading}}" class="upload-progress">
                  <view class="progress-bar">
                    <view class="progress-fill" style="width: {{item.progress}}%"></view>
                  </view>
                  <text class="progress-text">{{item.progress}}%</text>
                </view>
                <text wx:elif="{{item.uploaded}}" class="upload-status success">上传成功</text>
                <text wx:elif="{{item.error}}" class="upload-status error">{{item.error}}</text>
              </view>
            </view>
            <view class="attachment-actions">
              <text wx:if="{{!item.uploading}}" class="action-btn delete" bindtap="onDeleteAttachment" data-index="{{index}}">删除</text>
            </view>
          </view>
        </view>
        
        <!-- 附件数量提示 -->
        <view wx:if="{{attachments.length > 0}}" class="attachment-count">
          已上传 {{attachments.length}}/8 个文件
        </view>
      </view>
      
      <text wx:if="{{errors.attachments}}" class="error-text">{{errors.attachments}}</text>
    </view>
 
    <!-- 底部操作栏 -->
    <view class="bottom-actions">
      <view class="submit-btn {{submitting ? 'disabled' : ''}}" bindtap="onSubmit">
        {{submitting ? '提交中...' : '提交报名'}}
      </view>
    </view>
  </view>
 
 
</view>