From ce027925d42b8bef5ca0e87cc9a515f3af81662e Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Wed, 8 Jan 2025 14:03:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E8=B4=AD=E7=89=A9=E8=BD=A6=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- src/pages/merchant/components/product-row.vue | 3 +- src/pages/merchant/detail.vue | 43 ++++++++++--------- src/pages/wallet/detail.vue | 6 +-- src/sheep/api/food.ts | 4 +- src/sheep/api/pay.ts | 8 ++-- src/sheep/api/wallet.ts | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.env b/.env index 6e2c428..ded98e2 100644 --- a/.env +++ b/.env @@ -22,8 +22,8 @@ VITE_IMAGE_BASE_PATH = http://localhost:9999 # ******************** start 开发环境 start ******************** # VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api # VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api -VITE_APP_DEV_SERVICE = http://192.168.101.24:9999 # 邓-本地 -# VITE_APP_DEV_SERVICE = http://localhost:9999 +# VITE_APP_DEV_SERVICE = http://192.168.101.24:9999 # 邓-本地 +VITE_APP_DEV_SERVICE = http://localhost:9999 # ******************** end 开发环境 end ******************** # ******************** start 生产环境 start ******************** diff --git a/src/pages/merchant/components/product-row.vue b/src/pages/merchant/components/product-row.vue index 32eaef0..dafd6ed 100644 --- a/src/pages/merchant/components/product-row.vue +++ b/src/pages/merchant/components/product-row.vue @@ -13,7 +13,7 @@ export type Props = { modelValue: number, pic: string, name: string, - price: number, + price: any, marketPrice: number, salesCount: number, stock: number, @@ -31,7 +31,6 @@ const props = withDefaults(defineProps(), { stock: 0, count: 0, }); - const state = reactive({ }) diff --git a/src/pages/merchant/detail.vue b/src/pages/merchant/detail.vue index a2190af..8d4d4d2 100644 --- a/src/pages/merchant/detail.vue +++ b/src/pages/merchant/detail.vue @@ -18,7 +18,6 @@ import ProductTotal from "./components/product-total.vue"; const data = {}; const state = reactive({ detailId: null, - systemType: 3, totPrice: 0, totCount: 0, currentClassifyIndex: 0, @@ -50,7 +49,6 @@ const getDetail = async () => { const getShopCar = async () => { const _pa = { merchantId: state.detailId }; const { data } = await foodApi.getShopCar(_pa); - state.carList = data ?? []; state.totPrice = state.carList .map((v) => v.totalPrice) @@ -72,7 +70,7 @@ const getClassify = async () => { const updateShopCar = async () => { if (isEmpty(state.carList)) return; const list = state.carList - .filter((v) => v.productCount && v.productCount > 0) + .filter((v) => v.productCount !== undefined && v.productCount >= 0) .map((v) => { return { productCount: v.productCount, @@ -89,7 +87,6 @@ const getPorduct = async () => { const target = state.classifyList[state.currentClassifyIndex]; if (isEmpty(target)) return; const _pa = { - systemType: state.systemType, merchantId: state.detailId, categoryId: target.id, }; @@ -104,15 +101,24 @@ const getPorduct = async () => { } }); const shopList = [...state.shopList]; + // if (state.carList && state.carList.length) { + // for (const i of shopList) { + // if (i && i.foodSPURespVOList && i.foodSPURespVOList.length) { + // for (const j of i.foodSPURespVOList) { + // for (const v of state.carList) { + // if (j.id == v.productId) { + // j.productCount = v.productCount; + // } + // } + // } + // } + // } + // } if (state.carList && state.carList.length) { for (const i of shopList) { - if (i && i.foodSPURespVOList && i.foodSPURespVOList.length) { - for (const j of i.foodSPURespVOList) { - for (const v of state.carList) { - if (j.id == v.productId) { - j.productCount = v.productCount; - } - } + for (const v of state.carList) { + if (i.id == v.productId) { + i.productCount = v.productCount; } } } @@ -161,10 +167,6 @@ const submitPay = async () => { const { data: createData, code: createCode }: any = await payApi.createHardwareOrder(_createtPa); if (createCode != 0) throw new Error(); - const _submitPa = { orderId: createData }; - const { data: submitData, code: submitCode }: any = - await payApi.submitHardwareOrder(_submitPa); - if (submitCode != 0) throw new Error(); uni.hideLoading(); uni.showToast({ title: "支付成功", icon: "none" }); router.jump("/pages/tabbar/order"); @@ -328,21 +330,20 @@ const doFood = () => { :style="{ height: getHeight() }" class="flex-1 p-b-20rpx" > - - + + { }) const pageRef = ref(null) -const pageHook = hooks.usePage(pageRef, walletApi.transaction, null, 'data.list') +const pageHook = hooks.usePage(pageRef, walletApi.transaction, null, 'data.records') const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.pa); } @@ -61,12 +61,12 @@ const doTab = (e: any) => { v-for="(v, i) in pageHook.list" :key="i"> - {{ v.title }} + {{ v.title }} 支付交易 {{ v.title }} - {{ v.price }} + {{ hooks.useMoney(v.price) }}元 diff --git a/src/sheep/api/food.ts b/src/sheep/api/food.ts index 01b7735..aafbff7 100644 --- a/src/sheep/api/food.ts +++ b/src/sheep/api/food.ts @@ -21,7 +21,7 @@ export default { }), product: (params: any) => request({ - url: `/onlinefood/category/list`, + url: `/canteen/canteenOnlineSpu/app/getCanteenSpuList`, method: "GET", params, custom: { @@ -39,7 +39,7 @@ export default { }), updateShopCar: (data: any) => request({ - url: `/hard/car/save-or-upload`, + url: `/hard/hard-car/app/save-or-upload`, method: "POST", data, custom: { diff --git a/src/sheep/api/pay.ts b/src/sheep/api/pay.ts index 907c27b..3174fa2 100644 --- a/src/sheep/api/pay.ts +++ b/src/sheep/api/pay.ts @@ -18,11 +18,11 @@ export default { }); }, // 创建硬件订单 - createHardwareOrder: (data) => { + createHardwareOrder: (params) => { return request({ - url: "/hardware/order/create-order", - method: "POST", - data, + url: "/hard/hard-order/app/create-order", + method: "GET", + params, custom: { showLoading: false, }, diff --git a/src/sheep/api/wallet.ts b/src/sheep/api/wallet.ts index 93cfefb..8637889 100644 --- a/src/sheep/api/wallet.ts +++ b/src/sheep/api/wallet.ts @@ -56,7 +56,7 @@ export default { }), transaction: (params: any) => request({ - url: "wallet/wallet-transaction/page", + url: "wallet/wallet-transaction/app/page", method: "GET", params, custom: { From 4f75a10dbf94419b29f274293a0f96914dea86c4 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Thu, 9 Jan 2025 09:21:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=E4=B8=8B=E5=8D=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- src/pages/merchant/components/product-car.vue | 4 +- src/pages/merchant/detail.vue | 45 ++----- src/pages/merchant/food.vue | 6 +- src/pages/merchant/product-detail.vue | 119 ++++++++++-------- src/sheep/api/food.ts | 12 +- src/sheep/api/product.ts | 2 +- 7 files changed, 95 insertions(+), 97 deletions(-) diff --git a/.env b/.env index 853ae6a..e364819 100644 --- a/.env +++ b/.env @@ -22,8 +22,8 @@ VITE_IMAGE_BASE_PATH = http://localhost:9999 # ******************** start 开发环境 start ******************** # VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api # VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api -VITE_APP_DEV_SERVICE = http://192.168.101.29:9999 # 邓-本地 -# VITE_APP_DEV_SERVICE = http://localhost:9999 +# VITE_APP_DEV_SERVICE = http://192.168.101.29:9999 # 邓-本地 +VITE_APP_DEV_SERVICE = http://localhost:9999 # ******************** end 开发环境 end ******************** # ******************** start 生产环境 start ******************** diff --git a/src/pages/merchant/components/product-car.vue b/src/pages/merchant/components/product-car.vue index 19a9b84..d8e464e 100644 --- a/src/pages/merchant/components/product-car.vue +++ b/src/pages/merchant/components/product-car.vue @@ -8,6 +8,8 @@ import { merchantApi } from "@@/api" import ProductRow from './product-row.vue' import ProductTotal from './product-total.vue' +import { filePath } from "@@/utils/file"; + const emit = defineEmits(["update:modelValue", "submit", "doContainer", "add", "remove"]) export type Props = { @@ -57,7 +59,7 @@ const getHeight = () => {