From bec58fa7fe4fae2deac88200d8d939e12ec8a08f Mon Sep 17 00:00:00 2001 From: lrj <owen.stl@gmail.com> Date: 星期五, 03 十月 2025 22:26:39 +0800 Subject: [PATCH] 修复小程序WXS日期显示问题并重新设计【我的】页面 --- wx/pages/registration/registration.wxml | 235 +++++++++++++++++++++------------------------------------- 1 files changed, 85 insertions(+), 150 deletions(-) diff --git a/wx/pages/registration/registration.wxml b/wx/pages/registration/registration.wxml index 5722221..80cd8a8 100644 --- a/wx/pages/registration/registration.wxml +++ b/wx/pages/registration/registration.wxml @@ -6,31 +6,38 @@ <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="card"> + <view class="card-title">涓汉淇℃伅</view> - <!-- 鍩烘湰淇℃伅 --> - <view class="form-section"> - <view class="section-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" /> - <text wx:if="{{errors.name}}" class="error-text">{{errors.name}}</text> </view> + <text wx:if="{{errors.name}}" class="error-text">{{errors.name}}</text> </view> <!-- 鎵嬫満鍙� --> @@ -38,27 +45,21 @@ <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> + <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> - <text wx:if="{{errors.phone}}" class="error-text">{{errors.phone}}</text> </view> + <text wx:if="{{errors.phone}}" class="error-text">{{errors.phone}}</text> </view> <!-- 鎬у埆 --> @@ -72,12 +73,12 @@ value="{{genderIndex}}" bindchange="onGenderChange" > - <view class="picker-text"> + <view class="picker-text {{formData.gender === null ? 'placeholder' : ''}}"> {{formData.gender !== null ? genderOptions[formData.gender] : '璇烽�夋嫨鎬у埆'}} </view> </picker> - <text wx:if="{{errors.gender}}" class="error-text">{{errors.gender}}</text> </view> + <text wx:if="{{errors.gender}}" class="error-text">{{errors.gender}}</text> </view> <!-- 鐢熸棩 --> @@ -91,12 +92,12 @@ bindchange="onBirthDateChange" end="{{today}}" > - <view class="picker-text"> + <view class="picker-text {{!formData.birthDate ? 'placeholder' : ''}}"> {{formData.birthDate || '璇烽�夋嫨鐢熸棩'}} </view> </picker> - <text wx:if="{{errors.birthDate}}" class="error-text">{{errors.birthDate}}</text> </view> + <text wx:if="{{errors.birthDate}}" class="error-text">{{errors.birthDate}}</text> </view> <!-- 鎵�鍦ㄥ尯鍩� --> @@ -111,12 +112,12 @@ value="{{regionIndex}}" bindchange="onRegionChange" > - <view class="picker-text"> + <view class="picker-text {{formData.regionId === null ? 'placeholder' : ''}}"> {{formData.regionId !== null && regionIndex >= 0 ? regions[regionIndex].name : '璇烽�夋嫨鎵�鍦ㄥ尯鍩�'}} </view> </picker> - <text wx:if="{{errors.regionId}}" class="error-text">{{errors.regionId}}</text> </view> + <text wx:if="{{errors.regionId}}" class="error-text">{{errors.regionId}}</text> </view> <!-- 鏁欒偛鑳屾櫙 --> @@ -130,134 +131,76 @@ value="{{educationIndex}}" bindchange="onEducationChange" > - <view class="picker-text"> + <view class="picker-text {{!formData.education ? 'placeholder' : ''}}"> {{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銆丳NG銆乄ebP鏍煎紡锛屽缓璁昂瀵�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> + <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> - <textarea - class="textarea" - placeholder="璇风畝瑕佷粙缁嶈嚜宸辩殑鑳屾櫙銆佹妧鑳藉拰缁忛獙" - value="{{formData.introduction}}" - data-field="introduction" - bindinput="onInputChange" - maxlength="500" - /> + <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="form-section"> - <view class="section-title">涓汉浠嬬粛</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" /> - <text wx:if="{{errors.projectName}}" class="error-text">{{errors.projectName}}</text> </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> - <textarea - class="textarea" - placeholder="璇疯缁嗘弿杩版偍鐨勯」鐩唴瀹广�佺洰鏍囧拰鐗硅壊" - value="{{formData.description}}" - data-field="description" - bindinput="onInputChange" - maxlength="1000" - /> + <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="form-section vertical-layout"> - <view class="section-title">闄勪欢璧勬枡</view> - <view class="section-subtitle">鏀寔涓婁紶鐩稿叧璧勬枡锛屾渶澶�8涓枃浠�</view> - - <!-- 涓婁紶鎸夐挳 --> + <!-- 闄勪欢璧勬枡鍗$墖 --> + <view class="card"> + <view class="card-title">闄勪欢璧勬枡</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)銆丳DF銆乄ord绛夋枃妗� - </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 wx:for="{{attachments}}" wx:key="id" class="attachment-item"> <view class="attachment-info"> <view class="attachment-icon"> <text wx:if="{{item.type === 'image'}}">馃柤锔�</text> @@ -269,39 +212,31 @@ <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 && item.uploaded}}" class="action-btn preview" bindtap="onPreviewAttachment" data-index="{{index}}">棰勮</text> - <text wx:if="{{!item.uploading}}" class="action-btn delete" bindtap="onDeleteAttachment" data-index="{{index}}">鍒犻櫎</text> + <text class="delete-btn" bindtap="onDeleteAttachment" data-index="{{index}}">鍒犻櫎</text> </view> </view> </view> - <!-- 闄勪欢鏁伴噺鎻愮ず --> - <view wx:if="{{attachments.length > 0}}" class="attachment-count"> - 宸蹭笂浼� {{attachments.length}}/8 涓枃浠� + <!-- 涓婁紶鎸夐挳 --> + <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">{{errors.attachments}}</text> - </view> - - <!-- 搴曢儴鎿嶄綔鏍� --> - <view class="bottom-actions"> - <view class="submit-btn {{submitting ? 'disabled' : ''}}" bindtap="onSubmit"> - {{submitting ? '鎻愪氦涓�...' : '鎻愪氦鎶ュ悕'}} - </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> \ No newline at end of file -- Gitblit v1.8.0