|
@@ -1,4 +1,4 @@
|
|
|
-// components/My_accessory/index.js
|
|
|
+const cf = require("../../utils/checkFile")
|
|
|
Component({
|
|
|
/**
|
|
|
* 组件的属性列表
|
|
@@ -7,6 +7,13 @@ Component({
|
|
|
butType: {
|
|
|
type: String,
|
|
|
value: "下载"
|
|
|
+ },
|
|
|
+ list: {
|
|
|
+ type: Array,
|
|
|
+ value: []
|
|
|
+ },
|
|
|
+ callBack: {
|
|
|
+ type: Function
|
|
|
}
|
|
|
},
|
|
|
options: {
|
|
@@ -24,11 +31,18 @@ Component({
|
|
|
* 组件的方法列表
|
|
|
*/
|
|
|
methods: {
|
|
|
- butClick(){
|
|
|
- console.log(this.data.butType)
|
|
|
+ butClick(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
|
|
|
},
|
|
|
- checkFile(){
|
|
|
- console.log("查看文件")
|
|
|
+ checkFile(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ if (this.data.butType == '播放') return this.triggerEvent("callBack", item);
|
|
|
+ cf.checkFile(item);
|
|
|
}
|
|
|
}
|
|
|
})
|