|
@@ -6,7 +6,10 @@ Component({
|
|
* 组件的属性列表
|
|
* 组件的属性列表
|
|
*/
|
|
*/
|
|
properties: {
|
|
properties: {
|
|
-
|
|
|
|
|
|
+ itemIndex: {
|
|
|
|
+ type: Number,
|
|
|
|
+ value: 0
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -21,7 +24,9 @@ Component({
|
|
fileName: '',
|
|
fileName: '',
|
|
uploadTime: '',
|
|
uploadTime: '',
|
|
expireTime: '',
|
|
expireTime: '',
|
|
- iconUrl: ''
|
|
|
|
|
|
+ iconUrl: '',
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
|
|
|
|
lifetimes: {
|
|
lifetimes: {
|
|
@@ -32,6 +37,7 @@ Component({
|
|
pageHeight: wx.getSystemInfoSync().windowHeight,
|
|
pageHeight: wx.getSystemInfoSync().windowHeight,
|
|
pageWidth: wx.getSystemInfoSync().windowWidth
|
|
pageWidth: wx.getSystemInfoSync().windowWidth
|
|
})
|
|
})
|
|
|
|
+ console.log("itemIndex:", this.properties.itemIndex)
|
|
|
|
|
|
},
|
|
},
|
|
detached: function () {
|
|
detached: function () {
|
|
@@ -108,7 +114,7 @@ Component({
|
|
lessId: that.data.itemData.lessId,
|
|
lessId: that.data.itemData.lessId,
|
|
title: rename
|
|
title: rename
|
|
}
|
|
}
|
|
- httpUtil.wxPut(puturl, params).then((res:any) => {
|
|
|
|
|
|
+ httpUtil.wxPut(puturl, params).then((res: any) => {
|
|
that.setData({
|
|
that.setData({
|
|
fileName: res.data.data.title
|
|
fileName: res.data.data.title
|
|
})
|
|
})
|
|
@@ -127,12 +133,20 @@ Component({
|
|
|
|
|
|
downloadFile: function () {
|
|
downloadFile: function () {
|
|
console.log("下载方法")
|
|
console.log("下载方法")
|
|
- if (this.data.windowType == 0) {
|
|
|
|
|
|
+ let that = this;
|
|
|
|
+ if (that.data.windowType == 0) {
|
|
//文件夹下载
|
|
//文件夹下载
|
|
- } else if (this.data.windowType == 1) {
|
|
|
|
|
|
+ } else if (that.data.windowType == 1) {
|
|
//文件下载
|
|
//文件下载
|
|
- httpUtil.wxDownLoadFile(this.data.itemData.url, function (res: any) {
|
|
|
|
- console.log("下载没??===", res.progress)
|
|
|
|
|
|
+ httpUtil.wxDownLoadFile(that.data.itemData.url, function (res: any) {
|
|
|
|
+ // console.log("下载没===", res)
|
|
|
|
+ that.triggerEvent("downLoading", { progress: res.progress })
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ // console.log("下载成功:", res)
|
|
|
|
+ that.triggerEvent("downLoadComplete", { data: res })
|
|
|
|
+ }).catch((res) => {
|
|
|
|
+ // console.log("下载失败")
|
|
|
|
+ that.triggerEvent("downLoadError", { data: res })
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|