Skip to content

Commit

Permalink
⬆️ Upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zce committed May 2, 2018
1 parent cb3e56d commit f09d435
Show file tree
Hide file tree
Showing 4 changed files with 1,753 additions and 1,643 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"del": "^3.0.0",
"eslint": "^4.16.0",
"eslint-config-standard": "^11.0.0-beta.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"generate-weapp-page": "^0.1.3",
Expand All @@ -54,7 +54,7 @@
"gulp-if": "^2.0.1",
"gulp-imagemin": "^4.1.0",
"gulp-jsonminify": "^1.1.0",
"gulp-less": "^3.4.0",
"gulp-less": "^4.0.0",
"gulp-load-plugins": "^1.3.0",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.6.3",
Expand Down
8 changes: 6 additions & 2 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"client": "dist",
"setting": {
"urlCheck": true
}
"urlCheck": true,
"newFeature": true
},
"appid": "wxb9eb22375e8789a7",
"projectname": "weapp-douban",
"condition": {}
}
54 changes: 12 additions & 42 deletions src/pages/board/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,31 @@ Page({
boards: [
{ key: 'in_theaters' },
{ key: 'coming_soon' },
{ key: 'top250' }
{ key: 'new_movies' },
{ key: 'top250' },
// { key: 'weekly' },
// { key: 'new_movies' },
// { key: 'us_box', name: '北美票房榜' }
],
loading: true
// { key: 'us_box' }
]
},

/**
* 生命周期函数--监听页面加载
*/
onLoad () {
const promises = this.data.boards.map(board => {
return app.douban.find(board.key, 1, 10)
wx.showLoading({ title: '拼命加载中...' })

const tasks = this.data.boards.map(board => {
return app.douban.find(board.key, 1, 8)
.then(d => {
board.title = d.title
board.movies = d.subjects
return board
})
})
Promise.all(promises).then(boards => this.setData({ boards: boards, loading: false }))
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady () {
// TODO: onReady
},

/**
* 生命周期函数--监听页面显示
*/
onShow () {
// TODO: onShow
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide () {
// TODO: onHide
},

/**
* 生命周期函数--监听页面卸载
*/
onUnload () {
// TODO: onUnload
},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh () {
// TODO: onPullDownRefresh
Promise.all(tasks).then(boards => {
this.setData({ boards: boards, loading: false })
wx.hideLoading()
})
}
})
Loading

0 comments on commit f09d435

Please sign in to comment.