<repo_name>cj814/YiKaTong<file_sep>/src/mock/caipu.js
// 引入mockjs
const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;

// 菜谱列表
const caiPuList = () => {
    let caiPuList = [];

    for(let i = 0; i < 10; i++) {
        caiPuList.push({
            caiPuName: Random.csentence(4, 6),
            caiPuImage: Random.dataImage('100%x100%', '随机菜谱')
        })
    }

    return caiPuList
}

// 菜谱详情
const caiPuDetail = () => {
    let caiPuDetail = {
        danBaiZhi: Random.float(0, 100, 2, 2) + '%',
        xianWeiSu: Random.float(0, 100, 2, 2) + '%',
        huaHeWu: Random.float(0, 100, 2, 2) + '%',
        caiPuScore: Random.integer(0, 5),
        caiPuName: Random.csentence(4, 6),
        caiPuImage: Random.dataImage('100%x100%', '随机菜谱')
    }

    return caiPuDetail
}

export default {
    getCaiPuList: caiPuList,
    getCaiPuDetail: caiPuDetail
}<file_sep>/src/mock/account.js
// 引入mockjs
const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;


// 账户信息
const accountInfo = () => {
    let accountInfo = {
        userName: Random.cname(),
        cardNumber: Random.natural(),
        bankName: Random.csentence(4, 6),
        bankLogo: Random.dataImage('100%x100%', 'B')
    }

    return accountInfo
}

export default {
    getAccountInfo: accountInfo
}<file_sep>/src/mock/cost.js
// 引入mockjs
const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;

// 消费列表
const costList = () => {
    let costList = [];

    for (let i = 0; i < 10; i++) {
        costList.push({
            costName: Random.csentence(6, 8),
            costTime: Random.datetime('MM-dd HH:mm'),
            costMoney: Random.float(0, 1000, 2, 2)
        })
    }

    return costList
}

// 消费详情
const costDetail = () => {
    let costDetail = {
        costName: Random.csentence(6, 8),
        yingYeShiDuan: Random.csentence(2, 4),
        costMoney: Random.float(0, 1000, 2, 2),
        qingCaiBao: Random.float(0, 1000, 2, 2),
        kaNeiJinE: Random.float(0, 1000, 2, 2),
        costTime: Random.datetime('yyyy-MM-dd HH:mm')
    };

    return costDetail
}

export default {
    getCostList: costList,
    getCostDetail: costDetail
}<file_sep>/src/mock/kaoqin.js
// 引入mockjs
const Mock = require('mockjs');
// 获取 mock.Random 对象
const Random = Mock.Random;

// 考勤状态
const kaoQinState = () => {
    let kaoQinState = {
        chuQinTianShu: Random.integer(1, 31),
        xiuXiTianShu: Random.integer(1, 31),
        chiDao: Random.integer(1, 31),
        zaoTui: Random.integer(1, 31),
        kuangGong: Random.integer(1, 31),
        jiaBan: Random.integer(1, 31)
    }

    return kaoQinState
}

// 考勤详情
const kaoQinDetail = () => {
    let kaoQinDetail = {
        shangBanTime: Random.datetime('HH:mm'),
        xiaBanTime: Random.datetime('HH:mm')
    }

    return kaoQinDetail
}

export default {
    getUserKaoQinState: kaoQinState,
    getUserKaoQinDetail: kaoQinDetail
}<file_sep>/src/api/cost.js
import { fetch } from '../utils/fetch'

// 消费列表
export function getCostList(url, params) {
    return fetch(url, params)
}

// 消费详情
export function getCostDetail(url, params) {
    return fetch(url, params)
}<file_sep>/src/api/kaoqin.js
import { fetch } from '../utils/fetch'

// 考勤状态
export function getUserKaoQinState(url, params) {
    return fetch(url, params)
}

// 考勤详情
export function getUserKaoQinDetail(url, params) {
    return fetch(url, params)
}<file_sep>/src/router/index.js
import Vue from 'vue'
import Router from 'vue-router'
import App from '../App'
import Layout from '../views/layout'
import kaoQinRecord from '../views/kaoQinRecord'
import costRecord from '../views/costRecord'
import oneWeekMenu from '../views/oneWeekMenu'
import menuDetail from '../views/menuDetail'
import costDetail from '../views/costDetail'
import foodEvaluate from '../views/foodEvaluate'
import myAccount from '../views/myAccount'
import transMoney from '../views/transMoney'
import kaoQinDate from '../views/kaoQinDate'
import kaoQinDetail from '../views/kaoQinDetail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: Layout
    },
    {
      path: '/views/kaoQinRecord',
      name: 'kaoQinRecord',
      component: kaoQinRecord
    },
    {
      path: '/views/kaoQinDetail',
      name: 'kaoQinDetail',
      component: kaoQinDetail
    },
    {
      path: '/views/oneWeekMenu',
      name: 'oneWeekMenu',
      component: oneWeekMenu
    },
    {
      path: '/views/costRecord',
      name: 'costRecord',
      component: costRecord
    },
    {
      path: '/views/menuDetail',
      name: 'menuDetail',
      component: menuDetail
    },
    {
      path: '/views/costDetail',
      name: 'costDetail',
      component: costDetail
    },
    {
      path: '/views/foodEvaluate',
      name: 'foodEvaluate',
      component: foodEvaluate
    },
    {
      path: '/views/myAccount',
      name: 'myAccount',
      component: myAccount
    },
    {
      path: '/views/transMoney',
      name: 'transMoney',
      component: transMoney
    },
    {
      path: '/views/kaoQinDate',
      name: 'kaoQinDate',
      component: kaoQinDate
    }
  ]
})
<file_sep>/README.md
# 一卡通考勤（公司vue-cli项目demo）

## 安装

``` bash
# 安装项目依赖
npm install

# 运行
npm run dev

# 编译
npm run build
```

在线预览：https://cj814.github.io/YiKaTong/docs/