litian
2024-07-22 f4e7324c27b7c6ecb824029e22a13541c5033ade
ceshi
5个文件已修改
76 ■■■■■ 已修改文件
packageBookService/pages/bookServices/detail/components/testResource/testResource.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/testTree/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/examination.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -29,6 +29,9 @@
      type: String,
      value: "",
    },
    jslx: {
      type: Boolean,
    },
  },
  /**
@@ -57,7 +60,6 @@
      })
    },
    async goTest(e) {
      console.log(e.detail.value.item, 666)
      const value = e.detail.value.item;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
@@ -73,7 +75,8 @@
      });
      // 获取章节下是否有题目
      let idPathList = [];
      if (this.properties.storeInfo) {
      if (this.properties.storeInfo || this.properties.jslx) {
        idPathList.push({
          id: this.properties.bookInfo.id,
          name: this.properties.bookInfo.name,
@@ -117,7 +120,7 @@
          this.properties.bookInfo.rootCmsItemId
        }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${
          value.name
        }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}`,
        }&answerType=${"option"}&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`,
      });
    },
    goMycollect(e) {
packageBookService/pages/bookServices/detail/components/testTree/index.js
@@ -35,7 +35,6 @@
      });
    },
    goTest(e) {
      console.log(e, 234)
      const value = e.currentTarget.dataset;
      var myEventDetail = {
        value,
packageBookService/pages/bookServices/detail/index.js
@@ -35,6 +35,7 @@
    teach: [],
    learn: [],
    test: [],
    jslx: true,
    openTeachids: [],
    openLearnids: [],
    openTestids: [],
@@ -154,7 +155,8 @@
    ],
    showIndex: '',
    successOrderNumber: '',
    applicationState: '' // 电子样书申请状态
    applicationState: '', // 电子样书申请状态
  },
  resetTree: function (e) {
@@ -385,7 +387,6 @@
      },
    };
    app.MG.store.getProductDetail(query).then(async (res) => {
      console.log(res.datas, 'res.datas');
      this.setData({
        bookDetail: res.datas,
        buyIdList: res.datas.purchasedSaleMethodIdList,
@@ -457,7 +458,6 @@
        ),
      });
      console.log("图书信息", this.data.bookClass);
    });
  },
  //请求子商品的文件
@@ -658,8 +658,6 @@
      this.setData({
        showIndex: '1'
      })
    console.log(this.data.bookDetail.icon, '0111111');
    console.log(this.data.bookDetail.name, '45688');
  },
  // 跳转网店
  goShop(e) {
@@ -977,15 +975,16 @@
  },
  //  获取 云测试
  getResourceData(type) {
    this.setData({
    var that = this
    that.setData({
      loading: true,
      noResources: false,
    });
    let query = {
      path: "*",
      queryType: "*",
      storeInfo: this.data.options.storeInfo,
      productId: this.data.bookDetail.id,
      storeInfo: that.data.options.storeInfo,
      productId: that.data.bookDetail.id,
      cmsPath: type.productLinkPath,
      cmsType: '*',
      itemFields: {
@@ -1012,38 +1011,57 @@
        if (type.refCode == "questionBank") {
          let data = []
          let result = [];
          if (this.data.options.storeInfo == 'jsek_jslx') {
          const isTSFW = res.datas.cmsDatas[0].datas.filter(
            (item) =>
            item.type == 'questionBankFolder' &&
            (item.name == '填空题' ||
              item.name == '判断题' ||
              item.name == '单选题' ||
              item.name == '多选题' ||
              item.name == '简答题')
          )
          if (that.data.options.storeInfo == 'jsek_jslx') {
            data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder');
            if (data.length > 0) {
              this.setData({
              that.setData({
                test: data,
                loading: false,
                openTeachids: result,
              });
            } else {
              this.setData({
              that.setData({
                noResources: true,
                loading: false,
              });
            }
          } else {
            data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0);
            if (isTSFW.length > 0) {
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0)
              that.setData({
                jslx: false,
              });
            } else {
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder')
              that.setData({
                jslx: true,
              });
            }
            if (data.length > 0) {
              let list = []
              // 测试 6位// 正式 5位//  测试调用传20,内部7  正式调用传17 内部传6
              const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6
              const num = query.cmsPath.length + addNum
              this.getTreeList(data, num, list, '\\', addNum)
              list = this.ensureTreeConsistency(list)
              this.findChildIds(list[0].children, result);
              this.setData({
                test: list[0].children,
              that.getTreeList(data, num, list, '\\', addNum)
              list = that.ensureTreeConsistency(list)
              that.findChildIds(list[0].children, result);
              that.setData({
                test: list.length == 1 && list[0].name == '题库' ? list[0].children : list,
                loading: false,
                openTeachids: result,
              });
            } else {
              this.setData({
              that.setData({
                noResources: true,
                loading: false,
              });
@@ -1265,9 +1283,7 @@
            url,
          });
        }
      } else {
        console.log(222);
      }
      } else {}
    } else {
      wx.showToast({
        title: "商品不在有效期",
@@ -2228,7 +2244,6 @@
            });
            return false;
          } else if (isApply.state == 'Normal') {
            console.log(isApply.state, "isApply.state")
            const flag = new Date(isApply.feedBack.endDate + ' 23:59:59').getTime() > new Date().getTime()
            if (flag) {
              wx.showToast({
packageBookService/pages/bookServices/detail/index.wxml
@@ -157,7 +157,7 @@
          </t-tab-panel>
          <t-tab-panel label="云测试" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}">
            <view wx:if="{{!loading}}">
              <test-resource id="test-resource" list="{{test}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" storeInfo="{{options.storeInfo}}" bind:buyMock="buyMock"></test-resource>
              <test-resource id="test-resource" list="{{test}}" bookInfo="{{bookDetail}}" openIds="{{openLearnids}}" mockData="{{mockData}}" tab="{{tabValue}}" storeInfo="{{options.storeInfo}}" jslx="{{jslx}}" bind:buyMock="buyMock"></test-resource>
            </view>
          </t-tab-panel>
          <t-tab-panel label="云笔记" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}">
packageBookService/pages/bookServices/examination/examination.js
@@ -15,6 +15,7 @@
    isCountdownRunning: true, // 是否倒计时
    countdownTime: 0, // 倒计时时间
    storeInfo: '',
    jslx: '',
    bookId: "",
    productLinkPath: "",
    rootCmsItemId: "",
@@ -70,6 +71,7 @@
      idPathList: options.idPathList ? JSON.parse(options.idPathList) : [],
      answerType: options.answerType,
      storeInfo: options.storeInfo,
      jslx: options.jslx,
    });
    wx.setNavigationBarTitle({
      title: options.answerTitle,
@@ -464,7 +466,6 @@
    const inputData = e.detail.value.detail.value;
    const id = e.detail.value.currentTarget.dataset.id;
    const index = Number(e.detail.value.currentTarget.dataset.index);
    console.log(index);
    const questionList = this.data.questionDataList;
    questionList.forEach((item) => {
      if (item.id == id) {
@@ -859,7 +860,7 @@
          });
        }
        res.datas.cmsDatas[0].datas.forEach((item, index) => {
          if (this.data.storeInfo) {
          if (this.data.storeInfo || this.data.jslx) {
            if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
              pathitem.name = "单选题"
            } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {