From 3ee4a6cccd325a6db5301c9e694073c6e754d8a8 Mon Sep 17 00:00:00 2001 From: Agent Date: Tue, 24 Mar 2026 09:59:49 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8picker=E6=9B=BF=E4=BB=A3popup?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/create.vue | 81 ++++++++------------------------------ 1 file changed, 16 insertions(+), 65 deletions(-) diff --git a/src/pages/order/create.vue b/src/pages/order/create.vue index c304fa0..5361d4c 100644 --- a/src/pages/order/create.vue +++ b/src/pages/order/create.vue @@ -22,7 +22,14 @@ 商品明细 - + 添加商品 + + + 添加商品 + @@ -136,30 +143,6 @@ - - - - - - 选择商品 - 关闭 - - - - - - - {{ p.name }} - ¥{{ p.price }} - - - - @@ -205,10 +188,8 @@ export default { selectCustomer(e) { this.selectedCustomer = this.customers[e.detail.value] }, - addProduct() { - this.$refs.productPopup.open() - }, - selectProduct(product) { + onProductSelect(e) { + const product = this.productList[e.detail.value] // 检查是否已添加 const exists = this.orderItems.find(item => item.productId === product.productId) if (exists) { @@ -218,6 +199,12 @@ export default { this.orderItems.push({ productId: product.productId, + productName: product.name, + price: product.price, + quantity: 1 + }) + this.calcAmount() + }, productName: product.name, spec: product.spec, unit: product.unit, @@ -226,7 +213,6 @@ export default { }) this.calcAmount() - this.$refs.productPopup.close() }, removeItem(index) { this.orderItems.splice(index, 1) @@ -499,39 +485,4 @@ export default { border-radius: 40rpx; font-size: 28rpx; } - -.product-popup { - background: #fff; - height: 60vh; - border-radius: 24rpx 24rpx 0 0; -} - -.popup-header { - display: flex; - justify-content: space-between; - padding: 24rpx; - border-bottom: 1rpx solid #eee; -} - -.popup-search { - padding: 20rpx; -} - -.popup-search input { - height: 60rpx; - background: #f5f5f5; - border-radius: 8rpx; - padding: 0 20rpx; -} - -.popup-list { - height: calc(60vh - 140rpx); -} - -.popup-item { - display: flex; - justify-content: space-between; - padding: 24rpx; - border-bottom: 1rpx solid #f5f5f5; -}