diff --git a/components/goodPopup.vue b/components/goodPopup.vue index e3fedb6..4374985 100644 --- a/components/goodPopup.vue +++ b/components/goodPopup.vue @@ -115,7 +115,8 @@ datas.value.cart_num = ''; return; } - emit('change', datas.value); + datas.value.types = true + emit('change', datas.value, ); } const subtotal = computed(() => { @@ -124,11 +125,6 @@ return Number(num * sell * 100 / 100).toFixed(2) }) - - - - - defineExpose({ setData, // founcsFn diff --git a/multipleShop/index/index.vue b/multipleShop/index/index.vue index b847922..c97905b 100644 --- a/multipleShop/index/index.vue +++ b/multipleShop/index/index.vue @@ -196,7 +196,12 @@ lat: queryParams.latitude, long: queryParams.longitude }, )) + }, + fail() { + console.log("获取定位失败") + getShopList(); } + }) } } diff --git a/pages/index/index.vue b/pages/index/index.vue index e220d0b..8f6a320 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -400,6 +400,8 @@ } const addCart = (product_id, cart_num) => { //加入购物车 + console.log("触发了加入购物车") + cartCreateApi({ type: 1, cart_num: cart_num, @@ -617,6 +619,7 @@ }; const changeGood = (data) => { // 确定选择商品重量 showGoodPopup.value = false; + if (!data.types) return if (!userStore.token) return uni.showModal({ content: '您需要先登录才可使用该功能, 是否前去登录', success: (e) => { @@ -633,6 +636,7 @@ }, }); + console.log('data', data) addCart(data.product_id, data.cart_num); } diff --git a/pages/my/my.vue b/pages/my/my.vue index 1c07200..83f2f75 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -24,7 +24,7 @@