Quellcode durchsuchen

Merge branch 'feature_点餐优化' of elab-damai-h5/h5-dm-orderFront into master

周建思 vor 3 Wochen
Ursprung
Commit
9dd65fc2da
2 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
  1. 2 2
      src/views/orders/list.vue
  2. 4 2
      src/views/workbench/index.vue

+ 2 - 2
src/views/orders/list.vue

@@ -106,9 +106,9 @@
                       <div>
                         <div v-for="orderDish in row.orderDishes" :key="orderDish.id">
                             {{ orderDish.name }}<span style="margin: 0 15px 0 15px;">x</span>{{orderDish.number}}
-                            <div v-if="orderDish.specsList && orderDish.specsList.length">
+                            <div v-if="orderDish.specsList && orderDish.specsList.length > 0">
                                 <div v-for="spec in orderDish.specsList" :key="spec.id" class="refund-info" style="margin-left: 20px;margin-top: 0;">
-                                    - {{ spec.name }}: {{ spec.value }}
+                                  <span v-if="spec.name && spec.value">- {{ spec.name }}: {{ spec.value }}</span>
                                 </div>
                             </div>
                         </div>

+ 4 - 2
src/views/workbench/index.vue

@@ -5,7 +5,7 @@
                 <template #header>
                     <span class="card-title">店铺信息</span>
                 </template>
-                <div class="w-40">
+                <div>
                     <div class="flex leading-9">
                         <div class="w-20 flex-none">店铺名称:</div>
                         <span v-text="workbenchData.shopName"></span>
@@ -432,9 +432,11 @@ const changeStatus = () => {
 }
 const dishTop10 = () => {
     statisticsDishTop10().then((res) => {
-        const list = res || []
+        let list = res || []
         // 按照 quantity 倒序排列
         list.sort((a: { quantity: number }, b: { quantity: number }) => b.quantity - a.quantity)
+        // 只取前10个菜品
+        list = list.slice(0, 10);
         // console.warn("**statisticsDishTop10****",list)
         workbenchData.listOption.yAxis.data = list.map((it: { title: any }) => it.title)
         workbenchData.listOption.series[0].data = list.map((it: { quantity: any }) => it.quantity)