From aba7fe92d3bccda59f3d5d27bbf517912143b641 Mon Sep 17 00:00:00 2001 From: davy Date: Thu, 10 Apr 2025 00:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96writeReview=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=9A1.=20=E6=B7=BB=E5=8A=A0=E6=96=87=E5=AD=97=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E5=92=8C=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=202.=20=E4=BC=98=E5=8C=96=E5=BA=95=E9=83=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/writeReview.vue | 42 ++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/pages/index/writeReview.vue b/pages/index/writeReview.vue index 71f76a2..279df0a 100644 --- a/pages/index/writeReview.vue +++ b/pages/index/writeReview.vue @@ -196,7 +196,8 @@ @@ -613,20 +614,27 @@ left: 0; right: 0; bottom: 0; - padding: 24rpx 32rpx; + padding: 24rpx 32rpx env(safe-area-inset-bottom); background: #FFFFFF; - box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04); + box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1); display: flex; gap: 24rpx; .btn { flex: 1; - height: 88rpx; - border-radius: 44rpx; + height: 96rpx; + border-radius: 48rpx; display: flex; align-items: center; justify-content: center; - font-size: 28rpx; + font-size: 32rpx; + font-weight: 500; + transition: all 0.3s ease; + + &:active { + transform: scale(0.98); + opacity: 0.9; + } &.prev { background: #F7F7F7; @@ -639,11 +647,16 @@ &.next, &.submit { - background: #19367A; + background: linear-gradient(135deg, #19367A, #1E4B9E); color: #FFFFFF; + box-shadow: 0 4rpx 16rpx rgba(25, 54, 122, 0.2); - &:disabled { + &:disabled, + &.disabled { background: #CCCCCC; + opacity: 0.7; + pointer-events: none; + box-shadow: none; } } } @@ -700,7 +713,11 @@ } }, isFormValid() { - return this.form.reviewContent.trim().length > 0; + // 检查文字评价和图片是否都已填写/上传 + const hasContent = this.form.reviewContent.trim().length > 0; + const hasImage = !!this.form.reviewImg; + console.log('表单验证状态:', { hasContent, hasImage, isValid: hasContent && hasImage }); + return hasContent && hasImage; } }, onLoad(options) { @@ -793,6 +810,7 @@ count: 1, success: (res) => { this.form.reviewImg = res.tempFilePaths[0]; + console.log('图片上传成功:', this.form.reviewImg); } }); }, @@ -800,12 +818,12 @@ if (!this.isFormValid) { if (!this.form.reviewImg) { uni.showToast({ - title: '请上传至少一张图片', + title: '请上传图片', icon: 'none' }); - } else if (this.form.reviewContent.trim().length < 15) { + } else if (this.form.reviewContent.trim().length === 0) { uni.showToast({ - title: '评价内容至少15个字', + title: '请填写评价内容', icon: 'none' }); }