feat: 商品列表查看详情跳转到商品管理进行编辑
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -159,8 +159,9 @@ export default {
|
|||||||
this.loadProducts()
|
this.loadProducts()
|
||||||
},
|
},
|
||||||
viewDetail(item) {
|
viewDetail(item) {
|
||||||
|
// 跳转到商品管理页面进行编辑
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/product/detail?productId=${item.productId}`
|
url: `/pages/product/manage?productId=${item.productId}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getStock(productId) {
|
getStock(productId) {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(options) {
|
||||||
if (!canManageProduct()) {
|
if (!canManageProduct()) {
|
||||||
uni.showToast({ title: '无权限', icon: 'none' })
|
uni.showToast({ title: '无权限', icon: 'none' })
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
@@ -172,6 +172,15 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loadCategories()
|
this.loadCategories()
|
||||||
this.loadProducts()
|
this.loadProducts()
|
||||||
|
// 如果传入了 productId,则打开编辑弹窗
|
||||||
|
if (options.productId) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const item = this.productList.find(p => p.productId === options.productId)
|
||||||
|
if (item) {
|
||||||
|
this.editProduct(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
computedArea() {
|
computedArea() {
|
||||||
|
|||||||
Reference in New Issue
Block a user