diff --git a/src/pages.json b/src/pages.json
index c73d75b..d6e1571 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -165,6 +165,13 @@
"navigationBarTitleText": "商品管理",
"disableScroll": true
}
+ },
+ {
+ "path": "goods-form",
+ "style": {
+ "navigationBarTitleText": "商品信息管理",
+ "disableScroll": true
+ }
}
]
},
diff --git a/src/pages/prosperity-shop/goods-form.vue b/src/pages/prosperity-shop/goods-form.vue
new file mode 100644
index 0000000..69770c1
--- /dev/null
+++ b/src/pages/prosperity-shop/goods-form.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+ 商品基本信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 注:图片大小不超过5M
+
+
+
+
+
+
+
+
+
+ 申请原因
+
+ {{ applyForm.reasonStr || "请选择申请原因" }}
+
+
+
+
+
+
+
+
+
+ 保存
+
+
+
+
+
diff --git a/src/pages/prosperity-shop/goods-manage.vue b/src/pages/prosperity-shop/goods-manage.vue
index 2b49354..9ba3c7d 100644
--- a/src/pages/prosperity-shop/goods-manage.vue
+++ b/src/pages/prosperity-shop/goods-manage.vue
@@ -1,30 +1,206 @@
-
-
+
+
+
+
+ 新 增
+ 分 类
+
+
+ 搜 索
+
+
+
+
+
+
+ {{ v.name }}
+
+
+
+
+
+
+
+
+
+ {{ v.title }}
+
+
+ {{ state.category.find((item) => item.id == v.categoryId)?.name || "未知分类" }}
+
+ {{ v.status == "0" ? "在售" : "未售" }}
+
+
+ 单位 {{ v.unit }}
+ 库存 {{ v.totalStock }}
+
+
+
+ ¥
+ {{ v.originalPrice.toFixed(2) }}
+
+
+ ¥
+ {{ v.spuPrice.toFixed(2).split(".")[0] }}.
+ {{ v.spuPrice.toFixed(2).split(".")[1] }}
+
+ 到手价
+
+
+
+
+
+
+ 删除商品
+
+
+ 编辑商品
+
+
+ 查看详情
+
+
+
+
+
+
diff --git a/src/pages/prosperity-shop/goods-search.vue b/src/pages/prosperity-shop/goods-search.vue
index f1b8ba9..d794b07 100644
--- a/src/pages/prosperity-shop/goods-search.vue
+++ b/src/pages/prosperity-shop/goods-search.vue
@@ -94,7 +94,7 @@ onLoad((options: any) => {
// 点击搜索
const search = () => {
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
const doGoodsDetail = (id: string) => {
diff --git a/src/pages/prosperity-shop/shop-detail.vue b/src/pages/prosperity-shop/shop-detail.vue
index 6cf636c..5c531fb 100644
--- a/src/pages/prosperity-shop/shop-detail.vue
+++ b/src/pages/prosperity-shop/shop-detail.vue
@@ -108,7 +108,7 @@ onLoad(async (option: any) => {
uni.showLoading({ title: "加载中..." })
state.id = option.id
await getShopDetail(option.id)
- await getGoodsCategory(option.id)
+ await getGoodsCategoryTree(option.id)
await getGoodsList()
uni.hideLoading()
})
@@ -119,8 +119,8 @@ const getShopDetail = async (id: string) => {
state.detail = data
}
-const getGoodsCategory = async (id: string) => {
- const { code, data, msg } = await prosperityShopApi.getGoodsCategory({ merchantId: id })
+const getGoodsCategoryTree = async (id: string) => {
+ const { code, data, msg } = await prosperityShopApi.getGoodsCategoryTree({ merchantId: id })
if (code != 0) return uni.showToast({ title: msg || "商品分类获取失败", icon: "none" })
state.category = treeToList(data) ?? []
}
diff --git a/src/pages/tabbar/onlineShop.vue b/src/pages/tabbar/onlineShop.vue
index f1231aa..731d4bc 100644
--- a/src/pages/tabbar/onlineShop.vue
+++ b/src/pages/tabbar/onlineShop.vue
@@ -216,7 +216,7 @@ const getClassify = async () => {
state.classifyList.unshift({ id: "", name: "全部分类" })
if (!isEmpty(state.classifyList)) {
state.params.categoryId = state.classifyList[0].id
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
}
}
@@ -234,20 +234,20 @@ const confirmRadioMerchant = async () => {
state.params.merchantId = state.curMerchant.id
cartStore.saveShopMerchantId(state.curMerchant.id)
await cartStore.getShopCart()
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
// 点击搜索
const searchProduct = () => {
state.params.categoryId = ""
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
// 切换分类
const doClassify = async (categoryId: string) => {
if (state.params.categoryId == categoryId) return
state.params.categoryId = categoryId
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
const pageHook = hooks.usePage(pageRef, onlineShopApi.getSpuList, null, "data.records")
diff --git a/src/pages/tabbar/prosperityShop.vue b/src/pages/tabbar/prosperityShop.vue
index 8a733e9..baa2c70 100644
--- a/src/pages/tabbar/prosperityShop.vue
+++ b/src/pages/tabbar/prosperityShop.vue
@@ -136,13 +136,13 @@ onLoad(async () => {
// const doClassify = async (categoryId: string) => {
// if (state.params.categoryId == categoryId) return
// state.params.categoryId = categoryId
-// pageRef.value && pageRef.value.reload(true)
+// pageRef.value && pageRef.value.reload(false)
// }
// 点击搜索
const search = () => {
// state.params.categoryId = ""
- pageRef.value && pageRef.value.reload(true)
+ pageRef.value && pageRef.value.reload(false)
}
// 联系商家
diff --git a/src/sheep/api/prosperityShop.ts b/src/sheep/api/prosperityShop.ts
index bcba12c..fc623fa 100644
--- a/src/sheep/api/prosperityShop.ts
+++ b/src/sheep/api/prosperityShop.ts
@@ -9,13 +9,14 @@ export default {
params: { productLimit: 5 },
})
},
- // 获取超市商户分类列表
- // getShopCategory: (): Promise => {
- // return request({
- // url: "/supermarket/app/mall/merchant/category/list",
- // method: "GET",
- // })
- // },
+ // 获取商品分类列表
+ getGoodsCategory: (params?: any): Promise => {
+ return request({
+ url: "/supermarket/app/mall/merchant/category/list",
+ method: "GET",
+ params,
+ })
+ },
// 获取超市详情
getShopDetail: (id: string): Promise => {
return request({
@@ -23,8 +24,8 @@ export default {
method: "GET",
})
},
- // 获取超市商品分类列表
- getGoodsCategory: (params: { merchantId: string }): Promise => {
+ // 获取超市商品分类列表树
+ getGoodsCategoryTree: (params: { merchantId: string }): Promise => {
return request({
url: `/supermarket/app/mall/category/tree`,
method: "GET",
@@ -46,4 +47,11 @@ export default {
method: "GET",
})
},
+ // 删除商品
+ deleteGoods: (id: string): Promise => {
+ return request({
+ url: `/supermarket/app/mall/merchant/product/${id}`,
+ method: "DELETE",
+ })
+ },
}
diff --git a/src/uni_modules/tm-ui/components/tm-picker-view/picker-item.vue b/src/uni_modules/tm-ui/components/tm-picker-view/picker-item.vue
index f223a0a..22b4268 100644
--- a/src/uni_modules/tm-ui/components/tm-picker-view/picker-item.vue
+++ b/src/uni_modules/tm-ui/components/tm-picker-view/picker-item.vue
@@ -1,54 +1,72 @@
-
+
{{ item }}
-
+
-
+ v-for="(item, index) in item2"
+ :key="index"
+ class="tmPickerViewWrapCoumn"
+ >
+
{{ item[rangText] || "" }}
@@ -183,7 +210,6 @@ export default {
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
-
}
.tmPickerView {
@@ -221,7 +247,6 @@ export default {
border-radius: 10px;
margin: 0 3px;
flex: 1;
-
}
.tmPickerContent {
@@ -239,4 +264,4 @@ export default {
border-radius: 10px;
/* background-color: #f5f5f5; */
}
-
\ No newline at end of file
+