4.2提交
This commit is contained in:
@@ -76,6 +76,7 @@ const shareImg = ref("");
|
||||
const shareTitle = ref("");
|
||||
const type = ref("");
|
||||
const tags = ref("");
|
||||
const reportTitle = ref("");
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
fail() {
|
||||
@@ -99,6 +100,7 @@ onHide(() => {
|
||||
// plus.screen.lockOrientation('landscape-primary');
|
||||
});
|
||||
onLoad((query) => {
|
||||
console.log(query);
|
||||
if (query.title) {
|
||||
title.value = query.title;
|
||||
}
|
||||
@@ -130,19 +132,33 @@ onLoad((query) => {
|
||||
shareImg.value = query.imgPath?decodeURIComponent(query.imgPath):'https://doc.igandan.com/app/html/img/2016/20160714132557.png';
|
||||
if (query.type == "live_yugao") {
|
||||
shareTitle.value = query.sharetitle;
|
||||
reportTitle.value = shareTitle.value;
|
||||
summary.value = "分享一篇来自“肝胆相照”的会议预告:" + shareTitle.value;
|
||||
console.log(reportTitle.value);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: "会议直播",
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
} else if (query.type == "live_old") {
|
||||
shareTitle.value = query.sharetitle;
|
||||
summary.value = "分享一篇来自“肝胆相照”的历史会议:" + shareTitle.value;
|
||||
} else if (query.type == "live") {
|
||||
shareTitle.value = "肝胆相照直播:" + query.sharetitle;
|
||||
reportTitle.value = query.sharetitle;
|
||||
summary.value = shareTitle.value;
|
||||
|
||||
console.log(reportTitle.value);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: "会议直播",
|
||||
resource_name:shareTitle.value,
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
},
|
||||
@@ -251,6 +267,15 @@ const closeShare = () => {
|
||||
const nativeMaskView = ref(null);
|
||||
const nativePopupView = ref(null);
|
||||
const popupShowing = ref(false);
|
||||
/** 原生分享面板:防止同一次手势内重复触发(兜底) */
|
||||
let nativePanelLastActionAt = 0;
|
||||
const NATIVE_PANEL_ACTION_GAP_MS = 400;
|
||||
function tryCommitNativePanelAction(fn) {
|
||||
const t = Date.now();
|
||||
if (t - nativePanelLastActionAt < NATIVE_PANEL_ACTION_GAP_MS) return;
|
||||
nativePanelLastActionAt = t;
|
||||
fn();
|
||||
}
|
||||
// 保存弹窗尺寸信息,供事件处理使用
|
||||
const popupInfo = ref({
|
||||
screenW: 0,
|
||||
@@ -597,7 +622,7 @@ function createNativePopup() {
|
||||
);
|
||||
if (relativeY >= cancelTop) {
|
||||
console.log("点击了取消按钮");
|
||||
closeNativePopup();
|
||||
tryCommitNativePanelAction(() => closeNativePopup());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -631,12 +656,16 @@ function createNativePopup() {
|
||||
|
||||
if (idx === 0) {
|
||||
console.log("执行微信分享");
|
||||
shareToWechat();
|
||||
closeNativePopup();
|
||||
tryCommitNativePanelAction(() => {
|
||||
shareToWechat();
|
||||
closeNativePopup();
|
||||
});
|
||||
} else if (idx === 1) {
|
||||
console.log("执行朋友圈分享");
|
||||
shareToMoments();
|
||||
closeNativePopup();
|
||||
tryCommitNativePanelAction(() => {
|
||||
shareToMoments();
|
||||
closeNativePopup();
|
||||
});
|
||||
} else if (idx === 2) {
|
||||
console.log("执行微博分享");
|
||||
// shareToWeibo();
|
||||
@@ -654,19 +683,17 @@ function createNativePopup() {
|
||||
}
|
||||
};
|
||||
|
||||
// 同时监听 click 和 touchstart 事件
|
||||
// 仅监听 click:若同时绑定 touchstart/touchend,一次点击会触发多次,导致分享重复执行
|
||||
nativeMaskView.value.addEventListener("click", handleMaskClick, false);
|
||||
nativeMaskView.value.addEventListener("touchstart", handleMaskClick, false);
|
||||
|
||||
nativePopupView.value.addEventListener("click", handlePanelClick, false);
|
||||
nativePopupView.value.addEventListener("touchstart", handlePanelClick, false);
|
||||
nativePopupView.value.addEventListener("touchend", handlePanelClick, false);
|
||||
// #endif
|
||||
}
|
||||
|
||||
function showNativePopup() {
|
||||
// #ifdef APP-PLUS
|
||||
if (popupShowing.value) return;
|
||||
nativePanelLastActionAt = 0;
|
||||
if (!nativeMaskView.value || !nativePopupView.value) {
|
||||
createNativePopup();
|
||||
}
|
||||
@@ -688,12 +715,12 @@ function closeNativePopup() {
|
||||
// 分享到微信
|
||||
const shareToWechat = () => {
|
||||
// #ifdef APP-PLUS
|
||||
if(type.value == "live"){
|
||||
if(type.value == "live" || type.value == "live_yugao"){
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "会议直播",
|
||||
resource_name:shareTitle.value,
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
});
|
||||
@@ -800,12 +827,12 @@ onUnload(() => {
|
||||
// 分享到朋友圈
|
||||
const shareToMoments = () => {
|
||||
// #ifdef APP-PLUS
|
||||
if(type.value == "live"){
|
||||
if(type.value == "live" || type.value == "live_yugao"){
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "会议直播",
|
||||
resource_name:shareTitle.value,
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -512,11 +512,7 @@ onLoad((query) => {
|
||||
|
||||
backgroundColor.value = "linear-gradient(to bottom,'#fff' , '#398775')";
|
||||
}
|
||||
if (type.value == "huanjiao_news") {
|
||||
getNewsDetail(true);
|
||||
} else {
|
||||
getKePuCollection(true);
|
||||
}
|
||||
|
||||
getOutRead();
|
||||
|
||||
const raw =
|
||||
@@ -556,6 +552,12 @@ onLoad((query) => {
|
||||
shareTitle.value = query.sharetitle;
|
||||
summary.value = query.summary;
|
||||
}
|
||||
|
||||
if (type.value == "huanjiao_news") {
|
||||
getNewsDetail(true);
|
||||
} else {
|
||||
getKePuCollection(true);
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
// let wv = plus.webview.create("", "custom-webview", {
|
||||
// top: statusBarHeight + navHeight + "px",
|
||||
|
||||
Reference in New Issue
Block a user