【修改】会议文件的 下载加入接口判断条件
This commit is contained in:
@@ -75,6 +75,8 @@ const UserApi = {
|
||||
registerUser: (params) => http.post(`${URL_CONFIG}home/registerSelf`, params),
|
||||
// 手机号唯一校验
|
||||
checkPhoneOnly: (params) => http.get(`${URL_CONFIG}/sys/duplicate/check`, params),
|
||||
// 企业端的会议文件的下载
|
||||
downFileDownWeb: (fileId,meetingId, params) => http.get(`${URL_CONFIG}meeting/payMeeting/userDownload/${fileId}/${meetingId}`,params)
|
||||
}
|
||||
|
||||
export default UserApi
|
||||
|
||||
@@ -245,12 +245,27 @@ Page({
|
||||
return fileList
|
||||
}
|
||||
},
|
||||
// 是否可以下载会议文件
|
||||
downMeetingFile(param){
|
||||
return new Promise(resolve => {
|
||||
UserApi.downFileDownWeb(param.fileId,param.meetingId,{type:param.type}).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 会议文件的预览
|
||||
previewFileMeetingData(e) {
|
||||
async previewFileMeetingData(e) {
|
||||
const fileObj = e.currentTarget.dataset.file
|
||||
const param = {
|
||||
fileId:fileObj.id,
|
||||
meetingId:this.data.meetingInfo.id,
|
||||
type:'download'
|
||||
}
|
||||
let res = await this.downMeetingFile(param)
|
||||
// r如果可以下载 那么res 是一个文件流 否则就不可以下载
|
||||
let flag = typeof(res) === 'string'
|
||||
const that = this
|
||||
// 只有审核通过的才可以去下载
|
||||
// 工作组会议 会议金额为0 可以去下载文件
|
||||
let flag = this.data.meetingInfo.meetingType === 1 && this.data.meetingInfo.meetingCosts === '0.00'
|
||||
if (!flag && this.data.singInPersonInfo.checkResult !== 1) {
|
||||
wx.showToast({
|
||||
title: '会议报名并审核通过后才可查看文件',
|
||||
@@ -259,7 +274,6 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
const fileObj = e.currentTarget.dataset.file
|
||||
let fileType = sliceFileTypeByFileName(fileObj.name)
|
||||
// 文件类型不是docx,doc,pdf时,已邮件形式发送到参会人的邮箱
|
||||
if (fileType !== 'docx' && fileType !== 'doc' && fileType !== 'pdf') {
|
||||
|
||||
Reference in New Issue
Block a user