111
litian
2024-03-20 0555dd7dc2edc553030b7a6d03d6a1cda4b1e336
111
24个文件已修改
6个文件已添加
1729 ■■■■ 已修改文件
app.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/js/middleGround/api/file.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/js/middleGround/api/job.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
assets/js/toolClass.js 115 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/applicationForm/index.js 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/applicationForm/index.wxml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/index.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/index.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/sampleBookList/index.wxss 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/teacherCertification/index.js 371 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/teacherCertification/index.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/teacherCertification/index.wxml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/teacherCertification/index.wxss 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/userSetting/index.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/userSetting/index.json 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/userSetting/index.wxml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packagePersonal/pages/userSetting/index.wxss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxss 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/components/user-center-card/index.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/components/user-center-card/index.wxml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/components/user-center-card/index.wxss 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.js 166 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.wxml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/testLogin/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/formdata/index.js 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/formdata/mimeMap.js 346 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -40,7 +40,8 @@
        "pages/sampleBooks/index",
        "pages/personalCenter/publishBooks/index",
        "pages/feedBack/index",
        "pages/aboutUs/index"
        "pages/aboutUs/index",
        "pages/userSetting/index"
      ]
    },
    {
assets/js/middleGround/api/file.js
@@ -36,10 +36,14 @@
  },
  //上传文件
  upload(data) {
    console.log(data)
    return request({
      url: "/file/api/ApiUpload",
      method: "post",
      data
      header: {
        'content-type': data.contentType,
      },
      data: data.buffer,
    });
  },
@@ -71,13 +75,13 @@
  },
  // 批量下载get
  getDownloadFiles (params) {
  getDownloadFiles(params) {
    return request({
      url: '/file/api/ApiGetDownloadFiles',
      method: 'GET',
      responseType: 'blob',
      headers:{
        'md5s':params
      headers: {
        'md5s': params
      }
    });
  }
assets/js/middleGround/api/job.js
@@ -14,7 +14,7 @@
  },
  newSession(data) {
    let token = wx.getStorageSync(config.tokenKey) ? wx.getStorageSync(config.tokenKey) : ''
    let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : ''
    return request({
      url: token ? "/job/api/AppUserNewSession" : "/job/api/NewSession",
      method: "post",
assets/js/toolClass.js
@@ -203,46 +203,71 @@
}
export function UpdateworksDataBytool(initData, res, value, linkList) {
  let arr = []
  let arr = [];
  let newArr = [];
  for (let i = 0; i < initData.length; i++) {
    const ele = initData[i]
    const ele = initData[i];
    for (let j = 0; j < res.length; j++) {
      const item = res[j]
      const item = res[j];
      if (item.sequenceNum == ele.sequenceNum) {
        item.refCode = ele.typeField.refCode
        item.refCode = ele.typeField.refCode;
      }
    }
  }
  res.forEach((item) => {
    const obj = {
      baseType: item.baseType,
      order: 0,
      id: item.id,
      typeFieldId: item.fieldId,
      sequenceNum: item.sequenceNum,
      setDataAndFileLinkListRequest: []
    }
    for (let k in value) {
      if (item.refCode === k) {
        if (typeof value[k] == 'object') {
          obj.strValue = JSON.stringify(value[k][0])
          obj.setDataAndFileLinkListRequest = linkList
        } else {
          if (obj.baseType === 'String') {
            obj.strValue = value[k] + ''
          } else if (obj.baseType === 'Text') {
            obj.textValue = value[k] + ''
  initData.forEach((citem) => {
    const updateOldData = res.find((f) => f.sequenceNum == citem.sequenceNum);
    if (updateOldData) {
      const obj = {
        baseType: citem.typeField.baseType,
        order: 0,
        id: updateOldData.id,
        typeFieldId: citem.typeField.id,
        sequenceNum: citem.sequenceNum,
        setDataAndFileLinkListRequest: [],
      };
      for (let k in value) {
        if (citem.typeField.refCode === k) {
          if (typeof value[k] == "object" && k != "region") {
            obj.strValue = JSON.stringify(linkList);
            obj.setDataAndFileLinkListRequest = linkList;
          } else if (typeof value[k] == "object" && k == "region") {
            obj.strValue = value[k]?.join("/");
            obj.setDataAndFileLinkListRequest = [{ area: value[k] }];
          } else {
            obj.strValue = value[k] + ''
            obj.strValue = value[k].toString();
          }
        }
      }
      if (obj.strValue) {
        arr.push(obj);
      }
    } else {
      const newObj = {
        baseType: citem.typeField.baseType,
        order: 0,
        typeFieldId: citem.typeField.id,
        sequenceNum: citem.sequenceNum,
        setDataAndFileLinkListRequest: [],
      };
      for (let k in value) {
        if (citem.typeField.refCode === k) {
          if (typeof value[k] == "object") {
            newObj.strValue = JSON.stringify(linkList);
            newObj.setDataAndFileLinkListRequest = linkList;
          } else {
            newObj.strValue = value[k].toString();
          }
        }
      }
      if (newObj.strValue) {
        newArr.push(newObj);
      }
    }
    // if (obj.strValue) {
    arr.push(obj)
    // }
  })
  return arr
  });
  return {
    updateData: arr,
    newData: newArr,
  };
}
export function download(url) {
@@ -294,36 +319,12 @@
  return uuid.join('')
}
export function getFileMd5(file, chunkSize) {
export function getFileMd5(file) {
  return new Promise((resolve, reject) => {
    let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice
    let chunks = Math.ceil(file.size / chunkSize)
    let currentChunk = 0
    let spark = new SparkMD5.ArrayBuffer()
    let fileReader = new FileReader()
    fileReader.onload = function (e) {
      spark.append(e.target.result)
      currentChunk++
      if (currentChunk < chunks) {
        loadNext()
      } else {
        const md5 = spark.end()
        resolve(md5)
      }
    }
    fileReader.onerror = function (e) {
      reject(e)
    }
    function loadNext() {
      let start = currentChunk * chunkSize
      let end = start + chunkSize
      if (end > file.size) {
        end = file.size
      }
      fileReader.readAsArrayBuffer(blobSlice.call(file, start, end))
    }
    loadNext()
    spark.append(file)
    const md5 = spark.end(false)
    resolve(md5)
  })
}
custom-tab-bar/index.js
@@ -7,6 +7,7 @@
  methods: {
    onChange(event) {
      this.setData({ active: event.detail.value });
      wx.switchTab({
        url: this.data.list[event.detail.value].url.startsWith('/')
packageDomain/pages/sampleBookList/applicationForm/index.js
@@ -1,4 +1,4 @@
import { worksDataBytool } from "../../../../../assets/js/toolClass.js";
import { worksDataBytool } from "../../../../assets/js/toolClass.js";
const app = getApp();
Page({
  data: {
@@ -36,26 +36,22 @@
      })
      if (this.data.userInfo.role == 'Teacher') {
        this.setData({
          teacherInfo: {
            schoolName: JSON.parse(this.data.userInfo.data).schoolName,
            courseName: JSON.parse(this.data.userInfo.data).courseName,
          },
          contactInfo: {
            fullName: JSON.parse(this.data.userInfo.data).fullName,
            phone: JSON.parse(this.data.userInfo.data).phone,
            detailedAddress: JSON.parse(this.data.userInfo.data).detailedAddress
          }
          'teacherInfo.schoolName': JSON.parse(this.data.userInfo.data).schoolName,
          'teacherInfo.courseName': JSON.parse(this.data.userInfo.data).courseName,
          'contactInfo.fullName': JSON.parse(this.data.userInfo.data).fullName,
          'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone,
          'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress,
        })
      }
      if (wx.getStorageSync("paperBookList")) {
        this.setData({
          paperBookList: JSON.parse(wx.getStorageSync("paperBookList")),
          bookList: JSON.parse(wx.getStorageSync("paperBookList"))
          paperBookList: wx.getStorageSync("paperBookList"),
          bookList: wx.getStorageSync("paperBookList")
        })
      }
      if (wx.getStorageSync("electronicBookList")) {
        this.setData({
          electronicBookList: JSON.parse(wx.getStorageSync("electronicBookList"))
          electronicBookList: wx.getStorageSync("electronicBookList")
        })
      }
      this.getSelectBookCount();
@@ -90,9 +86,7 @@
    app.MG.resource.getCmsTypeByRefCode({ refCodes: ['jsek_electronicSampleBook'] }).then((res) => {
      this.setData({
        description: res[0].description,
        teacherInfo: {
          workInfo: res[0].cmsTypeLinks[0].children
        },
        'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
      })
    })
  },
@@ -104,9 +98,7 @@
        if (res && res.length > 0) {
          this.setData({
            description: res[0].description,
            teacherInfo: {
              workInfo: res[0].cmsTypeLinks[0].children
            },
            'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children,
          })
        }
      })
@@ -173,7 +165,7 @@
        }
        applyInfo = {
          ticketRefCodeOrGuid: 'electronicSampleBookapplyNum',
          roleId: userStore.userInfo.roleId,
          roleId: that.data.userInfo.roleId,
          refType: 'applyBook'
        }
      } else {
@@ -257,25 +249,27 @@
      success: function (res) {
        if (res.confirm) {
          if (that.data.active == '1') {
            that.data.electronicBookList.forEach((obj, index) => {
            let eList = that.data.electronicBookList;
            eList.forEach((obj, index) => {
              if (obj.id == item.id) {
                that.data.electronicBookList.splice(index, 1);
                eList.splice(index, 1);
              }
            })
            that.setData({
              bookList: that.data.electronicBookList
              bookList: eList
            })
            wx.setStorageSync("electronicBookList", that.data.electronicBookList);
            wx.setStorageSync("electronicBookList", eList);
          } else {
            that.data.paperBookList.forEach((obj, index) => {
            let pList = that.data.paperBookList;
            pList.forEach((obj, index) => {
              if (obj.id == item.id) {
                that.data.paperBookList.splice(index, 1);
                pList.splice(index, 1);
              }
            })
            that.setData({
              bookList: this.data.paperBookList
              bookList: pList
            })
            wx.setStorageSync("paperBookList", that.data.paperBookList);
            wx.setStorageSync("paperBookList", pList);
          }
        } else if (res.cancel) {
        }
packageDomain/pages/sampleBookList/applicationForm/index.wxml
@@ -16,10 +16,11 @@
            <t-cell title="左滑单操作" note="辅助信息" bordered="{{false}}">
              <view class="listItem flex">
                <view class="specialSubject-img">
                  <image src="{{item.icon}}" mode="aspectFill" class="img" />
                  <image src="{{item.icon}}" mode="aspectFill" class="img" wx:if="{{item.icon}}" />
                  <image src="/static/images/default-book-img.png" mode="aspectFill" class="img" wx:else="" />
                </view>
                <view class="body-info">
                  <view class="name">{{item.name}}</view>
                  <view class="name">{{item.title}}</view>
                  <view class="author">作者:{{item.author}}</view>
                  <view class="author">ISBN:{{item.isbn}}</view>
                  <view class="author">出版时间:{{item.publicationDate}}</view>
packageDomain/pages/sampleBookList/index.js
@@ -63,6 +63,7 @@
    electronicBookList: [], //样书单电子书
    paperBookCount: 0, //纸质书剩余次数
    ebookCount: 0, //电子书剩余次数
    num: 0,
  },
  /**
@@ -117,7 +118,7 @@
      })
    }
    this.getIconTypeList();
    this.getBookList(false);
    // 获取重点项目
    this.getProjectList('bookClassification');
    //新形态教材
@@ -133,14 +134,18 @@
    }
    if (wx.getStorageSync("paperBookList")) {
      this.setData({
        paperBookList: wx.getStorageSync("paperBookList")
        paperBookList: wx.getStorageSync("paperBookList"),
      })
    }
    if (wx.getStorageSync("electronicBookList")) {
      this.setData({
        electronicBookList: wx.getStorageSync("electronicBookList")
        electronicBookList: wx.getStorageSync("electronicBookList"),
      })
    }
    this.setData({
      num: this.data.paperBookList.length + this.data.electronicBookList.length
    })
    this.getBookList(false);
  },
  /**
@@ -299,7 +304,6 @@
        this.setData({
          'newTextBook.options': options,
        });
        console.log('重点项目', this.data.newTextBook);
      }
    });
  },
@@ -389,6 +393,7 @@
                })
              })
            }
            if (that.data.alreadyElectronicBookList.length > 0) {
              that.data.alreadyElectronicBookList.forEach((eBook) => {
                eBook.content.forEach((eBookItem) => {
@@ -546,7 +551,6 @@
  },
  // 搜索图书
  searchBook(e) {
    console.log(e.detail.value);
    this.setData({
      searchValue: e.detail.value,
    });
@@ -572,13 +576,15 @@
      }
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      let list = [];
      res.datas.map((item) => {
        if (item.content) {
          item.content = JSON.parse(item.content)
        }
        list.push(item)
      })
      this.setData({
        alreadyPaperBookList: res.datas,
        alreadyPaperBookList: list,
      });
    })
  },
@@ -596,27 +602,30 @@
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      let list = []
      res.datas.map((item) => {
        if (item.feedBack) {
          item.feedBack = JSON.parse(item.feedBack)
          if (item.feedBack.endDate) {
            let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime()
            let currentDate = new Date().getTime()
            if (times < currentDate) {
              item.isExpiry = true
      if (res.datas.length > 0) {
        res.datas.map((item) => {
          if (item.feedBack) {
            item.feedBack = JSON.parse(item.feedBack)
            if (item.feedBack.endDate) {
              let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime()
              let currentDate = new Date().getTime()
              if (times < currentDate) {
                item.isExpiry = true
              }
            }
          }
        }
        if (item.content) {
          item.content = JSON.parse(item.content)
        }
        if (item.state != 'Reject') {
          list.push(item)
        }
      })
      this.setData({
        alreadyElectronicBookList: list,
      });
          if (item.content) {
            item.content = JSON.parse(item.content)
          }
          if (item.state != 'Reject') {
            list.push(item)
          }
        })
        this.setData({
          alreadyElectronicBookList: list,
        });
        this.getBookList(false);
      }
    })
  },
@@ -681,12 +690,12 @@
        })
        return
      }
      if (item.paperChecked) {
        if (this.data.paperBookList.length > 0) {
          this.data.paperBookList.forEach((obj, index) => {
        let pList = this.data.paperBookList;
        if (pList.length > 0) {
          pList.forEach((obj, index) => {
            if (obj.id == item.id) {
              this.data.paperBookList.splice(index, 1);
              pList.splice(index, 1);
            }
          })
        }
@@ -703,7 +712,11 @@
          icon: 'none',
          duration: 1000,
        })
        wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList));
        this.setData({
          paperBookList: pList,
          num: pList.length + this.data.electronicBookList.length
        })
        wx.setStorageSync("paperBookList", JSON.stringify(pList));
        return
      }
      if (role == 'Teacher') {
@@ -757,10 +770,11 @@
        return
      }
      if (item.electronChecked) {
        if (this.data.electronicBookList) {
          this.data.electronicBookList.forEach((obj, index) => {
        let eList = this.data.electronicBookList;
        if (eList.length > 0) {
          eList.forEach((obj, index) => {
            if (obj.id == item.id) {
              this.data.electronicBookList.splice(index, 1);
              eList.splice(index, 1);
            }
          })
        }
@@ -777,7 +791,11 @@
          icon: 'none',
          duration: 1000,
        })
        wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList));
        this.setData({
          electronicBookList: eList,
          num: eList.length + this.data.paperBookList.length
        })
        wx.setStorageSync("electronicBookList", eList);
        return
      }
      if (role == 'Teacher') {
@@ -830,6 +848,8 @@
          }
        })
      }
    } else {
      item.electronChecked = false
    }
  },
  getSelectBookCount(item) {
@@ -889,16 +909,28 @@
              duration: 1000,
            })
            this.setData({
              electronicBookList: [...this.data.electronicBookList, ...[item]]
              electronicBookList: [...this.data.electronicBookList, ...[itemAttr]],
              num: this.data.electronicBookList.length + this.data.paperBookList.length
            })
            wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList));
            wx.setStorageSync("electronicBookList", this.data.electronicBookList);
          } else {
            let list = this.data.electronicBookList;
            list.forEach((obj, index) => {
              if (obj.id == item.id) {
                list.splice(index, 1);
              }
            })
            item.electronChecked = false
            wx.showToast({
              title: "该书已在清单列表中",
              title: "已从样书申请单移除",
              icon: "none",
              duration: 1000,
            })
            this.setData({
              electronicBookList: list,
              num: list.length + this.data.paperBookList.length
            })
            wx.setStorageSync("electronicBookList", list);
          }
        } else {
          wx.showToast({
@@ -907,9 +939,10 @@
            duration: 1000,
          })
          this.setData({
            electronicBookList: [...this.data.electronicBookList, ...[item]]
            electronicBookList: [itemAttr],
            num: 1 + this.data.paperBookList.length
          })
          wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList));
          wx.setStorageSync("electronicBookList", [itemAttr]);
        }
      } else {
        item.electronChecked = false
@@ -945,17 +978,28 @@
              duration: 1000,
            })
            this.setData({
              paperBookList: [...this.data.paperBookList, ...[item]]
              paperBookList: [...this.data.paperBookList, ...[itemAttr]],
              num: this.data.paperBookList.lenght + this.data.electronicBookList.length
            })
            wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList));
            console.log(this.data.paperBookList, "3")
            wx.setStorageSync("paperBookList", this.data.paperBookList);
          } else {
            let list = this.data.paperBookList;
            list.forEach((obj, index) => {
              if (obj.id == item.id) {
                list.splice(index, 1);
              }
            })
            item.paperChecked = false
            wx.showToast({
              title: "该书已在清单列表中",
              icon: 'none',
              title: "已从样书申请单移除",
              icon: "none",
              duration: 1000,
            })
            this.setData({
              paperChecked: list,
              num: list.length + this.data.electronicBookList.length
            })
            wx.setStorageSync("paperBookList", list);
          }
        } else {
          item.paperChecked = true;
@@ -965,10 +1009,10 @@
            duration: 1000,
          })
          this.setData({
            paperBookList: [item]
            paperBookList: [itemAttr],
            num: 1 + this.data.electronicBookList.length
          })
          wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList));
          console.log(this.data.paperBookList, "4")
          wx.setStorageSync("paperBookList", [itemAttr]);
        }
      } else {
        item.paperChecked = false
packageDomain/pages/sampleBookList/index.wxml
@@ -11,7 +11,7 @@
    <view class="header-scroll">
      <scroll-view scroll-x scroll-with-animation='true' class="srcolbox">
        <t-dropdown-menu>
          <t-dropdown-item label="总分类" options="{{iconList.options}}" value="{{iconList.value}}" optionsColumns="2" bindchange="onChangeIcon" arrow-icon="" />
          <t-dropdown-item label="总分类" options="{{iconList.options}}" default-value="{{iconList.value}}" optionsColumns="2" bindchange="onChangeIcon" arrow-icon="" />
          <t-dropdown-item label="一级" options="{{stairList.options}}" value="{{stairList.value}}" optionsColumns="2" bindchange="onChangeStair" arrow-icon="" />
          <t-dropdown-item label="二级" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" />
        </t-dropdown-menu>
@@ -70,6 +70,6 @@
<view class="applyBox" bindtap="goApply">
  <view class="box">
    <t-image src="/static/images/home/yangshuForm.png" mode="heightFix" class="img" />
    <view class="num">{{num}}</view>
    <view class="num" wx:if="{{num > 0}}">{{num}}</view>
  </view>
</view>
packageDomain/pages/sampleBookList/index.wxss
@@ -45,6 +45,19 @@
  white-space: nowrap;
}
.srcolbox .t-button--primary {
  border-radius: 50rpx !important;
  background: #FF6C00 !important;
  border: none;
}
.srcolbox .t-button--light {
  background: #fff !important;
  border-radius: 50rpx !important;
  color: #545C63 !important;
  border: 2rpx solid #979797 !important;
}
.t-dropdown-menu:after,
.t-dropdown-menu::after {
  height: 0px;
@@ -74,10 +87,20 @@
  border-radius: 40rpx 40rpx 0 0;
}
.t-radio__title {
  font-size: 28rpx !important;
}
.t-dropdown-menu__item--active,
.t-radio__icon--checked,
.t-checkbox__icon--checked {
  color: #FF6C00 !important
.t-checkbox__icon--checked,
.t-radio__title--checked,
.t-checkbox__title--checked {
  color: #FF6C00 !important;
}
.srcolbox .t-checkbox--checked {
  background-color: #FFECDE !important;
}
.t-checkbox__icon--disabled {
@@ -85,7 +108,7 @@
}
.t-radio--block {
  padding: 20rpx !important;
  padding: 10rpx !important;
}
.t-radio__border {
@@ -245,16 +268,33 @@
  height: 184rpx;
  position: fixed;
  bottom: 20%;
  right: 20rpx;
  right: 0;
}
.applyBox .box {
  width: 184rpx;
  height: 184rpx;
  color: #fff;
  position: relative;
}
.applyBox .box .t-image {
  width: 100%;
  height: 100%;
}
.num {
  background-color: #FD3D16;
  color: #fff;
  border: 2rpx solid #FFFFFF;
  font-size: 24rpx;
  line-height: 30rpx;
  font-weight: 400;
  width: 48rpx;
  height: 32rpx;
  text-align: center;
  border-radius: 9px;
  position: absolute;
  top: 30rpx;
  left: 118rpx;
}
packageDomain/pages/teacherCertification/index.js
@@ -1,6 +1,7 @@
const app = getApp();
import tool from "../../../assets/js/toolClass.js";
import { getTopicMsgCmsItemFile } from '../../../assets/js/middleGround/tool.js'
import { getTopicMsgCmsItemFile } from '../../../assets/js/middleGround/tool.js';
import FormData from '../../../utils/formdata/index.js';
Page({
  /**
@@ -30,11 +31,14 @@
    topicId: "",
    worksInfo: [],
    userId: '',
    fileList: [],
    imgPics: [],
    file: "",
    imgs: [],
    protocolTxt: '', //教师协议
    protocolShow: false,
    editState: true,
    reasonTxt: ""
    reasonTxt: "",
    reasonTxtShow: false,
  },
  /**
@@ -123,7 +127,7 @@
            role: 'Student'
          }
        }
        wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo));
        wx.setStorageSync(app.config.userInfoKey, JSON.stringify(defaultUser));
      }
    })
  },
@@ -152,7 +156,7 @@
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      try {
        this.setData({
          fileList: [],
          imgPics: [],
        })
        const resData = res.datas.find((i) => i.appUserCreator.userId === this.data.userId)
        if (resData) {
@@ -166,9 +170,10 @@
            })
          }
          let info = getTopicMsgCmsItemFile(this.data.worksInfo, resData.cmsItemDataList)
          console.log(info)
          this.setData({
            'teacherInfo.fullName': info.fullName,
            'teacherInfo.schoolName ': info.schoolName,
            'teacherInfo.schoolName': info.schoolName,
            'teacherInfo.positionalTitle': info.positionalTitle,
            'teacherInfo.courseName': info.courseName,
            'teacherInfo.phone': info.phone,
@@ -179,7 +184,8 @@
            'teacherInfo.agree': true,
            'teacherInfo.state': resData.state,
            topicId: resData.id,
            topicMessageList: resData.cmsItemDataList
            topicMessageList: resData.cmsItemDataList,
            teachText: info.positionalTitle,
          })
          if (resData.feedBack != null) {
            this.setData({
@@ -187,15 +193,19 @@
            })
          }
          if (this.data.teacherInfo.relevantCertificates.length > 0) {
            let arr = [];
            if (typeof this.data.teacherInfo.relevantCertificates == 'object') {
              this.data.teacherInfo.relevantCertificates.forEach((ele) => {
                let imgObj = {
                  md5: ele.file.md5,
                  linkType: 'LinkFile',
                  linkProtectType: 'Public',
                  url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + ele.file.md5
                  url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + ele.md5
                }
                this.data.fileList.push(imgObj)
                arr.push(imgObj);
                this.setData({
                  imgPics: arr,
                });
              })
            } else {
              let imgObj = {
@@ -205,9 +215,13 @@
                url:
                  app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates
              }
              this.data.fileList.push(imgObj)
              arr.push(imgObj);
              this.setData({
                imgPics: arr,
              });
            }
          }
        }
      } catch (error) {
      }
@@ -253,6 +267,31 @@
      }
    })
  },
  //学校名称
  onSchoolNameInput(e) {
    this.setData({
      "teacherInfo.schoolName": e.detail.value,
    });
  },
  //姓名
  onFullNameInput(e) {
    this.setData({
      "teacherInfo.fullName": e.detail.value,
    });
  },
  // 任教课程
  onCourseNameInput(e) {
    this.setData({
      "teacherInfo.courseName": e.detail.value,
    });
  },
  //详细地址
  onAddressInput(e) {
    this.setData({
      "teacherInfo.detailedAddress": e.detail.value,
    });
  },
  //选择职称
  onTeachPicker() {
@@ -279,6 +318,7 @@
    if (phoneError === isPhoneNumber) {
      this.setData({
        phoneError: !isPhoneNumber,
        "teacherInfo.phone": e.detail.value,
      });
    }
  },
@@ -289,6 +329,7 @@
    if (telphoneError === isPhoneNumber) {
      this.setData({
        telphoneError: !isPhoneNumber,
        "teacherInfo.telphone": e.detail.value,
      });
    }
  },
@@ -298,69 +339,115 @@
    if (emailError === isPhoneNumber) {
      this.setData({
        emailError: !isPhoneNumber,
        "teacherInfo.email": e.detail.value,
      });
    }
  },
  handleAdd(e) {
    const { fileList } = this.data;
    console.log(e)
    const { files } = e.detail;
    // 方法2:每次选择图片都上传,展示每次上传图片的进度
    files.forEach(file => {
      this.onUpload(file)
    })
  },
  onUpload(file) {
    console.log(file, '123')
    const isLt2M = (0.5 * file.size) / 1024 / 1024 < 0.5
    if (!isLt2M) {
      wx.showToast({
        title: "上传文件大小不能超过 500KB!",
        icon: 'none',
        duration: 1000,
      })
      return reject()
    }
    const FileName = file.name.split('.')[0]
    const Extension = file.name.split('.')[1]
    const FileType = file.type
    let size = 1024
    tool.getFileMd5(file, size * 1024).then((e) => {
      if (!this.data.fileList.find((item) => item.md5 == e)) {
        const imgData = new FormData()
        imgData.append('Md5', e)
        imgData.append('FileName', FileName)
        imgData.append('Extension', Extension)
        imgData.append('FileType', FileType)
        imgData.append('MetaData', null)
        imgData.append('file', file)
        app.MG.file.upload(imgData).then(() => {
          this.data.fileList.push({
            md5: e,
            linkType: 'LinkFile',
            linkProtectType: 'Public',
            name: FileName,
            type: FileType,
            url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + e
          })
  // 上传图片事件
  chooseImg(e) {
    var that = this;
    wx.chooseMedia({
      // count: 1, // 默认9
      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
      success: function (res) {
        // 返回选定照片的本地文件路径列表,tempFilePath也可以作为img标签的src属性显示图片
        console.log(res.tempFiles[0])
        tool.getFileMd5(res.tempFiles[0]).then((e) => {
          console.log(e, 4)
          if (!that.data.imgPics.find((item) => item.md5 == e)) {
            let formData = new FormData();
            formData.append('Md5', e);
            formData.append('FileName', e);
            formData.append('FileType', res.tempFiles[0].fileType);
            formData.appendFile("file", res.tempFiles[0].tempFilePath);
            const data = formData.getData();
            let _token = wx.getStorageSync(app.config.tokenKey);
            let header = {};
            if (_token == null) {
              header["Authorization"] = `Basic ${Base64.encode(website.clientId + ":" + website.clientSecret)}`;
            } else {
              header["Authorization"] = `Bearer ` + _token;
            }
            new Promise((resolve, reject) => {
              wx.request({
                url: app.config.requestCtx + '/file/api/ApiUpload',
                method: 'POST',
                header: {
                  'content-type': data.contentType,
                  ...header
                },
                data: data.buffer,
                success(res) {
                  if (res.statusCode == 200) {
                    resolve(res.data); if (res.data) {
                      let arr = [];
                      let imgObj = {
                        md5: e,
                        linkType: 'LinkFile',
                        linkProtectType: 'Public',
                        url:
                          app.config.requestCtx + `/file/GetPreViewImage?md5=` + e
                      }
                      arr = [...that.data.imgPics, ...[imgObj]];
                      that.setData({
                        imgPics: arr,
                      });
                    }
                  } else {
                    reject('运行时错误,请稍后再试');
                  }
                }
              })
            })
          } else {
            wx.showToast({
              title: "当前文件已上传,请勿重复操作!",
              icon: 'none',
              duration: 1000,
            })
          }
        })
      } else {
        ElMessage.error('当前文件已上传,请勿重复操作!')
      }
    })
      .catch((e) => {
        console.error(e)
      })
  },
  handleRemove(e) {
    const { index } = e.detail;
    const { fileList } = this.data;
    fileList.splice(index, 1);
    this.setData({
      fileList,
    });
  },
  // 删除图片
  deleteImg(e) {
    var imgs = this.data.imgPics;
    var index = e.currentTarget.dataset.index;
    imgs.splice(index, 1);
    this.setData({
      imgPics: imgs
    });
  },
  // 预览现场图片
  previewImg(e) {
    //获取当前图片的下标
    var index = e.currentTarget.dataset.index;
    //所有图片
    let imgs = [];
    this.data.imgPics.forEach(item => {
      imgs.push(item.url)
    })
    wx.previewImage({
      //当前显示图片
      current: imgs[index],
      //所有图片
      urls: imgs
    })
  },
  onChange() {
    console.log(this.data.teacherInfo.agree, 12)
    if (this.data.teacherInfo.agree) {
      this.setData({
        'teacherInfo.agree': false,
      });
    } else {
      this.setData({
        'teacherInfo.agree': true,
      });
    }
  },
  //查看教师认证服务
@@ -372,7 +459,161 @@
  onVisibleChange(e) {
    this.setData({
      protocolShow: e.detail.visible,
      reasonTxtShow: e.detail.visible
    });
  },
  //查看为通过原因
  previewReason() {
    this.setData({
      reasonTxtShow: true,
    });
  },
  submit() {
    let that = this;
    if (!that.data.teacherInfo.schoolName) {
      wx.showToast({
        title: "请填写学校名称!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    if (!that.data.teacherInfo.fullName) {
      wx.showToast({
        title: "请填写真实姓名!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    if (!that.data.teacherInfo.courseName) {
      wx.showToast({
        title: "请填写任教课程!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    if (!that.data.teacherInfo.phone) {
      wx.showToast({
        title: "请填写联系电话!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    if (!that.data.teacherInfo.email) {
      wx.showToast({
        title: "请填写邮箱!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    if (that.data.teacherInfo.relevantCertificates.length == 0) {
      wx.showToast({
        title: "请上传工作证!",
        icon: 'none',
        duration: 1000,
      })
      return
    }
    console.log(that.data.teacherInfo.fullName)
    if (that.data.teacherInfo.agree) {
      if (that.data.topicMessageList.length > 0) {
        let dataRequests = tool.UpdateworksDataBytool(
          that.data.worksInfo,
          that.data.topicMessageList,
          that.data.teacherInfo,
          that.data.imgPics
        );
        console.log(dataRequests, 4)
        const data = {
          description: '',
          icon: '',
          id: that.data.topicId,
          topicIdOrRefCode: 'teacherRoleApproval',
          name: that.data.teacherInfo.fullName + '',
          content: '',
          state: 'WaitAudit',
          type: 'teacherRegister',
          newDataRequests: dataRequests.newData,
          updateDataRequests: dataRequests.updateData,
          delDataRequest: {
            ids: []
          }
        }
        let basicInfo = JSON.parse(JSON.stringify(that.data.teacherInfo))
        delete basicInfo.worksInfo
        delete basicInfo.state
        const userInfo = {
          requests: [
            {
              data: JSON.stringify(basicInfo),
              name: that.data.teacherInfo.fullName + '',
              type: 'newTeacherInfo'
            }
          ]
        }
        app.MG.identity.setAppUserInfo(userInfo).then((res) => {
          if (res) {
            app.MG.ugc.updateTopicMessage(data).then(() => {
              if (res !== false) {
                wx.showToast({
                  title: "提交成功!请等待审核...",
                  icon: 'none',
                  duration: 1000,
                })
                that.newGetTeacherInfo()
              }
            })
          }
        })
      } else {
        const data = {
          topicIdOrRefCode: 'teacherRoleApproval',
          name: that.data.teacherInfo.fullName + '',
          content: '',
          state: 'WaitAudit',
          type: 'teacherRegister',
          cmsTypeRefCode: 'jsek_teacherCertification',
          newDataListRequest: tool.worksDataBytool(that.data.worksInfo, that.data.teacherInfo, that.data.imgPics)
        }
        let basicInfo = JSON.parse(JSON.stringify(that.data.teacherInfo))
        delete basicInfo.worksInfo
        delete basicInfo.state
        const userInfo = {
          requests: [
            {
              data: JSON.stringify(basicInfo),
              name: that.data.teacherInfo.fullName + '',
              type: 'teacherInfo'
            }
          ]
        }
        app.MG.identity.setAppUserInfo(userInfo).then((res) => {
          app.MG.ugc.newTopicMessage(data).then(() => {
            if (res !== false) {
              wx.showToast({
                title: "提交成功!请等待审核...",
                icon: 'none',
                duration: 1000,
              })
              that.newGetTeacherInfo()
            }
          })
        })
      }
    } else {
      wx.showToast({
        title: "请同意《教师认证服务条款》!",
        icon: 'none',
        duration: 1000,
      })
    }
  },
packageDomain/pages/teacherCertification/index.json
@@ -7,6 +7,7 @@
    "t-input": "tdesign-miniprogram/input/input",
    "t-upload": "tdesign-miniprogram/upload/upload",
    "t-popup": "tdesign-miniprogram/popup/popup",
    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox"
    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
    "t-image": "tdesign-miniprogram/image/image"
  }
}
packageDomain/pages/teacherCertification/index.wxml
@@ -9,57 +9,61 @@
          <text class="yes" wx:if="{{teacherInfo.state == 'Normal'}}">已认证</text>
          <text class="no" wx:if="{{teacherInfo.state == 'Reject'}}">已驳回</text>
          <text class="wait" wx:if="{{teacherInfo.state == ''}}">待认证</text>
          <view class="reasonTxt" bindtap="previewReason" wx:if="{{teacherInfo.state == 'Reject'}}">查看原因</view>
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 学校: </view>
        <view class="item-content">
          <t-input placeholder="请输入学校" borderless value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" />
          <t-input placeholder="请输入学校" borderless value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" bindchange="onSchoolNameInput" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 真实姓名: </view>
        <view class="item-content">
          <t-input placeholder="请输入真实姓名" borderless value="{{teacherInfo.fullName}}" disabled="{{!editState}}" />
          <t-input placeholder="请输入真实姓名" borderless value="{{teacherInfo.fullName}}" disabled="{{!editState}}" bindchange="onFullNameInput" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 职称: </view>
        <view class="item-content">
        <view class="item-content state" wx:if="{{editState}}">
          <t-cell arrow note="{{teachText}}" bind:click="onTeachPicker" />
          <t-picker visible="{{teachVisible}}" default-value="{{teacherInfo.positionalTitle}}" title="选择职称" cancelBtn="取消" confirmBtn="确认" bindchange="onPickerChange" bindcancel="onPickerCancel">
          <t-picker visible="{{teachVisible}}" value="{{teacherInfo.positionalTitle}}" title="选择职称" cancelBtn="取消" confirmBtn="确认" bindchange="onPickerChange" bindcancel="onPickerCancel">
            <t-picker-item options="{{teachPosts}}" />
          </t-picker>
        </view>
        <view class="item-content" wx:if="{{!editState}}">
          <t-cell arrow note="{{teachText}}" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 任教课程: </view>
        <view class="item-content">
          <t-input placeholder="请输入任教课程" borderless value="{{teacherInfo.courseName}}" />
          <t-input placeholder="请输入任教课程" borderless value="{{teacherInfo.courseName}}" bindchange="onCourseNameInput" disabled="{{!editState}}" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 手机号: </view>
        <view class="item-content">
          <t-input placeholder="输入手机号码" borderless value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" />
          <t-input placeholder="输入手机号码" borderless value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" disabled="{{!editState}}" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 座机: </view>
        <view class="item-content">
          <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" type="number" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" />
          <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" type="number" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" disabled="{{!editState}}" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 邮箱: </view>
        <view class="item-content">
          <t-input placeholder="输入邮箱" borderless value="{{teacherInfo.email}}" type="number" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" />
          <t-input placeholder="输入邮箱" borderless value="{{teacherInfo.email}}" type="number" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" disabled="{{!editState}}" />
        </view>
      </view>
      <view class="from-item">
        <view class="label"> 详细地址: </view>
        <view class="item-content">
          <t-input placeholder="请输入详细地址" borderless value="{{teacherInfo.detailedAddress}}" />
          <t-input placeholder="请输入详细地址" borderless value="{{teacherInfo.detailedAddress}}" bindchange="onAddressInput" disabled="{{!editState}}" />
        </view>
      </view>
    </view>
@@ -67,9 +71,15 @@
      <view class="from-item">
        <view class="label"> 在职教师工作证: </view>
        <view class="imageBox">
          <view class="wrapper">
            <t-upload mediaType="{{['image']}}" files="{{fileList}}" bind:add="handleAdd" bind:remove="handleRemove">
            </t-upload>
          <view class="weui-uploader">
            <view class='pics' wx:for="{{imgPics}}" wx:for-item="item" wx:key="*this">
              <image class='weui-uploader__img' src="{{item.url}}" data-index="{{index}}" mode="aspectFill" bindtap="previewImg">
                <icon type='cancel' class="delete-btn" data-index="{{index}}" catchtap="deleteImg"></icon>
              </image>
            </view>
            <view class="tp_cont {{tj_ycang?'':'hide'}}" bindtap="chooseImg" wx:if="{{editState}}">
              <view class="tp_add">+</view>
            </view>
          </view>
        </view>
        <view class="fileTip">
@@ -78,16 +88,23 @@
      </view>
    </view>
    <view class="protocolBox">
      <t-checkbox label="" icon="rectangle" default-checked="{{teacherInfo.agree}}" bind:change="onChange" />
      <t-checkbox label="" icon="rectangle" checked="{{teacherInfo.agree}}" bind:change="onChange" disabled="{{!editState}}" />
      <text class="wait" bind:tap="viewContent">《教师认证服务条款》</text>
    </view>
    <view class="btn-area">
      <button class="submit" formType="submit">提交</button>
    <view class="btn-area" wx:if="{{editState}}">
      <button class="submit" bindtap="submit">提交</button>
    </view>
  </view>
  <t-popup visible="{{protocolShow}}" bind:visible-change="onVisibleChange" placement="center" close-btn>
    <view class="block">
      <rich-text space="emsp" nodes="{{protocolTxt}}" class="content" />
    </view>
  </t-popup>
  <view class="popupBox">
    <t-popup visible="{{protocolShow}}" bind:visible-change="onVisibleChange" placement="center" close-btn>
      <view class="block">
        <rich-text space="emsp" nodes="{{protocolTxt}}" class="content" />
      </view>
    </t-popup>
    <t-popup visible="{{reasonTxtShow}}" bind:visible-change="onVisibleChange" placement="center" close-btn>
      <view class="reasonBlock">
        {{reasonTxt}}
      </view>
    </t-popup>
  </view>
</view>
packageDomain/pages/teacherCertification/index.wxss
@@ -48,13 +48,19 @@
}
.from-item .item-content {
  width: 56%;
  width: 75%;
  border: 2rpx solid #D9D9D9;
  padding: 10rpx;
}
.from-item .stateBox {
  padding: 10rpx;
  display: flex;
}
.reasonTxt {
  margin-left: 40rpx;
  color: #ff6d00;
}
.from-item .t-input {
@@ -78,7 +84,12 @@
.t-cell__note {
  justify-content: flex-start !important;
  display: block !important;
  font-size: 28rpx !important;
  /* width: 300rpx; */
}
.state .t-cell__note {
  color: #333 !important;
}
.t-input__wrap .t-input__content,
@@ -117,10 +128,6 @@
  padding: 20rpx;
}
.wrapper {
  width: 100%;
}
.fileTip {
  font-size: 24rpx;
  color: #949494;
@@ -145,11 +152,11 @@
  color: #ff6c00 !important;
}
.t-popup {
.popupBox .t-popup {
  width: 80% !important;
}
.t-popup__content {
.popupBox .t-popup__content {
  padding: 40rpx 10rpx !important;
  padding-top: 80rpx !important;
}
@@ -157,6 +164,13 @@
.block {
  height: 450px !important;
  overflow: auto !important;
}
.reasonBlock {
  height: 450px !important;
  overflow: auto !important;
  font-size: 28rpx;
  line-height: 48rpx;
}
.btn-area {
@@ -169,4 +183,40 @@
  background: #ff6c00;
  color: #fff;
  border-radius: 50rpx;
}
/* 上传图片样式 */
.weui-uploader {
  height: 152rpx;
}
.tp_add {
  width: 152rpx;
  height: 152rpx;
  border-radius: 10rpx;
  opacity: 1;
  border: 2rpx dashed #999999;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 59rpx;
}
.pics {
  float: left;
  position: relative;
  margin-right: 15px;
}
.pics image {
  width: 152rpx;
  height: 152rpx;
}
.delete-btn {
  width: 20rpx;
  height: 20rpx;
  position: absolute;
  top: -15rpx;
  right: -5rpx;
}
packagePersonal/pages/userSetting/index.js
New file
@@ -0,0 +1,66 @@
// packagePersonal/pages/userSetting/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  }
})
packagePersonal/pages/userSetting/index.json
New file
@@ -0,0 +1,3 @@
{
  "usingComponents": {}
}
packagePersonal/pages/userSetting/index.wxml
New file
@@ -0,0 +1,2 @@
<!--packagePersonal/pages/userSetting/index.wxml-->
<text>packagePersonal/pages/userSetting/index.wxml</text>
packagePersonal/pages/userSetting/index.wxss
New file
@@ -0,0 +1 @@
/* packagePersonal/pages/userSetting/index.wxss */
pages/home/home.js
@@ -4,6 +4,8 @@
const app = getApp()
Page({
  data: {
    barHeight: '',
    navBarHeight: '',
    searchVal: '',
    isWhite: false,
    backUrl: null,
@@ -36,6 +38,13 @@
  },
  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,
    });
    if (options.backUrl) {
      let backUrl = JSON.parse(decodeURIComponent(options.backUrl));
      if (backUrl.options) {
@@ -149,7 +158,7 @@
  getBannerList() {
    const list = []
    app.MG.resource.getItem({
      path: 'jsek_banner\\jsek_homeBanner',
      path: 'jsek_banner\\jsek_homeBannerApplet',
      fields: { jsek_link: [] },
      paging: { start: 0, size: 9 }
    }).then(res => {
pages/home/home.wxml
@@ -1,7 +1,8 @@
<view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}">
  <t-loading theme="circular" size="40rpx" text="加载中..." inherit-color />
</view>
<view class="background {{ isWhite ? 'white':''}}">
<view class="background {{ isWhite ? 'white':''}}" style="padding-top: {{barHeight}}px">
  <text class="text">京师E课</text>
</view>
<view class="home-page-header">
@@ -195,7 +196,7 @@
            </view>
            <view class="body-info">
              <view class="name">{{item.name}}</view>
              <view class="author">{{item.author}}</view>
              <!-- <view class="author">{{item.author}}</view> -->
            </view>
          </view>
        </view>
pages/home/home.wxss
@@ -15,6 +15,7 @@
  top: 0;
  left: 0;
  height: 80rpx;
  line-height: 80rpx;
  z-index: 3;
  text-align: center;
  padding-top: 110rpx;
@@ -152,7 +153,7 @@
.body-info .name {
  font-size: 30rpx;
  height: 88rpx;
  height: 80rpx;
  color: #333333;
  font-weight: bold;
  line-height: 40rpx;
@@ -173,6 +174,17 @@
  font-size: 26rpx;
  display: flex;
  justify-content: space-between;
  display: -webkit-box;
  /* 使用弹性盒子布局模型 */
  -webkit-line-clamp: 1;
  /* 控制文本的行数 */
  -webkit-box-orient: vertical;
  /* 设置盒子的子元素排列方向 */
  overflow: hidden;
  /* 超出部分隐藏 */
  text-overflow: ellipsis;
  /* 超出部分显示省略号 */
  white-space: normal;
}
.body-info .price {
@@ -241,7 +253,7 @@
}
.listBox2 .booksListItemBox {
  width: calc(100%/3 - 30rpx);
  width: calc(100%/3 - 32rpx);
  margin-bottom: 30rpx;
  margin-right: 45rpx;
}
@@ -360,10 +372,16 @@
  height: 80rpx;
  width: 188rpx;
  color: #333333;
  line-height: 30rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 40rpx;
  display: -webkit-box;
  /* 使用弹性盒子布局模型 */
  -webkit-line-clamp: 2;
  /* 控制文本的行数 */
  -webkit-box-orient: vertical;
  /* 设置盒子的子元素排列方向 */
  overflow: hidden;
  /* 超出部分隐藏 */
  text-overflow: ellipsis;
  /* 超出部分显示省略号 */
  white-space: normal;
}
pages/personalCenter/components/user-center-card/index.js
@@ -31,5 +31,8 @@
    gotoUserEditPage() {
      this.triggerEvent('gotoUserEditPage');
    },
    editUserType() {
      this.triggerEvent('editUserType');
    },
  },
});
pages/personalCenter/components/user-center-card/index.wxml
@@ -3,7 +3,9 @@
  <block wx:if="{{currAuthStep === AuthStepType.ONE}}">
    <view class="user-center-card__header" bind:tap="gotoUserEditPage">
      <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
      <view class="user-center-card__header__name">{{'请登录'}}</view>
      <view>
        <view class="user-center-card__header__name">{{'请登录'}}</view>
      </view>
      <view class="setting" bind:tap="gotoUserEditPage">
        <image src="/static/images/personal/setting.png" mode="heightFix" class="img" />
        <text>设置</text>
@@ -13,21 +15,37 @@
  <!-- 已登录但未授权用户信息情况 -->
  <block wx:if="{{currAuthStep === AuthStepType.TWO}}">
    <view class="user-center-card__header">
      <t-avatar image="{{userInfo.avatarUrl || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
      <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
      <!-- 需要授权用户信息,通过slot添加弹窗 -->
      <view class="user-center-card__header__transparent" wx:if="{{isNeedGetUserInfo}}">
        <slot name="getUserInfo" />
      <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" />
      <view>
        <view class="user-center-card__header__name">{{userInfo.fullName || '微信用户'}}</view>
        <view class="userTypeBox">
          <text>{{userInfo.userType}}</text>
          <text class="edit" bindtap="editUserType">修改</text>
        </view>
      </view>
      <!-- 不需要授权用户信息,仍然触发gotoUserEditPage事件 -->
      <view class="user-center-card__header__transparent" bind:tap="gotoUserEditPage" wx:else></view>
      <view class="setting" bind:tap="gotoUserEditPage">
        <image src="/static/images/personal/setting.png" mode="heightFix" class="img" />
        <text>设置</text>
      </view>
    </view>
  </block>
  <!-- 已登录且已经授权用户信息的情况 -->
  <block wx:if="{{currAuthStep === AuthStepType.THREE}}">
    <view class="user-center-card__header" bind:tap="gotoUserEditPage">
      <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.avatarUrl || defaultAvatarUrl}}" />
      <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view>
    <view class="user-center-card__header">
      <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.icon || defaultAvatarUrl}}" />
      <view>
        <view class="user-center-card__header__name">{{userInfo.fullName || '微信用户'}}</view>
        <view class="userTypeBox">
          <text>{{userInfo.userType}}</text>
          <text bindtap="editUserType">修改</text>
        </view>
      </view>
      <view class="setting" bind:tap="gotoUserEditPage">
        <image src="/static/images/personal/setting.png" mode="heightFix" class="img" />
        <text>设置</text>
      </view>
    </view>
  </block>
</view>
pages/personalCenter/components/user-center-card/index.wxss
@@ -9,7 +9,7 @@
  margin-top: 160rpx;
  margin-bottom: 30rpx;
  margin-left: 20rpx;
  height: 96rpx;
  height: 120rpx;
  line-height: 48rpx;
  display: flex;
  justify-content: flex-start;
@@ -19,8 +19,8 @@
}
.user-center-card__header__avatar {
  width: 96rpx;
  height: 96rpx;
  width: 120rpx;
  height: 120rpx;
  border-radius: 48rpx;
  overflow: hidden;
}
@@ -34,6 +34,17 @@
  margin-right: 16rpx;
}
.userTypeBox {
  margin-left: 24rpx;
  font-size: 28rpx;
  padding-top: 15rpx;
}
.edit {
  margin-left: 20rpx;
  color: #ff6d00;
}
.user-center-card__header__transparent {
  position: absolute;
  left: 0;
pages/personalCenter/index.js
@@ -77,21 +77,37 @@
    type: 'contact',
  }
];
const userTypeList = [
  {
    lable: '中职教师',
    value: 'vocSchoolTeachers'
  },
  {
    lable: '高职教师',
    value: 'vocCollegeTeachers'
  },
  {
    lable: '普通高校教师',
    value: 'ordUniversityTeachers'
  },
  {
    lable: '其他读者',
    value: 'otherReaders'
  }
];
Page({
  /**
   * 页面的初始数据
   */
  data: {
    barHeight: '',
    navBarHeight: '',
    isWhite: false,
    show: false,
    userInfo: {
      avatarUrl:
        'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/avatar/avatar-1.jpg',
      nickName: 'TDesign',
      phoneNumber: '13438358888',
    },
    userInfo: {},
    currAuthStep: 1,
    userTypeActive: '',
    userTypeList,
    teacherState: {
      state: '',
      reasonTxt: '',
@@ -99,56 +115,109 @@
    integral: 0,
    menuData,
    moreMenu,
    moreMenu1
    moreMenu1,
    visible: false,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(options);
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (wx.getStorageSync(app.config.userInfoKey)) {
  onLoad() {
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
    this.setData({
      barHeight: systInfo.statusBarHeight,
      navBarHeight: navBarHeight,
    });
    if (wx.getStorageSync(app.config.tokenKey)) {
      this.setData({
        show: true,
        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
      })
      if (typeof this.getTabBar === 'function' && this.getTabBar()) {
        this.getTabBar().setData({
          selected: 4 //这个数字是当前页面在tabBar中list数组的索引
        })
      }
      this.getTeacherInfo()
        currAuthStep: 2,
      });
      this.getUserInfo()
    } else {
      this.setData({
        currAuthStep: 1,
      });
      wx.navigateTo({
        url: "/pages/testLogin/index",
      });
    }
  },
  /**
 * 生命周期函数--监听页面隐藏
 */
  onHide() {
    this.setData({
      show: false
    })
  onShow() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    this.init();
    this.getUserInfo()
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  // 获取登录用户身份
  getUserInfo() {
    app.MG.identity.getCurrentAppUser().then(res => {
      // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认)
      if (res) {
        //获取用户类型
        let userTypeData = res.infoList.find((item) => item.type == 'userType')
        let type = "";
        if (userTypeData) {
          this.data.userTypeActive = JSON.parse(userTypeData.data).userType;
          type = userTypeList.find((item) => item.value === this.data.userTypeActive)?.lable;
        } else {
          type = '-'
        }
        let defaultUser = {};
        let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher')
        let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo')
        let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword')
        let WeChatInfo = res.infoList.find((item) => item.type === "WeChat");
        if (teacherRole && teacherInfos) {
          defaultUser = {
            ...teacherInfos,
            fullName: teacherInfos.fullName,
            icon: teacherInfos.icon,
            userId: res.userId,
            role: 'Teacher',
            roleId: teacherRole.role.id,
            userType: type
          }
          this.setData({
            currAuthStep: 2,
          });
        } else if (WeChatInfo) {
          defaultUser = {
            ...WeChatInfo,
            fullName: WeChatInfo.name,
            icon: WeChatInfo.icon,
            userId: res.userId,
            userType: type
          }
          this.setData({
            currAuthStep: 3,
          });
        } else if (secretData) {
          defaultUser = {
            fullName: secretData.credential,
            icon: "",
            userId: res.userId,
            userType: type
          }
        }
        this.setData({
          userInfo: defaultUser
        })
        this.getTeacherInfo()
        wx.setStorageSync(app.config.userInfoKey, JSON.stringify(this.data.userInfo));
      }
    });
  },
  //教师信息
  getTeacherInfo() {
@@ -163,7 +232,6 @@
      }
    }
    app.MG.ugc.getTopicMessageList(data).then((res) => {
      console.log(this.data.userInfo, "userInfo")
      const resData = res.datas.find((i) => i.appUserCreator.userId == this.data.userInfo.userId)
      if (resData) {
        this.setData({
@@ -179,6 +247,23 @@
  toCertification() {
    wx.navigateTo({
      url: "/packageDomain/pages/teacherCertification/index",
    });
  },
  //修改用户类型
  editUserType() {
    this.setData({
      visible: true,
    });
  },
  onVisibleChange(e) {
    this.setData({
      visible: e.detail.visible,
    });
  },
  //设置
  gotoUserEditPage() {
    wx.navigateTo({
      url: "/packagePersonal/pages/userSetting/index",
    });
  },
@@ -203,13 +288,6 @@
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  onPageScroll(e) {
    this.setData({
      isWhite: e.scrollTop > 50 ? true : false
    })
  },
  //跳转关于我们和联系我们
pages/personalCenter/index.wxml
@@ -1,12 +1,12 @@
<view class="background {{ isWhite ? 'white':''}}">
<view style="width: 100%; height: {{barHeight}}px;"></view>
<view class="background {{ isWhite ? 'white':''}}" style="padding-top: {{barHeight}}px">
  <text class="text">个人中心</text>
</view>
<view class="home-page">
  <view class="bg">
    <image src="/static/images/personal/my-bg.png" mode="heightFix" class="image" />
  </view>
  <!-- <image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> -->
  <t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" />
  <t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" bind:editUserType="editUserType" />
  <view class="content-wrapper">
    <view class="topBox">
      <view class="teacherBox">
@@ -46,8 +46,8 @@
        <text>更多功能</text>
      </view>
      <view class="domainList1">
        <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem" >
          <view class="icon"  >
        <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem">
          <view class="icon">
            <t-image src="{{item.icon}}" mode="heightFix" class="img" />
          </view>
          <view class="label">
@@ -67,4 +67,13 @@
      </view>
    </view>
  </view>
</view>
</view>
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="bottom">
  <view class="block">
    <view class="header">
      <view class="btn btn--cancel" aria-role="button">取消</view>
      <view class="title">标题文字</view>
      <view class="btn btn--confirm" aria-role="button">确定</view>
    </view>
  </view>
</t-popup>
pages/personalCenter/index.wxss
@@ -10,9 +10,9 @@
  top: 0;
  left: 0;
  height: 80rpx;
  line-height: 80rpx;
  z-index: 3;
  text-align: center;
  padding-top: 60rpx;
  font-size: 36rpx;
}
pages/testLogin/index.js
@@ -77,7 +77,7 @@
        } else if (secretData) {
          defaultUser = {
            nickName: secretData.credential,
            avatarUrl: "../../static/images/index/tab.png",
            avatarUrl: "",
            userId: res.userId
          }
        }
utils/formdata/index.js
New file
@@ -0,0 +1,145 @@
import mimeMap from './mimeMap'
function FormData(){
  let fileManager = wx.getFileSystemManager();
  let data = {};
  let files = [];
  this.append = (name, value)=>{
    data[name] = value;
    return true;
  }
  this.appendFile = (name, path)=>{
    let buffer = fileManager.readFileSync(path);
    if(Object.prototype.toString.call(buffer).indexOf("ArrayBuffer") < 0){
      return false;
    }
    files.push({
      name: name,
      buffer: buffer,
      fileName: getFileNameFromPath(path)
    });
    return true;
  }
  this.getData = ()=>convert(data, files)
}
function getFileNameFromPath(path){
  let idx=path.lastIndexOf("/");
  return path.substr(idx+1);
}
function convert(data, files){
  let boundaryKey = 'wxmpFormBoundary' + randString(); // 数据分割符,一般是随机的字符串
  let boundary = '--' + boundaryKey;
  let endBoundary = boundary + '--';
  let postArray = [];
  //拼接参数
  if(data && Object.prototype.toString.call(data) == "[object Object]"){
    for(let key in data){
      postArray = postArray.concat(formDataArray(boundary, key, data[key]));
    }
  }
  //拼接文件
  if(files && Object.prototype.toString.call(files) == "[object Array]"){
    for(let i in files){
      let file = files[i];
      postArray = postArray.concat(formDataArray(boundary, file.name, file.buffer, file.fileName));
    }
  }
  //结尾
  let endBoundaryArray = [];
  for (var i = 0; i < endBoundary.length; i++) { // 最后取出结束boundary的charCode
    endBoundaryArray.push(...endBoundary.utf8CodeAt(i));
  }
  postArray = postArray.concat(endBoundaryArray);
  return {
    contentType: 'multipart/form-data; boundary=' + boundaryKey,
    buffer: new Uint8Array(postArray).buffer
  }
}
function randString() {
  let res = "";
  for (let i = 0; i < 17; i++) {
    let n = parseInt(Math.random() * 62);
    if (n <= 9) {
      res += n;
    }
    else if (n <= 35) {
      res += String.fromCharCode(n + 55);
    }
    else {
      res += String.fromCharCode(n + 61);
    }
  }
  return res;
}
function formDataArray(boundary, name, value, fileName){
  let dataString = '';
  let isFile = !!fileName;
  dataString += boundary + '\r\n';
  dataString += 'Content-Disposition: form-data; name="' + name + '"';
  if (isFile){
    dataString += '; filename="' + fileName + '"' + '\r\n';
    dataString += 'Content-Type: ' + getFileMime(fileName) + '\r\n\r\n';
  }
  else{
    dataString += '\r\n\r\n';
    dataString += value;
  }
  var dataArray = [];
  for (var i = 0; i < dataString.length; i++) { // 取出文本的charCode(10进制)
    dataArray.push(...dataString.utf8CodeAt(i));
  }
  if (isFile) {
    let fileArray = new Uint8Array(value);
    dataArray = dataArray.concat(Array.prototype.slice.call(fileArray));
  }
  dataArray.push(..."\r".utf8CodeAt());
  dataArray.push(..."\n".utf8CodeAt());
  return dataArray;
}
function getFileMime(fileName){
  let idx = fileName.lastIndexOf(".");
  let mime = mimeMap[fileName.substr(idx)];
  return mime?mime:"application/octet-stream"
}
String.prototype.utf8CodeAt = function(i) {
  var str = this;
  var out = [], p = 0;
  var c = str.charCodeAt(i);
  if (c < 128) {
    out[p++] = c;
  } else if (c < 2048) {
    out[p++] = (c >> 6) | 192;
    out[p++] = (c & 63) | 128;
  } else if (
      ((c & 0xFC00) == 0xD800) && (i + 1) < str.length &&
      ((str.charCodeAt(i + 1) & 0xFC00) == 0xDC00)) {
    // Surrogate Pair
    c = 0x10000 + ((c & 0x03FF) << 10) + (str.charCodeAt(++i) & 0x03FF);
    out[p++] = (c >> 18) | 240;
    out[p++] = ((c >> 12) & 63) | 128;
    out[p++] = ((c >> 6) & 63) | 128;
    out[p++] = (c & 63) | 128;
  } else {
    out[p++] = (c >> 12) | 224;
    out[p++] = ((c >> 6) & 63) | 128;
    out[p++] = (c & 63) | 128;
  }
  return out;
};
export default FormData;
utils/formdata/mimeMap.js
New file
@@ -0,0 +1,346 @@
const mimeMap = {
  "0.001": "application/x-001",
  "0.323": "text/h323",
  "0.907": "drawing/907",
  ".acp": "audio/x-mei-aac",
  ".aif": "audio/aiff",
  ".aiff": "audio/aiff",
  ".asa": "text/asa",
  ".asp": "text/asp",
  ".au": "audio/basic",
  ".awf": "application/vnd.adobe.workflow",
  ".bmp": "application/x-bmp",
  ".c4t": "application/x-c4t",
  ".cal": "application/x-cals",
  ".cdf": "application/x-netcdf",
  ".cel": "application/x-cel",
  ".cg4": "application/x-g4",
  ".cit": "application/x-cit",
  ".cml": "text/xml",
  ".cmx": "application/x-cmx",
  ".crl": "application/pkix-crl",
  ".csi": "application/x-csi",
  ".cut": "application/x-cut",
  ".dbm": "application/x-dbm",
  ".dcd": "text/xml",
  ".der": "application/x-x509-ca-cert",
  ".dib": "application/x-dib",
  ".doc": "application/msword",
  ".drw": "application/x-drw",
  ".dwf": "Model/vnd.dwf",
  ".dwg": "application/x-dwg",
  ".dxf": "application/x-dxf",
  ".emf": "application/x-emf",
  ".ent": "text/xml",
  ".eps": "application/x-ps",
  ".etd": "application/x-ebx",
  ".fax": "image/fax",
  ".fif": "application/fractals",
  ".frm": "application/x-frm",
  ".gbr": "application/x-gbr",
  ".gif": "image/gif",
  ".gp4": "application/x-gp4",
  ".hmr": "application/x-hmr",
  ".hpl": "application/x-hpl",
  ".hrf": "application/x-hrf",
  ".htc": "text/x-component",
  ".html": "text/html",
  ".htx": "text/html",
  ".ico": "image/x-icon",
  ".iff": "application/x-iff",
  ".igs": "application/x-igs",
  ".img": "application/x-img",
  ".isp": "application/x-internet-signup",
  ".java": "java/*",
  ".jpe": "image/jpeg",
  ".jpeg": "image/jpeg",
  ".jpg": "application/x-jpg",
  ".jsp": "text/html",
  ".lar": "application/x-laplayer-reg",
  ".lavs": "audio/x-liquid-secure",
  ".lmsff": "audio/x-la-lms",
  ".ltr": "application/x-ltr",
  ".m2v": "video/x-mpeg",
  ".m4e": "video/mpeg4",
  ".man": "application/x-troff-man",
  ".mdb": "application/msaccess",
  ".mfp": "application/x-shockwave-flash",
  ".mhtml": "message/rfc822",
  ".mid": "audio/mid",
  ".mil": "application/x-mil",
  ".mnd": "audio/x-musicnet-download",
  ".mocha": "application/x-javascript",
  ".mp1": "audio/mp1",
  ".mp2v": "video/mpeg",
  ".mp4": "video/mpeg4",
  ".mpd": "application/vnd.ms-project",
  ".mpeg": "video/mpg",
  ".mpga": "audio/rn-mpeg",
  ".mps": "video/x-mpeg",
  ".mpv": "video/mpg",
  ".mpw": "application/vnd.ms-project",
  ".mtx": "text/xml",
  ".net": "image/pnetvue",
  ".nws": "message/rfc822",
  ".out": "application/x-out",
  ".p12": "application/x-pkcs12",
  ".p7c": "application/pkcs7-mime",
  ".p7r": "application/x-pkcs7-certreqresp",
  ".pc5": "application/x-pc5",
  ".pcl": "application/x-pcl",
  ".pdf": "application/pdf",
  ".pdx": "application/vnd.adobe.pdx",
  ".pgl": "application/x-pgl",
  ".pko": "application/vnd.ms-pki.pko",
  ".plg": "text/html",
  ".plt": "application/x-plt",
  ".png": "application/x-png",
  ".ppa": "application/vnd.ms-powerpoint",
  ".pps": "application/vnd.ms-powerpoint",
  ".ppt": "application/x-ppt",
  ".prf": "application/pics-rules",
  ".prt": "application/x-prt",
  ".ps": "application/postscript",
  ".pwz": "application/vnd.ms-powerpoint",
  ".ra": "audio/vnd.rn-realaudio",
  ".ras": "application/x-ras",
  ".rdf": "text/xml",
  ".red": "application/x-red",
  ".rjs": "application/vnd.rn-realsystem-rjs",
  ".rlc": "application/x-rlc",
  ".rm": "application/vnd.rn-realmedia",
  ".rmi": "audio/mid",
  ".rmm": "audio/x-pn-realaudio",
  ".rms": "application/vnd.rn-realmedia-secure",
  ".rmx": "application/vnd.rn-realsystem-rmx",
  ".rp": "image/vnd.rn-realpix",
  ".rsml": "application/vnd.rn-rsml",
  ".rtf": "application/msword",
  ".rv": "video/vnd.rn-realvideo",
  ".sat": "application/x-sat",
  ".sdw": "application/x-sdw",
  ".slb": "application/x-slb",
  ".slk": "drawing/x-slk",
  ".smil": "application/smil",
  ".snd": "audio/basic",
  ".sor": "text/plain",
  ".spl": "application/futuresplash",
  ".ssm": "application/streamingmedia",
  ".stl": "application/vnd.ms-pki.stl",
  ".sty": "application/x-sty",
  ".swf": "application/x-shockwave-flash",
  ".tg4": "application/x-tg4",
  ".tif": "image/tiff",
  ".tiff": "image/tiff",
  ".top": "drawing/x-top",
  ".tsd": "text/xml",
  ".uin": "application/x-icq",
  ".vcf": "text/x-vcard",
  ".vdx": "application/vnd.visio",
  ".vpg": "application/x-vpeg005",
  ".vsd": "application/x-vsd",
  ".vst": "application/vnd.visio",
  ".vsw": "application/vnd.visio",
  ".vtx": "application/vnd.visio",
  ".wav": "audio/wav",
  ".wb1": "application/x-wb1",
  ".wb3": "application/x-wb3",
  ".wiz": "application/msword",
  ".wk4": "application/x-wk4",
  ".wks": "application/x-wks",
  ".wma": "audio/x-ms-wma",
  ".wmf": "application/x-wmf",
  ".wmv": "video/x-ms-wmv",
  ".wmz": "application/x-ms-wmz",
  ".wpd": "application/x-wpd",
  ".wpl": "application/vnd.ms-wpl",
  ".wr1": "application/x-wr1",
  ".wrk": "application/x-wrk",
  ".ws2": "application/x-ws",
  ".wsdl": "text/xml",
  ".xdp": "application/vnd.adobe.xdp",
  ".xfd": "application/vnd.adobe.xfd",
  ".xhtml": "text/html",
  ".xls": "application/x-xls",
  ".xml": "text/xml",
  ".xq": "text/xml",
  ".xquery": "text/xml",
  ".xsl": "text/xml",
  ".xwd": "application/x-xwd",
  ".sis": "application/vnd.symbian.install",
  ".x_t": "application/x-x_t",
  ".apk": "application/vnd.android.package-archive",
  "0.301": "application/x-301",
  "0.906": "application/x-906",
  ".a11": "application/x-a11",
  ".ai": "application/postscript",
  ".aifc": "audio/aiff",
  ".anv": "application/x-anv",
  ".asf": "video/x-ms-asf",
  ".asx": "video/x-ms-asf",
  ".avi": "video/avi",
  ".biz": "text/xml",
  ".bot": "application/x-bot",
  ".c90": "application/x-c90",
  ".cat": "application/vnd.ms-pki.seccat",
  ".cdr": "application/x-cdr",
  ".cer": "application/x-x509-ca-cert",
  ".cgm": "application/x-cgm",
  ".class": "java/*",
  ".cmp": "application/x-cmp",
  ".cot": "application/x-cot",
  ".crt": "application/x-x509-ca-cert",
  ".css": "text/css",
  ".dbf": "application/x-dbf",
  ".dbx": "application/x-dbx",
  ".dcx": "application/x-dcx",
  ".dgn": "application/x-dgn",
  ".dll": "application/x-msdownload",
  ".dot": "application/msword",
  ".dtd": "text/xml",
  ".dwf": "application/x-dwf",
  ".dxb": "application/x-dxb",
  ".edn": "application/vnd.adobe.edn",
  ".eml": "message/rfc822",
  ".epi": "application/x-epi",
  ".eps": "application/postscript",
  ".exe": "application/x-msdownload",
  ".fdf": "application/vnd.fdf",
  ".fo": "text/xml",
  ".g4": "application/x-g4",
  ".tif": "image/tiff",
  ".gl2": "application/x-gl2",
  ".hgl": "application/x-hgl",
  ".hpg": "application/x-hpgl",
  ".hqx": "application/mac-binhex40",
  ".hta": "application/hta",
  ".htm": "text/html",
  ".htt": "text/webviewhtml",
  ".icb": "application/x-icb",
  ".ico": "application/x-ico",
  ".ig4": "application/x-g4",
  ".iii": "application/x-iphone",
  ".ins": "application/x-internet-signup",
  ".IVF": "video/x-ivf",
  ".jfif": "image/jpeg",
  ".jpe": "application/x-jpe",
  ".jpg": "image/jpeg",
  ".js": "application/x-javascript",
  ".la1": "audio/x-liquid-file",
  ".latex": "application/x-latex",
  ".lbm": "application/x-lbm",
  ".ls": "application/x-javascript",
  ".m1v": "video/x-mpeg",
  ".m3u": "audio/mpegurl",
  ".mac": "application/x-mac",
  ".math": "text/xml",
  ".mdb": "application/x-mdb",
  ".mht": "message/rfc822",
  ".mi": "application/x-mi",
  ".midi": "audio/mid",
  ".mml": "text/xml",
  ".mns": "audio/x-musicnet-stream",
  ".movie": "video/x-sgi-movie",
  ".mp2": "audio/mp2",
  ".mp3": "audio/mp3",
  ".mpa": "video/x-mpg",
  ".mpe": "video/x-mpeg",
  ".mpg": "video/mpg",
  ".mpp": "application/vnd.ms-project",
  ".mpt": "application/vnd.ms-project",
  ".mpv2": "video/mpeg",
  ".mpx": "application/vnd.ms-project",
  ".mxp": "application/x-mmxp",
  ".nrf": "application/x-nrf",
  ".odc": "text/x-ms-odc",
  ".p10": "application/pkcs10",
  ".p7b": "application/x-pkcs7-certificates",
  ".p7m": "application/pkcs7-mime",
  ".p7s": "application/pkcs7-signature",
  ".pci": "application/x-pci",
  ".pcx": "application/x-pcx",
  ".pdf": "application/pdf",
  ".pfx": "application/x-pkcs12",
  ".pic": "application/x-pic",
  ".pl": "application/x-perl",
  ".pls": "audio/scpls",
  ".png": "image/png",
  ".pot": "application/vnd.ms-powerpoint",
  ".ppm": "application/x-ppm",
  ".ppt": "application/vnd.ms-powerpoint",
  ".pr": "application/x-pr",
  ".prn": "application/x-prn",
  ".ps": "application/x-ps",
  ".ptn": "application/x-ptn",
  ".r3t": "text/vnd.rn-realtext3d",
  ".ram": "audio/x-pn-realaudio",
  ".rat": "application/rat-file",
  ".rec": "application/vnd.rn-recording",
  ".rgb": "application/x-rgb",
  ".rjt": "application/vnd.rn-realsystem-rjt",
  ".rle": "application/x-rle",
  ".rmf": "application/vnd.adobe.rmf",
  ".rmj": "application/vnd.rn-realsystem-rmj",
  ".rmp": "application/vnd.rn-rn_music_package",
  ".rmvb": "application/vnd.rn-realmedia-vbr",
  ".rnx": "application/vnd.rn-realplayer",
  ".rpm": "audio/x-pn-realaudio-plugin",
  ".rt": "text/vnd.rn-realtext",
  ".rtf": "application/x-rtf",
  ".sam": "application/x-sam",
  ".sdp": "application/sdp",
  ".sit": "application/x-stuffit",
  ".sld": "application/x-sld",
  ".smi": "application/smil",
  ".smk": "application/x-smk",
  ".sol": "text/plain",
  ".spc": "application/x-pkcs7-certificates",
  ".spp": "text/xml",
  ".sst": "application/vnd.ms-pki.certstore",
  ".stm": "text/html",
  ".svg": "text/xml",
  ".tdf": "application/x-tdf",
  ".tga": "application/x-tga",
  ".tif": "application/x-tif",
  ".tld": "text/xml",
  ".torrent": "application/x-bittorrent",
  ".txt": "text/plain",
  ".uls": "text/iuls",
  ".vda": "application/x-vda",
  ".vml": "text/xml",
  ".vsd": "application/vnd.visio",
  ".vss": "application/vnd.visio",
  ".vst": "application/x-vst",
  ".vsx": "application/vnd.visio",
  ".vxml": "text/xml",
  ".wax": "audio/x-ms-wax",
  ".wb2": "application/x-wb2",
  ".wbmp": "image/vnd.wap.wbmp",
  ".wk3": "application/x-wk3",
  ".wkq": "application/x-wkq",
  ".wm": "video/x-ms-wm",
  ".wmd": "application/x-ms-wmd",
  ".wml": "text/vnd.wap.wml",
  ".wmx": "video/x-ms-wmx",
  ".wp6": "application/x-wp6",
  ".wpg": "application/x-wpg",
  ".wq1": "application/x-wq1",
  ".wri": "application/x-wri",
  ".ws": "application/x-ws",
  ".wsc": "text/scriptlet",
  ".wvx": "video/x-ms-wvx",
  ".xdr": "text/xml",
  ".xfdf": "application/vnd.adobe.xfdf",
  ".xls": "application/vnd.ms-excel",
  ".xlw": "application/x-xlw",
  ".xpl": "audio/scpls",
  ".xql": "text/xml",
  ".xsd": "text/xml",
  ".xslt": "text/xml",
  ".x_b": "application/x-x_b",
  ".sisx": "application/vnd.symbian.install",
  ".ipa": "application/vnd.iphone",
  ".xap": "application/x-silverlight-app",
  ".zip": "application/x-zip-compressed",
}
export default mimeMap;