Browse Source

中英文

youyawu 5 years ago
parent
commit
f89529d1ec
45 changed files with 605 additions and 197 deletions
  1. 2 3
      .env
  2. 2 1
      package.json
  3. 1 1
      public/index.html
  4. 38 0
      src/components/LangSelect.vue
  5. 24 0
      src/lang/en.ts
  6. 53 0
      src/lang/index.ts
  7. 24 0
      src/lang/zh.ts
  8. 1 1
      src/views/layout/components/footer.vue
  9. 22 0
      src/layout/components/header.vue
  10. 30 0
      src/layout/components/nav.vue
  11. 6 6
      src/views/layout/index.vue
  12. 7 4
      src/main.ts
  13. 123 14
      src/router/index.ts
  14. 5 6
      src/store/modules/user.ts
  15. 29 0
      src/types/global.d.ts
  16. 1 37
      src/types/index.d.ts
  17. 0 4
      src/types/shims-vue.d.ts
  18. 5 0
      src/utils/cookies.ts
  19. 8 53
      src/utils/index.ts
  20. 1 1
      src/utils/request.ts
  21. 10 0
      src/views/account/findPassword.vue
  22. 10 0
      src/views/account/login.vue
  23. 10 0
      src/views/account/register.vue
  24. 10 0
      src/views/account/user/collect.vue
  25. 11 0
      src/views/account/user/index.vue
  26. 10 0
      src/views/account/user/issue.vue
  27. 3 1
      src/views/error.vue
  28. 8 1
      src/views/home/index.vue
  29. 10 0
      src/views/info/add.vue
  30. 10 0
      src/views/info/details/buy.vue
  31. 10 0
      src/views/info/details/sell.vue
  32. 10 0
      src/views/info/index.vue
  33. 0 50
      src/views/layout/components/breadcrumb.vue
  34. 0 11
      src/views/layout/components/header.vue
  35. 10 0
      src/views/mall/index.vue
  36. 10 0
      src/views/news/index.vue
  37. 10 0
      src/views/shops/details/honor.vue
  38. 14 0
      src/views/shops/details/index.vue
  39. 11 0
      src/views/shops/details/product.vue
  40. 10 0
      src/views/shops/details/products.vue
  41. 10 0
      src/views/shops/details/profile.vue
  42. 10 0
      src/views/shops/enter/add.vue
  43. 10 0
      src/views/shops/enter/index.vue
  44. 10 0
      src/views/shops/index.vue
  45. 6 3
      vue.config.js

+ 2 - 3
.env

@@ -1,3 +1,2 @@
-VUE_APP_BaseUrl=/oneportal
-VUE_APP_publicPath=/website
-VUE_APP_publicName=中国钢制家具产业聚集网
+VUE_APP_BASE_API=/oneportal
+VUE_APP_publicPath=/

+ 2 - 1
package.json

@@ -18,7 +18,8 @@
     "vue-property-decorator": "^8.3.0",
     "vue-router": "^3.1.3",
     "vuex": "^3.1.2",
-    "vuex-module-decorators": "^0.11.0"
+    "vuex-module-decorators": "^0.11.0",
+    "vue-i18n": "^8.15.3"
   },
   "devDependencies": {
     "@types/js-cookie": "^2.2.4",

+ 1 - 1
public/index.html

@@ -6,7 +6,7 @@
   <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" />
-  <title><%= VUE_APP_publicName %></title>
+  <title>中国钢制家具产业聚集网</title>
 </head>
 
 <body>

+ 38 - 0
src/components/LangSelect.vue

@@ -0,0 +1,38 @@
+<template>
+  <el-dropdown
+    trigger="click"
+    class="international"
+    @command="handleSetLanguage"
+  >
+    <div>LangSelect-{{ language }}</div>
+    <el-dropdown-menu slot="dropdown">
+      <el-dropdown-item :disabled="language === 'zh'" command="zh">
+        中文
+      </el-dropdown-item>
+      <el-dropdown-item :disabled="language === 'en'" command="en">
+        English
+      </el-dropdown-item>
+    </el-dropdown-menu>
+  </el-dropdown>
+</template>
+
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+import { setLocale } from "@/lang";
+import { setPageTitle } from "@/utils";
+@Component
+export default class extends Vue {
+  get language() {
+    return this.$i18n.locale;
+  }
+
+  private handleSetLanguage(lang: string) {
+    setLocale(lang);
+    setPageTitle(this.$route.meta.title);
+    this.$message({
+      message: "Switch Language Success",
+      type: "success"
+    });
+  }
+}
+</script>

+ 24 - 0
src/lang/en.ts

@@ -0,0 +1,24 @@
+export default {
+  title: "Title",
+  route: {
+    home: "home",
+    mall: "mall",
+    shops: "shops",
+    info: "info",
+    login: "login",
+    register: "register",
+    findPassword: "findPassword",
+    collect: "collect",
+    issue: "issue",
+    shopDetails: "shopDetails",
+    shopHonor: "shopHonor",
+    shopProfile: "shopProfile",
+    productDetails: "productDetails",
+    shopEnter: "shopEnter",
+    shopEnterAdd: "shopEnterAdd",
+    infoBuy: "infoBuy",
+    infoSell: "infoSell",
+    infoAdd: "infoAdd",
+    news: "news"
+  }
+};

+ 53 - 0
src/lang/index.ts

@@ -0,0 +1,53 @@
+import Vue from "vue";
+import VueI18n from "vue-i18n";
+
+import { getLanguage, setLanguage } from "@/utils/cookies";
+
+// element-ui built-in lang
+import elementEnLocale from "element-ui/lib/locale/lang/en";
+import elementZhLocale from "element-ui/lib/locale/lang/zh-CN";
+
+// User defined lang
+import enLocale from "./en";
+import zhLocale from "./zh";
+
+Vue.use(VueI18n);
+
+const messages = {
+  en: {
+    ...enLocale,
+    ...elementEnLocale
+  },
+  zh: {
+    ...zhLocale,
+    ...elementZhLocale
+  }
+};
+
+const getLocale = () => {
+  const cookieLanguage = getLanguage();
+  if (cookieLanguage) {
+    return cookieLanguage;
+  }
+
+  const language = navigator.language.toLowerCase();
+  const locales = Object.keys(messages);
+  for (const locale of locales) {
+    if (language.indexOf(locale) > -1) {
+      return locale;
+    }
+  }
+
+  // Default language is english
+  return "en";
+};
+
+const i18n = new VueI18n({
+  locale: getLocale(),
+  messages
+});
+export const setLocale = (language: string) => {
+  setLanguage((i18n.locale = language));
+};
+
+export default i18n;

+ 24 - 0
src/lang/zh.ts

@@ -0,0 +1,24 @@
+export default {
+  title: "中国钢制家具产业聚集网",
+  route: {
+    home: "首页",
+    mall: "在线商城",
+    shops: "生产厂家",
+    info: "需求供应",
+    login: "登陆",
+    register: "注册",
+    findPassword: "忘记密码",
+    collect: "我的关注",
+    issue: "我的需求",
+    shopDetails: "店铺详情",
+    shopHonor: "资质荣誉",
+    shopProfile: "企业简介",
+    productDetails: "产品详情",
+    shopEnter: "企业认证公示",
+    shopEnterAdd: "商户入驻申请",
+    infoBuy: "求购信息详情",
+    infoSell: "供应信息详情",
+    infoAdd: "我要买",
+    news: "新闻内容"
+  }
+};

+ 1 - 1
src/views/layout/components/footer.vue

@@ -6,7 +6,7 @@
 <script lang="ts">
 import { Component, Vue } from "vue-property-decorator";
 @Component
-export default class yfooter extends Vue {}
+export default class extends Vue {}
 </script>
 <style scoped lang="scss">
 .footer {

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

@@ -0,0 +1,22 @@
+<template>
+  <div class="header">
+    header
+    <lang-select />
+  </div>
+</template>
+
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+import langSelect from "@/components/LangSelect.vue";
+@Component({
+  components: {
+    langSelect
+  }
+})
+export default class extends Vue {}
+</script>
+<style scoped lang="scss">
+.header {
+  height: 6rem;
+}
+</style>

+ 30 - 0
src/layout/components/nav.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="navs">
+    <router-link
+      class="nav"
+      v-for="{ url, title } in nav"
+      :to="url"
+      :key="title"
+      >{{ $t(`route.${title}`) }}</router-link
+    >
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue } from "vue-property-decorator";
+import { nav } from "@/router";
+@Component
+export default class extends Vue {
+  get nav() {
+    return nav.map(({ path: url, meta: { title } }) => ({ url, title }));
+  }
+}
+</script>
+<style lang="scss" scoped>
+.navs {
+  margin: 1rem 5rem;
+  .nav {
+    font-size: 1.5rem;
+    margin: 5rem;
+  }
+}
+</style>

+ 6 - 6
src/views/layout/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="layout">
     <y-header />
-    <!-- <breadcrumb /> -->
+    <y-nav />
     <keep-alive>
       <router-view class="main" />
     </keep-alive>
@@ -11,22 +11,22 @@
 <script lang="ts">
 import { Component, Vue, Watch } from "vue-property-decorator";
 import yHeader from "./components/header.vue";
+import yNav from "./components/nav.vue";
 import yFooter from "./components/footer.vue";
-import breadcrumb from "./components/breadcrumb.vue";
 @Component({
   components: {
     yHeader,
-    yFooter,
-    breadcrumb
+    yNav,
+    yFooter
   }
 })
-export default class layout extends Vue {}
+export default class extends Vue {}
 </script>
 <style lang="scss" scoped>
 .layout {
   height: 100%;
   .main {
-    min-height: calc(100% - 250px);
+    // min-height: calc(100% - 250px);
     overflow: hidden;
   }
 }

+ 7 - 4
src/main.ts

@@ -1,20 +1,23 @@
 import Vue from "vue";
-import elementUI, { Form } from "element-ui";
+import elementUI from "element-ui";
 import App from "./App.vue";
 import router from "./router";
 import store from "./store";
 import "./styles/index.scss";
 import request from "./utils/request";
-import { setTitles } from "./utils/index";
 import message from "./utils/message";
-Vue.use(elementUI);
+import i18n from "@/lang";
+Vue.use(elementUI, {
+  i18n: (key: string, value: string) => i18n.t(key, value)
+});
 Vue.use(request);
 Vue.use(message);
-setTitles(router);
+
 Vue.config.productionTip = false;
 
 new Vue({
   router,
   store,
+  i18n,
   render: h => h(App)
 }).$mount("#app");

+ 123 - 14
src/router/index.ts

@@ -1,12 +1,34 @@
 import Vue from "vue";
-import VueRouter, { Route, RouteConfig } from "vue-router";
-import layout from "../views/layout/index.vue";
-import { getTitle } from "@/utils";
+import VueRouter, { RouteConfig } from "vue-router";
+import layout from "@/layout/index.vue";
 import user from "@/store/modules/user";
 import { Loading } from "element-ui";
 import { Message } from "@/utils/message";
 import { login } from "@/utils/cookies";
+import { setPageTitle } from "@/utils";
 Vue.use(VueRouter);
+export const nav: RouteConfig[] = [
+  {
+    path: "/home",
+    component: () => import("../views/home/index.vue"),
+    meta: { title: "home" }
+  },
+  {
+    path: "/mall",
+    component: () => import("../views/mall/index.vue"),
+    meta: { title: "mall" }
+  },
+  {
+    path: "/shops",
+    component: () => import("../views/shops/index.vue"),
+    meta: { title: "shops" }
+  },
+  {
+    path: "/info",
+    component: () => import("../views/info/index.vue"),
+    meta: { title: "info" }
+  }
+];
 const router = new VueRouter({
   mode: "history",
   base: process.env.BASE_URL,
@@ -23,16 +45,104 @@ const router = new VueRouter({
       component: layout,
       redirect: "/home",
       children: [
+        ...nav,
+        {
+          path: "/login",
+          component: () => import("../views/account/login.vue"),
+          meta: { title: "login" }
+        },
+        {
+          path: "/register",
+          component: () => import("../views/account/register.vue"),
+          meta: { title: "register" }
+        },
+        {
+          path: "/findPassword",
+          component: () => import("../views/account/findPassword.vue"),
+          meta: { title: "findPassword" }
+        },
+        {
+          path: "/user",
+          component: () => import("../views/account/user/index.vue"),
+          // meta: { title: "user" },
+          redirect: "/user/collect",
+          children: [
+            {
+              path: "collect",
+              component: () => import("../views/account/user/collect.vue"),
+              meta: { title: "collect" }
+            },
+            {
+              path: "issue",
+              component: () => import("../views/account/user/issue.vue"),
+              meta: { title: "issue" }
+            }
+          ]
+        },
+        {
+          path: "/shop/:sid",
+          component: () => import("../views/shops/details/index.vue"),
+          redirect: "/shop/:sid/products",
+          props: true,
+          children: [
+            {
+              path: "products",
+              component: () => import("../views/shops/details/products.vue"),
+              meta: { title: "shopDetails" }
+            },
+            {
+              path: "honor",
+              component: () => import("../views/shops/details/honor.vue"),
+              meta: { title: "shopHonor" }
+            },
+            {
+              path: "profile",
+              component: () => import("../views/shops/details/profile.vue"),
+              meta: { title: "shopProfile" }
+            },
+            {
+              path: ":pid",
+              props: true,
+              component: () => import("../views/shops/details/product.vue"),
+              meta: { title: "productDetails" }
+            }
+          ]
+        },
+        {
+          path: "/shopEnter",
+          component: () => import("../views/shops/enter/index.vue"),
+          meta: { title: "shopEnter" }
+        },
+        {
+          path: "/shopEnter/add",
+          component: () => import("../views/shops/enter/add.vue"),
+          meta: { title: "shopEnterAdd" }
+        },
+        {
+          path: "/info/buy",
+          component: () => import("../views/info/details/buy.vue"),
+          meta: { title: "infoBuy" }
+        },
+        {
+          path: "/info/sell",
+          component: () => import("../views/info/details/sell.vue"),
+          meta: { title: "infoSell" }
+        },
+        {
+          path: "/info/add",
+          component: () => import("../views/info/add.vue"),
+          meta: { title: "infoAdd" }
+        },
         {
-          path: "/home",
-          component: () => import("../views/home/index.vue"),
-          meta: { title: "首页", nav: true }
+          path: "/news",
+          component: () => import("../views/news/index.vue"),
+          meta: { title: "news" }
         }
       ]
     },
     {
       path: "/error/:code",
-      component: () => import("../views/error.vue")
+      component: () => import("../views/errorPage/index.vue")
     }
   ]
 });
@@ -58,13 +168,12 @@ router.beforeEach(async (to, from, next) => {
     fullscreen: true,
     text: "跳转中..."
   });
-  if (errCode)
-    return next({
-      path: `/error/${errCode}`,
-      replace: true
-    });
-  const title = getTitle(to);
-  if (title) document.title = `${title} - ${process.env.VUE_APP_publicName}`;
+  // if (errCode)
+  //   return next({
+  //     path: `/error/${errCode}`,
+  //     replace: true
+  //   });
+  setPageTitle(to.meta.title);
   next();
 });
 router.afterEach((to, from) =>

+ 5 - 6
src/store/modules/user.ts

@@ -3,8 +3,7 @@ import {
   Module,
   getModule,
   Mutation,
-  Action,
-  MutationAction
+  Action
 } from "vuex-module-decorators";
 import { auth } from "@/utils/cookies";
 import { getUserInfo } from "@/api/user";
@@ -14,12 +13,12 @@ import store from "../index";
 class User extends VuexModule {
   public Token = auth.getToken() || "";
   public UserInfo: IUser | null = null;
-  @Action({ commit: "setUserInfo" })
+  @Action
   public async getUserInfo() {
     if (!this.Token) return null;
     const userInfo = await getUserInfo(this.Token);
     if (userInfo === null) this.clear();
-    return userInfo;
+    this.setUserInfo(userInfo);
   }
   @Mutation
   private setUserInfo(userInfo: IUser | null) {
@@ -29,11 +28,11 @@ class User extends VuexModule {
   private set_token(token: string) {
     this.Token = token;
   }
-  @Action({ commit: "set_token" })
+  @Action
   public setToken(token: string) {
     if (this.UserInfo) return this.Token;
     auth.setToken(token);
-    return token;
+    this.set_token(token);
   }
   @Mutation
   public clear() {

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

@@ -0,0 +1,29 @@
+declare module "*.vue" {
+  import Vue from "vue";
+  export default Vue;
+}
+declare module "element-ui/lib/locale/lang/*" {
+  export const elementLocale: any;
+}
+
+interface IAny {
+  [index: string]: any;
+}
+interface IError {
+  errmsg: string;
+  errno: number;
+}
+interface IBaseResult<T = any> extends IError {
+  data: T;
+}
+interface IRequest {
+  <T = any>(url: string, data?: any): Promise<IResult<T>>;
+}
+
+interface IResult<T> extends Array<IError | null | T> {
+  0: IError | null;
+  1: T;
+  length: 2;
+}
+
+interface IUser {}

+ 1 - 37
src/types/index.d.ts

@@ -1,5 +1,4 @@
-import Vue from "vue";
-
+import "vue";
 declare module "vue/types/vue" {
   interface Vue {
     $post: IRequest;
@@ -7,39 +6,4 @@ declare module "vue/types/vue" {
     $post_auth: IRequest;
     $get_auth: IRequest;
   }
-  interface VueConstructor {
-    $post: IRequest;
-    $get: IRequest;
-    $post_auth: IRequest;
-    $get_auth: IRequest;
-  }
-}
-
-declare global {
-  interface IAny {
-    [index: string]: any;
-  }
-  interface IError {
-    errmsg: string;
-    errno: number;
-  }
-  interface IBaseResult<T = any> extends IError {
-    data: T;
-  }
-  interface IRequest {
-    <T = any>(url: string, data?: any): Promise<IResult<T>>;
-  }
-
-  interface IResult<T> extends Array<IError | null | T> {
-    0: IError | null;
-    1: T;
-    length: 2;
-  }
-
-  interface IUser {}
-
-  interface IBreadCrumbs {
-    path: string;
-    title: string;
-  }
 }

+ 0 - 4
src/types/shims-vue.d.ts

@@ -1,4 +0,0 @@
-declare module "*.vue" {
-  import Vue from "vue";
-  export default Vue;
-}

+ 5 - 0
src/utils/cookies.ts

@@ -16,3 +16,8 @@ export const login = {
   set: (value: string) => Cookies.set("Login", value),
   remove: () => Cookies.remove("Login")
 };
+
+const languageKey = "language";
+export const getLanguage = () => Cookies.get(languageKey);
+export const setLanguage = (language: string) =>
+  Cookies.set(languageKey, language);

+ 8 - 53
src/utils/index.ts

@@ -1,55 +1,4 @@
-import { Route, RouteConfig } from "vue-router";
-
-export const getLevel = (level: string) => {
-  switch (level) {
-    case "1":
-      return 3;
-    case "2":
-      return 1;
-
-    case "3":
-      return 2;
-  }
-  return 0;
-};
-
-const titles: IBreadCrumbs[] = [];
-export const setTitles = (router: any) =>
-  titles.push(
-    ...getChildren(router.options.routes[0].children as RouteConfig[])
-  );
-const getChildren = (route: RouteConfig[], parent = "") => {
-  const t: IBreadCrumbs[] = [];
-
-  route.forEach(({ path, children, meta: { title } = { title: "" } }) => {
-    const tit: IBreadCrumbs = {
-      path: path.startsWith("/")
-        ? path
-        : `${parent ? `${parent}/` : parent}${path}`,
-      title
-    };
-    t.push(tit);
-    if (children) t.push(...getChildren(children, tit.path));
-  });
-  return t;
-};
-
-export const getTitle: (route: Route) => string = route => {
-  let title = getTitleByPath(route.path);
-  if (title) return title;
-  let length = route.matched.length;
-  while (!title && length--) {
-    title = getTitleByPath(route.matched[length].path);
-  }
-  return title;
-};
-export const getTitleByPath = (path: string) => {
-  let title = "";
-  titles.forEach(t => {
-    if (t.path === path) title = t.title;
-  });
-  return title;
-};
+import i18n from "@/lang";
 export const dateFormat = (fmt: string, x: Date | string) => {
   const date = typeof x === "string" ? new Date(x) : x;
   let ret;
@@ -60,7 +9,6 @@ export const dateFormat = (fmt: string, x: Date | string) => {
     "h+": date.getHours().toString(), // 时
     "m+": date.getMinutes().toString(), // 分
     "s+": date.getSeconds().toString() // 秒
-    // 有其他格式化字符需求可以继续添加,必须转化成字符串
   };
   for (let k in opt) {
     ret = new RegExp("(" + k + ")").exec(fmt);
@@ -73,3 +21,10 @@ export const dateFormat = (fmt: string, x: Date | string) => {
   }
   return fmt;
 };
+
+export const setPageTitle = (key: string) => {
+  const title = i18n.t("title");
+  document.title = `${
+    i18n.te(`route.${key}`) ? i18n.t(`route.${key}`) + " - " : ""
+  }${title}`;
+};

+ 1 - 1
src/utils/request.ts

@@ -3,7 +3,7 @@ import axios from "axios";
 import qs from "qs";
 import user from "@/store/modules/user";
 const instance = axios.create({
-  baseURL: process.env.VUE_APP_BaseUrl,
+  baseURL: process.env.VUE_APP_BASE_API,
   timeout: 5000,
   headers: {
     "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"

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

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    找回密码
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/account/login.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    登陆
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/account/register.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    注册
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/account/user/collect.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    我的关注
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 11 - 0
src/views/account/user/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>
+    会员中心
+    <router-view />
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/account/user/issue.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    我的需求
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 3 - 1
src/views/error.vue

@@ -19,7 +19,9 @@
 import { Component, Vue, Watch } from "vue-property-decorator";
 @Component
 export default class extends Vue {
-  private title = process.env.VUE_APP_publicName;
+  get title() {
+    return this.$t("title");
+  }
   get message() {
     switch (this.$route.params.code) {
       case "401":

+ 8 - 1
src/views/home/index.vue

@@ -1,3 +1,10 @@
 <template>
-  <div>index</div>
+  <div>
+    首页
+  </div>
 </template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/info/add.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    提交需求表单
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/info/details/buy.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    需求详情
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/info/details/sell.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    供应详情
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/info/index.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    需求供应
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 0 - 50
src/views/layout/components/breadcrumb.vue

@@ -1,50 +0,0 @@
-<template>
-  <div class="bgF5">
-    <el-breadcrumb
-      v-if="arr.length > 1"
-      class="container  breadcrumb"
-      separator-class="el-icon-arrow-right"
-    >
-      <el-breadcrumb-item
-        v-for="({ path, title }, index) in arr"
-        :key="path"
-        :to="index === arr.length - 1 ? '' : path"
-        >{{ title }}</el-breadcrumb-item
-      >
-    </el-breadcrumb>
-  </div>
-</template>
-<script lang="ts">
-import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator";
-import { getTitle, getTitleByPath } from "@/utils/index";
-@Component
-export default class extends Vue {
-  get arr() {
-    const arr: IBreadCrumbs[] = [];
-    const paths = this.$route.path.split("/");
-    paths.reduce((total = "", curr, index) => {
-      const path = `${total}/${curr}`;
-      let title = getTitleByPath(path);
-      if (index === paths.length - 1 && !title) title = getTitle(this.$route);
-      if (title) arr.push({ title, path });
-      return path;
-    });
-    return arr;
-  }
-}
-</script>
-<style lang="scss" scoped>
-.breadcrumb {
-  height: 4rem;
-  line-height: 4rem;
-  padding: 0 20px;
-  box-sizing: border-box;
-  span {
-    cursor: pointer;
-  }
-}
-.pd20 {
-  padding: 20px;
-  box-sizing: border-box;
-}
-</style>

+ 0 - 11
src/views/layout/components/header.vue

@@ -1,11 +0,0 @@
-<template>
-  <div class="header">
-    header
-  </div>
-</template>
-
-<style scoped lang="scss">
-.header {
-  height: 14rem;
-}
-</style>

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

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    在线商城
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/news/index.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    新闻咨询
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/shops/details/honor.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    店铺资质荣誉
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 14 - 0
src/views/shops/details/index.vue

@@ -0,0 +1,14 @@
+<template>
+  <div>
+    店铺详情-{{ sid }}
+    <router-view />
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch, Prop } from "vue-property-decorator";
+@Component
+export default class extends Vue {
+  @Prop(String)
+  private sid!: string;
+}
+</script>

+ 11 - 0
src/views/shops/details/product.vue

@@ -0,0 +1,11 @@
+<template>
+  <div>商品详情-{{ pid }}</div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch, Prop } from "vue-property-decorator";
+@Component
+export default class extends Vue {
+  @Prop(String)
+  private pid!: string;
+}
+</script>

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

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    店铺商品列表
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/shops/details/profile.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    企业简介
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/shops/enter/add.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    申请商家入住表单
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 10 - 0
src/views/shops/enter/index.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    企业认证公示
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

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

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    生产厂家
+  </div>
+</template>
+<script lang="ts">
+import { Component, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class extends Vue {}
+</script>

+ 6 - 3
vue.config.js

@@ -9,9 +9,12 @@ module.exports = {
   devServer: {
     open: true,
     proxy: {
-      "/oneportal": {
-        target: process.env.VUE_APP_Target
-        // changeOrigin: true,
+      [process.env.VUE_APP_BASE_API]: {
+        target: process.env.VUE_APP_Target,
+        changeOrigin: true
+        // pathRewrite: {
+        //   ["^" + process.env.VUE_APP_BASE_API]: ""
+        // }
       }
     }
   }