From 1daa00227f03bc3a370dc1311b7166df17368929 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 20 三月 2024 16:15:46 +0800
Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master

---
 packageDomain/pages/sampleBookList/applicationForm/index.js |   48 +++++++++++++++++++++---------------------------
 1 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.js b/packageDomain/pages/sampleBookList/applicationForm/index.js
index 8cd51e5..92d0e54 100644
--- a/packageDomain/pages/sampleBookList/applicationForm/index.js
+++ b/packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -36,26 +36,22 @@
       })
       if (this.data.userInfo.role == 'Teacher') {
         this.setData({
-          teacherInfo: {
-            schoolName: JSON.parse(this.data.userInfo.data).schoolName,
-            courseName: JSON.parse(this.data.userInfo.data).courseName,
-          },
-          contactInfo: {
-            fullName: JSON.parse(this.data.userInfo.data).fullName,
-            phone: JSON.parse(this.data.userInfo.data).phone,
-            detailedAddress: JSON.parse(this.data.userInfo.data).detailedAddress
-          }
+          '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 (wx.getStorageSync("paperBookList")) {
         this.setData({
-          paperBookList: JSON.parse(wx.getStorageSync("paperBookList")),
-          bookList: JSON.parse(wx.getStorageSync("paperBookList"))
+          paperBookList: wx.getStorageSync("paperBookList"),
+          bookList: wx.getStorageSync("paperBookList")
         })
       }
       if (wx.getStorageSync("electronicBookList")) {
         this.setData({
-          electronicBookList: JSON.parse(wx.getStorageSync("electronicBookList"))
+          electronicBookList: wx.getStorageSync("electronicBookList")
         })
       }
       this.getSelectBookCount();
@@ -90,9 +86,7 @@
     app.MG.resource.getCmsTypeByRefCode({ refCodes: ['jsek_electronicSampleBook'] }).then((res) => {
       this.setData({
         description: res[0].description,
-        teacherInfo: {
-          workInfo: res[0].cmsTypeLinks[0].children
-        },
+        'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
       })
     })
   },
@@ -104,9 +98,7 @@
         if (res && res.length > 0) {
           this.setData({
             description: res[0].description,
-            teacherInfo: {
-              workInfo: res[0].cmsTypeLinks[0].children
-            },
+            'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
           })
         }
       })
@@ -173,7 +165,7 @@
         }
         applyInfo = {
           ticketRefCodeOrGuid: 'electronicSampleBookapplyNum',
-          roleId: userStore.userInfo.roleId,
+          roleId: that.data.userInfo.roleId,
           refType: 'applyBook'
         }
       } else {
@@ -257,25 +249,27 @@
       success: function (res) {
         if (res.confirm) {
           if (that.data.active == '1') {
-            that.data.electronicBookList.forEach((obj, index) => {
+            let eList = that.data.electronicBookList;
+            eList.forEach((obj, index) => {
               if (obj.id == item.id) {
-                that.data.electronicBookList.splice(index, 1);
+                eList.splice(index, 1);
               }
             })
             that.setData({
-              bookList: that.data.electronicBookList
+              bookList: eList
             })
-            wx.setStorageSync("electronicBookList", that.data.electronicBookList);
+            wx.setStorageSync("electronicBookList", eList);
           } else {
-            that.data.paperBookList.forEach((obj, index) => {
+            let pList = that.data.paperBookList;
+            pList.forEach((obj, index) => {
               if (obj.id == item.id) {
-                that.data.paperBookList.splice(index, 1);
+                pList.splice(index, 1);
               }
             })
             that.setData({
-              bookList: this.data.paperBookList
+              bookList: pList
             })
-            wx.setStorageSync("paperBookList", that.data.paperBookList);
+            wx.setStorageSync("paperBookList", pList);
           }
         } else if (res.cancel) {
         }

--
Gitblit v1.9.1