From ccf200b60ad213343a13d36c17c5ee5ac5cd7b7a Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期三, 27 三月 2024 20:19:45 +0800
Subject: [PATCH] 样书等

---
 packageBookService/pages/bookServices/detail/index.js |  149 +++++++++++++++++++++++++------------------------
 1 files changed, 75 insertions(+), 74 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index 88edf9f..803cff1 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -34,17 +34,20 @@
     openTeachids: [],
     openLearnids: [],
     openTestids: [],
-    applyResourceState: false,  // 鐢宠鏁欏璧勬簮鎸夐挳闃叉姈
+    applyResourceState: false, // 鐢宠鏁欏璧勬簮鎸夐挳闃叉姈
     resourceClassList: [], // 璧勬簮鎵�灞炲垎绫�
-    applyState: "",  // 鏁欏璧勬簮鐢宠鐘舵��
-    deadline: "",  // 鏁欏璧勬簮鐢宠鏈夋晥鏃ユ湡
-    rejectCause: "",  // 涓嬭浇鎷掔粷鍘熷洜
+    applyState: "", // 鏁欏璧勬簮鐢宠鐘舵��
+    deadline: "", // 鏁欏璧勬簮鐢宠鏈夋晥鏃ユ湡
+    rejectCause: "", // 涓嬭浇鎷掔粷鍘熷洜
     buyIdList: [],
     shoppingCartGetId: [], // 宸茶喘涔癷d鍒楄〃
     shoppingList: [],
     loading: false,
-    isShowTeachDownload: false,  // 鎻愮ずPC涓嬭浇寮圭獥鐘舵��
-    confirmBtn: { content: '鎴戠煡閬撲簡', variant: 'base' },
+    isShowTeachDownload: false, // 鎻愮ずPC涓嬭浇寮圭獥鐘舵��
+    confirmBtn: {
+      content: '鎴戠煡閬撲簡',
+      variant: 'base'
+    },
     mockData: {
       id: 0, // 閿�鍞甶d
       price: 0, // 鍞环
@@ -55,9 +58,9 @@
     },
     flag: true,
     noResources: false,
-    selectedIds: "",//鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮�
+    selectedIds: "", //鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮�
     bookBuy: false, //鍟嗗搧鎴栧瓙鍟嗗搧鏄惁璐拱
-    expire: false,//鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮忔槸鍚﹁繃鏈�
+    expire: false, //鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮忔槸鍚﹁繃鏈�
     noFile: false, //鍟嗗搧鎴栧瓙鍟嗘湁鏃犵數瀛愪功鏂囦欢
     num: 0, //鏍蜂功鐢宠鍗曟暟閲�
     alreadyPaperBookList: [], //宸茬敵璇风焊璐ㄦ牱涔�
@@ -72,7 +75,7 @@
       fileType: "",
       md5: "",
       freePage: ""
-    },  //闃呰鍣ㄦ暟鎹�
+    }, //闃呰鍣ㄦ暟鎹�
     buyResourceData: {
       productLinkPath: '',
       refCode: '',
@@ -157,6 +160,20 @@
         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
     }
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
+   */
+  onShow() {
     if (wx.getStorageSync("paperBookList")) {
       this.setData({
         paperBookList: wx.getStorageSync("paperBookList"),
@@ -173,26 +190,14 @@
   },
 
   /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() { },
-
-  /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
    */
-  onHide() { },
+  onHide() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
    */
-  onUnload() { },
+  onUnload() {},
 
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
@@ -215,7 +220,7 @@
   /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
-  onShareAppMessage() { },
+  onShareAppMessage() {},
   // 鏍煎紡鍖栨棩鏈�
   formatDate(dateString) {
     if (!dateString) {
@@ -522,7 +527,9 @@
   },
   // 璺宠浆缃戝簵
   goShop(e) {
-    const { link } = e.currentTarget.dataset;
+    const {
+      link
+    } = e.currentTarget.dataset;
     wx.navigateTo({
       url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`,
     })
@@ -541,9 +548,9 @@
             'buyResourceData.refCode': checkData.refCode
           })
         }
-        if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length)
-          || (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length)
-          || (e.detail.value == 'questionBank' && !this.data.test.length)) {
+        if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length) ||
+          (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length) ||
+          (e.detail.value == 'questionBank' && !this.data.test.length)) {
           this.getResourceData(checkData)
         }
       } else {
@@ -799,13 +806,11 @@
       console.log(determine);
       if (!determine) {
         let query = {
-          requests: [
-            {
-              saleMethodId: this.data.selectedIds,
-              storeEventId: null,
-              agentCode: '鐢靛瓙涔�'
-            }
-          ]
+          requests: [{
+            saleMethodId: this.data.selectedIds,
+            storeEventId: null,
+            agentCode: '鐢靛瓙涔�'
+          }]
         }
         const addRes = app.MG.store.addShoppingCart(query)
         this.showSuccessToast()
@@ -846,12 +851,10 @@
       let bookOrdersId = ''
       let query = {
         remarks: '鐢靛瓙涔�',
-        requests: [
-          {
-            saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId,
-            count: 1
-          }
-        ]
+        requests: [{
+          saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId,
+          count: 1
+        }]
       }
       // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉
       const res = await app.MG.store.initOrder(query)
@@ -975,14 +978,12 @@
       cmsTypeRefCode: '',
       newDataListRequest: [],
       name: this.data.bookDetail.name, // name涓虹敵璇风殑涔︽湰鍚嶇О
-      content: JSON.stringify([
-        {
-          name: this.data.bookDetail.name,
-          id: this.data.bookDetail.id,
-          // defaultSaleMethodId: bookData.value.defaultSaleMethodId,
-          icon: this.data.bookDetail.icon
-        }
-      ])
+      content: JSON.stringify([{
+        name: this.data.bookDetail.name,
+        id: this.data.bookDetail.id,
+        // defaultSaleMethodId: bookData.value.defaultSaleMethodId,
+        icon: this.data.bookDetail.icon
+      }])
     }
     app.MG.ugc.newTopicMessage(query).then(async (res) => {
       if (res) {
@@ -1333,9 +1334,9 @@
         if (new RegExp('(' + k + ')').test(fmt)) {
           fmt = fmt.replace(
             RegExp.$1,
-            RegExp.$1.length == 1
-              ? (o)[k]
-              : ('00' + (o)[k]).substr(('' + (o)[k]).length)
+            RegExp.$1.length == 1 ?
+            (o)[k] :
+            ('00' + (o)[k]).substr(('' + (o)[k]).length)
           )
         }
       }
@@ -1388,12 +1389,10 @@
     try {
       let query = {
         remarks: '缁勫嵎',
-        requests: [
-          {
-            saleMethodId: this.data.mockData.id,
-            count: 1
-          }
-        ]
+        requests: [{
+          saleMethodId: this.data.mockData.id,
+          count: 1
+        }]
       }
       if (this.data.flag) {
         this.setData({
@@ -1408,7 +1407,9 @@
       } else {
         // 0鍏冪洿鎺ラ鍙�
         // 纭璁㈠崟
-        const confirmOrderRes = await app.MG.store.confirmOrder({ orderNum: res.orderNumber })
+        const confirmOrderRes = await app.MG.store.confirmOrder({
+          orderNum: res.orderNumber
+        })
         if (confirmOrderRes) {
           wx.showToast({
             icon: "success",
@@ -1430,27 +1431,29 @@
     const id = tool.uuid(8)
     const createDate = this.DateFormat(new Date().getTime(), 'yyyy-MM-dd')
     const mockList = this.data.mockData.mockList
-    mockList.push({ id, createDate, name: `绗�${num + 1}濂楄瘯鍗穈, state: '0' })
+    mockList.push({
+      id,
+      createDate,
+      name: `绗�${num + 1}濂楄瘯鍗穈,
+      state: '0'
+    })
     this.setData({
       'mockData.mockList': mockList
     })
     // 璁板綍璐拱鏃堕棿锛屽苟璁剧姸鎬乻tate涓�1锛岃〃绀哄垰璐拱瀹屾垚缁勫嵎
     app.MG.identity.setUserKey({
-      setKeyRequests: [
-        {
-          domain: 'mockData',
-          key: this.data.bookDetail.id + '',
-          value: JSON.stringify(this.data.mockData.mockList)
-        }
-      ]
+      setKeyRequests: [{
+        domain: 'mockData',
+        key: this.data.bookDetail.id + '',
+        value: JSON.stringify(this.data.mockData.mockList)
+      }]
     })
   },
   // 搴曢儴璐拱鎸夐挳
   buyBtn() {
     if (this.data.tabValue == 'brief' && !this.data.bookBuy) {
       this.buyBook()
-    }
-    else if (this.data.tabValue == 'jsek_cloudLearning') {
+    } else if (this.data.tabValue == 'jsek_cloudLearning') {
       const tree = this.selectComponent('#tree')
       tree.onCloudShoppingCart()
     } else if (this.data.tabValue == 'questionBank') {
@@ -1502,8 +1505,7 @@
                 wx.navigateTo({
                   url: "/packageDomain/pages/teacherCertification/index",
                 });
-              } else if (res.cancel) {
-              }
+              } else if (res.cancel) {}
             }
           })
         }
@@ -1532,8 +1534,7 @@
                 wx.navigateTo({
                   url: "/packageDomain/pages/teacherCertification/index",
                 });
-              } else if (res.cancel) {
-              }
+              } else if (res.cancel) {}
             }
           })
         }
@@ -1787,4 +1788,4 @@
       teach: tree
     })
   },
-})
+})
\ No newline at end of file

--
Gitblit v1.9.1