feat: 后端版本迁移修改

This commit is contained in:
Blizzard
2026-05-24 01:38:28 +08:00
parent 058a575e10
commit f8d71ee800
29 changed files with 304 additions and 291 deletions
+7 -4
View File
@@ -24,10 +24,13 @@ Page({
this.classifyPlant(imagePath);
},
classifyPlant(filePath) {
async classifyPlant(filePath) {
this.setData({ isLoading: true, hasError: false });
request.uploadToUrl('/classify/plant', filePath, 'file').then(res => {
try {
// Directly upload file to classify endpoint without uploading to MinIO file service
const res = await request.uploadToUrl('/plant/classify/plant', filePath);
const results = res.result || [];
// Map results with percentage scores
@@ -46,10 +49,10 @@ Page({
topResult: mappedResults.length > 0 ? mappedResults[0] : null,
isLoading: false
});
}).catch(err => {
} catch (err) {
console.error('Classify failed', err);
this.setData({ isLoading: false, hasError: true });
});
}
},
// Retry identification
+1
View File
@@ -6,6 +6,7 @@
<view class="state-card">
<view class="loading-image-wrap">
<image src="{{imagePath}}" mode="aspectFill" class="loading-preview" bindtap="previewImage" />
<view class="scan-overlay"></view>
<view class="scan-line"></view>
</view>
<view class="loading-info">
+25 -8
View File
@@ -44,21 +44,38 @@
display: block;
}
/* Scan line animation */
/* Scan overlay breathing effect */
.scan-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(180deg, rgba(85, 139, 47, 0) 30%, rgba(85, 139, 47, 0.15) 100%);
animation: pulseBg 2s ease-in-out infinite alternate;
pointer-events: none;
}
@keyframes pulseBg {
0% { opacity: 0.2; }
100% { opacity: 0.65; }
}
/* Premium neon scan line animation */
.scan-line {
position: absolute;
left: 0;
right: 0;
height: 4rpx;
background: linear-gradient(90deg, transparent, #558B2F, transparent);
animation: scan 2s ease-in-out infinite;
box-shadow: 0 0 16rpx rgba(85, 139, 47, 0.5);
height: 8rpx;
background: linear-gradient(90deg, rgba(85, 139, 47, 0) 0%, rgba(139, 195, 74, 1) 50%, rgba(85, 139, 47, 0) 100%);
animation: scan 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
box-shadow: 0 0 20rpx rgba(139, 195, 74, 0.9), 0 0 40rpx rgba(85, 139, 47, 0.5);
}
@keyframes scan {
0% { top: 0; }
50% { top: 100%; }
100% { top: 0; }
0% { top: 0%; opacity: 0.8; }
50% { top: 98%; opacity: 1; }
100% { top: 0%; opacity: 0.8; }
}
.loading-info {