This commit is contained in:
zjf committed 2025-09-11 17:52:25 +08:00
commit 79000cbb4a
18 files changed
+1022 -132

No files matched your search

+45
View File
@@ -9,4 +9,49 @@ export default {
params: { productLimit: 5 },
})
},
// 获取商品分类列表
getGoodsCategory: (params?: any): Promise<any> => {
return request({
url: "/supermarket/app/mall/merchant/category/list",
method: "GET",
params,
})
},
// 获取超市详情
getShopDetail: (id: string): Promise<any> => {
return request({
url: `/supermarket/app/mall/merchant/${id}`,
method: "GET",
})
},
// 获取超市商品分类列表树
getGoodsCategoryTree: (params: { merchantId: string }): Promise<any> => {
return request({
url: `/supermarket/app/mall/category/tree`,
method: "GET",
params,
})
},
// 获取商品列表
getGoodsList: (params: any): Promise<any> => {
return request({
url: `/supermarket/app/mall/merchant/product/list`,
method: "GET",
params,
})
},
// 获取商品详情
getGoodsDetail: (id: string): Promise<any> => {
return request({
url: `/supermarket/app/mall/product/${id}`,
method: "GET",
})
},
// 删除商品
deleteGoods: (id: string): Promise<any> => {
return request({
url: `/supermarket/app/mall/merchant/product/${id}`,
method: "DELETE",
})
},
}
@@ -21,6 +21,7 @@ const props = withDefaults(defineProps<Props>(), {
mainIsScroll: false,
bg: "",
})
const emit = defineEmits(["scroll"])
const state = reactive({
navBgTitleColor_: props.navBgTitleColor,
@@ -46,10 +47,11 @@ onMounted(() => {
})
function scroll(e) {
if (!router.hasTabbar()) return
if (!props.scrollHideTabbar) return
const offset = 50
const top = e.target.scrollTop
// if (!router.hasTabbar()) return
// if (!props.scrollHideTabbar) return
// const offset = 50
// const top = e.target.scrollTop
emit("scroll", e)
}
function defaultPage() {
@@ -67,7 +69,7 @@ function initBackStyle() {
break
case "just-flot-back":
state.visble.topSafe = true
state.visble.topNav = false
state.visble.topNav = true
break
default:
break
+11
View File
@@ -0,0 +1,11 @@
const treeToList = <T extends { children?: T[] }>(tree: T[], result: T[] = []): T[] => {
for (const node of tree) {
result.push(node)
if (node?.children?.length) {
treeToList(node.children, result)
}
}
return result
}
export default treeToList