From cc8d911e0e8b7c2071222e41e2c7d909c01d063f Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Tue, 9 Jul 2024 16:36:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=B1=BB=E5=9E=8B=E5=B1=95=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/saleHome/component/order.vue | 26 +++++++++++++++----------- src/views/saleHome/component/pupop.vue | 6 +++++- src/views/saleHome/component/shop.vue | 6 +++++- src/views/saleHome/index.vue | 7 ++++--- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/views/saleHome/component/order.vue b/src/views/saleHome/component/order.vue index d5f6009..2d99465 100644 --- a/src/views/saleHome/component/order.vue +++ b/src/views/saleHome/component/order.vue @@ -38,12 +38,24 @@ const deleteShop = (arr) => { }); }; +const userInfo = ref({ + uid: '' +}) +const setUser = (row) => { + userInfo.value = row; + userInfo.value.uid = row.id; + getList(); + emit("getStoreList", {uid: row.id}, true); +} + const extend = ref({}); const getList = () => { allPrice.value = 0; costPrice.value = 0; discounts.value = 0; - cartListApi().then((res) => { + cartListApi({ + uid: userInfo.value.uid + }).then((res) => { extend.value = res.data.extend; list.value = res.data.lists || []; // if (!extend.value?.pay_price) userInfo.value.uid = ""; @@ -58,7 +70,7 @@ const getList = () => { }; getList(); -const emit = defineEmits(["goPay", "editAttr"]); +const emit = defineEmits(["goPay", "editAttr", "getStoreList"]); const goPay = () => { emit("goPay"); @@ -104,14 +116,6 @@ const showPrice = (type = true) => { priceRef.value.show(type, costPrice.value); }; -const userInfo = ref({ - uid: '' -}) -const setUser = (row) => { - userInfo.value = row; - userInfo.value.uid = row.id; -} - const is_storage = ref(false) const resetView = () => { @@ -169,7 +173,7 @@ onUnmounted(() => { }}
余额: {{ userInfo.now_money }}
- + 重置 diff --git a/src/views/saleHome/component/pupop.vue b/src/views/saleHome/component/pupop.vue index ba1c138..3d5498d 100644 --- a/src/views/saleHome/component/pupop.vue +++ b/src/views/saleHome/component/pupop.vue @@ -66,7 +66,7 @@ const close = () => {
{{ form.store_name }}
-
+ +
+ ¥{{ form[priceKey.price] }} + /{{ form.unit_name }}
diff --git a/src/views/saleHome/component/shop.vue b/src/views/saleHome/component/shop.vue index 50c88b3..238928c 100644 --- a/src/views/saleHome/component/shop.vue +++ b/src/views/saleHome/component/shop.vue @@ -107,7 +107,7 @@ onUnmounted(() => {
{{ item.store_name }}
-
+ +
+ ¥{{ item[priceKey.price] }} + /{{ item.unit_name }}
diff --git a/src/views/saleHome/index.vue b/src/views/saleHome/index.vue index af6d215..fd43911 100644 --- a/src/views/saleHome/index.vue +++ b/src/views/saleHome/index.vue @@ -43,7 +43,7 @@ const getStoreList = (data = {}, reload = false) => { ...where.value, ...data, }; - console.log("===", data, where.value); + console.log("===", data, reload); if (reload) { storeList.value = []; where.value.page_no = 1; @@ -87,10 +87,11 @@ function isAllDigits(str) { } const cartAddInfo = (item, change = "") => { - console.log(item, change); + // console.log(item, change); let q = { product_id: item.product_id, cart_num: item.cart_num, + uid: where.value.uid || null }; cartCreateApi(q).then((res) => { orderRef.value.getList(); @@ -218,7 +219,7 @@ onUnmounted(() => {