feat: login rest

This commit is contained in:
Blizzard
2026-02-12 09:26:39 +08:00
parent e97fd30fa3
commit 5553e2711a
115 changed files with 4090 additions and 3499 deletions
+62 -119
View File
@@ -32,14 +32,69 @@
<view class="detail-content">
<!-- Custom Tabs -->
<view class="pd-tabs">
<view class="pd-tab-btn {{activeTab === 'info' ? 'active' : ''}}" bindtap="switchTab" data-tab="info">
基础档案
</view>
<view class="pd-tab-btn {{activeTab === 'care' ? 'active' : ''}}" bindtap="switchTab" data-tab="care">
养护记录
</view>
<view class="pd-tab-btn {{activeTab === 'archive' ? 'active' : ''}}" bindtap="switchTab" data-tab="archive">
植物档案
<view class="pd-tab-btn {{activeTab === 'growth' ? 'active' : ''}}" bindtap="switchTab" data-tab="growth">
成长档案
</view>
</view>
<!-- Info Tab Scroll View -->
<scroll-view
scroll-y="{{!showGrowthModal}}"
class="pd-content"
enhanced="{{true}}"
show-scrollbar="{{false}}"
hidden="{{activeTab !== 'info'}}"
>
<view class="archive-view fadeIn">
<view class="archive-identity-card">
<view class="aic-header">
<view class="aic-badge">🏆 元老级植物</view>
<view class="aic-location">
<t-icon name="location" size="28rpx" color="#388E3C" />
<text>{{currentPlant.location || '位置未定'}}</text>
</view>
</view>
<view class="aic-stats">
<view class="aic-stat-item">
<text class="label">入家时间</text>
<text class="value">{{currentPlant.adoptionDate || '未知'}}</text>
</view>
<view class="aic-stat-item">
<text class="label">入住天数</text>
<text class="value">{{currentPlant.daysPlanted}} 天</text>
</view>
</view>
<!-- New detail fields -->
<view class="aic-extra-info">
<view wx:if="{{currentPlant.potMaterial}}" class="aic-info-row">
<text class="label">花园材质:</text>
<text class="value">{{currentPlant.potMaterial}}</text>
</view>
<view wx:if="{{currentPlant.potSize}}" class="aic-info-row">
<text class="label">花园大小:</text>
<text class="value">{{currentPlant.potSize}}</text>
</view>
<view wx:if="{{currentPlant.sunlight}}" class="aic-info-row">
<text class="label">光照条件:</text>
<text class="value">{{currentPlant.sunlight}}</text>
</view>
<view wx:if="{{currentPlant.plantingMaterial}}" class="aic-info-row">
<text class="label">植料土壤:</text>
<text class="value">{{currentPlant.plantingMaterial}}</text>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- Care Tab Scroll View -->
<scroll-view
scroll-y="{{!showGrowthModal}}"
@@ -91,58 +146,15 @@
</view>
</scroll-view>
<!-- Archive Tab Scroll View -->
<!-- Growth Tab Scroll View -->
<scroll-view
scroll-y="{{!showGrowthModal}}"
class="pd-content"
enhanced="{{true}}"
show-scrollbar="{{false}}"
hidden="{{activeTab !== 'archive'}}"
hidden="{{activeTab !== 'growth'}}"
>
<view class="archive-view fadeIn">
<view class="archive-identity-card">
<view class="aic-header">
<view class="aic-badge">🏆 元老级植物</view>
<view class="aic-location">
<t-icon name="location" size="28rpx" color="#388E3C" />
<text>{{currentPlant.location || '位置未定'}}</text>
</view>
</view>
<view class="aic-stats">
<view class="aic-stat-item">
<text class="label">入家时间</text>
<text class="value">{{currentPlant.adoptionDate || '未知'}}</text>
</view>
<view class="aic-stat-item">
<text class="label">入住天数</text>
<text class="value">{{currentPlant.daysPlanted}} 天</text>
</view>
<view class="aic-stat-item">
<text class="label">养护次数</text>
<text class="value">{{careLogs.length || 0}} 次</text>
</view>
</view>
<!-- New detail fields -->
<view class="aic-extra-info">
<view wx:if="{{currentPlant.potMaterial}}" class="aic-info-row">
<text class="label">花园材质:</text>
<text class="value">{{currentPlant.potMaterial}}</text>
</view>
<view wx:if="{{currentPlant.potSize}}" class="aic-info-row">
<text class="label">花园大小:</text>
<text class="value">{{currentPlant.potSize}}</text>
</view>
<view wx:if="{{currentPlant.sunlight}}" class="aic-info-row">
<text class="label">光照条件:</text>
<text class="value">{{currentPlant.sunlight}}</text>
</view>
<view wx:if="{{currentPlant.plantingMaterial}}" class="aic-info-row">
<text class="label">植料土壤:</text>
<text class="value">{{currentPlant.plantingMaterial}}</text>
</view>
</view>
</view>
<view class="section-header">
<text class="h3">成长记录</text>
@@ -166,11 +178,11 @@
<text>{{item.title}}</text>
</view>
<text class="timeline-desc">{{item.content}}</text>
<t-image
<image
wx:if="{{item.image}}"
src="{{item.image}}"
mode="widthFix"
width="100%"
mode="aspectFill"
style="width: 220rpx; height: 220rpx; border-radius: 16rpx; margin-top: 16rpx;"
class="timeline-img"
bindtap="handlePreviewRecordImage"
data-src="{{item.image}}"
@@ -196,74 +208,5 @@
</scroll-view>
</view>
<!-- Growth Record Popup -->
<t-popup visible="{{showGrowthModal}}" bind:visible-change="onGrowthPopupVisibleChange" placement="center" prevent-scroll-through>
<view class="edit-modal">
<view class="modal-header" catchtouchmove="preventTouchMove">
<text class="modal-title">添加成长记录</text>
<view class="close-btn" bindtap="closeGrowthModal">
<t-icon name="close" size="40rpx" color="#666" />
</view>
</view>
<view class="modal-body">
<!-- Record Type -->
<view class="form-group">
<text class="form-label">记录类型</text>
<view class="chip-group">
<view class="chip {{newRecordType === 'growth' ? 'active' : ''}}" bindtap="setRecordTypeByTap" data-type="growth">
<t-icon name="thumb-up" size="28rpx" />
<text>生长</text>
</view>
<view class="chip {{newRecordType === 'repot' ? 'active' : ''}}" bindtap="setRecordTypeByTap" data-type="repot">
<t-icon name="swap" size="28rpx" />
<text>换盆</text>
</view>
<view class="chip {{newRecordType === 'pest' ? 'active' : ''}}" bindtap="setRecordTypeByTap" data-type="pest">
<t-icon name="error-circle" size="28rpx" />
<text>病虫害</text>
</view>
<view class="chip {{newRecordType === 'other' ? 'active' : ''}}" bindtap="setRecordTypeByTap" data-type="other">
<t-icon name="file" size="28rpx" />
<text>其他</text>
</view>
</view>
</view>
<!-- Content -->
<view class="form-group">
<text class="form-label">备注</text>
<textarea
class="form-textarea"
placeholder="记录这一刻的变化..."
value="{{newRecordContent}}"
bindinput="onRecordContentInput"
auto-height
/>
</view>
<!-- Image Upload -->
<view class="form-group">
<text class="form-label">添加照片</text>
<view class="record-image-upload">
<view wx:if="{{newRecordImage}}" class="uploaded-image-box">
<t-image src="{{newRecordImage}}" mode="aspectFill" width="160rpx" height="160rpx" shape="round" />
<view class="remove-img-btn" bindtap="handleRemoveRecordImage">
<t-icon name="close" size="24rpx" color="#FFF" />
</view>
</view>
<view wx:else class="upload-add-btn" bindtap="handleChooseRecordImage">
<t-icon name="add" size="48rpx" color="#999" />
</view>
</view>
</view>
</view>
<view class="modal-footer" catchtouchmove="preventTouchMove">
<view class="submit-btn" bindtap="handleAddRecord">
<text>保存记录</text>
</view>
</view>
</view>
</t-popup>
</view>