From 3d73fb33c46aada16a6060adcd4ea14bb33b6b2a Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 09 四月 2024 10:39:11 +0800 Subject: [PATCH] 详情页tabs样式优化,答题添加页面退出拦截,合并代码 --- pages/bibliographyList/index.js | 105 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 94 insertions(+), 11 deletions(-) diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index 53945fb..27743d5 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -7,6 +7,11 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + input: '', + dialogKey: '', + showWithInput: false, + showTextAndTitleWithInput: false, + downloadLoadin: false, isMore: null, higherList: [], vocationalList: [], @@ -18,7 +23,10 @@ BarHeight: '', navBarHeight: '', start: 1, - tabValue: '' + tabValue: '', + keyword: '', + Md5: '', + emailError: false, }, /** @@ -37,9 +45,10 @@ barHeight: systInfo.statusBarHeight, }) - let event = - { - detail: { value: "0" } + let event = { + detail: { + value: "0" + } } this.onTabsChange(event) @@ -126,6 +135,7 @@ //楂樼瓑鏁欒偛 higherGet(keyword) { + console.log(keyword, 'keyword'); let searchObj = { 'Name*': keyword, '||author*': keyword, @@ -245,12 +255,13 @@ teacherList: res.datas, teacherTotal: res.total }) - }) wx.stopPullDownRefresh() - }, downloadData(event) { + this.setData({ + downloadLoadin: true + }) console.log(111); const item = event.currentTarget.dataset.item; // console.log(item.datas.freeFile.Value); @@ -280,6 +291,11 @@ console.log('涓嬭浇鏂囦欢澶辫触', res); } }); + setTimeout(() => { + this.setData({ + downloadLoadin: false + }); + }, 2000); }, onSearchSubmit: function (e) { const keyword = e.detail.value; @@ -360,16 +376,83 @@ }, + onPullDownRefresh() { + let keyword = this.data.value + this.setData({ + start: 1, + }) + this.higherGet(keyword) + this.vocationalGet(keyword) + this.teacherGet(keyword) + }, + // 閭鐐瑰嚮 + mailbox(e) { + const key = e.currentTarget.dataset.key; + const item = e.currentTarget.dataset.item; + this.setData({ - start: 1 - }) - this.vocationalGet() - this.higherGet() - this.teacherGet() + [key]: true, + dialogKey: key, + input: '', + Md5: item.datas.freeFile.FileList[0].Md5 + }); + + }, + onEmailInput(e) { + const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value); + this.setData({ + emailError: !isEmailValid, + "input": e.detail.value, + }); + }, + //寮圭獥纭 + onConfirm() { + if (!this.data.emailError && this.data.input) { + const { + dialogKey + } = this.data; + this.setData({ + [dialogKey]: false + }); + + + console.log(this.data.input); + console.log(this.data.Md5); + if (this.data.input) { + let query = { + eMail: this.data.input, + md5s: [this.data.Md5] + } + app.MG.file.sendFileWithEmail(query).then(res => { + console.log(res); + }) + } + } else { + // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀� + wx.showToast({ + title: '閭鏍煎紡涓嶆纭�', + icon: 'none', + }); + } + + }, + // 寮圭獥鍙栨秷 + closeDialog() { + const { + dialogKey + } = this.data; + this.setData({ + [dialogKey]: false + }); + console.log(111); + }, + + + }) \ No newline at end of file -- Gitblit v1.9.1