|
|
@@ -20,11 +20,6 @@
|
|
|
</view>
|
|
|
<slot name="footer"></slot>
|
|
|
|
|
|
- <!-- 测试按钮:打开花材网格选择弹框 -->
|
|
|
- <view class="flower-grid-test-btn" @tap="openFlowerGridPopup">
|
|
|
- <text>📋 批量选择花材</text>
|
|
|
- </view>
|
|
|
-
|
|
|
<!-- 开单选花材输入数量和金额 -->
|
|
|
<uni-popup ref="selectNumPriceRef" background-color="#fff" type="center" :animation="false">
|
|
|
<selectNum v-if="currentJobType=='make'" @confirmAddItemModel="confirmAddItemModel" :customData.sync="customData" @cancelKdSelectNumPrice="addItemModelHidden"></selectNum>
|
|
|
@@ -33,7 +28,7 @@
|
|
|
|
|
|
<!-- 花材网格选择弹框 -->
|
|
|
<uni-popup ref="selectFlowerGridRef" background-color="#fff" type="center" :animation="false">
|
|
|
- <selectFlowerGrid :flowerData="gridFlowerList" @confirm="confirmFlowerGrid" @cancel="cancelFlowerGrid"></selectFlowerGrid>
|
|
|
+ <selectFlowerGrid :flowerData="globalGridFlowerList" @confirm="confirmFlowerGrid" @cancel="cancelFlowerGrid"></selectFlowerGrid>
|
|
|
</uni-popup>
|
|
|
|
|
|
</view>
|
|
|
@@ -50,8 +45,7 @@ export default {
|
|
|
data(){
|
|
|
return {
|
|
|
currentJobType:'bill',
|
|
|
- currentJobId:0,
|
|
|
- gridFlowerList:[]
|
|
|
+ currentJobId:0
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
@@ -118,98 +112,6 @@ export default {
|
|
|
addListenScan(){
|
|
|
this.listenScanItem()
|
|
|
},
|
|
|
- // 打开花材网格选择弹框
|
|
|
- openFlowerGridPopup() {
|
|
|
- this.$util.hitVoice()
|
|
|
-
|
|
|
- // 如果有真实数据,使用真实数据;否则使用模拟数据
|
|
|
- const mockFlowers = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '自由女神A级',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23C41E3A" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E自由女神%3C/text%3E%3C/svg%3E',
|
|
|
- price: 88,
|
|
|
- stock: 150,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: '香槟玫瑰',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23F4D03F" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E香槟玫瑰%3C/text%3E%3C/svg%3E',
|
|
|
- price: 65,
|
|
|
- stock: 200,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- name: '白玫瑰',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFFFFF" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E白玫瑰%3C/text%3E%3C/svg%3E',
|
|
|
- price: 55,
|
|
|
- stock: 180,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- name: '粉玫瑰',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E粉玫瑰%3C/text%3E%3C/svg%3E',
|
|
|
- price: 60,
|
|
|
- stock: 160,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 5,
|
|
|
- name: '向日葵',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFD700" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E向日葵%3C/text%3E%3C/svg%3E',
|
|
|
- price: 45,
|
|
|
- stock: 120,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 6,
|
|
|
- name: '郁金香',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FF69B4" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E郁金香%3C/text%3E%3C/svg%3E',
|
|
|
- price: 50,
|
|
|
- stock: 140,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 7,
|
|
|
- name: '百合',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFF8DC" width="200" height="200"/%3E%3Crect fill="none" stroke="%23ddd" stroke-width="2" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23333" text-anchor="middle" dy=".3em"%3E百合%3C/text%3E%3C/svg%3E',
|
|
|
- price: 75,
|
|
|
- stock: 100,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 8,
|
|
|
- name: '康乃馨',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23FFB6C1" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E康乃馨%3C/text%3E%3C/svg%3E',
|
|
|
- price: 35,
|
|
|
- stock: 250,
|
|
|
- property: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 9,
|
|
|
- name: '绣球花',
|
|
|
- cover: 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%239370DB" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" font-size="24" fill="%23fff" text-anchor="middle" dy=".3em"%3E绣球花%3C/text%3E%3C/svg%3E',
|
|
|
- price: 70,
|
|
|
- stock: 110,
|
|
|
- property: 0
|
|
|
- }
|
|
|
- ]
|
|
|
-
|
|
|
- // 使用真实数据或模拟数据
|
|
|
- const sourceData = this.globalRightItemInfloList && this.globalRightItemInfloList.length > 0
|
|
|
- ? this.globalRightItemInfloList
|
|
|
- : mockFlowers
|
|
|
-
|
|
|
- // 将列表数据传递给弹框,并重置选择数量
|
|
|
- this.gridFlowerList = sourceData.map(item => ({
|
|
|
- ...item,
|
|
|
- selectedQty: 0
|
|
|
- }))
|
|
|
- this.$refs.selectFlowerGridRef.open()
|
|
|
- },
|
|
|
// 确认花材网格选择
|
|
|
confirmFlowerGrid(selectedItems) {
|
|
|
// 处理选中的花材
|
|
|
@@ -218,7 +120,6 @@ export default {
|
|
|
// 例如添加到购物车或其他操作
|
|
|
console.log(`已选择: ${item.name}, 数量: ${item.selectedQty}`)
|
|
|
})
|
|
|
-
|
|
|
this.$msg(`已选择 ${selectedItems.length} 种花材`)
|
|
|
this.$refs.selectFlowerGridRef.close()
|
|
|
},
|