From f2036f82c20767036fe8c4d627e5694e28e6ab73 Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期二, 29 七月 2025 18:29:33 +0800 Subject: [PATCH] 修复资源移动目录产生的BUG --- packageDomain/pages/publickBookForm/index.js | 44 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 34 insertions(+), 10 deletions(-) diff --git a/packageDomain/pages/publickBookForm/index.js b/packageDomain/pages/publickBookForm/index.js index 97b0ed1..0772913 100644 --- a/packageDomain/pages/publickBookForm/index.js +++ b/packageDomain/pages/publickBookForm/index.js @@ -30,24 +30,19 @@ worksInfo: [], keyboardHeight: 0, autosize: { - maxHeight: 120, - minHeight: 80, + maxHeight: 100, + minHeight: 40, }, phoneError: false, emailError: false, - loading: false + loading: false, + isKeyboard: false }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad() { - const token = wx.getStorageSync(app.config.tokenKey) - if (!token) { - loginInfo(app, (data) => { - if (data) {} - }) - } else {} this.getType() }, @@ -62,7 +57,16 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { - + // const token = wx.getStorageSync(app.config.tokenKey) + // if (!token) { + // loginInfo(app, (data) => { + // if (data) {} else { + // wx.switchTab({ + // url: '/pages/home/home', + // }) + // } + // }) + // } else {} }, /** @@ -77,6 +81,21 @@ */ onUnload() { + }, + + scroll() { + // 鐩戝惉瑙嗗浘婊氬姩锛屾墜鍔ㄦ敹璧烽敭鐩� + if (this.data.isKeyboard) { + wx.hideKeyboard() + } + }, + // 鐩戝惉閿洏寮硅捣鍜屾敹璧� + bindkeyboardheightchange(e) { + // 閿洏楂樺害 + const height = e.detail.height; + this.setData({ + isKeyboard: height ? true : false + }) }, //鑾峰彇瀛楁 getType() { @@ -194,6 +213,11 @@ submit() { let that = this; + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => {}) + return false + } if (!that.data.teacherInfo.topicName) { wx.showToast({ title: "璇峰~鍐欓�夐鍚嶇О锛�", -- Gitblit v1.9.1