This commit is contained in:
pengxiaolong
2025-07-25 16:39:52 +08:00
parent 7116e57fc3
commit 8580cd18fa
128 changed files with 2991 additions and 411 deletions

View File

@@ -3,7 +3,7 @@ const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
props: {
message: {
type: String,
type: Object,
default: ""
}
},

View File

@@ -0,0 +1,80 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
data() {
return {
url: ""
};
},
onLoad(options) {
this.url = options.url;
},
methods: {
//返回上一页
goBack() {
common_vendor.wx$1.navigateBack({
delta: 1
});
},
//保存图片
saveImage() {
common_vendor.index.showLoading({
title: "正在下载图片...",
mask: true
});
common_vendor.index.downloadFile({
url: this.url,
success: (downloadRes) => {
if (downloadRes.statusCode === 200) {
common_vendor.index.saveImageToPhotosAlbum({
filePath: downloadRes.tempFilePath,
success: () => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "保存成功",
icon: "none",
duration: 2e3
});
},
fail: (saveErr) => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "保存失败: " + saveErr.errMsg,
icon: "none",
duration: 2e3
});
}
});
} else {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "下载失败",
icon: "none",
duration: 2e3
});
}
},
fail: (downloadErr) => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "下载失败: " + downloadErr.errMsg,
icon: "none",
duration: 2e3
});
}
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.url,
b: common_vendor.o((...args) => $options.saveImage && $options.saveImage(...args)),
c: common_vendor.o(() => {
}),
d: common_vendor.o((...args) => $options.goBack && $options.goBack(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-61106fa9"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/pages/index/chat/messageComponent/fullscreen/imagePreview.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "图片预览",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="image-preview data-v-61106fa9" bindtap="{{d}}"><view class="data-v-61106fa9"></view><image class="image data-v-61106fa9" src="{{a}}" mode="aspectFill"></image><view class="Localbtn data-v-61106fa9" catchtap="{{c}}"><image class="Local data-v-61106fa9" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Local.png" mode="aspectFit" bindtap="{{b}}"></image></view></view>

View File

@@ -0,0 +1,26 @@
.image-preview.data-v-61106fa9 {
width: 100vw;
height: 100vh;
background-color: black;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.image.data-v-61106fa9 {
width: 100vw;
object-fit: contain;
}
.Localbtn.data-v-61106fa9 {
width: 100vw;
height: 50rpx;
margin-bottom: 50rpx;
display: flex;
flex-direction: row-reverse;
}
.Local.data-v-61106fa9 {
width: 50rpx;
height: 50rpx;
margin-right: 50rpx;
}

View File

@@ -0,0 +1,80 @@
"use strict";
const common_vendor = require("../../../../../common/vendor.js");
const _sfc_main = {
data() {
return {
url: ""
};
},
onLoad(options) {
this.url = options.url;
},
methods: {
//返回上一页
goBack() {
common_vendor.wx$1.navigateBack({
delta: 1
});
},
//保存图片
saveImage() {
common_vendor.index.showLoading({
title: "正在下载视频...",
mask: true
});
common_vendor.index.downloadFile({
url: this.url,
success: (downloadRes) => {
if (downloadRes.statusCode === 200) {
common_vendor.index.saveVideoToPhotosAlbum({
filePath: downloadRes.tempFilePath,
success: () => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "保存成功",
icon: "none",
duration: 2e3
});
},
fail: (saveErr) => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "保存失败: " + saveErr.errMsg,
icon: "none",
duration: 2e3
});
}
});
} else {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "下载失败",
icon: "none",
duration: 2e3
});
}
},
fail: (downloadErr) => {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "下载失败: " + downloadErr.errMsg,
icon: "none",
duration: 2e3
});
}
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o(($event) => $options.goBack()),
b: $data.url,
c: common_vendor.o((...args) => $options.saveImage && $options.saveImage(...args)),
d: common_vendor.o(() => {
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3d18a684"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/pages/index/chat/messageComponent/fullscreen/videoPreview.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "视频预览",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="image-preview data-v-3d18a684"><view class="top data-v-3d18a684"><image class="Fork data-v-3d18a684" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/crossCross.png" mode="scaleToFill" bindtap="{{a}}"/></view><video class="image data-v-3d18a684" src="{{b}}" mode="aspectFill"></video><view class="Localbtn data-v-3d18a684" catchtap="{{d}}"><image class="Local data-v-3d18a684" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Local.png" mode="aspectFit" bindtap="{{c}}"></image></view></view>

View File

@@ -0,0 +1,35 @@
.image-preview.data-v-3d18a684 {
width: 100vw;
height: 100vh;
background-color: black;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.image.data-v-3d18a684 {
width: 100vw;
object-fit: contain;
}
.Localbtn.data-v-3d18a684 {
width: 100vw;
height: 50rpx;
margin-bottom: 50rpx;
display: flex;
flex-direction: row-reverse;
}
.Local.data-v-3d18a684 {
width: 50rpx;
height: 50rpx;
margin-right: 50rpx;
}
.Fork.data-v-3d18a684{
width: 60rpx;
height: 60rpx;
margin-left: 50rpx;
}
.top.data-v-3d18a684{
margin-top: 110rpx;
width: 100vw;
}

View File

@@ -0,0 +1,50 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
props: {
message: {
type: Object,
default: ""
}
},
data() {
return {
imageHeight: 0,
imageWidth: 0
};
},
onLoad() {
},
methods: {
load(event) {
if (event.detail.height > 400) {
this.imageHeight = 400;
} else {
this.imageHeight = event.detail.height;
}
if (event.detail.width > 400) {
this.imageWidth = 400;
} else {
this.imageWidth = event.detail.width;
}
},
// 点击图片全屏显示
imadeFullScreen() {
common_vendor.wx$1.navigateTo({
url: "/pages/index/chat/messageComponent/fullscreen/imagePreview?url=" + this.message.url
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.imageWidth + "rpx",
b: $data.imageHeight + "rpx",
c: common_vendor.o((...args) => $options.load && $options.load(...args)),
d: $props.message.url,
e: common_vendor.o((...args) => $options.imadeFullScreen && $options.imadeFullScreen(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d774affd"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/index/chat/messageComponent/imageMessage.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="image-message data-v-d774affd" bindtap="{{e}}"><image class="image data-v-d774affd" style="{{'width:' + a + ';' + ('height:' + b)}}" bindload="{{c}}" src="{{d}}" mode="aspectFit"></image></view>

View File

@@ -0,0 +1,8 @@
.image-message.data-v-d774affd{
width: 100%;
height: 100%;
}
.image.data-v-d774affd{
border-radius: 20rpx;
}

View File

@@ -0,0 +1,33 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
props: {
message: {
type: Object,
default: ""
}
},
data() {
return {
title: "Hello"
};
},
onLoad() {
},
methods: {
onTap() {
common_vendor.wx$1.navigateTo({
url: "/pages/index/chat/messageComponent/fullscreen/videoPreview?url=" + this.message.video.url
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $props.message.thumbnail.url,
b: common_vendor.o((...args) => $options.onTap && $options.onTap(...args))
};
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-23a12dbe"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/index/chat/messageComponent/videoMessage.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="video-message data-v-23a12dbe" bindtap="{{b}}"><image class="video-player data-v-23a12dbe" src="{{a}}" mode="scaleToFill"/><image class="Play data-v-23a12dbe" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Play.png" mode="scaleToFill"/></view>

View File

@@ -0,0 +1,18 @@
.video-message.data-v-23a12dbe {
width: 450rpx;
height: 300rpx;
border-radius: 20px;
display: flex;
}
.video-player.data-v-23a12dbe {
width: 100%;
height: 100%;
border-radius: 20px;
}
.Play.data-v-23a12dbe {
width: 200rpx;
height: 200rpx;
margin-left: -330rpx;
margin-top: 50rpx;
}

View File

@@ -0,0 +1,92 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const _sfc_main = {
props: {
message: {
type: Object,
default: () => ({})
},
senderId: {
type: String,
default: ""
},
userId: {
type: Number
},
playbackStatus: {
type: Boolean
}
},
data() {
return {
innerAudioContext: null,
NumberClicks: 0
};
},
watch: {
playbackStatus(newVal) {
if (!newVal) {
if (this.innerAudioContext) {
this.innerAudioContext.pause();
this.innerAudioContext.destroy();
this.innerAudioContext = null;
this.NumberClicks = 0;
this.$emit("notplayVoice", true);
} else {
this.$emit("notplayVoice", true);
}
} else {
this.$emit("notplayVoice", true);
}
}
},
methods: {
floor(num) {
return Math.floor(num);
},
Play() {
this.$emit("notplayVoice", false);
setTimeout(() => {
this.innerAudioContext = common_vendor.index.createInnerAudioContext();
this.innerAudioContext.src = this.message.url;
this.innerAudioContext.onEnded(() => {
this.NumberClicks = 0;
this.innerAudioContext.destroy();
this.innerAudioContext = null;
});
this.innerAudioContext.onError((res) => {
this.NumberClicks = 0;
this.innerAudioContext.destroy();
this.innerAudioContext = null;
});
this.innerAudioContext.play();
this.NumberClicks = 1;
}, 500);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $props.senderId == $props.userId
}, $props.senderId == $props.userId ? common_vendor.e({
b: common_vendor.t($options.floor($props.message.duration)),
c: $data.NumberClicks == 0
}, $data.NumberClicks == 0 ? {} : {}, {
d: $data.NumberClicks == 1
}, $data.NumberClicks == 1 ? {} : {}, {
e: $data.NumberClicks == 2
}, $data.NumberClicks == 2 ? {} : {}) : common_vendor.e({
f: $data.NumberClicks == 0
}, $data.NumberClicks == 0 ? {} : {}, {
g: $data.NumberClicks == 1
}, $data.NumberClicks == 1 ? {} : {}, {
h: $data.NumberClicks == 2
}, $data.NumberClicks == 2 ? {} : {}, {
i: common_vendor.t($options.floor($props.message.duration))
}), {
j: common_vendor.o((...args) => $options.Play && $options.Play(...args))
});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2ecc0080"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/index/chat/messageComponent/voiceMessage.js.map

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="voice-message data-v-2ecc0080" bindtap="{{j}}"><view wx:if="{{a}}" class="voice-message-content data-v-2ecc0080"><view class="data-v-2ecc0080">{{b}}"</view><image wx:if="{{c}}" class="voice-message-avatar data-v-2ecc0080" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/voice.png" mode="scaleToFill"/><view wx:if="{{d}}" class="voice-message-name data-v-2ecc0080">播放中...</view><view wx:if="{{e}}" class="voice-message-name data-v-2ecc0080">暂停中...</view></view><view wx:else class="voice-message-content data-v-2ecc0080"><image wx:if="{{f}}" class="voice-message-avatar data-v-2ecc0080" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/voice.png" mode="scaleToFill"/><view wx:if="{{g}}" class="voice-message-name data-v-2ecc0080">播放中...</view><view wx:if="{{h}}" class="voice-message-name data-v-2ecc0080">暂停中...</view><view class="data-v-2ecc0080">"{{i}}"</view></view></view>

View File

@@ -0,0 +1,20 @@
.voice-message.data-v-2ecc0080 {
padding: 0 20rpx 0 20rpx;
}
.voice-message-avatar.data-v-2ecc0080 {
width: 100rpx;
height: 80rpx;
margin-left: 10rpx;
}
.voice-message-content.data-v-2ecc0080 {
display: flex;
align-items: center;
}
.voice-message-name.data-v-2ecc0080 {
height: 80rpx;
margin-left: 10rpx;
font-size: 28rpx;
color: #999;
line-height: 80rpx;
}