litian
2024-09-06 266c7278841d2cbae5e9ab969ffd2efae1d0dda5
renwu
19个文件已修改
4个文件已添加
920 ■■■■ 已修改文件
app.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnTask/index.js 305 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnTask/index.json 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnTask/index.wxml 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/learnTask/index.wxss 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myVideo/index.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/myVideo/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/publishBooks/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/paymentPage/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.js 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.wxml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.wxss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalTextbooks/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.js 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
services/home/home.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -76,7 +76,8 @@
        "pages/bookServices/examination/examination",
        "pages/bookServices/webpage/index",
        "pages/components/webView/index",
        "pages/bookServices/detail/buyResource/index"
        "pages/bookServices/detail/buyResource/index",
        "pages/bookServices/detail/components/learnTask/index"
      ]
    }
  ],
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js
@@ -63,6 +63,11 @@
      this.setData({
        buy: type
      })
    },
    goLearnTask() {
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}`,
      })
    }
  }
})
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml
@@ -1,43 +1,21 @@
<!--pages/bookServices/detail/components/learnResource/learnResource.wxml-->
<view
  class="learnResource"
  theme="primary"
  style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};"
>
  <t-button
    wx:if="{{isshowDrawBtn}}"
    loading="{{receive}}"
    class="btn"
    theme="primary"
    style="height: 72rpx; font-size: 28rpx"
    t-class="external-class"
    bind:tap="getFreeResource"
  >
<view class="learnResource" theme="primary" style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};">
  <t-button wx:if="{{isshowDrawBtn}}" loading="{{receive}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx" t-class="external-class" bind:tap="getFreeResource">
    <view slot="content" class="btn-content">
      <image src=" /static/images/bookService/detail/yijianlingqu.png" />
      <text>领取查看</text>
    </view>
  </t-button>
  <t-button
    loading="{{buy}}"
    class="btn"
    theme="primary"
    style="height: 72rpx; font-size: 28rpx"
    bind:tap="goBuyResource"
    style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}"
  >
  <t-button loading="{{buy}}" class="btn" theme="primary" bind:tap="goBuyResource" style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}">
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/yijiangoumai.png" />
      <text>资源购买</text>
    </view>
  </t-button>
  <!-- <t-button
    class="btn"
    theme="primary"
    style="height: 72rpx; font-size: 28rpx"
    wx:if="{{false}}"
  >
    <image src="/static/images/bookService/detail/renwudan/icon.png" />
    学习任务单
  <!-- <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;margin:0 20rpx" bind:tap="goLearnTask">
    <view slot="content" class="btn-content">
      <image src="/static/images/bookService/detail/renwudan/icon.png" />
      <text>学习任务单</text>
    </view>
  </t-button> -->
</view>
</view>
packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss
@@ -8,7 +8,7 @@
}
.btn {
  width: 300rpx;
  width: 220rpx;
  font-size: 28rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
packageBookService/pages/bookServices/detail/components/learnTask/index.js
New file
@@ -0,0 +1,305 @@
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    bookId: '',
    consumer: '',
    bookInfo: {},
    menuList: [],
    loading: true,
    name: '',
    school: '',
    class: '',
    learnTime: '2',
    taskShow: false,
    dataList: [], //任务单
    tasksListData: [], //已填写任务单messsge
    taskInfo: {}, //选中任务单目录
    tasksData: {}, //已填写任务单
    userId: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).id,
    isUpdate: false,
    taskId: 0, //默认选中目录id
    autosize: {
      maxHeight: 120,
      minHeight: 80,
    },
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if (options) {
      this.setData({
        bookId: options.bookId,
        consumer: options.consumer
      });
      this.getResourceData()
    }
  },
  getResourceData() {
    this.setData({
      loading: true,
    });
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookId,
      cmsPath: 'jsek_learningTasks',
      // cmsType: '*',
      itemFields: {
        SysType: 'CmsFolder'
      },
      pading: {
        start: 0,
        size: 999
      }
    }
    app.MG.store.getProductDetail(query).then((res) => {
      this.setData({
        bookInfo: res.datas,
      });
      if (res.datas.cmsDatas[0].datas) {
        let list = res.datas.cmsDatas[0].datas
        let dataLists = []
        list.forEach(async (item) => {
          if (item.childrenFolderCount > 0) {
            let query = {
              path: '*',
              queryType: '*',
              productId: this.data.bookId,
              cmsPath: item.productLinkPath,
              // cmsType: '*',
              itemFields: {
                SysType: 'CmsFolder'
              },
              pading: {
                start: 0,
                size: 99
              }
            }
            const data = await app.MG.store.getProductDetail(query).then((res1) => {
              // item.children = res1.datas.cmsDatas[0].datas
              return res1.datas.cmsDatas[0].datas
            })
            item.children = data
          }
          dataLists.push(item)
        })
        this.setData({
          menuList: dataLists,
          loading: false
        });
        console.log(this.data.menuList)
      }
      this.getTasksList()
    })
  },
  getTask(e) {
    console.log(e, 123)
    let data = e.currentTarget.dataset.item
    this.setData({
      taskShow: true,
    });
    this.taskSelect(data)
  },
  onVisibleChange(e) {
    this.setData({
      taskShow: e.detail.visible,
    });
  },
  onCloseTask() {
    this.setData({
      taskShow: false,
      dataList: []
    });
  },
  getTasksList() {
    let query = {
      start: 0,
      size: 999,
      sort: {
        type: 'Desc',
        field: 'CreateDate'
      },
      appRefCode: app.config.appRefCode,
      topicIdOrRefCode: 'learningTasks'
    }
    app.MG.ugc.getTopicMessageList(query).then((res) => {
      this.setData({
        tasksListData: res.datas,
      });
    })
  },
  taskSelect(item) {
    if (!item.children) {
      this.setData({
        taskInfo: item,
        dataList: []
      });
      if (this.data.tasksListData.length > 0) {
        this.data.tasksListData.forEach((item1) => {
          let content = JSON.parse(item1.content)
          if (content.id == this.data.taskInfo.id && content.userId == this.data.userId) {
            isUpdate.value = true
            tasksData.value = item1
            form.name = content.userName
            form.school = content.school
            form.class = content.class
            form.learnTime = content.learnTime
            this.setData({
              isUpdate: true,
              tasksData: item1,
              name: content.userName,
              school: content.school,
              class: content.class,
              learnTime: content.learnTime
            });
            this.getChildTasksList()
            if (content.evaluate.length > 0) {
              content.evaluate.forEach((element) => {
                if (this.data.consumer == 'classmate') {
                  element.mateEvaluation = ''
                }
                if (this.data.consumer == 'teacher') {
                  element.teacherEvaluation = ''
                }
              })
              this.setData({
                dataList: content.evaluate
              });
            }
            console.log(1111)
          } else {
            this.goDetail(item)
          }
        })
      } else {
        this.goDetail(item)
      }
    }
  },
  goDetail(item) {
    this.setData({
      dataList: []
    });
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookId,
      cmsPath: item.productLinkPath,
      // cmsType: '*',
      itemFields: {
        SysType: 'CmsFolder',
        subtaskDescription: [],
        learningSuggestions: []
      },
      pading: {
        start: 0,
        size: 99
      }
    }
    app.MG.store.getProductDetailNoChildren(query).then((res) => {
      if (res.datas.cmsDatas[0].datas.length > 0) {
        res.datas.cmsDatas[0].datas.forEach((item) => {
          item.introspection = ''
          item.completion = ''
          item.selfEvaluation = ''
          item.mateEvaluation = ''
          item.teacherEvaluation = ''
        })
      }
      this.setData({
        dataList: res.datas.cmsDatas[0].datas
      });
      console.log(this.data.dataList, 444)
    })
  },
  getChildTasksList() {
    let query = {
      start: 0,
      size: 999,
      sort: {
        type: 'Desc',
        field: 'CreateDate'
      },
      appRefCode: app.config.appRefCode,
      topicIdOrRefCode: 'learningTasks',
      parentId: this.data.tasksData.id
    }
    app.MG.ugc.getChildTopicMessageList(query).then((res) => {
      if (res.datas.length > 0) {
        this.data.dataList.forEach((item) => {
          console.log(item, 1)
          res.datas.forEach((item1) => {
            let content = JSON.parse(item1.content)
            if (content.teacherComment) {
              content.teacherComment.forEach((item2) => {
                if (item.id == item2.childTaskId) {
                  item.teacherEvaluation.push(item2)
                }
              })
            }
            if (content.mateComment) {
              content.mateComment.forEach((item3) => {
                if (item.id == item3.childTaskId) {
                  item.mateEvaluation.push(item3)
                }
              })
            }
          })
        })
      }
    })
  },
  //任务填写
  //反思
  onIntrospectionInput(e) {
    console.log(e)
  },
  //完成情况
  onCompletionInput(e) {
  },
  //自己评价
  onSelfInput(e) {
  },
  //同伴评价
  onMateInput(e) {
  },
  //老师评价
  onTeacherInput(e) {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
packageBookService/pages/bookServices/detail/components/learnTask/index.json
New file
@@ -0,0 +1,12 @@
{
  "navigationBarTitleText": "学习任务单",
  "usingComponents": {
    "t-input": "tdesign-miniprogram/input/input",
    "t-textarea": "tdesign-miniprogram/textarea/textarea",
    "t-loading": "tdesign-miniprogram/loading/loading",
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-popup": "tdesign-miniprogram/popup/popup",
    "t-button": "tdesign-miniprogram/button/button",
    "empty": "/components/empty/index"
  }
}
packageBookService/pages/bookServices/detail/components/learnTask/index.wxml
New file
@@ -0,0 +1,147 @@
<view class="container">
  <view class="page-body">
    <view class="from-item">
      <view class="label"><text class="icon"></text> 图书名称: </view>
      <view class="item-content">
        {{bookInfo.name}}
      </view>
    </view>
    <view class="from-item">
      <view class="label"><text class="icon">*</text> 姓名: </view>
      <view class="item-content">
        <t-input placeholder="请输入姓名" borderless value="{{name}}" bindchange="bindTnputBlur" />
      </view>
    </view>
    <view class="from-item">
      <view class="label"> <text class="icon">*</text>学校: </view>
      <view class="item-content">
        <t-input placeholder="输学校名称" borderless value="{{school}}" type="number" bindchange="onSchoolInput" />
      </view>
    </view>
    <view class="from-item">
      <view class="label"><text class="icon">*</text> 班级: </view>
      <view class="item-content">
        <t-input placeholder="请输入班级" borderless value="{{class}}" bindchange="bindClassBlur" />
      </view>
    </view>
    <view class="from-item">
      <view class="label"><text class="icon">*</text> 学习时长: </view>
      <view class="item-content">
        {{learnTime}}
      </view>
    </view>
    <!-- <view class="from-item">
      <view class="label"> <text class="icon">*</text>反馈内容: </view>
      <view class="item-content">
        <t-textarea placeholder="请输入反馈内容" value="{{content}}" disableDefaultPadding="{{true}}" autosize="{{true}}" bind:line-change="onLineChange" maxlength="300" indicator bindchange="bindTextAreaBlur" />
      </view>
    </view> -->
  </view>
  <view class="content-Box">
    <view class="item-title">
      <image src="/static/images/bookService/detail/renwudan/icon.png" class="icon" />
      <view>学习任务单</view>
    </view>
    <view class="item-box" wx:if="{{menuList.length > 0 && !loading}}">
      <view wx:for="{{menuList}}" wx:for-item="item" wx:for-index="index" wx:key="id" class="item">
        <view class="itemCon">
          <view>
          </view>
          <view bind:tap="getTask" data-item="{{item}}">{{ item.name }}</view>
        </view>
        <view class="childBox">
          <view wx:for="{{item.children}}" wx:for-item="item1" wx:for-index="index" wx:key="id" class="item">
            <view bind:tap="getTask" data-item="{{item}}">{{ item1.name }}</view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <view class="popupBox">
    <t-popup visible="{{taskShow}}" bind:visible-change="onVisibleChange" placement="center">
      <view class="block">
        <scroll-view class="srcolbox" scroll-y scroll-height-animation="true">
          <view class="dataList">
            <view wx:if="{{dataList.length > 0}}">
              <view wx:for="{{dataList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="item-Con-Box">
                <view class="description">
                  <view class="label">
                    <view>{{ index + 1 }}、</view>
                    <view class="des">任务描述</view>
                  </view>
                  <view class="name">{{ item.subtaskDescription }}</view>
                </view>
                <view class="pointer">
                  <view class="name">图书建议:</view>
                  <view>{{ item.learningSuggestions }}</view>
                </view>
                <view class="evaluateBox">
                  <view class="box-list">
                    <view class="lable"><text class="icon">*</text>学习反思:</view>
                    <view class="inputBox">
                      <t-textarea placeholder="请输入学习反思" value="{{item.introspection}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" data-index="{{index}}" bindchange="onIntrospectionInput" />
                    </view>
                  </view>
                  <view class="box-list">
                    <view class="lable"><text class="icon">*</text>完成情况:</view>
                    <view class="inputBox">
                      <t-textarea placeholder="请输入完成情况" value="{{item.completion}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onCompletionInput" />
                    </view>
                  </view>
                  <view class="box-list">
                    <view class="lable"><text class="icon">*</text>自己评:</view>
                    <view class="inputBox">
                      <t-textarea placeholder="请输入评价" value="{{item.selfEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onSelfInput" />
                    </view>
                  </view>
                  <view class="box-list" wx:if="{{consumer == 'classmate' || !consumer}}">
                    <view class="lable">同伴评:</view>
                    <view class="inputBox">
                      <t-textarea placeholder="请输入评价" value="{{item.mateEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onMateInput" wx:if="{{consumer == 'classmate'}}" />
                      <view wx:if="{{isUpdate && item.mateEvaluation.length > 0}}" class="rateList">
                        <view wx:for="{{item.mateEvaluation}}" wx:for-item="mateItem" wx:key="index">
                          <view class="userName">{{ mateItem.userName }}</view>
                          <view>{{ mateItem.evaluation }}</view>
                        </view>
                      </view>
                      <text wx:if="{{consumer != 'classmate' && item.mateEvaluation.length == 0}}">暂无数据</text>
                    </view>
                  </view>
                  <view class="box-list" wx:if="{{consumer == 'teacher' || !consumer}}">
                    <view class="lable">老师评:</view>
                    <view class="inputBox">
                      <t-textarea placeholder="请输入评价" value="{{item.teacherEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onTeacherInput" wx:if="{{consumer == 'teacher'}}" />
                      <view wx:if="{{isUpdate && item.teacherEvaluation.length > 0}}" class="rateList">
                        <view wx:for="{{item.teacherEvaluation}}" wx:for-item="mateItem" wx:key="index">
                          <view class="userName">{{ mateItem.userName }}</view>
                          <view>{{ mateItem.evaluation }}</view>
                        </view>
                      </view>
                      <text wx:if="{{consumer != 'teacher' && item.teacherEvaluation.length == 0}}">暂无数据</text>
                    </view>
                  </view>
                </view>
              </view>
            </view>
            <view wx:if="{{dataList.length == 0}}" class="empyt">
              <empty />
            </view>
            <view class="buttonBox">
              <t-button class="btn" theme="primary" bind:tap="submitComment" wx:if="{{consumer}}">
                <view slot="content" class="btn-content">提交</view>
              </t-button>
              <t-button class="btn" theme="primary" bind:tap="updateSubmit" wx:if="{{isUpdate && !consumer}}">
                <view slot="content" class="btn-content">邀请评价</view>
              </t-button>
              <t-button class="btn" theme="primary" bind:tap="inviteBtn" wx:if="{{!isUpdate && !consumer}}">
                <view slot="content" class="btn-content">邀请评价</view>
              </t-button>
            </view>
          </view>
        </scroll-view>
        <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="onCloseTask" />
      </view>
    </t-popup>
  </view>
</view>
packageBookService/pages/bookServices/detail/components/learnTask/index.wxss
New file
@@ -0,0 +1,173 @@
/* packageBookService/pages/bookServices/detail/components/learnTask/index.wxss */
page {
  box-sizing: border-box;
  padding: 0 24rpx;
}
.page-body {
  padding: 20rpx;
  font-size: 28rpx;
}
.from-item {
  margin-bottom: 20rpx;
  display: flex;
  align-items: center;
}
.from-item .label {
  width: 180rpx;
  height: 68rpx;
  line-height: 68rpx;
}
.t-input__content,
.t-textarea {
  border: 2rpx solid #D9D9D9 !important;
  padding: 10rpx !important;
}
.t-textarea {
  min-height: 200rpx;
}
.t-input {
  padding: 0 !important;
}
.t-input__tips,
.from-item .label .icon {
  color: #f56c6c !important;
  margin-right: 5rpx;
}
.t-input__placeholder,
.t-textarea__placeholder {
  font-size: 28rpx !important;
}
.content-Box {
  padding: 20rpx;
}
.item-title {
  padding: 20rpx;
  font-weight: bold;
  display: flex;
  align-items: center;
  background: #fff6f0;
}
.icon {
  width: 36rpx;
  height: 36rpx;
  margin-right: 10rpx;
}
.item-box {
  padding: 10rpx;
}
.item {
  padding: 10rpx 0;
}
.block {
  position: relative;
  width: 90vw;
  height: 80vh;
  background: var(--td-bg-color-container);
  border-radius: 16rpx;
  font-size: 28rpx;
}
.srcolbox {
  width: 100%;
  height: 80vh;
  white-space: nowrap;
}
.dataList {
  width: 100%;
  height: 100%;
  white-space: pre-wrap;
}
.item-Con-Box {
  padding: 20rpx;
}
.description {
  padding: 10rpx 0;
}
.label {
  display: flex;
  align-items: center;
}
.des {
  padding: 2px 5px;
  background: rgba(255, 108, 0, 0.1);
  color: #ff6d00;
}
.description .name {
  margin: 10rpx 0;
  margin-left: 40rpx;
  font-weight: bold;
}
.pointer {
  margin-left: 40rpx;
}
.pointer .name {
  margin-bottom: 10rpx;
}
.box-list {
  margin-top: 30rpx;
  margin-left: 10rpx;
}
.box-list .lable {
  margin-bottom: 10rpx;
}
.lable .icon {
  color: #f56c6c;
}
.buttonBox {
  text-align: center;
  padding: 30rpx;
}
.btn {
  width: 200rpx;
  font-size: 28rpx;
  height: 68rpx !important;
  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;
}
.close-btn {
  position: absolute;
  left: 50%;
  margin-left: -32rpx;
  bottom: calc(-1 * (48rpx + 64rpx));
}
.submit {
  background: #ff6c00;
  color: #fff;
}
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml
@@ -1,8 +1,8 @@
<view class="teach-btn">
  <t-button theme="primary" style="width: 120px; height: 36px" class="btn-upload" bind:tap="uploadBtn">
  <!-- <t-button theme="primary" style="width: 120px; height: 36px" class="btn-upload" bind:tap="uploadBtn">
    <t-image src="/static/images/bookService/detail/upload.png" style="margin-top: 20rpx"></t-image>
    <text>上传资源</text>
  </t-button>
  </t-button> -->
  <!-- <t-button theme="primary" style="width: 120px; height: 36px">
    <t-image src="/static/images/bookService/detail/download.png"></t-image>
    批量下载
packageDomain/pages/resourceDetails/myVideo/index.js
@@ -25,6 +25,7 @@
    productLinkPath: '',
    threeLeveData: [],
    showData: '',
    showDataVod: '',
    src: '',
    selectedId: null,
    topicId: '',
@@ -255,11 +256,14 @@
              showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
              titleName: items.name
            })
            this.aliVod(file, this.data.showData)
          } else {
            this.setData({
              showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
              titleName: items.name
            })
            this.aliVod(items.file, this.data.showData)
          }
          let selectedIndex = index; // 存储选中项的索引
          this.setData({
@@ -290,14 +294,36 @@
        this.setData({
          showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey)
        })
        this.aliVod(file, this.data.showData)
      } else {
        this.setData({
          showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
        })
        this.aliVod(item.file, this.data.showData)
      }
    }
  },
  aliVod(md5, currentVideo) {
    let query = {
      md5: md5,
      appRefCode: config.appRefCode
    }
    MG.file.getAliVod(query).then((res) => {
      if (res) {
        this.setData({
          showDataVod: res,
        })
      } else if (currentVideo) {
        this.setData({
          showDataVod: currentVideo,
        })
      } else {
        return ElMessage.error('无法获取视频资源')
      }
    })
  },
  timeUpdate(e) {
    console.log(2);
    let {
packageDomain/pages/resourceDetails/myVideo/index.wxml
@@ -14,7 +14,7 @@
      <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{videoLoaidng}}" />
    </view>
    <!-- <video show-center-play-btn="{{false}}" src="{{showData}}" bindloadedmetadata="loadedmetadata" bindtimeupdate="timeUpdate"></video> -->
    <t-video id="tvd" src="{{showData}}" style="width:100%;" bindvideoloaded="loadedmetadata" bindtimeupdate="timeUpdate" wx:if="{{!videoLoaidng}}">
    <t-video id="tvd" src="{{showDataVod}}" style="width:100%;" bindvideoloaded="loadedmetadata" bindtimeupdate="timeUpdate" wx:if="{{!videoLoaidng}}">
    </t-video>
  </view>
packagePersonal/pages/publishBooks/index.wxss
@@ -95,7 +95,6 @@
  width: 100%;
  height: 78vh;
  white-space: nowrap;
}
.block-content {
pages/cart/paymentPage/index.js
@@ -157,7 +157,7 @@
        orderGoods: res.orderNumber
      })
      this.setData({
        price: res.payPrice,
        price: res.payPrice.toFixed(2),
        payPrice: res.payPrice.toFixed(2),
        ImmediatelyReceive: res.payPrice
      })
@@ -224,10 +224,11 @@
          this.setData({
            payId: res.payList[0].id,
            payPrice: res.payPrice,
            deduct: (this.data.price - this.data.payPrice).toFixed(2),
            deduct: (this.data.currentBalance / 100).toFixed(2),
            integral: this.data.integral - this.data.currentBalance,
            showIntegral: true
          });
          console.log(this.data.price, this.data.payPrice, 123)
        }
      })
    } else {
pages/digitalCourses/digitalCoursesDetails/index.js
@@ -2,7 +2,7 @@
const app = getApp()
import SparkMD5 from 'spark-md5'
import FormData from '../../../utils/formdata/index.js';
// import Wxml2Canvas from 'wxml2canvas';
import Wxml2Canvas from 'wxml2canvas';
import {
  worksDataBytool
} from "../../../assets/js/toolClass.js";
@@ -98,8 +98,9 @@
    publishingUnit: '',
    pubCertificateHide: true,
    cbzsImg: '', //出版证书base64
    rzzsImg: '' //认证证书base64
    rzzsImg: '', //认证证书base64
    imageWidth: '', //画在画布上的图片的宽度
    imageHeight: '', //画在画布上的图片的高度
  },
  formatDate(dateString) {
    if (!dateString) {
@@ -282,7 +283,7 @@
          expire: res.false
        })
      }
      res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月DD日')
      res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月')
      res.datas.price = res.datas.price.toFixed(2)
      wx.setNavigationBarTitle({
@@ -310,6 +311,7 @@
      }
      this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath)
      this.getCertificateList()
      res.datas.content = res.datas.content.replace('../', app.config.requestCtx + '/')
      this.setData({
        lecturerList: lecturer,
        digitalsData: res.datas,
@@ -346,7 +348,7 @@
      tabValue: value
    })
    if (this.data.tabValue == 1) {
      // this.saveAsImage()
      this.saveAsImage()
    }
    if (this.data.tabValue == 2) {
      this.getResource()
@@ -823,48 +825,69 @@
  },
  //申请证书
  async saveAsImage() {
    let query = wx.createSelectorQuery().in(this);
    query.select("#pubCertificate").boundingClientRect();
    query.exec(function (res) {
      console.log("View 的信息:", res[0]);
    });
    console.log(value, 123)
    let drawImage = new Wxml2Canvas({
      element: 'pubCertificate', // canvas节点的id,
      obj: that, // 在组件中使用时,需要传入当前组件的this
      width: this.width * 2, // 宽高
      height: this.height * 2,
      background: '#fff', // 默认背景色
      progress(percent) { // 绘制进度
      },
    const that = this
    const query = wx.createSelectorQuery().in(this)
    query
      .select('#pubCertificate')
      .fields({
          // 选择需要生成canvas的范围
          size: true,
          node: true,
          scrollOffset: true,
        },
        (data) => {
          let width = data.width
          let height = data.height
          console.log(width, height)
          that.setData({
            imageWidth: width,
            imageHeight: height,
          })
        },
      )
      .exec()
    this.drawImage1()
  },
  drawImage1() {
    let that = this;
    let drawMyImage = new Wxml2Canvas({
      // width: 230,
      // height: 325,
      width: that.data.imageWidth,
      height: that.data.imageHeight,
      element: 'myCanvas',
      background: '#f0f0f0',
      progress(percent) {},
      finish(url) {
        console.log("创建的图片", url);
        console.log("生成的图片地址", url)
        wx.getFileSystemManager().readFile({
          filePath: url,
          encoding: 'base64',
          success: (res) => {
            let MyImageBase64 = 'data:image/jpg;base64,' + res.data
            console.log('MyImageBase64', MyImageBase64)
            that.setData({
              cbzsImg: MyImageBase64,
              pubCertificateHide: false,
            })
          },
        })
      },
      error(res) {
        console.log(res);
        // uni.hideLoading()
        // 画失败的原因
        console.log("生成的图片失败", res)
      }
    }, this);
    // const canvas = Wxml2Canvas.wxmlToCanvas(value);
    // // 转换为图片
    // const img = Wxml2Canvas.canvasToTempImage(canvas);
    // const path = Wxml2Canvas.canvasToTempFilePath(canvas);
    // console.log(canvas)
    // Wxml2Canvas(value).then((canvas) => {
    //   const img = canvas.toDataURL('image/png')
    //   this.setData({
    //     cbzsImg: img,
    //   })
    // })
    // Wxml2Canvas(textCertificate.value).then((canvas1) => {
    //   const img1 = canvas1.toDataURL('image/png')
    //   rzzsImg.value = img1
    // })
    this.setData({
      pubCertificateHide: false,
    })
    let data = {
      list: [{
        type: 'wxml',
        class: '.my_canvas .my_draw_canvas', //.my_draw_canvas每个要绘制元素的类名
        limit: '.my_canvas', //my_canvas根元素类名
        x: 0,
        y: 0
      }]
    }
    drawMyImage.draw(data, that);
  },
  //获取字段
  getType() {
@@ -1135,7 +1158,7 @@
  //证书查看
  onClick1() {
    this.setData({
      images: ['https://jsek.bnuic.com/home/certificate/szkc.jpg'],
      images: [this.data.cbzsImg],
      showIndex: true,
      visible: true,
    })
pages/digitalCourses/digitalCoursesDetails/index.wxml
@@ -94,27 +94,27 @@
          <view class="course-content">
            <view class="certificateChart">
              <view class="chart" bind:tap="onClick1">
                <image src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" />
                <image src="{{cbzsImg}}" mode="" />
              </view>
              <view class="chart" bind:tap="onClick2">
                <image src="https://jsek.bnuic.com/home/certificate/kczs.jpg" mode="" />
              </view>
            </view>
          </view>
          <!-- <canvas canvas-id="share"></canvas>
          <view id="pubCertificate" wx:if="pubCertificateHide">
            <image src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" class="bgImg" />
            <view class="certificateInfo">
              <view class="bookName">{{digitalsData.name}}</view>
              <view class="author">{{digitalsData.courseLeader || '-' }}</view>
              <view class="affiliatedUnit">{{digitalsData.affiliatedUnit || '-'}}</view>
              <view class="affiliatedUnit"> {{ digitalsData.isbn || '-'}}</view>
              <view class="affiliatedUnit">{{digitalsData.publicationDate}}</view>
              <view class="affiliatedUnit">{{publishingUnit}}</view>
              <view class="website">{{website}}</view>
          <canvas canvas-id="myCanvas" style="height:845px;width:595px" wx:if="{{pubCertificateHide}}"></canvas>
          <view id="pubCertificate" class="my_canvas" wx:if="{{pubCertificateHide}}">
            <image data-type="image" data-url="https://jsek.bnuic.com/home/certificate/szkc.jpg" src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" class="bgImg" />
            <view class="certificateInfo my_draw_canvas">
              <view class="bookName my_draw_canvas" data-type="text" data-text="{{digitalsData.name}}">{{digitalsData.name}}</view>
              <view class="author my_draw_canvas" data-type="text" data-text="{{digitalsData.courseLeader}}">{{digitalsData.courseLeader || '-' }}</view>
              <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.affiliatedUnit}}">{{digitalsData.affiliatedUnit || '-'}}</view>
              <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.isbn}}"> {{ digitalsData.isbn || '-'}}</view>
              <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.publicationDate}}">{{digitalsData.publicationDate}}</view>
              <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{publishingUnit}}">{{publishingUnit}}</view>
              <view class="website my_draw_canvas" data-type="text" data-text="{{website}}">{{website}}</view>
              <view class="codeBox"></view>
            </view>
          </view> -->
          </view>
        </t-tab-panel>
        <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" label="课程学习" value="2">
          <view class="course-content">
pages/digitalCourses/digitalCoursesDetails/index.wxss
@@ -429,13 +429,12 @@
  width: 595px;
  height: 845px;
  position: relative;
  background-image: url('https://jsek.bnuic.com/home/certificate/szkc.jpg');
  /* background-image: url('https://jsek.bnuic.com/home/certificate/szkc.jpg'); */
}
.bgImg {
  width: 100%;
  height: 100%;
}
.certificateInfo {
pages/digitalCourses/index.js
@@ -171,8 +171,9 @@
    // // 搜索框
    if (this.data.searchValue) {
      searchObj = {
        'Name*': this.data.searchValue.trim()
        // '||subtitle*': searchInputValue.value.trim()
        'Name*': this.data.searchValue.trim(),
        '||isbn*': searchInputValue.value.trim(),
        '||courseLeader*': searchInputValue.value.trim()
      }
    }
pages/digitalCourses/index.wxml
@@ -6,7 +6,7 @@
    <view>
      <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
    </view>
    <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" />
    <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入课程名称/ISBN/课程负责人" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" />
  </view>
  <view class="heardTab">
    <view class="tabBox">
pages/digitalTextbooks/index.wxml
@@ -7,7 +7,7 @@
    <view>
      <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
    </view>
    <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" />
    <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入教材名称/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" />
  </view>
  <view class="heardTab">
    <view class="tabBox">
pages/home/home.js
@@ -248,9 +248,9 @@
    const obj = {
      storeInfo: "app.config.goodsStore",
      path: item.pathList + '\\' + item.id,
      coverSize: {
        width: 260
      },
      // coverSize: {
      //   height: 205
      // },
      paging: {
        start: 0,
        size: 4
@@ -446,6 +446,11 @@
    });
  },
  goSubjectDetail(e) {
    return wx.showToast({
      title: "建设中",
      icon: 'none',
      duration: 1000
    })
    const item = e.currentTarget.dataset.book
    console.log(item);
    wx.navigateTo({
@@ -453,6 +458,11 @@
    });
  },
  goCourseDetail(e) {
    return wx.showToast({
      title: "建设中",
      icon: 'none',
      duration: 1000
    })
    const {
      book
    } = e.currentTarget.dataset;
@@ -577,11 +587,21 @@
        url: '/pages/home/digitalRead/index'
      })
    } else if (type == "zhuantitaolun") {
      return wx.showToast({
        title: "建设中",
        icon: 'none',
        duration: 1000
      })
      wx.navigateTo({
        url: '/pages/specialDiscussion/index'
      })
    } else if (type == "jingxuankecheng") {
      return wx.showToast({
        title: "建设中",
        icon: 'none',
        duration: 1000
      })
      wx.navigateTo({
        url: '/pages/digitalCourses/index?courseTypeActive=' + this.data.courseTypeActive
      })
pages/home/home.wxss
@@ -310,6 +310,7 @@
  width: 336rpx;
  height: 205rpx;
  flex: 1;
  margin: 0 auto;
}
.listBox1 .body-info {
pages/personalCenter/index.js
@@ -18,7 +18,8 @@
  {
    title: '我的证书',
    icon: '/static/images/personal/certificate.png',
    url: '/pages/personalCenter/certificate/index',
    url: '',
    // url: '/pages/personalCenter/certificate/index',
    type: 'certificate',
  },
  {
@@ -42,13 +43,15 @@
  {
    title: '我的上传',
    icon: '/static/images/personal/upload.png',
    url: '/pages/personalCenter/myUpload/index',
    url: '',
    // url: '/pages/personalCenter/myUpload/index',
    type: 'upload',
  },
  {
    title: '出书申请',
    icon: '/static/images/personal/chushu.png',
    url: '/packagePersonal/pages/publishBooks/index',
    url: '',
    // url: '/packagePersonal/pages/publishBooks/index',
    type: 'publishBooks',
  }
];
services/home/home.js
@@ -21,8 +21,8 @@
          text: '数字课程',
          key: 2,
          icon: '/static/images/home/shuzikecheng@2x.png',
          url: '/pages/digitalCourses/index',
          // url: ''
          // url: '/pages/digitalCourses/index',
          url: ''
        },
        {
          text: '数字教材',
@@ -35,8 +35,8 @@
          text: '专题活动',
          key: 4,
          icon: '/static/images/home/zhuantitaolun@2x.png',
          url: '/pages/specialDiscussion/index',
          // url: ''
          // url: '/pages/specialDiscussion/index',
          url: ''
        },
        {
          text: '线上书展',
@@ -66,8 +66,8 @@
          text: '我要出书',
          key: 9,
          icon: '/static/images/home/xueshuzhuzuo@2x.png',
          url: '/packageDomain/pages/publickBookForm/index',
          // url: '',
          // url: '/packageDomain/pages/publickBookForm/index',
          url: '',
        },
      ],
    };