This commit is contained in:
chc
2026-07-13 15:28:32 +08:00
2 changed files with 37 additions and 5 deletions

View File

@@ -27,7 +27,7 @@
<div class="panel-head"> <div class="panel-head">
<span class="panel-title">直播预览</span> <span class="panel-title">直播预览</span>
<div class="ratio-switch"> <div class="ratio-switch">
</div> </div>
</div> </div>
<div class="player-box" :class="aspectRatio === '16:9' ? 'ratio-169' : 'ratio-43'"> <div class="player-box" :class="aspectRatio === '16:9' ? 'ratio-169' : 'ratio-43'">
@@ -644,7 +644,7 @@ export default {
}, },
buildShareUrl() { buildShareUrl() {
const base = (this.wapUrl || BASE?.WAP_URL || config.website || "").replace(/\/?$/, "/"); const base = (this.wapUrl || BASE?.WAP_URL || config.website || "").replace(/\/?$/, "/");
return `${base}pages/promotions/live/detail?id=${this.liveId}`; return `${base}pages/promotion/live/room?id=${this.liveId}`;
}, },
handleShare() { handleShare() {
const url = this.buildShareUrl(); const url = this.buildShareUrl();

View File

@@ -237,7 +237,7 @@ export default {
}, },
buildH5ShareUrl(liveId) { buildH5ShareUrl(liveId) {
const base = (this.wapUrl || BASE?.WAP_URL || config.website || "").replace(/\/?$/, "/"); const base = (this.wapUrl || BASE?.WAP_URL || config.website || "").replace(/\/?$/, "/");
return `${base}pages/promotions/live/detail?id=${liveId}`; return `${base}pages/promotion/live/room?id=${liveId}`;
}, },
handleShare(row) { handleShare(row) {
this.shareTitle = row.title || ""; this.shareTitle = row.title || "";
@@ -246,8 +246,40 @@ export default {
}, },
copyShareUrl() { copyShareUrl() {
if (!this.shareH5Url) return; if (!this.shareH5Url) return;
navigator.clipboard.writeText(this.shareH5Url); this.copyText(this.shareH5Url);
this.$Message.success("链接已复制"); },
copyText(text) {
const onSuccess = () => this.$Message.success("链接已复制");
const onFail = () => this.$Message.error("复制失败,请手动复制");
if (navigator.clipboard?.writeText) {
navigator.clipboard
.writeText(text)
.then(onSuccess)
.catch(() => {
this.copyTextFallback(text) ? onSuccess() : onFail();
});
return;
}
this.copyTextFallback(text) ? onSuccess() : onFail();
},
copyTextFallback(text) {
const textArea = document.createElement("textarea");
textArea.value = text;
textArea.style.position = "fixed";
textArea.style.left = "-9999px";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
let ok = false;
try {
ok = document.execCommand("copy");
} catch (e) {
ok = false;
}
document.body.removeChild(textArea);
return ok;
}, },
handleStart(row) { handleStart(row) {
if (row.liveStatus === "LIVING") { if (row.liveStatus === "LIVING") {