闫增涛
2025-03-28 abbd7d18ea431ee8b6b8e634abf3e8ccb1fbb1b3
packageBookService/pages/bookServices/detail/index.js
@@ -1272,12 +1272,6 @@
  // 图书添加购物车
  addBookShopcCar() {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      addFun()
    } else {
      this.logInFun(() => {})
    }
    const addFun = async () => {
      if (!this.data.expire) {
        const shoppingCartGetId = [];
@@ -1321,6 +1315,13 @@
        });
      }
    }
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      addFun()
    } else {
      this.logInFun(() => {})
    }
  },
  showSuccessToast() {
@@ -1796,13 +1797,6 @@
  },
  // 云学习一键领取
  getFreeResource() {
    const child = this.selectComponent("#learn-resource");
    const token = wx.getStorageSync(app.config.tokenKey);
    if (!token) {
      this.logInFun(() => {});
    } else {
      getFreeFun()
    }
    const getFreeFun = async () => {
      // 领取查看 ,先看云学习上的  再看资源上的
      const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning')
@@ -1871,6 +1865,14 @@
        console.log(error);
      }
    }
    const child = this.selectComponent("#learn-resource");
    const token = wx.getStorageSync(app.config.tokenKey);
    if (!token) {
      this.logInFun(() => {});
    } else {
      getFreeFun()
    }
  },
  // 云学习一键购买
  async allAddShoppiingCar() {
@@ -1924,12 +1926,6 @@
  },
  // 云学习全部购买
  buyCloudLearnClass() {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      buyClass()
    } else {
      this.logInFun(() => {})
    }
    const buyClass = async () => {
      const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning')
      let query = {
@@ -1954,6 +1950,13 @@
        });
      }
    }
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      buyClass()
    } else {
      this.logInFun(() => {})
    }
  },
  // 变为所有check   true
  findAndUpdateItemsByIds(tree, ids) {
@@ -2251,12 +2254,6 @@
  },
  // 底部购买按钮
  buyBtn() {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      buyFun()
    } else {
      this.logInFun(() => {})
    }
    const buyFun = () => {
      if (this.data.tabValue == "brief" && !this.data.bookBuy) {
        this.buyBook();
@@ -2267,6 +2264,13 @@
        console.log(this.data.tabValue);
      }
    }
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      buyFun()
    } else {
      this.logInFun(() => {})
    }
  },
  goRead(e) {
@@ -2421,12 +2425,6 @@
  //申请电子样书
  appplyElectronicBook() {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      applyFun()
    } else {
      this.logInFun(() => {})
    }
    const applyFun = () => {
      // 先判断下教师认证,未对原有逻辑修改
      let role = this.data.userInfo != null ? this.data.userInfo.role : null;
@@ -2534,15 +2532,16 @@
        });
      }
    }
  },
  //申请纸质样书
  appplyPaperBook() {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      applyFun()
    } else {
      this.logInFun(() => {})
    }
  },
  //申请纸质样书
  appplyPaperBook() {
    const applyFun = () => {
      let role = this.data.userInfo != null ? this.data.userInfo.role : null;
      if (role && role == "Teacher") {} else {
@@ -2630,6 +2629,13 @@
        });
      }
    }
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      applyFun()
    } else {
      this.logInFun(() => {})
    }
  },
  //  添加样书
  addBookFun(item, type) {
@@ -2756,14 +2762,6 @@
    return childrenList
  },
  uploadFile(e) {
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      uploadFun()
    } else {
      this.logInFun(() => {
        uploadFun()
      })
    }
    const uploadFun = () => {
      const userInfo = JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      if (userInfo.role != 'Teacher') return wx.showToast({
@@ -2775,6 +2773,15 @@
        isShowUp: true
      });
    }
    const token = wx.getStorageSync(app.config.tokenKey);
    if (token) {
      uploadFun()
    } else {
      this.logInFun(() => {
        uploadFun()
      })
    }
  },
  closeDialog() {
    this.setData({