youyawu 4 年之前
父節點
當前提交
e8321df8d0

二進制
src/assets/loginbg_en.png


src/assets/loginbg.png → src/assets/loginbg_zh.png


二進制
src/assets/zxsc-banner.png


+ 2 - 2
src/lang/index.ts

@@ -29,8 +29,8 @@ const getLocale = () => {
   if (cookieLanguage) {
     return cookieLanguage;
   }
-
-  const language = navigator.language.toLowerCase();
+  const ieLang = (navigator as any).browserLanguage as string;
+  const language = (navigator.language || ieLang).toLowerCase();
   const locales = Object.keys(messages);
   for (const locale of locales) {
     if (language.indexOf(locale) > -1) {

+ 3 - 0
src/lang/zh.ts

@@ -34,6 +34,9 @@ export default {
       cancelGz: "是否取消关注?",
       revocation: "是否撤销该需求?",
       logout: "是否退出登陆?"
+    },
+    error: {
+      imgUpload: "只能上传png或jpg格式"
     }
   },
   route: {

+ 1 - 0
src/layout/components/header.vue

@@ -67,6 +67,7 @@
             "
             v-model="searchVal"
             class="input-with-select"
+            @keyup.native.enter="search"
           >
             <i slot="prefix" class="el-input__icon el-icon-search"></i>
           </el-input>

+ 1 - 5
src/layout/index.vue

@@ -2,7 +2,7 @@
   <div class="layout">
     <y-header @reload="reload" />
     <keep-alive exclude="shopEnterAdd,infoList,shopEnter" v-if="showView">
-      <router-view class="main" />
+      <router-view />
     </keep-alive>
     <y-footer />
   </div>
@@ -30,9 +30,5 @@ export default class extends Vue {
 <style lang="scss" scoped>
 .layout {
   height: 100%;
-  .main {
-    // min-height: calc(100% - 250px);
-    overflow: hidden;
-  }
 }
 </style>

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

@@ -40,7 +40,7 @@ interface ILogin {
   loginAccount: string;
   loginPassword: string;
   validateCode: string;
-  autoLogin: boolean;
+  autoLogin?: boolean;
 }
 
 interface IMenu {

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

@@ -11,7 +11,7 @@
     </div>
     <div class="bg">
       <div class="container  ">
-        <img src="@assets/loginbg.png" />
+        <img :src="require(`@assets/loginbg_${$i18n.locale}.png`)" />
         <div class="loginDiv">
           <div class="x-title">
             {{ $t("page.views.account.findPassword.title") }}

+ 2 - 2
src/views/account/login.vue

@@ -9,7 +9,7 @@
     </div>
     <div class="bg">
       <div class="container  ">
-        <img src="@assets/loginbg.png" />
+        <img :src="require(`@assets/loginbg_${$i18n.locale}.png`)" />
         <div class="loginDiv">
           <div class="x-title">{{ $t("page.views.account.login.title") }}</div>
           <el-form :model="form" :rules="rules" class="form" ref="form">
@@ -127,7 +127,7 @@ export default class extends Vue {
   async submit() {
     const token = await user.setToken(this.form);
     if (!token) return this.setVerifyImg();
-    this.$message.success(`${this.$i18n.t("message.login")}`);
+    this.$message.success(`${this.$i18n.t("message.success.login")}`);
     (this.$refs.form as ElForm).resetFields();
     this.$router.push("/user");
   }

+ 20 - 7
src/views/account/register.vue

@@ -9,7 +9,7 @@
     </div>
     <div class="bg">
       <div class="container  ">
-        <img src="@assets/loginbg.png" />
+        <img :src="require(`@assets/loginbg_${$i18n.locale}.png`)" />
         <div class="loginDiv">
           <div class="x-title">
             {{ $t("page.views.account.register.title") }}
@@ -65,9 +65,13 @@
               >
             </el-form-item>
 
-            <el-button class="loginBtn" @click="validate">{{
-              $t("form.register")
-            }}</el-button>
+            <el-button
+              :disabled="!form.check"
+              :class="{ disabled: !form.check }"
+              class="loginBtn"
+              @click="validate"
+              >{{ $t("form.register") }}</el-button
+            >
           </el-form>
         </div>
       </div>
@@ -83,11 +87,11 @@ import i18n from "@/lang";
 @Component
 export default class extends Vue {
   private verifyImg = "";
-  private form: ILogin = {
+  private form: IAny = {
     loginAccount: "",
     loginPassword: "",
     validateCode: "",
-    autoLogin: false
+    check: false
   };
   private rules = {
     loginAccount: [
@@ -149,7 +153,11 @@ export default class extends Vue {
       {
         validator: (rule: any, value: boolean, callback: any) =>
           callback(
-            value ? undefined : new Error(`${i18n.t("form.validateCheck")}`)
+            value
+              ? undefined
+              : new Error(
+                  `${i18n.t("page.views.account.register.validateCheck")}`
+                )
           ),
         trigger: "blur"
       }
@@ -244,6 +252,11 @@ export default class extends Vue {
             background: #fd5522;
             color: #fff;
             border-color: #fd5522;
+            &.disabled {
+              background: #f5f5f5;
+              border-color: #f5f5f5;
+              color: #666;
+            }
           }
         }
       }

+ 11 - 1
src/views/mall/index.vue

@@ -115,7 +115,11 @@
             item: { id, name, companyId, price, cover, companyName }
           }"
         >
-          <router-link :to="`/shop/${companyId}/${id}`" class="product">
+          <router-link
+            :to="`/shop/${companyId}/${id}`"
+            class="product"
+            :title="name"
+          >
             <div class="img">
               <img :src="`${$basePath}${cover}`" />
             </div>
@@ -415,10 +419,16 @@ export default class extends Vue {
           font-size: 14px;
           color: rgb(51, 51, 51);
           margin-bottom: 10px;
+          white-space: nowrap;
+          overflow: hidden;
+          text-overflow: ellipsis;
         }
         .shop {
           font-size: 12px;
           color: rgb(102, 102, 102);
+          white-space: nowrap;
+          overflow: hidden;
+          text-overflow: ellipsis;
         }
       }
     }

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

@@ -118,7 +118,15 @@
         >
           <el-input v-model="address"></el-input>
         </el-form-item>
-        <el-form-item class="formItem" :label="`${$t(`pleaseChoose`)}${$t(`page.views.shops.enter.add.longitude`)}${$t(`page.views.shops.enter.add.latitude`)}`" prop="jwd">
+        <el-form-item
+          class="formItem"
+          :label="
+            `${$t(`pleaseChoose`)}${$t(
+              `page.views.shops.enter.add.longitude`
+            )}${$t(`page.views.shops.enter.add.latitude`)}`
+          "
+          prop="jwd"
+        >
           <div class="longLatDiv">
             <span>{{ $t("page.views.shops.enter.add.longitude") }}</span>
             <el-input class="input" v-model="form.longitude"></el-input>
@@ -186,6 +194,7 @@
           <el-upload
             list-type="picture-card"
             :action="`${$basePath}/common/upload`"
+            :before-upload="beforeUpload"
             :on-preview="preview"
             :on-remove="remove"
             :on-success="
@@ -209,6 +218,7 @@
             :class="{ uploadHide: form.defaultImgUrl }"
             list-type="picture-card"
             :action="`${$basePath}/common/upload`"
+            :before-upload="beforeUpload"
             :on-preview="preview"
             :on-remove="remove"
             :on-success="
@@ -227,6 +237,7 @@
           <el-upload
             list-type="picture-card"
             :action="`${$basePath}/common/upload`"
+            :before-upload="beforeUpload"
             :on-preview="preview"
             :on-remove="remove"
             :on-success="
@@ -590,6 +601,12 @@ export default class extends Vue {
     this.showImgSrc = url;
     this.showImg = true;
   }
+
+  beforeUpload(file: any) {
+    if (/image\/(png|jpg)$/.test(file.type)) return true;
+    this.$message.error(`${this.$i18n.t("message.error.imgUpload")}`);
+    return false;
+  }
 }
 </script>
 <style scoped lang="scss">