litian
2024-03-12 b125d3ea74d61fb8e4d7238c83906aeea52c6b4c
更新代码
35个文件已修改
3个文件已删除
63个文件已添加
1 文件已重命名
3937 ■■■■ 已修改文件
.prettierrc 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/settings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionDetails/index.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionDetails/index.json 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionDetails/index.wxml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionDetails/index.wxss 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionList/index.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionList/index.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionList/index.wxml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookExhibitionList/index.wxss 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.js 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.wxml 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.wxss 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/learnResource/learnResource.wxss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/note/note.js 317 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/note/note.json 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/note/note.wxml 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/note/note.wxss 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.js 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.wxml 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/suggest/suggest.wxss 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.wxml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/teachResource/index.wxss 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/testResource/testResource.js 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/testResource/testResource.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/testResource/testResource.wxml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/testResource/testResource.wxss 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.js 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.wxml 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/components/tree/index.wxss 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.js 379 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.json 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.wxml 195 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/detail/index.wxss 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/examination.js 339 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/examination.json 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/examination.wxml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/examination.wxss 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionList/index.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionList/index.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionList/index.wxml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionList/index.wxss 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionOptions/index.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionOptions/index.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionOptions/index.wxml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionOptions/index.wxss 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionSchedule/index.js 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionSchedule/index.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionSchedule/index.wxml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/examination/questionSchedule/index.wxss 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.wxml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/list/index.wxss 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/paymentPage/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/document/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/document/index.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/document/index.wxml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/document/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/index.js 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/index.wxml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/index.wxss 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myAudio/index.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myAudio/index.json 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myAudio/index.wxml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myAudio/index.wxss 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myVideo/index.js 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myVideo/index.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myVideo/index.wxml 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/resourceDetails/myVideo/index.wxss 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/retrievalPage/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/cart.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/compliceHover.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/cuoti.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/deleteHover.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/edit.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/feedback.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/lianxi-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/makeNote.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/note-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/practice-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/test-icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/wodeshoucang.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/detail/zujuan.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/examination/collect.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/examination/questionCard.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/examination/reset.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bookService/examination/setting.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetails/jibijii.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetails/jibijiicon2.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetails/jibijiicon3.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/Full screen.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/cd.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/jibiji/icon.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/shangyizhang.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/video-bg.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/xiayizhang.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/resourceDetailsMyAudio/zanting.png 补丁 | 查看 | 原始文档 | blame | 历史
.prettierrc
New file
@@ -0,0 +1,22 @@
{
  "overrides": [
    {
      "files": "*.wxml",
      "options": {
        "parser": "html"
      }
    },
    {
      "files": "*.wxss",
      "options": {
        "parser": "css"
      }
    },
    {
      "files": "*.wxs",
      "options": {
        "parser": "babel"
      }
    }
  ]
}
.vscode/settings.json
@@ -32,7 +32,7 @@
  },
  "editor.tabSize": 2,
  "[wxml]": {
    "editor.defaultFormatter": "wechat.miniprogram.wxml-language-features"
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[css]": {
    "editor.defaultFormatter": "HookyQR.beautify"
app.json
@@ -1,7 +1,13 @@
{
  "pages": [
<<<<<<< HEAD
    "pages/home/home",
    "pages/resourceDetails/index",
=======
    "pages/resourceDetails/myAudio/index",
    "pages/resourceDetails/myVideo/index",
    "pages/resourceDetails/document/index",
>>>>>>> master
    "pages/retrievalPage/index",
    "pages/cart/paymentPage/index",
    "pages/cart/index",
@@ -54,7 +60,8 @@
    "pages/personalCenter/sampleBooks/index",
    "pages/personalCenter/downloads/index",
    "pages/personalCenter/activateProduct/index",
    "pages/testLogin/index"
    "pages/testLogin/index",
    "pages/bookServices/examination/examination"
  ],
  "tabBar": {
    "custom": true,
pages/bookExhibitionDetails/index.js
@@ -11,13 +11,29 @@
    bookCreator: '',
    bookContent: '',
    bookImage: '',
    bookExhibitionList: []
    bookExhibitionList: [],
    navBarHeight: '',
    barHeight: '',
    bookName: ''
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // èƒ¶å›Šä¿¡æ¯
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // å¯¼èˆªæ é«˜åº¦
    this.setData({
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
    })
    console.log();
    this.setData({
      bookName: options.bookName
    })
    const passId = options.id
@@ -131,6 +147,9 @@
    // wx.navigateTo({
    //   url: '/pages/bookExhibitionDetails/index?id?name=' + item.id + item.name // å‡è®¾è·³è½¬åˆ°è¯¦æƒ…页面,并传递了id参数
    // });
  }
  },
  goBack() {
    wx.navigateBack();
  },
})
pages/bookExhibitionDetails/index.json
@@ -1,3 +1,6 @@
{
  "usingComponents": {}
  "usingComponents": {
    "t-icon": "tdesign-miniprogram/icon/icon"
  },
  "navigationStyle": "custom"
}
pages/bookExhibitionDetails/index.wxml
@@ -1,5 +1,11 @@
<!--pages/bookExhibitionDetails/index.wxml-->
<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" />
  </view>
  <view class="navbar-title">{{bookName}}</view>
</view>
<view class="headBox">
  <text class="titleBox">{{bookName}}</text>
pages/bookExhibitionDetails/index.wxss
@@ -1,6 +1,23 @@
/* pages/bookExhibitionDetails/index.wxss */
.headBox {}
.nacigationBar {
  background-color: #fff;
  display: flex;
  align-items: center;
}
.navbar-title {
  white-space: nowrap;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 5rpx;
}
.titleBox {
  font-weight: 800;
  font-size: 45rpx;
pages/bookExhibitionList/index.js
@@ -56,9 +56,55 @@
      value: [],
      options: [],
    },
    navBarHeight: '',
    barHeight: ''
  },
  /**
    * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
    */
  onLoad(options) {
    // console.log(this.data.filteredItems, 88888);
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // èƒ¶å›Šä¿¡æ¯
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // å¯¼èˆªæ é«˜åº¦
    this.setData({
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
    })
    // å•列选择器选项
    const singleSelectOptions = this.data.filteredItems.map(item => ({
      label: item.name,
      value: item.value,
      disabled: false,
    }))
    if (this.data.filteredItems = []) {
      console.log(11111);
      singleSelectOptions.push({
        label: '禁用选项',
        value: 'disabled',
        disabled: true,
      });
    }
    // singleSelectOptions.push({
    //   label: '禁用选项',
    //   value: 'disabled',
    //   disabled: true,
    // });
    // æ›´æ–°æ•°æ®
    this.setData({
      'multipleSelect.options': singleSelectOptions,
    });
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
@@ -171,6 +217,7 @@
      this.setData({
        bookExhibitionList: list
      })
      //取消
      wx.hideLoading()
      // console.log(this.data.bookExhibitionList, '数据');
@@ -205,41 +252,6 @@
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    // console.log(this.data.filteredItems, 88888);
    // å•列选择器选项
    const singleSelectOptions = this.data.filteredItems.map(item => ({
      label: item.name,
      value: item.value,
      disabled: false,
    }))
    if (this.data.filteredItems = []) {
      console.log(11111);
      singleSelectOptions.push({
        label: '禁用选项',
        value: 'disabled',
        disabled: true,
      });
    }
    // singleSelectOptions.push({
    //   label: '禁用选项',
    //   value: 'disabled',
    //   disabled: true,
    // });
    // æ›´æ–°æ•°æ®
    this.setData({
      'multipleSelect.options': singleSelectOptions,
    });
  },
  // æ€»åˆ†ç±»
@@ -326,7 +338,7 @@
    const item = event.currentTarget.dataset.item;
    console.log(item);
    wx.navigateTo({
      url: '/pages/bookExhibitionDetails/index?id=' + item.id // å‡è®¾è·³è½¬åˆ°è¯¦æƒ…页面,并传递了id参数
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // å‡è®¾è·³è½¬åˆ°è¯¦æƒ…页面,并传递了id参数
    });
  },
  // æœç´¢æ¡†
@@ -336,5 +348,8 @@
    })
    console.log(this.data.keyword, 'keyword');
    this.bookExhibitionGet()
  }
  },
  goBack() {
    wx.navigateBack();
  },
})
pages/bookExhibitionList/index.json
@@ -8,5 +8,6 @@
    "t-toast": "tdesign-miniprogram/toast/toast",
    "t-icon": "tdesign-miniprogram/icon/icon"
  },
  "onReachBottomDistance": 200
  "onReachBottomDistance": 200,
  "navigationStyle": "custom"
}
pages/bookExhibitionList/index.wxml
@@ -3,16 +3,15 @@
<!-- å¼¹å‡ºæ¡† ç¦æ­¢ -->
<t-toast id="t-toast" />
<view class="example-search">
  <t-search model:value="{{value}}" placeholder="请输入关键词/书目/ISBN/作者" bind:submit="onSearchSubmit" />
<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" />
</view>
  <view class="example-search">
    <t-search model:value="{{value}}" placeholder="请输入书展名称" bind:submit="onSearchSubmit" />
  </view>
</view>
<view class="menuBox">
@@ -40,7 +39,7 @@
  <view class="outside">
    <view class="contentBox" wx:for="{{bookExhibitionList}}" wx:key="index" wx:for-item="item" wx:for-index="index" bindtap="onBookExhibitionDetails" data-item="{{item}}">
      <image wx:if="{{item.icon}}" src="{{item.icon}}" mode="" />
      <image wx:if="{{item.icon}}" src="{{item.icon}}" mode="aspectFit" />
      <image wx:else="" src="/static/images/bookExhibitionList/banner.png" mode="" />
      <view class="textBox" title="{{item.name}}"> <text>{{item.name}}</text></view>
    </view>
pages/bookExhibitionList/index.wxss
@@ -1,5 +1,21 @@
/* pages/bookExhibitionList/index.wxss */
.nacigationBar {
  background-color: #fff;
  display: flex;
  align-items: center;
}
.navbar-title {
  white-space: nowrap;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 5rpx;
}
.outside {
@@ -27,6 +43,7 @@
.textBox {
  font-family: PingFang SC, PingFang SC;
  width: 280rpx;
  /* height: 75rpx; */
  font-size: 25rpx;
pages/bookServices/assort/index.js
@@ -1,4 +1,5 @@
// pages/bookServices/assort/index.js
import { getPublicImage } from '../../../assets/js/middleGround/tool'
const app = getApp();
Page({
  /**
@@ -79,9 +80,7 @@
      sort: { type: 'Asc', field: 'LinkOrder' },
    };
    app.MG.store.getStoreChannelList(query).then((res) => {
      const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService');
      this.setData({
        assortList: list,
      });
@@ -120,15 +119,14 @@
      sort: { type: 'Asc', field: 'LinkOrder' },
    };
    app.MG.store.getStoreChannelList(query).then(async (res) => {
      console.log(res, 'res');
      // ä¸€çº§åˆ†ç±»é€‰ä¸­
      this.setData({
        startCheck: res.datas[0].refCode,
      });
      // this.setData({
      //   startCheck: res.datas[0].refCode,
      // });
      // èŽ·å–äºŒçº§åˆ†ç±»
      for (let index = 0; index < res.datas.length; index++) {
        const item = res.datas[index];
        item.icon ? item.icon = getPublicImage(item.icon, 58, 72) : item.icon = item.icon
        item.children = await this.getSecondList(item);
      }
      // ä¸€çº§åˆ†ç±»èµ‹å€¼
@@ -156,22 +154,41 @@
      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, 58, 72)
      }
      datas = res.datas;
    });
    return datas;
  },
  tabClick(tabData) {
    const data = tabData.currentTarget.dataset.tabdata;
  tabClick(e) {
    const data = e.currentTarget.dataset.tabdata;
    this.setData({
      startCheck: data.refCode,
    });
    console.log(data);
  },
  // è·³è½¬åˆ—表页
  goPageList(item) {
    const secondCode = `${item.currentTarget.dataset.staircode.pathLinks[0].linkPath}\\${item.currentTarget.dataset.staircode.id}`;
  goPageList(e) {
    const tab = e.currentTarget.dataset.tabdata
    const stair = e.currentTarget.dataset.stair
    this.setData({
      startCheck: tab.refCode
    })
    if (stair) {
      const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`;
    wx.navigateTo({
      url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck}&secondCode=${secondCode}`,
    });
    } else {
      wx.navigateTo({
        url: `/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`,
      });
    }
  },
  navToSearchPage(e) {
    console.log(e.detail.value);
pages/bookServices/assort/index.wxml
@@ -2,13 +2,7 @@
<view class="page-header">
  <!-- æœç´¢æ¡† -->
  <view class="search">
    <t-search
      t-class-input="t-search__input"
      t-class-input-container="t-search__input-container"
      placeholder="请输入关键词/书名/ISBN/作者"
      leftIcon=""
      bind:submit="navToSearchPage"
    >
    <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="请输入关键词/书名/ISBN/作者" leftIcon="" bind:submit="navToSearchPage" placeholder-class="placeholder" placeholder-style="font-size:28rpx;">
      <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
    </t-search>
  </view>
@@ -18,28 +12,14 @@
  <view class="side-bar-wrapper">
    <view class="tab-left">
      <t-side-bar value="{{assortCheck.code}}" bind:change="changeAssort">
        <t-side-bar-item
          wx:for="{{assortList}}"
          wx:key="id"
          value="{{item.refCode}}"
          label="{{item.name}}"
          badge-props="{{item.badgeProps}}"
        />
        <t-side-bar-item wx:for="{{assortList}}" wx:key="id" value="{{item.refCode}}" label="{{item.name}}" badge-props="{{item.badgeProps}}" />
      </t-side-bar>
    </view>
    <view class="side-bar-content">
      <!-- ä¸€çº§åˆ†ç±» -->
      <view class="tab-top">
        <scroll-view scroll-x="{{true}}" class="myScroll">
          <view
            wx:for="{{startList}}"
            wx:key="id"
            class="row {{startCheck == item.refCode ? 'tab-active' : ''}}"
            bind:tap="tabClick"
            data-tabData="{{item}}"
            wx:if="{{item.children.length}}"
            >{{item.name}}</view
          >
          <view wx:for="{{startList}}" wx:key="id" class="row {{startCheck == item.refCode ? 'tab-active' : ''}}" bind:tap="tabClick" data-tabData="{{item}}">{{item.name}}</view>
        </scroll-view>
      </view>
      <!-- å†…容 -->
@@ -47,27 +27,17 @@
        <view wx:if="{{listLoading}}">
          <t-loading theme="spinner" size="400rpx" loading="{{listLoading}}"></t-loading>
        </view>
        <view
          wx:for="{{startList}}"
          wx:for-item="item"
          wx:key="item.refCode"
          id="{{item.refCode}}"
          class="class-box"
          wx:if="{{item.children.length && !listLoading}}"
        >
        <view wx:for="{{startList}}" wx:for-item="item" wx:key="item.refCode" id="{{item.refCode}}" class="class-box" wx:if="{{!listLoading}}">
          <view class="class-name">{{item.name}}</view>
          <view class="class-content">
            <view
              wx:for="{{item.children}}"
              wx:for-item="citem"
              wx:key="id"
              class="book-box"
              bind:tap="goPageList"
              data-stairCode="{{citem}}"
            >
              <t-image src="/static/images/bookService/assort/book-img.png" mode="heightFix" width="58" height="72" />
            <view wx:for="{{item.children}}" wx:for-item="citem" wx:key="id" class="book-box" bind:tap="goPageList" data-stair="{{citem}}" data-tabData="{{item}}" wx:if="{{item.children.length}}">
              <image src="{{citem.icon ? citem.icon : '/static/images/bookService/assort/book-img.png'}}" mode="heightFix" />
              <view class="classify">{{citem.name}}</view>
            </view>
            <view wx:if="{{!item.children.length}}" class="book-box" bind:tap="goPageList" data-tabData="{{item}}">
              <image src="{{item.icon ? item.icon : '/static/images/bookService/assort/book-img.png'}}" mode="heightFix"></image>
              <text class="classify">全部</text>
            </view>
          </view>
        </view>
      </scroll-view>
pages/bookServices/assort/index.wxss
@@ -13,6 +13,11 @@
  left: 0;
  width: 100%;
  z-index: 99;
  font-size: 28rpx;
}
.placeholder {
  font-size: 28rpx;
}
.page-header .t-search__input-container {
@@ -108,7 +113,7 @@
.book-box {
  width: 140rpx;
  margin-right: 10rpx;
  margin: 0 10rpx 20rpx 0
}
.book-box:nth-child(3n) {
@@ -116,8 +121,8 @@
}
.book-box image {
  width: 58px;
  height: 70px;
  height: 142rpx;
  object-fit: contain;
}
.classify {
pages/bookServices/detail/components/learnResource/learnResource.js
@@ -11,13 +11,39 @@
   * ç»„件的初始数据
   */
  data: {
    receive: false,
    buy: false,
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    getFreeResource() {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {
        bubbles: true,
        composed: true
      } // è§¦å‘事件的选项
      this.triggerEvent('getFreeResource', myEventDetail, myEventOption)
    },
    allAddShoppiingCar() {
      var myEventDetail = {} // detail对象,提供给事件监听函数
      var myEventOption = {
        bubbles: true,
        composed: true
      } // è§¦å‘事件的选项
      this.triggerEvent('allAddShoppiingCar', myEventDetail, myEventOption)
    },
    changeReceive(type) {
      this.setData({
        receive: type
      })
    },
    changeBuy(type) {
      this.setData({
        buy: type
      })
    }
  }
})
pages/bookServices/detail/components/learnResource/learnResource.wxml
@@ -1,14 +1,14 @@
<!--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-button loading="{{receive}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx; " t-class="external-class" bind:tap="getFreeResource">
    <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-button loading="{{buy}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;" bind:tap="allAddShoppiingCar">
    <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-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;" wx:if="{{false}}">
    <t-image src="/static/images/bookService/detail/renwudan/icon.png"></t-image>
    å­¦ä¹ ä»»åŠ¡å•
  </t-button>
pages/bookServices/detail/components/learnResource/learnResource.wxss
@@ -8,11 +8,13 @@
}
.btn {
  width: 232rpx;
  width: 300rpx;
  font-size: 28rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-color: #ff6c00;
  --td-button-primary-active-bg-color: #fff0e6;
  --td-button-primary-active-border-color: #ff6c00;
  padding: 0;
  display: flex;
  align-items: center;
@@ -21,4 +23,5 @@
.btn image {
  width: 28rpx;
  height: 32rpx;
  margin: 25rpx 10rpx 0 0;
}
pages/bookServices/detail/components/note/note.js
New file
@@ -0,0 +1,317 @@
// pages/bookServices/detail/components/note/note.js
const app = getApp()
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
    bookInfo: {
      type: Object,
      value: {}
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
    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: '',
    showInput: false,
    submitTitle: "",
    pageCount: {
      page: 1,
      total: 0,
    },
    isMore: null,
    noteList: [],
    activeValues: 0,
    loading: false,
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    onReachBottom() {
      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()
      } else {
        this.setData({
          isMore: true
        })
        setTimeout(() => {
          this.setData({
            isMore: false
          })
        }, 100)
      }
    },
    handleSubmitTitle() {
      this.setData({
        submitTitle: this.properties.bookInfo.name
      })
    },
    openDialog() {
      this.setData({
        submitTitle: this.properties.bookInfo.name,
        showNoteDialog: true
      })
    },
    closeDialog() {
      this.setData({
        flag: false,
        showNoteDialog: false,
        submitTitle: '',
        textvalue: "",
      })
    },
    textareaChange(e) {
      this.setData({
        textvalue: e.detail.value
      })
    },
    textareaBlur() {
      console.log('失去焦点');
    },
    // æ ‡é¢˜è¾“入框值
    inputChange(e) {
      this.setData({
        submitTitle: e.detail.value
      })
    },
    // å¼¹çª—确定按钮
    confirmSuggest() {
      if (!this.data.submitTitle) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记标题',
        })
      } else if (!this.data.textvalue) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记内容',
        })
      }
      if (this.data.submitType == 'new') {
        this.makeNote()
      } else if (this.data.submitType == 'edit') {
        this.updateNote()
      }
      this.setData({
        showNoteDialog: false
      })
    },
    handleChange(e) {
      this.setData({
        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
    },
    changeLoading() {
      this.setData({
        loading:true
      })
    },
    // èŽ·å–ç¬”è®°åˆ—è¡¨
    async getNoteList() {
      // this.setData({
      //   loading: true
      // })
      let topicId
      await app.MG.ugc
        .getProductUserSubmitTopic({
          productId: this.properties.bookInfo.id,
          appRefCode: app.config.appRefCode
        })
        .then((res) => {
          if (res) {
            topicId = res.id
          } else {
            return wx.showToast({
              icon: "error",
              title: '查询失败',
            })
          }
        })
      // loadings.value.bookResource = true
      let query = {
        start: 0,
        size: this.data.pageCount.page * 5,
        messageType: 'note',
        sort: {
          type: 'Desc',
          field: 'CreateDate'
        },
        appRefCode: app.config.appRefCode,
        topicIdOrRefCode: topicId + ''
      }
      await app.MG.ugc.getTopicMessageList(query).then((res) => {
        // notePage.value.total = res.totalSize
        res.datas.forEach((item) => {
          item.compliceHover = false
          item.deleteHover = false
          item.createDate = this.convertTimestamp(item.createDate)
        })
        this.setData({
          "pageCount.total": res.totalSize,
          noteList: res.datas,
          loading: false
        })
        console.log('笔记列表', res.datas);
      })
    },
    // æ–°å»ºç¬”记接口
    async makeNote() {
      const token = wx.getStorageSync('jsek-token')
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          success: (res) => {
            console.log(res);
          }
        })
      }
      let topicId
      await app.MG.ugc
        .getProductUserSubmitTopic({
          productId: this.properties.bookInfo.id,
          appRefCode: app.config.appRefCode
        })
        .then((res) => {
          if (res) {
            topicId = res.id
          } else {
            return wx.showToast({
              icon: 'error',
              title: '新建失败',
            })
          }
        })
      let query = {
        topicIdOrRefCode: topicId + '',
        name: this.data.submitTitle,
        content: this.data.textvalue,
        type: 'note',
        cmsTypeRefCode: '',
        newDataListRequest: []
      }
      await app.MG.ugc.newTopicMessage(query).then((res) => {
        wx.showToast({
          title: '新建成功',
        })
        this.closeDialog()
        this.getNoteList()
      })
    },
    // åˆ é™¤ç¬”è®°
    deleteNote(e) {
      const id = e.currentTarget.dataset.id
      const messageIds = []
      messageIds.push(id)
      wx.showModal({
        title: '提示',
        content: '确认删除该笔记吗?',//editable如果为true,这就是输入框的内容
        editable: false,//是否显示输入框
        placeholderText: '请输入内容吧',//输入框的默认内容
        success: (res) => {
          if (res.confirm) {
            app.MG.ugc
              .delTopicMessage({ messageIds })
              .then((res) => {
                wx.showToast({
                  title: '删除成功',
                })
                // if ((notePage.value.total % 3) - 1 == 0) {
                //   notePage.value.page -= 1
                // }
                this.getNoteList()
              })
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
    },
    // æ ‡é¢˜æ”¹å˜
    changeTitle(e) {
      this.setData({
        flag: e.currentTarget.dataset.value
      })
    },
    // ç¼–辑按钮
    editNote(e) {
      const note = e.currentTarget.dataset.note
      this.setData({
        submitType: "edit",
        textvalue: note.content,
        submitTitle: note.name,
        noteId: note.id
      })
      this.openDialog()
    },
    // ç¼–辑笔记接口
    updateNote() {
      const token = wx.getStorageSync('jsek-token')
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          success: (res) => {
            console.log(res);
          }
        })
      }
      if (!this.data.submitTitle) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记标题',
        })
      } else if (!this.data.textvalue) {
        return wx.showToast({
          icon: 'error',
          title: '请填写笔记内容',
        })
      }
      let query = {
        id: this.data.noteId,
        name: this.data.submitTitle,
        description: 'string',
        icon: 'string',
        type: 'note',
        content: this.data.textvalue,
        newDataRequests: [],
        updateDataRequests: []
      }
      app.MG.ugc.updateTopicMessage(query).then((res) => {
        wx.showToast({
          title: '编辑成功',
        })
        this.closeDialog()
        this.getNoteList()
      })
      this.setData({
        submitType: "new"
      })
    }
  }
})
pages/bookServices/detail/components/note/note.json
New file
@@ -0,0 +1,15 @@
{
  "component": true,
  "usingComponents": {
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button",
    "t-collapse": "tdesign-miniprogram/collapse/collapse",
    "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel",
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-textarea": "tdesign-miniprogram/textarea/textarea",
    "t-input": "tdesign-miniprogram/input/input",
    "t-loading": "tdesign-miniprogram/loading/loading",
    "t-popup": "tdesign-miniprogram/popup/popup",
    "t-icon": "tdesign-miniprogram/icon/icon"
  }
}
pages/bookServices/detail/components/note/note.wxml
New file
@@ -0,0 +1,63 @@
<!--pages/bookServices/detail/components/note/note.wxml-->
<view class="note" wx:if="{{!loading && noteList.length}}">
  <view class="note-btn">
    <t-button theme="primary" class="make-note" bind:tap="openDialog" style="width: 240rpx;">
      <view slot="content">
        <t-image src="/static/images/bookService/detail/makeNote.png"></t-image>
        è®°ç¬”è®°
      </view>
    </t-button>
  </view>
  <view class="note-content">
    <t-collapse value="{{activeValues}}" bind:change="handleChange">
      <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}">
        <view slot="header" class="collapse-header">
          <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image>
          <view class="header-name">{{item.name}}</view>
        </view>
        <view>
          <view class="note-content">{{item.content}}</view>
          <view class="note-bottom">
            <view class="note-time">{{item.createDate}}</view>
            <view class="bottom-btn">
              <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image>
              <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image>
            </view>
          </view>
        </view>
      </t-collapse-panel>
    </t-collapse>
  </view>
  <view class="bottom-box">
    <t-loading wx:if="{{isMore == true}}"></t-loading>
    <text wx:if="{{isMore == false}}">没有更多了</text>
  </view>
</view>
<view class="loading-box" wx:if="{{loading}}">
  <t-loading loading="{{loading}}" size="60rpx"></t-loading>
</view>
<!-- è®°ç¬”记弹窗 -->
<t-popup visible="{{showNoteDialog}}" bind:visible-change="onVisibleChange" placement="center">
  <view class="popup">
    <view slot="title">
      <view class="title-text" wx:if="{{!flag}}">
        <text class="note-title">{{submitTitle}}</text>
        <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image>
      </view>
      <view wx:else>
        <t-input value="{{submitTitle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" bind:change="inputChange" maxlength="{{50}}" style="{{inputStyle}}"></t-input>
      </view>
    </view>
    <view slot="content" class="content">
      <t-textarea value="{{textvalue}}" t-class="external-class" label="" placeholder="请输入笔记内容" maxcharacter="500" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" bind:blur="" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" />
    </view>
    <view class="submit-btn">
      <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button>
    </view>
  </view>
  <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" />
</t-popup>
pages/bookServices/detail/components/note/note.wxss
New file
@@ -0,0 +1,146 @@
/* pages/bookServices/detail/components/note/note.wxss */
.popup {
  padding: 40rpx;
  width: 600rpx;
}
.note-btn {
  height: 140rpx;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid #EFF0F1;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-color: #ff6c00;
  --td-button-primary-active-bg-color: #fff0e6;
}
.note-btn image {
  width: 28rpx;
  height: 32rpx;
  margin-top: 24rpx;
}
.note-title {
  width: 90%;
  height: 84rpx;
  line-height: 84rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.make-note {
  margin: 0;
  margin-right: 40rpx;
}
.title-text {
  display: flex;
  align-items: center;
}
.edit-icon {
  margin-left: 10rpx;
  width: 30rpx;
  height: 30rpx;
}
.header {
  display: flex;
}
.note-icon {
  width: 44rpx;
  height: 48rpx;
  margin-right: 20rpx;
}
.collapse-header {
  display: flex;
}
.collapse-header .header-name {
  font-size: 32rpx;
  width: 500rpx;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-content {
  height: min-content;
  font-size: 28rpx;
  color: #949494;
  margin-bottom: 20rpx;
  max-height: 600rpx;
  text-align: justify;
  /* padding-bottom: 200rpx; */
}
.wrapper {
  height: 100%;
}
.note-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottom-btn {
  height: 40rpx;
  display: flex;
  align-items: center;
}
.note-time {
  color: #D9D9D9;
}
.complice,
.delete {
  width: 30rpx;
  height: 30rpx;
}
.delete {
  margin-left: 40rpx;
}
.loading-box {
  width: 100%;
  min-height: 550rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.content {
  margin-top: 20rpx;
}
.close-btn {
  position: absolute;
  left: 50%;
  margin-left: -32rpx;
  bottom: calc(-1 * (48rpx + 64rpx));
}
.submit-btn {
  padding: 40rpx;
  --td-button-border-radius: 60rpx;
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.bottom-box {
  display: flex;
  justify-content: center;
}
pages/bookServices/detail/components/suggest/suggest.js
@@ -1,19 +1,30 @@
// pages/bookServices/detail/components/suggest/suggest.js
const app = getApp()
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
    bookIcon: {
      type: String,
      value: ''
    },
    bookName: {
      type: String,
      value: ''
    }
  },
  data: {
    inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx',
    placeholderstyle: 'font-size:28rpx',
    dialogKey: '',
    showWithInput: false,
    showTextAndTitleWithInput: false,
    inputvalue: '',
    textvalue: '',
    ratevalue: 0,
    textError: false,
  },
  methods: {
    showDialog(e) {
@@ -24,15 +35,90 @@
    closeDialog() {
      this.setData({
        showWithInput: false
        showWithInput: false,
        ratevalue: 0,
        inputvalue: '',
        textvalue: ''
      })
    },
    // è¯„分改变
    onChangeRate(e) {
      const { value } = e.detail;
      console.log(e.detail);
      this.setData({
        ratevalue: value
        ratevalue: e.detail.value
      });
    },
    // è¾“入框改变
    inputChange(e) {
      this.setData({
        inputvalue: e.detail.value
      })
    },
    // æ–‡æœ¬æ¡†æ”¹å˜
    textareaChange(e) {
      this.setData({
        textvalue: e.detail.value
      })
    },
    feedBack() {
      const token = wx.getStorageSync('jsek-token')
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          success: (res) => {
            console.log(res);
          }
        })
      }
      this.closeDialog()
      let content = {
        source: this.data.ratevalue,
        phone: this.data.inputvalue,
        content: this.data.textvalue,
        icon: this.properties.bookIcon
      }
      let query = {
        topicIdOrRefCode: 'bookOpinion',
        name: this.properties.bookName,
        content: JSON.stringify(content),
        type: 'ProductComment',
        cmsTypeRefCode: '',
        newDataListRequest: []
      }
      app.MG.ugc.newTopicMessage(query).then((res) => {
        wx.showToast({
          title: '提交成功',
          icon: 'success',
          duration: 2000
        })
      })
    },
    // ç¡®å®š
    confirmSuggest() {
      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(this.data.inputvalue);
      if (!this.data.ratevalue) {
        return wx.showToast({
          icon: "error",
          title: '请选择评分',
        })
      } else if (!this.data.inputvalue) {
        return wx.showToast({
          icon: "error",
          title: '请填写联系方式',
        })
      } else if (!isPhoneNumber) {
        return wx.showToast({
          icon: "error",
          title: '请输入正确联系方式',
        })
      } else if (!this.data.textvalue) {
        return wx.showToast({
          icon: 'error',
          title: '请输入反馈反馈内容',
        })
      }
      this.feedBack()
    }
  },
})
pages/bookServices/detail/components/suggest/suggest.json
@@ -4,6 +4,10 @@
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-input": "tdesign-miniprogram/input/input",
    "t-textarea": "tdesign-miniprogram/textarea/textarea",
    "t-rate": "tdesign-miniprogram/rate/rate"
    "t-rate": "tdesign-miniprogram/rate/rate",
    "t-popup": "tdesign-miniprogram/popup/popup",
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-button": "tdesign-miniprogram/button/button",
    "t-image": "tdesign-miniprogram/image/image"
  }
}
pages/bookServices/detail/components/suggest/suggest.wxml
@@ -1,10 +1,31 @@
<t-dialog visible="{{showWithInput}}" title="我要建议" confirm-btn="确定" cancel-btn="取消" bind:confirm="closeDialog" bind:cancel="closeDialog" class="suggest-dialog">
<!-- <t-dialog visible="{{showWithInput}}" title="我要建议" confirm-btn="确定" cancel-btn="取消" bind:confirm="confirmSuggest" 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 class="demo-rate__title">评分</view>
      <t-rate value="{{ratevalue}}" catch: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 />
    <t-input clearable value="{{inputvalue}}" slot="content" label="联系方式" placeholder="请输入联系方式" placeholder-class="placeholder" bind:change="inputChange" type="number" maxlength="{{11}}" tips="{{phoneError ? '手机号输入不正确' : ''}}" />
    <t-textarea value="{{textvalue}}" t-class="external-class" label="意见反馈" placeholder="请输入内容" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" />
  </view>
</t-dialog>
</t-dialog> -->
<!-- <view class="suggest"> -->
<t-popup visible="{{showWithInput}}" bind:visible-change="onVisibleChange" placement="center">
  <view class="top-icon">
    <t-image src="/static/images/bookService/detail/feedback.png"></t-image>
  </view>
  <view slot="content" class="content">
    <view class="top-title">我要建议</view>
    <view class="demo-rate">
      <t-rate value="{{ratevalue}}" catch:change="onChangeRate" size="{{30}}" color="#FFB400" />
    </view>
    <view class="phone-input">
      <t-input clearable value="{{inputvalue}}" slot="content" label="" placeholder="请输入联系方式" placeholder-class="placeholder" bind:change="inputChange" type="number" maxlength="{{11}}" class="phone" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" />
    </view>
    <t-textarea value="{{textvalue}}" t-class="external-class" label="" placeholder="请输入反馈内容" maxcharacter="200" disableDefaultPadding="{{true}}" indicator bind:change="textareaChange" style="{{inputStyle}}" placeholder-style="{{placeholderstyle}}" />
  </view>
  <view class="submit-btn">
    <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button>
  </view>
  <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" />
</t-popup>
<!-- </view> -->
pages/bookServices/detail/components/suggest/suggest.wxss
@@ -1,16 +1,4 @@
/* 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);
@@ -35,18 +23,7 @@
  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;
@@ -57,3 +34,71 @@
  padding-left: 32rpx;
  border: 0;
}
.block {
  position: relative;
  width: 240px;
  height: 240px;
  background: #fff;
  border-radius: 16rpx;
}
.close-btn {
  position: absolute;
  left: 50%;
  margin-left: -32rpx;
  bottom: calc(-1 * (48rpx + 64rpx));
}
.wrapper {
  margin: 32rpx;
  display: block;
}
.content {
  position: relative;
  border-radius: 40rpx;
  padding: 100rpx 40rpx 0rpx 40rpx;
  width: 600rpx;
  background-image: linear-gradient(to bottom, #FFF8E5, #fffcf5);
}
.demo-rate {
  width: 350rpx;
  margin: 20rpx auto 20rpx auto;
}
.phone {
  margin-bottom: 16rpx;
  --td-input-border-radius: 20rpx;
  border-radius: 20rpx;
}
.submit-btn {
  padding: 40rpx;
  --td-button-border-radius: 60rpx;
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.top-icon {
  top: -50rpx;
  left: 40%;
  position: absolute;
}
.top-icon image {
  width: 146rpx;
  height: 146rpx;
}
.top-title {
  width: 160rpx;
  margin: 0 auto;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
}
pages/bookServices/detail/components/teachResource/index.wxml
@@ -1,7 +1,7 @@
<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>
    ä¸Šä¼ èµ„源
<view class="teach-btn" wx:if="{{false}}">
  <t-button theme="primary" style="width: 120px; height: 36px;" class="btn-upload" wx:if="{{false}}">
    <t-image src="/static/images/bookService/detail/upload.png" style="margin-top: 20rpx;"></t-image>
    <text>上传资源</text>
  </t-button>
  <t-button theme="primary" style="width: 120px; height: 36px;">
    <t-image src="/static/images/bookService/detail/download.png"></t-image>
pages/bookServices/detail/components/teachResource/index.wxss
@@ -1,28 +1,32 @@
.teach-btn {
  display: flex;
  justify-content: flex-end;
  justify-content: flex-start;
  align-items: center;
  height: 134rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-color: #ff6c00;
  --td-button-primary-active-bg-color: #fff0e6;
  --td-button-primary-active-border-color: #ff6c00;
}
.btn-content {
  display: flex;
  align-items: center;
}
.teach-btn image {
  width: 32rpx;
  height: 32rpx;
  margin-right: 6rpx;
  margin-top: 20rpx;
}
.teach-btn .t-button__content {
  display: flex;
  align-items: center;
}
.applyResult {
  padding: 0 10rpx;
  width: 740rpx;
  height: 80rpx;
  width: 660rpx;
  min-height: 80rpx;
  display: flex;
  align-items: center;
  margin: 0 auto;
@@ -40,6 +44,7 @@
}
.applyPass {
  background-color: rgba(0, 128, 0, 0.16);
  border: 1px solid green;
}
@@ -47,6 +52,14 @@
.applying {
  background-color: #fff2e9;
  border: 1px solid #ff6c00;
}
.applyNone,
.applyReject,
.applyPass,
.applying {
  margin-top: 40rpx;
  margin-bottom: 40rpx;
}
.btn-box {
@@ -61,7 +74,8 @@
  --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;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.rejectBtn {
pages/bookServices/detail/components/testResource/testResource.js
New file
@@ -0,0 +1,84 @@
// pages/bookServices/detail/components/testResource/testResource.js
const app = getApp()
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    bookInfo: {
      type: Object,
      value: "",
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    async goTest(e) {
      const value = e.currentTarget.dataset.value
      const token = wx.getStorageSync('jsek-token')
      if (!token) {
        return wx.getUserProfile({
          desc: '用户登录',
          success: (res) => {
            console.log(res);
          }
        })
      }
      // èŽ·å–ç« èŠ‚ä¸‹æ˜¯å¦æœ‰é¢˜ç›®
      let idPathList = []
      let query = {
        path: '*',
        queryType: '*',
        productId: this.properties.bookInfo.id,
        cmsPath: value.productLinkPath,
        pading: {
          start: 0,
          size: 999
        }
      }
      if (value.childrenFolderCount == 0) {
        return wx.showToast({
          icon: "error",
          title: '暂无数据',
        })
      } else {
        const res = await app.MG.store.getProductDetail(query)
        debugger
        res.datas.cmsDatas[0].datas.forEach((item) => {
          idPathList.push({
            id: item.id,
            name: item.name,
            productLinkPath: item.productLinkPath,
            type: item.type
          })
        })
      }
      // query: {
      //   title: bookData.value.test,
      //   bookId: route.query.bookId,
      //   productLinkPath: data.productLinkPath,
      //   answerTitle: data.name,
      //   answerType: 'option',
      //   rootCmsItemId: bookData.value.rootCmsItemId,
      //   idPathList: JSON.stringify(idPathList)
      // }
      wx.navigateTo({
        url: `/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'}`,
      })
    }
  }
})
pages/bookServices/detail/components/testResource/testResource.json
New file
@@ -0,0 +1,7 @@
{
  "component": true,
  "usingComponents": {
    "t-button": "tdesign-miniprogram/button/button",
    "t-image": "tdesign-miniprogram/image/image"
  }
}
pages/bookServices/detail/components/testResource/testResource.wxml
New file
@@ -0,0 +1,39 @@
<!--pages/bookServices/detail/components/testResource/testResource.wxml-->
<view class="test-resource">
  <view class="top-btn">
    <t-button class="practice-btn" theme="primary" size="medium" style="width: 85px;">
      <view slot="content">
        <t-image src="/static/images/bookService/detail/practice-icon.png"></t-image>
        ç»ƒä¹ 
      </view>
    </t-button>
    <t-button class="paper-btn" theme="default" size="medium" style="width: 85px;">
      <view slot="content">
        <t-image src="/static/images/bookService/detail/zujuan.png"></t-image>
        ç»„卷
      </view>
    </t-button>
    <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx;">
      <view slot="content">
        <t-image src="/static/images/bookService/detail/cuoti.png"></t-image>
        æˆ‘的错题
      </view>
    </t-button>
    <t-button class="collect-btn" theme="default" size="medium" style="padding: 0 12rpx;">
      <view slot="content">
        <t-image src="/static/images/bookService/detail/wodeshoucang.png"></t-image>
        æˆ‘的收藏
      </view>
    </t-button>
  </view>
  <view class="resource-list" wx:for="{{list}}" wx:key="item.id">
    <view class="list-title">
      <t-image src="/static/images/bookService/detail/test-icon.png"></t-image>
      <text>{{item.name}}</text>
    </view>
    <view class="practice" bind:tap="goTest" data-value="{{item}}">
      <t-image src="/static/images/bookService/detail/lianxi-icon.png"></t-image>
    </view>
  </view>
</view>
pages/bookServices/detail/components/testResource/testResource.wxss
New file
@@ -0,0 +1,56 @@
/* pages/bookServices/detail/components/testResource/testResource.wxss */
.test-resource {
  padding-top: 20rpx;
}
.resource-list {
  height: 80rpx;
  margin: 20rpx;
  padding: 0 20rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #FFF6F0;
}
.list-title image {
  width: 34rpx;
  height: 38rpx;
}
.practice image {
  width: 26rpx;
  height: 30rpx;
}
.list-title text {
  margin-left: 10rpx;
  color: #333;
}
.top-btn {
  display: flex;
  justify-content: space-evenly;
}
.top-btn image {
  margin-top: 20rpx;
  width: 36rpx;
  height: 36rpx;
}
.practice-btn {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
.paper-btn,
.error-btn,
.collect-btn {
  --td-button-default-bg-color: #fff;
  --td-button-default-color: #ff6c00;
  --td-button-default-active-bg-color: #fff0e6;
  --td-button-medium-font-size: 28rpx
}
pages/bookServices/detail/components/tree/index.js
@@ -1,3 +1,4 @@
import Message from 'tdesign-miniprogram/message/message';
const app = getApp()
Component({
@@ -5,6 +6,10 @@
    treeList: {
      type: Array,
      value: []
    },
    bookInfo: {
      type: Object,
      value: {}
    },
    buyIds: {
      type: Array,
@@ -17,6 +22,14 @@
    applyState: {
      type: String,
      value: ''
    },
    openTeachids: {
      type: Array,
      value: ''
    },
    openLearnids: {
      type: Array,
      value: ""
    }
  },
  data: {
@@ -43,7 +56,6 @@
      }
    },
    downloadTeach(e) {
      console.log('点击了', e);
      const value = e.currentTarget.dataset.value
      var myEventDetail = {
        value,
@@ -53,6 +65,7 @@
        composed: true
      } // è§¦å‘事件的选项
      this.triggerEvent('downloadTeach', myEventDetail, myEventOption)
    },
    // åˆ¤æ–­èµ„源是否购买
resourceIsBuy (data) {
@@ -62,6 +75,118 @@
  } else {
    return false
  }
    },
    // è·³è½¬éŸ³è§†é¢‘播放器
    goPlayer(e) {
      const item = e.currentTarget.dataset.item
      const parent = e.currentTarget.dataset.parent
      //   "pages/resourceDetails/myAudio/index",
      // "pages/resourceDetails/myVideo/index",
      // "pages/resourceDetails/document/index",
      let url
      if (item.selectType == 'video') {
        url = '/pages/resourceDetails/myVideo/index'
      } else if (item.selectType == 'audio') {
        url = '/pages/resourceDetails/myAudio/index'
      } else {
        url = '/pages/resourceDetails/document/index'
      }
      wx.navigateTo({
        url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`,
      })
    },
    // æ‹¿åˆ°æ‰€æœ‰é¡¹
    getAllChildren(id) {
      let result = [];
      function findChildren(item) {
        if (item.id === id) {
          if (item.children && item.children.length > 0) {
            item.children.forEach(child => {
              findChildren(child);
            });
          }
        } else {
          if (item.children && item.children.length > 0) {
            item.children.forEach(child => {
              findChildren(child);
            });
          }
        }
        if (item.children && item.children.length > 0) {
          result.push(...item.children);
        }
      }
      this.properties.treeList.forEach(item => {
        findChildren(item);
      });
      return result;
    },
    // æ‹¿åˆ°å½“前项子项
    flattenTree(tree) {
      let result = [];
      function flatten(node) {
        result.push(node);
        if (node.children && node.children.length > 0) {
          node.children.forEach(child => {
            flatten(child);
          });
        }
      }
      tree.forEach(node => {
        flatten(node);
      });
      return result
    },
    findAndUpdateItemById(tree, id) {
      function findAndUpdate(node) {
        if (node.id === id) {
          node.check = true; // å°†ç›®æ ‡é¡¹çš„ check å±žæ€§è®¾ç½®ä¸º true
          return true; // è¿”回 true è¡¨ç¤ºæ‰¾åˆ°äº†ç›®æ ‡é¡¹
        }
        if (node.children && node.children.length > 0) {
          for (let child of node.children) {
            if (findAndUpdate(child)) {
              return true; // å¦‚果在子节点中找到了目标项,则直接返回 true
            }
          }
        }
        return false; // è¡¨ç¤ºæœªæ‰¾åˆ°ç›®æ ‡é¡¹
      }
      for (let node of tree) {
        if (findAndUpdate(node)) {
          break; // å¦‚果在顶层节点中找到了目标项,直接退出循环
        }
      }
    },
    // å˜ä¸ºtrue
    findAndUpdateItemsByIds(tree, ids) {
      function findAndUpdate(node) {
        if (ids.includes(node.id)) {
          node.checked = true; // å°†ç›®æ ‡é¡¹çš„ check å±žæ€§è®¾ç½®ä¸º true
        }
        if (node.children && node.children.length > 0) {
          for (let child of node.children) {
            findAndUpdate(child); // é€’归处理子节点
          }
        }
      }
      for (let node of tree) {
        findAndUpdate(node); // å¯¹æ¯ä¸ªé¡¶å±‚节点执行查找和更新操作
      }
      return tree; // è¿”回修改后的完整数组
    },
    // ç« èЂ勾选
    checkResourceTitle(e) {
      const item = e.currentTarget.dataset.item
      let list = this.flattenTree([item])
      let ids = []
      list.forEach(item => {
        ids.push(item.id)
      })
      const tab = this.findAndUpdateItemsByIds([item], ids)
      console.log(ids, tab);
}
  }
})
pages/bookServices/detail/components/tree/index.wxml
@@ -1,58 +1,168 @@
<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>
  <t-collapse default-value="{{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 wx:if="{{tab == 'jsek_cloudLearning'}}">
          <t-checkbox
            icon="rectangle"
            checked="{{item.checked}}"
            data-item="{{item}}"
            bind:change="checkResourceTitle"
          />
        </view>
        <text>{{item.name}}</text>
      </view>
      <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex">
      <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="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"
              bind:tap="goPlayer"
              data-item="{{citem}}"
              data-parent="{{item}}"
            >
              <!-- æ•™å­¦èµ„源 äº‘学习 å›¾æ ‡ -->
              <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
                class="box-image"
                style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}"
              >
                <view class="checkBox" wx:if="{{tab == 'jsek_cloudLearning'}}">
                  <t-checkbox
                    icon="rectangle"
                    checked="{{citem.checked}}"
                    disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}"
                    catch:change="checkResource"
                    data-item="{{citem}}"
                  />
                </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" />
                  <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>
                <view> </view>
                <!-- åç§° -->
                <text class="name">{{citem.name}}</text>
                <text
                  class="name"
                  style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}"
                  >{{citem.name}}</text
                >
              </view>
              <!-- æ•™å­¦èµ„源类型 -->
              <view class="teachClass">
                {{citem.resourceClass}}
              </view>
              <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}">
              <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>
                <t-image
                  src="/static/images/bookService/detail/download-icon.png"
                  width="16"
                  height="16"
                  class="download"
                  data-value="{{citem}}"
                  catchtap="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>
                <!-- äº‘学习试看图标 -->
                <t-image
                  src="/static/images/bookService/detail/shikan.png"
                  class="testSee"
                  wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"
                ></t-image>
                <!-- äº‘学习加入购物车图标 -->
                <t-image
                  src="/static/images/bookService/detail/cart.png"
                  wx:if="{{citem.isShopCar}}"
                  class="shopCar"
                ></t-image>
                <!-- äº‘学习购买图标 -->
                <t-image
                  src="/static/images/bookService/detail/need-buy.png"
                  class="need-buy"
                  wx:if="{{citem.isbuy }}"
                ></t-image>
              </view>
            </view>
          </view>
        </view>
        <!-- // åˆ¤æ–­ ä¸æ˜¯å•†å“ æœ‰å­é¡¹ é€’归组件 -->
        <tree wx:else treeList="{{[citem]}}" itemId="{{itemId}}"></tree>
        <tree
          wx:else
          bookInfo="{{bookInfo}}"
          treeList="{{[citem]}}"
          itemId="{{itemId}}"
          tab="{{tab}}"
          openTeachids="{{openTeachids}}"
          openLearnids="{{openLearnids}}"
        ></tree>
      </view>
      <view class="listItems" wx:if="{{children.length <= 0 && !loading}}">
        æš‚无数据
pages/bookServices/detail/components/tree/index.wxss
@@ -1,5 +1,7 @@
.tree {
  --td-collapse-content-padding: 32rpx 12rpx 32rpx 32rpx;
  --td-collapse-content-padding: 0rpx 12rpx 32rpx 12rpx;
  --td-collapse-header-text-color: #ff6C00;
  --td-collapse-icon-color: #ff6c00
}
.header-title {
@@ -8,9 +10,15 @@
  --td-checkbox-vertical-padding: 0
}
.t-class {
  background-color: #F7F7F7;
}
.t-class-content {
  padding: 0;
}
.contentBox {
  padding: 0 26rpx;
@@ -55,7 +63,13 @@
}
.testSee,
.need-buy {
.need-buy,
.shopCar {
  width: 38rpx;
  height: 38rpx;
}
.testSee,
.shopCar {
  margin-right: 20rpx;
}
pages/bookServices/detail/index.js
@@ -6,6 +6,7 @@
   * é¡µé¢çš„初始数据
   */
  data: {
    bookId: '',
    barHeight: '',
    navBarHeight: '',
    options: {
@@ -26,15 +27,20 @@
    teachResources: [],
    teach: [],
    learn: [],
    test: [],
    openTeachids: [],
    openLearnids: [],
    openTestids: [],
    resourceClassList: [], // èµ„源所属分类
    applyState: "",  // æ•™å­¦èµ„源申请状态
    deadline: "",  // æ•™å­¦èµ„源申请有效日期
    rejectCause: "",  // ä¸‹è½½æ‹’绝原因
    buyIdList: [],
    shoppingCartGetId: [], // å·²è´­ä¹°id列表
    shoppingList: []
    shoppingList: [],
    loading: false,
    isShowTeachDownload: false,  // æç¤ºPC下载弹窗状态
    confirmBtn: { content: '我知道了', variant: 'base' },
  },
  resetTree: function (e) {
@@ -51,6 +57,7 @@
    const menu = wx.getMenuButtonBoundingClientRect(); // èƒ¶å›Šä¿¡æ¯
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // å¯¼èˆªæ é«˜åº¦
    this.setData({
      bookId: options.id,
      barHeight: systInfo.statusBarHeight,
      navBarHeight: navBarHeight,
    });
@@ -63,7 +70,8 @@
    this.getBookInfo(options.id);
    this.getResourceClass() // èŽ·å–èµ„æºæ‰€å±žåˆ†ç±»
    this.getApplyInfo(options.id)
    if (wx.getAccountInfoSync('jsek-token')) {
    const token = wx.getStorageSync('jsek-token')
    if (token) {
      this.getShoppingCartProductGet()
    }
  },
@@ -93,12 +101,20 @@
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() { },
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() { },
  onReachBottom() {
    if (this.data.tabValue == 'jesk_note') {
      const child = this.selectComponent('#note')
      child.onReachBottom()
    }
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
@@ -195,7 +211,8 @@
        freeEpubPage: [], //epub试读百分比
      },
    };
    app.MG.store.getProductDetail(query).then((res) => {
    app.MG.store.getProductDetail(query).then(async (res) => {
      this.setData({
        bookDetail: res.datas,
        cmsDatas: res.datas.cmsDatas[0].datas,
@@ -204,9 +221,10 @@
      // èŽ·å–å›¾ä¹¦åˆ†ç±»
      const iconType = JSON.parse(res.datas.bookClassification)[0][0];
      const classType = JSON.parse(res.datas.bookClassification)[0][1];
      const className = await this.getBookClass(iconType, classType)
      this.setData({
        'bookDetail.publicationDate': this.formatDate(this.data.bookDetail.publicationDate),
        'bookDetail.class': this.getBookClass(iconType, classType),
        'bookDetail.class': className,
        'bookDetail.price': this.numFormat(this.data.bookDetail.price),
        'bookDetail.oldPrice': this.numFormat(this.data.bookDetail.oldPrice),
        'bookDetail.paperPrice': this.numFormat(this.data.bookDetail.paperPrice),
@@ -214,17 +232,17 @@
    });
  },
  // èŽ·å–å›¾ä¹¦åˆ†ç±»
  getBookClass(iconType, classType) {
  async getBookClass(iconType, classType) {
    let name = '';
    const query = {
      refCodes: ['bookClassification'],
    };
    app.MG.store.getProductTypeField(query).then((res) => {
    await app.MG.store.getProductTypeField(query).then((res) => {
      JSON.parse(res[0].config).option.forEach((item) => {
        if (item.value == iconType) {
          item.child.forEach((item) => {
            if (item.value == classType) {
              name = item.name;
          item.child.forEach((citem) => {
            if (citem.value == classType) {
              name = citem.name;
            }
          });
        }
@@ -293,9 +311,18 @@
          || (e.detail.value == 'questionBank' && !this.data.test.length)) {
          this.getResourceData(checkData)
        }
      }
    } else if (e.detail.label == '云笔记') {
      const token = wx.getStorageSync('jsek-token')
      const child = this.selectComponent('#note')
      child.handleSubmitTitle()
      if (token) {
        child.changeLoading()
        child.getNoteList()
    }
    console.log('切换', this.data.tabValue);
    }
  },
  // èŽ·å–èµ„æºæ‰€å±žåˆ†ç±»
  getResourceClass() {
@@ -310,6 +337,9 @@
  },
  //  èŽ·å–æ•™å­¦èµ„æº  äº‘学习  äº‘测试
  getResourceData(type) {
    this.setData({
      loading: true
    })
    let query = {
      path: '*',
      queryType: '*',
@@ -340,7 +370,7 @@
          const data = res.datas.cmsDatas[0].datas.filter(
            (item) => item.refCode == 'jsek_questionBank'
          )
          if (data.length) return getResourceData(data[0])
          if (data.length) return this.getResourceData(data[0])
        }
        //教学资源 äº‘学习
        if (type.refCode == 'jsek_teachingResources' || type.refCode == 'jsek_cloudLearning') {
@@ -351,23 +381,27 @@
              })
              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              this.setData({
                teachResources: list,
                teach: list
                teach: list,
                loading: false
              })
              this.findChildIds(this.data.teachResources, this.data.openTeachids = [])
              this.findChildIds(this.data.teach, this.data.openTeachids = [])
            } else if (type.refCode == 'jsek_cloudLearning') {
              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
              this.setData({
                learn: list
                learn: list,
                loading: false
              })
              console.log('云学习', this.data.learn);
              this.findChildIds(this.data.teachResources, this.data.openLearnids = [])
              this.findChildIds(this.data.learn, this.data.openLearnids = [])
            }
          } else {
            // æ— æ•°æ®
          }
        } else if (type.refCode == 'jsek_questionBank') {
          console.log('云测试');
          // const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
          this.setData({
            test: res.datas.cmsDatas[0].datas,
            loading: false
          })
        } else {
          console.log('其他');
        }
@@ -375,7 +409,6 @@
      .catch((e) => {
        console.log(e)
      })
    console.log('信息', this.data);
  },
  // èŽ·å–tag下所有资源
  async getAllResource(data) {
@@ -522,14 +555,14 @@
          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: '永久',
            })
            console.log('有效日期', this.data.deadline);
          } else {
            let endTime = new Date(endDate + ' 23:59:59').getTime()
            // deadline.value = endDate + ' 23:59:59'
            this.setData({
              deadline: endDate + ' 23:59:59'
            })
@@ -554,9 +587,8 @@
          applyState: 'none'
        })
      }
      console.log('申请通过', this.data.applyState);
    })
    console.log('有效日期', this.data.deadline);
  },
  // ç”³è¯·æ•™å­¦èµ„源
  applyResource() {
@@ -601,92 +633,102 @@
    //   // logIn()
    // }
  },
  // æ•™å­¦èµ„源下载前往PC提示Diialog
  closeTeachDownload() {
    this.setData({
      isShowTeachDownload: false
    })
  },
  // ä¸‹è½½åŠŸèƒ½
  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: '该文件无法下载'
    this.setData({
      isShowTeachDownload: true
            })
          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'
    console.log('zhuan', this.data.isShowTeachDownload);
    //   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: '该文件无法下载'
      // })
      //   .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 {
    //         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: '请先申请下载'
    //           content: '暂无资源',
      // })
      console.log('请先申请下载');
    }
    //   } else {
    //     ElMessageBox.confirm('请先进行教师认证!', '尊敬的用户,您好!', {
    //       confirmButtonText: '去认证',
    //       cancelButtonText: '取消',
    //       type: 'warning'
    //     })
    //       .then(() => {
    //         isShow.value = true
    //       })
    //       .catch(() => { })
    //   }
    //       this.downloadFile(url)
    // } else {
    //   logIn()
    //       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({
@@ -726,6 +768,7 @@
      return false
    }
  },
  // èŽ·å–å·²è´­ä¹°å•†å“
  getShoppingCartProductGet() {
    let query = {
      start: 0,
@@ -742,7 +785,6 @@
        shoppingList: res.datas,
        shoppingCartGetId: list
      })
      console.log('è´­ä¹°', this.data);
    })
  },
  // åˆ¤æ–­èµ„源加入购物车按钮是否显示
@@ -762,5 +804,140 @@
    } else {
      return false
    }
  },
  // éåŽ†æ ‘ç»“æž„è½¬æ¢ä¸ºæ•°ç»„æ–¹æ³•
  handleTreeData(array) {
    const flattenedArray = []
    array.forEach((node) => {
      // å°†å½“前节点添加到展开的数组中
      flattenedArray.push(node)
      // é€’归处理子节点
      if (node.children && node.children.length > 0) {
        const childrenArray = this.handleTreeData(node.children)
        flattenedArray.push(...childrenArray)
  }
})
    return flattenedArray.filter((item) => item.sysType == 'CmsItem')
  },
  // äº‘学习一键领取
  async getFreeResource() {
    const child = this.selectComponent('#learn-resource')
    const token = wx.getStorageSync('jsek-token')
    if (!token) {
      return wx.getUserProfile({
        desc: '用户登录',
        success: (res) => {
          console.log(res);
        }
      })
    }
    let arr = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item))
    let freeIds = arr.filter((item) => {
      return item.saleMethod[0].Price == 0
    })
    if (!freeIds.length) return wx.showToast({
      icon: "error",
      title: '暂无免费资源',
    })
    child.changeReceive(true)
    let requests = []
    freeIds.forEach((item, index) => {
      if (this.resourceIsBuy(item)) {
        requests.push({
          saleMethodId: item.saleMethod[0].Id,
          count: 1
        })
      }
    })
    let query = {
      remarks: '云学习',
      requests,
    }
    try {
      const initOrderRes = await app.MG.store.initOrder(query)
      let parameter = {
        orderNum: initOrderRes.orderNumber
      }
      // ç¡®è®¤è®¢å•
      const confirmOrderRes = await app.MG.store.confirmOrder(parameter)
      if (confirmOrderRes.orderNumber) {
        child.changeReceive(false)
        wx.showToast({
          title: '领取成功',
        })
        this.getBookInfo(this.data.bookId)
      }
    } catch (error) {
      console.log(error)
    }
  },
  // äº‘学习一键购买
  async allAddShoppiingCar() {
    const child = this.selectComponent('#learn-resource')
    const token = wx.getStorageSync('jsek-token')
    if (!token) {
      return wx.getUserProfile({
        desc: '用户登录',
        success: (res) => {
          console.log(res);
        }
      })
    }
    let shopList = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item))
    this.getShoppingCartProductGet()
    if (!shopList.length) return wx.showToast({
      icon: "error",
      title: '已全部购买',
    })
    child.changeBuy(true)
    let requests = []
    shopList.forEach((item) => {
      requests.push({
        saleMethodId: item.saleMethod[0].Id,
        count: 1,
      })
    })
    let query = {
      remarks: '云学习',
      requests,
    }
    const initOrderRes = await app.MG.store.initOrder(query)
    child.changeBuy(false)
    // æ£€æŸ¥è®¢å•号是否存在
    if (initOrderRes.orderNumber) {
      // bookService: orderNumber.value,  å°‘传这个 ï¼Œæš‚时不知道有什么用
      wx.navigateTo({
        url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNum=${initOrderRes.orderNumber}`,
      })
    } else {
      // è®¢å•号不存在,显示警告消息
      wx.showToast({
        icon: "error",
        title: '请重试',
      })
    }
  },
  // å˜ä¸ºæ‰€æœ‰check   true
  findAndUpdateItemsByIds(tree, ids) {
    function findAndUpdate(node) {
      if (ids.includes(node.id)) {
        node.checked = true; // å°†ç›®æ ‡é¡¹çš„ check å±žæ€§è®¾ç½®ä¸º true
      }
      if (node.children && node.children.length > 0) {
        for (let child of node.children) {
          findAndUpdate(child); // é€’归处理子节点
        }
      }
    }
    for (let node of tree) {
      findAndUpdate(node); // å¯¹æ¯ä¸ªé¡¶å±‚节点执行查找和更新操作
    }
    return tree; // è¿”回修改后的完整数组
  },
  handleTrue() {
    // findAndUpdateItemsByIds(this.date.)
  },
})
pages/bookServices/detail/index.json
@@ -9,9 +9,13 @@
    "book-brief": "/pages/bookServices/detail/components/brief/index",
    "teach-resource": "/pages/bookServices/detail/components/teachResource/index",
    "learn-resource": "/pages/bookServices/detail/components/learnResource/learnResource",
    "test-resource": "/pages/bookServices/detail/components/testResource/testResource",
    "note": "/pages/bookServices/detail/components/note/note",
    "tree": "/pages/bookServices/detail/components/tree/index",
    "suggest": "/pages/bookServices/detail/components/suggest/suggest",
    "t-loading": "tdesign-miniprogram/loading/loading"
    "t-loading": "tdesign-miniprogram/loading/loading",
    "t-dialog": "tdesign-miniprogram/dialog/dialog"
  },
  "navigationStyle": "custom"
  "navigationStyle": "custom",
  "onReachBottomDistance": 200
}
pages/bookServices/detail/index.wxml
@@ -3,29 +3,48 @@
<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>
<scroll-view scroll-y="{{true}}" class="book">
<scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom">
  <!-- å›¾ä¹¦è¯¦æƒ… -->
  <view class="book-box">
    <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 class="use-title">收藏</view>
          </view>
          <view class="suggest" bind:tap="suggestBtn">
            <view>
              <t-image src="/static/images/bookService/detail/suggest.png"></t-image>
              <t-image
                src="/static/images/bookService/detail/suggest.png"
              ></t-image>
            </view>
            <view class="use-title">我要建议</view>
          </view>
@@ -50,9 +69,13 @@
            <view class="li-title">出版时间:</view>
            <view class="li-content">{{bookDetail.publicationDate}}</view>
          </view>
          <view class="message-li">
          <view
            class="message-li"
            wx:if="{{bookDetail.class}}"
            style="height: 80rpx"
          >
            <view class="li-title">图书分类:</view>
            <view class="li-content">{{bookDetail.class}}</view>
            <view class="class-name showTow">{{bookDetail.class}}</view>
          </view>
        </view>
      </view>
@@ -63,11 +86,16 @@
        <!-- ç”µå­ä¹¦å”®ä»· -->
        <view class="electron-price">
          <view>
            <t-image src="/static/images/bookService/detail/electon-price.png"></t-image>
            <t-image
              src="/static/images/bookService/detail/electon-price.png"
            ></t-image>
          </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="line"></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>
@@ -75,37 +103,132 @@
        <!-- çº¸è´¨ä¹¦å”®ä»· -->
        <view class="paper-price">
          <view>
            <t-image src="/static/images/bookService/detail/paper-price.png"></t-image>
            <t-image
              src="/static/images/bookService/detail/paper-price.png"
            ></t-image>
          </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">
        <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="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class">
    <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>
        <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="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
        label="教学资源"
        value="jsek_teachingResources"
        class="{{loading ? 'loading': ''}}"
      >
        <view wx:if="{{!loading && teach.length}}">
          <teach-resource
            applyState="{{applyState}}"
            rejectCause="{{rejectCause}}"
            bind:applyResource="applyResource"
          ></teach-resource>
          <tree
            bookInfo="{{bookDetail}}"
            treeList="{{teach}}"
            tab="{{tabValue}}"
            applyState="{{applyState}}"
            bind:downloadTeach="downloadTeach"
            openTeachids="{{openTeachids}}"
          ></tree>
        </view>
        <t-loading
          theme="circular"
          size="60rpx"
          class="loading"
          loading="{{loading}}"
        />
      </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
        label="云学习"
        value="jsek_cloudLearning"
        style="{{tabPanelstyle}}"
      >
        <view wx:if="{{!loading && learn.length}}">
          <learn-resource
            bind:getFreeResource="getFreeResource"
            bind:allAddShoppiingCar="allAddShoppiingCar"
            id="learn-resource"
          ></learn-resource>
          <tree
            bookInfo="{{bookDetail}}"
            tab="{{tabValue}}"
            treeList="{{learn}}"
            buyIds="{{buyIdList}}"
            openLearnids="{{openLearnids}}"
          ></tree>
        </view>
      </t-tab-panel>
      <t-tab-panel label="云测试" value="questionBank" style="{{tabPanelstyle}}">选项四内容</t-tab-panel>
      <t-tab-panel
        label="云测试"
        value="questionBank"
        style="{{tabPanelstyle}}"
      >
        <view wx:if="{{!loading && test.length}}">
          <test-resource
            list="{{test}}"
            bookInfo="{{bookDetail}}"
          ></test-resource>
        </view>
      </t-tab-panel>
      <t-tab-panel label="云笔记" value="jesk_note" style="{{tabPanelstyle}}">
        <note
          bookInfo="{{bookDetail}}"
          id="note"
          class="note-list"
          bind:changeLoaidng="changeLoaidng"
        ></note>
      </t-tab-panel>
    </t-tabs>
  </view>
  <!-- è´­ä¹°æŒ‰é’® -->
@@ -118,7 +241,9 @@
    </view>
    <view class="bottom-btn">
      <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>
@@ -127,4 +252,18 @@
  </view>
</scroll-view>
<!-- æˆ‘要建议弹窗 -->
<suggest class="suggest-component" id="suggest-component"></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"
/>
pages/bookServices/detail/index.wxss
@@ -33,9 +33,22 @@
}
.detail-right .book-name {
  width: 420rpx;
  font-weight: bold;
  font-size: 36rpx;
  color: #000000;
  margin-bottom: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.showTow {
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-message {
@@ -60,6 +73,12 @@
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.class-name {
  height: 2.5em;
  width: 280rpx;
  font-size: 28rpx;
}
.book-use {
@@ -153,6 +172,7 @@
.book-web {
  margin-left: 30rpx;
  display: flex;
}
.book-web image {
@@ -240,3 +260,25 @@
.tab-box {
  min-height: 550rpx;
}
.note-list {
  /* margin-bottom: 80rpx; */
}
.tab-class {
  --td-loading-color: #ff6c00
}
.loading {
  min-height: 550rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.teachDownloadDialog {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #ff6c00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
pages/bookServices/examination/examination.js
New file
@@ -0,0 +1,339 @@
const app = getApp()
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    barHeight: "",
    navBarHeight: "",
    loading: false,
    answerTitle: "",  // å¯¼èˆªæ æ ‡é¢˜
    bookId: "",
    productLinkPath: "",
    rootCmsItemId: "",
    idPathList: [],  // é¢˜ç›®åˆ—表
    answerType: "",  // ç­”题类型
    submitStatus: false,  // æäº¤çŠ¶æ€
    currentIndex: 0, // å½“前答题数
    collectList: [],   //  æ”¶è—é¢˜ç›®åˆ—表
    subjectiveNum: 0, // ä¸»è§‚题得分
    subjectiveGrade: 0, // ä¸»è§‚题总分
    total: 0,   // é¢˜ç›®æ€»æ•°
    correctNum: 0,  // æ­£ç¡®é¢˜ç›®æ•°é‡
    cardList: [],  // æäº¤é¡¹,
    questionDataList: []
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  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,
      answerTitle: options.answerTitle,
      bookId: options.bookId,
      productLinkPath: options.productLinkPath,
      rootCmsItemId: options.rootCmsItemId,
      idPathList: JSON.parse(options.idPathList),
      answerType: options.answerType
    });
    this.init()
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  },
  // è¿”回
  goBack() {
    wx.navigateBack();
  },
  // åˆå§‹åŒ–函数
  async init() {
    if (this.data.answerType == 'option') {
      // æµ‹è¯•答题
      await this.getCollectIdList() // èŽ·å–æ”¶è—id列表
      // await getErrorList() // èŽ·å–é”™é¢˜id列表
    }
  },
  // èŽ·å–æ”¶è—é¢˜ç›®åˆ—è¡¨id
  getCollectIdList() {
    app.MG.identity
      .getUserKey({
        domain: 'collectData',
        keys: [this.data.rootCmsItemId]
      })
      .then(async (res) => {
        try {
          this.setData({
            collectList: JSON.parse(res[0].value)
          })
        } catch (error) {
        }
        if (this.data.answerType == 'option') {
          // å…ˆèŽ·å–ç”¨æˆ·ç­”é¢˜è®°å½•
          await this.getAnswerInfo((res) => {
            if (res.length) {
              // æœ‰è®°å½•,不能答题,状态设为已提交
              this.setData({
                submitStatus: true
              })
              let value = JSON.parse(res[0].value)
              // console.log('答题记录', JSON.parse(res[0].value))
              // æœ‰ç­”题记录,得分赋值
              if (value) {
                value.dataList.forEach((item) => {
                  if (item.name == '客观题得分' && item.path == this.data.productLinkPath)
                    this.setData({
                      subjectiveNum: item.score
                    })
                })
              }
              this.setData({
                currentIndex: value.currentIndex
              })
              // æºå¸¦ç­”题记录 èŽ·å–é¢˜ç›®
              this.getQuestionList(value.dataList)
            } else {
              this.getQuestionList() // èŽ·å–é¢˜åº“é¢˜ç›®
            }
          })
        }
      })
  },
  // èŽ·å–é¢˜åº“é¢˜ç›®
  getQuestionList(oldData) {
    // æ¸…空正确题数记录
    this.setData({
      correctNum: 0
    })
    let flag = 0
    this.data.idPathList.forEach((pathitem) => {
      const pathList = this.data.cardList
      pathList.push({
        name: pathitem.name,
        path: pathitem.productLinkPath,
        catalogName: pathitem.type,
        infoList: []
      })
      this.setData({
        cardList: pathList
      })
      // èŽ·å–é¢˜ç›®
      let questionArr = []
      let query = {
        path: '*',
        queryType: '*',
        productId: this.data.bookId,
        cmsPath: pathitem.productLinkPath,
        itemFields: {
          // SysType: 'CmsFolder',
          Embedded_QuestionBank_Stem: [],
          Embedded_QuestionBank_AnalysisCon: [],
          Embedded_QuestionBank_Answer: [],
          Embedded_QuestionBank_Option: [],
          Embedded_QuestionBank_QuestionType: [],
          Embedded_QuestionBank_StemStyle: [],
          Embedded_QuestionBank_OptionStyle: [],
          Embedded_QuestionBank_KnowledgePoint: [],
          Embedded_QuestionBank_Difficulty: []
        },
        pading: {
          start: 0,
          size: 999
        }
      }
      app.MG.store.getProductDetail(query).then((res) => {
        this.setData({
          total: res.datas.cmsDatas[0].datas.length
        })
        // total.value += res.datas.cmsDatas[0].datas.length
        let oldList
        if (oldData) {
          // æäº¤è¿‡ï¼Œå­˜åœ¨ç­”题记录
          oldList = oldData.find((item) => item.path == pathitem.productLinkPath).infoList
          this.setData({
            submitStatus: true
          })
        }
        res.datas.cmsDatas[0].datas.forEach((item, index) => {
          let oldObj = ''
          if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id)
          let questionObj = {
            // num: index, // é¢˜å·
            id: item.id,
            stem:
              item.Embedded_QuestionBank_QuestionType == 'completion'
                ? JSON.parse(item.Embedded_QuestionBank_Stem)
                  .stemTxt.replaceAll('<vacancy>', ',input,')
                  .split(',')
                : JSON.parse(item.Embedded_QuestionBank_Stem), // é¢˜å¹²
            answer: item.Embedded_QuestionBank_Answer, // ç­”案
            option: item.Embedded_QuestionBank_Option
              ? JSON.parse(item.Embedded_QuestionBank_Option)
              : '', // é€‰æ‹©é¢˜é€‰é¡¹
            analysisCon: item.Embedded_QuestionBank_AnalysisCon, // è§£æž
            questionType: item.Embedded_QuestionBank_QuestionType, // é¢˜åž‹
            optionStyle: item.Embedded_QuestionBank_OptionStyle, // é€‰é¡¹æ˜¾ç¤ºç±»åž‹
            stemStyle: item.Embedded_QuestionBank_StemStyle, // é¢˜å¹²æ˜¾ç¤ºç±»åž‹
            difficulty: item.Embedded_QuestionBank_Difficulty
              ? 4 - item.Embedded_QuestionBank_Difficulty
              : 0, // éš¾åº¦ç­‰çº§
            userAnswer: oldObj
              ? oldObj.userAnswer
              : item.Embedded_QuestionBank_QuestionType == 'completion' ||
                item.Embedded_QuestionBank_QuestionType == 'multipleChoice'
                ? []
                : '',
            isRight: oldObj ? oldObj.isRight : null,
            isComplete: oldObj ? oldObj.isComplete : false,
            isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false,
            isUnfold: '' // æŽ§åˆ¶è§£æžçš„æŠ˜å é¢æ¿æ˜¯å¦å±•å¼€
          }
          // å¤šé€‰å’Œå¡«ç©ºç­”案肯为数组,要转换JSON格式
          if (
            questionObj.questionType == 'completion' ||
            questionObj.questionType == 'multipleChoice'
          ) {
            try {
              questionObj.answer = JSON.parse(questionObj.answer)
            } catch (error) {
              questionObj.answer = item.Embedded_QuestionBank_Answer
            }
          }
          // å¡«ç©ºé¢˜æ”¹é€ 
          if (questionObj.questionType == 'completion') {
            let index = 0
            for (let i = 0; i < questionObj.stem.length; i++) {
              const item = questionObj.stem[i]
              if (item == 'input') {
                questionObj.stem[i] = {
                  num: index,
                  data: 'input'
                }
                if (!oldObj) questionObj.userAnswer[index] = ''
                index++
              }
            }
          }
          questionArr.push(questionObj)
          // æ—§æ•°æ®é‡Œ é¢˜ç›®å·²ç»ä½œç­”,修改已答题目数量
          // if (oldObj && oldObj.userAnswer.length > 0) countDownRef.value.changeAlready()
          // æ—§æ•°æ®é‡Œ é¢˜ç›®æ­£ç¡® è®°å½•正确数量
          if (questionObj.isRight) {
            this.setData({
              correctNum: this.data.correctNum + 1
            })
          }
          // if (pathitem.name == '判断题') {
          //   topicList.value.judge.data = questionArr
          //   topicList.value.judge.path = pathitem.productLinkPath
          //   if (oldData) subjectiveTotal.value += 1 // æœ‰æ—§æ•°æ®ï¼Œè®¡ç®—主观题数
          // } else if (pathitem.name == '填空题') {
          //   topicList.value.gap.data = questionArr
          //   topicList.value.gap.path = pathitem.productLinkPath
          //   if (oldData) subjectiveTotal.value += 1
          // } else if (pathitem.name == '多选题') {
          //   topicList.value.check.data = questionArr
          //   topicList.value.check.path = pathitem.productLinkPath
          //   if (oldData) subjectiveTotal.value += 1
          // } else if (pathitem.name == '单选题') {
          //   topicList.value.radio.data = questionArr
          //   topicList.value.radio.path = pathitem.productLinkPath
          //   if (oldData) subjectiveTotal.value += 1
          // } else if (pathitem.name == '简答题') {
          //   topicList.value.short.data = questionArr
          //   topicList.value.short.path = pathitem.productLinkPath
          // } else if (pathitem.name == '翻译题') {
          //   topicList.value.translate.data = questionArr
          //   topicList.value.translate.path = pathitem.productLinkPath
          // } else if (pathitem.name == '听力题') {
          //   topicList.value.listen.data = questionArr
          //   topicList.value.listen.path = pathitem.productLinkPath
          //   if (oldData) subjectiveTotal.value += 1
          // }
          let infoList =
            this.data.cardList[this.data.cardList.findIndex((item) => item.path == pathitem.productLinkPath)]
              .infoList
          infoList.push(questionObj)
          flag++;
          let questionList = []
          // if (flag == this.data.idPathList.length) {
          this.data.cardList.forEach(aitem => {
            aitem.infoList.forEach(bitem => {
              questionList.push(bitem)
              bitem.number = questionList.length
            })
          })
          this.setData({
            questionDataList: questionList
          })
          // }
        })
      })
    })
    this.setData({
      loading: false,
    })
    console.log('题目列表', this.data.questionDataList, this.data.cardList);
  },
  // èŽ·å–ç­”é¢˜æ•°æ®
  getAnswerInfo(callback) {
    app.MG.identity
      .getUserKey({
        domain: 'answerData',
        keys: [this.data.productLinkPath]
      })
      .then((res) => {
        if (callback) callback(res)
      })
  }
})
pages/bookServices/examination/examination.json
New file
@@ -0,0 +1,11 @@
{
  "usingComponents": {
    "question-options": "/pages/bookServices/examination/questionOptions/index",
    "question-schedule": "/pages/bookServices/examination/questionSchedule/index",
    "question-list": "/pages/bookServices/examination/questionList/index",
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button"
  },
  "navigationStyle": "custom"
}
pages/bookServices/examination/examination.wxml
New file
@@ -0,0 +1,24 @@
<!--pages/examination/examination.wxml-->
<!--导航区域 -->
<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"
    />
  </view>
  <view class="navbar-title">{{answerTitle}}</view>
</view>
<view class="page-content">
  <question-schedule></question-schedule>
  <question-list questionList="{{questionDataList}}"></question-list>
</view>
<!-- åº•部区域-->
<view class="page-bottom">
  <question-options></question-options>
</view>
pages/bookServices/examination/examination.wxss
New file
@@ -0,0 +1,23 @@
/* pages/examination/examination.wxss */
.nacigationBar {
  display: flex;
  align-items: center;
}
.navbar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: 600;
}
.page-content {
  box-sizing: border-box;
  width: 100%;
  height: 78vh;
  padding: 20rpx;
  background-color: #F2F3F8;
}
pages/bookServices/examination/questionList/index.js
New file
@@ -0,0 +1,44 @@
// pages/bookServices/examination/questionList/index.js
const imageCdn = 'https://tdesign.gtimg.com/mobile/demos';
const swiperList = [
  `${imageCdn}/swiper1.png`,
  `${imageCdn}/swiper2.png`,
  `${imageCdn}/swiper1.png`,
  `${imageCdn}/swiper2.png`,
  `${imageCdn}/swiper1.png`,
];
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
    questionList: {
      type: Array,
      value: []
    }
  },
  created() {
    console.log('组件传参', this.properties);
  },
  /**
   * ç»„件的初始数据
   */
  data: {
    current: 2,
    autoplay: true,
    duration: 500,
    interval: 5000,
    paginationPosition: 'bottom-right',
    swiperList,
    navigation: { type: 'fraction' },
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
  }
})
pages/bookServices/examination/questionList/index.json
New file
@@ -0,0 +1,7 @@
{
  "component": true,
  "usingComponents": {
    "t-swiper": "tdesign-miniprogram/swiper/swiper",
  "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav"
  }
}
pages/bookServices/examination/questionList/index.wxml
New file
@@ -0,0 +1,13 @@
<!--pages/bookServices/examination/questionList/index.wxml-->
<view class="question-list">
  <!-- é¢˜åž‹title -->
  <view class="question-title">
    <text class="title-name">单选题</text><text class="title-score">(每题2分)</text>
  </view>
  <!-- é¢˜ç›®åˆ—表 -->
  <swiper>
    <swiper-item wx:for="{{questionList}}">
      <text>{{item.stem.stemTxt}}</text>
    </swiper-item>
  </swiper>
</view>
pages/bookServices/examination/questionList/index.wxss
New file
@@ -0,0 +1,25 @@
/* pages/bookServices/examination/questionList/index.wxss */
.question-list {
  width: 100%;
  height: 90%;
  padding: 20rpx;
  background-color: #ffffff;
  border-radius: 20rpx;
  margin-top: 20rpx;
}
.question-title {
  font-size: 28rpx;
  margin-bottom: 20rpx;
}
.title-name {
  padding: 6rpx;
  background-color: #ff6c00;
  color: #ffffff;
  margin-right: 10rpx;
}
.title-score {
  color: #000;
}
pages/bookServices/examination/questionOptions/index.js
New file
@@ -0,0 +1,23 @@
// pages/bookServices/examination/questionOptions/index.js
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
  },
  /**
   * ç»„件的初始数据
   */
  data: {
    btnStyle: "width:320rpx;border-radius:60rpx",
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
  }
})
pages/bookServices/examination/questionOptions/index.json
New file
@@ -0,0 +1,8 @@
{
  "component": true,
  "usingComponents": {
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button"
  }
}
pages/bookServices/examination/questionOptions/index.wxml
New file
@@ -0,0 +1,24 @@
<!--pages/bookServices/examination/questionOptions/index.wxml-->
<view class="page-bottom">
  <view class="li-option">
    <t-image src="/static/images/bookService/examination/collect.png"></t-image>
    æ”¶è—
  </view>
  <view class="li-option">
    <t-image
      src="/static/images/bookService/examination/questionCard.png"
    ></t-image>
    ç­”题卡
  </view>
  <view class="li-option">
    <t-image src="/static/images/bookService/examination/setting.png"></t-image>
    è®¾ç½®
  </view>
  <view class="li-option">
    <t-image src="/static/images/bookService/examination/reset.png"></t-image>
    é‡åš
  </view>
  <view class="bottom-submit">
    <t-button theme="primary" size="large" style="{{btnStyle}}">提交</t-button>
  </view>
</view>
pages/bookServices/examination/questionOptions/index.wxss
New file
@@ -0,0 +1,31 @@
/* pages/bookServices/examination/questionOptions/index.wxss */
.page-bottom {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  position: fixed;
  bottom: 30rpx;
  width: 100%;
  height: 180rpx;
  /* background-color: red; */
}
.li-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 24rpx;
  color: #010101;
}
.page-bottom image {
  width: 36rpx;
  height: 36rpx;
}
.bottom-submit {
  --td-button-primary-bg-color: #ff6c00;
  --td-button-primary-border-color: #FF6C00;
  --td-button-primary-active-bg-color: #ff984d;
  --td-button-primary-active-border-color: #ff984d;
}
pages/bookServices/examination/questionSchedule/index.js
New file
@@ -0,0 +1,115 @@
// pages/bookServices/examination/questionSchedule/questionSchedule.js
Component({
  /**
   * ç»„件的属性列表
   */
  properties: {
  },
  created() {
    // if (props.answerType == 'option') {
    // this.startCountdown()
    this.setData({
      countdownTime: 2 * 60 * 60 * 1000
    })
    // }
  },
  detached() {
    if (this.data.countdownInterval !== null) {
      clearInterval(this.data.countdownInterval)
    }
  },
  /**
   * ç»„件的初始数据
   */
  data: {
    countdownInterval: null,   // è®¡æ—¶å™¨
    isCountdownRunning: true, // æ˜¯å¦å€’计时
    countdownTime: "",  // æ—¶é—´
    showTime: '',
  },
  observers: {
    'countdownTime': function (newValue, oldValue) {
      const showTime = this.formatTime(this.data.countdownTime)
      this.setData({
        showTime: showTime
      })
      console.log(this.data.showTime);
    }
  },
  /**
   * ç»„件的方法列表
   */
  methods: {
    // æ ¼å¼åŒ–æ—¶é—´
    formatTime(ms) {
      const hours = Math.floor((ms / (1000 * 60 * 60)) % 24)
        .toString()
        .padStart(2, '0')
      const minutes = Math.floor((ms / (1000 * 60)) % 60)
        .toString()
        .padStart(2, '0')
      const seconds = Math.floor((ms / 1000) % 60)
        .toString()
        .padStart(2, '0')
      return `${hours}:${minutes}:${seconds}`
    },
    // èŽ·å–ä¿å­˜çš„å€’è®¡æ—¶æ—¶é—´
    getSavedTime() {
      const savedTime = wx.getStorageSync('countdownTime')
      return savedTime ? parseInt(savedTime) : null
    },
    // ä¿å­˜å€’计时时间到本地存储
    saveTime() {
      wx.setStorageSync('countdownTime', this.data.countdownTime.toString())
    },
    clearTime() {
      this.setData({
        countdownTime: 2 * 60 * 60 * 1000
      })
    },
    // æš‚停或继续倒计时
    toggleCountdown() {
      if (countdownInterval) {
        clearInterval(this.data.countdownInterval)
        this.setData({
          countdownInterval: null,
          isCountdownRunning: false
        })
      } else {
        this.startCountdown()
        this.setData({
          isCountdownRunning: true
        })
      }
    },
    // å¼€å§‹å€’计时
    startCountdown() {
      // å¦‚果计时器已经存在,先清除之前的计时器
      if (this.data.countdownInterval) {
        clearInterval(this.data.countdownInterval)
        this.setData({
          countdownInterval: null
        })
      }
      this.setData({
        countdownInterval: setInterval(() => {
          this.setData({
            countdownTime: this.data.countdownTime - 1000
          })
          if (this.data.countdownTime <= 0) {
            clearInterval(this.data.countdownInterval)
            this.setData({
              countdownTime: 0,
              isCountdownRunning: false
            })
          }
          this.saveTime()
        }, 1000)
      })
    }
  }
})
pages/bookServices/examination/questionSchedule/index.json
New file
@@ -0,0 +1,6 @@
{
  "component": true,
  "usingComponents": {
    "t-progress": "tdesign-miniprogram/progress/progress"
  }
}
pages/bookServices/examination/questionSchedule/index.wxml
New file
@@ -0,0 +1,11 @@
<!--pages/bookServices/examination/questionSchedule/questionSchedule.wxml-->
<view class="schedule">
  <view class="schedule-top">
    <view class="question-schedule">答题进度<text class="parimary-color question-num">1</text> <text>/18</text></view>
    <view class="remainder">剩余时间 <text class="parimary-color">{{showTime}}</text></view>
  </view>
  <view class="schedule-progress">
    <t-progress percentage="80" color="#ff6c00" label="" />
  </view>
</view>
pages/bookServices/examination/questionSchedule/index.wxss
New file
@@ -0,0 +1,32 @@
/* pages/bookServices/examination/questionSchedule/questionSchedule.wxss */
.schedule {
  background-color: #ffffff;
  padding: 20rpx;
  font-size: 28rpx;
  border-radius: 20rpx;
}
.schedule-top {
  display: flex;
  justify-content: space-between;
}
.question-schedule {
  color: #000;
}
.schedule-progress {
  margin-top: 20rpx;
}
.remainder {
  color: #545C63;
}
.parimary-color {
  color: #ff6c00;
}
.question-num {
  margin-left: 10rpx;
}
pages/bookServices/list/index.js
@@ -9,7 +9,11 @@
    searchValue: '',
    path: '',
    pathList: [],
    pageCount: {
    page: 1,
      total: 0,
    },
    isMore: null,
    assortCheck: {
      name: '',
      code: '',
@@ -135,6 +139,24 @@
   */
  onReachBottom(e) {
    console.log('底部');
    const flag = this.data.bookList.length < this.data.pageCount.total
    if (flag) {
      this.setData({
        isMore: true,
        "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('没有更多了');
    }
  },
  /**
@@ -299,8 +321,8 @@
        height: 145,
      },
      paging: {
        start: (this.data.page - 1) * 16,
        size: 16,
        start: 0,
        size: this.data.pageCount.page * 8,
      },
      fields: {
        author: [],
@@ -313,8 +335,10 @@
    app.MG.store.getProductList(query).then((res) => {
      this.setData({
        bookList: res.datas,
        enable: false
        enable: false,
        "pageCount.total": res.total
      });
      console.log('图书列表', res, this.data.pageCount);
    });
  },
  // ä¸€çº§åˆ†ç±»åˆ‡æ¢
pages/bookServices/list/index.json
@@ -5,8 +5,8 @@
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-image": "tdesign-miniprogram/image/image",
    "t-search": "tdesign-miniprogram/search/search",
    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh"
    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh",
    "t-loading": "tdesign-miniprogram/loading/loading"
  },
  "navigationStyle": "custom",
  "onReachBottomDistance": 250
  "navigationStyle": "custom"
}
pages/bookServices/list/index.wxml
@@ -26,7 +26,7 @@
    </view>
  </view>
  <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onRefresh">
    <scroll-view scroll-y="{{true}}" class="list-container">
    <scroll-view scroll-y="{{true}}" class="list-container" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom">
      <view class="assort-title">
        <view class="title-box"></view>
        <view class="title-name">{{assortCheck.name}}</view>
@@ -40,6 +40,10 @@
          <view class="book-author book-color">{{item.author}}</view>
        </view>
      </view>
      <view class="bottom-box">
        <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" />
        <text wx:if="{{isMore == false}}">没有更多了</text>
      </view>
    </scroll-view>
  </t-pull-down-refresh>
</view>
pages/bookServices/list/index.wxss
@@ -39,7 +39,7 @@
.list-container {
  height: 80vh;
  margin-top: 20rpx;
  background-color: #fff;
  /* background-color: #fff; */
}
.assort-title {
@@ -69,7 +69,7 @@
.book-box {
  box-sizing: border-box;
  width: 48%;
  background-color: #f7f7f7;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
@@ -93,6 +93,7 @@
.book-name {
  margin-top: 24rpx;
  color: #333;
  width: 100%;
  font-size: 28rpx;
  font-weight: 700;
@@ -101,15 +102,25 @@
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  text-align: left;
}
.book-author {
  color: #333;
  margin-top: 16rpx;
  width: 100%;
  font-size: 24rpx;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-align: left;
}
.bottom-box {
  display: flex;
  justify-content: center;
  color: #999;
  height: 80rpx;
  font-size: 28rpx;
  --td-loading-color: #ff6c00
}
pages/cart/paymentPage/index.wxml
@@ -17,10 +17,10 @@
  <!--
  <t-button t-class="wrapper" theme="primary" size="large" variant="outline" data-key="showCloseBtn" bind:tap="showDialog" block>
    å¸¦å…³é—­æŒ‰é’®
  </t-button>
  </t-button> -->
  <t-dialog visible="{{showCloseBtn}}" close-btn bind:confirm="closeDialog" bind:cancel="closeDialog">
    <view slot="content" class="slotContent">
      <view class="myQrcodeBox">
pages/resourceDetails/document/index.js
New file
@@ -0,0 +1,66 @@
// pages/resourceDetails/document/index.js
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  }
})
pages/resourceDetails/document/index.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
pages/resourceDetails/document/index.wxml
New file
@@ -0,0 +1,6 @@
<!--pages/resourceDetails/document/index.wxml-->
<text>pages/resourceDetails/document/index.wxml</text>
<view>
</view>
pages/resourceDetails/document/index.wxss
New file
@@ -0,0 +1 @@
/* pages/resourceDetails/document/index.wxss */
pages/resourceDetails/index.js
File was deleted
pages/resourceDetails/index.wxml
File was deleted
pages/resourceDetails/index.wxss
File was deleted
pages/resourceDetails/myAudio/index.js
New file
@@ -0,0 +1,52 @@
// audio.js
Page({
  data: {
    poster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
    name: '此时此刻',
    author: '许巍',
    src: 'http://182.92.203.7:3001/file/api/ApiDownload?md5=aa72e586dd93b7c2633bee6320bc6c76',
    navBarHeight: '',
    barHeight: '',
  },
  onLoad(options) {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // èƒ¶å›Šä¿¡æ¯
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // å¯¼èˆªæ é«˜åº¦
    this.setData({
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
    })
  },
  onReady: function (e) {
    // ä½¿ç”¨ wx.createAudioContext èŽ·å– audio ä¸Šä¸‹æ–‡ context
    this.audioCtx = wx.createAudioContext('myAudio')
  },
  audioPlay: function () {
    this.audioCtx.play()
  },
  audioPause: function () {
    this.audioCtx.pause()
  },
  audio14: function () {
    this.audioCtx.seek(14)
  },
  audioStart: function () {
    this.audioCtx.seek(0)
  },
  goBack() {
    wx.navigateBack()
  },
  MusicStart: function (e) {
    var progress = parseInt((e.detail.currentTime / e.detail.duration) * 100)
    var that = this
    that.setData({
      progress: progress
    })
    console.log('音乐播放进度为' + progress + '%')
  },
})
pages/resourceDetails/myAudio/index.json
pages/resourceDetails/myAudio/index.wxml
New file
@@ -0,0 +1,39 @@
<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" />
  </view>
  <view class="navbar-title">资源详情-音频</view>
</view>
<view class="audioBox">
  <view class="">
    <image class="imageFront" src="/static/images/resourceDetailsMyAudio/cd.png" mode="aspectFit" />
    <image class=" imageAfter" src="/static/images/resourceDetailsMyAudio/video-bg.png" mode="aspectFit" />
  </view>
  <view class="controlBox">
    <image src="/static/images/resourceDetailsMyAudio/shangyizhang.png" mode="" />
    <image bindtap="audioPlay" src="/static/images/resourceDetailsMyAudio/zanting.png" mode="" />
    <image bindtap="audioPause" src="/static/images/resourceDetailsMyAudio/xiayizhang.png" mode="" />
    <image src="/static/images/resourceDetailsMyAudio/Full screen.png" mode="" />
    <!-- <view class="free-MusicProgress">
      <view style="width:{{progress}}%;"></view>
    </view> -->
  </view>
</view>
<audio wx:if="{{false}}" bindtimeupdate="MusicStart" poster="{{poster}}" name="{{name}}" author="{{author}}" src="{{src}}" id="myAudio" controls loop>
</audio>
<!-- <button type="primary" >播放</button>
<button type="primary">暂停</button>
<button type="primary" bindtap="audio14">设置当前播放时间为14秒</button>
<button type="primary" bindtap="audioStart">回到开头</button> -->
pages/resourceDetails/myAudio/index.wxss
New file
@@ -0,0 +1,66 @@
/* pages/resourceDetails/myAudio/index.wxss */
.nacigationBar {
  background-color: #fff;
  display: flex;
  align-items: center;
}
.navbar-title {
  white-space: nowrap;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 5rpx;
}
.audioBox {
  width: 100%;
  height: 350rpx;
}
.imageFront {
  width: 300rpx;
  height: 300rpx;
  position: absolute;
  top: 150rpx;
  left: 250rpx;
}
.imageAfter {
  width: 100%;
}
.controlBox {
  width: 750rpx;
  height: 96rpx;
  background: #000000;
  border-radius: 0rpx 0rpx 0rpx 0rpx;
  opacity: 0.6;
  position: relative;
}
.controlBox image {
  width: 45rpx;
  height: 45rpx;
  margin: 20rpx 35rpx;
}
audio {
  position: relative;
}
.free-MusicProgress {
  position: absolute;
  width: 78%;
  left: 21.7%;
  bottom: 1px;
  background: #C3C3C3;
}
.free-MusicProgress>view {
  background: #48c23d;
  height: 5px;
}
pages/resourceDetails/myVideo/index.js
New file
@@ -0,0 +1,243 @@
// pages/resourceDetails/index.js
const app = getApp()
Page({
  /**
   * é¡µé¢çš„初始数据
   */
  data: {
    navBarHeight: '',
    barHeight: '',
    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
    activeValues: [0],
    dialogKey: true,
    style: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;',
    activeId: '',
    bookId: '',
    bookName: '',
    cmsId: '',
    parentName: '',
    parentProductLinkPath: '',
    productLinkPath: '',
    threeLeveData: [],
    showData: '',
    src: '',
    selectedId: null,
    topicId: ''
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面加载
   */
  onLoad(options) {
    console.log(this.data.dialogKey, 'dialogKey');
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // èƒ¶å›Šä¿¡æ¯
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // å¯¼èˆªæ é«˜åº¦
    this.setData({
      navBarHeight: navBarHeight,
      barHeight: systInfo.statusBarHeight,
      activeId: options.activeId,
      bookId: options.bookId,
      bookName: options.bookName,
      cmsId: options.cmsId,
      parentName: options.parentName,
      parentProductLinkPath: options.parentProductLinkPath,
      productLinkPath: options.productLinkPath
    })
    console.log(this.data.parentProductLinkPath, 'parentProductLinkPath');
    this.resourceDetailsData()
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面显示
   */
  onShow() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面隐藏
   */
  onHide() {
  },
  /**
   * ç”Ÿå‘½å‘¨æœŸå‡½æ•°--监听页面卸载
   */
  onUnload() {
  },
  /**
   * é¡µé¢ç›¸å…³äº‹ä»¶å¤„理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * é¡µé¢ä¸Šæ‹‰è§¦åº•事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * ç”¨æˆ·ç‚¹å‡»å³ä¸Šè§’分享
   */
  onShareAppMessage() {
  },
  onTabsChange(event) {
  },
  onTabsClick(event) {
  }, handleChange(e) {
    this.setData({
      activeValues: e.detail.value,
    });
  },
  onTakeNotes() {
  },
  showDialog(e) {
    const { key } = e.currentTarget.dataset;
    this.setData({ [key]: true, dialogKey: key });
  },
  closeDialog() {
    this.setData({
      dialogKey: false
    });
  },
  goBack() {
    wx.navigateBack();
  },
  resourceDetailsData() {
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookId,
      cmsPath: this.data.parentProductLinkPath,
      itemFields: {
        SysType: 'CmsFolder',
        // èµ„源类型,试读文件,是否允许下载等参数
        selectType: [],
        freeFile: [],
        file: [],
        protectedFile: [],
        resourcesClassification: [],
        isDownload: [],
        jsek_resourceBrief: [],
        jsek_link: [],
        jsek_questionBank: [],
        learnSelectType: []
      },
      pading: {
        start: 0,
        size: 999
      }
    }
    app.MG.store.getProductDetail(query).then(res => {
      console.log(res, 'res');
      const list = []
      res.datas.cmsDatas[0].datas.forEach((item) => {
        this.data.threeLeveData.push(item)
        list.push(item)
        this.setData({
          threeLeveData: list
        })
        if (this.data.productLinkPath == item.productLinkPath) {
          console.log(item, 'item');
          this.setData({
            showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file
          })
        }
        // console.log(this.data.threeLeveData, 'threeLeveData');
      })
    })
  },
  onVideo(e) {
    this.setData({
      selectedId: e.currentTarget.dataset.index,
    })
    // console.log(e);
    const item = e.currentTarget.dataset.item
    // console.log(item);
    if (item.selectType == "video") {
      console.log(item.file);
      this.setData({
        showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file
      })
      console.log(this.data.showData);
    } else {
      console.log(app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file);
    }
  },
  getProductUserSubmitTopicGet() {
    app.MG.ugc.getProductUserSubmitTopic({
      productId: this.data.bookId,
      appRefCode: app.config.appRefCode
    }).then((res) => {
      console.log(res);
      this.setData({
        topicId: res.id
      })
    })
  },
  newTopicMessageGet() {
    let query = {
      topicIdOrRefCode: topicId + '',
      name: titleText.value,
      content: form.value.noteContent,
      type: 'note',
      cmsTypeRefCode: '',
      newDataListRequest: []
    }
    app.MG.ugc.newTopicMessage(query).then(res => {
      console.log(res);
    })
  },
  // currentTarget
  onConfirm() {
    console.log(1111);
  },
  onCancellation() {
    console.log(222);
    this.data.dialogKey = false
  }
})
pages/resourceDetails/myVideo/index.json
New file
@@ -0,0 +1,14 @@
{
  "component": true,
  "usingComponents": {
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-tabs": "tdesign-miniprogram/tabs/tabs",
    "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
    "t-collapse": "tdesign-miniprogram/collapse/collapse",
    "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel",
    "t-button": "tdesign-miniprogram/button/button",
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-input": "tdesign-miniprogram/input/input"
  },
  "navigationStyle": "custom"
}
pages/resourceDetails/myVideo/index.wxml
New file
@@ -0,0 +1,79 @@
<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" />
  </view>
  <view class="navbar-title">资源详情-视频</view>
</view>
<!-- è§†é¢‘ ç­‰ -->
<view class="videoBox">
  <video src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video>
</view>
<!-- æ ‡é¢˜ -->
<view class="titleBox">基础教育研究背景总体设计</view>
<view class="contentBox">
  <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}}" style="width: 750rpx;">
      <view class="wrapper">
        <t-collapse value="{{activeValues}}" bind:change="handleChange">
          <t-collapse-panel header="{{parentName}}" value="{{0}}" expandIcon>
            <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}">
              <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view>
            </view>
          </t-collapse-panel>
        </t-collapse>
      </view>
    </t-tab-panel>
    <!-- ç¬”记展示 -->
    <t-tab-panel label="笔记" value="1" style="{{tabPanelstyle}}">
      <view class="wrapper">
        <t-collapse value="{{activeValues}}" bind:change="handleChange">
          <t-collapse-panel header="第1第1课时 è¯¾ç¨‹è§†é¢‘" value="{{0}}" expandIcon>
            <view> æ­¤å¤„可自定义内容此处可自定义内容此处可自定义内容此处可自定义内容此处可自定义内容此处可自定义内容此处可自定义内容此处可自定义内容</view>
            <view class="operateBox">
              <view>2023-08-29</view>
              <view class="iconBox">
                <image src="/static/images/resourceDetails/jibijiicon2.png" mode="" />
                <image src="/static/images/resourceDetails/jibijiicon3.png" mode="" />
              </view>
            </view>
          </t-collapse-panel>
        </t-collapse>
      </view>
    </t-tab-panel>
  </t-tabs>
  <!-- è®°ç¬”è®° -->
  <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog">
    <view class="takeNotesLining">
      <image src="/static/images/resourceDetails/jibijii.png" mode="" /> è®°ç¬”è®°
    </view>
  </view>
</view>
<!-- è®°ç¬”记弹窗 -->
<t-dialog visible="{{showCloseBtn}}" close-btn bind:confirm="closeDialog" bind:cancel="closeDialog">
  <view slot='title' class="dialogTitleBox">一、道德与品德的关系-有试看
    <image class="titleImageBox" src="/static/images/resourceDetails/edit.png" alt="" />
  </view>
  <view slot='content'>
    <view class="input-example">
      <view class="input-example__label"> å†…容 </view>
      <t-input class="inputBox" placeholder="请输入文字" borderless="{{true}}" style="{{style}}" />
    </view>
    <view class="buttonBox">
      <view>
        <t-button bind:tap="onCancellation" style="margin: 20rpx 30rpx;" variant="outline" size="extra-small">取消</t-button>
        <t-button bind:tap="onConfirm" style="margin: 20rpx 30rpx;" theme="primary" size="extra-small">确认</t-button>
      </view>
    </view>
  </view>
</t-dialog>
pages/resourceDetails/myVideo/index.wxss
New file
@@ -0,0 +1,162 @@
/* pages/resourceDetails/index.wxss */
.nacigationBar {
  background-color: #fff;
  display: flex;
  align-items: center;
}
.navbar-title {
  white-space: nowrap;
  /* overflow: hidden; */
  text-overflow: ellipsis;
  color: #0F1214;
  font-size: 40rpx;
  font-weight: bold;
  margin-bottom: 5rpx;
}
.videoBox {
  width: 100%;
}
.videoBox video {
  width: 100vw;
}
.titleBox {
  margin: 30rpx;
  border-bottom: 1px #f4f4f4 solid;
  padding-bottom: 20rpx;
  font-weight: bold;
}
.contentBox {
  position: relative;
}
.contentBox .custom-tabs {
  /* margin-bottom: 32rpx; */
  width: 400rpx;
}
.t-tabs__content {
  width: 750rpx !important;
  overflow: auto !important;
}
.custom-panel {
  /* height: 120px; */
  width: 750rpx;
  /* height: 200rpx; */
}
.contentBox .takeNotes {
  position: absolute;
  top: 5rpx;
  right: 0;
  width: 350rpx;
  border-bottom: 1px solid #f4f4f4;
}
.takeNotes image {
  width: 30rpx;
  height: 30rpx;
  margin-top: 10rpx;
  margin-right: 10rpx;
}
.takeNotesLining {
  margin: 25rpx;
  display: flex;
  justify-content: flex-end;
}
.operateBox {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.iconBox {
  display: flex;
}
.iconBox image {
  width: 26rpx;
  height: 26rpx;
  margin: 0 10rpx;
}
.t-dialog__content {
  padding: 0 !important;
}
.titleImageBox {
  width: 40rpx;
  height: 40rpx;
  margin-left: 20rpx;
}
.dialogTitleBox {
  margin: 30rpx;
  border-bottom: 1px #f4f4f4 solid;
  padding-bottom: 20rpx;
  font-weight: bold;
  display: flex;
  align-items: center;
}
.input-example {
  --td-input-vertical-padding: 24rpx;
  background-color: #fff;
  padding: 32rpx 32rpx 16rpx;
}
.input-example__label {
  color: rgba(0, 0, 0, 0.9);
  font-size: 24rpx;
  line-height: 40rpx;
  margin: 0 8rpx 16rpx;
}
.buttonBox {
  display: flex;
  justify-content: flex-end;
}
/* .inputBox {
  height: 500rpx;
} */
.detailsName {
  margin: 30rpx;
  width: 90%;
  height: 60rpx;
  display: flex;
  align-items: center;
  background: #F4F4F4;
  padding-left: 20rpx;
}
.detailsName:hover {
  background-color: #fff0e6;
  width: 90%;
  height: 60rpx;
  color: #ff6c00;
}
.audioBox {
  width: 750rpx;
  height: 200rpx;
}
pages/retrievalPage/index.wxml
@@ -24,7 +24,7 @@
      <view class="bookDataForBox" wx:for="{{bookData}}" wx:key="index" wx:for-item="item" wx:for-index="index">
        <view class="imageBox">
          <image src="{{item.icon}}" mode="" />
          <image src="{{item.icon}}" mode="aspectFill" />
        </view>
        <view class="bookDataNmae">
          {{item.name}}
static/images/bookService/detail/cart.png
static/images/bookService/detail/compliceHover.png
static/images/bookService/detail/cuoti.png
static/images/bookService/detail/deleteHover.png
static/images/bookService/detail/edit.png
static/images/bookService/detail/feedback.png
static/images/bookService/detail/lianxi-icon.png
static/images/bookService/detail/makeNote.png
static/images/bookService/detail/note-icon.png
static/images/bookService/detail/practice-icon.png
static/images/bookService/detail/test-icon.png
static/images/bookService/detail/wodeshoucang.png
static/images/bookService/detail/zujuan.png
static/images/bookService/examination/collect.png
static/images/bookService/examination/questionCard.png
static/images/bookService/examination/reset.png
static/images/bookService/examination/setting.png
static/images/resourceDetails/jibijii.png
static/images/resourceDetails/jibijiicon2.png
static/images/resourceDetails/jibijiicon3.png
static/images/resourceDetailsMyAudio/Full screen.png
static/images/resourceDetailsMyAudio/cd.png
static/images/resourceDetailsMyAudio/jibiji£¯icon.png
static/images/resourceDetailsMyAudio/shangyizhang.png
static/images/resourceDetailsMyAudio/video-bg.png
static/images/resourceDetailsMyAudio/xiayizhang.png
static/images/resourceDetailsMyAudio/zanting.png