- 基于nodejs && express的后台服务
- 基于zepto的前端网页构建
- 前后数据分离
###注:头像上传功能暂时没加上去,用户头像都采用默认头像
首页
报名页
个人主页
搜索页
规则页
克隆项目
> $ git clone https://github.com/Cathy0807/vote.git
在vote目录下安装依赖包
> $ npm install
启动服务器
> $ npm run start
执行完npm run start
命令后,打开浏览器 http://localhost:8080/vote/index
访问首页地址
-
项目需求
- 实现投票获奖活动,票数越高,排名越高。
- 只有报名用户才可以参加投票,每人最多投5票,每一个投票者最多只能投一票给同一个人。
- 报名用户既是投票者,也是被投票者。
- 用户未登入时,首页橙色按钮显示我要报名状态,点击进入报名页。
- 用户已登入,首页橙色按钮显示个人主页,点击进入登入者的个人主页。
- 用户未登入进行投票,点击投票则提示用户先登入或者报名才可以参与投票。
- 首页搜索内容可以为用户的名称或编号,如有多个相同名称,则返回所有匹配名称的用户信息。
- 搜索页的用户内容也可以进行投票,投票行为和首页的投票行为一致。
- 首页用户信息通过上拉加载刷新进行分页,每页为十条数据。
- 个人详细页需要显示投票者信息。
-
页面访问地址
- 首页:localhost:8080/vote/index
- 报名页:localhost:8080/vote/register
- 个人详细页:localhost:8080/vote/detail/{id}
- 搜索页:localhost:8080/vote/search
- 规则页:localhost:8080/vote/rule
-
后台接口
- 首页加载用户信息
method: GET url: /vote/index/data?limit=10&offset=0 参数说明: limit为每页限制数量,offset为偏移量 返回数据:errno为0,数据正确
- 首页投票请求
method: GET url: /vote/index/poll?id={被投票者id}&voterId={投票者id} 返回数据:errno为0,数据正确
- 首页登入请求
method: POST url: /vote/index/info sendData: { password: {用户密码}, id: {用户编号} } 返回数据:errno为0,数据正确
- 搜索页搜索内容
method: GET url: /vote/index/search?content={搜索内容} 返回数据:errno为0,数据正确
- 报名页报名请求
method: POST url: /vote/register/data sendData: { username: {用户名}, mobile: {手机号码}, description: {描述}, gender: {性别, 男:'boy', 女:'girl'}, password: {用户密码} } 返回数据:errno为0,数据正确
- 个人主页加载数据请求
method: GET url: /vote/all/detail/data?id={用户id} 返回数据:errno为0,数据正确
vote's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.