diff --git a/pages.json b/pages.json index 508a03c..fcafb4f 100644 --- a/pages.json +++ b/pages.json @@ -2,7 +2,8 @@ "pages": [{ "path": "pages/index/index", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { @@ -14,7 +15,8 @@ { "path": "pages/publish/actorDetail", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { @@ -44,25 +46,29 @@ { "path": "pages/index/center", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { "path": "pages/publish/postList", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { "path": "pages/publish/postDetail", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { "path": "pages/publish/actorList", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } } ], @@ -174,13 +180,15 @@ { "path": "publish/worksDetail", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { "path": "publish/competition", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "", + "enablePullDownRefresh" : true } }, { diff --git a/pages/index/center.vue b/pages/index/center.vue index 367c6f1..ba54752 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -177,6 +177,9 @@ // 获取用户个人信息 this.$store.commit('getUserInfo') }, + onPullDownRefresh(){ + this.$store.commit('getUserInfo') + }, methods: { toAuthPage() { uni.navigateTo({ diff --git a/pages/index/index.vue b/pages/index/index.vue index 67a8458..c31bbaa 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -147,6 +147,10 @@ }) } }, + onPullDownRefresh(){ + this.indexGetTrendsPage() + this.getData() + }, onShow() { this.getData() this.queryParams.pageNo = 1 @@ -173,6 +177,7 @@ indexGetTrendsPage(fn){ this.$api('indexGetTrendsPage', this.queryParams, res => { + uni.stopPullDownRefresh() if(res.code == 200){ // fn && fn(res) this.trends = res.result.records diff --git a/pages/publish/actorDetail.vue b/pages/publish/actorDetail.vue index 18b60e0..262aba7 100644 --- a/pages/publish/actorDetail.vue +++ b/pages/publish/actorDetail.vue @@ -106,6 +106,9 @@ //滚动到屏幕底部 onReachBottom() { + }, + onPullDownRefresh(){ + this.getData() }, methods: { leftClick(){ @@ -115,6 +118,7 @@ this.$api('indexGetActorDetail', { id : this.id }, res => { + uni.stopPullDownRefresh() if(res.code == 200){ this.item = res.result } diff --git a/pages/publish/actorList.vue b/pages/publish/actorList.vue index cf45387..371055e 100644 --- a/pages/publish/actorList.vue +++ b/pages/publish/actorList.vue @@ -58,6 +58,9 @@ onShow() { this.getData() }, + onPullDownRefresh(){ + this.getData() + }, onReachBottom(){ if(this.queryParams.pageSize < this.total){ //当前条数小于总条数 则增加请求数 @@ -68,6 +71,7 @@ methods: { getData(){ this.$api('indexGetActorSetPage', this.queryParams, res => { + uni.stopPullDownRefresh() if(res.code == 200){ this.actorList = res.result.records this.total = res.result.total diff --git a/pages/publish/postDetail.vue b/pages/publish/postDetail.vue index e49995e..73c3349 100644 --- a/pages/publish/postDetail.vue +++ b/pages/publish/postDetail.vue @@ -62,6 +62,9 @@ console.log(options) this.id = options.id }, + onPullDownRefresh(){ + this.getData() + }, onShow() { this.getData() }, @@ -70,6 +73,7 @@ this.$api('indexGetTrendsDetail', { id : this.id }, res => { + uni.stopPullDownRefresh() if (res.code == 200) { this.item = res.result.details this.isThumbs_up = res.result.isThumbs_up//是否点赞 diff --git a/pages/publish/postList.vue b/pages/publish/postList.vue index 63883e0..4a329db 100644 --- a/pages/publish/postList.vue +++ b/pages/publish/postList.vue @@ -61,6 +61,9 @@ this.postList = res.result.records }) }, + onPullDownRefresh(){ + this.indexGetTrendsPage() + }, //滚动到屏幕底部 onReachBottom() { let total = this.queryParams.pageNo * this.queryParams.pageSize @@ -75,6 +78,7 @@ indexGetTrendsPage(fn){ this.$api('indexGetTrendsPage', this.queryParams, res => { + uni.stopPullDownRefresh() if(res.code == 200){ // fn && fn(res) this.postList = res.result.records diff --git a/pages_mine/publish/competition.vue b/pages_mine/publish/competition.vue index 3bb0707..c9cc0dd 100644 --- a/pages_mine/publish/competition.vue +++ b/pages_mine/publish/competition.vue @@ -126,6 +126,9 @@ }) } }, + onPullDownRefresh(){ + this.getList() + }, methods: { // 点赞 thumbUp(item){ @@ -145,6 +148,7 @@ this.$api('indexGetGetWorkPage', { ...this.queryParams }, res => { + uni.stopPullDownRefresh() if(res.code == 200){ fn && fn(res) this.total = res.result.total diff --git a/pages_mine/publish/worksDetail.vue b/pages_mine/publish/worksDetail.vue index 0dc5013..f1f40c8 100644 --- a/pages_mine/publish/worksDetail.vue +++ b/pages_mine/publish/worksDetail.vue @@ -91,6 +91,9 @@ console.log(options) this.id = options.id }, + onPullDownRefresh(){ + this.getData() + }, onShow() { this.getData() }, @@ -102,6 +105,7 @@ this.$api('indexGetGetWorkDetail', { id }, res => { + uni.stopPullDownRefresh() if(res.code == 200){ this.item = res.result.details this.isThumbs_up = res.result.isThumbs_up//是否点赞