@@ -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({
})
}
@@ -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>
@@ -87,6 +87,7 @@
this.getCartList()
// 刷新购物车列表
uni.$on("getCartList",item =>{
+ console.log('getCartList11112221')
// 加入购物车
@@ -25,7 +25,7 @@ export default {
// 查看订单详情
toOrderDetail() {
url: '/pages/order/orderDetail?id=' + this.orderId