10.14号更新
This commit is contained in:
+30
-60
@@ -387,15 +387,24 @@ import { setTabUnread } from "@/utils/im/msg";
|
||||
const countdown = ref(5);
|
||||
const showAd=ref(true);
|
||||
let timer = null;
|
||||
const hasAd=ref(false);
|
||||
const expertDetail = reactive({});
|
||||
const hasConsult = ref(false);
|
||||
const hasMsg = ref(false);
|
||||
const showSign = ref(false);
|
||||
|
||||
const signInfo = reactive({
|
||||
news: {
|
||||
summary: "",
|
||||
},
|
||||
});
|
||||
/**会话列表 */
|
||||
const conversationList = ref<
|
||||
(
|
||||
| (V2NIMConversationForUI & { renderKey: string })
|
||||
| (V2NIMLocalConversationForUI & { renderKey: string })
|
||||
)[]
|
||||
>([]);
|
||||
// 定义refs
|
||||
const tabbarRef = ref(null);
|
||||
const visible = ref(false);
|
||||
@@ -425,21 +434,27 @@ const handleReadMsg = () => {
|
||||
const getStartpage = () => {
|
||||
my_api.startpage().then(res => {
|
||||
console.log('开屏广告数据:', res);
|
||||
|
||||
if (res && res.data) {
|
||||
adData.value = {
|
||||
path: docUrl + res.data.path || '',
|
||||
url: res.data.url || ''
|
||||
};
|
||||
|
||||
|
||||
// 如果有广告图片,开始倒计时
|
||||
if (res.data.path) {
|
||||
|
||||
startCountdown();
|
||||
if(!hasAd.value){
|
||||
startCountdown();
|
||||
}else{
|
||||
navigateToHome();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// 没有广告,直接跳转到首页
|
||||
navigateToHome();
|
||||
}
|
||||
hasAd.value=true;
|
||||
} else {
|
||||
// 接口返回异常,直接跳转到首页
|
||||
navigateToHome();
|
||||
@@ -457,9 +472,7 @@ const getStartpage = () => {
|
||||
countdown.value--;
|
||||
if (countdown.value <= 0) {
|
||||
clearInterval(timer);
|
||||
if(app.globalData.plAd){
|
||||
navigateToHome();
|
||||
}
|
||||
navigateToHome();
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
@@ -555,13 +568,7 @@ const subscribeUserStatus = (
|
||||
}
|
||||
};
|
||||
|
||||
/**会话列表 */
|
||||
const conversationList = ref<
|
||||
(
|
||||
| (V2NIMConversationForUI & { renderKey: string })
|
||||
| (V2NIMLocalConversationForUI & { renderKey: string })
|
||||
)[]
|
||||
>([]);
|
||||
|
||||
/**是否是云端会话 */
|
||||
const enableV2CloudConversation =
|
||||
uni.$UIKitStore?.sdkOptions?.enableV2CloudConversation;
|
||||
@@ -747,34 +754,10 @@ const formatToMonthDay = (val) => {
|
||||
|
||||
// 消息通知点击事件
|
||||
const onNoticeClick = (item) => {
|
||||
|
||||
uni.showToast({
|
||||
title: `查看${item.content}`,
|
||||
icon: "none",
|
||||
console.log(item);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encodeURIComponent(item.path)}&title=${item.content}`,
|
||||
});
|
||||
|
||||
// 根据消息类型跳转到不同页面
|
||||
switch (item.type) {
|
||||
case "patient":
|
||||
uni.navigateTo({
|
||||
url: "/pages/patient/consultation",
|
||||
});
|
||||
break;
|
||||
case "meeting":
|
||||
uni.navigateTo({
|
||||
url: "/pages/meeting/live",
|
||||
});
|
||||
break;
|
||||
case "guide":
|
||||
uni.navigateTo({
|
||||
url: "/pages/guide/list",
|
||||
});
|
||||
break;
|
||||
default:
|
||||
uni.navigateTo({
|
||||
url: "/pages/notice/detail?id=" + item.id,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 查看更多消息
|
||||
@@ -816,7 +799,7 @@ const onClick = (index, name) => {
|
||||
const encoded = encodeURIComponent(
|
||||
"https://wx.igandan.com/Esite/index.htm#/home?fromtype=doctor"
|
||||
);
|
||||
url = `/pages_app/webview/webview?url=${encoded}`;
|
||||
url = `/pages_app/webview/webview?url=${encoded}&title=专题e站`;
|
||||
} else {
|
||||
url = "/pages_app/myApplication/myApplication";
|
||||
}
|
||||
@@ -862,12 +845,13 @@ const goNews = () => {
|
||||
// #ifdef MP
|
||||
const encoded = encodeURIComponent(url);
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}`,
|
||||
url: `/pages_app/webview/webview?url=${encoded}&title=${signInfo.news.title}`,
|
||||
});
|
||||
// #endif
|
||||
};
|
||||
// 点击顶部轮播图
|
||||
const onBannerClick = (item, index) => {
|
||||
console.log(item, index);
|
||||
if (!item) return;
|
||||
if (index == 0) {
|
||||
navTo({
|
||||
@@ -878,7 +862,7 @@ const onBannerClick = (item, index) => {
|
||||
if (item.path) {
|
||||
const encoded = encodeURIComponent(item.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}`,
|
||||
url: `/pages_app/webview/webview?url=${encoded}&title=${item.title}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -886,26 +870,10 @@ const onBannerClick = (item, index) => {
|
||||
|
||||
// 点击专题E站图片
|
||||
const onEsiteClick = (item) => {
|
||||
if (!item || !item.url) {
|
||||
return;
|
||||
}
|
||||
// H5 端
|
||||
// #ifdef H5
|
||||
window.open(item.url, "_blank");
|
||||
// #endif
|
||||
|
||||
// App 端
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.openURL(item.url);
|
||||
// #endif
|
||||
|
||||
// 小程序端:使用内嵌 webview 页面打开
|
||||
// #ifdef MP
|
||||
const encoded = encodeURIComponent(item.url);
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}`,
|
||||
url: `/pages_app/webview/webview?url=${encoded}&title=${item.name}`,
|
||||
});
|
||||
// #endif
|
||||
};
|
||||
const hasTip = ref(false);
|
||||
const goMessage = () => {
|
||||
@@ -1030,6 +998,7 @@ const getHomeData = async () => {
|
||||
type: item.type, // 0: H5链接, 1: 图片无跳转 等
|
||||
path: item.path || "",
|
||||
uuid: item.uuid || "",
|
||||
title: item.title || "",
|
||||
}))
|
||||
);
|
||||
} else if (Array.isArray(data.esite_list) && data.esite_list.length > 0) {
|
||||
@@ -1076,6 +1045,7 @@ const getHomeData = async () => {
|
||||
specialList.push(
|
||||
...data.esite_list.slice(0, 3).map((item) => ({
|
||||
image: item.img_path || "",
|
||||
name: item.name || "",
|
||||
url: item.url || "",
|
||||
}))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user