{"size": 935, "ext": "js", "max_stars_repo_path": "src/mock/api/common/adv.js", "max_stars_repo_name": "coderStars/vue_backstage", "max_stars_repo_stars_event_min_datetime": "2019-06-08T01:23:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-28T15:52:49.000Z", "max_issues_repo_path": "src/mock/api/common/adv.js", "max_issues_repo_name": "coderStars/vue_backstage", "max_issues_repo_issues_event_min_datetime": "2020-03-22T10:19:57.000Z", "max_issues_repo_issues_event_max_datetime": "2020-03-30T07:52:49.000Z", "max_forks_repo_path": "src/mock/api/common/adv.js", "max_forks_repo_name": "coderStars/vue_backstage", "max_forks_repo_forks_event_min_datetime": "2019-06-08T01:40:56.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-12T07:10:34.000Z"}
{"max_stars_count": 82, "max_issues_count": 1, "max_forks_count": 32, "avg_line_length": 26.7142857143, "max_line_length": 106, "alphanum_fraction": 0.6203208556}
import Mock from 'mockjs'
import { getQueryObject } from '@/utils'

const List = []
const count = 6
const img_url = [
  'http://jing-ui.com/Public/uploads/1414050553.jpg',
  'http://jing-ui.com/Public/uploads/1408321593.jpg',
  'http://jing-ui.com/Public/uploads/1408290688.jpg',
  'http://jing-ui.com/Public/uploads/1393824421.jpg',
  'http://jing-ui.com/Public/uploads/1394098765.jpg',
  'http://jing-ui.com/Public/uploads/banner-02.jpg'
]

for (let i = 0; i < count; i++) {
  List.push(Mock.mock({
    id: '@increment',
    'title|1': '@pick(["人民币", "美元", "日元", "全币种", "港币"])',
    img: `@pick(${img_url})`
  }))
}

export default {
  advListData (config) {
    const { page = 1, limit = 20 } = getQueryObject(config.url)
    const mockList = List
    const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))

    return {
      total: mockList.length,
      list: pageList
    }
  }
}
