闫增涛
2024-03-05 14de3e90ae29af2ccfd51b08c6a11ab02fe8f8e7
feat(合并代码): 和冰帝阿

合并代码

BREAKING CHANGE: N
10个文件已修改
33个文件已添加
1404 ■■■■ 已修改文件
pages/bookServices/assort/index.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/brief/index.wxml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/brief/index.wxss 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.wxml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.wxss 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.wxml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.wxss 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.wxml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.wxss 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.js 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.json 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.wxml 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.wxss 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.js 552 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.json 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.wxml 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.wxss 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.js 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.wxml 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/PPT.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/audioIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/download-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/download.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/excel.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/need-buy.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/net.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/pdf.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/picture.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/renwudan/icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/shikan.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/upload.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/video.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/word.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/yijiangoumai.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/yijianlingqu.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/zip.png 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.js
@@ -27,7 +27,7 @@
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {},
  onReady() { },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
@@ -39,27 +39,27 @@
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {},
  onHide() { },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {},
  onUnload() { },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},
  onPullDownRefresh() { },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {},
  onReachBottom() { },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {},
  onShareAppMessage() { },
  // èŽ·å–ä¾§è¾¹æ åˆ—è¡¨
  getAssortList() {
pages/bookServices/detail/components/brief/index.wxml
@@ -1,17 +1,14 @@
<view class="message">
  <view class="basic">
  <view class="basic" wx:if="{{content}}">
    <view class="basic-title">
      <view>
        <t-image src="/static/images/bookService/detail/label.png"></t-image>
      </view>
      <view class="title-name">基本信息</view>
    </view>
    <rich-text
      nodes="{{content}}"
      style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify"
    ></rich-text>
    <rich-text nodes="{{content}}" style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify"></rich-text>
  </view>
  <view class="basic">
  <view class="basic" wx:if="{{authorIntroduction}}">
    <view class="basic-title">
      <view>
        <t-image src="/static/images/bookService/detail/author.png"></t-image>
@@ -19,8 +16,5 @@
      <view class="title-name">作者简介</view>
    </view>
  </view>
  <rich-text
    nodes="{{authorIntroduction}}"
    style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify"
  />
</view>
  <rich-text nodes="{{authorIntroduction}}" style="font-size: 28rpx; color: #333; line-height: 48rpx; text-align: justify" />
</view>
pages/bookServices/detail/components/brief/index.wxss
@@ -1,8 +1,10 @@
/* pages/bookServices/detail/components/brief/index.wxss */
.message {
  padding: 0 40rpx 40rpx 40rpx;
  min-height: 550rpx;
}
.message image {
  width: 42rpx;
  height: 48rpx;
pages/bookServices/detail/components/learnResource/learnResource.js
New file
@@ -0,0 +1,23 @@
// pages/bookServices/detail/components/learnResource/learnResource.js
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
  }
})
pages/bookServices/detail/components/learnResource/learnResource.json
New file
@@ -0,0 +1,7 @@
{
  "component": true,
  "usingComponents": {
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button"
  }
}
pages/bookServices/detail/components/learnResource/learnResource.wxml
New file
@@ -0,0 +1,15 @@
<!--pages/bookServices/detail/components/learnResource/learnResource.wxml-->
<view class="learnResource" theme="primary">
  <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; " t-class="external-class">
    <t-image src=" /static/images/bookService/detail/yijianlingqu.png"></t-image>
    <text>领取查看</text>
  </t-button>
  <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;">
    <t-image src="/static/images/bookService/detail/yijiangoumai.png"></t-image>
    ä¸€é”®è´­ä¹°
  </t-button>
  <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;">
    <t-image src="/static/images/bookService/detail/renwudan/icon.png"></t-image>
    å­¦ä¹ ä»»åŠ¡å•
  </t-button>
</view>
pages/bookServices/detail/components/learnResource/learnResource.wxss
New file
@@ -0,0 +1,24 @@
/* pages/bookServices/detail/components/learnResource/learnResource.wxss */
.learnResource {
  padding: 40rpx 0;
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  border-bottom: 1px solid #EFF0F1;
}
.btn {
  width: 232rpx;
  font-size: 28rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-color: #ff6c00;
  padding: 0;
  display: flex;
  align-items: center;
}
.btn image {
  width: 28rpx;
  height: 32rpx;
}
pages/bookServices/detail/components/suggest/suggest.js
New file
@@ -0,0 +1,38 @@
// pages/bookServices/detail/components/suggest/suggest.js
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
  },
  data: {
    dialogKey: '',
    showWithInput: false,
    showTextAndTitleWithInput: false,
    inputvalue: '',
    textvalue: '',
    ratevalue: 0,
  },
  methods: {
    showDialog(e) {
      this.setData({
        showWithInput: true
      })
    },
    closeDialog() {
      this.setData({
        showWithInput: false
      })
    },
    // è¯„分改变
    onChangeRate(e) {
      const { value } = e.detail;
      this.setData({
        ratevalue: value
      });
    },
  },
})
pages/bookServices/detail/components/suggest/suggest.json
New file
@@ -0,0 +1,9 @@
{
  "component": true,
  "usingComponents": {
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-input": "tdesign-miniprogram/input/input",
    "t-textarea": "tdesign-miniprogram/textarea/textarea",
    "t-rate": "tdesign-miniprogram/rate/rate"
  }
}
pages/bookServices/detail/components/suggest/suggest.wxml
New file
@@ -0,0 +1,10 @@
<t-dialog visible="{{showWithInput}}" title="我要建议" confirm-btn="确定" cancel-btn="取消" bind:confirm="closeDialog" bind:cancel="closeDialog" class="suggest-dialog">
  <view slot="content">
    <view class="demo-rate">
      <view class="demo-rate__title">实心评分</view>
      <t-rate value="{{ratevalue}}" bind:change="onChangeRate" />
    </view>
    <t-input clearable value="{{inputvalue}}" slot="content" label="联系方式" placeholder="请输入联系方式" placeholder-class="placeholder" />
    <t-textarea value="{{textvalue}}" t-class="external-class" label="标签文字" placeholder="设置最大字符个数,一个汉字表示两个字符" maxcharacter="200" disableDefaultPadding="{{true}}" indicator />
  </view>
</t-dialog>
pages/bookServices/detail/components/suggest/suggest.wxss
New file
@@ -0,0 +1,59 @@
/* pages/bookServices/detail/components/suggest/suggest.wxss */
.suggest-dialog {
  --td-dialog-close-color: #666
}
.t-class-content {
  height: 400px;
}
.wrapper {
  margin-bottom: 32rpx;
}
.placeholder {
  color: rgba(0, 0, 0, 0.26);
  line-height: 96rpx;
  height: 96rpx !important;
  display: flex;
  align-items: center;
}
.dialog-input {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  margin-top: 32rpx;
  border-radius: 8rpx;
  background-color: #f3f3f3;
  box-sizing: border-box;
}
.placeholder {
  color: rgba(0, 0, 0, 0.4);
  line-height: 96rpx;
}
.demo-rate {
  background-color: #fff;
  height: 96rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32rpx;
  border-bottom: solid 1rpx #f0f0f0;
  border-top: solid 1rpx #f0f0f0;
  margin-top: 32rpx;
  margin-bottom: 32rpx;
}
.demo-rate__title {
  width: 200rpx;
}
.demo-rate__transparent {
  background-color: transparent;
  padding-left: 32rpx;
  border: 0;
}
pages/bookServices/detail/components/teachResource/index.js
New file
@@ -0,0 +1,37 @@
Component({
  properties: {
    applyState: {
      type: String,
      value: 'none'
    },
    rejectCause: {
      type: String,
      value: ''
    }
  },
  data: {
    showRejectDialog: false,
    confirmBtn: { content: '知道了', variant: 'base' },
  },
  methods: {
    applyResource() {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {
        bubbles: true,
        composed: true,
        // capturePhase: true,
      } // è§¦å‘事件的选项
      this.triggerEvent('applyResource', myEventDetail, myEventOption)
    },
    showDialog() {
      this.setData({
        showRejectDialog: true
      })
    },
    closeDialog() {
      this.setData({
        showRejectDialog: false
      })
    }
  }
})
pages/bookServices/detail/components/teachResource/index.json
New file
@@ -0,0 +1,8 @@
{
  "component": true,
  "usingComponents": {
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button",
    "t-dialog": "tdesign-miniprogram/dialog/dialog"
  }
}
pages/bookServices/detail/components/teachResource/index.wxml
New file
@@ -0,0 +1,31 @@
<view class="teach-btn">
  <t-button theme="primary" style="width: 120px; height: 36px;" class="btn-upload">
    <t-image src="/static/images/bookService/detail/upload.png"></t-image>
    ä¸Šä¼ èµ„源
  </t-button>
  <t-button theme="primary" style="width: 120px; height: 36px;">
    <t-image src="/static/images/bookService/detail/download.png"></t-image>
    æ‰¹é‡ä¸‹è½½
  </t-button>
</view>
<view class="applyResult  {{applyState == 'none' ? 'applyNone' : applyState == 'Normal' ? 'applyPass' : applyState == 'WaitAudit' ? 'applying' :applyState == 'Reject' ? 'applyReject' :'' }}">
  <view wx:if="{{applyState == 'WaitAudit'}}">资源下载申请正在审核中,请耐心等待!</view>
  <view wx:if="{{applyState == 'Normal'}}">
    èµ„源下载申请已通过<text wx:if="{{deadline}}">,有效日期截至:{{ deadline }}</text>
  </view>
  <view wx:if="{{applyState == 'Reject'}}">资源下载需要申请,请先申请并等待审核通过后方可下载</view>
  <view wx:if="{{applyState == 'none'}}">
    èµ„源下载需要申请,请先申请并等待审核通过后方可下载
  </view>
  <view class="btn-box">
    <t-button wx:if="{{applyState == 'Reject'}}" bind:tap="checkCause" style="height: 50rpx;" class="rejectBtn" bind:tap="showDialog">查看原因</t-button>
    <t-button wx:if="{{applyState == 'none' || applyState == 'Reject'}}" theme="primary" bind:tap="applyResource" class="applyBtn" style="height: 50rpx;">申请</t-button>
  </view>
</view>
<!-- æœªé€šè¿‡åŽŸå›  -->
<t-dialog visible="{{showRejectDialog}}" title="提示" confirm-btn="{{ confirmBtn }}" bind:confirm="closeDialog">
  <view slot="content">
    <text class="cause-title">资源下载申请未通过,解决问题后可点击“申请”按钮重新提交申请</text>
    <view class="cause-content">原因:{{ rejectCause }}</view>
  </view>
</t-dialog>
pages/bookServices/detail/components/teachResource/index.wxss
New file
@@ -0,0 +1,77 @@
.teach-btn {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 134rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-color: #ff6c00;
}
.teach-btn image {
  width: 32rpx;
  height: 32rpx;
  margin-right: 6rpx;
}
.teach-btn .t-button__content {
  display: flex;
  align-items: center;
}
.applyResult {
  padding: 0 10rpx;
  width: 740rpx;
  height: 80rpx;
  display: flex;
  align-items: center;
  margin: 0 auto;
  font-size: 24rpx;
}
.applyNone {
  background-color: rgba(255, 108, 0, 0.06);
  color: #ff6C00;
}
.applyReject {
  background-color: rgba(238, 24, 24, 0.16);
  border: 1px solid #ee1818;
}
.applyPass {
  background-color: rgba(0, 128, 0, 0.16);
  border: 1px solid green;
}
.applying {
  background-color: #fff2e9;
  border: 1px solid #ff6c00;
}
.btn-box {
  display: flex;
}
.applyBtn {
  margin-left: 20rpx;
  width: 92rpx;
  height: 50rpx;
  --td-button-font-size: 24rpx;
  --td-button-border-radius: 10rpx;
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-text-active-bg-color: #000;
}
.rejectBtn {
  width: 150rpx;
}
.cause-title {
  color: #FF6C00;
}
.cause-content {
  line-height: 40rpx;
}
pages/bookServices/detail/components/tree/index.js
New file
@@ -0,0 +1,67 @@
import Message from 'tdesign-miniprogram/message/message';
const app = getApp()
Component({
  properties: {
    treeList: {
      type: Array,
      value: []
    },
    buyIds: {
      type: Array,
      value: []
    },
    tab: {
      type: String,
      value: ''
    },
    applyState: {
      type: String,
      value: ''
    }
  },
  data: {
    activeValues: [0]
  },
  onShow() {
  },
  methods: {
    // èŠ‚ç‚¹å±•å¼€
    handleChange(e) {
      this.setData({
        activeValues: e.detail.value,
      });
      console.log('传递', this.properties.buyIds);
    },
    handleCheck(data) {
      for (let index = 0; index < data.length; index++) {
        const element = data[index];
        element.checked = true
        if (element.childrenCount && element.type == "productFolder") {
          handleCheck(element.children)
        }
      }
    },
    downloadTeach(e) {
      console.log('点击了', e);
      const value = e.currentTarget.dataset.value
      var myEventDetail = {
        value,
      } // detail对象,提供给事件监听函数
      var myEventOption = {
        bubbles: true,
        composed: true
      } // è§¦å‘事件的选项
      this.triggerEvent('downloadTeach', myEventDetail, myEventOption)
    },
    // åˆ¤æ–­èµ„源是否购买
resourceIsBuy (data) {
  if (data.saleMethod && data.saleMethod.length) {
    const isSHow = buyIdList.value.some((item) => item == data.saleMethod[0].Id)
    return !isSHow
  } else {
    return false
  }
}
  }
})
pages/bookServices/detail/components/tree/index.json
New file
@@ -0,0 +1,12 @@
{
  "component": true,
  "usingComponents": {
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-image": "tdesign-miniprogram/image/image",
    "t-collapse": "tdesign-miniprogram/collapse/collapse",
    "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel",
    "t-button": "tdesign-miniprogram/button/button",
    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
    "tree": "/pages/bookServices/detail/components/tree/index"
  }
}
pages/bookServices/detail/components/tree/index.wxml
New file
@@ -0,0 +1,65 @@
<view class="tree">
  <t-collapse defaultValue="{{activeValues}}" bind:change="handleChange">
    <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{index}}" expandIcon>
      <view slot="header" class="header-title">
        <view>
          <t-checkbox icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" catch:change="checkResourceTitle" wx:if="{{tab == 'jsek_teachingResources'}}" />
        </view>
        <text>{{item.name}}</text>
      </view>
      <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex">
        <!-- // åˆ¤æ–­ æ— å­é¡¹ ä¸”为商品item ç›´æŽ¥æ˜¾ç¤º -->
        <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}">
          <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}">
            <view class="contentBox">
              <!-- æ•™å­¦èµ„源 äº‘学习 å›¾æ ‡ -->
              <view class="box-image">
                <view class="checkBox">
                  <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" bind:change="checkResource" data-item="{{citem}}" wx:if="{{tab == 'jsek_teachingResources'}}" />
                </view>
                <!-- æ•™å­¦èµ„源图标 -->
                <view class="teach-icon">
                  <t-image wx:if="{{citem.selectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" />
                  <t-image wx:if="{{citem.selectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" />
                  <t-image wx:if="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" />
                  <t-image wx:if="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" />
                  <t-image wx:if="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" />
                  <t-image wx:if="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" />
                  <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'doc' ||  citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" />
                  <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'xlsx' ||  citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" />
                  <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'ppt' ||  citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" />
                </view>
                <!-- äº‘学习图标 -->
                <view>
                </view>
                <!-- åç§° -->
                <text class="name">{{citem.name}}</text>
              </view>
              <!-- æ•™å­¦èµ„源类型 -->
              <view class="teachClass">
                {{citem.resourceClass}}
              </view>
              <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}">
                <!--  ä¸‹è½½æŒ‰é’® -->
                <t-image src="/static/images/bookService/detail/download-icon.png" width="16" height="16" class="download" data-value="{{citem}}" bind:tap="downloadTeach"></t-image>
              </view>
              <view wx:if="{{tab == 'jsek_cloudLearning'}}">
                <t-image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{citem.isuy }}"></t-image>
                <t-image src="/static/images/bookService/detail/need-buy.png" class="need-buy"></t-image>
              </view>
            </view>
          </view>
        </view>
        <!-- // åˆ¤æ–­ ä¸æ˜¯å•†å“ æœ‰å­é¡¹ é€’归组件 -->
        <tree wx:else treeList="{{[citem]}}" itemId="{{itemId}}"></tree>
      </view>
      <view class="listItems" wx:if="{{children.length <= 0 && !loading}}">
        æš‚无数据
      </view>
      <view class="loading" wx:if="{{loading}}">
        <t-loading theme="circular" size="40rpx" class="wrapper" />
      </view>
    </t-collapse-panel>
  </t-collapse>
</view>
pages/bookServices/detail/components/tree/index.wxss
New file
@@ -0,0 +1,61 @@
.tree {
  --td-collapse-content-padding: 32rpx 12rpx 32rpx 32rpx;
}
.header-title {
  display: flex;
  align-items: center;
  --td-checkbox-vertical-padding: 0
}
.t-class-content {
  padding: 0;
}
.contentBox {
  padding: 0 26rpx;
  height: 88rpx;
  background-color: #FFF6F0;
  margin-top: 24rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.contentBox .checkBox {
  --td-checkbox-vertical-padding: 0;
  --td-checkbox-bg-color: #FFF6F0;
}
.box-image {
  width: 350rpx;
  display: flex;
}
.box-image image {
  width: 44rpx;
  height: 44rpx;
  margin-right: 8rpx;
}
.contentBox .box-image .name {
  width: 300rpx;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teachClass {
  color: #949494;
}
.teach-btn {
  display: flex;
  align-items: center;
}
.testSee,
.need-buy {
  width: 38rpx;
  height: 38rpx;
}
pages/bookServices/detail/index.js
@@ -1,5 +1,5 @@
// pages/bookServices/detail/index.js
import Message from 'tdesign-miniprogram/message/index';
import Message from 'tdesign-miniprogram/message/index.js';
const app = getApp();
Page({
  /**
@@ -19,8 +19,30 @@
      dang: '',
      micro: '',
    },
    tabValue: 'brief',
    cmsDatas: [], // èµ„源refCode列表
    ids: [1],
    list: [],
    teachResources: [],
    teach: [],
    learn: [],
    openTeachids: [],
    openLearnids: [],
    resourceClassList: [], // èµ„源所属分类
    applyState: "",  // æ•™å­¦èµ„源申请状态
    deadline: "",  // æ•™å­¦èµ„源申请有效日期
    rejectCause: "",  // ä¸‹è½½æ‹’绝原因
    buyIdList: [],
    shoppingCartGetId: [], // å·²è´­ä¹°id列表
    shoppingList: []
  },
  resetTree: function (e) {
    this.setData({
      currentCheck: e.detail.checkedItem,
      list: e.detail.changeList
    })
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
@@ -39,42 +61,49 @@
      },
    });
    this.getBookInfo(options.id);
    this.getResourceClass() // èŽ·å–èµ„æºæ‰€å±žåˆ†ç±»
    this.getApplyInfo(options.id)
    if (wx.getAccountInfoSync('jsek-token')) {
      this.getShoppingCartProductGet()
    }
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {},
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {},
  onShow() { },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {},
  onHide() { },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {},
  onUnload() { },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},
  onPullDownRefresh() { },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {},
  onReachBottom() { },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {},
  onShareAppMessage() { },
  // æ ¼å¼åŒ–日期
  formatDate(dateString) {
    if (!dateString) {
@@ -169,8 +198,9 @@
    app.MG.store.getProductDetail(query).then((res) => {
      this.setData({
        bookDetail: res.datas,
        cmsDatas: res.datas.cmsDatas[0].datas,
        buyIdList: res.datas.purchasedSaleMethodIdList
      });
      console.log('详情', res.datas);
      // èŽ·å–å›¾ä¹¦åˆ†ç±»
      const iconType = JSON.parse(res.datas.bookClassification)[0][0];
      const classType = JSON.parse(res.datas.bookClassification)[0][1];
@@ -211,12 +241,14 @@
          linkType: 'FavoriteBookCity',
        })
        .then(() => {
          this.data.bookDetail.isFavourite = false;
          this.setData({
            'bookDetail.isFavourite': false
          })
          Message.success({
            context: this,
            offset: ['20rpx', '32rpx'],
            duration: 2000,
            content: '取消收藏',
            offset: [20, 32],
            duration: 5000,
            content: '这是一条成功的提示消息',
          });
        });
    } else {
@@ -225,8 +257,9 @@
        linkType: 'FavoriteBookCity',
      };
      app.MG.store.addProductLink(params).then((res) => {
        console.log(res);
        this.data.bookDetail.isFavourite = true;
        this.setData({
          'bookDetail.isFavourite': true
        })
        Message.success({
          context: this,
          offset: ['20rpx', '32rpx'],
@@ -236,6 +269,11 @@
      });
    }
  },
  // æˆ‘要建议
  suggestBtn() {
    const child = this.selectComponent('#suggest-component')
    child.showDialog()
  },
  // è·³è½¬ç½‘店
  goShop(e) {
    const { link } = e.currentTarget.dataset;
@@ -243,4 +281,486 @@
      url: link,
    });
  },
});
  onTabsChange(e) {
    this.setData({
      tabValue: e.detail.value
    })
    if (e.detail.label == '教学资源' || e.detail.label == '云学习' || e.detail.label == '云测试') {
      const checkData = this.data.cmsDatas.find(item => item.refCode == e.detail.value)
      if (checkData) {
        if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length)
          || (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length)
          || (e.detail.value == 'questionBank' && !this.data.test.length)) {
          this.getResourceData(checkData)
        }
      }
    }
    console.log('切换', this.data.tabValue);
  },
  // èŽ·å–èµ„æºæ‰€å±žåˆ†ç±»
  getResourceClass() {
    let query = {
      refCodes: ['resourcesClassification']
    }
    app.MG.store.getProductTypeField(query).then((res) => {
      this.setData({
        resourceClassList: JSON.parse(res[0].config).option
      })
    })
  },
  //  èŽ·å–æ•™å­¦èµ„æº  äº‘学习  äº‘测试
  getResourceData(type) {
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookDetail.id,
      cmsPath: type.productLinkPath,
      itemFields: {
        SysType: 'CmsFolder',
        // èµ„源类型,试读文件,是否允许下载等参数
        selectType: [],
        freeFile: [],
        file: [],
        resourcesClassification: [],
        isDownload: [],
        jsek_resourceBrief: [],
        jsek_link: [],
        jsek_questionBank: []
      },
      pading: {
        start: 0,
        size: 999
      },
    }
    app.MG.store
      .getProductDetail(query)
      .then(async (res) => {
        // äº‘测试,递归请求里层数据
        if (type.refCode == 'questionBank') {
          const data = res.datas.cmsDatas[0].datas.filter(
            (item) => item.refCode == 'jsek_questionBank'
          )
          if (data.length) return getResourceData(data[0])
        }
        //教学资源 äº‘学习
        if (type.refCode == 'jsek_teachingResources' || type.refCode == 'jsek_cloudLearning') {
          if (res.datas.cmsDatas[0].datas.length > 0) {
            if (type.refCode == 'jsek_teachingResources') {
              res.datas.cmsDatas[0].datas.forEach(item => {
                item.checked = false
              })
              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              this.setData({
                teachResources: list,
                teach: list
              })
              this.findChildIds(this.data.teachResources, this.data.openTeachids = [])
            } else if (type.refCode == 'jsek_cloudLearning') {
              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              this.setData({
                learn: list
              })
              console.log('云学习', this.data.learn);
              this.findChildIds(this.data.teachResources, this.data.openLearnids = [])
            }
          } else {
            // æ— æ•°æ®
          }
        } else if (type.refCode == 'jsek_questionBank') {
          console.log('云测试');
        } else {
          console.log('其他');
        }
      })
      .catch((e) => {
        console.log(e)
      })
    console.log('信息', this.data);
  },
  // èŽ·å–tag下所有资源
  async getAllResource(data) {
    if (!data.length) return false
    for (let i = 0; i < data.length; i++) {
      let item = data[i]
      if (item.sysType == 'CmsFolder' && item.childrenCount > 0) {
        item.children = []
        item.children = await this.getFolderItem(item.productLinkPath)
        await this.getAllResource(item.children)
      }
    }
    return data
  },
  // èŽ·å–èµ„æºæŽ¥å£
  async getFolderItem(path) {
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookDetail.id,
      cmsPath: path,
      itemFields: {
        SysType: 'CmsFolder',
        // èµ„源类型,试读文件,是否允许下载等参数
        selectType: [],
        freeFile: [],
        file: [],
        protectedFile: [],
        resourcesClassification: [],
        isDownload: [],
        jsek_resourceBrief: [],
        jsek_link: [],
        accessType: []
      },
      pading: {
        start: 0,
        size: 999
      },
    }
    const data = await app.MG.store.getProductDetail(query)
    data.datas.cmsDatas[0].datas.forEach((item) => {
      this.data.resourceClassList.forEach((type) => {
        if (type.value == item.resourcesClassification) item.resourceClass = type.name
      })
      // ç½‘页 ä¸èƒ½ä¸‹è½½ ç§æœ‰æ–‡ä»¶
      if (item.sysType == 'CmsItem') {
        if (item.selectType == 'webpage') {
          item.disabled = true
        } else {
          if (item.isDownload != 1) {
            item.disabled = true
          }
        }
        if (item.file) {
          if (item.fileMap[item.file].protectType == 'Private') item.disabled = true
        }
      }
    })
    data.datas.cmsDatas[0].datas.forEach(item => {
      if (this.data.tabValue == 'jsek_teachingResources') {
        item.checked = false
      } else if (this.data.tabValue == 'jsek_cloudLearning') {
        item.isbuy = this.resourceIsBuy(item)
        item.isShopCar = this.isShoppingCart(item)
      }
    })
    return data.datas.cmsDatas[0].datas
  },
  // èŽ·å–å±•å¼€é¡¹
  findChildIds(data, result) {
    let index = 0
    for (let i = 0; i < data.length; i++) {
      if (index < 3) {
        const item = data[i]
        if (item.childrenFolderCount > 0) {
          result.push(item.id)
          for (let j = 0; j < item.children.length; j++) {
            if (index < 3) {
              const childrenItme = item.children[j]
              if (item.childrenCount > 0) {
                result.push(childrenItme.id)
                index += 1
              }
            } else {
              break
            }
          }
        } else if (item.childrenCount > 0) {
          result.push(item.id)
          index += 1
        }
      } else {
        break
      }
    }
  },
  // å›¾ä¹¦æ·»åŠ è´­ç‰©è½¦
  addBookShopcCar() {
    let query = {
      requests: [
        {
          saleMethodId: this.data.bookDetail.defaultSaleMethodId,
          storeEventId: null,
          agentCode: '电子书'
        }
      ]
    }
    const addRes = app.MG.store.addShoppingCart(query)
  },
  // èŽ·å–æ•™å­¦èµ„æºä¸‹è½½æ˜¯å¦ç”³è¯·é€šè¿‡
  getApplyInfo(id) {
    // èŽ·å–å½“å‰æ—¶é—´
    const currentDate = new Date()
    let query = {
      sort: {
        type: 'Desc',
        field: 'CreateDate'
      },
      start: 0,
      size: 99999,
      appRefCode: app.config.appRefCode,
      topicIdOrRefCode: 'productDownLoad'
    }
    app.MG.ugc.getTopicMessageList(query).then((res) => {
      const applyResource = res.datas.find((item) => {
        let content = []
        try {
          content = JSON.parse(item.content)
        } catch (error) {
          content = []
        }
        if (Array.isArray(content)) return content.find((citem) => citem.id == id)
        return false
      })
      // æœ‰ç”³è¯·è®°å½•
      if (applyResource) {
        if (applyResource.state == 'Reject') {
          this.setData({
            rejectCause: JSON.parse(applyResource.feedBack).reason,
            applyState: 'Reject'
          })
        } else if (applyResource.state == 'Normal') {
          const endDate = JSON.parse(applyResource.feedBack).endDate
          // const endDate = new Date(JSON.parse(applyResource.feedBack).endDate + ' 23:59:59').getTime()
          if (endDate == '永久') {
            // deadline.value = '永久'
            this.setData({
              applyState: 'Normal',
              deadline: '永久',
            })
          } else {
            let endTime = new Date(endDate + ' 23:59:59').getTime()
            // deadline.value = endDate + ' 23:59:59'
            this.setData({
              deadline: endDate + ' 23:59:59'
            })
            if (currentDate.getTime() < endTime) {
              // æœªè¶…æ—¶
              this.setData({
                applyState: 'Normal'
              })
            } else {
              this.setData({
                applyState: 'none'
              })
            }
          }
        } else {
          this.setData({
            applyState: applyResource.state
          })
        }
      } else {
        this.setData({
          applyState: 'none'
        })
      }
      console.log('申请通过', this.data.applyState);
    })
  },
  // ç”³è¯·æ•™å­¦èµ„源
  applyResource() {
    // let role = userStore.userInfo ? userStore.userInfo.role : null
    // if (role) {
    //   if (role == 'Teacher') {
    // ç”³è¯·æ•™å­¦èµ„源
    let query = {
      topicIdOrRefCode: 'productDownLoad',
      type: 'applyForDownload',
      state: 'WaitAudit',
      cmsTypeRefCode: '',
      newDataListRequest: [],
      name: this.data.bookDetail.name, // name为申请的书本名称
      content: JSON.stringify([
        {
          name: this.data.bookDetail.name,
          id: this.data.bookDetail.id,
          // defaultSaleMethodId: bookData.value.defaultSaleMethodId,
          icon: this.data.bookDetail.icon
        }
      ])
    }
    app.MG.ugc.newTopicMessage(query).then((res) => {
      if (res) {
        Message.success('申请已提交,请待审核通过后下载')
      }
      this.getApplyInfo(this.data.bookDetail.id)
    })
    //   } else {
    //     ElMessageBox.confirm('请先进行教师认证!', '尊敬的用户,您好!', {
    //       confirmButtonText: '去认证',
    //       cancelButtonText: '取消',
    //       type: 'warning'
    //     })
    //       .then(() => {
    //         isShow.value = true
    //       })
    //       .catch(() => { })
    //   }
    // } else {
    //   // logIn()
    // }
  },
  downloadTeach(e) {
    const data = e.detail.value
    // const data
    // let role = userStore.userInfo ? userStore.userInfo.role : null
    // if (role) {
    //   if (role == 'Teacher') {
    if (this.properties.applyState == 'Normal' || this.properties.applyState == 'none') {
      // æ˜¯å¦å…è®¸ä¸‹è½½
      if (data.isDownload == 1) {
        // ç”³è¯·é€šè¿‡
        let url = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5='
        if (data.file) {
          // åˆ¤æ–­æ˜¯å¦ç§æœ‰
          if (data.fileMap[data.file].protectType == 'Private')
            return Message.error({
              context: this,
              offset: ['20rpx', '32rpx'],
              duration: 5000,
              content: '该文件无法下载'
            })
          url = url + data.file + '&token=' + wx.getStorageSync('jsek-token')
        } else if (data.freeFile) {
          url = url + data.freeFile + '&token=' + wx.getStorageSync('jsek-token')
        } else {
          Message.error({
            context: this,
            offset: ['20rpx', '32rpx'],
            duration: 5000,
            content: '暂无资源',
          })
        }
        this.downloadFile(url)
      } else {
        Message.error({
          context: this,
          offset: ['20rpx', '32rpx'],
          duration: 5000,
          content: '该资源无法下载',
        })
      }
    } else if (this.properties.applyState == 'WaitAudit') {
      // ElMessageBox.confirm('请先申请下载!', '尊敬的用户,您好!', {
      //   confirmButtonText: '申请',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // })
      //   .then(() => applyBookInfo())
      //   .catch()
      Message.error({
        context: this,
        offset: ['20rpx', '32rpx'],
        duration: 5000,
        content: '该资源下载申请审核中',
      })
    } else if (this.properties.applyState == 'Reject') {
      Message.error({
        context: this,
        offset: ['20rpx', '32rpx'],
        duration: 5000,
        content: '资源下载申请未通过'
      })
    } else {
      // Message.error({
      //   context: this,
      //   offset: ['20rpx', '32rpx'],
      //   duration: 5000,
      //   content: '请先申请下载'
      // })
      console.log('请先申请下载');
    }
    //   } else {
    //     ElMessageBox.confirm('请先进行教师认证!', '尊敬的用户,您好!', {
    //       confirmButtonText: '去认证',
    //       cancelButtonText: '取消',
    //       type: 'warning'
    //     })
    //       .then(() => {
    //         isShow.value = true
    //       })
    //       .catch(() => { })
    //   }
    // } else {
    //   logIn()
    // }
  },
  downloadFile(url) {
    wx.downloadFile({
      url: url,
      success: function (res) {
        // ä¸‹è½½æˆåŠŸåŽï¼Œè°ƒç”¨saveImageToPhotosAlbum函数保存图片到本地
        wx.saveFile({
          tempFilePath: res.tempFilePath,
          success: function (res) {
            wx.showToast({
              title: '下载成功',
              icon: 'success'
            })
          },
          fail: function (res) {
            wx.showToast({
              title: '下载失败',
              icon: 'none'
            })
          }
        })
      },
      fail: function (res) {
        wx.showToast({
          title: '下载失败',
          icon: 'none'
        })
      }
    })
  },
  // åˆ¤æ–­èµ„源是否购买
  resourceIsBuy(data) {
    if (data.saleMethod && data.saleMethod.length) {
      const isSHow = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id)
      return !isSHow
    } else {
      return false
    }
  },
  getShoppingCartProductGet() {
    let query = {
      start: 0,
      size: 999,
      filterList: [],
      searchList: []
    }
    app.MG.store.getShoppingCartProductList(query).then((res) => {
      const list = []
      res.datas.forEach((item) => {
        list.push(item.saleMethod.id)
      })
      this.setData({
        shoppingList: res.datas,
        shoppingCartGetId: list
      })
      console.log('è´­ä¹°', this.data);
    })
  },
  // åˆ¤æ–­èµ„源加入购物车按钮是否显示
  isShoppingCart(data) {
    if (data.saleMethod && data.saleMethod.length) {
      if (data.saleMethod[0].Price <= 0) return false
      // å†åˆ¤æ–­æ˜¯å¦è´­ä¹°
      const isBuy = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id)
      if (isBuy) {
        // è´­ä¹°äº†
        return false
      } else {
        // åˆ¤æ–­æ˜¯å¦åŠ å…¥è´­ç‰©è½¦
        const isSHow = this.data.shoppingCartGetId.some((item) => item == data.saleMethod[0].Id)
        return !isSHow
      }
    } else {
      return false
    }
  }
})
pages/bookServices/detail/index.json
@@ -4,7 +4,14 @@
    "t-image": "tdesign-miniprogram/image/image",
    "t-tabs": "tdesign-miniprogram/tabs/tabs",
    "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
    "book-brief": "/pages/bookServices/detail/components/brief/index"
    "t-button": "tdesign-miniprogram/button/button",
    "t-message": "tdesign-miniprogram/message/message",
    "book-brief": "/pages/bookServices/detail/components/brief/index",
    "teach-resource": "/pages/bookServices/detail/components/teachResource/index",
    "learn-resource": "/pages/bookServices/detail/components/learnResource/learnResource",
    "tree": "/pages/bookServices/detail/components/tree/index",
    "suggest": "/pages/bookServices/detail/components/suggest/suggest",
    "t-loading": "tdesign-miniprogram/loading/loading"
  },
  "navigationStyle": "custom"
}
}
pages/bookServices/detail/index.wxml
@@ -13,33 +13,21 @@
    <view class="book-detail">
      <view class="detail-left">
        <view class="book-img">
          <t-image
            src="{{bookDetail.icon}}"
            mode="aspectFill"
            width="120"
            height="170"
            aria-label="{{bookDetail.name}}"
          />
          <t-image src="{{bookDetail.icon}}" mode="aspectFill" width="120" height="170" aria-label="{{bookDetail.name}}" />
        </view>
        <view class="book-use">
          <view class="collect" bind:tap="setCollect">
            <view>
              <t-image
                src="/static/images/bookService/detail/collect.png"
                wx:if="{{!bookDetail.isFavourite}}"
              ></t-image>
              <t-image
                src="/static/images/bookService/detail/collecting.png"
                wx:if="{{bookDetail.isFavourite}}"
              ></t-image>
              <t-image src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}"></t-image>
              <t-image src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}"></t-image>
            </view>
            <view>收藏</view>
            <view class="use-title">收藏</view>
          </view>
          <view class="suggest">
          <view class="suggest" bind:tap="suggestBtn">
            <view>
              <t-image src="/static/images/bookService/detail/suggest.png"></t-image>
            </view>
            <view>我要建议</view>
            <view class="use-title">我要建议</view>
          </view>
        </view>
      </view>
@@ -78,8 +66,9 @@
            <t-image src="/static/images/bookService/detail/electon-price.png"></t-image>
          </view>
          <view class="price">
            <view>Â¥{{bookDetail.price}}</view>
            <view class="price-old">Â¥{{bookDetail.oldPrice}} <view class="line"></view> </view>
            <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="line"></view>
            </view>
          </view>
          <view> </view>
        </view>
@@ -88,58 +77,35 @@
          <view>
            <t-image src="/static/images/bookService/detail/paper-price.png"></t-image>
          </view>
          <view class="price">Â¥{{bookDetail.paperPrice}}</view>
          <view class="price">Â¥{{bookDetail.paperPrice == '0.00' ? '免费' : bookDetail.paperPrice}}</view>
        </view>
      </view>
      <!-- ç½‘店 -->
      <view class="book-web">
        <t-image
          src="/static/images/bookService/detail/jd.png"
          wx:if="{{bookDetail.JDLink}}"
          bind:tap="goShop"
          data-link="{{bookDetail.tmallLink}}"
          data-type="jd"
        ></t-image>
        <t-image
          src="/static/images/bookService/detail/tmall.png"
          width="32"
          height="22"
          bind:tap="goShop"
          data-link="{{bookDetail.tmallLink}}"
          wx:if="{{bookDetail.tmallLink}}"
        ></t-image>
        <t-image
          src="/static/images/bookService/detail/dangdang.png"
          bind:tap="goShop"
          data-link="{{bookDetail.dangdangLink}}"
          wx:if="{{bookDetail.dangdangLink}}"
        ></t-image>
        <t-image
          src="/static/images/bookService/detail/jd.png"
          bind:tap="goShop"
          data-link="{{bookDetail.weidianLink}}"
          wx:if="{{bookDetail.weidianLink}}"
        ></t-image>
        <t-image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" data-type="jd"></t-image>
        <t-image src="/static/images/bookService/detail/tmall.png" width="32" height="22" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}"></t-image>
        <t-image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}"></t-image>
        <t-image src="/static/images/bookService/detail/jd.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}"></t-image>
      </view>
    </view>
  </view>
  <view class="book-resource">
    <t-tabs
      defaultValue="{{0}}"
      bind:change="onTabsChange"
      bind:click="onTabsClick"
      t-class="custom-tabs"
      t-class-content="custom-panel"
    >
      <t-tab-panel label="图书简介" value="0" style="{{tabPanelstyle}}">
        <book-brief
          content="{{bookDetail.content}}"
          authorIntroduction="{{bookDetail.authorIntroduction}}"
        ></book-brief>
    <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class">
      <t-tab-panel label="图书简介" value="brief" style="{{tabPanelstyle}}">
        <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}"></book-brief>
      </t-tab-panel>
      <t-tab-panel label="电子书" value="1" style="{{tabPanelstyle}}">选项二内容</t-tab-panel>
      <t-tab-panel label="云学习" value="2" style="{{tabPanelstyle}}">选项三内容</t-tab-panel>
      <t-tab-panel label="云测试" value="3" style="{{tabPanelstyle}}">选项四内容</t-tab-panel>
      <t-tab-panel label="电子书" value="1" style="{{tabPanelstyle}}">
        ç”µå­ä¹¦
      </t-tab-panel>
      <t-tab-panel label="教学资源" value="jsek_teachingResources">
        <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" bind:applyResource="applyResource"></teach-resource>
        <tree treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach"></tree>
      </t-tab-panel>
      <t-tab-panel label="云学习" value="jsek_cloudLearning" style="{{tabPanelstyle}}">
        <learn-resource></learn-resource>
        <tree tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}"></tree>
      </t-tab-panel>
      <t-tab-panel label="云测试" value="questionBank" style="{{tabPanelstyle}}">选项四内容</t-tab-panel>
    </t-tabs>
  </view>
  <!-- è´­ä¹°æŒ‰é’® -->
@@ -148,15 +114,17 @@
      <view>
        <t-image src="/static/images/bookService/detail/ebook.png"></t-image>
      </view>
      <view>电子样书申请</view>
      <view class="btn-text">电子样书申请</view>
    </view>
    <view class="bottom-btn">
      <view>
        <t-image src="/static/images/bookService/detail/paper-book.png"></t-image>
      </view>
      <view>纸质样书申请</view>
      <view class="btn-text">纸质样书申请</view>
    </view>
    <view class="shopCar">加入购物车</view>
    <view class="shopCar" bind:tap="addBookShopcCar">加入购物车</view>
    <view class="buy">立即购买</view>
  </view>
</scroll-view>
<!-- æˆ‘要建议弹窗 -->
<suggest class="suggest-component" id="suggest-component"></suggest>
pages/bookServices/detail/index.wxss
@@ -43,7 +43,6 @@
}
.message-li {
  font-size: 28rpx;
  color: #333333;
  display: flex;
  height: 40rpx;
@@ -52,14 +51,26 @@
.li-title {
  width: 140rpx;
  font-size: 28rpx;
}
.li-content {
  width: 280rpx;
  font-size: 28rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-use {
  margin-top: 16rpx;
  display: flex;
  justify-content: space-evenly;
  font-size: 24rpx;
  color: #949494;
}
.use-title {
  font-size: 24rpx;
}
.collect,
@@ -120,6 +131,10 @@
  color: #fff;
}
.price-text {
  font-size: 34rpx;
}
.price-old {
  margin-left: 10rpx;
  position: relative;
@@ -152,13 +167,16 @@
/* å›¾ä¹¦èµ„源 */
.book-resource {
  min-height: 640rpx;
  margin-top: 20rpx;
  background-color: #fff !important;
}
.custom-tabs {
  --td-tab-item-active-color: #FF6C00
  --td-tab-item-active-color: #FF6C00;
  --td-tab-font-size: 28rpx;
}
/* åº•部 */
.box-bottom {
@@ -167,7 +185,6 @@
  bottom: 40rpx;
  width: 100%;
  height: 110rpx;
}
.box-bottom {
@@ -187,9 +204,12 @@
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-sizing: border-box;
}
.btn-text {
  font-size: 24rpx;
  color: #010101;
  box-sizing: border-box;
}
.bottom-btn image {
@@ -215,4 +235,8 @@
.buy {
  background-color: #F14B3B;
}
.tab-box {
  min-height: 550rpx;
}
pages/bookServices/list/index.js
@@ -39,6 +39,10 @@
    stairCode: '', // ä¸€çº§åˆ†ç±»é€‰ä¸­é¡¹
    secondCode: '', // äºŒçº§åˆ†ç±»é€‰ä¸­é¡¹
    sort: '', // æŽ’序
    enable: false,
    loadingProps: {
      size: '50rpx',
    },
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
@@ -74,10 +78,20 @@
      this.setData({
        'stairList.value': options.stairCode,
        stairCode: options.stairCode,
        secondCode: options.secondCode,
        'secondList.value': options.secondCode,
        path: `${options.assortCode}\\${options.stairCode}`,
      });
    }
    // äºŒçº§åˆ†ç±»èµ‹å€¼
    if (options.secondCode) {
      this.setData({
        secondCode: options.secondCode,
        pathList: [{
          Path: options.secondCode,
          Type: '*',
          StoreRefCode: app.config.goodsStore,
        }
        ],
      })
    }
    // èŽ·å–äºŒçº§åˆ†ç±»
    this.getSecondList(`${options.assortCode}\\${options.stairCode}`);
@@ -90,37 +104,43 @@
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {},
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {},
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {},
  onHide() { },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {},
  onUnload() { },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},
  onPullDownRefresh() {
    console.log('下拉');
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {},
  onReachBottom(e) {
    console.log('底部');
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {},
  onShareAppMessage() { },
  goBack() {
    wx.navigateBack();
  },
@@ -179,8 +199,11 @@
      }
      this.setData({
        'secondList.options': options,
        'secondList.value': this.data.secondCode,
      });
      const second = [this.data.secondCode]
      this.setData({
        'secondList.value': second
      })
    });
  },
  // èŽ·å–é‡ç‚¹é¡¹ç›®
@@ -290,6 +313,7 @@
    app.MG.store.getProductList(query).then((res) => {
      this.setData({
        bookList: res.datas,
        enable: false
      });
    });
  },
@@ -299,6 +323,7 @@
      ? `${this.data.assortCheck.code}\\${e.detail.value}`
      : this.data.assortCheck.code;
    this.setData({
      pathList: [],
      stairCode: e.detail.value,
      secondCode: '',
      path: path,
@@ -309,7 +334,6 @@
  },
  // äºŒçº§åˆ†ç±»åˆ‡æ¢
  onChangeSecond(e) {
    console.log(e);
    const pathList = [];
    for (let index = 0; index < e.detail.value.length; index++) {
      const element = e.detail.value[index];
@@ -323,6 +347,10 @@
      pathList: pathList,
      'secondList.value': e.detail.value,
    });
  },
  //
  onConfirmSecond() {
    this.getBookList(this.data.path);
  },
  // é‡ç‚¹é¡¹ç›®æ”¹å˜
@@ -394,4 +422,8 @@
      url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`,
    });
  },
  onRefresh() {
    this.setData({ enable: true });
    this.getBookList(this.data.path)
  },
});
pages/bookServices/list/index.json
@@ -4,7 +4,9 @@
    "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item",
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-image": "tdesign-miniprogram/image/image",
    "t-search": "tdesign-miniprogram/search/search"
    "t-search": "tdesign-miniprogram/search/search",
    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh"
  },
  "navigationStyle": "custom"
}
  "navigationStyle": "custom",
  "onReachBottomDistance": 250
}
pages/bookServices/list/index.wxml
@@ -5,14 +5,7 @@
  <view>
    <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
  </view>
  <t-search
    model:value="{{searchValue}}"
    shape="round"
    placeholder="请输入关键词/书名/ISBN/作者"
    class="navBar-search"
    style="width: 464rpx"
    bind:submit="searchBook"
  />
  <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" />
</view>
<view class="bookServices-list">
@@ -20,32 +13,9 @@
    <scroll-view scroll-x="{{true}}" class="header-scroll">
      <t-dropdown-menu>
        <t-dropdown-item options="{{stairList.options}}" value="{{stairList.value}}" bindchange="onChangeStair" />
        <t-dropdown-item
          label="二级"
          options="{{secondList.options}}"
          optionsColumns="2"
          multiple
          defaultValue="{{secondList.value}}"
          bind:confirm="onChangeSecond"
        />
        <t-dropdown-item
          label="重点项目"
          options="{{majorProjectList.options}}"
          optionsColumns="2"
          multiple
          defaultValue="{{majorProjectList.value}}"
          bind:confirm="changeMajorProject"
          bind:reset="resetMajorProject"
        />
        <t-dropdown-item
          label="新形态教材"
          options="{{newTextBook.options}}"
          optionsColumns="2"
          multiple
          defaultValue="{{newTextBook.value}}"
          bind:confirm="changeNewText"
          bind:reset="resetNewText"
        />
        <t-dropdown-item label="二级" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" />
        <t-dropdown-item label="重点项目" options="{{majorProjectList.options}}" optionsColumns="2" multiple defaultValue="{{majorProjectList.value}}" bind:confirm="changeMajorProject" bind:reset="resetMajorProject" />
        <t-dropdown-item label="新形态教材" options="{{newTextBook.options}}" optionsColumns="2" multiple defaultValue="{{newTextBook.value}}" bind:confirm="changeNewText" bind:reset="resetNewText" />
      </t-dropdown-menu>
    </scroll-view>
    <view class="header-sort" bind:tap="sortClick">
@@ -56,19 +26,21 @@
      </view>
    </view>
  </view>
  <scroll-view scroll-y="{{true}}" class="list-container">
    <view class="assort-title">
      <view class="title-box"></view>
      <view class="title-name">{{assortCheck.name}}</view>
    </view>
    <view class="book-list">
      <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}">
        <view class="book-img">
          <t-image src="{{item.icon}}" width="105" height="145" aria-label="{item.name{}}" />
        </view>
        <view class="book-name book-color">{{ item.name}}</view>
        <view class="book-author book-color">{{item.author}}</view>
  <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onRefresh">
    <scroll-view scroll-y="{{true}}" class="list-container">
      <view class="assort-title">
        <view class="title-box"></view>
        <view class="title-name">{{assortCheck.name}}</view>
      </view>
    </view>
  </scroll-view>
</view>
      <view class="book-list">
        <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}">
          <view class="book-img">
            <t-image src="{{item.icon}}" width="105" height="145" aria-label="{item.name{}}" />
          </view>
          <view class="book-name book-color">{{ item.name}}</view>
          <view class="book-author book-color">{{item.author}}</view>
        </view>
      </view>
    </scroll-view>
  </t-pull-down-refresh>
</view>
static/images/bookService/detail/PPT.png
static/images/bookService/detail/audioIcon.png
static/images/bookService/detail/download-icon.png
static/images/bookService/detail/download.png
static/images/bookService/detail/excel.png
static/images/bookService/detail/need-buy.png
static/images/bookService/detail/net.png
static/images/bookService/detail/pdf.png
static/images/bookService/detail/picture.png
static/images/bookService/detail/renwudan£¯icon.png
static/images/bookService/detail/shikan.png
static/images/bookService/detail/upload.png
static/images/bookService/detail/video.png
static/images/bookService/detail/word.png
static/images/bookService/detail/yijiangoumai.png
static/images/bookService/detail/yijianlingqu.png
static/images/bookService/detail/zip.png