添加返回购物车按钮功能,方便用户从收银台页面快速返回购物车页面
@@ -48,6 +48,7 @@
</view>
<button class="confirm-btn" type="primary" @click="onConfirmPayment">确认支付</button>
+ <button class="return-cart-btn" @click="returnToCart">返回购物车</button>
</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>