分标委的会议更多与查看详情

This commit is contained in:
fengachen
2021-10-19 20:57:06 +08:00
parent c667471245
commit 167af66c23
6 changed files with 48 additions and 18 deletions
+28 -14
View File
@@ -1,5 +1,8 @@
import UserApi from '../../assets/js/http/userApi'
import { previewFile, initFileList } from '../../assets/js/preview'
import {
previewFile,
initFileList
} from '../../assets/js/preview'
import MeetingApi from '../../assets/js/http/meetingApi'
Page({
@@ -9,43 +12,52 @@ Page({
data: {
form: {},
id: '', // 在工作组id,项目id
workingGroupId:'',//工作组id
workingGroupId: '', //工作组id
showMeeting: false, // 会议信息的显隐
projectFileList: [], // 项目资料文件
notifyFileList: [], // 通知文件
meetingList: [] // 会议文件
},
// 预览
preview(e){
preview(e) {
const fileObj = e.currentTarget.dataset.file
previewFile(fileObj.id,fileObj.name)
previewFile(fileObj.id, fileObj.name)
},
// 获取更多会议信息数据
goMoreMeeting(){
goMoreMeeting() {
wx.navigateTo({
url: `../meeting/meeting?workingGroupId=${this.data.workingGroupId}`,
})
},
// 会议详情
meetingDetail(e) {
const meetingInfo = JSON.stringify(e.currentTarget.dataset.meetinginfo)
wx.navigateTo({
url: `../meetingDetailSigned/meetingDetailSigned?meetingInfo=${meetingInfo}`,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.id = options.id
this.data.workingGroupId = options.workingGroupId
if(options.type == 'work') { // 工作组项目有会议详情
if (options.type == 'work') { // 工作组项目有会议详情
this.setData({
showMeeting: true
})
MeetingApi.meetingList({workingGroupProjectId: this.data.id}).then(res=>{
MeetingApi.meetingList({
workingGroupProjectId: this.data.id
}).then(res => {
console.log(res)
if(res.success){
if(res.result.records && res.result.records.length <= 2){
if (res.success) {
if (res.result.records && res.result.records.length <= 2) {
this.setData({
meetingList: res.result.records
})
}else if(res.result.records && res.result.records.length > 2){
} else if (res.result.records && res.result.records.length > 2) {
this.setData({
meetingList: res.result.records.slice(0,2)
meetingList: res.result.records.slice(0, 2)
})
}
}
@@ -57,12 +69,14 @@ Page({
})
})
}
UserApi.projectDetail({id: this.data.id}).then(res=>{
UserApi.projectDetail({
id: this.data.id
}).then(res => {
this.setData({
form: res.result
})
// 获取项目资料文件list
if(this.data.form) {
if (this.data.form) {
initFileList(this.data.form.files).then(res => {
this.setData({
projectFileList: res
@@ -132,4 +146,4 @@ Page({
onShareAppMessage: function () {
}
})
})