|
|
|
|
@ -97,7 +97,7 @@
|
|
|
|
|
<view class="scroll-content">
|
|
|
|
|
<view v-for="(item, index) in swiperArray" :key="index" class="scroll-item" :class="index == 0 ? 'g_ml_0 g_mr_0' : ''" @click="item.type == 'image' ? handleViewBig(item, index) : showVideo(item)">
|
|
|
|
|
<u-image :radius="4" v-if="item.type == 'image'" :showLoading="true" :src="item.image" width="58px" height="58px" style="border-radius: 4px"> </u-image>
|
|
|
|
|
<view class="g_w_58 g_h_58 g_radius_4 videoContainer" v-else>
|
|
|
|
|
<view class="g_w_58 g_h_58 g_radius_4 videoContainer" v-else @longpress="downloadVideo(item)">
|
|
|
|
|
<video class="theVideo" :show-fullscreen-btn="true" :show-play-btn="true" :show-center-play-btn="true" :enable-play-gesture="true" :id="item.id" :src="item.image" @fullscreenchange="fullScreen" :muted="muted" :show-mute-btn="isFullscreen" :show-progress="isFullscreen" :show-time="isFullscreen" :controls="isFullscreen" :enable-progress-gesture="isFullscreen" :object-fit="'cover'" style="width: 100%; height: 100%"></video>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -1334,6 +1334,47 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 长按下载视频
|
|
|
|
|
downloadVideo(e) {
|
|
|
|
|
var that = this;
|
|
|
|
|
console.log("长按下载视频", e);
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: "下载中...",
|
|
|
|
|
mask: true,
|
|
|
|
|
});
|
|
|
|
|
uni.downloadFile({
|
|
|
|
|
url: e.image, // 下载url
|
|
|
|
|
success: (downloadRes) => {
|
|
|
|
|
uni.saveVideoToPhotosAlbum({
|
|
|
|
|
filePath: downloadRes.tempFilePath,
|
|
|
|
|
success: () => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "视频已保存到相册",
|
|
|
|
|
icon: "success"
|
|
|
|
|
});
|
|
|
|
|
console.log("视频已保存到相册");
|
|
|
|
|
},
|
|
|
|
|
fail: () => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "保存视频到相册失败",
|
|
|
|
|
icon: "none"
|
|
|
|
|
});
|
|
|
|
|
console.error("保存视频到相册失败");
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail: () => {
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: "下载失败",
|
|
|
|
|
icon: "none"
|
|
|
|
|
});
|
|
|
|
|
console.error("下载文件失败");
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleUpdateTab(e) {
|
|
|
|
|
console.log("e", e);
|
|
|
|
|
this.G.isLogin();
|
|
|
|
|
|