Преглед изворни кода

feat(收银台): 添加返回购物车按钮

添加返回购物车按钮功能,方便用户从收银台页面快速返回购物车页面
ylong пре 1 недеља
родитељ
комит
a6524775bc
1 измењених фајлова са 23 додато и 0 уклоњено
  1. 23 0
      pages-car/pages/cashier-desk.vue

+ 23 - 0
pages-car/pages/cashier-desk.vue

@@ -48,6 +48,7 @@
         </view>
 
         <button class="confirm-btn" type="primary" @click="onConfirmPayment">确认支付</button>
+        <button class="return-cart-btn" @click="returnToCart">返回购物车</button>
     </view>
 </template>
 
@@ -178,6 +179,13 @@
                         icon: 'none'
                     });
                 })
+            },
+            
+            // 返回购物车
+            returnToCart() {
+                uni.switchTab({
+                    url: '/pages/cart/index'
+                });
             }
         }
     }
@@ -274,5 +282,20 @@
                 border: none;
             }
         }
+
+        .return-cart-btn {
+            width: 90%;
+            margin-left: 5%;
+            margin-top: 40rpx;
+            background: #ffffff;
+            color: #38C148;
+            border-radius: 45rpx;
+            font-size: 32rpx;
+
+            &::after {
+                border: 1px solid #38C148;
+                border-radius: 90rpx; /* border-radius for ::after pseudo element should be double because of 200% scale in uni-app */
+            }
+        }
     }
 </style>