vue项目-外卖管理系统

一、项目介绍

本项目是一个外卖的后端管理系统,可以对外卖的商品,商家等等进行一些操作,包括后端管理系统本身也用到了权限路由,对不同权限的账号设置了一些限制,用到了vue3和element-plus组件库协同开发。

二、路由配置

路由分为
1.登陆页面(一级路由)
2.页面主件 渲染tab栏切换(一级路由)
3.商品管理、店铺管理、账号管理、销售统计 (都是二级路由)

2.1 安装依赖

npm install vue-router@4(@4专门为vue3项目设计的)

2.2 创建路由配置文件

src/router/index.js

在index.js文件里面将路由绑定的组件引入进来

import { createRouter, createWebHistory } from 'vue-router';
import  LoginView from '../components/LoginView.vue'
import  HomeView from '../views/HomeView.vue'
import OrderView from '../views/OrderView.vue'
import ProductList from '../views/ProductList.vue'
import ProductAdd from '../views/ProductAdd.vue'
import ProductClassification from '../views/ProductClassification.vue'
import ShopView from '../views/ShopView.vue'
import LayoutView from '../views/LayoutView.vue'
import AccAdd from '../views/AccAdd.vue'
import AccList from '../views/AccList.vue'
import AccEdit from '../views/AccEdit.vue'
import AccHome from '../views/AccHome.vue'
import OrderStatistics from '../views/OrderStatistics.vue'
import ProductStatistics from '../views/ProductStatistics.vue'

2.3 配置组件路由以及权限控制

这是基本的路由配置
path:路由路径
component:路由渲染的组件
meta:一般用来给路由添加一些数据 比如title 或者我们现在要用到了roles(哪些身份可以访问)

const routes = [
  {
    path: '/',//路由路径
    component: LayoutView,//渲染的组件
    redirect: '/Login',
    meta:{title:'主页'},
    children: [
      {
        path: '/index',
        component: HomeView,
        meta:{title:'首页' ,roles:['super','normal']}
      },
      {
        path:'/order',
        component:OrderView,
        meta:{title:'订单' ,roles:['super','normal']}
      },
      {
        path:'/productList',
        component:ProductList,
        meta:{title:'商品列表' ,roles:['super','normal']}
      },
      {
         path:'/productAdd',
         component:ProductAdd,
         meta:{title:'商品添加' ,roles:['super','normal']}
      },
      {
        path:'/productClassification',
        component:ProductClassification,
        meta:{title:'商品分类' ,roles:['super','normal']}
      },
      {
        path:'/shopView',
        component:ShopView,
        meta:{title:'店铺',roles:['super']}
      },
      {
        path:'/accAdd',
        component:AccAdd,
        meta:{title:'账号添加',roles:['super','normal']}
      },
      {
        path:'/accList',
        compo
项目为外卖App核心的商家模块的SPA,包括商品、评论、商家介绍、购物车等多个子模块,使用Vuejs全家桶+ES6+Webpack等前端最新最热的技术,采用模块化、组件化、工程化的模式开发; 显示/隐藏优惠和公告详情 <template> <div class="header"> <div class="content-wrapper"> <div class="avatar"> <img width="64" height="64"src="seller.avatar"> </div> <div class="content"> <div class="title"> <span class="brand"></span> <span class="name">{{seller.name}}</span> </div> <div class="description"> {{seller.description}}/{{seller.deliveryTime}}分钟到达 </div> <div class="support" v-if="seller.supports"> <span class="icon" :class="classMap[seller.supports[0].type]"></span> <span class="text">{{seller.supports[0].description}}</span> </div> </div> <div class="supports_count" v-if="seller.supports" @click="showDetail(true)"> <span class="count">{{seller.supports.length}}个</span> <span class="icon-keyboard_arrow_right"></span> </div> </div> <div class="bulletin-wrapper" @click="showDetail(true)"> <span class="bulletin-title"></span> <span class="bulletin-text">{{seller.bulletin}}</span> <i class="icon-keyboard_arrow_right"></i> </div> <div class="background"> <img width="100%" height="100%"src="seller.avatar"> </div> <div class="detail" v-show="detailShow"> <div class="detail-wrapper"> <div class="detail-main clearfix"> <div class="name">{{seller.name}}</div> <div class="star-wrapper">star组件内容</div> <div class="title"> <div class="line"></div> <div class="text">优惠信息</div> <div class="line"></div> </div> <ul class="supports" v-if="seller.supports"> <li class="support" v-for="item in seller.supports"> <span class="icon" :class="classMap[item.type]"></span> <span class="text">{{item.description}}</span> </li> </ul> <div class="title"> <div class="line"></div> <div class="text">商家公告</div> <div class="line"></div> </div> <div class="content"> <p>{{seller.bulletin}}</p> </div> </div> </div> <div class="detail-close" @click="showDetail(false)"> <span class="icon-close"></span> </div> </div> </div> </template> [removed] export default{ props: { seller: { type: Object } }, data () { return { detailShow: false } }, created () { this.classMap = ["decrease", "discount", "guarantee", "invoice", "special"] }, methods: { showDetail (isShow) { this.detailShow = isShow } } } [removed]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值