瀏覽代碼

home-products

youyawu 5 年之前
父節點
當前提交
8221f9b2a1

+ 106 - 0
src/assets/throbber.svg

@@ -0,0 +1,106 @@
+<svg version="1" xmlns="http://www.w3.org/2000/svg"
+                 xmlns:xlink="http://www.w3.org/1999/xlink"
+     width="16px" height="16px" viewBox="0 0 28 28">
+  <!-- 28= RADIUS*2 + STROKEWIDTH -->
+
+  <title>Material design circular activity spinner with CSS3 animation</title>
+  <style type="text/css">
+      /**************************/
+      /* STYLES FOR THE SPINNER */
+      /**************************/
+
+      /*
+       * Constants:
+       *      RADIUS      = 12.5
+       *      STROKEWIDTH = 3
+       *      ARCSIZE     = 270 degrees (amount of circle the arc takes up)
+       *      ARCTIME     = 1333ms (time it takes to expand and contract arc)
+       *      ARCSTARTROT = 216 degrees (how much the start location of the arc
+       *                                should rotate each time, 216 gives us a
+       *                                5 pointed star shape (it's 360/5 * 2).
+       *                                For a 7 pointed star, we might do
+       *                                360/7 * 3 = 154.286)
+       *
+       *      SHRINK_TIME = 400ms
+       */
+
+      .qp-circular-loader {
+        width:28px;  /* 2*RADIUS + STROKEWIDTH */
+        height:28px; /* 2*RADIUS + STROKEWIDTH */
+      }
+      .qp-circular-loader-path {
+        stroke-dasharray: 58.9;  /* 2*RADIUS*PI * ARCSIZE/360 */
+        stroke-dashoffset: 58.9; /* 2*RADIUS*PI * ARCSIZE/360 */
+                                 /* hides things initially */
+      }
+
+      /* SVG elements seem to have a different default origin */
+      .qp-circular-loader, .qp-circular-loader * {
+        -webkit-transform-origin: 50% 50%;
+      }
+
+      /* Rotating the whole thing */
+      @-webkit-keyframes rotate {
+        from {-webkit-transform: rotate(0deg);}
+        to {-webkit-transform: rotate(360deg);}
+      }
+      .qp-circular-loader {
+        -webkit-animation-name: rotate;
+        -webkit-animation-duration: 1568.63ms; /* 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
+        -webkit-animation-iteration-count: infinite;
+        -webkit-animation-timing-function: linear;
+      }
+
+      /* Filling and unfilling the arc */
+      @-webkit-keyframes fillunfill {
+        from {
+          stroke-dashoffset: 58.8 /* 2*RADIUS*PI * ARCSIZE/360 - 0.1 */
+                                  /* 0.1 a bit of a magic constant here */
+        }
+        50% {
+          stroke-dashoffset: 0;
+        }
+        to {
+          stroke-dashoffset: -58.4 /* -(2*RADIUS*PI * ARCSIZE/360 - 0.5) */
+                                   /* 0.5 a bit of a magic constant here */
+        }
+      }
+      @-webkit-keyframes rot {
+        from {
+          -webkit-transform: rotate(0deg);
+        }
+        to {
+          -webkit-transform: rotate(-360deg);
+        }
+      }
+      @-webkit-keyframes colors {
+        from {
+          stroke: #4285f4;
+        }
+        to {
+          stroke: #4285f4;
+        }
+      }
+      .qp-circular-loader-path {
+        -webkit-animation-name: fillunfill, rot, colors;
+        -webkit-animation-duration: 1333ms, 5332ms, 5332ms; /* ARCTIME, 4*ARCTIME, 4*ARCTIME */
+        -webkit-animation-iteration-count: infinite, infinite, infinite;
+        -webkit-animation-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1), steps(4), linear;
+        -webkit-animation-play-state: running, running, running;
+        -webkit-animation-fill-mode: forwards;
+      }
+
+  </style>
+
+  <!-- 3= STROKEWIDTH -->
+  <!-- 14= RADIUS + STROKEWIDTH/2 -->
+  <!-- 12.5= RADIUS -->
+  <!-- 1.5=  STROKEWIDTH/2 -->
+  <!-- ARCSIZE would affect the 1.5,14 part of this... 1.5,14 is specific to
+       270 degress -->
+  <g class="qp-circular-loader">
+    <path class="qp-circular-loader-path" fill="none" 
+          d="M 14,1.5 A 12.5,12.5 0 1 1 1.5,14" stroke-width="3"
+          stroke-linecap="round"></path>
+  </g>
+</svg>

+ 28 - 3
src/components/loadMore.vue

@@ -5,6 +5,7 @@
         <slot v-for="(item, index) in items" :index="index" :item="item" />
       </div>
       <el-pagination
+        v-if="pageType === 'pagination'"
         class="pagination"
         background
         layout="prev, pager, next,total, jumper"
@@ -12,6 +13,18 @@
         :page-size="rows"
         @current-change="page => load(page)"
       />
+      <div
+        class="increase"
+        v-if="pageType === 'increase' && items.length < count"
+        @click="load(params.pageNum + 1)"
+      >
+        {{ loading ? `正在加载` : increaseText + "  v" }}
+        <img v-if="loading" src="@assets/throbber.svg" />
+        <!-- <img
+          :src="require(`@assets/${loading ? `throbber.svg` : `throbber.svg`}`)"
+          alt=""
+        /> -->
+      </div>
     </template>
     <template v-else-if="count === 0 && !hideTip">
       <div class="noneData">
@@ -48,9 +61,13 @@ export default class extends Vue {
   private readonly rows!: number;
   @Prop(Boolean) private hideTip!: boolean;
   @PropSync("total") totalSync!: number;
-
+  @Prop({ default: "pagination" })
+  private readonly pageType!: "none" | "pagination" | "increase";
+  @Prop({ default: "点击加载更多" })
+  private increaseText!: string;
   private count: number | null = null;
   private items: any[] = [];
+  private loading = false;
   @Watch("params", { immediate: true, deep: true })
   reload() {
     if (!this.params) return;
@@ -62,15 +79,19 @@ export default class extends Vue {
   }
   @Emit("getItems")
   async load(pageNum: number) {
+    if (this.loading) return;
+    this.loading = true;
     const [err, { rows = [], total = 0 }] = await this.$post<IPageResult>(
       this.url,
-      Object.assign({}, this.params, {
+      Object.assign(this.params, {
         pageNum,
         pageSize: this.rows
       })
     );
     this.count = total;
-    return (this.items = rows);
+    this.items = [...(this.pageType === "increase" ? this.items : []), ...rows];
+    this.loading = false;
+    return this.items;
   }
 }
 </script>
@@ -85,6 +106,10 @@ export default class extends Vue {
     text-align: right;
     margin-top: 2rem;
   }
+  .increase {
+    text-align: center;
+    cursor: pointer;
+  }
   .noneData {
     padding: 5rem;
     text-align: center;

+ 1 - 1
src/lang/zh.ts

@@ -25,7 +25,7 @@ export default {
   errCode: {
     "-100": "网络请求失败",
     "-1": "发生未知错误",
-    "301": "账号已存在",
+    "301": "用户名已存在",
     "302": "手机号已存在",
     "303": "账号或密码错误",
     "304": "验证码错误",

+ 1 - 1
src/layout/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="layout">
     <y-header @reload="reload" />
-    <keep-alive exclude="shopEnterAdd,infoList" v-if="showView">
+    <keep-alive exclude="shopEnterAdd,infoList,shopEnter" v-if="showView">
       <router-view class="main" />
     </keep-alive>
     <y-footer />

+ 2 - 2
src/router/index.ts

@@ -48,7 +48,6 @@ const router = new VueRouter({
       component: layout,
       redirect: "/home",
       children: [
-        ...nav,
         {
           path: "/login",
           component: () => import("../views/account/login.vue"),
@@ -143,7 +142,8 @@ const router = new VueRouter({
           component: () => import("../views/news/details.vue"),
           props: true,
           meta: { title: "newsDetail" }
-        }
+        },
+        ...nav
       ]
     },
     {

+ 1 - 0
src/types/global.d.ts

@@ -47,6 +47,7 @@ interface IMenu {
   id: number;
   pId: number;
   title: string;
+  remake: string;
 }
 interface IDict {
   key: string;

+ 1 - 0
src/views/account/findPassword.vue

@@ -45,6 +45,7 @@
                 v-model="form.loginPassword"
                 prefix-icon="x-el-icon-lock"
                 placeholder="新密码"
+                show-password
               />
             </el-form-item>
 

+ 4 - 6
src/views/account/login.vue

@@ -27,14 +27,16 @@
                 v-model="form.loginPassword"
                 prefix-icon="x-el-icon-lock"
                 placeholder="请输入密码"
+                show-password
               />
             </el-form-item>
-            <el-form-item class="formItem yzm" prop="validateCode">
+            <el-form-item class="formItem " prop="validateCode">
               <img class="icon" src="@assets/yz.png" alt="" />
               <el-input
                 v-model="form.validateCode"
                 prefix-icon="icon-yzm"
                 placeholder="请输入验证码"
+                class="yzm"
               />
               <img
                 class="verifyImg"
@@ -203,11 +205,7 @@ export default class extends Vue {
       }
     }
   }
-}
-</style>
-<style lang="scss">
-.formItem.yzm {
-  .el-input {
+  .yzm {
     width: 150px;
   }
   .verifyImg {

+ 4 - 12
src/views/account/register.vue

@@ -27,6 +27,7 @@
                 v-model="form.loginPassword"
                 prefix-icon="x-el-icon-lock"
                 placeholder="登录密码"
+                show-password
               />
             </el-form-item>
             <el-form-item class="formItem" prop="phone">
@@ -37,12 +38,13 @@
                 placeholder="手机号码"
               />
             </el-form-item>
-            <el-form-item class="formItem yzm" prop="validateCode">
+            <el-form-item class="formItem " prop="validateCode">
               <img class="icon" src="@assets/yz.png" alt="" />
               <el-input
                 v-model="form.validateCode"
                 prefix-icon="icon-yzm"
                 placeholder="验证码"
+                class="yzm"
               />
               <div class="getyzm">获取验证码</div>
             </el-form-item>
@@ -231,18 +233,8 @@ export default class extends Vue {
       }
     }
   }
-}
-</style>
-<style lang="scss">
-.formItem.yzm {
-  .el-input {
+  .yzm {
     width: 200px;
   }
-  .verifyImg {
-    height: 40px;
-    width: 108px;
-    margin-left: 10px;
-    vertical-align: middle;
-  }
 }
 </style>

+ 30 - 23
src/views/account/user/editPassword.vue

@@ -16,7 +16,7 @@
             :rules="rules"
             label-width="180px"
           >
-            <el-form-item prop="loginName">
+            <!-- <el-form-item prop="loginName">
               <span slot="label">
                 <img src="@assets/user.png" alt="" />
                 用户名:
@@ -25,7 +25,7 @@
                 v-model="form.loginName"
                 placeholder="请输入用户名/登录账号"
               />
-            </el-form-item>
+            </el-form-item> -->
             <el-form-item prop="oldPassword">
               <span slot="label">
                 <img src="@assets/lock.png" alt="" />
@@ -35,14 +35,19 @@
                 v-model="form.oldPassword"
                 type="password"
                 placeholder="请输入旧密码"
+                show-password
               />
             </el-form-item>
-            <el-form-item prop="newPassword">
+            <el-form-item prop="loginPassword">
               <span slot="label">
                 <img src="@assets/lock.png" alt="" />
                 新密码:
               </span>
-              <el-input v-model="form.newPassword" placeholder="请输入新密码" />
+              <el-input
+                v-model="form.loginPassword"
+                placeholder="请输入新密码"
+                show-password
+              />
             </el-form-item>
             <el-form-item prop="surePassword">
               <span slot="label">
@@ -52,6 +57,7 @@
               <el-input
                 v-model="form.surePassword"
                 placeholder="请再次输入新密码"
+                show-password
               />
             </el-form-item>
           </el-form>
@@ -73,29 +79,30 @@
 import { Component, Vue, Watch } from "vue-property-decorator";
 import { RegAccount } from "@/utils";
 import { ElForm } from "element-ui/types/form";
+import user from "@/store/modules/user";
 @Component
 export default class extends Vue {
   private form = {
     loginName: "",
     oldPassword: "",
-    newPassword: "",
+    loginPassword: "",
     surePassword: ""
   };
   private rules = {
-    loginName: [
-      { required: true, message: "请输入用户名", trigger: "blur" },
-      {
-        validator: (rule: any, value: string, callback: any) =>
-          callback(
-            RegAccount.test(value)
-              ? undefined
-              : new Error("用户名必须为9到16位由数字字母组合")
-          ),
-        trigger: "blur"
-      }
-    ],
+    // loginName: [
+    //   { required: true, message: "请输入用户名", trigger: "blur" },
+    //   {
+    //     validator: (rule: any, value: string, callback: any) =>
+    //       callback(
+    //         RegAccount.test(value)
+    //           ? undefined
+    //           : new Error("用户名必须为9到16位由数字字母组合")
+    //       ),
+    //     trigger: "blur"
+    //   }
+    // ],
     oldPassword: [{ required: true, message: "请输入旧密码", trigger: "blur" }],
-    newPassword: [
+    loginPassword: [
       { required: true, message: "请输入新密码", trigger: "blur" },
       {
         validator: (rule: any, value: string, callback: any) =>
@@ -113,7 +120,7 @@ export default class extends Vue {
         validator: (rule: any, value: string, callback: any) => {
           if (value === "") {
             callback(new Error("请再次输入密码"));
-          } else if (value !== this.form.newPassword) {
+          } else if (value !== this.form.loginPassword) {
             callback(new Error("两次输入密码不一致!"));
           } else {
             callback();
@@ -124,18 +131,18 @@ export default class extends Vue {
     ]
   };
   get DomForm() {
-    console.log(this.$refs);
     return this.$refs.form as ElForm;
   }
   validate() {
     this.DomForm.validate(x => x && this.submit());
   }
   async submit() {
-    const [err] = await this.$post("/", this.form);
+    const [err] = await this.$post("/member/info/editPassword", this.form);
     if (err) return;
     this.DomForm.resetFields();
-    this.$message.success("密码修改成功");
-    // this.$router.push("/");
+    this.$message.success("密码修改成功 请重新登陆");
+    await this.$router.push("/login");
+    user.clear();
   }
 }
 </script>

+ 189 - 61
src/views/home/index.vue

@@ -56,29 +56,96 @@
         <img src="@assets/home_ggw1.png" alt />
       </div>
       <div class="partTitle">
-        <span class="orangeLine"></span>热门商品
+        <span class="orangeLine"></span>产品中心
         <router-link to="/mall">
           <span class="more">more<i class="el-icon-d-arrow-right"></i></span>
         </router-link>
       </div>
-      <div class="rmspList">
-        <router-link
-          :to="`/shop/${item.companyId}/${item.id}`"
-          class="product"
-          v-for="item in products"
-          :key="item.id"
+      <div class="categoryList bg-F5">
+        <el-carousel
+          :autoplay="false"
+          arrow="always"
+          indicator-position="none"
+          ref="carousel"
+          class=" marquee"
         >
+          <el-carousel-item
+            v-for="(items, index) in categoryList"
+            :key="`carousel-categoryList-${index}`"
+          >
+            <div
+              v-for="({ title, remake, id }, index) in items"
+              :key="`categoryList${index}`"
+              class="item"
+              :class="{ curr: params.typeId === id }"
+              @click="params.typeId = params.typeId === id ? 0 : id"
+            >
+              <div class="img">
+                <img :src="`${$basePath}${remake}`" alt="" srcset="" />
+              </div>
+              <h3>{{ title }}</h3>
+            </div>
+          </el-carousel-item>
+        </el-carousel>
+      </div>
+
+      <load-more
+        class="productList"
+        url="/goods/info/page"
+        pageType="increase"
+        :params="params"
+        v-slot="{
+          item: { id, name, companyId, price, cover, companyName }
+        }"
+      >
+        <router-link :to="`/shop/${companyId}/${id}`" class="product">
           <div class="imgDiv">
-            <img :src="`${$basePath}${item.cover}`" />
+            <img :src="`${$basePath}${cover}`" />
           </div>
-          <a :title="item.name" class="name">{{ item.name }}</a>
+          <a :title="name" class="name">{{ name }}</a>
           <div class="money">
             ¥
-            <span>{{ item.price }}</span>
+            <span>{{ price }}</span>
           </div>
-          <div class="company ">{{ item.companyName }}</div>
+          <div class="company ">{{ companyName }}</div>
         </router-link>
-      </div>
+      </load-more>
+      <el-row :gutter="20">
+        <el-col
+          :span="12"
+          v-for="(items, index) in products"
+          :key="`products${index}`"
+          class="products"
+        >
+          <div class="partTitle">
+            <span class="orangeLine"></span
+            >{{ index ? "热门商品" : "新品推荐" }}
+            <router-link :to="`/mall`">
+              <span class="more"
+                >more<i class="el-icon-d-arrow-right"></i
+              ></span>
+            </router-link>
+          </div>
+
+          <router-link
+            v-for="({ id, name, companyId, price, cover, companyName },
+            index) in items"
+            :key="`products-item-${index}`"
+            :to="`/shop/${companyId}/${id}`"
+            class="product"
+          >
+            <div class="imgDiv">
+              <img :src="`${$basePath}${cover}`" />
+            </div>
+            <a :title="name" class="name">{{ name }}</a>
+            <div class="money">
+              ¥
+              <span>{{ price }}</span>
+            </div>
+            <div class="company ">{{ companyName }}</div>
+          </router-link>
+        </el-col>
+      </el-row>
       <div class="partTitle ppsj">
         <span class="orangeLine"></span>品牌商家
         <router-link to="/shops" class="more"
@@ -190,11 +257,16 @@
 </template>
 <script lang="ts">
 import { Component, Vue, Watch, Prop } from "vue-property-decorator";
+import menu from "@/store/modules/menu";
+import { chunk } from "lodash";
 @Component
 export default class extends Vue {
+  private params = {
+    typeId: 0
+  };
+  private products: IAny[][] = [];
   private notices: IAny[] = [];
   private infos: IAny[] = [];
-  private products: IAny[] = [];
   private shops: IAny[] = [];
   private fwList: Array<{
     img: string;
@@ -231,7 +303,7 @@ export default class extends Vue {
       .split(",")
       .map(url => this.$post(url.trim()));
     const [
-      { list: p },
+      { newList, hotlist },
       { demandList: d },
       { supplyList: s },
       { list: shops },
@@ -246,7 +318,7 @@ export default class extends Vue {
         })
       )
     ]).then(x => x.map(([, data]) => data));
-    this.products = p;
+    this.products = [newList, hotlist];
     this.infos = [d, s];
     this.shops = shops;
     [companyNum, goodsNum, memberNum].forEach(
@@ -254,6 +326,9 @@ export default class extends Vue {
     );
     this.notices = n.map(({ list }) => list);
   }
+  get categoryList() {
+    return chunk(menu.pList, 6);
+  }
 }
 </script>
 
@@ -295,6 +370,45 @@ export default class extends Vue {
     }
   }
 }
+.categoryList {
+  height: 100px;
+  overflow: hidden;
+  margin-bottom: 20px;
+  .item {
+    width: 180px;
+    height: 100%;
+    float: left;
+    overflow: hidden;
+    box-sizing: border-box;
+    background: #fff;
+    padding: 10px;
+    margin-left: 16px;
+    &:first-child {
+      margin-left: 0;
+    }
+    &.curr {
+      border: 1px solid red;
+    }
+    .img {
+      height: 60px;
+      position: relative;
+      cursor: pointer;
+      img {
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate(-50%, -50%);
+        max-width: 80%;
+        max-height: 80%;
+      }
+    }
+    h3 {
+      line-height: 20px;
+      text-align: center;
+      font-size: 16px;
+    }
+  }
+}
 .partTitle {
   padding: 3rem 0 2rem 0;
   font-size: 1.8rem;
@@ -411,61 +525,75 @@ export default class extends Vue {
     }
   }
 }
-.rmspList {
+.products {
+  .product {
+    width: 275px;
+    &:nth-child(2n + 1) {
+      margin-right: 0;
+    }
+  }
+}
+.productList {
   .product {
-    display: inline-block;
     width: 216px;
-    height: 340px;
-    background: #fff;
-    overflow: hidden;
-    margin-right: 20px;
-    margin-bottom: 1rem;
-    border-radius: 0.4rem;
-    box-sizing: border-box;
-    padding: 2rem;
     &:nth-child(5n + 5) {
       margin-right: 0;
     }
-    .imgDiv {
-      border: 0.1rem solid #e5e5e5;
-      width: 175px;
-      height: 200px;
-      text-align: center;
-      line-height: 0;
-      position: relative;
-      img {
-        width: 90%;
-        position: absolute;
-        top: 50%;
-        left: 50%;
-        transform: translate(-50%, -50%);
-      }
-    }
-    .name {
-      font-size: 1.4rem;
-      color: #333;
-      font-weight: bold;
-      margin-top: 15px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-      display: block;
-    }
-    .money {
-      font-size: 1.2rem;
-      margin-top: 5px;
-      color: #fd5522;
-      span {
-        font-size: 1.8rem;
-      }
+  }
+}
+.product {
+  display: inline-block;
+
+  height: 340px;
+  background: #fff;
+  overflow: hidden;
+  margin-right: 20px;
+  margin-bottom: 1rem;
+  border-radius: 0.4rem;
+  box-sizing: border-box;
+  padding: 2rem;
+
+  .imgDiv {
+    border: 0.1rem solid #e5e5e5;
+    width: 100%;
+    height: 60%;
+    text-align: center;
+    line-height: 0;
+    position: relative;
+    img {
+      max-width: 90%;
+      max-height: 90%;
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%, -50%);
     }
-    .company {
-      margin-top: 10px;
-      font-size: 1.2rem;
-      color: #666;
+  }
+  .name {
+    font-size: 1.4rem;
+    color: #333;
+    font-weight: bold;
+    margin-top: 15px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    display: block;
+  }
+  .money {
+    font-size: 1.2rem;
+    margin-top: 5px;
+    color: #fd5522;
+    span {
+      font-size: 1.8rem;
     }
   }
+  .company {
+    margin-top: 10px;
+    font-size: 1.2rem;
+    color: #666;
+  }
 }
+
 .xqgy {
   overflow: hidden;
   // height: 430px;

+ 3 - 0
src/views/mall/index.vue

@@ -136,6 +136,9 @@ export default class extends Vue {
     };
   }
 
+  // activated() {
+  //   console.log(this.$route);
+  // }
   get items() {
     return [{ id: 0, title: "全部" }, ...menu.pList];
   }

+ 0 - 37
src/views/news/details.vue

@@ -32,43 +32,6 @@ export default class extends Vue {
     this.detailObj = sysNotice;
   }
 }
-// export default {
-//   name: "app",
-//   components: {},
-//   data() {
-//     return {
-//       noticeId: "",
-//       detailObj: {}
-//     };
-//   },
-//   methods: {
-//     detail() {
-//       var that = this;
-//       that
-//         .$post("/interface/notice/getNoticeListById", {
-//           noticeId: that.noticeId
-//         })
-//         .then(function(res) {
-//           console.log(res);
-//           if (!res[0]) {
-//             that.detailObj = res[1].sysNotice;
-//           }
-//         });
-//     }
-//   },
-//   activated() {
-//     if (this.$route.query.noticeId) {
-//       this.noticeId = this.$route.query.noticeId;
-//       this.detail();
-//     }
-//   },
-//   mounted() {
-//     if (this.$route.query.noticeId) {
-//       this.noticeId = this.$route.query.noticeId;
-//       this.detail();
-//     }
-//   }
-// };
 </script>
 <style lang="scss" scoped>
 .container {

+ 7 - 1
src/views/shops/details/index.vue

@@ -29,7 +29,10 @@
     </div>
     <div class="navs ">
       <div class="container">
-        <router-link class="nav " :to="`/shop/${sid}/products`"
+        <router-link
+          class="nav "
+          :to="`/shop/${sid}/products`"
+          @click.native="refresh"
           >首页
         </router-link>
         <router-link class="nav  " :to="`/shop/${sid}/profile`"
@@ -74,6 +77,9 @@ export default class extends Vue {
     this.shopInfo.isFollow = 1;
     this.$message.success("关注成功");
   }
+  refresh() {
+    this.shopInfo = { ...this.shopInfo };
+  }
 }
 </script>
 <style lang="scss" scoped>

+ 1 - 1
src/views/shops/enter/add.vue

@@ -393,7 +393,7 @@ export default class extends Vue {
     if (err) return;
     this.DomForm.resetFields();
     this.$message.success("信息提交成功");
-    // this.$router.push("/");
+    this.$router.push("/shopEnter");
   }
   success(type: string, url: string, uid: number) {
     this.fileList.push({ type, url, uid });

+ 1 - 1
src/views/shops/enter/index.vue

@@ -77,7 +77,7 @@
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
 import dict from "@/store/modules/dict";
-@Component
+@Component({ name: "shopEnter" })
 export default class extends Vue {
   private companyName = "";
   private status = "";

+ 3 - 2
src/views/shops/index.vue

@@ -13,7 +13,8 @@
             companyName,
             primaryBusiness,
             propagandaImgUrl,
-            defaultImgUrl
+            defaultImgUrl,
+            goodsCount
           }
         }"
       >
@@ -22,7 +23,7 @@
           <div class="details fl">
             <div class="name">{{ companyName }}</div>
             <div class="desc">主营:{{ primaryBusiness }}</div>
-            <div class="total">共计900件商品</div>
+            <div class="total">共计{{ goodsCount }}件商品</div>
             <span class="in">进入店铺</span>
           </div>
           <div