|
|
|
@ -45,6 +45,10 @@ |
|
|
|
|
<image src="/static/trash.png" mode="aspectFill"></image> |
|
|
|
|
<view>删除文案</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view class="btn" @click="previewFile(item)"> |
|
|
|
|
<image src="/static/trash.png" mode="aspectFill"></image> |
|
|
|
|
<view>下载附件</view> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="btn" v-if="item.imgs && item.imgs.length > 0" @click="downloadMultipleImages(item.imgs)"> |
|
|
|
|
<image src="/static/download.png" mode="aspectFill"></image> |
|
|
|
|
<view>下载图片</view> |
|
|
|
@ -160,11 +164,13 @@ |
|
|
|
|
this.userInfo = {} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onReachBottom() { |
|
|
|
|
this.getDynamicList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 刷新页面 |
|
|
|
|
onRefreshPage() { |
|
|
|
|
this.isLogin = checkLogin() |
|
|
|
|
console.log(this.isLogin, '是否登录') |
|
|
|
|
// 获取页面数据 |
|
|
|
|
this.getUserInfo(); |
|
|
|
|
}, |
|
|
|
@ -203,7 +209,6 @@ |
|
|
|
|
pageSize: this.limit, |
|
|
|
|
}) |
|
|
|
|
.then(result => { |
|
|
|
|
console.log(result); |
|
|
|
|
const data = result.data.data; |
|
|
|
|
this.dynamicList = this.dynamicList.concat(data); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
@ -221,14 +226,11 @@ |
|
|
|
|
.finally(() => this.loading = false) |
|
|
|
|
}, |
|
|
|
|
getHeight(item, index) { |
|
|
|
|
console.log(item, index); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
const query = uni.createSelectorQuery().in(this); |
|
|
|
|
query.select(`.cont${index}`).boundingClientRect(data => { |
|
|
|
|
console.log(data); |
|
|
|
|
if (data) { |
|
|
|
|
// data.height 就是元素的高度 |
|
|
|
|
console.log('元素高度:', data.height); |
|
|
|
|
item.contH = data.height; |
|
|
|
|
} |
|
|
|
|
}).exec(); |
|
|
|
@ -237,7 +239,6 @@ |
|
|
|
|
toggleFullCont(index) { |
|
|
|
|
if (this.showFullCont.includes(index)) { |
|
|
|
|
const idx = this.showFullCont.findIndex(v => v == index); |
|
|
|
|
console.log(idx); |
|
|
|
|
this.showFullCont.splice(idx, 1); |
|
|
|
|
} else { |
|
|
|
|
this.showFullCont.push(index); |
|
|
|
@ -249,7 +250,6 @@ |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
downloadSingleImage(url) { |
|
|
|
|
console.log(url); |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
uni.downloadFile({ |
|
|
|
|
url: url, |
|
|
|
@ -282,6 +282,30 @@ |
|
|
|
|
})); |
|
|
|
|
}) |
|
|
|
|
return Promise.all(tasks) |
|
|
|
|
}, |
|
|
|
|
previewFile() { |
|
|
|
|
uni.downloadFile({ |
|
|
|
|
url: 'https://www.royaum.com.cn/static/test/test.xls', |
|
|
|
|
success: (res) => { |
|
|
|
|
if (res.statusCode === 200) { |
|
|
|
|
this.isPreview = true; |
|
|
|
|
uni.openDocument({ |
|
|
|
|
filePath: res.tempFilePath, |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'error', |
|
|
|
|
title: '下载失败!' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'error', |
|
|
|
|
title: '下载失败!' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
togggleLike(item, index) { |
|
|
|
|
Api.dynamicLike({ |
|
|
|
@ -370,7 +394,6 @@ |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
previewImages(idx, images) { |
|
|
|
|
console.log(idx, images); |
|
|
|
|
const arr = []; |
|
|
|
|
images.forEach(v => { |
|
|
|
|
arr.push(v.external_url); |
|
|
|
@ -406,7 +429,6 @@ |
|
|
|
|
squareId: item.square_id |
|
|
|
|
}) |
|
|
|
|
.then(result => { |
|
|
|
|
console.log(result); |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'success', |
|
|
|
|
title: '删除成功', |
|
|
|
@ -425,7 +447,6 @@ |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.container { |
|
|
|
|
background: #F7F8FA; |
|
|
|
|
padding-bottom: 55rpx; |
|
|
|
|
padding-top: 292rpx; |
|
|
|
|
.head { |
|
|
|
|
height: 450rpx; |
|
|
|
|