From 5d70c2d38f12437afedc1c978269d29689ff0c2e Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期四, 28 三月 2024 19:54:52 +0800 Subject: [PATCH] 微信支付 --- pages/bibliographyList/index.js | 91 ++++++++++++++++++++++++++++++++++++++------- 1 files changed, 77 insertions(+), 14 deletions(-) diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index c02f54b..27743d5 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -7,6 +7,10 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + input: '', + dialogKey: '', + showWithInput: false, + showTextAndTitleWithInput: false, downloadLoadin: false, isMore: null, higherList: [], @@ -20,7 +24,9 @@ navBarHeight: '', start: 1, tabValue: '', - keyword: '' + keyword: '', + Md5: '', + emailError: false, }, /** @@ -39,9 +45,10 @@ barHeight: systInfo.statusBarHeight, }) - let event = - { - detail: { value: "0" } + let event = { + detail: { + value: "0" + } } this.onTabsChange(event) @@ -248,10 +255,8 @@ teacherList: res.datas, teacherTotal: res.total }) - }) wx.stopPullDownRefresh() - }, downloadData(event) { this.setData({ @@ -286,13 +291,11 @@ console.log('涓嬭浇鏂囦欢澶辫触', res); } }); - setTimeout(() => { this.setData({ downloadLoadin: false }); }, 2000); - }, onSearchSubmit: function (e) { const keyword = e.detail.value; @@ -301,7 +304,6 @@ this.higherGet(keyword) this.vocationalGet(keyword) this.teacherGet(keyword) - }, @@ -376,20 +378,81 @@ }, 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({ + [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