From caa654ec657331f4774856c43838a8b9f322ccbd Mon Sep 17 00:00:00 2001 From: callmeyan Date: Fri, 1 Jan 2021 10:07:56 +0800 Subject: [PATCH] c --- src/Layout.vue | 22 ++++- src/components/SearchGoodsBox.vue | 53 ++++++++++++ src/main.js | 5 +- src/router.js | 90 ++++++++++++--------- src/style.less | 3 + src/views/Cart.vue | 130 ++++++++++++++++++++++++++++++ src/views/Category.vue | 11 +-- src/views/Detail.vue | 26 +++++- src/views/Home.vue | 13 +-- src/views/Orders.vue | 13 +++ src/views/bak/Home.vue | 88 -------------------- src/views/bak/Login.vue | 93 --------------------- 12 files changed, 306 insertions(+), 241 deletions(-) create mode 100644 src/components/SearchGoodsBox.vue create mode 100644 src/style.less create mode 100644 src/views/Cart.vue create mode 100644 src/views/Orders.vue delete mode 100644 src/views/bak/Home.vue delete mode 100644 src/views/bak/Login.vue diff --git a/src/Layout.vue b/src/Layout.vue index eeb4d2d..f74ff26 100644 --- a/src/Layout.vue +++ b/src/Layout.vue @@ -1,10 +1,10 @@ \ No newline at end of file diff --git a/src/components/SearchGoodsBox.vue b/src/components/SearchGoodsBox.vue new file mode 100644 index 0000000..4c9ea3b --- /dev/null +++ b/src/components/SearchGoodsBox.vue @@ -0,0 +1,53 @@ + + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 8da53d4..7a9efca 100644 --- a/src/main.js +++ b/src/main.js @@ -1,14 +1,13 @@ import Vue from 'vue' import App from './App.vue' -import 'element-ui/lib/theme-chalk/index.css' -import ElementUI from "element-ui" +// import 'element-ui/lib/theme-chalk/index.css' import router from './router' import Vant from 'vant'; import 'vant/lib/index.css'; +import './style.less'; import { Lazyload } from 'vant'; Vue.config.productionTip = false -Vue.use(ElementUI) Vue.use(Vant); Vue.use(Lazyload); diff --git a/src/router.js b/src/router.js index 1e0401f..b824a99 100644 --- a/src/router.js +++ b/src/router.js @@ -8,49 +8,59 @@ import Vuex from 'vuex' Vue.use(Vuex) Vue.use(Router) const router = new Router({ - routes: [{ + routes: [ + { + path: '/', + component: Layout, + children: [ + { + path: '/', + name: 'home', + component: Home, + }, + { + path: '/cate', + name: 'Category', + component: () => import( /* webpackChunkName: "Category" */ './views/Category.vue') + }, + { + path: '/cart', + name: 'Cart', + component: () => import( /* webpackChunkName: "Cart" */ './views/Cart.vue') + }, + { + path: '/my', + name: 'Orders', + component: () => import( /* webpackChunkName: "Orders" */ './views/Orders.vue') + } + ] + }, + { + path: '/login', + name: 'Login', + component: () => import( /* webpackChunkName: "Login" */ './views/Login.vue') + }, + { + path: '/goods-list', + name: 'GoodsList', + component: () => import( /* webpackChunkName: "GoodsList" */ './views/GoodsList.vue') + }, + { + path: '/goods-detail', + name: 'GoodsDetail', + component: () => import( /* webpackChunkName: "GoodsDetail" */ './views/Detail.vue') + } - path: '/', - component: Layout, - children: [ - { - path: '/', - name: 'home', - component: Home, - }, - { - path: '/cate', - name: 'Category', - component: () => import( /* webpackChunkName: "Category" */ './views/Category.vue') - } - ] - }, - { - path: '/login', - name: 'Login', - component: () => import( /* webpackChunkName: "Login" */ './views/Login.vue') - }, - { - path: '/goods-list', - name: 'GoodsList', - component: () => import( /* webpackChunkName: "GoodsList" */ './views/GoodsList.vue') - }, - { - path: '/goods-detail', - name: 'GoodsDetail', - component: () => import( /* webpackChunkName: "GoodsDetail" */ './views/Detail.vue') - } - - ] + ] }); router.beforeEach((to, from, next) => { - // if(to.path != '/login'){ - // if(store.state.user.userId < 1){ - // next({path:'/login'}); - // return; - // } - // } - next(); + // if(to.path != '/login'){ + // if(store.state.user.userId < 1){ + // next({path:'/login'}); + // return; + // } + // } + next(); }); export default router; \ No newline at end of file diff --git a/src/style.less b/src/style.less new file mode 100644 index 0000000..4b73851 --- /dev/null +++ b/src/style.less @@ -0,0 +1,3 @@ +.text-center{ + text-align:center; +} \ No newline at end of file diff --git a/src/views/Cart.vue b/src/views/Cart.vue new file mode 100644 index 0000000..ae4a122 --- /dev/null +++ b/src/views/Cart.vue @@ -0,0 +1,130 @@ + + + + + \ No newline at end of file diff --git a/src/views/Category.vue b/src/views/Category.vue index 5cfa42d..19153b5 100644 --- a/src/views/Category.vue +++ b/src/views/Category.vue @@ -1,13 +1,6 @@