This commit is contained in:
zmj 2024-07-02 14:04:26 +08:00
parent 26ada06159
commit c53c0b8cc4
5 changed files with 20 additions and 12 deletions

View File

@ -115,7 +115,8 @@
datas.value.cart_num = ''; datas.value.cart_num = '';
return; return;
} }
emit('change', datas.value); datas.value.types = true
emit('change', datas.value, );
} }
const subtotal = computed(() => { const subtotal = computed(() => {
@ -124,11 +125,6 @@
return Number(num * sell * 100 / 100).toFixed(2) return Number(num * sell * 100 / 100).toFixed(2)
}) })
defineExpose({ defineExpose({
setData, setData,
// founcsFn // founcsFn

View File

@ -196,7 +196,12 @@
lat: queryParams.latitude, lat: queryParams.latitude,
long: queryParams.longitude long: queryParams.longitude
}, )) }, ))
},
fail() {
console.log("获取定位失败")
getShopList();
} }
}) })
} }
} }

View File

@ -400,6 +400,8 @@
} }
const addCart = (product_id, cart_num) => { // const addCart = (product_id, cart_num) => { //
console.log("触发了加入购物车")
cartCreateApi({ cartCreateApi({
type: 1, type: 1,
cart_num: cart_num, cart_num: cart_num,
@ -617,6 +619,7 @@
}; };
const changeGood = (data) => { // const changeGood = (data) => { //
showGoodPopup.value = false; showGoodPopup.value = false;
if (!data.types) return
if (!userStore.token) return uni.showModal({ if (!userStore.token) return uni.showModal({
content: '您需要先登录才可使用该功能, 是否前去登录', content: '您需要先登录才可使用该功能, 是否前去登录',
success: (e) => { success: (e) => {
@ -633,6 +636,7 @@
}, },
}); });
console.log('data', data)
addCart(data.product_id, data.cart_num); addCart(data.product_id, data.cart_num);
} }

View File

@ -24,7 +24,7 @@
<template> <template>
<view style="flex-grow: 1;overflow-y: auto;"> <view style="flex-grow: 1;overflow-y: auto;">
<view class="user-info" <view class="user-info"
:style="{backgroundImage: userInfo.user_ship!=1?'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp)':'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/514af20240702100300627.png)' }"> :style="{backgroundImage: userInfo.user_ship!=1?'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp)':'url(https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/aace1202407021022357574.png)' }">
<view class="u-card"> <view class="u-card">
<view style="display: flex;" @click="updataInfp"> <view style="display: flex;" @click="updataInfp">
<up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx" <up-image :src="userInfo.avatar" mode="aspectFill" width="112rpx" height="112rpx"
@ -50,8 +50,6 @@
<view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')"> <view class="to-vip-btn" @click="navgo('/pageQuota/vipUser/index')">
会员报备 会员报备
</view> </view>
</view> </view>
<view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')"> <view class="balance" @click="navgo('/pageQuota/balanceDetail/index?type=2')">
<view class="" style="font-size: 28rpx;transform: translateY(10rpx);"> <view class="" style="font-size: 28rpx;transform: translateY(10rpx);">

View File

@ -395,7 +395,7 @@
const shop_Info = ref({}) const shop_Info = ref({})
const cartList = ref([]); const cartList = ref([]);
const orderInfo = ref({}); const orderInfo = ref({});
const checkOrder = () => { const checkOrder = (store_id) => {
checkOrderApi({ checkOrderApi({
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
store_id: STORE_INFO.id || 0, store_id: STORE_INFO.id || 0,
@ -406,7 +406,7 @@
shop_Info.value = res.data.shopInfo || {} shop_Info.value = res.data.shopInfo || {}
checkInventoryApi({ checkInventoryApi({
cart_id: cartStore.cartList, cart_id: cartStore.cartList,
store_id: res.data.shopInfo.id store_id: store_id || res.data.shopInfo.id
}).then(res => { }).then(res => {
reservation.value = res.data.reservation reservation.value = res.data.reservation
}) })
@ -557,7 +557,12 @@
location.long = res.longitude; location.long = res.longitude;
uni.setStorageSync('location', JSON.stringify(location)) uni.setStorageSync('location', JSON.stringify(location))
checkOrder(); checkOrder();
} },
fail() {
uni.$u.toast('获取位置当前失败,为你推荐当前门店')
checkOrder(STORE_INFO.id);
},
complete() {}
}) })
} }
}) })