This commit is contained in:
Felix
2025-11-30 19:18:39 +08:00
parent 560ca94fc4
commit 766c0400e6
9 changed files with 137 additions and 71 deletions

View File

@@ -0,0 +1 @@
{"containers":[],"config":{}}

View File

@@ -230,12 +230,10 @@ Page({
// maxWidth: 1200,
// maxHeight: 1200
// })
// console.log('图片压缩完成:', compressedImagePath)
// const result = await apiManager.uploadImage(compressedImagePath)
const result = await apiManager.uploadImage(this.data.imagePath)
// console.log('识别结果:', result)
// 验证识别结果的数据结构
if (!result) {

View File

@@ -42,6 +42,7 @@ Page({
facePosition: 'normal' as 'up' | 'down' | 'normal',
// SVG data for avatar
avatarSvgData: '',
paperSvgData: '',
photoSvgData: '',
scrollTop: 0
},
@@ -690,11 +691,12 @@ Page({
this.setData({ isProcessing: true })
wx.showLoading({ title: '准备选择图片...' })
const imagePath = await imageManager.chooseFromAlbum({
quality: 80,
maxWidth: 1920,
maxHeight: 1920
})
// const imagePath = await imageManager.chooseFromAlbum({
// quality: 80,
// maxWidth: 1920,
// maxHeight: 1920
// })
const imagePath = await imageManager.chooseFromAlbum()
wx.hideLoading()
console.log('选择图片成功:', imagePath)

View File

@@ -114,15 +114,16 @@
</view>
</view>
</view> -->
<view class="card-wrapper">
<!-- <view class="card-wrapper">
<view class="card-normal">
<image class="card-image" src="/static/sun-2.png" />
</view>
<view class="card-ascii">
<view class="aurora-wrapper">
<view class="aurora"></view>
</view>
</view> -->
<!-- <view class="card-ascii">
<view class="ascii-content">
// compiled preview • scanner demo /* generated for visual effect
not executed */ const SCAN_WIDTH = 8; const FADE_ZONE = 35; cons
t MAX_PARTICLES = 2500; const TRANSITION = 0.05; function clamp(n,
MAX_PARTICLES = 2500; const TRANSITION = 0.05; function clamp(n,
a, b) { return Math.max(a, Math.min(b, n)); } function lerp(a, b,
t) { return a + (b - a) * t; } const now = () => performance.now(
); function rng(min, max) { return Math.random() * (max - min) + m
@@ -140,8 +141,8 @@ glow: 3.5, }; function drawParticle(ctx, p) { ctx.globalAlpha = cl
amp(p.a, 0, 1); ctx.drawImage(gradient, p.x - p.r, p.y - p.r, p.r
* 2, p.r * 2); } function tick(t)
</view>
</view>
<view class="scanner"></view>
</view>
</view> -->
<!-- <view class="scanner"></view> -->
<!-- </view> -->
</view>
</view>

View File

@@ -1163,15 +1163,13 @@ position:relative;
left: 0;
width: 100%;
height: 100%;
border-radius: 16rpx;
clip-path: inset(30% 0 0 0);
/* clip-path: inset(0 0 30% 0); */
}
.card-image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 15px;
transition: all 0.3s ease;
filter: brightness(1.1) contrast(1.1);
box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
@@ -1185,7 +1183,6 @@ position:relative;
left: 0;
width: 100%;
height: 100%;
border-radius: 16rpx;
overflow: hidden;
}
@@ -1195,8 +1192,6 @@ position:relative;
left: 0;
width: 100%;
height: 100%;
color: rgba(220, 210, 255, 0.6);
font-family: "Courier New", monospace;
font-size: 36rpx;
overflow: hidden;
white-space: pre;
@@ -1206,28 +1201,31 @@ position:relative;
text-align: left;
vertical-align: top;
box-sizing: border-box;
clip-path: inset(0 0 30% 0);
clip-path: inset(70% 0 0 0);
/* mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 30%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.4) 80%, rgba(0, 0, 0, 0.2) 100%); */
mask-image: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0.2) 100%);
background: linear-gradient(#eee, #ccc);
}
.scanner {
/* .scanner {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4rpx;
/* background: linear-gradient(90deg, transparent, #74b9ff, transparent);
background: linear-gradient(90deg, transparent, #74b9ff, transparent);
box-shadow: 0 0 16rpx #74b9ff, 0 0 60px #74b9ff;
border-radius: 8rpx;
opacity: 0;
transition: transform 0s linear, opacity 0.3s ease; */
transition: transform 0s linear, opacity 0.3s ease;
animation: scan-animation 3s linear infinite;
background: linear-gradient(180deg, transparent 89%, rgba(0, 255, 255, 0.5) 1%, transparent);
border-radius: 20rpx;
animation: scan-animation 5s infinite;
background-size: 200% 200%;
box-shadow: inset 0 0px 15rpx 1rpx cyan;
/* animation: scan-animation 3s linear infinite; */
z-index: 3;
}
@@ -1240,4 +1238,50 @@ position: absolute;
top: 100%;
opacity: 0.9;
}
} */
.aurora-wrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.9;
background: #272727;
}
.aurora{
position: absolute;
top: 300px;
width: 50vw;
height: 50px;
background: #D5D8FF;
filter: blur(40px);
border-radius: 50%;
animation-name: aurora-float;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
/* transform: translate(20%, 0); */
}
.aurora:nth-child(1) {
background: #D5A3E5;
}
.aurora:nth-child(2) {
background: #FDB5F0;
}
.aurora:nth-child(3) {
background: #F5838E;
}
.aurora:nth-child(4) {
background: #F0D9B6;
}
@keyframes aurora-float {
0% { transform: translateX(10vw) scale(1.2); }
50% { transform: translateX(32vw) scale(1.4); }
100% { transform: translateX(10vw) scale(1.2); }
}

58
package-lock.json generated
View File

@@ -8,12 +8,58 @@
"name": "miniprogram-ts-less-quickstart",
"version": "25.9.10",
"dependencies": {
"cos-wx-sdk-v5": "^1.8.0",
"tdesign-miniprogram": "^1.11.2"
},
"devDependencies": {
"miniprogram-api-typings": "^2.8.3-1"
}
},
"node_modules/cos-wx-sdk-v5": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/cos-wx-sdk-v5/-/cos-wx-sdk-v5-1.8.0.tgz",
"integrity": "sha512-CP4TKANIX5KvN6fjkPrFhdEfXjyBSExwBemRr2Ofa7ObN+Z8S62/eo6/d0WVKxSbneoPaXJzkf4AwZz7HOQXXg==",
"hasInstallScript": true,
"license": "ISC",
"dependencies": {
"fast-xml-parser": "4.5.0",
"mime": "^2.4.6"
}
},
"node_modules/fast-xml-parser": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz",
"integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
},
{
"type": "paypal",
"url": "https://paypal.me/naturalintelligence"
}
],
"license": "MIT",
"dependencies": {
"strnum": "^1.0.5"
},
"bin": {
"fxparser": "src/cli/cli.js"
}
},
"node_modules/mime": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
"license": "MIT",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/miniprogram-api-typings": {
"version": "2.12.0",
"resolved": "https://registry.npmjs.org/miniprogram-api-typings/-/miniprogram-api-typings-2.12.0.tgz",
@@ -21,6 +67,18 @@
"dev": true,
"license": "MIT"
},
"node_modules/strnum": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz",
"integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"license": "MIT"
},
"node_modules/tdesign-miniprogram": {
"version": "1.11.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/tdesign-miniprogram/-/tdesign-miniprogram-1.11.2.tgz",

View File

@@ -10,6 +10,7 @@
"miniprogram-api-typings": "^2.8.3-1"
},
"dependencies": {
"cos-wx-sdk-v5": "^1.8.0",
"tdesign-miniprogram": "^1.11.2"
}
}

View File

@@ -46,7 +46,7 @@
"tabIndent": "insertSpaces",
"tabSize": 2
},
"libVersion": "3.9.3",
"libVersion": "3.11.3",
"packOptions": {
"ignore": [],
"include": []

View File

@@ -16,48 +16,9 @@
"showES6CompileOption": false,
"bigPackageSizeSupport": true,
"checkInvalidKey": true,
"ignoreDevUnusedFiles": true
"ignoreDevUnusedFiles": true,
"skylineRenderEnable": true
},
"libVersion": "3.11.3",
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/upload/upload",
"pathName": "pages/upload/upload",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/coupon/coupon",
"pathName": "pages/coupon/coupon",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/result/result",
"query": "imagePath=http://tmp/Jg3M9pJYPJdd9ab131e406bc48acb9ed4069809fd559.png",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/assessment/assessment",
"query": "imageId=2089419112290844672",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/analyze/analyze",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
}
"condition": {}
}