|
@@ -1,5 +1,4 @@
|
|
|
- const _Http = getApp().globalData.http,
|
|
|
|
|
- MFT = require("../../../../utils/matchingFeilType");
|
|
|
|
|
|
|
+ const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
Page({
|
|
|
data: {
|
|
data: {
|
|
|
detail: null,
|
|
detail: null,
|
|
@@ -18,49 +17,11 @@
|
|
|
detail: JSON.parse(options.data),
|
|
detail: JSON.parse(options.data),
|
|
|
isFollow: options.isFollow == 'true'
|
|
isFollow: options.isFollow == 'true'
|
|
|
});
|
|
});
|
|
|
- if (this.data.detail.attinfos.length != 0) this.handleFiles(MFT.fileList(this.data.detail.attinfos))
|
|
|
|
|
|
|
+ if (this.data.detail.attinfos.length != 0) this.selectComponent("#Yl_files").handleFiles(res.data)
|
|
|
if (this.data.detail.notes != '' && this.data.isFollow) this.setData({
|
|
if (this.data.detail.notes != '' && this.data.isFollow) this.setData({
|
|
|
isSubmit: false
|
|
isSubmit: false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- /* 删除文件 */
|
|
|
|
|
- deleteFile({
|
|
|
|
|
- detail
|
|
|
|
|
- }) {
|
|
|
|
|
- let e = detail,
|
|
|
|
|
- item = e.detail.attachmentid ? e.detail : e.currentTarget.dataset.item;
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "classname": "system.attachment.Attachment",
|
|
|
|
|
- "method": "deleteFileLink",
|
|
|
|
|
- "content": {
|
|
|
|
|
- "linksids": [item.linksid]
|
|
|
|
|
- }
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
|
|
- title: res.data,
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- });
|
|
|
|
|
- let files = this.data.files;
|
|
|
|
|
- switch (item.fileType) {
|
|
|
|
|
- case "image":
|
|
|
|
|
- files.images = files.images.filter(v => v.url != item.url);
|
|
|
|
|
- files.viewImages = files.viewImages.filter(v => v.url != item.url);
|
|
|
|
|
- break;
|
|
|
|
|
- case "video":
|
|
|
|
|
- files.videos = files.videos.filter(v => v.url != item.url);
|
|
|
|
|
- files.viewVideos = files.viewVideos.filter(v => v.url != item.url);
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- files.files = files.files.filter(v => v.attachmentid != item.attachmentid);
|
|
|
|
|
- break;
|
|
|
|
|
- };
|
|
|
|
|
- this.setData({
|
|
|
|
|
- files,
|
|
|
|
|
- "detail.attinfos": this.data.detail.attinfos.filter(v => v.url != item.url)
|
|
|
|
|
- });
|
|
|
|
|
- this.changeFile();
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
//文本域输入
|
|
//文本域输入
|
|
|
onInput(e) {
|
|
onInput(e) {
|
|
|
this.setData({
|
|
this.setData({
|
|
@@ -86,40 +47,11 @@
|
|
|
title: res.data,
|
|
title: res.data,
|
|
|
icon: "none"
|
|
icon: "none"
|
|
|
})
|
|
})
|
|
|
- this.handleFiles(MFT.fileList(res.data));
|
|
|
|
|
|
|
+ this.selectComponent("#Yl_files").handleFiles(res.data)
|
|
|
this.data.detail.attinfos.push(res.data[0])
|
|
this.data.detail.attinfos.push(res.data[0])
|
|
|
this.changeFile();
|
|
this.changeFile();
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- /* 处理附件 */
|
|
|
|
|
- handleFiles(list) {
|
|
|
|
|
- let files = this.data.files;
|
|
|
|
|
- list.forEach(v => {
|
|
|
|
|
- switch (v.fileType) {
|
|
|
|
|
- case "video":
|
|
|
|
|
- files.videos.push(v)
|
|
|
|
|
- files.viewVideos.push({
|
|
|
|
|
- url: v.url,
|
|
|
|
|
- type: "video",
|
|
|
|
|
- poster: v.subfiles[0].url
|
|
|
|
|
- })
|
|
|
|
|
- break;
|
|
|
|
|
- case "image":
|
|
|
|
|
- files.images.push(v)
|
|
|
|
|
- files.viewImages.push({
|
|
|
|
|
- url: v.url,
|
|
|
|
|
- type: "image"
|
|
|
|
|
- })
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- files.files.push(v)
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- this.setData({
|
|
|
|
|
- files
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
/* 修改源文件附件 */
|
|
/* 修改源文件附件 */
|
|
|
changeFile() {
|
|
changeFile() {
|
|
|
let pages = getCurrentPages(),
|
|
let pages = getCurrentPages(),
|