From dc1b48bb46e5715a5a55ee2c0f60175b849a6b3b Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 09 四月 2024 19:32:30 +0800 Subject: [PATCH] 问题修改 --- packageDomain/pages/sampleBookList/applicationForm/index.js | 36 ++++++++++++++++++++---------------- 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.js b/packageDomain/pages/sampleBookList/applicationForm/index.js index b1831f9..baf669e 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.js +++ b/packageDomain/pages/sampleBookList/applicationForm/index.js @@ -34,17 +34,21 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { + let that = this; + that.setData({ + bookList: [] + }) if (wx.getStorageSync(app.config.userInfoKey)) { - this.setData({ + that.setData({ userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) }) - if (this.data.userInfo.role == 'Teacher') { - this.setData({ - 'teacherInfo.schoolName': JSON.parse(this.data.userInfo.data).schoolName, - 'teacherInfo.courseName': JSON.parse(this.data.userInfo.data).courseName, - 'contactInfo.fullName': JSON.parse(this.data.userInfo.data).fullName, - 'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone, - 'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress, + if (that.data.userInfo.role == 'Teacher') { + that.setData({ + 'teacherInfo.schoolName': JSON.parse(that.data.userInfo.data).schoolName, + 'teacherInfo.courseName': JSON.parse(that.data.userInfo.data).courseName, + 'contactInfo.fullName': JSON.parse(that.data.userInfo.data).fullName, + 'contactInfo.phone': JSON.parse(that.data.userInfo.data).phone, + 'contactInfo.detailedAddress': JSON.parse(that.data.userInfo.data).detailedAddress, }) } else { wx.showModal({ @@ -60,19 +64,19 @@ }) } if (wx.getStorageSync("paperBookList")) { - this.setData({ - paperBookList: wx.getStorageSync("paperBookList"), - bookList: wx.getStorageSync("paperBookList") + that.setData({ + paperBookList: JSON.parse(wx.getStorageSync("paperBookList")), + bookList: JSON.parse(wx.getStorageSync("paperBookList")) }) } if (wx.getStorageSync("electronicBookList")) { - this.setData({ - electronicBookList: wx.getStorageSync("electronicBookList") + that.setData({ + electronicBookList: JSON.parse(wx.getStorageSync("electronicBookList")) }) } - this.getSelectBookCount(); - this.getSelectPaperBookCount(); - this.getPaperType(); + that.getSelectBookCount(); + that.getSelectPaperBookCount(); + that.getPaperType(); } }, -- Gitblit v1.9.1