diff --git a/src/pages/prosperity-shop/goods-form.vue b/src/pages/prosperity-shop/goods-form.vue
index 69770c1..51450ed 100644
--- a/src/pages/prosperity-shop/goods-form.vue
+++ b/src/pages/prosperity-shop/goods-form.vue
@@ -1,22 +1,31 @@
-
+
商品基本信息
-
+
-
+
-
+
+
+
+
+
-
-
+
+
-
-
+
+
注:图片大小不超过5M
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 商品SKU信息
+
+
+
+ 编号:{{ index + 1 }}
+ 删 除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添 加
+
+
+ 提交
-
-
-
- 申请原因
-
- {{ applyForm.reasonStr || "请选择申请原因" }}
-
-
-
-
-
+
+
+
-
-
- 保存
-
diff --git a/src/pages/prosperity-shop/goods-manage.vue b/src/pages/prosperity-shop/goods-manage.vue
index 9ba3c7d..ab8a89c 100644
--- a/src/pages/prosperity-shop/goods-manage.vue
+++ b/src/pages/prosperity-shop/goods-manage.vue
@@ -15,29 +15,25 @@
@scroll="pageHook.scroll"
>
-
- 新 增
- 分 类
-
-
- 搜 索
-
-
-
+
+
+ 搜 索
+
+
-
+
- {{ v.title }}
-
+ {{ v.title }}
+
{{ state.category.find((item) => item.id == v.categoryId)?.name || "未知分类" }}
{{ v.status == "0" ? "在售" : "未售" }}
-
- 单位 {{ v.unit }}
- 库存 {{ v.totalStock }}
+
+ 单位 {{ v.unit }}
+ 库存 {{ v.totalStock }}
@@ -80,10 +76,10 @@
¥
- {{ v.spuPrice.toFixed(2).split(".")[0] }}.
- {{ v.spuPrice.toFixed(2).split(".")[1] }}
+ {{ v.spuPrice.toFixed(2).split(".")[0] }}.
+ {{ v.spuPrice.toFixed(2).split(".")[1] }}
- 到手价
+ 到手价
@@ -101,6 +97,10 @@
+
+ 新增商品
+ 分类管理
+
@@ -109,7 +109,7 @@ import { reactive, ref } from "vue"
import { prosperityShopApi } from "@/sheep/api"
import { hooks } from "@/sheep"
import { filePath } from "@/sheep/utils/file"
-import { onLoad } from "@dcloudio/uni-app"
+import { onLoad, onShow } from "@dcloudio/uni-app"
const state = reactive({
params: {
@@ -121,7 +121,7 @@ const state = reactive({
})
const pageRef = ref(null)
-const pageHook = hooks.usePage(pageRef, prosperityShopApi.getGoodsList, null, "data.records")
+const pageHook = hooks.usePage(pageRef, prosperityShopApi.getManageGoodsList, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.params)
@@ -131,6 +131,10 @@ onLoad(async () => {
await getGoodsCategory()
})
+onShow(() => {
+ pageRef.value && pageRef.value.reload(false)
+})
+
const getGoodsCategory = async () => {
const { code, data, msg } = await prosperityShopApi.getGoodsCategory()
if (code != 0) return uni.showToast({ title: msg || "商品分类获取失败", icon: "none" })
diff --git a/src/sheep/api/prosperityShop.ts b/src/sheep/api/prosperityShop.ts
index fc623fa..affb054 100644
--- a/src/sheep/api/prosperityShop.ts
+++ b/src/sheep/api/prosperityShop.ts
@@ -25,7 +25,7 @@ export default {
})
},
// 获取超市商品分类列表树
- getGoodsCategoryTree: (params: { merchantId: string }): Promise => {
+ getGoodsCategoryTree: (params?: { merchantId: string }): Promise => {
return request({
url: `/supermarket/app/mall/category/tree`,
method: "GET",
@@ -35,7 +35,7 @@ export default {
// 获取商品列表
getGoodsList: (params: any): Promise => {
return request({
- url: `/supermarket/app/mall/merchant/product/list`,
+ url: `/supermarket/app/mall/product/page`,
method: "GET",
params,
})
@@ -47,6 +47,14 @@ export default {
method: "GET",
})
},
+ // 共富商城商品管理获取自己商户的商品列表
+ getManageGoodsList: (params: any): Promise => {
+ return request({
+ url: `/supermarket/app/mall/merchant/product/list`,
+ method: "GET",
+ params,
+ })
+ },
// 删除商品
deleteGoods: (id: string): Promise => {
return request({
@@ -54,4 +62,12 @@ export default {
method: "DELETE",
})
},
+ // 新增商品
+ addGoods: (data: any): Promise => {
+ return request({
+ url: `/supermarket/app/mall/merchant/product/create`,
+ method: "POST",
+ data,
+ })
+ },
}
diff --git a/src/sheep/components/shop-categary-picker.vue b/src/sheep/components/shop-categary-picker.vue
new file mode 100644
index 0000000..ea462ae
--- /dev/null
+++ b/src/sheep/components/shop-categary-picker.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+ ▾
+
+
+ {{ item.name }}
+
+ 暂无数据
+
+
+ 取消
+
+ 确定
+
+
+
+
+
+