|
|
@@ -60,11 +60,15 @@
|
|
|
</view>
|
|
|
<view class="active-date-comment">{{item.addtime}}</view>
|
|
|
</view>
|
|
|
- <view class="active-content-files margin-top-1">
|
|
|
-
|
|
|
+ <view class="active-content-files files-class-box">
|
|
|
+ <view class="show-file-box" v-for="(file,index) in item.file_list" :key="file.id" @click="()=>openFileFn(file.url)">
|
|
|
+ <image src="../../../static/file.png" mode="aspectFill" style="width: 90rpx;height: 70rpx;"></image>
|
|
|
+ <view class="margin-top-3" style="font-size: 24rpx;">{{file.name}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <view class="files-desc-box">{{item.content}}</view>
|
|
|
<view class="edit-icon-box-comment">
|
|
|
- <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id,'comment')"></image>
|
|
|
+ <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id,'files')"></image>
|
|
|
<image class="margin-right-0" src="/static/del-icon.png" mode="aspectFit" v-if="item.del_auth" @click="delProcess(item.id,'files')"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -156,6 +160,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
pageShowShare(obj,tabs){
|
|
|
+ console.log(obj,tabs)
|
|
|
switch (tabs){
|
|
|
case 'record':
|
|
|
this.readActive(this.recordId)
|
|
|
@@ -185,27 +190,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//打开文件
|
|
|
- openFile(files){
|
|
|
- console.log(files)
|
|
|
+ openFileFn(files){
|
|
|
+ uni.showLoading({
|
|
|
+ mask:true,
|
|
|
+ title:'加载中...',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
uni.downloadFile({
|
|
|
- url: files,
|
|
|
+ url: getApp().globalData.shareUrl + files,
|
|
|
success: function(res) {
|
|
|
var filePath = res.tempFilePath;
|
|
|
//打开文件有效值 doc, xls, ppt, pdf, docx, xlsx, pptx
|
|
|
uni.openDocument({
|
|
|
filePath:filePath,
|
|
|
success: function(res) {
|
|
|
- console.log(res)
|
|
|
//that.downloadFile_onoff = true;
|
|
|
+ uni.hideLoading();
|
|
|
},
|
|
|
fail(res) {
|
|
|
- console.log(res)
|
|
|
uni.showToast({
|
|
|
title: '暂不支持此类型',
|
|
|
icon:'none',
|
|
|
duration: 2000
|
|
|
});
|
|
|
- //uni.hideLoading();
|
|
|
+ uni.hideLoading();
|
|
|
//that.downloadFile_onoff = true;
|
|
|
}
|
|
|
});
|
|
|
@@ -299,6 +307,41 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ delFilesRequeset(delId){
|
|
|
+ let md5Sign = md5(
|
|
|
+ "method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
|
|
|
+ "&secret=" + getApp().globalData.secret
|
|
|
+ );
|
|
|
+ let url = getApp().globalData.shareUrl +"api/api.php" +
|
|
|
+ "?method=activity&action=files_del×tamp=" +
|
|
|
+ getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
|
|
|
+ uni.request({
|
|
|
+ url: url,
|
|
|
+ method: "POST",
|
|
|
+ header: {
|
|
|
+ "content-type": "application/x-www-form-urlencoded",
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ openid: getApp().globalData.open_id,
|
|
|
+ id:delId
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "删除成功",
|
|
|
+ icon: "none",
|
|
|
+ duration: 2500,
|
|
|
+ success:()=>{
|
|
|
+ this.getFileList(this.activeId)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log("连接失败");
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
delProcess(id,type){
|
|
|
let that = this;
|
|
|
let typeTitle;
|
|
|
@@ -309,7 +352,7 @@ export default {
|
|
|
case 'comment':
|
|
|
typeTitle = '确定删除此评论吗'
|
|
|
break;
|
|
|
- case 'comment':
|
|
|
+ case 'files':
|
|
|
typeTitle = '确定删除此文件吗'
|
|
|
break;
|
|
|
}
|
|
|
@@ -323,6 +366,9 @@ export default {
|
|
|
else if (type === 'comment') {
|
|
|
that.delCommentRequeset(id);
|
|
|
}
|
|
|
+ else if (type === 'files') {
|
|
|
+ that.delFilesRequeset(id);
|
|
|
+ }
|
|
|
} else if (res.cancel) {
|
|
|
console.log("用户点击取消");
|
|
|
}
|
|
|
@@ -791,4 +837,18 @@ export default {
|
|
|
margin-right: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
+ .files-class-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ margin-top: 10px;
|
|
|
+ width: 80%;
|
|
|
+ }
|
|
|
+ .files-desc-box {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ .show-file-box {
|
|
|
+ width: 30%;
|
|
|
+ margin-right: 20rpx;
|
|
|
+ }
|
|
|
</style>
|