GithubHelp home page GithubHelp logo

cody1991 / ticket-purchase Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.04 MB

在线购票模拟系统。有完善的开发文档,在线Demo演示,以及流程图,模块说明,使用说明等等

Home Page: https://cody1991.github.io/ticket-purchase/?front=50&back=100&step=2&block=4&refundRate=0.1&sleepMax=50

License: MIT License

JavaScript 43.97% HTML 2.37% Vue 51.82% Shell 1.84%

ticket-purchase's Introduction

Ticket Purchase Build Status

Demo 地址

https://cody1991.github.io/ticket-purchase/?front=50&back=100&step=2&block=4&refundRate=0.1&sleepMax=50

运行结果

运行结果


https://cody1991.github.io/ticket-purchase

运行结果

运行结果

URL 参数使用

参数名 说明 参数值
displayUsersLen 展示用户行为列表的最大值 > 0, 默认 25
sleepMax 模拟每次购票用户等待时间的最大值 > 0, 默认 100ms
refundRate 用户退票的概率 >= 0, 默认 0.2
block 区块数 > 0, 默认 2
front 第一排的座位数量 > 0, 默认 2
back 最后一排的座位数量 > 0, 默认 20
step 每排递增的数量 != 0, 默认 1

任务列表

  • Other
    • 新增算法的流程图
    • 展示演唱会的位置使用 canvas 绘制(现在座位太多的话很卡,先简单处理,座位数太多的时候隐藏)
  • Class
    • User: 购票用户信息与行为
    • Seats: 演唱会座位信息
    • AdvancedSeas: 继承 Seats,优化购票算法
  • Views
    • Helloworld: 简单的项目介绍
    • DisplaySeats: 展示演唱会座位
    • DisplayUsers: 展示用户购票
      • 展示 n 排 n 座
      • 展示在第几个区域
    • Intro: 演唱会现况
  • Deploy (Github Pages)
    • 手动构建: sh ./deploy.sh
    • 自动构建: 接入 Travis CI
  • Algorithm
    • purchase ticket by order 按顺序购票,无太多逻辑
    • 支持退票
    • 随机购票
    • 邻座分配(只考虑横向的邻座)

流程图

流程图

ticket-purchase's People

Contributors

cody1991 avatar

Stargazers

苍南 avatar Jsonz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.