Skip to content

Commit

Permalink
部分优化
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed Jun 20, 2017
1 parent 12bf395 commit 8095289
Show file tree
Hide file tree
Showing 46 changed files with 211 additions and 135 deletions.
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm run build
# 效果演示


[demo地址](http://test.fe.ptdev.cn/happyfri/)(请用chrome手机模式预览)
[demo地址](http://cangdu.org/happyfri/)(请用chrome手机模式预览)

### 移动端扫描下方二维码

Expand Down Expand Up @@ -71,23 +71,16 @@ import ajax from '../config/ajax'

export default {
addNum({ commit, state }, id) {
//点击下一题,记录答案id,判断是否是最后一题,如果不是则跳转下一题
commit('REMBER_ANSWER', { id })
if (state.itemNum < state.itemDetail.length) {
commit('ADD_ITEMNUM', {
num: 1
})
}
},

getData({ commit, state }) {
ajax('GET', 'http://operating-activities.putao.com/happyfriday?active_topic_id=4').
then(res => {
commit('GET_DATA', {
res
})
})
},


//初始化信息
initializeData({ commit }) {
commit('INITIALIZE_DATA')
}
Expand All @@ -98,38 +91,30 @@ export default {

## mutations
```js
const GET_DATA = 'GET_DATA'
const ADD_ITEMNUM = 'ADD_ITEMNUM'
const REMBER_ANSWER = 'REMBER_ANSWER'
const REMBER_TIME = 'REMBER_TIME'
const INITIALIZE_DATA = 'INITIALIZE_DATA'
const GET_USER_INFORM = 'GET_USER_INFORM'

export default {
[GET_DATA](state, payload) {
if (payload.res.httpStatusCode == 200) {
state.itemDetail = payload.res.topiclist;
}
},

[GET_USER_INFORM](state, payload) {
state.user_id = payload.res.users_id;
},

//点击进入下一题
[ADD_ITEMNUM](state, payload) {
state.itemNum += payload.num;
},

//记录答案
[REMBER_ANSWER](state, payload) {
state.answerid[state.itemNum] = payload.id;
},

/*
记录做题时间
*/
[REMBER_TIME](state) {
state.timer = setInterval(() => {
state.allTime++;
}, 1000)
},

/*
初始化信息,
*/
[INITIALIZE_DATA](state) {
state.itemNum = 1;
state.allTime = 0;
Expand Down
6 changes: 2 additions & 4 deletions happyfri/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
<meta name="screen-orientation" content="portrait" />
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="screen-orientation" content="portrait"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
Expand Down
2 changes: 1 addition & 1 deletion happyfri/static/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified happyfri/static/img/1-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified happyfri/static/img/1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed happyfri/static/img/2-1.png
Binary file not shown.
Binary file modified happyfri/static/img/4-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified happyfri/static/img/4-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed happyfri/static/img/4-3.png
Binary file not shown.
Binary file modified happyfri/static/img/4-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed happyfri/static/img/5-2.png
Binary file not shown.
2 changes: 1 addition & 1 deletion happyfri/static/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions happyfri/static/js/home.974d5d21b74c00c29576.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions happyfri/static/js/home.eba44ba58e2bfc337147.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions happyfri/static/js/item.3b980ae7430e17d02370.min.js

This file was deleted.

1 change: 1 addition & 0 deletions happyfri/static/js/item.7eda274d80fddaaf58dc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion happyfri/static/js/manifest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions happyfri/static/js/score.928bc788f34a3d977dab.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 8095289

Please sign in to comment.