diff --git a/src/components/PopGetAllowance.vue b/src/components/PopGetAllowance.vue index 2ebf996..c261d12 100644 --- a/src/components/PopGetAllowance.vue +++ b/src/components/PopGetAllowance.vue @@ -75,6 +75,7 @@ const props = defineProps({ showPop: { type: Boolean, default: false }, // 控制弹窗的显示和隐藏 coupons: { type: Object, default: () => ({}) }, // 补贴信息 detail: { type: Object, default: () => ({}) }, // 补贴信息 + cityInfo: { type: Object, default: () => ({})}, // 城市信息 }) // Ensure slot 'value' is called inside template/render function const mobile = ref(''); @@ -165,7 +166,8 @@ const bindPostCoupon = async () => { const result = await api.post('/auto/car/coupon', { mobile: mobile.value, code: code.value, - couponId: props.coupons.coupon_id + couponId: props.coupons.coupon_id, + cityId: props.cityInfo.cityId }); if (result.code === 200) { diff --git a/src/pages/Home.vue b/src/pages/Home.vue index fe5c3af..a77e62c 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -43,7 +43,7 @@
- + @@ -231,8 +231,8 @@ const cityInfo = ref({ if (location && location.latitude && location.longitude) { if(localStorage.getItem('cityInfo')){ - // cityInfo.value = JSON.parse(localStorage.getItem('cityInfo')); - // console.log('城市信息:', cityInfo.value); + cityInfo.value = JSON.parse(localStorage.getItem('cityInfo')); + console.log('城市信息:', cityInfo.value); // if (cityInfo.value.cityId) { // userStore.setCity(cityInfo.value); // query_data.cityId = cityInfo.value.cityId;