youyawu 5 سال پیش
والد
کامیت
55aaf15bfe

+ 1 - 0
.env.development

@@ -1,3 +1,4 @@
 VUE_APP_Target=http://192.168.100.254:10002/
 VUE_APP_BASE_API=/api/
+VUE_APP_MANAGER_URL=http://192.168.100.254:10000/
 devtool=cheap-module-eval-source-map

+ 1 - 0
.env.production

@@ -1,3 +1,4 @@
 VUE_APP_Target=/
 VUE_APP_BASE_API=http://192.168.100.254:10002/
+VUE_APP_MANAGER_URL=http://192.168.100.254:10000/
 devtool=cheap-module-source-map

+ 4 - 1
public/index.html

@@ -6,7 +6,6 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
   <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
-  <script defer="true" src="http://ikefu.dgtis.com:80/im/0dMc4l.html"></script>
   <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=tRYGyu9yuGOVk2HNdf5fBxcjV3TmtDMA"></script>
   <title>中国钢制家具产业聚集网</title>
 </head>
@@ -18,6 +17,10 @@
   </noscript>
   <div id="app"></div>
   <!-- built files will be auto injected -->
+
+  <% if (NODE_ENV!=='development') { %>
+  <script defer="true" src="http://ikefu.dgtis.com:80/im/0dMc4l.html"></script>
+  <% } %>
 </body>
 
 </html>

+ 7 - 8
src/components/category.vue

@@ -2,7 +2,7 @@
   <div class="menuDiv">
     <h3 v-if="showHeader">商品分类</h3>
     <ul class="menuUl">
-      <li v-for="{ id, title } in items" :key="id" class="menuli">
+      <li v-for="{ id, title, subList } in items" :key="id" class="menuli">
         <div
           class="dalei"
           :class="{ curr: currPid === id }"
@@ -12,9 +12,9 @@
           {{ title }}
           <i class="el-icon-arrow-right"></i>
         </div>
-        <div class="menuCon">
+        <div class="menuCon" v-if="subList.length">
           <div
-            v-for="{ id: sid, title: st } in getSub(id)"
+            v-for="{ id: sid, title: st } in subList"
             :key="sid"
             :class="{ item: true, curr: currSid === sid }"
             @click="() => setCurrIndex(sid, id)"
@@ -35,7 +35,10 @@ export default class extends Vue {
   private currId!: number;
   @Prop(Boolean) private showHeader!: boolean;
   get items() {
-    return menu.pList;
+    return menu.pList.map(x => ({
+      ...x,
+      subList: menu.subList(x.id)
+    }));
   }
   get info() {
     return menu.info(this.currId);
@@ -48,10 +51,6 @@ export default class extends Vue {
     if (!this.info) return 0;
     return this.info.id;
   }
-
-  getSub(pid: number) {
-    return menu.subList(pid);
-  }
   @Emit("change")
   setCurrIndex(id: number, pid = id) {
     return { id, pid };

+ 41 - 0
src/components/productImgs.vue

@@ -0,0 +1,41 @@
+<template>
+  <div class="imgs ">
+    <img :src="imgs[currImgIndex]" alt="" />
+    <img
+      v-for="(s, index) in imgs"
+      :key="`imgs${index}`"
+      :src="s"
+      @mouseover="currImgIndex = index"
+    />
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch, Prop } from "vue-property-decorator";
+@Component
+export default class extends Vue {
+  private currImgIndex = 0;
+
+  @Prop(String)
+  private img!: string;
+
+  get imgs() {
+    return (this.img + "").split(",").map(x => this.$basePath + x);
+  }
+}
+</script>
+<style lang="scss" scoped>
+.imgs {
+  width: 400px;
+  img {
+    width: 92px;
+    height: 92px;
+    margin-right: 10px;
+    cursor: pointer;
+    &:nth-child(1) {
+      width: 400px;
+      height: 400px;
+      margin-bottom: 20px;
+    }
+  }
+}
+</style>

+ 1 - 0
src/lang/zh.ts

@@ -30,6 +30,7 @@ export default {
     "303": "账号或密码错误",
     "304": "验证码错误",
     "305": "注册失败",
+    "306": "用户未注册", //重置密码时 账号和手机号未能查询到相应用户
 
     "402": "接口请求失败",
     "404": "查询结果不存在",

+ 8 - 2
src/layout/components/header.vue

@@ -26,9 +26,12 @@
             </router-link>
           </div>
           <div class="line"></div>
+
           <div class="spfb">
-            <span class="font_family">&#xe603;</span>
-            商品发布
+            <a :href="managerUrl">
+              <span class="font_family">&#xe603;</span>
+              商品发布
+            </a>
           </div>
           <div class="line"></div>
           <div class="spfb">
@@ -97,6 +100,9 @@ export default class extends Vue {
   get userInfo() {
     return user.UserInfo;
   }
+  get managerUrl() {
+    return process.env.VUE_APP_MANAGER_URL;
+  }
 }
 </script>
 

+ 197 - 185
src/views/account/findPassword.vue

@@ -4,216 +4,228 @@
       <div class="container">
         <span class="title">中国钢制家具产业聚集网</span>
         <span class="line"></span>
-        <span class="info">忘记密码</span>
+        <span class="info">重设密码</span>
       </div>
     </div>
-    <div class="bgImg">
-      <div class="container pt3rem pb3rem">
-        <el-row :gutter="20">
-          <el-col :span="8" :offset="16">
-            <div class="loginDiv">
-              <div class="name"><span class="line"></span>重设密码</div>
-              <div class="inputDiv">
-                <img src="@assets/user.png" alt="" />
-                <el-input
-                  class="fr"
-                  placeholder="登录账号"
-                  v-model="form.username"
-                >
-                </el-input>
-              </div>
-              <div class="inputDiv">
-                <img src="@assets/phone.png" alt="" />
-                <el-input
-                  class="fr"
-                  placeholder="手机号码"
-                  v-model="form.phone"
-                >
-                </el-input>
-              </div>
-              <div class="yzmDiv">
-                <div class="inputDiv per70">
-                  <img src="@assets/yz.png" alt="" />
-                  <el-input
-                    class="fr"
-                    placeholder="验证码"
-                    style="width:89%;"
-                    v-model="form.yzm"
-                  >
-                  </el-input>
-                </div>
-                <div class="yzm">获取验证码</div>
-              </div>
-              <div class="inputDiv">
-                <img src="@assets/lock.png" alt="" />
-                <el-input
-                  class="fr"
-                  type="password"
-                  placeholder="新密码"
-                  v-model="form.password"
-                >
-                </el-input>
-              </div>
-              <div>
-                <el-button class="loginBtn">提交</el-button>
-              </div>
-            </div>
-          </el-col>
-        </el-row>
+    <div class="bg">
+      <div class="container  ">
+        <img src="@assets/loginbg.png" />
+        <div class="loginDiv">
+          <div class="x-title">重设密码</div>
+          <el-form :model="form" :rules="rules" class="form" ref="form">
+            <el-form-item class="formItem" prop="loginAccount">
+              <img class="icon" src="@assets/user.png" alt="" />
+              <el-input
+                v-model="form.loginAccount"
+                prefix-icon="x-el-icon-user"
+                placeholder="登录账号"
+              />
+            </el-form-item>
+
+            <el-form-item class="formItem" prop="phone">
+              <img class="icon" src="@assets/phone.png" alt="" />
+              <el-input
+                v-model="form.phone"
+                prefix-icon="x-el-icon-lock"
+                placeholder="手机号码"
+              />
+            </el-form-item>
+            <el-form-item class="formItem yzm" prop="validateCode">
+              <img class="icon" src="@assets/yz.png" alt="" />
+              <el-input
+                v-model="form.validateCode"
+                prefix-icon="icon-yzm"
+                placeholder="验证码"
+              />
+              <div class="getyzm">获取验证码</div>
+            </el-form-item>
+            <el-form-item class="formItem" prop="loginPassword">
+              <img class="icon" src="@assets/lock.png" alt="" />
+              <el-input
+                v-model="form.loginPassword"
+                prefix-icon="x-el-icon-lock"
+                placeholder="新密码"
+              />
+            </el-form-item>
+
+            <el-button class="loginBtn" @click="validate">注册</el-button>
+          </el-form>
+        </div>
       </div>
     </div>
   </div>
 </template>
-<script>
+<script lang="ts">
 import { Component, Vue, Watch } from "vue-property-decorator";
-export default {
-  name: "app",
-  components: {},
-  data() {
-    return {
-      form: {
-        username: "",
-        password: "",
-        yzm: "",
-        zddl: false,
-        phone: ""
+import user from "@/store/modules/user";
+import { RegAccount } from "@/utils";
+import { ElForm } from "element-ui/types/form";
+@Component
+export default class extends Vue {
+  private verifyImg = "";
+  private form = {
+    loginAccount: "",
+    loginPassword: "",
+    validateCode: "",
+    phone: ""
+  };
+  private rules = {
+    loginAccount: [
+      { required: true, message: "请输入用户名", trigger: "blur" },
+      {
+        validator: (rule: any, value: string, callback: any) =>
+          callback(
+            RegAccount.test(value)
+              ? undefined
+              : new Error("用户名必须为9到16位由数字字母组合")
+          ),
+        trigger: "blur"
       }
-    };
-  },
-  methods: {}
-};
-</script>
-<style lang="scss" scoped>
-.topDiv {
-  height: 9rem;
-  line-height: 9rem;
-  background: #fff;
-  .title {
-    font-size: 2.2rem;
-    font-weight: bold;
-    color: #fd5522;
-  }
-  .line {
-    display: inline-block;
-    height: 3rem;
-    width: 0.1rem;
-    background: #e5e5e5;
-    margin: 0 2rem;
-    vertical-align: middle;
+    ],
+    loginPassword: [
+      { required: true, message: "请输入密码", trigger: "blur" },
+      {
+        validator: (rule: any, value: string, callback: any) =>
+          callback(
+            RegAccount.test(value)
+              ? undefined
+              : new Error("密码必须为9到16位由数字字母组合")
+          ),
+        trigger: "blur"
+      }
+    ],
+    phone: [
+      { required: true, message: "请输入手机号码", trigger: "blur" },
+      {
+        validator: (rule: any, value: string, callback: any) =>
+          callback(
+            /^1[3|4|5|7|8][0-9]\d{8}$/.test(value)
+              ? undefined
+              : new Error("请输入正确的手机号")
+          ),
+        trigger: "blur"
+      }
+    ],
+    validateCode: [{ required: true, message: "请输入验证码", trigger: "blur" }]
+  };
+
+  validate() {
+    (this.$refs.form as ElForm).validate(x => x && this.submit());
   }
-  .info {
-    font-size: 1.8rem;
-    font-weight: bold;
-    color: #666;
+
+  async submit() {
+    const [err] = await this.$post("/member/info/resetPassword", this.form);
+    if (err) return;
+    this.$message.success("重设成功 请登陆");
+    (this.$refs.form as ElForm).resetFields();
+    this.$router.push("/login");
   }
 }
-.loginDiv {
-  background: #fff;
-  padding: 1.6rem;
-  box-sizing: border-box;
-  border-radius: 0.4rem;
-  box-shadow: 2px 2px 12px #ddd;
-  .name {
-    height: 3rem;
-    line-height: 3rem;
-    font-size: 1.6rem;
-    color: #333;
-    position: relative;
-    .line {
-      display: inline-block;
-      height: 1.8rem;
-      width: 0.4rem;
-      background: #fd5522;
-      position: absolute;
-      left: -1.6rem;
-      top: 0.6rem;
-    }
-  }
-  .inputDiv {
-    height: 4rem;
-    line-height: 4rem;
-    border: 0.1rem solid #acacac;
-    border-radius: 0.4rem;
-    margin-top: 2rem;
-    img {
-      height: 1.6rem;
-      vertical-align: middle;
-      margin-left: 0.6rem;
-    }
-  }
-  .yzmDiv {
-    overflow: hidden;
-    .yzm {
-      height: 4rem;
-      line-height: 4rem;
-      width: 28%;
-      font-size: 1.4rem;
+</script>
+<style lang="scss" scoped>
+.bg-F5 {
+  .topDiv {
+    height: 9rem;
+    line-height: 9rem;
+    background: #fff;
+    .title {
+      font-size: 2.2rem;
+      font-weight: bold;
       color: #fd5522;
-      text-align: center;
-      float: right;
-      background: #ffded5;
-      border-radius: 0.4rem;
-      margin-top: 2rem;
-    }
-  }
-  div {
-    .loginBtn {
-      width: 100%;
-      background: #fd5522;
-      color: #fff;
-      border-color: #fd5522;
-      margin-top: 2rem;
     }
-  }
-  .newDiv {
-    height: 4rem;
-    line-height: 4rem;
-    text-align: right;
-    font-size: 1.4rem;
     .line {
-      height: 1rem;
+      display: inline-block;
+      height: 3rem;
       width: 0.1rem;
       background: #e5e5e5;
-      margin: 0 1rem;
+      margin: 0 2rem;
       vertical-align: middle;
-      display: inline-block;
     }
-    .forgetPass {
+    .info {
+      font-size: 1.8rem;
+      font-weight: bold;
       color: #666;
     }
-    .register {
-      color: #fd5522;
+  }
+
+  .bg {
+    background: #84ccc9;
+    padding: 75px 0;
+    .container {
+      overflow: hidden;
+      > img {
+        margin-left: 180px;
+        margin-top: 50px;
+        float: left;
+      }
+      .loginDiv {
+        // width: 320px;
+        // height: 338px;
+        margin-left: 218px;
+        float: left;
+        background: #fff;
+
+        box-sizing: border-box;
+        border-radius: 0.4rem;
+        box-shadow: 2px 2px 12px #ddd;
+        .x-title {
+          margin-top: 20px;
+        }
+        .form {
+          padding: 15px 20px;
+          .formItem {
+            height: 40px;
+            line-height: 40px;
+            box-sizing: border-box;
+            border-radius: 4px;
+            margin-bottom: 20px;
+            position: relative;
+            .icon {
+              position: absolute;
+              left: 10px;
+              top: 50%;
+              transform: translateY(-50%);
+              z-index: 1;
+              width: 12px;
+            }
+          }
+          .loginBtn {
+            width: 100%;
+            background: #fd5522;
+            color: #fff;
+            border-color: #fd5522;
+          }
+        }
+      }
+      .getyzm {
+        height: 40px;
+        line-height: 40px;
+        width: 100px;
+        font-size: 14px;
+        color: #fd5522;
+        text-align: center;
+        float: right;
+        background: #ffded5;
+        border-radius: 0.4rem;
+        cursor: pointer;
+      }
+      .xieyi {
+        color: #fd5522;
+      }
     }
   }
 }
-.bgImg {
-  background: url("~@assets/loginbg.png") no-repeat;
-  background-size: 100% 100%;
-}
-.bg-F5 {
-  background: #f5f5f5;
-}
-.pt3rem {
-  padding-top: 3rem;
-}
-.pb3rem {
-  padding-bottom: 3rem;
-}
-.fr {
-  float: right;
-}
-.per70 {
-  width: 70%;
-  float: left;
-}
 </style>
 <style lang="scss">
-.inputDiv .el-input {
-  width: 92%;
-  float: right;
-  .el-input__inner {
-    border: 0;
-    padding-left: 0.6rem;
+.formItem.yzm {
+  .el-input {
+    width: 200px;
+  }
+  .verifyImg {
+    height: 40px;
+    width: 108px;
+    margin-left: 10px;
+    vertical-align: middle;
   }
 }
 </style>

+ 3 - 48
src/views/info/details/sell.vue

@@ -4,29 +4,7 @@
     <div class="container">
       <el-row class="xqDiv" :gutter="20">
         <el-col :span="10">
-          <div class="bigImgDiv">
-            <img src="@assets/productDetails.jpg" alt="" />
-          </div>
-          <div class="imgDetailDiv">
-            <el-carousel height="80px" :autoplay="false">
-              <el-carousel-item v-for="item in 3" :key="item">
-                <div class="imgDetail">
-                  <div class="imgDiv">
-                    <img src="@assets/productDetails.jpg" alt="" />
-                  </div>
-                  <div class="imgDiv">
-                    <img src="@assets/productDetails.jpg" alt="" />
-                  </div>
-                  <div class="imgDiv">
-                    <img src="@assets/productDetails.jpg" alt="" />
-                  </div>
-                  <div class="imgDiv">
-                    <img src="@assets/productDetails.jpg" alt="" />
-                  </div>
-                </div>
-              </el-carousel-item>
-            </el-carousel>
-          </div>
+          <product-imgs :img="noticeSupply.picture" />
         </el-col>
         <el-col :span="14">
           <div class="title">
@@ -54,7 +32,7 @@
 import { Component, Vue, Watch, Prop } from "vue-property-decorator";
 @Component
 export default class extends Vue {
-  private noticeSupply = {};
+  private noticeSupply: IAny = {};
   @Prop(String) private id!: number;
   @Watch("id", { immediate: true })
   async load(id: string) {
@@ -76,30 +54,7 @@ export default class extends Vue {
     border-bottom: 0.1rem solid #e5e5e5;
     padding: 3rem 3rem 2rem 2rem;
     box-sizing: border-box;
-    .bigImgDiv {
-      img {
-        width: 100%;
-        border-radius: 0.5rem;
-      }
-    }
-    .imgDetailDiv {
-      margin-top: 2rem;
-      .imgDetail {
-        width: 100%;
-        overflow: hidden;
-        .imgDiv {
-          width: 22.7%;
-          float: left;
-          margin-right: 3%;
-          &:last-child {
-            margin-right: 0;
-          }
-          img {
-            width: 100%;
-          }
-        }
-      }
-    }
+
     .title {
       height: 4rem;
       line-height: 4rem;

+ 5 - 29
src/views/shops/details/product.vue

@@ -1,15 +1,7 @@
 <template>
   <div class="productDetails container">
     <div class="payInfo">
-      <div class="imgs fl">
-        <img :src="imgs[currImgIndex]" alt="" />
-        <img
-          v-for="(s, index) in imgs"
-          :key="`imgs${index}`"
-          :src="s"
-          @mouseover="currImgIndex = index"
-        />
-      </div>
+      <product-imgs class="fl" :img="product.slideshow" />
       <div class="info fl">
         <div class="title">{{ product.name }}</div>
         <div class="desc">品牌认证</div>
@@ -81,7 +73,6 @@
 import { Component, Vue, Watch, Prop } from "vue-property-decorator";
 @Component
 export default class extends Vue {
-  private currImgIndex = 0;
   private showPhone = false;
   private form = {
     goodsSizes: "",
@@ -92,15 +83,13 @@ export default class extends Vue {
   private product: IAny = {};
   @Watch("pid", { immediate: true })
   async load(id: number) {
+    if (!id) return;
+    this.showPhone = false;
     const [err, data] = await this.$post("/goods/info/details", { id });
     if (err) return;
     this.product = data;
   }
-  get imgs() {
-    return (this.product.slideshow + "")
-      .split(",")
-      .map(x => this.$basePath + x);
-  }
+
   get colors() {
     return (this.product.goodsColors || []).map((x: any) => x.color).join();
   }
@@ -117,20 +106,7 @@ export default class extends Vue {
     padding-bottom: 30px;
     margin-bottom: 30px;
     border-bottom: 1px solid rgb(229, 229, 229);
-    .imgs {
-      width: 400px;
-      img {
-        width: 92px;
-        height: 92px;
-        margin-right: 10px;
-        cursor: pointer;
-        &:nth-child(1) {
-          width: 400px;
-          height: 400px;
-          margin-bottom: 20px;
-        }
-      }
-    }
+
     .info {
       overflow: hidden;
       padding: 20px 30px;

+ 1 - 0
src/views/shops/details/products.vue

@@ -17,6 +17,7 @@
             <load-more
               url="/goods/info/page"
               :params="params"
+              :rows="16"
               v-slot="{
                 item: { id, name, companyId, price, cover, companyName }
               }"

+ 18 - 5
src/views/shops/details/profile.vue

@@ -9,7 +9,9 @@
                 v-for="item in (this.shopInfo.propagandaImgUrl + ``).split(`,`)"
                 :key="item"
               >
-                <img :src="`${$basePath}${item}`" alt="" />
+                <div class="img">
+                  <img :src="`${$basePath}${item}`" alt="" />
+                </div>
               </el-carousel-item>
             </el-carousel>
           </div>
@@ -72,17 +74,28 @@ export default class extends Vue {
     .left {
       border-right: 1px dashed #e3e3e3;
       > div {
-        width: 50%;
+        width: 40%;
         box-sizing: border-box;
         // display: inline-block;
         height: 100%;
         float: left;
-        img {
-          width: 100%;
+        .img {
           height: 100%;
-          border-radius: 4px;
+
+          position: relative;
+          img {
+            max-width: 100%;
+            max-height: 100%;
+            border-radius: 4px;
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+          }
         }
+
         &.details {
+          width: 60%;
           padding: 10px 20px;
           span {
             margin-bottom: 20px;