1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- const cf = require("../../utils/checkFile")
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- butType: {
- type: String,
- value: "下载"
- },
- list: {
- type: Array,
- value: []
- },
- callBack: {
- type: Function
- },
- deleteFile: {
- type: Function
- }
- },
- options: {
- addGlobalClass: true
- },
- /**
- * 组件的初始数据
- */
- data: {
- },
- /**
- * 组件的方法列表
- */
- methods: {
- butClick(e) {
- const {
- item
- } = e.currentTarget.dataset;
- const that = this;
- if (this.data.butType == '播放') {
- this.triggerEvent("callBack", item);
- } else if (this.data.butType == '删除') {
- wx.showModal({
- title: "通知",
- content: "是否确认删除该附件?",
- success: res => {
- if (res.confirm) that.triggerEvent("deleteFile", item);
- }
- })
- }
- },
- callback(e) {
- const {
- item
- } = e.currentTarget.dataset;
- this.triggerEvent("callBack", item);
- },
- checkFile(e) {
- const {
- item
- } = e.currentTarget.dataset;
- if (item.fileType == 'video' && this.data.butType == '商学院' || this.data.butType == '播放') return this.triggerEvent("callBack", item);
- cf.checkFile(item);
- }
- }
- })
|