From 4ba2ed6e547b3e8019e9da9ee731d69065271da6 Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 9 Apr 2025 12:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=AE=B6=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=B5=81=E6=B0=B4=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/merchant/detail.vue | 41 +++++++++++++---------------- src/pages/merchant/index.vue | 23 ---------------- src/pages/tabbar/flowStatistics.vue | 10 +++---- src/sheep/api/merchant.ts | 2 +- 4 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 src/pages/merchant/index.vue diff --git a/src/pages/merchant/detail.vue b/src/pages/merchant/detail.vue index 1e813b1..f51ca1b 100644 --- a/src/pages/merchant/detail.vue +++ b/src/pages/merchant/detail.vue @@ -2,10 +2,8 @@ import { reactive, nextTick } from "vue" import { onLoad, onShow } from "@dcloudio/uni-app" import { isEmpty } from "radash" - import { hooks, router } from "@@/index" import { merchantApi, foodApi, payApi } from "@@/api" - import { filePath } from "@@/utils/file" import ProductRow from "./components/product-row.vue" @@ -14,12 +12,13 @@ import ProductTotal from "./components/product-total.vue" const state = reactive({ detailId: null, + canteenDetail: {}, + totPrice: 0, totCount: 0, currentClassifyIndex: 0, showCarDialog: false, - detail: {}, carList: [], classifyList: [], shopList: [], @@ -36,20 +35,16 @@ onShow(() => { getClassify() }) +// 获取食堂详情信息 const getDetail = async () => { - uni.showLoading({ - title: "加载中...", - mask: true, - }) - const _pa = { id: state.detailId } - const { data } = await merchantApi.detail(_pa) - state.detail = data + uni.showLoading({ title: "加载中...", mask: true }) + const { code, data } = await merchantApi.detail({ id: state.detailId }) + if (code == 0) state.canteenDetail = data uni.hideLoading() } const getShopCar = async () => { - const _pa = { merchantId: state.detailId, hardType: "CANTEEN" } - const { data } = await foodApi.getShopCar(_pa) + const { data } = await foodApi.getShopCar({ merchantId: state.detailId, hardType: "CANTEEN" }) state.carList = data ?? [] if (isEmpty(state.carList)) { state.shopList.forEach((v: any) => { @@ -201,11 +196,11 @@ const getHeight = () => { } const doPhone = () => { - if (isEmpty(state.detail.phone)) { + if (isEmpty(state.canteenDetail.phone)) { uni.showToast({ title: "该商户没有预留电话", icon: "none" }) return } - hooks.useMakePhoneCall(state.detail.phone) + hooks.useMakePhoneCall(state.canteenDetail.phone) } const doFood = () => { router.jump("/pages/merchant/food", { merchantId: state.detailId }) @@ -223,7 +218,7 @@ const doFood = () => { indicator-color="#ffffff" :autoplay="true" > - + @@ -233,31 +228,31 @@ const doFood = () => { - + - {{ state.detail.name }} + {{ state.canteenDetail.name }} - {{ state.detail.deptName }} + {{ state.canteenDetail.deptName }} 营业时间: - {{ state.detail.jobTime?.split(",")[0] ? "早:" + state.detail.jobTime?.split(",")[0] : "" }} + {{ state.canteenDetail.jobTime?.split(",")[0] ? "早:" + state.canteenDetail.jobTime?.split(",")[0] : "" }} - {{ state.detail.jobTime?.split(",")[1] ? "中:" + state.detail.jobTime?.split(",")[1] : "" }} + {{ state.canteenDetail.jobTime?.split(",")[1] ? "中:" + state.canteenDetail.jobTime?.split(",")[1] : "" }} - {{ state.detail.jobTime?.split(",")[2] ? "晚:" + state.detail.jobTime?.split(",")[2] : "" }} + {{ state.canteenDetail.jobTime?.split(",")[2] ? "晚:" + state.canteenDetail.jobTime?.split(",")[2] : "" }} - + 食堂地址: - {{ state.detail.addressDes }} + {{ state.canteenDetail.addressDes }} diff --git a/src/pages/merchant/index.vue b/src/pages/merchant/index.vue deleted file mode 100644 index 57a4924..0000000 --- a/src/pages/merchant/index.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/src/pages/tabbar/flowStatistics.vue b/src/pages/tabbar/flowStatistics.vue index 67cf5f0..a7bf028 100644 --- a/src/pages/tabbar/flowStatistics.vue +++ b/src/pages/tabbar/flowStatistics.vue @@ -3,7 +3,7 @@