shish 20 hours ago
parent
commit
d6aecb5bcf
1 changed files with 19 additions and 4 deletions
  1. 19 4
      mallApp/src/pages/home/recent.vue

+ 19 - 4
mallApp/src/pages/home/recent.vue

@@ -117,7 +117,11 @@
             <view class="shop-main-actions">
               <view
                 class="balance-btn"
-                :class="Number(item.balance) < 0 ? 'is-debt' : 'is-balance'"
+                :class="{
+                  'is-debt': Number(item.balance) < 0,
+                  'is-positive': Number(item.balance) > 0,
+                  'is-zero': Number(item.balance) === 0 || !item.balance
+                }"
                 @click.stop="recharge(item)"
               >
                 <view class="balance-btn-content">
@@ -810,17 +814,28 @@ page {
     margin-right: 16upx;
     background: #eef9f0;
 
-    /* 余额:标签+数值均为绿色 */
-    &.is-balance {
+    /* 余额为 0:标签+数值均为绿色,不加粗 */
+    &.is-zero {
       background: #eef9f0;
 
       .balance-btn-label,
       .balance-btn-value {
         color: #1f7a3d;
+        font-weight: 400;
       }
     }
 
-    /* 待结:标签+数值均为红色 */
+    /* 余额 > 0:文字蓝色,背景保持原绿色底 */
+    &.is-positive {
+      background: #eef9f0;
+
+      .balance-btn-label,
+      .balance-btn-value {
+        color: #4c8ff3;
+      }
+    }
+
+    /* 待结(余额 < 0):标签+数值均为红色 */
     &.is-debt {
       background: #fef2f2;