feat: 添加商品选择页面
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-03-24 11:57:19 +00:00
parent cd9e2edc8e
commit 6cdfc47250
3 changed files with 180 additions and 10 deletions

View File

@@ -22,14 +22,7 @@
<view class="section">
<view class="section-header">
<text class="section-title">商品明细</text>
<picker
mode="selector"
:range="productList"
range-key="name"
@change="onProductSelect"
>
<text class="add-btn">+ 添加商品</text>
</picker>
<text class="add-btn" @click="goToSelectProduct">+ 添加商品</text>
</view>
<view v-for="(item, index) in orderItems" :key="index" class="order-item">
@@ -188,8 +181,10 @@ export default {
selectCustomer(e) {
this.selectedCustomer = this.customers[e.detail.value]
},
onProductSelect(e) {
const product = this.productList[e.detail.value]
goToSelectProduct() {
uni.navigateTo({ url: '/pages/product/select' })
},
addProduct(product) {
// 检查是否已添加
const exists = this.orderItems.find(item => item.productId === product.productId)
if (exists) {