lilei 4 yıl önce
ebeveyn
işleme
57928f6eb4

+ 16 - 3
components/uni-cart-fix/uni-cart-fix.vue

@@ -6,6 +6,12 @@
 </template>
 	<script>
 		export default {
+			props:{
+				closeCurPage:{
+					type: Boolean,
+					default: false
+				}
+			},
 			computed: {
 				count() {
 					let arr = this.$store.state.vuex_cartList || []
@@ -18,10 +24,17 @@
 			},
 			methods: {
 				toCart() {
+					let _this = this
 					this.$bindClick(function(){
-						uni.navigateTo({
-							url:"/pages/cart/cart"
-						})
+						if(_this.closeCurPage){
+							uni.redirectTo({
+								url:"/pages/cart/cart"
+							})
+						}else{
+							uni.navigateTo({
+								url:"/pages/cart/cart"
+							})
+						}
 					})
 				}
 			},

+ 1 - 1
pages/goods/goodsDetail.vue

@@ -52,7 +52,7 @@
 			<view><u-button :custom-style="toOrderButton" type="error" @click="toOrder()">立即下单</u-button></view>
 		</view>
 		<!-- 购物车 -->
-		<uni-cart-fix></uni-cart-fix>
+		<uni-cart-fix :closeCurPage="true"></uni-cart-fix>
 	</view>
 </template>
 

+ 1 - 0
pages/index/index.vue

@@ -87,6 +87,7 @@
 			this.getCartList()
 			// 刷新购物车列表
 			uni.$on("getCartList",item =>{
+				console.log('getCartList11112221')
 				this.getCartList()
 			})
 			// 加入购物车

+ 1 - 1
pages/toOrder/payFinish.vue

@@ -25,7 +25,7 @@ export default {
 	methods: {
 		// 查看订单详情
 		toOrderDetail() {
-			uni.navigateTo({
+			uni.redirectTo({
 			    url: '/pages/order/orderDetail?id=' + this.orderId
 			})
 		},