闫增涛
2024-12-16 1fa2461678d7f93b88f5666c4898e5b6c72080f3
packageBookService/pages/bookServices/detail/index.js
@@ -7,6 +7,7 @@
} from "../../../../assets/js/login";
import FormData from '../../../../utils/formdata/index.js';
const app = getApp();
var pastData = require('../../psychologyAnswer/testdata/index')
Page({
  /**
   * 页面的初始数据
@@ -435,6 +436,7 @@
    };
    app.MG.store.getProductDetail(query).then(async (res) => {
      this.getResourceCode(id, res.datas.rootCmsItemId)
      console.log(res.datas, "res.datas")
      this.setData({
        bookDetail: res.datas,
        buyIdList: res.datas.purchasedSaleMethodIdList,
@@ -506,7 +508,7 @@
        }
      }
      this.setData({
        "bookDetail.publicationDate": moment(this.data.bookDetail.publicationDate).format("YYYY年MM月"),
        "bookDetail.publicationDate": this.data.bookDetail.publicationDate ? moment(this.data.bookDetail.publicationDate).format("YYYY年MM月") : '',
        "bookDetail.price": this.numFormat(this.data.bookDetail.price),
        "bookDetail.oldPrice": this.numFormat(this.data.bookDetail.oldPrice),
        "bookDetail.paperPrice": this.numFormat(
@@ -1161,18 +1163,24 @@
              });
            }
          } else {
            if (isTSFW.length > 0) {
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0)
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && (item.childrenFolderCount > 0 || item.childrenCount > 0) && (item.name !== '填空题' &&
                item.name !== '判断题' &&
                item.name !== '多选题' &&
                item.name !== '简答题') && item.name !== '单选题')
              that.setData({
                jslx: false,
              });
            } else {
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder')
              data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' &&
                item.refCode != 'jsek_interaction')
              that.setData({
                jslx: true,
              });
            }
            if (data.length > 0) {
              console.log('data', data);
              let list = []
              that.getTreeList(data, list, query.cmsPath)
              list = that.ensureTreeConsistency(list)
@@ -1182,6 +1190,20 @@
                loading: false,
                openTeachids: result,
              });
              //Json赋值
              // const bookId = that.data.bookId
              // if (bookId == 6619) {
              //   const jsonData = {}
              //   jsonData.name = "心理测评"
              //   jsonData.children = [...pastData.postData.list]
              //   var test = that.data.test;
              //   test.push(jsonData);
              //   that.setData({
              //     test: test,
              //   });
              //   console.log(that.data.test, "教学互动");
              // }
            } else {
              that.setData({
                noResources: true,