wj
litian
2024-10-23 abe52e53bee051e3f801d001c4de58d34a3fefd7
wj
9个文件已修改
226 ■■■■ 已修改文件
packageBookService/pages/bookServices/detail/components/teachResource/index.js 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.wxss 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.js 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/resourceDetails/document/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/teachResource/index.js
@@ -1,3 +1,4 @@
const app = getApp();
Component({
  properties: {
    applyState: {
@@ -16,7 +17,7 @@
      type: String,
      value: "",
    },
    treeList: {
    md5List: {
      type: Array,
    }
  },
@@ -26,6 +27,8 @@
      content: "知道了",
      variant: "base"
    },
    dialogBox: false,
    input: '',
  },
  methods: {
    copy() {
@@ -62,5 +65,53 @@
    uploadBtn() {
      this.triggerEvent("uploadFile", true);
    },
    mailbox() {
      this.setData({
        dialogBox: true
      })
    },
    // 弹窗取消
    closeDialog() {
      this.setData({
        dialogBox: false,
      })
    },
    //提交
    confirmM(e) {
      wx.showLoading({
        title: '发送中...',
      })
      const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input);
      if (isEmailValid && this.data.input) {
        this.setData({
          dialogBox: false
        })
        let query = {
          eMail: this.data.input,
          md5s: this.properties.md5List
        }
        app.MG.file.sendFileWithEmail(query).then(res => {
          wx.hideLoading()
          if (res) {
            wx.showToast({
              icon: 'success',
              title: '邮件已发送',
            })
          }
        })
      } else {
        // 校验不通过,给出错误提示
        wx.showToast({
          title: '邮箱格式不正确',
          icon: 'none',
        });
      }
    },
    inputChange(e) {
      this.setData({
        input: e.detail.value
      })
    },
  },
});
packageBookService/pages/bookServices/detail/components/teachResource/index.json
@@ -4,6 +4,7 @@
    "t-image": "tdesign-miniprogram/image/image",
    "t-button": "tdesign-miniprogram/button/button",
    "t-dialog": "tdesign-miniprogram/dialog/dialog",
    "t-input": "tdesign-miniprogram/input/input",
    "empty": "/components/empty/index"
  }
}
packageBookService/pages/bookServices/detail/components/teachResource/index.wxml
@@ -1,7 +1,6 @@
<view class="teach-btn">
  <t-button
    theme="primary"
    style="width: 120px; height: 36px"
    class="btn"
    bind:tap="uploadBtn"
  >
@@ -13,12 +12,39 @@
      <text>上传资源</text>
    </view>
  </t-button>
  <!-- <t-button theme="primary" style="width: 120px; height: 36px">
  <!-- <t-button theme="primary" style="margin-left:20rpx" class="btn" bind:tap="mailbox">
    <view slot="content" class="btn-content">
    <t-image src="/static/images/bookService/detail/download.png"></t-image>
    批量下载
    <text>下载到邮箱</text>
  </view>
  </t-button> -->
</view>
<view
<view wx:if="{{dialogBox}}">
  <view class="popup-box" bindtap="closeDialog"></view>
  <view class="info-center" style="top:40%;">
    <view>
      <view class="row-info">
        <view class="body">
          <view class="dialog-title">请输入邮箱</view>
          <view class="input-box">
            <t-input
              class="input"
              placeholder="请输入邮箱号"
              value="{{input}}"
              bind:change="inputChange"
            ></t-input>
          </view>
        </view>
        <view class="row-btn">
          <view class="left-btn" bindtap="closeDialog">取消</view>
          <view class="right-btn" bindtap="confirmM">确认</view>
        </view>
      </view>
    </view>
  </view>
</view>
<!-- <view
  class="applyResult  {{applyState == 'none' ? 'applyNone' : applyState == 'Normal' ? 'applyPass' : applyState == 'WaitAudit' ? 'applying' :applyState == 'Reject' ? 'applyReject' :'' }}"
  wx:if="{{treeList.length}}"
>
@@ -63,7 +89,7 @@
</view>
<view class="noData" wx:else>
  <empty />
</view>
</view> -->
<!-- 未通过原因 -->
<t-dialog
  visible="{{showRejectDialog}}"
packageBookService/pages/bookServices/detail/components/teachResource/index.wxss
@@ -88,6 +88,7 @@
.btn {
  width: 220rpx;
  height: 64rpx;
  font-size: 28rpx;
  --td-button-primary-bg-color: #fff;
  --td-button-primary-border-color: #FF6C00;
@@ -116,4 +117,83 @@
.noData {
  height: 300rpx;
}
.info-center {
  position: fixed;
  top: 30%;
  z-index: 999;
  background-color: white;
  align-items: center;
  justify-content: center;
  border-radius: 10rpx;
  width: 80%;
  margin-left: 10%;
  margin-right: 10%;
}
.row-btn {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  border-top: 1rpx solid #f1f1f1;
}
.row-btn view {
  flex: 1;
  text-align: center;
  margin: 20rpx 10%;
  padding: 12rpx 0;
  font-size: 32rpx;
  border-radius: 10rpx;
}
.left-btn {
  background-color: #f1f1f1;
  color: #5C5C5C;
}
.right-btn {
  background-color: #ff6c00;
  color: white;
}
.row-info .body {
  min-height: 160rpx;
}
.dialog-title {
  padding: 20rpx 0;
  text-align: center;
  font-size: 35rpx;
  font-weight: 600;
}
.input-box {
  padding: 0 20rpx;
  width: 92%;
}
.input-box .t-input--border::after {
  height: 0 !important;
}
.input {
  border-radius: 20rpx;
  border: 2rpx solid rgba(220, 220, 220, 1);
  border-radius: 12rpx;
  width: 98%;
  padding: 0 0 0 16rpx
}
/* 蒙层 */
.popup-box {
  position: absolute;
  z-index: 99;
  top: 0;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
}
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -195,17 +195,17 @@
        })
      }
      if (item.selectType == 'zip') {
        if (this.properties.applyState == 'Normal') {
          return wx.showToast({
            icon: 'error',
            title: '请前往PC端下载',
          })
        } else {
          return wx.showToast({
            icon: 'error',
            title: '请先申请下载',
          })
        }
        // if (this.properties.applyState == 'Normal') {
        return wx.showToast({
          icon: 'error',
          title: '请前往PC端下载',
        })
        // } else {
        //   return wx.showToast({
        //     icon: 'error',
        //     title: '请先申请下载',
        //   })
        // }
      }
      if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) {
        let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile]
packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -67,17 +67,17 @@
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'doc' ||  item.fileMap[item.file].extension == 'docx'}}"
                  wx:elif="{{ item.fileMap[item.file].extension == 'doc' ||  item.fileMap[item.file].extension == 'docx' || item.fileMap[item.freeFile].extension == 'doc' ||  item.fileMap[item.freeFile].extension == 'docx'}}"
                  src="/static/images/bookService/detail/word.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'xlsx' ||  item.fileMap[item.file].extension == 'xlsx'}}"
                  wx:elif="{{ item.fileMap[item.file].extension == 'xlsx' ||  item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.freeFile].extension == 'xlsx' ||  item.fileMap[item.freeFile].extension == 'xlsx'}}"
                  src="/static/images/bookService/detail/excel.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'ppt' ||  item.fileMap[item.file].extension == 'pptx'}}"
                  wx:elif="{{ item.fileMap[item.file].extension == 'ppt' ||  item.fileMap[item.file].extension == 'pptx' || item.fileMap[item.freeFile].extension == 'ppt' ||  item.fileMap[item.freeFile].extension == 'pptx'}}"
                  src="/static/images/bookService/detail/PPT.png"
                  mode="aspectFill"
                />
@@ -242,17 +242,17 @@
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' ||  citem.fileMap[citem.file].extension == 'docx'}}"
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' ||  citem.fileMap[citem.file].extension == 'docx' || citem.fileMap[citem.freeFile].extension == 'doc' ||  citem.fileMap[citem.freeFile].extension == 'docx'}}"
                    src="/static/images/bookService/detail/word.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' ||  citem.fileMap[citem.file].extension == 'xlsx'}}"
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' ||  citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.freeFile].extension == 'xlsx' ||  citem.fileMap[citem.freeFile].extension == 'xlsx' }}"
                    src="/static/images/bookService/detail/excel.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' ||  citem.fileMap[citem.file].extension == 'pptx'}}"
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' ||  citem.fileMap[citem.file].extension == 'pptx' || citem.fileMap[citem.freeFile].extension == 'ppt' ||  citem.fileMap[citem.freeFile].extension == 'pptx'}}"
                    src="/static/images/bookService/detail/PPT.png"
                    mode="aspectFill"
                  />
packageBookService/pages/bookServices/detail/index.js
@@ -209,7 +209,8 @@
    isShowUp: true,
    protocolShow: false,
    protocolTxt: '',
    learnMenu: null
    learnMenu: null,
    md5List: []
  },
  resetTree: function (e) {
@@ -994,8 +995,19 @@
        cloundSaleMethod &&
        new Date().getTime() <= new Date(cloundSaleMethod.EndDate).getTime() &&
        new Date().getTime() >= new Date(cloundSaleMethod.BeginDate).getTime()
      let md5s = []
      res.datas.cmsDatas[0].datas.forEach((item) => {
        // 云学习上有销售方式,去掉云学习下所有销售方式
        if (this.data.tabValue == "jsek_teachingResources") {
          if (item.file || item.freeFile) {
            let md5 = item.file ? item.file : item.freeFile
            md5s.push(md5)
          }
          this.setData({
            md5List: md5s,
          });
        }
        if (flags) item.saleMethod = []
        item.checked = false;
        if (item.sysType == 'CmsItem') {
packageBookService/pages/bookServices/detail/index.wxml
@@ -205,7 +205,7 @@
                rejectCause="{{rejectCause}}"
                deadline="{{deadline}}"
                bind:applyResource="applyResource"
                treeList="{{teach}}"
                md5List="{{md5List}}"
                applyResourceLoading="{{applyResourceLoading}}"
                bind:uploadFile="uploadFile"
              ></teach-resource>
packageDomain/pages/resourceDetails/document/index.js
@@ -286,7 +286,6 @@
  //刚进来的时候调用
  handleTeachData(item) {
    //图片
    if (item.selectType == 'picture') {
      this.setData({
        showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
@@ -309,13 +308,14 @@
    }
    //文档等
    if (item.selectType == 'pdf' || item.selectType == 'document') {
      let md5 = item.file ? item.file : item.freeFile
      app.MG.file.getPdfInfo({
        md5: item.file
        md5: md5
      }).then((res) => {
        let naturalResources = []
        if (res && res.totalPages) {
          for (let i = 0; i < res.totalPages; i++) {
            const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + item.file + '&index=' + (i + 1) + '&dpi=300'
            const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + md5 + '&index=' + (i + 1) + '&dpi=300'
            naturalResources.push(src)
          }
        }