Skip to content

Commit

Permalink
加入下拉刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
iwyvi committed Jul 11, 2018
1 parent 0610912 commit 47ba77c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/app.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export default class extends wepy.app {
'pages/about'
],
window: {
backgroundTextStyle: 'dark',
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#191919',
backgroundColor: '#191919',
navigationBarTitleText: '乌贼日历',
navigationBarTextStyle: 'white'
},
Expand Down
1 change: 1 addition & 0 deletions src/less/background.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ page {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoCAMAAABNO5HnAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVH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NKD9HCTR53OYU0JHaVPc6rr6+ONXbhEnX64tb30fPkS7XF/e+j54zkav1Rd77Pnpu67tYX8zzNgE/FhGUavVFp7dZRbDfP4gASJfqi5JO2Oxt7jcQiB9UFVlLOmEraWxR2/0mn/vobUuxHrShGvcGNdGza0Hnc66pp5ZLU4fJSVr23DfzNuWkT+i4+UnnYD+29z56YD4Vk+5p1+sfE/jKtaR7NkZiMmnGG+jZggqStDY/I0KCjXSApNVZg3BsbKSDI61OdZA2ZiINRaQ8+z56gDQVRgXzM0U6W0iLPkCkTIZIZwtpZqmC8vNYE9nnbZry81gT2edtuvLzVBPZ520qd5xQ0k1tIKCkUO+piF8VsP9o8jY1+bm7/0gNLS+TgVZ/3+aFcORh20wCHlolaMgcPZB0Nvmxz330F0Gr7AMpkohu0oRNOIfzc67pcx+9BDRy2uZuFIaeJvVYhvixQY+861LLQX/TuaYt99H/f+Xs9mNvfB99ft25pk330X/duaZd99F/27mmQ+6j7yD9nGvqIT3a22zq1v+duLX5eaS32eXHUoLsc67pB9LaTudIb5OcSJdJq7PGSG+TXLEWSctT3Uxvk4wGS6TxahnsvelJB0Zan5/HeptdfqzsXYZ+UIsrIPqooX4EQ7rFyhBNn1SVjJBu8V8CIQ3m56nepsuPlebnI71Nlx8rzc/PffQrpOUN6GM6kCY/VpSfW3FcGvpMbfO5j3486ZHnmqqB9JPOG99Hb9mSHe5t+vb1vtvbdPkAmBlX5dHlbe4F+gu9tjLA0FNZvI9+hLe52z0u41KHMUqQxbxN7XBBLjNnepuMHxtkcDrd2zSAZkq5I+6jh/zYQIvbMmhT88pI+i3oEX2Pm51rehn03bxNNWnV1BG999Eb9vdnLIZF0uLyU93MIf3YfwQYADEruUfBp+GOAAAAAElFTkSuQmCC');
background-position: top;
background-size: 360px 360px;
background-color: #191919;
}
.stripe-background {
background-image: linear-gradient(180deg, transparent, rgba(36, 36, 36, 0.1)),
Expand Down
8 changes: 7 additions & 1 deletion src/pages/index.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import scheduleCard from '@/components/schedule-card'
)
export default class Index extends wepy.page {
config = {
navigationBarTitleText: '乌贼日历'
navigationBarTitleText: '乌贼日历',
enablePullDownRefresh: true
}

components = {
Expand Down Expand Up @@ -66,6 +67,7 @@ export default class Index extends wepy.page {
this.gachiList = this.schedule.gachi.list
this.leagueList = this.schedule.league.list
this.$apply()
wx.stopPullDownRefresh()
}

onLoad() {
Expand All @@ -74,5 +76,9 @@ export default class Index extends wepy.page {
}

onShareAppMessage() {}

onPullDownRefresh() {
this.methods.updateSchedule()
}
}
</script>
9 changes: 7 additions & 2 deletions src/pages/salmonrun.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ import imageWxs from '../wxs/image.wxs'
)
export default class SalmonRun extends wepy.page {
config = {
navigationBarTitleText: '打工'
navigationBarTitleText: '打工',
enablePullDownRefresh: true
}

components = {
Expand Down Expand Up @@ -125,14 +126,18 @@ export default class SalmonRun extends wepy.page {
this.listWithDetail = list.filter((v) => v.has_detail)
this.restList = list.filter((v) => !v.has_detail)
this.$apply()
wx.stopPullDownRefresh()
}

onLoad() {
this.methods.updateSalmonRun()
this.loadSalmonRun()
}

onShareAppMessage() {}

onPullDownRefresh() {
this.methods.updateSalmonRun()
}
}
</script>
<style lang="less">
Expand Down
9 changes: 7 additions & 2 deletions src/pages/schedule.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ import imageWxs from '../wxs/image.wxs'
)
export default class Schedule extends wepy.page {
config = {
navigationBarTitleText: '日程'
navigationBarTitleText: '日程',
enablePullDownRefresh: true
}

components = {
Expand Down Expand Up @@ -189,6 +190,7 @@ export default class Schedule extends wepy.page {
loadSchedule() {
this.list = this.schedule[this.mode].list
this.$apply()
wx.stopPullDownRefresh()
}

onLoad(options) {
Expand All @@ -197,9 +199,12 @@ export default class Schedule extends wepy.page {
this.mode = mode
}
this.methods.updateSchedule()
this.loadSchedule()
}

onShareAppMessage() {}

onPullDownRefresh() {
this.methods.updateSchedule()
}
}
</script>
9 changes: 7 additions & 2 deletions src/pages/shop.wpy
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ import shopWxs from '../wxs/shop.wxs'
)
export default class Shop extends wepy.page {
config = {
navigationBarTitleText: '商店'
navigationBarTitleText: '商店',
enablePullDownRefresh: true
}

components = {
Expand All @@ -117,14 +118,18 @@ export default class Shop extends wepy.page {
loadShop() {
this.list = this.shop.shop.list
this.$apply()
wx.stopPullDownRefresh()
}

onLoad() {
this.methods.updateShop()
this.loadShop()
}

onShareAppMessage() {}

onPullDownRefresh() {
this.methods.updateShop()
}
}
</script>
<style lang="less">
Expand Down

0 comments on commit 47ba77c

Please sign in to comment.