闫增涛
2024-04-09 3d73fb33c46aada16a6060adcd4ea14bb33b6b2a
详情页tabs样式优化,答题添加页面退出拦截,合并代码
35个文件已修改
1853 ■■■■■ 已修改文件
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/note/note.js 299 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/note/note.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/note/note.wxss 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/testResource/testResource.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxss 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxml 290 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/examination.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/examination.wxml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.wxml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionList/index.wxss 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/examination/questionOptions/index.js 222 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/list/index.js 336 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/list/index.wxml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/applicationForm/index.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/index.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/index.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/downloads/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/feedBack/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/feedBack/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/myMassage/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/sampleBooks/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.js 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.wxss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/feedBackSubmit/index.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml
@@ -24,14 +24,14 @@
    theme="primary"
    style="height: 72rpx; font-size: 28rpx"
    bind:tap="goBuyResource"
    style="margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}"
    style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}"
  >
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/yijiangoumai.png" />
      <text>资源购买</text>
    </view>
  </t-button>
  <t-button
  <!-- <t-button
    class="btn"
    theme="primary"
    style="height: 72rpx; font-size: 28rpx"
@@ -39,5 +39,5 @@
  >
    <image src="/static/images/bookService/detail/renwudan/icon.png" />
    学习任务单
  </t-button>
  </t-button> -->
</view>
packageBookService/pages/bookServices/detail/components/note/note.js
@@ -1,5 +1,5 @@
// pages/bookServices/detail/components/note/note.js
const app = getApp()
const app = getApp();
Component({
  /**
   * 组件的属性列表
@@ -7,21 +7,22 @@
  properties: {
    bookInfo: {
      type: Object,
      value: {}
    }
      value: {},
    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx',
    placeholderstyle: 'font-size:28rpx',
    inputStyle:
      "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx",
    placeholderstyle: "font-size:28rpx",
    flag: false, // 输入框是否显示
    submitType: "new", //  新建 or 编辑
    showNoteDialog: false,
    textvalue: '',
    noteId: '',
    textvalue: "",
    noteId: "",
    showInput: false,
    submitTitle: "",
    pageCount: {
@@ -39,294 +40,306 @@
   */
  methods: {
    onReachBottom() {
      const flag = this.data.noteList.length < this.data.pageCount.total
      const flag = this.data.noteList.length < this.data.pageCount.total;
      if (flag) {
        this.setData({
          isMore: true,
          "pageCount.page": this.data.pageCount.page + 1
        })
        this.getNoteList()
          "pageCount.page": this.data.pageCount.page + 1,
        });
        this.getNoteList();
      } else {
        this.setData({
          isMore: true
        })
          isMore: true,
        });
        setTimeout(() => {
          this.setData({
            isMore: false
          })
        }, 100)
            isMore: false,
          });
        }, 100);
      }
    },
    handleSubmitTitle() {
      this.setData({
        submitTitle: this.properties.bookInfo.name
      })
        submitTitle: this.properties.bookInfo.name,
      });
    },
    openDialog() {
      this.setData({
        submitTitle: this.properties.bookInfo.name,
        showNoteDialog: true
      })
        showNoteDialog: true,
      });
    },
    closeDialog() {
      this.setData({
        flag: false,
        showNoteDialog: false,
        submitTitle: '',
        submitTitle: "",
        textvalue: "",
      })
      });
    },
    textareaChange(e) {
      this.setData({
        textvalue: e.detail.value
      })
        textvalue: e.detail.value,
      });
    },
    textareaBlur() {
      console.log('失去焦点');
      console.log("失去焦点");
    },
    // 标题输入框值
    inputChange(e) {
      this.setData({
        submitTitle: e.detail.value
      })
        submitTitle: e.detail.value,
      });
    },
    // 弹窗确定按钮
    confirmSuggest() {
      const submitTitle = this.data.submitTitle.trim()
      const textvalue = this.data.textvalue.trim()
      const submitTitle = this.data.submitTitle.trim();
      const textvalue = this.data.textvalue.trim();
      if (!submitTitle.length) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记标题',
        })
          icon: "error",
          title: "请填写笔记标题",
        });
      } else if (!textvalue.length) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记内容',
        })
          icon: "error",
          title: "请填写笔记内容",
        });
      }
      if (this.data.submitType == 'new') {
        this.makeNote()
      } else if (this.data.submitType == 'edit') {
        this.updateNote()
      if (this.data.submitType == "new") {
        this.makeNote();
      } else if (this.data.submitType == "edit") {
        this.updateNote();
      }
      this.setData({
        showNoteDialog: false
      })
        showNoteDialog: false,
      });
    },
    handleChange(e) {
      this.setData({
        activeValues: e.detail.value
      })
        activeValues: e.detail.value,
      });
    },
    // 格式化笔记时间
    convertTimestamp(timestamp) {
      const isoDate = new Date(timestamp)
      const year = isoDate.getFullYear()
      const month = String(isoDate.getMonth() + 1).padStart(2, '0')
      const day = String(isoDate.getDate()).padStart(2, '0')
      const hours = String(isoDate.getHours()).padStart(2, '0')
      const minutes = String(isoDate.getMinutes()).padStart(2, '0')
      const seconds = String(isoDate.getSeconds()).padStart(2, '0')
      const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
      return formattedDate
      const isoDate = new Date(timestamp);
      const year = isoDate.getFullYear();
      const month = String(isoDate.getMonth() + 1).padStart(2, "0");
      const day = String(isoDate.getDate()).padStart(2, "0");
      const hours = String(isoDate.getHours()).padStart(2, "0");
      const minutes = String(isoDate.getMinutes()).padStart(2, "0");
      const seconds = String(isoDate.getSeconds()).padStart(2, "0");
      const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
      return formattedDate;
    },
    changeLoading() {
      this.setData({
        loading: true
      })
        loading: true,
      });
    },
    changeNoList() {
      this.setData({
        noList: true,
      });
    },
    // 获取笔记列表
    async getNoteList() {
      if (!this.data.isMore) {
      this.setData({
        loading: true,
        noList: false
      })
      let topicId
        });
      }
      this.setData({
        noList: false,
      });
      let topicId;
      await app.MG.ugc
        .getProductUserSubmitTopic({
          productId: this.properties.bookInfo.id,
          appRefCode: app.config.appRefCode
          appRefCode: app.config.appRefCode,
        })
        .then((res) => {
          if (res) {
            topicId = res.id
            topicId = res.id;
          } else {
            return wx.showToast({
              icon: "error",
              title: '查询失败',
            })
              title: "查询失败",
            });
          }
        })
        });
      // loadings.value.bookResource = true
      let query = {
        start: 0,
        size: this.data.pageCount.page * 5,
        messageType: 'note',
        messageType: "note",
        sort: {
          type: 'Desc',
          field: 'CreateDate'
          type: "Desc",
          field: "CreateDate",
        },
        appRefCode: app.config.appRefCode,
        topicIdOrRefCode: topicId + ''
      }
        topicIdOrRefCode: topicId + "",
      };
      await app.MG.ugc.getTopicMessageList(query).then((res) => {
        if (!res.datas.length) {
          return this.setData({
            noList: true,
            loading: false,
            noList: true,
            noteList: res.datas,
          })
          });
        }
        // notePage.value.total = res.totalSize
        res.datas.forEach((item) => {
          item.compliceHover = false
          item.deleteHover = false
          item.createDate = this.convertTimestamp(item.createDate)
        })
          item.compliceHover = false;
          item.deleteHover = false;
          item.createDate = this.convertTimestamp(item.createDate);
        });
        this.setData({
          "pageCount.total": res.totalSize,
          noteList: res.datas,
          loading: false
        })
      })
          loading: false,
          noList: false,
        });
      });
    },
    // 新建笔记接口
    async makeNote() {
      const token = wx.getStorageSync('jsek-token')
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          },
        });
          }
        })
      }
      let topicId
      let topicId;
      await app.MG.ugc
        .getProductUserSubmitTopic({
          productId: this.properties.bookInfo.id,
          appRefCode: app.config.appRefCode
          appRefCode: app.config.appRefCode,
        })
        .then((res) => {
          if (res) {
            topicId = res.id
            topicId = res.id;
          } else {
            return wx.showToast({
              icon: 'error',
              title: '新建失败',
            })
              icon: "error",
              title: "新建失败",
            });
          }
        })
        });
      let query = {
        topicIdOrRefCode: topicId + '',
        topicIdOrRefCode: topicId + "",
        name: this.data.submitTitle,
        content: this.data.textvalue,
        type: 'note',
        cmsTypeRefCode: '',
        newDataListRequest: []
      }
        type: "note",
        cmsTypeRefCode: "",
        newDataListRequest: [],
      };
      await app.MG.ugc.newTopicMessage(query).then((res) => {
        wx.showToast({
          title: '新建成功',
        })
        this.closeDialog()
        this.getNoteList()
      })
          title: "新建成功",
        });
        this.closeDialog();
        this.getNoteList();
      });
    },
    // 删除笔记
    deleteNote(e) {
      const id = e.currentTarget.dataset.id
      const messageIds = []
      messageIds.push(id)
      const id = e.currentTarget.dataset.id;
      const messageIds = [];
      messageIds.push(id);
      wx.showModal({
        title: '提示',
        content: '确认删除该笔记吗?', //editable如果为true,这就是输入框的内容
        title: "提示",
        content: "确认删除该笔记吗?", //editable如果为true,这就是输入框的内容
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        editable: false, //是否显示输入框
        placeholderText: '请输入内容吧', //输入框的默认内容
        placeholderText: "请输入内容吧", //输入框的默认内容
        success: (res) => {
          if (res.confirm) {
            app.MG.ugc
              .delTopicMessage({
                messageIds
                messageIds,
              })
              .then((res) => {
                wx.showToast({
                  title: '删除成功',
                })
                  title: "删除成功",
                });
                // if ((notePage.value.total % 3) - 1 == 0) {
                //   notePage.value.page -= 1
                // }
                this.getNoteList()
              })
                this.getNoteList();
              });
          } else if (res.cancel) {
            console.log('用户点击取消')
            console.log("用户点击取消");
          }
        }
      })
        },
      });
    },
    // 标题改变
    changeTitle(e) {
      this.setData({
        flag: e.currentTarget.dataset.value
      })
        flag: e.currentTarget.dataset.value,
      });
    },
    // 编辑按钮
    editNote(e) {
      const note = e.currentTarget.dataset.note
      const note = e.currentTarget.dataset.note;
      this.setData({
        submitType: "edit",
        textvalue: note.content,
        submitTitle: note.name,
        noteId: note.id
      })
        noteId: note.id,
      });
      console.log(note.name, this.data.submitTitle);
      this.setData({
        showNoteDialog: true
      })
        showNoteDialog: true,
      });
    },
    // 编辑笔记接口
    updateNote() {
      const token = wx.getStorageSync('jsek-token')
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          }
        })
          },
        });
      }
      if (!this.data.submitTitle) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记标题',
        })
          icon: "error",
          title: "请填写笔记标题",
        });
      } else if (!this.data.textvalue) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记内容',
        })
          icon: "error",
          title: "请填写笔记内容",
        });
      }
      let query = {
        id: this.data.noteId,
        name: this.data.submitTitle,
        description: 'string',
        icon: 'string',
        type: 'note',
        description: "string",
        icon: "string",
        type: "note",
        content: this.data.textvalue,
        newDataRequests: [],
        updateDataRequests: []
      }
        updateDataRequests: [],
      };
      app.MG.ugc.updateTopicMessage(query).then((res) => {
        wx.showToast({
          title: '编辑成功',
        })
        this.closeDialog()
        this.getNoteList()
      })
          title: "编辑成功",
        });
        this.closeDialog();
        this.getNoteList();
      });
      this.setData({
        submitType: "new"
      })
    }
  }
})
        submitType: "new",
      });
    },
  },
});
packageBookService/pages/bookServices/detail/components/note/note.wxml
@@ -7,9 +7,9 @@
      bind:tap="openDialog"
      style="width: 240rpx"
    >
      <view slot="content">
      <view slot="content" class="btn-content">
        <image src="/static/images/bookService/detail/makeNote.png" />
        记笔记
        <text class="note-btn-text">记笔记</text>
      </view>
    </t-button>
  </view>
packageBookService/pages/bookServices/detail/components/note/note.wxss
@@ -2,6 +2,7 @@
.note {
  height: 100%;
  padding-bottom: 50rpx;
}
.popup {
@@ -25,7 +26,11 @@
.note-btn image {
  width: 28rpx;
  height: 32rpx;
  margin-top: 24rpx;
  margin-right: 5rpx;
}
.note-btn-text {
  font-size: 28rpx;
}
@@ -82,9 +87,7 @@
  font-size: 28rpx;
  color: #949494;
  margin-bottom: 20rpx;
  max-height: 600rpx;
  text-align: justify;
  /* padding-bottom: 200rpx; */
}
.wrapper {
@@ -154,3 +157,8 @@
.t-input__placeholder {
  font-size: 28rpx !important
}
.btn-content {
  display: flex;
  align-items: center;
}
packageBookService/pages/bookServices/detail/components/teachResource/index.js
@@ -24,14 +24,12 @@
  methods: {
    copy() {
      wx.setClipboardData({
        data: "11",
        data: "http://182.92.203.7:3007/jsek/website/#/home/index",
        success: function (res) {
          wx.showToast({ title: "复制成功" });
        },
        fail: function (res) {
          wx.showToast({
            title: "失败",
          });
          console.log(res);
        },
      });
    },
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml
@@ -26,11 +26,14 @@
    <view>
      资源下载申请已通过<text wx:if="{{deadline}}"
        >,有效日期截至:{{ deadline }}</text
      ></view>
    <!-- <view style="display: flex; align-items: center; margin-top: 10rpx">
      ></view
    >
    <view style="display: flex; align-items: center; margin-top: 10rpx">
      <text>下载资源请到PC端京师E课</text>
      <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy">复制</t-button>
    </view> -->
      <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy"
        >复制</t-button
      >
    </view>
  </view>
  <view wx:if="{{applyState == 'Reject'}}"
    >资源下载需要申请,请先申请并等待审核通过后方可下载</view
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -1,5 +1,5 @@
// pages/bookServices/detail/components/testResource/testResource.js
const app = getApp()
const app = getApp();
Component({
  /**
   * 组件的属性列表
@@ -7,7 +7,7 @@
  properties: {
    list: {
      type: Array,
      value: []
      value: [],
    },
    bookInfo: {
      type: Object,
@@ -15,16 +15,17 @@
    },
    mockData: {
      type: Object,
      value: {}
    }
      value: {},
    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    selectBtn: 'test',  // test  mock
    radioItem: 'test',
    selectBtn: "test", // test  mock
    radioItem: "test",
    loading: false,
  },
  /**
@@ -32,88 +33,100 @@
   */
  methods: {
    async goTest(e) {
      const value = e.currentTarget.dataset.value
      const token = wx.getStorageSync('jsek-token')
      const value = e.currentTarget.dataset.value;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          }
        })
          },
        });
      }
      wx.showLoading({
        title: '加载中',
      })
        title: "加载中",
      });
      // 获取章节下是否有题目
      let idPathList = []
      let idPathList = [];
      let query = {
        path: '*',
        queryType: '*',
        path: "*",
        queryType: "*",
        productId: this.properties.bookInfo.id,
        cmsPath: value.productLinkPath,
        pading: {
          start: 0,
          size: 999
        }
      }
          size: 999,
        },
      };
      if (value.childrenFolderCount == 0) {
        wx.hideLoading()
        wx.hideLoading();
        return wx.showToast({
          icon: "error",
          title: '暂无数据',
        })
          title: "暂无数据",
        });
      } else {
        const res = await app.MG.store.getProductDetail(query)
        const res = await app.MG.store.getProductDetail(query);
        res.datas.cmsDatas[0].datas.forEach((item) => {
          idPathList.push({
            id: item.id,
            name: item.name,
            productLinkPath: item.productLinkPath,
            type: item.type
          })
        })
            type: item.type,
          });
        });
      }
      wx.hideLoading()
      wx.hideLoading();
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&productLinkPath=${value.productLinkPath}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&idPathList=${JSON.stringify(idPathList)}&answerTitle=${value.name}&answerType=${'option'}`,
      })
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
          this.properties.bookInfo.id
        }&productLinkPath=${value.productLinkPath}&rootCmsItemId=${
          this.properties.bookInfo.rootCmsItemId
        }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${
          value.name
        }&answerType=${"option"}`,
      });
    },
    goMycollect(e) {
      const answertype = e.currentTarget.dataset.answertype
      const token = wx.getStorageSync('jsek-token')
      const answertype = e.currentTarget.dataset.answertype;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          }
        })
          },
        });
      }
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${answertype == 'collectQuestion' ? '我的收藏' : '我的错题'}&answerType=${answertype}`,
      })
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
          this.properties.bookInfo.id
        }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${
          answertype == "collectQuestion" ? "我的收藏" : "我的错题"
        }&answerType=${answertype}`,
      });
    },
    // 练习 组件切换
    onRadioChange(e) {
      this.setData({
        radioItem: e.detail.value
      })
        radioItem: e.detail.value,
      });
      if (e.detail.value == "mock") {
      }
    },
    async getMockId() {
      wx.showLoading({
        title: '加载中'
      })
      let id
        title: "加载中",
      });
      let id;
      let query = {
        start: 0,
        size: 99,
        productId: this.properties.bookInfo.id
      }
        productId: this.properties.bookInfo.id,
      };
      await app.MG.edu.getQuizConfigListByProduct(query).then((res) => {
        id = res.datas[0].id
      })
      return id
        id = res.datas[0].id;
      });
      return id;
    },
    // 组卷跳转答题界面
    async goMackPaper(e) {
@@ -121,21 +134,30 @@
      // if (!token) {
      //   return logIn()
      // }
      const mockid = await this.getMockId()
      wx.hideLoading()
      const item = e.currentTarget.dataset.item
      const mockid = await this.getMockId();
      wx.hideLoading();
      const item = e.currentTarget.dataset.item;
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${item.name}&answerType=${'mock'}&uuid=${item.id}&mockid=${mockid}`,
      })
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
          this.properties.bookInfo.id
        }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${
          item.name
        }&answerType=${"mock"}&uuid=${item.id}&mockid=${mockid}`,
      });
    },
    // 购买组卷
    buyMock() {
      var myEventDetail = {}
      var myEventDetail = {};
      var myEventOption = {
        bubbles: true,
        composed: true
      }
      this.triggerEvent('buyMock', myEventDetail, myEventOption)
    }
  }
})
        composed: true,
      };
      this.triggerEvent("buyMock", myEventDetail, myEventOption);
    },
    changeTestLoaidng(type) {
      this.setData({
        loading: type,
      });
    },
  },
});
packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml
@@ -14,7 +14,7 @@
            <image
              src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}"
            ></image>
            <text style="color: {{radioItem == 'test' ? '#fff':''}};"
            <text style="color: {{radioItem == 'test' ? '#fff':'#ff6c00'}};"
              >练习</text
            >
          </view>
@@ -26,7 +26,7 @@
            <image
              src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}"
            ></image>
            <text style="color: {{radioItem == 'mock' ? '#fff':''}};"
            <text style="color: {{radioItem == 'mock' ? '#fff':'#ff6c00'}};"
              >组卷</text
            >
          </view>
@@ -43,7 +43,7 @@
    >
      <view slot="content" class="btn-content">
        <image src="/static/images/bookService/detail/cuoti.png"></image>
        <text>我的错题</text>
        <text class="primary-color">我的错题</text>
      </view>
    </t-button>
    <t-button
@@ -56,7 +56,7 @@
    >
      <view slot="content" class="btn-content">
        <image src="/static/images/bookService/detail/wodeshoucang.png"></image>
        <text> 我的收藏</text>
        <text class="primary-color"> 我的收藏</text>
      </view>
    </t-button>
  </view>
@@ -137,4 +137,7 @@
      <t-button class="buy-mock-btn" bind:tap="buyMock">购买组卷</t-button>
    </view>
  </view>
  <view class="loading-box" wx:if="{{}}">
    <t-loading loading="{{}}" />
  </view>
</view>
packageBookService/pages/bookServices/detail/components/testResource/testResource.wxss
@@ -3,6 +3,10 @@
  padding-top: 20rpx;
}
.primary-color {
  color: #ff6c00;
}
.resource-list {
  height: 80rpx;
  margin: 20rpx;
@@ -149,7 +153,6 @@
}
.radio-content {
  padding: 0 8rpx;
  display: flex;
  align-items: center;
  justify-content: center;
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -55,10 +55,7 @@
    shoppingCart: true,
    stop: false,
  },
  ready() {
    this.setData({});
    console.log("准备");
  },
  ready() {},
  onLoad() {
    this.setData({
@@ -73,7 +70,6 @@
    treeList: function (newValue) {
      const list = [];
      let checked = "";
      console.log("新值", this.properties.treeList);
      this.properties.treeList.forEach((item) => {
        if (item.children && item.children.length > 0) {
          list.push(...this.flattenTree([item]));
packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -17,11 +17,11 @@
            wx:if="{{isShowCheck}}"
          />
          <!-- 章节名 -->
          <view style="width: 100%">
            <text>{{item.name}} </text
            ><text wx:if="{{item.sysType =='CmsFolder'}}"
              >({{item.children ? item.children.length : 0}})</text
            >
          <view class="title-box">
            <text class="title-name">{{item.name}} </text>
            <view wx:if="{{item.sysType =='CmsFolder'}}" class="title-num">
              ({{item.children ? item.children.length : 0}})
            </view>
          </view>
        </view>
      </view>
@@ -37,12 +37,7 @@
          class="listItems"
          wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"
        >
          <view
            class="itemsInfo"
            wx:if="{{citem.name}}"
            data-item="{{citem}}"
            data-index="{{cindex}}"
          >
          <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}">
            <view
              class="contentBox"
              bind:tap="goPlayer"
@@ -123,7 +118,7 @@
                <text
                  class="name"
                  style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}"
                  >{{citem.name}}</text
                  >{{citem.name || '-'}}</text
                >
              </view>
              <!-- 教学资源类型 -->
packageBookService/pages/bookServices/detail/components/tree/index.wxss
@@ -11,9 +11,28 @@
  align-items: center;
  --td-checkbox-vertical-padding: 0
}
.title-box {
  width: 100%;
  display: flex;
  align-items: flex-start;
}
.title-checkBox {
  width: 100%;
  display: flex;
}
.title-name {
  display: inline-block;
  /* max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; */
}
.t-class {
  background-color: #F7F7F7;
}
packageBookService/pages/bookServices/detail/index.js
@@ -1,9 +1,7 @@
// pages/bookServices/detail/index.js
import Toast from "tdesign-miniprogram/toast";
import tool from "../../../../assets/js/toolClass";
import {
  loginInfo
} from "../../../../assets/js/login";
import { loginInfo } from "../../../../assets/js/login";
const app = getApp();
Page({
  /**
@@ -166,7 +164,6 @@
    if (token) {
      this.getShoppingCartProductGet();
      this.getApplyInfo(options.id);
      this.getMockData();
      this.getAlreadyPBookList();
      this.getAlreadyEBookList();
    }
@@ -225,7 +222,7 @@
  onReachBottom() {
    if (this.data.tabValue == "jsek_note") {
      const child = this.selectComponent("#note");
      child.onReachBottom();
      if (!child.data.noList) child.onReachBottom();
    }
  },
@@ -303,7 +300,19 @@
  },
  // 返回
  goBack() {
    let bookPathList = wx.getStorageSync("bookPathList");
    if (bookPathList && JSON.parse(bookPathList).length) {
      bookPathList = JSON.parse(bookPathList);
      this.setData({
        pageLoading: true,
        tabValue: "brief",
      });
      this.onLoad(bookPathList[bookPathList.length - 1]);
      bookPathList.pop();
      wx.setStorageSync("bookPathList", JSON.stringify(bookPathList));
    } else {
    wx.navigateBack();
    }
  },
  // 获取图书详情
  getBookInfo(id) {
@@ -357,14 +366,15 @@
      this.getSubTtem();
      // 获取图书分类
      let className = "";
      if (
        Array.isArray(res.datas.bookClassification) &&
        res.datas.bookClassification.length
      ) {
        const iconType = JSON.parse(res.datas.bookClassification)[0][0];
        const classType = JSON.parse(res.datas.bookClassification)[0][1];
      if (res.datas.bookClassification) {
        const bookClassification = JSON.parse(res.datas.bookClassification);
        if (Array.isArray(bookClassification) && bookClassification.length) {
          const iconType = bookClassification[0][0];
          const classType = bookClassification[0][1];
        className = await this.getBookClass(iconType, classType);
      }
      }
      // 获取组卷销售id
      if (res.datas.saleMethod && res.datas.saleMethod.length) {
        res.datas.saleMethod.forEach((item) => {
@@ -429,11 +439,12 @@
    };
    app.MG.store.getProductList(obj).then((res) => {
      if (res.datas && res.datas.length > 0) {
        console.log(res.datas[0], 2)
        console.log(res.datas[0], 2);
        this.setData({
          bookItemDetail: res.datas[0],
          selectedIds: res.datas[0].defaultSaleMethod.id,
          bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf(
          bookBuy:
            res.datas[0].purchasedSaleMethodIdList.indexOf(
            res.datas[0].defaultSaleMethodId
          ) > -1,
          "bookDetail.price": this.numFormat(res.datas[0].price),
@@ -498,7 +509,8 @@
        }
        this.setData({
          selectedIds: this.data.bookDetail.defaultSaleMethodId,
          bookBuy: this.data.bookDetail.purchasedSaleMethodIdList.indexOf(
          bookBuy:
            this.data.bookDetail.purchasedSaleMethodIdList.indexOf(
            this.data.bookDetail.defaultSaleMethodId
          ) > -1,
        });
@@ -604,15 +616,14 @@
  },
  // 跳转网店
  goShop(e) {
    const {
      link
    } = e.currentTarget.dataset;
    const { link } = e.currentTarget.dataset;
    wx.navigateTo({
      url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`,
    });
  },
  // tag切换
  onTabsChange(e) {
    const token = wx.getStorageSync(app.config.tokenKey);
    this.setData({
      tabValue: e.detail.value,
      noResources: false,
@@ -641,6 +652,7 @@
        ) {
          this.getResourceData(checkData);
        }
        if (e.detail.value == "questionBank" && token) this.getMockData();
      } else {
        this.setData({
          noResources: true,
@@ -653,6 +665,8 @@
      if (token) {
        child.changeLoading();
        child.getNoteList();
      } else {
        child.changeNoList();
      }
    } else if (e.detail.label == "电子书") {
      const child = this.selectComponent("#eBook");
@@ -730,13 +744,13 @@
            const list = await this.getAllResource(res.datas.cmsDatas[0].datas);
            let result = [];
            if (type.refCode == "jsek_teachingResources") {
              console.log("教学资源", list);
              this.findChildIds(list, result);
              this.setData({
                teach: list,
                loading: false,
                openTeachids: result,
              });
              console.log("教学资源", list);
            } else if (type.refCode == "jsek_cloudLearning") {
              let arr = this.handleTreeData(list).filter(
                (item) => item.saleMethod[0]
@@ -850,7 +864,7 @@
        item.checked = false;
      } else if (this.data.tabValue == "jsek_cloudLearning") {
        item.checked = false;
        item.isbuy = this.resourceIsBuy(item);
        item.isbuy = this.isShowNeedBuy(item);
        item.isShopCar = this.isShoppingCart(item);
      }
    });
@@ -899,19 +913,18 @@
      res.datas.forEach((item) => {
        shoppingCartGetId.push(item.saleMethod.id);
      });
      console.log(shoppingCartGetId, "shoppingCartGetId");
      console.log(this.data.selectedIds, "销售方式id");
      const determine = shoppingCartGetId.some(
        (item) => item == this.data.selectedIds
      );
      console.log(determine);
      if (!determine) {
        let query = {
          requests: [{
          requests: [
            {
            saleMethodId: this.data.selectedIds,
            storeEventId: null,
            agentCode: "电子书",
          }, ],
            },
          ],
        };
        const addRes = app.MG.store.addShoppingCart(query);
        this.showSuccessToast();
@@ -952,11 +965,14 @@
      let bookOrdersId = "";
      let query = {
        remarks: "电子书",
        requests: [{
          saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ?
            this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId,
        requests: [
          {
            saleMethodId: this.data.bookItemDetail.defaultSaleMethodId
              ? this.data.bookItemDetail.defaultSaleMethodId
              : this.data.bookDetail.defaultSaleMethodId,
          count: 1,
        }, ],
          },
        ],
      };
      // 发起订单初始化请求并等待结果
      const res = await app.MG.store.initOrder(query);
@@ -966,9 +982,11 @@
      // 检查订单号是否存在
      if (bookOrdersId) {
        if (this.data.bookDetail.price == "0.00") {
          app.MG.store.confirmOrder({
            orderNum: bookOrdersId
          }).then(res => {
          app.MG.store
            .confirmOrder({
              orderNum: bookOrdersId,
            })
            .then((res) => {
            if (res) {
              wx.showToast({
                title: "领取成功",
@@ -977,9 +995,10 @@
              });
              this.getBookInfo(this.data.bookDetail.id);
            }
          })
            });
        } else {
          const url = "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId;
          const url =
            "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId;
          wx.navigateTo({
            url,
          });
@@ -987,7 +1006,6 @@
      } else {
        console.log(222);
      }
    } else {
      wx.showToast({
        title: "商品不在有效期",
@@ -1096,12 +1114,14 @@
          cmsTypeRefCode: "",
          newDataListRequest: [],
          name: this.data.bookDetail.name, // name为申请的书本名称
          content: JSON.stringify([{
          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) {
@@ -1116,8 +1136,11 @@
        wx.showModal({
          title: "尊敬的用户,您好!",
          content: "请先进行教师认证!",
          confirmColor: "#ff6c00",
          cancelColor: "#949494",
          complete: (res) => {
            if (res.cancel) {}
            if (res.cancel) {
            }
            if (res.confirm) {
              wx.navigateTo({
                url: "/packageDomain/pages/teacherCertification/index",
@@ -1130,8 +1153,11 @@
      wx.showModal({
        title: "尊敬的用户,您好!",
        content: "请先进行教师认证!",
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        complete: (res) => {
          if (res.cancel) {}
          if (res.cancel) {
          }
          if (res.confirm) {
            wx.navigateTo({
              url: "/packageDomain/pages/teacherCertification/index",
@@ -1158,8 +1184,11 @@
      wx.showModal({
        title: "尊敬的用户,您好!",
        content: "请先进行教师认证!",
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        complete: (res) => {
          if (res.cancel) {}
          if (res.cancel) {
          }
          if (res.confirm) {
            wx.navigateTo({
              url: "/packageDomain/pages/teacherCertification/index",
@@ -1288,6 +1317,22 @@
      const isSHow = this.data.buyIdList.some(
        (item) => item == data.saleMethod[0].Id
      );
      return !isSHow;
    } else {
      return false;
    }
  },
  // 云学习资源是否显示锁图标(未购买,且资源售价大于零)
  isShowNeedBuy(data) {
    if (data.saleMethod && data.saleMethod.length) {
      const isSHow = this.data.buyIdList.some(
        (item) => item == data.saleMethod[0].Id
      );
      if (isSHow) {
        return false;
      } else {
        return data.saleMethod[0].price > 0 ? true : false;
      }
      return !isSHow;
    } else {
      return false;
@@ -1515,9 +1560,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)
          );
        }
      }
@@ -1528,6 +1573,8 @@
  },
  // 获取组卷答题数据
  getMockData() {
    // const child = this.selectComponent("#test-resource");
    // if (child) child.changeTestLoaidng(true);
    this.setData({
      "mockData.useCount": 0,
      "mockData.mockList": [],
@@ -1571,10 +1618,12 @@
    try {
      let query = {
        remarks: "组卷",
        requests: [{
        requests: [
          {
          saleMethodId: this.data.mockData.id,
          count: 1,
        }, ],
          },
        ],
      };
      if (this.data.flag) {
        this.setData({
@@ -1624,11 +1673,13 @@
    });
    // 记录购买时间,并设状态state为1,表示刚购买完成组卷
    app.MG.identity.setUserKey({
      setKeyRequests: [{
      setKeyRequests: [
        {
        domain: "mockData",
        key: this.data.bookDetail.id + "",
        value: JSON.stringify(this.data.mockData.mockList),
      }, ],
        },
      ],
    });
  },
  // 获取相关图书
@@ -1658,33 +1709,45 @@
        (item) => item.id != this.data.bookDetail.id
      );
      let bookArr = [];
      // if (Arr.length > 3) {
      //   for (var i = 0; i < 3; i++) {
      //     var _num = Math.floor(Math.random() * Arr.length);
      //     var mm = Arr[_num];
      //     Arr.splice(_num, 1);
      //     bookArr.push(mm);
      //   }
      // } else {
      //   bookArr = Arr;
      // }
      if (Arr.length > 9) {
        for (var i = 0; i < 9; i++) {
          var _num = Math.floor(Math.random() * Arr.length);
          var mm = Arr[_num];
          Arr.splice(_num, 1);
          bookArr.push(mm);
        }
      } else {
        bookArr = Arr;
      }
      this.setData({
        relatedBookData: Arr,
        relatedBookData: bookArr,
        relatedBookLoading: false,
      });
      if (!this.data.relatedBookData.length)
        this.setData({
          noRelatedBookData: true,
        });
      console.log("相关图书", this.data.relatedBookData);
    });
  },
  goBookDetails(e) {
    console.log(e);
    this.setData({
      tabValue: "brief",
      pageLoading: true,
    });
    let bookPathList = wx.getStorageSync("bookPathList");
    const bookPath = {
      id: this.data.bookDetail.id,
      name: this.data.bookDetail.name,
    };
    if (bookPathList) {
      bookPathList = JSON.parse(bookPathList);
      if (bookPathList.length > 8) bookPathList.shift();
      bookPathList.push(bookPath);
    } else {
      bookPathList = [bookPath];
    }
    wx.setStorageSync("bookPathList", JSON.stringify(bookPathList));
    this.onLoad({
      id: e.detail.id,
      name: e.detail.name,
@@ -1712,7 +1775,8 @@
      return false;
    }
    wx.navigateTo({
      url: "/packageBookService/pages/components/webView/index?md5=" +
      url:
        "/packageBookService/pages/components/webView/index?md5=" +
        this.data.fileInfo.md5 +
        "&fileName=" +
        this.data.fileInfo.bookName +
@@ -1883,12 +1947,15 @@
        wx.showModal({
          title: "尊敬的用户,您好!", //提示的标题
          content: "请先进行教师认证?", //提示的内容
          confirmColor: "#ff6c00",
          cancelColor: "#949494",
          success: function (res) {
            if (res.confirm) {
              wx.navigateTo({
                url: "/packageDomain/pages/teacherCertification/index",
              });
            } else if (res.cancel) {}
            } else if (res.cancel) {
            }
          },
        });
      }
@@ -1953,12 +2020,15 @@
        wx.showModal({
          title: "尊敬的用户,您好!", //提示的标题
          content: "请先进行教师认证?", //提示的内容
          confirmColor: "#ff6c00",
          cancelColor: "#949494",
          success: function (res) {
            if (res.confirm) {
              wx.navigateTo({
                url: "/packageDomain/pages/teacherCertification/index",
              });
            } else if (res.cancel) {}
            } else if (res.cancel) {
            }
          },
        });
      }
packageBookService/pages/bookServices/detail/index.wxml
@@ -4,37 +4,62 @@
  <view style="width: 100%; height: {{barHeight}}px; "></view>
  <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;">
    <view>
      <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
      <t-icon
        name="chevron-left"
        size="30"
        data-name="{{item}}"
        bind:click="goBack"
      />
    </view>
    <view class="navbar-title">{{options.name}}</view>
  </view>
  <t-toast id="t-toast" />
  <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom">
  <scroll-view
    scroll-y="{{true}}"
    class="book"
    bindscrolltolower="onReachBottom"
  >
    <!-- 图书详情 -->
    <view class="book-box">
      <view class="book-detail" id="book-detail">
        <view class="detail-left">
          <view class="book-img">
            <image loading="" src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" aria-label="{{bookDetail.name}}" />
            <image
              loading=""
              src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}"
              mode="aspectFill"
              aria-label="{{bookDetail.name}}"
            />
          </view>
          <view class="book-use">
            <view class="collect" bind:tap="setCollect">
              <view>
                <image loading="" src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}" />
                <image loading="" src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}" />
                <image
                  loading=""
                  src="/static/images/bookService/detail/collect.png"
                  wx:if="{{!bookDetail.isFavourite}}"
                />
                <image
                  loading=""
                  src="/static/images/bookService/detail/collecting.png"
                  wx:if="{{bookDetail.isFavourite}}"
                />
              </view>
              <view class="use-title">收藏</view>
            </view>
            <view class="suggest" bind:tap="suggestBtn">
              <view>
                <image loading="" src="/static/images/bookService/detail/suggest.png" />
                <image
                  loading=""
                  src="/static/images/bookService/detail/suggest.png"
                />
              </view>
              <view class="use-title">我要建议</view>
            </view>
          </view>
        </view>
        <view class="detail-right">
          <view class="book-name">{{bookDetail.name}}</view>
          <view class="book-name showTow">{{bookDetail.name}}</view>
          <view class="book-message">
            <view class="message-li" wx:if="{{bookDetail.seriesName}}">
              <view class="li-title">丛书名:</view>
@@ -49,15 +74,24 @@
              <view class="li-content">{{bookDetail.isbn}}</view>
            </view>
            <view class="message-li">
              <view class="li-title" wx:if="{{bookDetail.publicationDate}}">出版时间:</view>
              <view class="li-title" wx:if="{{bookDetail.publicationDate}}"
                >出版时间:</view
              >
              <view class="li-content">{{bookDetail.publicationDate}}</view>
            </view>
            <view class="message-li" wx:if="{{bookDetail.class}}" style="height: 80rpx">
            <view
              class="message-li"
              wx:if="{{bookDetail.class}}"
              style="height: 80rpx"
            >
              <view class="li-title">图书分类:</view>
              <view class="class-name showTow">{{bookDetail.class}}</view>
            </view>
          </view>
          <image src="/static/images/bookService/detail/square.png" class="right-background" />
          <image
            src="/static/images/bookService/detail/square.png"
            class="right-background"
          />
        </view>
      </view>
      <!-- 销售信息 -->
@@ -66,12 +100,17 @@
          <!-- 电子书售价 -->
          <view class="electron-price" wx:if="{{bookDetail.price}}">
            <view>
              <image src="/static/images/bookService/detail/electon-price.png" />
              <image
                src="/static/images/bookService/detail/electon-price.png"
              />
            </view>
            <view class="price">
              <view class="price-text">{{bookDetail.price == '0.00' ? '免费' : '¥'+
                bookDetail.price}}</view>
              <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}">¥{{bookDetail.oldPrice}}
              <view class="price-text"
                >{{bookDetail.price == '0.00' ? '免费' : '¥'+
                bookDetail.price}}</view
              >
              <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}"
                >¥{{bookDetail.oldPrice}}
              </view>
            </view>
            <view> </view>
@@ -81,24 +120,66 @@
            <view>
              <image src="/static/images/bookService/detail/paper-price.png" />
            </view>
            <view class="price">{{bookDetail.paperPrice == '0.00' ? '免费' :
              '¥'+bookDetail.paperPrice}}</view>
            <view class="price"
              >{{bookDetail.paperPrice == '0.00' ? '免费' :
              '¥'+bookDetail.paperPrice}}</view
            >
          </view>
        </view>
        <!-- 网店 -->
        <view class="book-web">
          <image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.JDLink}}" data-type="jd" />
          <image class="tmall-image" src="/static/images/bookService/detail/tmall.png" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}" />
          <image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}" />
          <image src="/static/images/bookService/detail/weidian.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}" />
          <image
            src="/static/images/bookService/detail/jd.png"
            wx:if="{{bookDetail.JDLink}}"
            bind:tap="goShop"
            data-link="{{bookDetail.JDLink}}"
            data-type="jd"
          />
          <image
            class="tmall-image"
            src="/static/images/bookService/detail/tmall.png"
            bind:tap="goShop"
            data-link="{{bookDetail.tmallLink}}"
            wx:if="{{bookDetail.tmallLink}}"
          />
          <image
            src="/static/images/bookService/detail/dangdang.png"
            bind:tap="goShop"
            data-link="{{bookDetail.dangdangLink}}"
            wx:if="{{bookDetail.dangdangLink}}"
          />
          <image
            src="/static/images/bookService/detail/weidian.png"
            bind:tap="goShop"
            data-link="{{bookDetail.weidianLink}}"
            wx:if="{{bookDetail.weidianLink}}"
          />
        </view>
      </view>
    </view>
    <view class="book-resource">
      <t-tabs value="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class">
        <t-tab-panel label="图书简介" icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" style="{{tabPanelstyle}}">
          <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}" wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}"></book-brief>
          <view wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" class="noData">
      <t-tabs
        value="{{tabValue}}"
        bind:change="onTabsChange"
        t-class="custom-tabs"
        t-class-content="custom-panel"
        class="tab-class"
      >
        <t-tab-panel
          label="图书简介"
          icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}"
          value="brief"
          style="{{tabPanelstyle}}"
        >
          <book-brief
            content="{{bookDetail.content}}"
            authorIntroduction="{{bookDetail.authorIntroduction}}"
            wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}"
          ></book-brief>
          <view
            wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}"
            class="noData"
          >
            <t-empty icon="folder-open" description="暂无数据" />
          </view>
        </t-tab-panel>
@@ -109,48 +190,141 @@
          style="{{tabPanelstyle}}"
        >
        </t-tab-panel> -->
        <t-tab-panel label="教学资源" icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}">
          <view wx:if="{{!loading && teach.length && !noResources && applyState}}">
            <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" deadline="{{deadline}}" bind:applyResource="applyResource" applyResourceLoading="{{applyResourceLoading}}"></teach-resource>
            <tree id="teach-tree" openIds="{{openTeachids}}" bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach" bind:handleTree="handleTree" openTeachids="{{openTeachids}}" wx:if="{{teach.length}}"></tree>
        <t-tab-panel
          label="教学资源"
          icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}"
          value="jsek_teachingResources"
          class="{{loading ? 'loading': ''}}"
        >
          <view
            wx:if="{{!loading && teach.length && !noResources && applyState}}"
          >
            <teach-resource
              applyState="{{applyState}}"
              rejectCause="{{rejectCause}}"
              deadline="{{deadline}}"
              bind:applyResource="applyResource"
              applyResourceLoading="{{applyResourceLoading}}"
            ></teach-resource>
            <tree
              id="teach-tree"
              openIds="{{openTeachids}}"
              bookInfo="{{bookDetail}}"
              treeList="{{teach}}"
              tab="{{tabValue}}"
              applyState="{{applyState}}"
              bind:downloadTeach="downloadTeach"
              bind:handleTree="handleTree"
              openTeachids="{{openTeachids}}"
              wx:if="{{teach.length}}"
            ></tree>
          </view>
          <t-loading theme="circular" size="60rpx" class="loading" loading="{{loading }}" />
          <t-loading
            theme="circular"
            size="60rpx"
            class="loading"
            loading="{{loading }}"
          />
          <view wx:if="{{noResources}}" class="noData">
            <t-empty icon="folder-open" description="暂无数据" />
          </view>
        </t-tab-panel>
        <t-tab-panel label="云学习" icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" style="{{tabPanelstyle}}">
        <t-tab-panel
          label="云学习"
          icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}"
          value="jsek_cloudLearning"
          style="{{tabPanelstyle}}"
        >
          <view wx:if="{{!loading && learn.length}}">
            <learn-resource bind:getFreeResource="getFreeResource" bind:allAddShoppiingCar="allAddShoppiingCar" id="learn-resource" buyResourceData="{{buyResourceData}}" bookId="{{bookDetail.id}}" isshowDrawBtn="{{isshowDrawBtn}}"></learn-resource>
            <learn-resource
              bind:getFreeResource="getFreeResource"
              bind:allAddShoppiingCar="allAddShoppiingCar"
              id="learn-resource"
              buyResourceData="{{buyResourceData}}"
              bookId="{{bookDetail.id}}"
              isshowDrawBtn="{{isshowDrawBtn}}"
            ></learn-resource>
            <tree id="tree" openIds="{{openLearnids}}" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}" bind:updateShoppingCartHidden="updateShoppingCartHidden" bind:updateCloudLearning="updateCloudLearning"></tree>
            <tree
              id="tree"
              openIds="{{openLearnids}}"
              bookInfo="{{bookDetail}}"
              tab="{{tabValue}}"
              treeList="{{learn}}"
              buyIds="{{buyIdList}}"
              openLearnids="{{openLearnids}}"
              bind:updateShoppingCartHidden="updateShoppingCartHidden"
              bind:updateCloudLearning="updateCloudLearning"
            ></tree>
          </view>
          <view wx:if="{{noResources}}" class="noData">
            <t-empty icon="folder-open" description="暂无数据" />
          </view>
        </t-tab-panel>
        <t-tab-panel label="云测试" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}">
        <t-tab-panel
          label="云测试"
          icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}"
          value="questionBank"
          style="{{tabPanelstyle}}"
        >
          <view wx:if="{{!loading}}">
            <test-resource list="{{test}}" bookInfo="{{bookDetail}}" mockData="{{mockData}}" bind:buyMock="buyMock"></test-resource>
            <test-resource
              id="test-resource"
              list="{{test}}"
              bookInfo="{{bookDetail}}"
              mockData="{{mockData}}"
              bind:buyMock="buyMock"
            ></test-resource>
          </view>
        </t-tab-panel>
        <t-tab-panel label="云笔记" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}">
        <t-tab-panel
          label="云笔记"
          icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}"
          value="jsek_note"
          style="{{tabPanelstyle}}"
        >
          <note bookInfo="{{bookDetail}}" id="note" class="note-list"></note>
        </t-tab-panel>
        <t-tab-panel label="相关图书" icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" value="related_books" style="{{tabPanelstyle}}">
          <related-books relatedBookData="{{relatedBookData}}" relatedBookLoading="{{relatedBookLoading}}" noRelatedBookData="{{noRelatedBookData}}" bind:goBookDetails="goBookDetails"></related-books>
        <t-tab-panel
          label="相关图书"
          icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}"
          value="related_books"
          style="{{tabPanelstyle}}"
        >
          <related-books
            relatedBookData="{{relatedBookData}}"
            relatedBookLoading="{{relatedBookLoading}}"
            noRelatedBookData="{{noRelatedBookData}}"
            bind:goBookDetails="goBookDetails"
          ></related-books>
        </t-tab-panel>
      </t-tabs>
    </view>
  </scroll-view>
  <!-- 我要建议弹窗 -->
  <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest>
  <suggest
    class="suggest-component"
    id="suggest-component"
    bookIcon="{{bookDetail.icon}}"
    bookName="{{bookDetail.name}}"
  ></suggest>
  <!-- 教学资源下载提示弹窗 -->
  <t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="提示" content="请前往PC端下载" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" />
  <t-dialog
    class="teachDownloadDialog"
    visible="{{isShowTeachDownload}}"
    title="提示"
    content="请前往PC端下载"
    confirm-btn="{{ confirmBtn }}"
    bind:confirm="closeTeachDownload"
  />
  <view class="applyBox" bindtap="goApply">
    <view class="box">
      <t-image src="/static/images/home/yangshuForm1.png" mode="heightFix" class="img" />
      <t-image
        src="/static/images/home/yangshuForm1.png"
        mode="heightFix"
        class="img"
      />
      <view class="num" wx:if="{{num > 0}}">{{num}}</view>
    </view>
  </view>
@@ -158,26 +332,50 @@
  <view class="box-bottom">
    <view class="bottom-btn" bind:tap="appplyElectronicBook">
      <view>
        <t-image loading="" src="/static/images/bookService/detail/ebook.png"></t-image>
        <t-image
          loading=""
          src="/static/images/bookService/detail/ebook.png"
        ></t-image>
      </view>
      <view class="btn-text">电子样书申请</view>
    </view>
    <view class="bottom-btn" bind:tap="appplyPaperBook">
      <view>
        <t-image src="/static/images/bookService/detail/paper-book.png"></t-image>
        <t-image
          src="/static/images/bookService/detail/paper-book.png"
        ></t-image>
      </view>
      <view class="btn-text">纸质样书申请</view>
    </view>
    <view class="{{!bookBuy && bookDetail.isSell == '1' ? 'bottom-btn tryRead' : 'bottom-btn try'}}" bind:tap="goRead" wx:if="{{!bookBuy}}">
    <view
      class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}"
      bind:tap="goRead"
      wx:if="{{!bookBuy}}"
    >
      <view>
        <t-image src="/static/images/bookService/detail/shidu.png"></t-image>
      </view>
      <view class="btn-text">试读</view>
    </view>
    <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">加入购物车</view>
    <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">立即购买</view>
    <view class="buy receiveColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}">免费领取</view>
    <view
      class="shopCar shopCarColor"
      bind:tap="addBookShopcCar"
      wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}"
      >加入购物车</view
    >
    <view
      class="buy buyColor"
      bind:tap="buyBtn"
      wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}"
      >立即购买</view
    >
    <view
      class="buy receiveColor"
      bind:tap="buyBtn"
      wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell}}"
      >免费领取</view
    >
    <view class="buy read" bind:tap="goRead" wx:if="{{bookBuy}}">立即查看</view>
  </view>
</view>
packageBookService/pages/bookServices/detail/index.wxss
@@ -66,9 +66,6 @@
  font-size: 36rpx;
  color: #000000;
  margin-bottom: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.showTow {
packageBookService/pages/bookServices/examination/examination.js
@@ -50,15 +50,6 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // wx.enableAlertBeforeUnload({
    //   message: "未提交,是否退出答题?",
    //   success: function (res) {
    //     console.log('确定', res);
    //   },
    //   fail: function (err) {
    //     console.log("失败:", err);
    //   },
    // });
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight =
@@ -199,6 +190,25 @@
        const oldVal = value; // 记录属性的旧值
        value = newVal; // 更新属性的值
        callback.call(context, newVal, oldVal); // 调用回调函数,传递新值和旧值
      },
    });
  },
  // 返回拦截
  beforeleave() {
    wx.showModal({
      title: "提示",
      content: "未提交,是否退出答题",
      confirmColor: "#ff6c00",
      cancelColor: "#949494",
      complete: (res) => {
        if (res.cancel) {
        }
        if (res.confirm) {
          this.setData({
            submitStatus: true,
          });
          wx.navigateBack();
        }
      },
    });
  },
@@ -441,8 +451,6 @@
  },
  // 提交逻辑
  submitPaper() {
    // 关闭退出页面监听
    wx.disableAlertBeforeUnload();
    this.setData({
      submitStatus: true,
      loading: true,
@@ -669,7 +677,6 @@
              let value = JSON.parse(res[0].value);
              // 有答题记录,得分赋值
              if (value) {
                wx.disableAlertBeforeUnload();
                this.setData({
                  submitStatus: true,
                });
@@ -1203,6 +1210,8 @@
          wx.showModal({
            title: "提示",
            content: "收藏夹暂无数据", //editable如果为true,这就是输入框的内容
            confirmColor: "#ff6c00",
            cancelColor: "#949494",
            editable: false, //是否显示输入框
            showCancel: false,
            success: (res) => {
@@ -1439,6 +1448,8 @@
          wx.showModal({
            title: "提示",
            content: "错题集暂无数据", //editable如果为true,这就是输入框的内容
            confirmColor: "#ff6c00",
            cancelColor: "#949494",
            editable: false, //是否显示输入框
            showCancel: false,
            success: (res) => {
packageBookService/pages/bookServices/examination/examination.wxml
@@ -90,3 +90,11 @@
    bind:onChangeSlider="onChangeSlider"
  ></question-options>
</view>
<page-container
  wx:if="{{(answerType == 'mock' || answerType == 'option') && !submitStatus}}"
  show="{{true}}"
  duration="{{false}}"
  overlay="{{false}}"
  bind:beforeleave="beforeleave"
></page-container>
packageBookService/pages/bookServices/examination/questionList/index.wxml
@@ -126,8 +126,7 @@
                  style="height: min-content"
                >
                  <text>{{contentItem.value}}、</text>
                  <text class="radio-textimg">{{contentItem.txt}}</text>
                  <view class="radio-textimg">{{contentItem.txt}}</view>
                  <image src="{{contentItem.img}}" mode="aspectFit" />
                </view>
                <!-- 富文本 -->
@@ -291,7 +290,7 @@
          wx:if="{{item.analysisCon}}"
          style="color: {{isNight ? '#fff' : '#000'}};"
        >
          <text style="font-size: {{sliderValue || 32}}rpx;">答案解析:</text>
          <text style="font-size: {{sliderValue || 32}}rpx;" class="answer-analysis">答案解析:</text>
          <rich-text
            style="font-size: {{sliderValue || 32}}rpx;"
            nodes="{{item.analysisCon}}"
packageBookService/pages/bookServices/examination/questionList/index.wxss
@@ -47,9 +47,8 @@
}
.radio-item {
  max-height: 300rpx;
  min-height: 100rpx;
  padding: 0 32rpx;
  min-height: 98rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
@@ -229,6 +228,7 @@
}
.judge-rich-box {
  height: 100%;
  display: flex;
  align-items: center;
}
@@ -266,3 +266,8 @@
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-border-color: #ff6c00;
}
.answer-analysis {
  display: inline-block;
  width: 192rpx;
}
packageBookService/pages/bookServices/examination/questionOptions/index.js
@@ -1,4 +1,3 @@
// pages/bookServices/examination/questionOptions/index.js
Component({
  /**
@@ -11,15 +10,15 @@
    },
    questionDataList: {
      type: Array,
      value: []
      value: [],
    },
    cardList: {
      type: Array,
      value: []
      value: [],
    },
    subjectiveTotal: {
      type: Number,
      value: 0
      value: 0,
    },
    countdownTime: {
      type: Number,
@@ -27,23 +26,23 @@
    },
    answerType: {
      type: String,
      value: ''
      value: "",
    },
    subjectiveNum: {
      type: Number,
      value: 0
      value: 0,
    },
    subjectiveGrade: {
      type: Number,
      value: 0
      value: 0,
    },
    correctNum: {
      type: Number,
      value: 0
      value: 0,
    },
    submitStatus: {
      type: Boolean,
      value: false
      value: false,
    },
    mockSumTime: {
      type: Number,
@@ -51,8 +50,8 @@
    },
    isNight: {
      type: Boolean,
      value: false
    }
      value: false,
    },
  },
  /**
@@ -65,28 +64,34 @@
    setUpPopup: false,
    testReportState: false,
    sliderValue: 36,
    useTime: '',
    radioItem: 'daytime'
    useTime: "",
    radioItem: "daytime",
  },
  observers: {
    "countdownTime": function (newValue, oldValue) {
      if (this.properties.answerType == 'option') {
    countdownTime: function (newValue, oldValue) {
      if (this.properties.answerType == "option") {
        this.setData({
          useTime: this.formatTime(2 * 60 * 60 * 1000 - this.properties.countdownTime)
        })
      }
      else if (this.properties.answerType == 'option') {
          useTime: this.formatTime(
            2 * 60 * 60 * 1000 - this.properties.countdownTime
          ),
        });
      } else if (this.properties.answerType == "option") {
        this.setData({
          useTime: this.formatTime(this.properties.mockSumTime - this.properties.countdownTime)
        })
          useTime: this.formatTime(
            this.properties.mockSumTime - this.properties.countdownTime
          ),
        });
      }
      if (newValue == 0 && (this.properties.answerType == 'option' || this.properties.answerType == 'mock')) {
        this.timeout()
      if (
        newValue == 0 &&
        (this.properties.answerType == "option" ||
          this.properties.answerType == "mock")
      ) {
        this.timeout();
      }
    },
  },
  created() {
  },
  created() {},
  /**
   * 组件的方法列表
@@ -96,61 +101,60 @@
    formatTime(ms) {
      const hours = Math.floor((ms / (1000 * 60 * 60)) % 24)
        .toString()
        .padStart(2, '0')
        .padStart(2, "0");
      const minutes = Math.floor((ms / (1000 * 60)) % 60)
        .toString()
        .padStart(2, '0')
        .padStart(2, "0");
      const seconds = Math.floor((ms / 1000) % 60)
        .toString()
        .padStart(2, '0')
      return `${hours}:${minutes}:${seconds}`
        .padStart(2, "0");
      return `${hours}:${minutes}:${seconds}`;
    },
    // 判断是否输入答案
    isHaveAnswer(data) {
      if (typeof data == 'string') {
      if (typeof data == "string") {
        data = data
          .replace(/<[^>]*>/g, '')
          .replace(/&nbsp;/g, '')
          .trim()
          .replace(/<[^>]*>/g, "")
          .replace(/&nbsp;/g, "")
          .trim();
        if (data.length) {
          return true
          return true;
        } else {
          return false
          return false;
        }
      } else {
        const answer = data.find((item) => item.length > 0)
        const answer = data.find((item) => item.length > 0);
        if (answer) {
          return true
          return true;
        } else {
          return false
          return false;
        }
      }
    },
    setCollect() {
      var myEventDetail = {
      }
      var myEventDetail = {};
      var myEventOption = {
        bubbles: true,
        composed: true,
      }
      this.triggerEvent('setCollect', myEventDetail, myEventOption)
      };
      this.triggerEvent("setCollect", myEventDetail, myEventOption);
    },
    // 答题卡按钮
    handlePopup() {
      this.setData({
        questionCardState: true
      })
        questionCardState: true,
      });
    },
    // 答题卡跳转题目
    goQuestion(e) {
      var myEventDetail = {
        id: e.currentTarget.dataset.id
      }
        id: e.currentTarget.dataset.id,
      };
      var myEventOption = {
        bubbles: true,
        composed: true,
      }
      this.triggerEvent('goQuestion', myEventDetail, myEventOption)
      };
      this.triggerEvent("goQuestion", myEventDetail, myEventOption);
    },
    // 答题卡遮罩层点击
    onVisibleChange(e) {
@@ -161,136 +165,144 @@
    // 设置按钮
    setUpBtn() {
      this.setData({
        setUpPopup: true
      })
        setUpPopup: true,
      });
    },
    // 滑块变化
    onChangeSlider(e) {
      const value = e.detail.value
      const value = e.detail.value;
      console.log(value);
      this.triggerEvent('onChangeSlider', { value })
      this.triggerEvent("onChangeSlider", { value });
    },
    // 设置遮罩层点击
    onSetUpChange(e) {
      this.setData({
        setUpPopup: e.detail.visible
      })
        setUpPopup: e.detail.visible,
      });
    },
    // 设置模式切换
    onRadioChange(e) {
      this.setData({
        radioItem: e.detail.value
      })
      const value = e.detail.value == 'night' ? true : false
        radioItem: e.detail.value,
      });
      const value = e.detail.value == "night" ? true : false;
      wx.setNavigationBarColor({
        backgroundColor: '#222',
        frontColor: '#222',
      })
        backgroundColor: "#222",
        frontColor: "#222",
      });
      this.triggerEvent('changeBGColor', { value })
      this.triggerEvent("changeBGColor", { value });
    },
    // 重做按钮
    resterBtn() {
      wx.showModal({
        title: '提示',
        content: '是否重新开始答题?',//editable如果为true,这就是输入框的内容
        title: "提示",
        content: "是否重新开始答题?", //editable如果为true,这就是输入框的内容
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        editable: false,//是否显示输入框
        success: (res) => {
          if (res.confirm) {
            this.restart()
            this.restart();
          }
        }
      })
        },
      });
    },
    // 重做事件
    restart() {
      var myEventDetail = {
      }
      var myEventDetail = {};
      var myEventOption = {
        bubbles: true,
        composed: true,
      }
      this.triggerEvent('restart', myEventDetail, myEventOption)
      };
      this.triggerEvent("restart", myEventDetail, myEventOption);
    },
    // 还有N道题未做弹窗
    confrimPromptDialog() {
      wx.showModal({
        title: '提示',
        title: "提示",
        content: `您还有 ${this.data.noReady}道题未答,是否提交?`,//editable如果为true,这就是输入框的内容
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        editable: false,//是否显示输入框
        success: (res) => {
          if (res.confirm) {
            this.submitPaper()
            this.submitPaper();
          }
        }
      })
        },
      });
    },
    // 底部提交按钮
    submitBtn() {
      this.setData({
        noReady: 0
      })
        noReady: 0,
      });
      // 我的错题和收藏  直接走提交逻辑
      if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') {
        this.submitPaper()
        return wx.navigateBack()
      } else if (this.properties.answerType == 'option' || this.properties.answerType == 'mock') {
        if (this.properties.submitStatus) return wx.navigateBack()
        this.properties.questionDataList.forEach(item => {
      if (
        this.properties.answerType == "collectQuestion" ||
        this.properties.answerType == "errorQuestion"
      ) {
        this.submitPaper();
        return wx.navigateBack();
      } else if (
        this.properties.answerType == "option" ||
        this.properties.answerType == "mock"
      ) {
        if (this.properties.submitStatus) return wx.navigateBack();
        this.properties.questionDataList.forEach((item) => {
          if (!this.isHaveAnswer(item.userAnswer)) {
            this.setData({
              noReady: this.data.noReady + 1
            })
              noReady: this.data.noReady + 1,
            });
          }
        })
        });
        // 未做完,打开提示弹窗
        if (this.data.noReady > 0) {
          this.confrimPromptDialog()
          this.confrimPromptDialog();
        } else {
          // 做完了直接执行提交事件
          this.submitPaper()
          this.submitPaper();
        }
      }
    },
    // 提交事件
    submitPaper() {
      var myEventDetail = {
      }
      var myEventDetail = {};
      var myEventOption = {
        bubbles: true,
        composed: true,
      }
      this.triggerEvent('submitPaper', myEventDetail, myEventOption)
      };
      this.triggerEvent("submitPaper", myEventDetail, myEventOption);
    },
    // 打开测试报告弹窗
    openTestReportDialog() {
      this.setData({
        testReportState: true
      })
        testReportState: true,
      });
    },
    // 关闭测试报告弹窗
    closeTestReportDialog(e) {
      this.setData({
        testReportState: false
      })
        testReportState: false,
      });
    },
    // 测试报告弹窗查看答案解析按钮
    viewAnswer() {
      this.closeTestReportDialog()
      this.closeTestReportDialog();
    },
    // 答题时间到
    timeout() {
      wx.showModal({
        title: '提示',
        content: '答题时间已到',//editable如果为true,这就是输入框的内容
        title: "提示",
        content: "答题时间已到", //editable如果为true,这就是输入框的内容
        confirmColor: "#ff6c00",
        cancelColor: "#949494",
        editable: false,//是否显示输入框
        showCancel: false,
        success: (res) => {
        }
      })
      this.submitPaper()
        success: (res) => {},
      });
      this.submitPaper();
    },
  }
})
  },
});
packageBookService/pages/bookServices/list/index.js
@@ -1,16 +1,14 @@
const app = getApp();
import {
  loginInfo
} from '../../../../assets/js/login';
import { loginInfo } from "../../../../assets/js/login";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    barHeight: '',
    navBarHeight: '',
    searchValue: '',
    path: '',
    barHeight: "",
    navBarHeight: "",
    searchValue: "",
    path: "",
    pathList: [],
    pageCount: {
      page: 1,
@@ -18,16 +16,18 @@
    },
    isMore: null,
    assortCheck: {
      name: '',
      code: '',
      name: "",
      code: "",
    },
    bookList: [],
    stairList: {
      value: '',
      options: [{
        value: '',
        label: '一级',
      }, ],
      value: "",
      options: [
        {
          value: "",
          label: "一级",
        },
      ],
    },
    secondList: {
      value: [],
@@ -39,38 +39,40 @@
      options: [],
    },
    sortList: {
      value: 'default',
      options: [{
          value: 'default',
          label: '默认排序',
        }, {
          value: 'name-asc',
          label: '名称正序'
      value: "default",
      options: [
        {
          value: "default",
          label: "默认排序",
        },
        {
          value: 'name-desc',
          label: '名称倒叙'
          value: "name-asc",
          label: "名称正序",
        },
        {
          value: 'time-asc',
          label: '出版时间正序'
          value: "name-desc",
          label: "名称倒叙",
        },
        {
          value: 'time-desc',
          label: '出版时间倒叙'
        }
          value: "time-asc",
          label: "出版时间正序",
        },
        {
          value: "time-desc",
          label: "出版时间倒叙",
        },
      ],
    },
    newTextBook: {
      value: [],
      options: [],
    },
    stairCode: '', // 一级分类选中项
    secondCode: '', // 二级分类选中项
    sort: '', // 排序
    stairCode: "", // 一级分类选中项
    secondCode: "", // 二级分类选中项
    sort: "", // 排序
    enable: false,
    loadingProps: {
      size: '50rpx'
      size: "50rpx",
    },
    loading: false,
    noData: false,
@@ -81,6 +83,7 @@
    disabledProject: false,
    disabledNewForms: false,
    triggered: false,
    backTop: "",
  },
  /**
   * 生命周期函数--监听页面加载
@@ -88,7 +91,8 @@
  onLoad(options) {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
    const navBarHeight =
      (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
    this.setData({
      barHeight: systInfo.statusBarHeight,
      navBarHeight: navBarHeight,
@@ -114,7 +118,7 @@
    // 一级分类和path赋值
    if (options.stairCode) {
      this.setData({
        'stairList.value': options.stairCode,
        "stairList.value": options.stairCode,
        stairCode: options.stairCode,
        path: `${options.assortCode}\\${options.stairCode}`,
      });
@@ -123,19 +127,21 @@
    if (options.secondCode) {
      this.setData({
        secondCode: options.secondCode,
        pathList: [{
        pathList: [
          {
          Path: options.secondCode,
          Type: '*',
            Type: "*",
          StoreRefCode: app.config.goodsStore,
        }],
      })
          },
        ],
      });
    }
    // 获取二级分类
    this.getSecondList(`${options.assortCode}\\${options.stairCode}`);
    this.getBookList(`${options.assortCode}\\${options.stairCode}`);
    // 获取重点项目
    this.getProjectList('bookClassification');
    this.getProjectList('newFormsTextbooks');
    this.getProjectList("bookClassification");
    this.getProjectList("newFormsTextbooks");
  },
  /**
@@ -163,11 +169,11 @@
   */
  onPullDownRefresh() {
    this.setData({
      triggered: true
    })
      triggered: true,
    });
    this.setData({
      'pageCount.page': 1
    })
      "pageCount.page": 1,
    });
    this.getBookList(this.data.path);
  },
@@ -175,25 +181,24 @@
   * 页面上拉触底事件的处理函数
   */
  onReachBottom(e) {
    const flag = this.data.bookList.length < this.data.pageCount.total
    const flag = this.data.bookList.length < this.data.pageCount.total;
    if (flag) {
      if (!this.data.isRequesting) {
        this.setData({
          isMore: true,
          "pageCount.page": this.data.pageCount.page + 1
        })
        this.getBookList(this.data.path)
          "pageCount.page": this.data.pageCount.page + 1,
        });
        this.getBookList(this.data.path);
      }
    } else {
      this.setData({
        isMore: true,
      })
      });
      setTimeout(() => {
        this.setData({
          isMore: false
        })
      }, 100)
      console.log('没有更多了');
          isMore: false,
        });
      }, 100);
    }
  },
@@ -207,26 +212,28 @@
  // 获取一级列表
  getStairList(path) {
    this.setData({
      disabledStair: false
    })
      disabledStair: false,
    });
    const query = {
      path,
      filterList: [],
      queryType: '\\',
      queryType: "\\",
      searchList: [],
      size: '30',
      start: '0',
      size: "30",
      start: "0",
      storeRefCode: app.config.goodsStore,
      sort: {
        type: 'Asc',
        field: 'LinkOrder'
        type: "Asc",
        field: "LinkOrder",
      },
    };
    app.MG.store.getStoreChannelList(query).then(async (res) => {
      const options = [{
        value: '',
        label: '一级',
      }, ];
      const options = [
        {
          value: "",
          label: "一级",
        },
      ];
      for (let index = 0; index < res.datas.length; index++) {
        const item = res.datas[index];
        options.push({
@@ -235,13 +242,13 @@
        });
      }
      this.setData({
        'stairList.options': options,
        'stairList.value': this.data.stairCode,
        "stairList.options": options,
        "stairList.value": this.data.stairCode,
      });
      if (!options.length) {
        this.setData({
          disabledStair: true
        })
          disabledStair: true,
        });
      }
    });
  },
@@ -251,25 +258,25 @@
    const query = {
      path,
      filterList: [],
      queryType: '\\',
      queryType: "\\",
      searchList: [],
      size: '30',
      start: '0',
      size: "30",
      start: "0",
      storeRefCode: app.config.goodsStore,
      sort: {
        type: 'Asc',
        field: 'LinkOrder'
        type: "Asc",
        field: "LinkOrder",
      },
    };
    app.MG.store.getStoreChannelList(query).then((res) => {
      if (!res.datas.length) {
        this.setData({
          disabledSecondList: true
        })
          disabledSecondList: true,
        });
      } else {
        this.setData({
          disabledSecondList: false
        })
          disabledSecondList: false,
        });
      }
      for (let index = 0; index < res.datas.length; index++) {
        const item = res.datas[index];
@@ -279,20 +286,20 @@
        });
      }
      this.setData({
        'secondList.options': options,
        "secondList.options": options,
      });
      const second = [this.data.secondCode]
      const second = [this.data.secondCode];
      this.setData({
        'secondList.value': second
      })
        "secondList.value": second,
      });
    });
  },
  // 获取重点项目
  getProjectList(type) {
    this.setData({
      disabledProject: false,
      disabledNewForms: false
    })
      disabledNewForms: false,
    });
    const options = [];
    const arr = [];
    let array = [];
@@ -300,7 +307,9 @@
      refCodes: [type],
    };
    app.MG.store.getProductTypeField(query).then((res) => {
      array = JSON.parse(res[0].config).option.filter(item => item.value == this.data.assortCheck.code);
      array = JSON.parse(res[0].config).option.filter(
        (item) => item.value == this.data.assortCheck.code
      );
      for (let index = 0; index < array.length; index++) {
        const element = array[index];
        if (element.child) {
@@ -310,7 +319,7 @@
          }
        }
      }
      if (type == 'bookClassification') {
      if (type == "bookClassification") {
        for (let index = 0; index < arr.length; index++) {
          const element = arr[index];
          options.push({
@@ -320,13 +329,13 @@
        }
        if (!options.length) {
          this.setData({
            disabledProject: true
          })
            disabledProject: true,
          });
        }
        this.setData({
          'majorProjectList.options': options,
          "majorProjectList.options": options,
        });
      } else if (type == 'newFormsTextbooks') {
      } else if (type == "newFormsTextbooks") {
        for (let index = 0; index < arr.length; index++) {
          const element = arr[index];
          options.push({
@@ -336,13 +345,13 @@
        }
        if (!options.length) {
          this.setData({
            disabledNewForms: true
          })
            disabledNewForms: true,
          });
        }
        this.setData({
          'newTextBook.options': options,
          "newTextBook.options": options,
        });
        console.log('重点项目', this.data.newTextBook);
        console.log("重点项目", this.data.newTextBook);
      }
    });
  },
@@ -354,8 +363,8 @@
    this.setData({
      loading: true,
      noData: false,
      isRequesting: true
    })
      isRequesting: true,
    });
    let sort;
    let pathObj = {};
    if (this.data.pathList.length) {
@@ -365,34 +374,34 @@
    } else {
      pathObj = {
        path,
        queryType: '*',
        queryType: "*",
      };
    }
    if (this.data.sortList.value == 'name-asc') {
    if (this.data.sortList.value == "name-asc") {
      sort = {
        Name: 'Asc',
        BaseType: ''
      }
    } else if (this.data.sortList.value == 'name-desc') {
        Name: "Asc",
        BaseType: "",
      };
    } else if (this.data.sortList.value == "name-desc") {
      sort = {
        Name: 'Desc',
        BaseType: ''
      }
    } else if (this.data.sortList.value == 'time-asc') {
        Name: "Desc",
        BaseType: "",
      };
    } else if (this.data.sortList.value == "time-asc") {
      sort = {
        PublicationDate: 'Asc',
        BaseType: 'DateTime'
      }
    } else if (this.data.sortList.value == 'time-desc') {
        PublicationDate: "Asc",
        BaseType: "DateTime",
      };
    } else if (this.data.sortList.value == "time-desc") {
      sort = {
        PublicationDate: 'Desc',
        BaseType: 'DateTime'
      }
    } else if (this.data.sortList.value == 'default') {
        PublicationDate: "Desc",
        BaseType: "DateTime",
      };
    } else if (this.data.sortList.value == "default") {
      sort = {
        field: 'order',
        type: 'Desc'
      }
        field: "order",
        type: "Desc",
      };
    }
    // if (this.data.sort) {
    //   sort = {
@@ -409,18 +418,20 @@
    let searchObj = {};
    if (this.data.searchValue) {
      searchObj = {
        'Name*': this.data.searchValue,
        '||author*': this.data.searchValue,
        '||isbn*': this.data.searchValue,
        '||seriesName*': this.data.searchValue,
        "Name*": this.data.searchValue,
        "||author*": this.data.searchValue,
        "||isbn*": this.data.searchValue,
        "||seriesName*": this.data.searchValue,
      };
    }
    const query = {
      ...pathObj,
      filterList: [{
        value: 'Normal',
        field: 'state',
      }, ],
      filterList: [
        {
          value: "Normal",
          field: "state",
        },
      ],
      sort,
      paging: {
        start: 0,
@@ -430,51 +441,53 @@
        author: [],
        publicationDate: [],
        ...searchObj,
        'bookClassification*': this.data.majorProjectList.value,
        'newFormsTextbooks*': this.data.newTextBook.value,
        "bookClassification*": this.data.majorProjectList.value,
        "newFormsTextbooks*": this.data.newTextBook.value,
      },
    };
    app.MG.store.getProductList(query).then((res) => {
      this.setData({
        bookList: res.datas,
        isMore: null,
        enable: false,
        "pageCount.total": res.total,
        loading: false,
        isRequesting: false
        isRequesting: false,
      });
      if (!res.datas.length) {
        this.setData({
          noData: true,
        })
        });
      }
      if (this.data.triggered) {
        this.setData({
          triggered: false
        })
          triggered: false,
        });
        wx.showToast({
          title: '刷新成功',
        })
          title: "刷新成功",
        });
      }
    });
  },
  // 一级分类切换
  onChangeStair(e) {
    const path = e.detail.value.length ?
      `${this.data.assortCheck.code}\\${e.detail.value}` :
      this.data.assortCheck.code;
    const path = e.detail.value.length
      ? `${this.data.assortCheck.code}\\${e.detail.value}`
      : this.data.assortCheck.code;
    console.log(this.data.path);
    this.setData({
      backTop: "#assort-title",
      pathList: [],
      stairCode: e.detail.value,
      secondCode: '',
      secondCode: "",
      path: path,
      'stairList.value': e.detail.value,
      "stairList.value": e.detail.value,
    });
    if (e.detail.value == '') {
    if (e.detail.value == "") {
      this.setData({
        disabledSecondList: true
        disabledSecondList: true,
      });
    } else {
      this.getSecondList(path);
@@ -489,13 +502,14 @@
      const element = e.detail.value[index];
      pathList.push({
        Path: element,
        Type: '*',
        Type: "*",
        StoreRefCode: app.config.goodsStore,
      });
    }
    this.setData({
      backTop: "#assort-title",
      pathList: pathList,
      'secondList.value': e.detail.value,
      "secondList.value": e.detail.value,
    });
  },
  // 
@@ -505,22 +519,24 @@
  // 重点项目改变
  changeMajorProject(e) {
    this.setData({
      'majorProjectList.value': e.detail.value,
      backTop: "#assort-title",
      "majorProjectList.value": e.detail.value,
    });
    this.getBookList(this.data.path);
  },
  // 重点项目重置
  resetMajorProject() {
    this.setData({
      'majorProjectList.value': [],
      "majorProjectList.value": [],
    });
    this.getBookList(this.data.path);
  },
  // 排序切换
  onSortChange(e) {
    this.setData({
      'sortList.value': e.detail.value
    })
      backTop: "#assort-title",
      "sortList.value": e.detail.value,
    });
    let path;
    if (this.data.secondCode) {
@@ -535,15 +551,17 @@
    });
    this.getBookList(path);
  },
  // 新形态教材改变
  changeNewText(e) {
    this.setData({
      'newTextBook.value': e.detail.value,
      backTop: "#assort-title",
      "newTextBook.value": e.detail.value,
    });
    this.getBookList(this.data.path);
  },
  resetNewText() {
    this.setData({
      'newTextBook.value': [],
      "newTextBook.value": [],
    });
    this.getBookList(this.data.path);
  },
@@ -577,37 +595,35 @@
  // },
  // 搜索图书
  searchBook(e) {
    console.log(e.detail.value);
    this.setData({
      backTop: "#assort-title",
      searchValue: e.detail.value,
    });
    this.getBookList(this.data.path);
  },
  // 跳转图书详情
  goDetail(e) {
    const {
      book
    } = e.currentTarget.dataset;
    const { book } = e.currentTarget.dataset;
    wx.navigateTo({
      url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`,
    });
  },
  onRefresh() {
    this.setData({
      enable: true
      enable: true,
    });
    this.getBookList(this.data.path)
    this.getBookList(this.data.path);
  },
  openDropdown() {
    console.log('展开哦', );
    console.log("展开哦");
    this.setData({
      showDropdown: true
    })
      showDropdown: true,
    });
  },
  closeDropdown() {
    console.log('关闭');
    console.log("关闭");
    this.setData({
      showDropdown: false
    })
  }
      showDropdown: false,
    });
  },
});
packageBookService/pages/bookServices/list/index.wxml
@@ -78,6 +78,7 @@
    </view>
    <scroll-view
      scroll-y="{{true}}"
      scroll-into-view="{{backTop}}"
      refresher-enabled="{{true}}"
      lower-threshold="{{200}}"
      refresher-threshold="{{80}}"
@@ -99,7 +100,7 @@
          />
        </view>
      </view>
      <view class="assort-title">
      <view class="assort-title" id="assort-title">
        <view class="title-box"></view>
        <view class="title-name">{{assortCheck.name}}</view>
      </view>
@@ -137,12 +138,13 @@
          />
        </view>
      </view>
      <view class="bottom-box">
      <view class="bottom-box" wx:if="{{bookList.length}}">
        <t-loading
          theme="circular"
          size="40rpx"
          class="wrapper"
          wx:if="{{isMore == true}}"
          loading="{{isMore}}"
        />
        <text wx:if="{{isMore == false}}">没有更多了</text>
      </view>
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -46,18 +46,6 @@
          'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress,
        })
      } else {
        wx.showModal({
          title: '尊敬的用户,您好!', //提示的标题
          content: '请先进行教师认证?', //提示的内容
          success: function (res) {
            if (res.confirm) {
              wx.navigateTo({
                url: "/packageDomain/pages/teacherCertification/index",
              });
            }
          }
        })
      }
      if (wx.getStorageSync("paperBookList")) {
        this.setData({
packageDomain/pages/sampleBookList/index.js
@@ -420,8 +420,6 @@
        author: [],
        isbn: [],
        publicationDate: [],
        pdf: [],
        protectedEpub: [],
        isApplyBook: [],
        'isApplyBook>': ['1'],
        ...searchObj,
@@ -497,9 +495,6 @@
          })
        } else {
          that.setData({
            bookList: [],
            pageTotalCount: 0,
            bottomLoading: false,
            skeletonLoding: false,
            loading: false
          })
@@ -812,55 +807,14 @@
  },
  //选择电子样书
  async onChangeElectron(e) {
  onChangeElectron(e) {
    const item = e.currentTarget.dataset.book;
    console.log(item)
    const index = this.data.bookList.findIndex(citem => citem.id == item.id)
    let role = this.data.userInfo != null ? this.data.userInfo.role : null
    if (role && role == 'Teacher') {
      // 是教师
      if (e.detail.checked) {
        // 点击选中
        //商品有无电子书
        const obj = {
          path: '*',
          queryType: 'SubProduct',
          sort: {
            type: 'Desc',
            field: 'CreateDate'
          },
          paging: {
            start: 0,
            size: 1
          },
          mainProductId: item.id,
          fields: {
            bookshelf_pdf: [],
            bookshelf_protectedEpub: [],
          }
        }
        const res = await app.MG.store.getProductList(obj)
        if (res.datas.length > 0) {
          if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) {
            wx.showToast({
              title: "暂无电子书文件,请联系管理员!",
              icon: 'none',
              duration: 1000,
            })
            return false;
          }
        } else {
          if (!item.pdf && !item.protectedEpub) {
            wx.showToast({
              title: "暂无电子书文件,请联系管理员!",
              icon: 'none',
              duration: 1000,
            })
            return false;
          }
        }
        //申请次数
        if (this.data.ebookCount == 0) {
          wx.showToast({
            title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!",
packageDomain/pages/sampleBookList/index.json
@@ -11,7 +11,6 @@
    "t-search": "tdesign-miniprogram/search/search",
    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
    "t-loading": "tdesign-miniprogram/loading/loading",
    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh",
    "t-empty": "tdesign-miniprogram/empty/empty"
    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh"
  }
}
packagePersonal/pages/downloads/index.js
@@ -67,8 +67,6 @@
            })
          } else {
            this.setData({
              list: [],
              pageTotalCount: 0,
              skeletonLoding: false,
            })
          }
packagePersonal/pages/feedBack/index.js
@@ -9,7 +9,8 @@
  data: {
    active: 0,
    activeName: "bookOpinion",
    tabList: [{
    tabList: [
      {
        label: '图书建议',
        key: 0,
        value: 'bookOpinion'
@@ -111,8 +112,6 @@
            })
          } else {
            this.setData({
              list: [],
              pageTotalCount: 0,
              skeletonLoding: false,
            })
          }
packagePersonal/pages/feedBack/index.wxml
@@ -17,7 +17,7 @@
        <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox">
          <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index">
            <view class="icon">
              <t-image src="{{item.content.icon ? item.content.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" class="img" />
              <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" />
            </view>
            <view class="item-con">
              <view class="titleBox">
packagePersonal/pages/myMassage/index.js
@@ -59,8 +59,6 @@
            })
          } else {
            this.setData({
              list: [],
              pageTotalCount: 0,
              skeletonLoding: false,
            })
          }
packagePersonal/pages/sampleBooks/index.js
@@ -143,8 +143,6 @@
          })
        } else {
          this.setData({
            list: [],
            pageTotalCount: 0,
            skeletonLoding: false,
            loading: false
          })
pages/bookServices/assort/index.js
@@ -1,22 +1,24 @@
// pages/bookServices/assort/index.js
import { getPublicImage } from '../../../assets/js/middleGround/tool'
import { getPublicImage } from "../../../assets/js/middleGround/tool";
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    placeholderstyle: 'font-size:28rpx',
    barHeight: "",
    navBarHeight: "",
    placeholderstyle: "font-size:28rpx",
    assortList: [],
    assortCheck: {
      name: '',
      code: '',
      name: "",
      code: "",
    },
    startList: [],
    startCheck: {
      id: '',
      code: ''
      id: "",
      code: "",
    },
    bookList: [],
    loading: false,
@@ -27,6 +29,14 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight =
      (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
    this.setData({
      barHeight: systInfo.statusBarHeight,
      navBarHeight: navBarHeight,
    });
    this.getAssortList();
  },
@@ -39,10 +49,10 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
    if (typeof this.getTabBar === "function" && this.getTabBar()) {
      this.getTabBar().setData({
        active: 1
      })
        active: 1,
      });
    }
  },
@@ -74,28 +84,30 @@
  // 获取侧边栏列表
  getAssortList() {
    this.setData({
      loading: true
    })
      loading: true,
    });
    const query = {
      path: '*',
      path: "*",
      filterList: [
        {
          value: 'Normal',
          field: 'state',
          value: "Normal",
          field: "state",
        },
      ],
      queryType: '\\',
      queryType: "\\",
      searchList: [],
      size: '30',
      start: '0',
      size: "30",
      start: "0",
      storeRefCode: app.config.goodsStore,
      sort: { type: 'Asc', field: 'LinkOrder' },
      sort: { type: "Asc", field: "LinkOrder" },
    };
    app.MG.store.getStoreChannelList(query).then((res) => {
      const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService');
      const list = res.datas.filter(
        (item) => item.refCode != "jsek_homepageBookService"
      );
      this.setData({
        assortList: list,
        loading: false
        loading: false,
      });
      this.setData({
        assortCheck: {
@@ -125,22 +137,24 @@
      path,
      filterList: [
        {
          value: 'Normal',
          field: 'state'
        }
          value: "Normal",
          field: "state",
        },
      ],
      queryType: '\\',
      queryType: "\\",
      searchList: [],
      size: '30',
      start: '0',
      size: "30",
      start: "0",
      storeRefCode: app.config.goodsStore,
      sort: { type: 'Asc', field: 'LinkOrder' },
      sort: { type: "Asc", field: "LinkOrder" },
    };
    app.MG.store.getStoreChannelList(query).then(async (res) => {
      // 获取二级分类
      for (let index = 0; index < res.datas.length; index++) {
        const item = res.datas[index];
        item.icon ? item.icon = getPublicImage(item.icon, 500) : item.icon = item.icon
        item.icon
          ? (item.icon = getPublicImage(item.icon, 500))
          : (item.icon = item.icon);
        item.children = await this.getSecondList(item);
      }
      console.log(res.datas);
@@ -148,8 +162,8 @@
      this.setData({
        startList: res.datas,
        listLoding: false,
        'startCheck.id': res.datas[0].id,
        'startCheck..code': ''
        "startCheck.id": res.datas[0].id,
        "startCheck..code": "",
      });
    });
  },
@@ -162,26 +176,24 @@
      path,
      filterList: [
        {
          value: 'Normal',
          field: 'state'
        }
          value: "Normal",
          field: "state",
        },
      ],
      coverSize: {
        width: 500
        width: 500,
      },
      queryType: '\\',
      queryType: "\\",
      searchList: [],
      size: '30',
      start: '0',
      size: "30",
      start: "0",
      storeRefCode: app.config.goodsStore,
      sort: { type: 'Asc', field: 'LinkOrder' },
      sort: { type: "Asc", field: "LinkOrder" },
    };
    await app.MG.store.getStoreChannelList(query).then((res) => {
      for (let index = 0; index < res.datas.length; index++) {
        const element = res.datas[index];
        if (element.icon)
          element.icon = getPublicImage(element.icon, 500)
        if (element.icon) element.icon = getPublicImage(element.icon, 500);
      }
      datas = res.datas;
    });
@@ -190,19 +202,19 @@
  tabClick(e) {
    const data = e.currentTarget.dataset.tabdata;
    this.setData({
      'startCheck.id': data.id,
      'startCheck.code': data.refCode,
      "startCheck.id": data.id,
      "startCheck.code": data.refCode,
    });
    console.log(data);
  },
  // 跳转列表页
  goPageList(e) {
    const tab = e.currentTarget.dataset.tabdata
    const stair = e.currentTarget.dataset.stair
    const tab = e.currentTarget.dataset.tabdata;
    const stair = e.currentTarget.dataset.stair;
    this.setData({
      'startCheck.id': tab.id,
      'startCheck.code': tab.refCode
    })
      "startCheck.id": tab.id,
      "startCheck.code": tab.refCode,
    });
    if (stair) {
      const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`;
      wx.navigateTo({
@@ -213,7 +225,6 @@
        url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`,
      });
    }
  },
  navToSearchPage(e) {
    wx.navigateTo({
pages/bookServices/assort/index.json
@@ -1,5 +1,5 @@
{
  "navigationBarTitleText": "图书服务",
  "navigationStyle": "custom",
  "onReachBottomDistance": 10,
  "backgroundTextStyle": "light",
  "disableScroll": true,
pages/bookServices/assort/index.wxml
@@ -1,5 +1,9 @@
<!--图书服务分类-->
<page-meta style="width: 100vw; overflow: hidden">
  <view style="width: 100%; height: {{barHeight}}px; "></view>
  <view class="nacigationBar" style="width: 100%; height: {{navBarHeight}}px;">
    <view class="navbar-title">图书服务</view>
  </view>
  <view class="page-header">
    <!-- 搜索框 -->
    <view class="search">
pages/bookServices/assort/index.wxss
@@ -5,6 +5,13 @@
  padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx);
}
.navbar-title {
  text-align: center;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
}
.page-header {
  position: relative;
}
pages/personalCenter/feedBackSubmit/index.js
@@ -68,18 +68,11 @@
    const {
      phoneError
    } = this.data;
    if (e.detail.value) {
      const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value);
      if (phoneError === isPhoneNumber) {
        this.setData({
          phoneError: !isPhoneNumber,
          mannder: e.detail.value,
        });
      }
    } else {
      this.setData({
        phoneError: false,
        mannder: ''
      });
    }
  },
@@ -104,7 +97,7 @@
      if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') {
        this.data.lock = true;
        wx.showToast({
          title: "联系方式不能为空",
          title: "反馈内容不能为空",
          icon: 'none',
          duration: 1000
        })