From 1e0ffc1deed2044f96bab70e10d5c5544f6a23bf Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 22 三月 2024 15:37:46 +0800 Subject: [PATCH] 音频修改 --- pages/bibliographyList/index.js | 129 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 117 insertions(+), 12 deletions(-) diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index d3fee23..53945fb 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -7,6 +7,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + isMore: null, higherList: [], vocationalList: [], teacherList: [], @@ -15,7 +16,9 @@ teacherTotal: 0, value: '', BarHeight: '', - navBarHeight: '' + navBarHeight: '', + start: 1, + tabValue: '' }, /** @@ -34,7 +37,12 @@ barHeight: systInfo.statusBarHeight, }) + let event = + { + detail: { value: "0" } + } + this.onTabsChange(event) @@ -91,12 +99,31 @@ }, onTabsChange(event) { - console.log(`Change tab, tab-panel value is ${event.detail.value}.`); + + const value = event.detail.value + + if (value === '0') { + console.log(value); + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '1') { + console.log(value); + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '2') { + console.log(value); + this.setData({ + tabValue: value, + isMore: false + }) + } }, - onTabsClick(event) { - console.log(`Click tab, tab-panel value is ${event.detail.value}.`); - }, + //楂樼瓑鏁欒偛 higherGet(keyword) { let searchObj = { @@ -111,7 +138,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -138,7 +165,7 @@ }) console.log(this.data.higherList, '5555'); }) - + wx.stopPullDownRefresh() }, @@ -155,7 +182,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -180,6 +207,7 @@ }) }) + wx.stopPullDownRefresh() }, // 鑱屼笟鏁欒偛 teacherGet(keyword) { @@ -194,7 +222,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -219,16 +247,16 @@ }) }) - + wx.stopPullDownRefresh() }, downloadData(event) { console.log(111); const item = event.currentTarget.dataset.item; // console.log(item.datas.freeFile.Value); - const URL = 'http://182.92.203.7:3001/file/api/ApiDownload?md5=' + item.datas.freeFile.Value + const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value item.determine = false - + console.log(URL, 'URL'); setTimeout(() => { if (URL) { item.determine = true @@ -266,5 +294,82 @@ goBack() { wx.navigateBack(); }, + onReachBottom(e) { + if (this.data.tabValue == 0) { + console.log(0); + if (this.data.higherList.length < this.data.higherTotal) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.higherGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + + } else if (this.data.tabValue == 1) { + + if (this.data.teacherList.length < this.data.teacherTotal) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.teacherGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } else if (this.data.tabValue == 2) { + + if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.vocationalGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } + + + + }, + onPullDownRefresh() { + + + this.setData({ + start: 1 + }) + this.vocationalGet() + this.higherGet() + this.teacherGet() + + }, }) \ No newline at end of file -- Gitblit v1.9.1