From 8b5e55889d994044b0e0445f402e218a63fd9d48 Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 15 Sep 2025 11:23:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dtabbar=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/pages/human-face/apply.vue | 9 +++++---- src/pages/human-face/list.vue | 33 +++++++++++++++------------------ src/pages/tabbar/my.vue | 4 ++-- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/App.vue b/src/App.vue index 746ebf9..400d2f5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -107,7 +107,7 @@ const tabbar: TabbarItem[] = [ iconPath: "/static/tabbar/integrated.png", selectedIconPath: "/static/tabbar/integrated-select.png", launchParam: ["integrated"], - auth: [], + auth: ["user"], }, { pagePath: "pages/tabbar/my", diff --git a/src/pages/human-face/apply.vue b/src/pages/human-face/apply.vue index 95d3387..b227247 100644 --- a/src/pages/human-face/apply.vue +++ b/src/pages/human-face/apply.vue @@ -79,21 +79,22 @@ const doSubmit = async () => { @@ -120,6 +120,7 @@ import { hooks } from "@/sheep" import { filePath } from "@/sheep/utils/file" import { onLoad, onShow } from "@dcloudio/uni-app" import { displayPrice } from "@/sheep/utils/formatMoney" +import { useGoodsManage } from "./use-goods-manage" const state = reactive({ params: { @@ -137,6 +138,8 @@ const query = (page: number, pagesize: number) => { pageHook.startPage(page, pagesize, false, state.params) } +const { addGoods, editGoods, deleteGoods, doGoodsDetail, categaryManage } = useGoodsManage(pageRef) + onLoad(async () => { await getGoodsCategory() }) @@ -167,46 +170,6 @@ const search = () => { const inputClear = () => { pageRef.value && pageRef.value.reload(false) } - -const doGoodsDetail = (id: string) => { - if (!id) return uni.showToast({ title: "商品id不存在", icon: "none" }) - uni.navigateTo({ - url: `/pages/prosperity-shop/goods-detail?id=${id}`, - }) -} - -// 新增商品 -const addGoods = () => { - uni.navigateTo({ url: `/pages/prosperity-shop/goods-form` }) -} - -// 编辑商品 -const editGoods = (id: string) => { - if (!id) return uni.showToast({ title: "商品id不存在", icon: "none" }) - uni.navigateTo({ url: `/pages/prosperity-shop/goods-form?id=${id}` }) -} - -// 删除商品 -const deleteGoods = (id: string) => { - if (!id) return uni.showToast({ title: "商品id不存在", icon: "none" }) - uni.showModal({ - title: "确定删除商品吗?", - content: "", - success: async (res) => { - if (res.confirm) { - const { code } = await prosperityShopApi.deleteGoods(id) - if (code != 0) return uni.showToast({ title: "删除失败", icon: "error" }) - uni.showToast({ title: "删除成功", icon: "none" }) - pageRef.value && pageRef.value.reload(false) - } - }, - }) -} - -// 分类管理 -const categaryManage = () => { - uni.navigateTo({ url: "/pages/prosperity-shop/goods-categary" }) -} diff --git a/src/sheep/components/shop-categary-picker.vue b/src/sheep/components/shop-categary-picker.vue index 940fc87..8c94128 100644 --- a/src/sheep/components/shop-categary-picker.vue +++ b/src/sheep/components/shop-categary-picker.vue @@ -1,9 +1,9 @@