Funny 3 роки тому
батько
коміт
6d15c48076
2 змінених файлів з 45 додано та 6 видалено
  1. 5 4
      src/components/orderComponents/orderList.vue
  2. 40 2
      src/views/home.vue

+ 5 - 4
src/components/orderComponents/orderList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div> 
+  <div>
     <el-row class="track-detail">
       <!-- 订单追踪、订单详情 -->
       <el-col :span="7" v-loading="!orderDetailStutus && !showTrack" element-loading-text="拼命加载中">
@@ -29,7 +29,7 @@
                 <el-dropdown>
                   <span class="el-dropdown-link">更多</span>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId)" ><span style="color: #fc7200">补打发票</span></el-dropdown-item>
+                    <el-dropdown-item @click.native="orderPrinter(list[curIdx].waimaiOrderId)"><span style="color: #fc7200">补打发票</span></el-dropdown-item>
                     <el-dropdown-item @click.native="iGnoreOrder(list[curIdx].id)">忽略订单</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -39,7 +39,7 @@
                   list[curIdx].delayTime ? "修改定时" : "定时发单"
                 }}</el-button>
               <el-button v-else size="small" @click.native="cancelOrder(list[curIdx].id)" class="btn_bots">取消订单</el-button>
-              
+
               <el-button size="small" @click.native="sendNow(list[curIdx])" class="btn_bots btn">发起配送</el-button>
             </div>
             <!-- 待接单 -->
@@ -497,6 +497,8 @@ export default {
       this.$confirm("取消订单可能会存在违约金, 是否继续?", "提示", {
         confirmButtonText: "取消",
         cancelButtonText: "确定",
+        showClose: false,
+        closeOnClickModal: false,
         center: true,
         type: "warning",
       })
@@ -601,7 +603,6 @@ export default {
         type: "warning",
       })
         .then(() => {
-          console.log(11111);
           ignoreOrder({ orderId }).then((res) => {
             if (res.code == 200) {
               this.$message({

+ 40 - 2
src/views/home.vue

@@ -21,6 +21,7 @@
         <router-view></router-view>
       </el-main>
     </el-container>
+    <shop-add ref="shopAdd" :products="productList"></shop-add>
   </el-container>
 </template>
 
@@ -29,10 +30,13 @@ import sidebar from "../common/sider.vue";
 import headerVue from "../common/header.vue";
 import { mapState } from "vuex";
 import bus from "../common/bus.js";
+import shopAdd from "../components/shopCompoents/shopAdd";
+import { getProductList } from "../api/shop.js";
 export default {
   data() {
     return {
       audio: null,
+      productList: [],
     };
   },
   computed: {
@@ -41,12 +45,46 @@ export default {
   components: {
     sidebar,
     headerVue,
+    shopAdd,
   },
   created() {
     bus.$emit("openGetSoundMsg");
+    this.getProductList();
+    let memberType = this.$store.state.userInfo.memberType;
+    if (memberType === 1) {
+      this.$confirm("您当前还不是商户,请先申请成为商户!", "提示", {
+        confirmButtonText: "成为商户",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    }
   },
 
   methods: {
+    getProductList() {
+      getProductList().then((res) => {
+        if (res.code === 200) {
+          this.productList = res.data;
+        } else {
+          this.$message({
+            type: "error",
+            message: res.msg,
+          });
+        }
+      });
+    },
     goPrinter() {
       this.$router.push({
         path: "/shopInfo/shopInfos",
@@ -54,8 +92,8 @@ export default {
           tabNum: 3,
         },
       });
-      if(this.$route.name === 'shopInfos'){
-        bus.$emit('goPrinter')
+      if (this.$route.name === "shopInfos") {
+        bus.$emit("goPrinter");
       }
     },
     loginOut() {