From 3c6218616c1f55516e7797af4d568b59f6e49724 Mon Sep 17 00:00:00 2001 From: R524809 Date: Tue, 30 Sep 2025 16:27:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/shape-card/shape-card.less | 82 ++++++++++++------- .../components/shape-card/shape-card.wxml | 32 ++++---- .../components/word-card/word-card.less | 12 +-- .../components/word-input/word-input.less | 18 +--- .../components/word-input/word-input.wxml | 11 +-- miniprogram/pages/index/index.less | 72 ++++++++++++++-- miniprogram/pages/index/index.wxml | 22 +++-- miniprogram/pages/shape/index.less | 59 +++++++++++-- miniprogram/pages/shape/index.wxml | 16 +++- miniprogram/ui/button/button.less | 9 +- miniprogram/ui/button/button.wxs | 3 + 11 files changed, 238 insertions(+), 98 deletions(-) diff --git a/miniprogram/components/shape-card/shape-card.less b/miniprogram/components/shape-card/shape-card.less index 9ee0e7c..8e6e150 100644 --- a/miniprogram/components/shape-card/shape-card.less +++ b/miniprogram/components/shape-card/shape-card.less @@ -1,43 +1,69 @@ .shape-card { position: relative; - width: 186rpx; - // height: 260rpx; - border-radius: 16rpx; - background: #ffffff; - border: 1rpx solid #e8e8e8; - box-shadow: 0rpx 16rpx 24rpx rgba(184, 210, 188, 0.3); + width: 100%; + height: 184rpx; + background: #FFFFFF; + border-radius: 24rpx; + border: 2rpx solid #E8E8E8; display: flex; - flex-direction: column; align-items: center; justify-content: center; - padding: 16rpx 0; - box-sizing: border-box; + transition: all 0.2s ease-in-out; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); - .shape-card-img { - width: 140rpx; - height: 140rpx; - display: block; + &:active { + transform: scale(0.95); + box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1); } - .divider { - width: 150rpx; - height: 1rpx; - background-color: #ddd; - margin-block: 16rpx; - } - - .shape-color { - width: 60rpx; - height: 60rpx; + .color-box { + position: absolute; + top: 24rpx; + left: 24rpx; + width: 42rpx; + height: 42rpx; border-radius: 50%; - border: 1rpx solid #141414; - background-color: skyblue; + border: 4rpx solid #FFFFFF; + box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1); + } + + .shape-box { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + + .shape-card-img { + width: 140rpx; + height: 140rpx; + display: block; + } } .delete-icon { position: absolute; - top: -16rpx; - right: -16rpx; - color: #ff0000; + top: -12rpx; + right: -12rpx; + width: 46rpx; + height: 46rpx; + background: #FF4757; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + font-size: 32rpx; + font-weight: bold; + box-shadow: 0 2rpx 6rpx rgba(255, 71, 87, 0.3); + transition: all 0.2s ease-in-out; + + &:active { + transform: scale(0.9); + } + + .delete-icon-inner { + color: #FFFFFF !important; + } } } \ No newline at end of file diff --git a/miniprogram/components/shape-card/shape-card.wxml b/miniprogram/components/shape-card/shape-card.wxml index dd9873c..6892e94 100644 --- a/miniprogram/components/shape-card/shape-card.wxml +++ b/miniprogram/components/shape-card/shape-card.wxml @@ -1,18 +1,20 @@ - - - + class="color-box" + style="background-color: {{ fillColor }};" + bind:tap="onColorTap"> + + + + + + diff --git a/miniprogram/components/word-card/word-card.less b/miniprogram/components/word-card/word-card.less index 547b730..821569d 100644 --- a/miniprogram/components/word-card/word-card.less +++ b/miniprogram/components/word-card/word-card.less @@ -1,7 +1,7 @@ .word-card { position: relative; width: 100%; - height: 200rpx; + height: 172rpx; // 高度略缩小 background: #FFFFFF; border-radius: 24rpx; border: 2rpx solid #E8E8E8; @@ -20,8 +20,8 @@ position: absolute; top: 24rpx; left: 24rpx; - width: 40rpx; - height: 40rpx; + width: 42rpx; + height: 42rpx; border-radius: 50%; border: 4rpx solid #FFFFFF; box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1); @@ -35,7 +35,7 @@ height: 100%; .word-content { - font-size: 72rpx; + font-size: 64rpx; // 字号略缩小 font-weight: 600; color: #141414; text-align: center; @@ -46,8 +46,8 @@ position: absolute; top: -12rpx; right: -12rpx; - width: 40rpx; - height: 40rpx; + width: 46rpx; + height: 46rpx; background: #FF4757; border-radius: 50%; display: flex; diff --git a/miniprogram/components/word-input/word-input.less b/miniprogram/components/word-input/word-input.less index de68287..299580b 100644 --- a/miniprogram/components/word-input/word-input.less +++ b/miniprogram/components/word-input/word-input.less @@ -5,10 +5,12 @@ border-radius: 20rpx; background-color: #f8f8f8; align-items: center; + border: 1rpx solid #e0e0e0; + // box-shadow: 0 0rpx 4rpx rgba(0, 0, 0, 0.5); .word-input-icon { // border: 1px solid red; - padding: 22rpx; + padding: 0 22rpx; } .word-input { @@ -21,20 +23,6 @@ } .btn-word-add { - box-sizing: border-box; - display: inline-flex; - align-items: center; - justify-content: center; - height: 72rpx; - padding: 0 24rpx; - background: rgba(255, 215, 25, 1); - border-radius: 20rpx; - font-size: 28rpx; - color: #fff; margin-right: 10rpx; - - &.active { - background-color: rgba(255, 215, 25, 0.8); - } } } \ No newline at end of file diff --git a/miniprogram/components/word-input/word-input.wxml b/miniprogram/components/word-input/word-input.wxml index 94a1363..404fd10 100644 --- a/miniprogram/components/word-input/word-input.wxml +++ b/miniprogram/components/word-input/word-input.wxml @@ -14,11 +14,12 @@ placeholder="{{placeholder}}" bindinput="onInput" bindconfirm="onConfirm" /> - + type="primary" + width="auto" + height="72rpx" + bind:click="onConfirm"> 添加 - + diff --git a/miniprogram/pages/index/index.less b/miniprogram/pages/index/index.less index 232ec23..e094bfb 100644 --- a/miniprogram/pages/index/index.less +++ b/miniprogram/pages/index/index.less @@ -15,7 +15,7 @@ page { .wrapper { background-color: #ffffff; border-radius: 20rpx; - padding: 24rpx; + padding: 36rpx 24rpx; box-shadow: 0 6rpx 8rpx rgba(0, 0, 0, 0.15); margin: 30rpx 0; display: flex; @@ -24,7 +24,7 @@ page { .wrapper-title { font-size: 32rpx; color: #141414; - margin-bottom: 24rpx; + margin-bottom: 36rpx; // 增大标题与内容间距 font-weight: bold; text-align: center; } @@ -34,18 +34,78 @@ page { } .word-card-box { - padding: 34rpx 0; + padding: 38rpx 0; .word-list-empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60rpx 40rpx; text-align: center; - font-size: 28rpx; - color: #999; + + .empty-icon { + width: 120rpx; + height: 120rpx; + background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 32rpx; + box-shadow: 0 4rpx 12rpx rgba(59, 130, 246, 0.15); + + .toy-icon { + font-size: 48rpx; + color: #3b82f6; + } + } + + .empty-title { + font-size: 32rpx; + font-weight: 600; + color: #374151; + margin-bottom: 16rpx; + line-height: 1.4; + } + + .empty-desc { + font-size: 26rpx; + color: #6b7280; + line-height: 1.6; + margin-bottom: 32rpx; + max-width: 400rpx; + } + + .empty-hint { + display: flex; + align-items: center; + background: #f8fafc; + border: 1rpx solid #e2e8f0; + border-radius: 12rpx; + padding: 20rpx 24rpx; + max-width: 500rpx; + + .hint-icon { + font-size: 24rpx; + margin-right: 12rpx; + margin-top: -2rpx; + flex-shrink: 0; + } + + .hint-text { + font-size: 22rpx; + color: #64748b; + line-height: 1.5; + text-align: left; + } + } } .word-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 24rpx; + gap: 38rpx; // 间距从24rpx提升到32rpx } } diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index 98fd9e1..87dc0cd 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -2,11 +2,11 @@ 自定义涂鸦卡 - + + width="200rpx"> 选择文字 @@ -24,14 +24,26 @@ bind:onColorTap="onColorTap" /> - 请选择或输入文字,生成涂鸦卡 + + + + 还没有添加文字 + 请在上方输入文字或点击"选择文字"按钮
开始创建你的涂鸦卡吧!
+ + 💡 + 提示:最多可以同时添加六个文字 +
随机生成 @@ -40,7 +52,7 @@ disabled="{{cardList.length <= 0}}" type="white" bind:click="clearCardList" - width="220rpx" + width="200rpx" icon="clear" icon-class-prefix="toy-icon"> 清空 diff --git a/miniprogram/pages/shape/index.less b/miniprogram/pages/shape/index.less index 7b293e1..60c5b4d 100644 --- a/miniprogram/pages/shape/index.less +++ b/miniprogram/pages/shape/index.less @@ -14,7 +14,7 @@ page { .wrapper { background-color: #fff; border-radius: 20rpx; - padding: 24rpx; + padding: 0 24rpx; box-shadow: 0 6rpx 8rpx rgba(0, 0, 0, 0.15); margin: 30rpx 0; display: flex; @@ -23,24 +23,65 @@ page { .wrapper-title { font-size: 32rpx; color: #141414; - margin-bottom: 24rpx; + margin: 36rpx 0; font-weight: bold; text-align: center; } } .btn-area { - display: flex; - flex-direction: row; - justify-content: space-between; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 38rpx; } .shape-list { + margin: 38rpx 0; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 38rpx; + } + + .shape-list-empty { display: flex; - flex-wrap: wrap; - column-gap: 50rpx; - row-gap: 24rpx; - justify-content: flex-start; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 60rpx 40rpx; + text-align: center; + + .empty-icon { + width: 120rpx; + height: 120rpx; + background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 32rpx; + box-shadow: 0 4rpx 12rpx rgba(59, 130, 246, 0.15); + + .toy-icon { + font-size: 48rpx; + color: #3b82f6; + } + } + + .empty-title { + font-size: 32rpx; + font-weight: 600; + color: #374151; + margin-bottom: 16rpx; + line-height: 1.4; + } + + .empty-desc { + font-size: 26rpx; + color: #6b7280; + line-height: 1.6; + margin-bottom: 32rpx; + max-width: 400rpx; + } } } diff --git a/miniprogram/pages/shape/index.wxml b/miniprogram/pages/shape/index.wxml index 1391fb6..b5a1c63 100644 --- a/miniprogram/pages/shape/index.wxml +++ b/miniprogram/pages/shape/index.wxml @@ -5,20 +5,19 @@ + width="100%"> 选择图形 随机生成 - - + + + + + + 还没有选择图形 + 请点击上方“选择图形”或使用“随机生成”开始创建 +