Explorar o código

中英文切换文字语言整理

kouchengxing %!s(int64=4) %!d(string=hai) anos
pai
achega
e28a8b2c0b

+ 89 - 8
src/lang/zh.ts

@@ -211,7 +211,15 @@ export default {
         }
       },
       mall: {
-        category: "分类"
+        category: "分类",
+        comprehensiveSort: "综合排序",
+        newProducts: "新品",
+        price: "价格",
+        minPrice: "最低价",
+        maxPrice: "最高价",
+        productsOrCompanyName: "商品名称或企业名称",
+        search: "搜索",
+        all: "全部"
       },
       news: {
         details: {},
@@ -219,17 +227,90 @@ export default {
       },
       shops: {
         details: {
-          honor: {},
-          index: {},
-          product: {},
-          products: {},
-          profile: {}
+          honor: {
+            qualificationHonor: "资质荣誉"
+          },
+          index: {
+            certified: "已认证",
+            alreadyConcerned: "已关注",
+            focusBusinesses: "关注商家",
+            keyWord: "关键词",
+            searchWholeStation: "搜全站",
+            searchShop: "搜本店",
+            home: "首页",
+            companyIntroduction: "企业简介",
+            qualificationHonor: "资质荣誉",
+            followSuccess: "关注成功"
+          },
+          product: {
+            brandAuthentication: "品牌认证",
+            price: "价格",
+            specifications: "规格",
+            color: "颜色",
+            contactMerchant: "联系商家",
+            commodityDetails: "商品详情",
+            tradeName: "商品名称",
+            commodityMaterial: "商品材质",
+            commodityWeight: "商品单重",
+            commodityColor: "商品颜色",
+            commoditySpecifications: "商品规格",
+            distributionMode: "配送方式",
+            productionDate: "生产日期",
+            productionLocation: "生产地点",
+            warehouseAddress: "供货仓库地址"
+          },
+          products: {
+            buyNow: "立即购买"
+          },
+          profile: {
+            companyType: "企业类型",
+            unifiedSocialCreditCode: "统一社会信用代码",
+            legalPerson: "法人代表",
+            detailAddress: "注册地址",
+            primaryBusiness: "主营产品",
+            companyIntroduction: "企业简介",
+            businessLicense: "营业执照"
+          }
         },
         enter: {
-          add: {},
+          add: {
+            accountInfo: "账户信息",
+            useLoginSystem: "账号用于登录商户平台",
+            userName: "用户名",
+            password: "请设置密码",
+            surepassword: "请确认密码",
+            companyInfo: "企业基本信息",
+            companyName: "企业名称",
+            companyType: "企业类型",
+            primaryBusiness: "主营业务",
+            companyAddress: "企业所在地",
+            chooseProvince: "请选择省份",
+            chooseCity: "请选择城市",
+            chooseArea: "请选择区县",
+            detailAddress: "详细地址",
+            chooseLongitudeAndLatitude: "经纬度选择",
+            longitude: "经度",
+            latitude: "纬度",
+            close: "关闭",
+            choose: "选择",
+            legalPerson: "企业法人",
+            establishDate: "成立日期",
+            chooseEstablishDate: "选择成立日期",
+            unifiedSocialCreditCode: "统一社会信用代码",
+            companyIntroduction: "企业介绍",
+            businessLicense: "营业执照",
+            defaultImgUrl: "企业默认图片",
+            propagandaImg: "企业宣传图片",
+            submit: "提交"
+          },
           index: {}
         },
-        index: {}
+        index: {
+          primaryBusiness: "主营",
+          total: "共计",
+          product: "件商品",
+          enterTheShop: "进入店铺"
+        }
       }
     }
   }

+ 32 - 8
src/views/mall/index.vue

@@ -47,7 +47,7 @@
           :class="`sort fl ${params.orderByColumn === '' ? 'curr' : ''}`"
           @click="() => paramsChange({ orderByColumn: '' })"
         >
-          <span> 综合排序</span>
+          <span> {{ $t("page.views.mall.comprehensiveSort") }}</span>
         </div>
         <div
           :class="
@@ -57,7 +57,7 @@
             () => paramsChange({ orderByColumn: 'createTime', isAsc: 'asc' })
           "
         >
-          <span> 新品</span>
+          <span> {{ $t("page.views.mall.newProducts") }}</span>
         </div>
         <div
           :class="`sort fl ${params.orderByColumn === 'price' ? 'curr' : ''}`"
@@ -74,19 +74,36 @@
                       : `asc`
                 })
             "
-            >价格</span
+            >{{ $t("page.views.mall.price") }}</span
           >
           <input
             v-model="search.beginPrice"
-            placeholder="最低价"
+            :placeholder="
+              `${$t(`inputPlaceholder`)}${$t(`page.views.mall.minPrice`)}`
+            "
             type="number"
           />
           -
-          <input v-model="search.endPrice" placeholder="最高价" type="number" />
+          <input
+            v-model="search.endPrice"
+            :placeholder="
+              `${$t(`inputPlaceholder`)}${$t(`page.views.mall.maxPrice`)}`
+            "
+            type="number"
+          />
         </div>
         <div class="search fr">
-          <input placeholder="商品名称/企业名称" v-model="search.name" />
-          <span @click="() => paramsChange(search)">搜索</span>
+          <input
+            :placeholder="
+              `${$t(`inputPlaceholder`)}${$t(
+                `page.views.mall.productsOrCompanyName`
+              )}`
+            "
+            v-model="search.name"
+          />
+          <span @click="() => paramsChange(search)">
+            {{ $t("page.views.mall.search") }}</span
+          >
         </div>
       </div>
       <div class="products">
@@ -114,6 +131,7 @@
 <script lang="ts">
 import { Component, Vue, Watch, Prop } from "vue-property-decorator";
 import menu from "@/store/modules/menu";
+import i18n from "@/lang";
 @Component
 export default class extends Vue {
   private currPid = 0;
@@ -149,7 +167,13 @@ export default class extends Vue {
   //   console.log(this.$route);
   // }
   get items() {
-    return [{ id: 0, title: "全部" }, ...menu.pList];
+    return [
+      {
+        id: 0,
+        title: `${i18n.t(`page.views.mall.all`)}`
+      },
+      ...menu.pList
+    ];
   }
   get subs() {
     if (this.currPid === 0)

+ 1 - 1
src/views/shops/details/honor.vue

@@ -2,7 +2,7 @@
   <div class="bg-F5">
     <div class="container">
       <div class="x-title">
-        资质荣誉
+        {{ $t("page.views.shops.details.honor.qualificationHonor") }}
       </div>
       <div class="content" v-if="curr">
         <img :src="`${$basePath}${curr.img}`" />

+ 27 - 12
src/views/shops/details/index.vue

@@ -4,27 +4,39 @@
       <img class="logo fl" :src="`${$basePath}${shopInfo.defaultImgUrl}`" />
       <div class="desc fl">
         <h3>{{ shopInfo.companyName }}</h3>
-        <span class="rz">已认证</span>
+        <span class="rz">{{
+          $t("page.views.shops.details.index.certified")
+        }}</span>
         <div v-if="shopInfo.isFollow">
           <img src="@assets/guanzhu-2.png" />
-          <span class="gz">已关注</span>
+          <span class="gz">{{
+            $t("page.views.shops.details.index.alreadyConcerned")
+        }}</span>
         </div>
         <div v-else @click="gz">
           <img src="@assets/guanzhu.png" />
-          <span class="gz t">关注商家</span>
+          <span class="gz t">{{
+            $t("page.views.shops.details.index.focusBusinesses")
+          }}</span>
         </div>
       </div>
       <div class="fr search">
         <el-input
           class="input"
-          placeholder="请输入关键词"
+          :placeholder="
+            `${$t(`inputPlaceholder`)}${$t(
+              `page.views.shops.details.index.keyWord`
+            )}`
+          "
           prefix-icon="el-icon-search"
           v-model="searchVal"
         />
-        <router-link class="fr qz" :to="`/mall/${searchVal}`"
-          >搜全站</router-link
-        >
-        <div class="fr bd" @click="search">搜本店</div>
+        <router-link class="fr qz" :to="`/mall/${searchVal}`">
+          {{ $t("page.views.shops.details.index.searchWholeStation") }}
+        </router-link>
+        <div class="fr bd" @click="search">
+          {{ $t("page.views.shops.details.index.searchShop") }}
+        </div>
       </div>
     </div>
     <div class="navs ">
@@ -33,13 +45,14 @@
           class="nav "
           :to="`/shop/${sid}/products`"
           @click.native="refresh"
-          >首页
+        >
+          {{ $t("page.views.shops.details.index.home") }}
         </router-link>
         <router-link class="nav  " :to="`/shop/${sid}/profile`"
-          >企业简介
+          >{{ $t("page.views.shops.details.index.companyIntroduction") }}
         </router-link>
         <router-link class="nav " :to="`/shop/${sid}/honor`"
-          >资质荣誉
+          >{{ $t("page.views.shops.details.index.qualificationHonor") }}
         </router-link>
       </div>
     </div>
@@ -75,7 +88,9 @@ export default class extends Vue {
     });
     if (err) return;
     this.shopInfo.isFollow = 1;
-    this.$message.success("关注成功");
+    this.$message.success(
+      `${this.$i18n.t("page.views.shops.details.index.followSuccess")}`
+    );
   }
   refresh() {
     this.shopInfo = { ...this.shopInfo };

+ 61 - 15
src/views/shops/details/product.vue

@@ -4,13 +4,19 @@
       <product-imgs class="fl" :img="product.slideshow" />
       <div class="info fl">
         <div class="title">{{ product.name }}</div>
-        <div class="desc">品牌认证</div>
+        <div class="desc">
+          {{ $t("page.views.shops.details.product.brandAuthentication") }}
+        </div>
         <div class="row">
-          <div class="tit">价格 :</div>
+          <div class="tit">
+            {{ $t("page.views.shops.details.product.price") }} :
+          </div>
           <div class="amount fl"><span>¥</span>{{ product.price }}</div>
         </div>
         <div class="row">
-          <div class="tit">规格 :</div>
+          <div class="tit">
+            {{ $t("page.views.shops.details.product.specifications") }} :
+          </div>
           <div class="items">
             <div
               v-for="({ size }, index) in product.goodsSizes"
@@ -23,7 +29,9 @@
           </div>
         </div>
         <div class="row">
-          <div class="tit">颜色 :</div>
+          <div class="tit">
+            {{ $t("page.views.shops.details.product.color") }} :
+          </div>
           <div class="items">
             <div
               v-for="({ id, color }, index) in product.goodsColors"
@@ -37,25 +45,63 @@
         </div>
 
         <div class="pay" @click="showPhone = true">
-          联系商家
+          {{ $t("page.views.shops.details.product.contactMerchant") }}
         </div>
         <transition name="slide-fade">
           <span v-if="showPhone" class="phone">138 388 8888</span>
         </transition>
       </div>
     </div>
-    <div class="x-title">商品详情</div>
+    <div class="x-title">
+      {{ $t("page.views.shops.details.product.commodityDetails") }}
+    </div>
     <div class="details">
       <div class="items">
-        <div class="item">商品名称:{{ product.name }}</div>
-        <div class="item">商品材质:{{ product.material }}</div>
-        <div class="item">商品单重:{{ product.weight }}</div>
-        <div class="item">商品颜色:{{ colors }}</div>
-        <div class="item">商品规格:{{ sizes }}{{ sizes }}</div>
-        <div class="item">配送方式:{{ product.delivery }}</div>
-        <div class="item">生产日期:{{ product.producedTime }}</div>
-        <div class="item">生产地点:{{ product.producedAddress }}</div>
-        <div class="item">供货仓库地址:{{ product.warehouseAddress }}</div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.tradeName") }}:{{
+            product.name
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.commodityMaterial") }}:{{
+            product.material
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.commodityWeight") }}:{{
+            product.weight
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.commodityColor") }}:{{
+            colors
+          }}
+        </div>
+        <div class="item">
+          {{
+            $t("page.views.shops.details.product.commoditySpecifications")
+          }}:{{ sizes }}{{ sizes }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.distributionMode") }}:{{
+            product.delivery
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.productionDate") }}:{{
+            product.producedTime
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.productionLocation") }}:{{
+            product.producedAddress
+          }}
+        </div>
+        <div class="item">
+          {{ $t("page.views.shops.details.product.warehouseAddress") }}:{{
+            product.warehouseAddress
+          }}
+        </div>
         <div
           class="item"
           v-for="({ attributeName: k, value: v },

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

@@ -29,7 +29,9 @@
                 <span>{{ name }}</span>
                 <div class="pay">
                   <span>¥ {{ price }}</span>
-                  <router-link :to="`${id}`"> 立即购买 </router-link>
+                  <router-link :to="`${id}`">
+                    {{ $t("page.views.shops.details.products.buyNow") }}
+                  </router-link>
                 </div>
               </router-link>
             </load-more>

+ 27 - 7
src/views/shops/details/profile.vue

@@ -17,16 +17,36 @@
           </div>
           <div class="details">
             <span>{{ shopInfo.companyName }}</span>
-            <p>企业类型:{{ companyType }}</p>
-            <p>统一社会信用代码:{{ shopInfo.unifiedSocialCreditCode }}</p>
-            <p>法人代表:{{ shopInfo.legalPerson }}</p>
-            <p>注册地址:{{ shopInfo.detailAddress }}</p>
-            <p>主营产品:{{ shopInfo.primaryBusiness }}</p>
+            <p>
+              {{ $t("page.views.shops.details.profile.companyType") }}:{{
+                companyType
+              }}
+            </p>
+            <p>
+              {{
+                $t("page.views.shops.details.profile.unifiedSocialCreditCode")
+              }}:{{ shopInfo.unifiedSocialCreditCode }}
+            </p>
+            <p>
+              {{ $t("page.views.shops.details.profile.legalPerson") }}:{{
+                shopInfo.legalPerson
+              }}
+            </p>
+            <p>
+              {{ $t("page.views.shops.details.profile.detailAddress") }}:{{
+                shopInfo.detailAddress
+              }}
+            </p>
+            <p>
+              {{ $t("page.views.shops.details.profile.primaryBusiness") }}:{{
+                shopInfo.primaryBusiness
+              }}
+            </p>
           </div>
         </div>
         <div class="right">
           <div class="title">
-            企业介绍
+            {{ $t("page.views.shops.details.profile.companyIntroduction") }}
           </div>
           <p>
             {{ shopInfo.companyIntroduce }}
@@ -34,7 +54,7 @@
         </div>
       </div>
       <div class="x-title">
-        营业执照
+        {{ $t("page.views.shops.details.profile.businessLicense") }}
       </div>
       <img :src="`${$basePath}${shopInfo.businessLicenseUrl}`" alt="" />
     </div>

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

@@ -22,9 +22,16 @@
           <img class="logo fl" :src="`${$basePath}${defaultImgUrl}`" />
           <div class="details fl">
             <div class="name">{{ companyName }}</div>
-            <div class="desc">主营:{{ primaryBusiness }}</div>
-            <div class="total">共计{{ goodsCount }}件商品</div>
-            <span class="in">进入店铺</span>
+            <div class="desc">
+              {{ $t("page.views.shops.index.primaryBusiness") }}:{{ primaryBusiness }}
+            </div>
+            <div class="total">
+              {{ $t("page.views.shops.index.total") }}{{ goodsCount
+              }}{{ $t("page.views.shops.index.product") }}
+            </div>
+            <span class="in">{{
+              $t("page.views.shops.index.enterTheShop")
+            }}</span>
           </div>
           <div
             class="img"