|
@@ -12,12 +12,9 @@ Component({
|
|
|
type: Array,
|
|
|
value: []
|
|
|
},
|
|
|
- callBack: {
|
|
|
- type: Function
|
|
|
- },
|
|
|
- deleteFile: {
|
|
|
- type: Function
|
|
|
- }
|
|
|
+ callBack: Function,
|
|
|
+ deleteFile: Function,
|
|
|
+ downLoadRecord: Function
|
|
|
},
|
|
|
options: {
|
|
|
addGlobalClass: true
|
|
@@ -36,12 +33,13 @@ Component({
|
|
|
methods: {
|
|
|
butClick(e) {
|
|
|
const {
|
|
|
- item
|
|
|
+ item,
|
|
|
+ type
|
|
|
} = e.currentTarget.dataset;
|
|
|
const that = this;
|
|
|
- if (this.data.butType == '播放') {
|
|
|
+ if (type == '播放') {
|
|
|
this.triggerEvent("callBack", item);
|
|
|
- } else if (this.data.butType == '删除') {
|
|
|
+ } else if (type == '删除') {
|
|
|
wx.showModal({
|
|
|
title: "通知",
|
|
|
content: "是否确认删除该附件?",
|
|
@@ -49,7 +47,7 @@ Component({
|
|
|
if (res.confirm) that.triggerEvent("deleteFile", item);
|
|
|
}
|
|
|
})
|
|
|
- } else if (this.data.butType == '下载') {
|
|
|
+ } else if (type == '下载') {
|
|
|
wx.downloadFile({
|
|
|
url: item.url,
|
|
|
success(res) {
|
|
@@ -75,8 +73,8 @@ Component({
|
|
|
icon: "none"
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
+ this.triggerEvent("downLoadRecord");
|
|
|
};
|
|
|
},
|
|
|
callback(e) {
|