2.6提交
86
pages.json
@ -9,16 +9,16 @@
|
||||
}
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/upload/upload2",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/upload/upload2",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "",
|
||||
// "navigationStyle": "custom",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/loading/loading",
|
||||
"style": {
|
||||
@ -600,6 +600,38 @@
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "news/news",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "msg/msg",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "myPatient/myPatient",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarRightButton":{ "hide": true},
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "newsList/newsList",
|
||||
@ -741,17 +773,7 @@
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "myPatient/myPatient",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarRightButton":{ "hide": true},
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
// {
|
||||
// "path": "patientSetting/patientSetting",
|
||||
// "style": {
|
||||
@ -854,16 +876,7 @@
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "news/news",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
|
||||
|
||||
// {
|
||||
@ -887,16 +900,7 @@
|
||||
// },
|
||||
|
||||
|
||||
// {
|
||||
// "path": "msg/msg",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
|
||||
|
||||
// {
|
||||
|
||||
@ -107,18 +107,18 @@
|
||||
// 方法
|
||||
// 方法
|
||||
const goToCourse = (courseType) => {
|
||||
console.log('进入课程:', courseType);
|
||||
|
||||
|
||||
// 根据课程类型进行不同的处理
|
||||
switch(courseType) {
|
||||
case 'course':
|
||||
navTo({
|
||||
url: '/pages_course/course/course'
|
||||
uni.sendNativeEvent('goCourse',{
|
||||
msg: 'course'
|
||||
})
|
||||
break;
|
||||
case 'video':
|
||||
navTo({
|
||||
url: '/pages_app/video/video'
|
||||
url: '/pages_app/video/video?from=education'
|
||||
})
|
||||
break;
|
||||
case 'ppt':
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
title="肝胆会议"
|
||||
:left-icon="from?'left':''"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
@ -66,6 +67,7 @@
|
||||
<scroll-view
|
||||
ref="scrollView"
|
||||
class="scroll-content"
|
||||
:class="{'active':from}"
|
||||
scroll-y="true"
|
||||
refresher-enabled="true"
|
||||
:refresher-triggered="isRefreshing"
|
||||
@ -245,7 +247,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
<CustomTabbar></CustomTabbar>
|
||||
<CustomTabbar v-if="!from"></CustomTabbar>
|
||||
<topTip ref="topTipRef" title="相机权限使用说明" content="“肝胆相照”想使用您的相机和访问您的媒体,用于帮助您进行后续的扫码活动"></topTip>
|
||||
</view>
|
||||
</template>
|
||||
@ -288,6 +290,7 @@ const pageSize = ref(10);
|
||||
const scrollTop = ref(0);
|
||||
const permissionListener=ref(null);
|
||||
const topTipRef=ref(null);
|
||||
const from=ref('');
|
||||
const goToMeetHistroy = () => {
|
||||
navTo({
|
||||
url: "/pages_app/meetHistroy/meetHistroy",
|
||||
@ -297,7 +300,10 @@ const goToMeetHistroy = () => {
|
||||
onUnload (() => {
|
||||
permissionListener.value?.stop();
|
||||
});
|
||||
onLoad(()=>{
|
||||
onLoad((options)=>{
|
||||
if(options.from){
|
||||
from.value=options.from;
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
permissionListener.value=uni.createRequestPermissionListener();
|
||||
console.log('放在onLoad执行');
|
||||
@ -384,9 +390,15 @@ const goDetail = (item) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&sharetitle=${item.title}&bg=1&type=live_yugao&imgPath=${imgPath}&share=1&title=会议详情`,
|
||||
});
|
||||
};
|
||||
const goBack = () => {
|
||||
if(from.value){
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
onBackPress(() => {
|
||||
try{
|
||||
if(!from.value){
|
||||
try{
|
||||
uni.sendNativeEvent('goTabbarPage', {
|
||||
msg: 'home'
|
||||
},ret => {
|
||||
@ -397,6 +409,7 @@ const goDetail = (item) => {
|
||||
}
|
||||
plus.runtime.quit()
|
||||
return true;
|
||||
}
|
||||
})
|
||||
const sendWebsocketMsg = (code) => {
|
||||
let userInfo = uni.getStorageSync("userInfo");
|
||||
@ -1068,6 +1081,9 @@ $shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
right: 0;
|
||||
bottom:120rpx; // 底部导航栏高度
|
||||
width: 100%;
|
||||
&.active{
|
||||
bottom:10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 筛选标签栏
|
||||
|
||||
@ -130,9 +130,14 @@
|
||||
import api from "@/api/api.js"
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import {onBackPress} from '@dcloudio/uni-app';
|
||||
import navBar from "@/components/navBar/navBar.vue"
|
||||
import formatNumber from '@/utils/formatNumber.js';
|
||||
const type=ref(1)
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
|
||||
// 分页相关状态
|
||||
const currentPage = ref(1);
|
||||
@ -289,8 +294,8 @@
|
||||
|
||||
// 跳转到搜索页面
|
||||
const goToSearch = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/search/search'
|
||||
uni.sendNativeEvent('goHomeSearch',{
|
||||
msg: 'patientClass'
|
||||
});
|
||||
};
|
||||
|
||||
@ -357,16 +362,16 @@
|
||||
// 检查是否有选中的标签
|
||||
const hasSelected = filterTags.value.some(tag => tag.selected);
|
||||
isFilterActive.value = hasSelected;
|
||||
|
||||
let words='';
|
||||
// 执行筛选逻辑
|
||||
if (hasSelected) {
|
||||
const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.NAME);
|
||||
console.log('选中的标签:', selectedTags);
|
||||
keywords.value = selectedTags.join(',');
|
||||
words = selectedTags.join(',');
|
||||
} else {
|
||||
keywords.value = '';
|
||||
words = '';
|
||||
}
|
||||
|
||||
keywords.value = words;
|
||||
// 重置分页状态
|
||||
currentPage.value = 1;
|
||||
hasMore.value = true;
|
||||
@ -665,16 +670,15 @@ $padding-small: 20rpx;
|
||||
.filter-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 60rpx;
|
||||
max-height: 65vh;
|
||||
overflow-y: auto;
|
||||
|
||||
.tag-item {
|
||||
background-color: #f8f8f8;
|
||||
color: $gray-dark;
|
||||
padding: 8rpx 0rpx;
|
||||
width:150rpx;
|
||||
width:152rpx;
|
||||
margin:8rpx;
|
||||
text-align:center;
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
|
||||
@ -1,47 +1,53 @@
|
||||
<template>
|
||||
|
||||
<!-- 顶部导航栏 -->
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="消息"
|
||||
right-text="清除"
|
||||
@clickRight="clearMsg"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
></uni-nav-bar>
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
:title="'消息'"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
>
|
||||
<template v-slot:right>
|
||||
<view class="nav-right" >
|
||||
<view class="collect-img" @click="clearMsg" >
|
||||
<image class="img-icon" :src="clearImg" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
<view class="msg-page">
|
||||
|
||||
|
||||
<!-- 四宫格入口 -->
|
||||
<view class="shortcut-grid">
|
||||
<view class="grid-item" @click="goBenefit">
|
||||
<view class="icon-wrap gift">
|
||||
<uni-icons type="gift" size="34" color="#fff"></uni-icons>
|
||||
<view class="icon-wrap">
|
||||
<image :src="fuliImg" class="imgcell"/>
|
||||
<view class="badge" v-if="badgeData.Module_Welfare > 0">{{ badgeData.Module_Welfare }}</view>
|
||||
</view>
|
||||
<text class="label">福利</text>
|
||||
</view>
|
||||
<view class="grid-item" @click="goOrder">
|
||||
<view class="icon-wrap order">
|
||||
<uni-icons type="list" size="34" color="#fff"></uni-icons>
|
||||
<view class="icon-wrap ">
|
||||
<image :src="orderImg" class="imgcell"/>
|
||||
<view class="badge" v-if="badgeData.Module_Order > 0">{{ badgeData.Module_Order }}</view>
|
||||
</view>
|
||||
<text class="label">订单</text>
|
||||
</view>
|
||||
<view class="grid-item" @click="goFollow">
|
||||
<view class="icon-wrap visit">
|
||||
<uni-icons type="heart" size="34" color="#fff"></uni-icons>
|
||||
<view class="icon-wrap">
|
||||
<image :src="followImg" class="imgcell"/>
|
||||
<view class="badge" v-if="badgeData.Module_Relation > 0">{{ badgeData.Module_Relation }}</view>
|
||||
</view>
|
||||
<text class="label">随访</text>
|
||||
</view>
|
||||
<view class="grid-item" @click="goReply">
|
||||
<view class="icon-wrap reply">
|
||||
<uni-icons type="chatbubble" size="34" color="#fff"></uni-icons>
|
||||
<view class="icon-wrap">
|
||||
<image :src="replyImg" class="imgcell"/>
|
||||
<view class="badge" v-if="badgeData.Module_Comment > 0">{{ badgeData.Module_Comment }}</view>
|
||||
</view>
|
||||
<text class="label">回复我的</text>
|
||||
@ -53,11 +59,11 @@
|
||||
class="msg-list"
|
||||
scroll-y="true"
|
||||
:show-scrollbar="false"
|
||||
refresher-enabled="true"
|
||||
:refresher-enabled="true"
|
||||
:refresher-triggered="refreshing"
|
||||
@refresherrefresh="onRefresh"
|
||||
@scrolltolower="onLoadMore"
|
||||
lower-threshold="80"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<!-- 回复我的模块 - 聊天列表样式 -->
|
||||
<view v-if="currentModule === 4" class="chat-list">
|
||||
@ -78,23 +84,24 @@
|
||||
<!-- 其他模块 - 卡片样式 -->
|
||||
<view v-else>
|
||||
<view class="card" v-for="(msg, idx) in msgList" :key="msg.id" @click="goMsgDetail(msg)">
|
||||
<view class="card-title">{{ msg.title }}</view>
|
||||
<view class="card-title" :class="{'active':msg.is_read==0}">{{ msg.title }}</view>
|
||||
<view class="card-content">{{ msg.content }}</view>
|
||||
<view class="card-time">{{ msg.create_date }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="msgList.length === 0" class="empty-state">
|
||||
<text class="empty-text">暂无消息</text>
|
||||
<view v-if="msgList.length === 0 && !loading && !refreshing" class="empty-state">
|
||||
<empty></empty>
|
||||
</view>
|
||||
<!-- 加载更多提示 -->
|
||||
<view v-if="loading" class="loading-more">
|
||||
<view v-if="loading && msgList.length > 0" class="loading-more">
|
||||
<view class="loading-spinner"></view>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
<!-- 没有更多数据提示 -->
|
||||
<view v-if="noMore" class="no-more">
|
||||
<text class="no-more-text">没有更多数据了</text>
|
||||
<view v-if="noMore && msgList.length > 0 && !loading" class="no-more">
|
||||
<text class="no-more-text">— 没有更多数据了 —</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -105,6 +112,17 @@
|
||||
import api from '@/api/api.js';
|
||||
import docUrl from '@/utils/docUrl';
|
||||
import navTo from '@/utils/navTo';
|
||||
import clearImg from '@/static/clear_message.png';
|
||||
import empty from '@/components/empty/empty.vue';
|
||||
import fuliImg from '@/static/fu_message_big.png';
|
||||
import orderImg from '@/static/ding_message_big.png';
|
||||
import followImg from '@/static/sui_message_big.png';
|
||||
import replyImg from '@/static/hui_message_big.png';
|
||||
import {onBackPress} from '@dcloudio/uni-app';
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
|
||||
// 角标数据
|
||||
const badgeData = ref({
|
||||
@ -123,44 +141,53 @@
|
||||
const loading = ref(false);
|
||||
const noMore = ref(false);
|
||||
const page = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const pageSize = 10;
|
||||
|
||||
// 重置分页状态
|
||||
const resetPagination = () => {
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
msgList.value = [];
|
||||
};
|
||||
|
||||
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
fail() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
plus.runtime.quit();
|
||||
};
|
||||
|
||||
// 切换模块
|
||||
const switchModule = (module) => {
|
||||
if (currentModule.value === module && msgList.value.length > 0) return; // 避免重复加载
|
||||
currentModule.value = module;
|
||||
resetPagination();
|
||||
getAppMesageList(true);
|
||||
};
|
||||
|
||||
const goBenefit = () => switchModule(1);
|
||||
const goOrder = () => switchModule(2);
|
||||
const goFollow = () => switchModule(3);
|
||||
const goReply = () => switchModule(4);
|
||||
const readMsg = (id) => {
|
||||
api.appMesageRead({
|
||||
id: id
|
||||
}).then(res => {
|
||||
if(res.code==200){
|
||||
msgList.value.forEach(item => {
|
||||
if(item.id==id){
|
||||
item.is_read=1;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const goBenefit = () => {
|
||||
currentModule.value = 1;
|
||||
getAppMesageList(1);
|
||||
};
|
||||
const goOrder = () => {
|
||||
currentModule.value = 2;
|
||||
getAppMesageList(2);
|
||||
};
|
||||
const goFollow = () => {
|
||||
currentModule.value = 3;
|
||||
getAppMesageList(3);
|
||||
};
|
||||
const goReply = () => {
|
||||
currentModule.value = 4;
|
||||
getAppMesageList(4);
|
||||
};
|
||||
|
||||
}
|
||||
const clearMsg = () => {
|
||||
uni.showModal({
|
||||
title: '提醒',
|
||||
content: '是否要清除所有未读消息?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
api.appMesageRead({}).then(res => {
|
||||
api.appMesageRead().then(res => {
|
||||
console.log(res);
|
||||
});
|
||||
getUnReadList();
|
||||
@ -170,46 +197,78 @@
|
||||
}
|
||||
const goMsgDetail = (msg) => {
|
||||
console.log(msg);
|
||||
let url="";
|
||||
if(msg.is_read==0){
|
||||
readMsg(msg.id);
|
||||
};
|
||||
//readMsg(msg.id);
|
||||
if(msg.extra.module==4){
|
||||
uni.sendNativeEvent('goCourseDetail', {
|
||||
msg: {
|
||||
id:msg.extra.id
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
let url="";
|
||||
if(msg.extra.module==1 && msg.extra.type==36){
|
||||
url=`/pages_app/myPoint/myPoint`
|
||||
url=`/pages_app/myPoint/myPoint?from=msg`
|
||||
}else if(msg.extra.module==1 && msg.extra.type==31){
|
||||
url=`/pages_app/myPoint/myPoint?from=msg`
|
||||
}else if(msg.extra.module==1 && msg.extra.type==35){
|
||||
uni.setStorageSync('lookWelfare', 'useWelfare');
|
||||
url=`/pages_app/myWelfare/myWelfare?from=msg`
|
||||
}else if(msg.extra.module==3 && msg.extra.type==12){
|
||||
url=`/pages_app/myPatient/myPatient`
|
||||
}
|
||||
navTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
// 下拉刷新=
|
||||
// 下拉刷新
|
||||
const onRefresh = async () => {
|
||||
if (refreshing.value) return;
|
||||
refreshing.value = true;
|
||||
try {
|
||||
// 重新获取当前模块的消息列表
|
||||
getAppMesageList(currentModule.value);
|
||||
// 重新获取未读消息数量
|
||||
getUnReadList();
|
||||
// 重置分页并重新获取数据
|
||||
resetPagination();
|
||||
await Promise.all([
|
||||
getAppMesageList(true),
|
||||
getUnReadList()
|
||||
]);
|
||||
} catch (err) {
|
||||
console.error('刷新失败:', err);
|
||||
uni.showToast({
|
||||
title: '刷新失败',
|
||||
icon: 'none'
|
||||
});
|
||||
} finally {
|
||||
refreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 上拉加载
|
||||
// 上拉加载更多
|
||||
const onLoadMore = async () => {
|
||||
if (loading.value || noMore.value) return;
|
||||
if (loading.value || noMore.value || refreshing.value) return;
|
||||
loading.value = true;
|
||||
try {
|
||||
// 这里可以根据需要实现分页加载
|
||||
// 目前接口返回的数据已经包含了分页信息
|
||||
// 如果需要加载更多,可以调用 getAppMesageList 并传入页码参数
|
||||
noMore.value = true; // 暂时设置为没有更多数据
|
||||
page.value++;
|
||||
await getAppMesageList(false);
|
||||
} catch (err) {
|
||||
// 加载失败时回退页码
|
||||
page.value = Math.max(1, page.value - 1);
|
||||
console.error('加载更多失败:', err);
|
||||
uni.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const getUnReadList = () => {
|
||||
api.unReadList({}).then(res => {
|
||||
return api.unReadList({}).then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 200 && res.data) {
|
||||
// 更新角标数据
|
||||
@ -220,17 +279,24 @@
|
||||
Module_Relation: parseInt(res.data.Module_Relation) || 0
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}).catch(err => {
|
||||
console.error('获取未读消息列表失败:', err);
|
||||
throw err;
|
||||
});
|
||||
};
|
||||
|
||||
const getAppMesageList = (module) => {
|
||||
api.appMesageList({module: module}).then(res => {
|
||||
// 获取消息列表
|
||||
// isRefresh: true 表示刷新,false 表示加载更多
|
||||
const getAppMesageList = (isRefresh = false) => {
|
||||
return api.appMesageList({
|
||||
module: currentModule.value,
|
||||
page: page.value,
|
||||
pageSize: pageSize
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res.code === 200 && res.data && res.data.list) {
|
||||
// 更新消息列表数据
|
||||
msgList.value = res.data.list.map(item => ({
|
||||
const newList = res.data.list.map(item => ({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
content: item.content,
|
||||
@ -245,9 +311,31 @@
|
||||
`${getBaseUrl()}${item.extra.user_photo}`) :
|
||||
'/static/default-avatar.png'
|
||||
}));
|
||||
|
||||
// 刷新时替换数据,加载更多时追加数据
|
||||
if (isRefresh || page.value === 1) {
|
||||
msgList.value = newList;
|
||||
} else {
|
||||
msgList.value = [...msgList.value, ...newList];
|
||||
}
|
||||
|
||||
// 判断是否还有更多数据
|
||||
if (res.isLastPage || newList.length < pageSize) {
|
||||
noMore.value = true;
|
||||
} else {
|
||||
noMore.value = false;
|
||||
}
|
||||
} else if (res.code === 200 && (!res.data || !res.data.list || res.data.list.length === 0)) {
|
||||
// 没有数据的情况
|
||||
if (isRefresh || page.value === 1) {
|
||||
msgList.value = [];
|
||||
}
|
||||
noMore.value = true;
|
||||
}
|
||||
return res;
|
||||
}).catch(err => {
|
||||
console.error('获取消息列表失败:', err);
|
||||
throw err;
|
||||
});
|
||||
};
|
||||
|
||||
@ -264,7 +352,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
getUnReadList();
|
||||
getAppMesageList(1);
|
||||
getAppMesageList(true); // 初始加载视为刷新
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -283,16 +371,27 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.imgcell{
|
||||
width:74rpx;
|
||||
height: 74rpx;
|
||||
}
|
||||
.nav-right{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.collect-img{
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
}
|
||||
.msg-page {
|
||||
min-height: 100vh;
|
||||
background: $bg;
|
||||
padding-top: $nav-h; // 与导航栏高度一致
|
||||
|
||||
}
|
||||
|
||||
.shortcut-grid {
|
||||
position: fixed;
|
||||
top: $nav-h;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 9;
|
||||
@ -360,6 +459,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 空状态样式
|
||||
.empty-state {
|
||||
flex-direction: column;
|
||||
padding: 100rpx 0;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
// 加载动画
|
||||
.loading-more {
|
||||
gap: 16rpx;
|
||||
|
||||
.loading-spinner {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
border: 3rpx solid #eee;
|
||||
border-top-color: $theme;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
@ -372,6 +498,9 @@
|
||||
color: $text-primary;
|
||||
font-weight: 600;
|
||||
margin-bottom: 14rpx;
|
||||
&.active{
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
|
||||
@ -194,12 +194,20 @@
|
||||
<script setup>
|
||||
import api from "@/api/api.js";
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import {onBackPress} from '@dcloudio/uni-app';
|
||||
import {onBackPress,onLoad} from '@dcloudio/uni-app';
|
||||
import { reactive,ref,onMounted } from "vue";
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
const from = ref('');
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
});
|
||||
import navTo from "@/utils/navTo.js";
|
||||
import nosigninImg from "@/static/sign_day_false.png"
|
||||
@ -261,7 +269,11 @@ const refresherTriggered = ref(false);
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
|
||||
const showRules = () => {
|
||||
|
||||
@ -117,9 +117,12 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import {onShow,onBackPress,onLoad,onHide} from '@dcloudio/uni-app';
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
const from = ref('');
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
//import jifenImg from "@/static/duihuan.png"
|
||||
import api from '@/api/api';
|
||||
@ -190,7 +193,11 @@
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
|
||||
const showRules = () => {
|
||||
@ -239,6 +246,10 @@
|
||||
}
|
||||
};
|
||||
onLoad((options) => {
|
||||
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
getWelfarePage();
|
||||
});
|
||||
onHide(() => {
|
||||
@ -261,7 +272,7 @@
|
||||
});
|
||||
}else if(benefit.name == 'video'){
|
||||
navTo({
|
||||
url: '/pages_app/video/video'
|
||||
url: '/pages_app/video/video?from=myWelfare'
|
||||
});
|
||||
}else if(benefit.name == 'kejian'){
|
||||
navTo({
|
||||
|
||||
@ -1,6 +1,18 @@
|
||||
<template>
|
||||
|
||||
<navBar title="肝胆新闻" />
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="肝胆新闻"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
>
|
||||
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
<view class="news-page">
|
||||
<!-- Fixed Banner Swiper -->
|
||||
<view class="banner-container">
|
||||
@ -45,7 +57,7 @@
|
||||
<!-- 肝胆新闻 -->
|
||||
<view class="news-item" @click="goToNews('news')">
|
||||
<view class="news-icon blue">
|
||||
<uni-icons type="paperplane" size="24" color="#fff"></uni-icons>
|
||||
<image :src="newImg" width="94rpx" height="94rpx" ></image>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<view class="news-title">肝胆新闻</view>
|
||||
@ -101,7 +113,7 @@
|
||||
<!-- 肝胆会议 -->
|
||||
<view class="news-item" @click="goToCourse('hepatoBiliaryConference')">
|
||||
<view class="news-icon yellow">
|
||||
<uni-icons type="staff" size="24" color="#fff"></uni-icons>
|
||||
<image :src="meetingImg" width="94rpx" height="94rpx" ></image>
|
||||
</view>
|
||||
<view class="news-content">
|
||||
<view class="news-title">肝胆会议</view>
|
||||
@ -136,6 +148,9 @@
|
||||
import docUrl from "@/utils/docUrl.js";
|
||||
import navTo from '../../utils/navTo';
|
||||
import navBar from '@/components/navBar/navBar.vue';
|
||||
import newImg from '@/static/gandanxinwen.png';
|
||||
import meetingImg from '@/static/gandanhuiyi.png';
|
||||
import {onBackPress} from '@dcloudio/uni-app';
|
||||
|
||||
onMounted(() => {
|
||||
loadNewsBanner();
|
||||
@ -145,6 +160,10 @@
|
||||
loadNewsBanner();
|
||||
});
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
// 加载新闻轮播数据
|
||||
const loadNewsBanner = async () => {
|
||||
try {
|
||||
@ -170,16 +189,6 @@
|
||||
// Banner相关数据
|
||||
const bannerList = ref([]);
|
||||
const currentBannerIndex = ref(0);
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
fail() {
|
||||
uni.redirectTo({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// Banner相关方法
|
||||
const getMockBannerData = () => {
|
||||
return [
|
||||
@ -212,11 +221,14 @@
|
||||
};
|
||||
|
||||
const playBannerVideo = (banner) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/videoDetail/videoDetail?id=${banner.id}`
|
||||
});
|
||||
const encoded = encodeURIComponent(docUrl+banner.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${banner.title}`
|
||||
});
|
||||
};
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
|
||||
// 新闻相关方法
|
||||
const goToNews = (type) => {
|
||||
if(type=="news"){
|
||||
@ -228,7 +240,7 @@
|
||||
|
||||
const goToCourse = (type) => {
|
||||
navTo({
|
||||
url:'/pages/live/live'
|
||||
url:'/pages/live/live?from=news'
|
||||
})
|
||||
};
|
||||
</script>
|
||||
@ -332,6 +344,10 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 30rpx;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&.blue {
|
||||
background-color: $blue-color;
|
||||
|
||||
@ -1,16 +1,27 @@
|
||||
<template>
|
||||
<view class="news-list-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="肝胆新闻"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
></uni-nav-bar>
|
||||
<!-- <navBar title="肝胆新闻" /> -->
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
:title="'肝胆新闻'"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
>
|
||||
<template v-slot:right>
|
||||
<view class="nav-right" >
|
||||
<view class="collect-img" @click="goSearch" >
|
||||
<image class="img-icon" :src="searchImg" mode="aspectFill" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 导航标签 -->
|
||||
<view class="nav-tabs">
|
||||
@ -130,7 +141,10 @@
|
||||
import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
import api from '@/api/api.js';
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from "@/utils/navTo.js";
|
||||
import navBar from '@/components/navBar/navBar.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import searchImg from "@/static/search.png";
|
||||
// Banner相关数据
|
||||
const bannerList = ref([]);
|
||||
const currentBannerIndex = ref(0);
|
||||
@ -167,10 +181,10 @@
|
||||
currentBannerIndex.value = e.detail.current;
|
||||
};
|
||||
const playBannerVideo = (banner) => {
|
||||
let url=encodeURIComponent(docUrl+banner.path)
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${url}&title=${banner.title}`
|
||||
});
|
||||
const encoded = encodeURIComponent(docUrl+banner.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${banner.title}`
|
||||
});
|
||||
};
|
||||
// scroll-view 下拉刷新
|
||||
const onRefresh = async () => {
|
||||
@ -477,10 +491,19 @@
|
||||
};
|
||||
|
||||
const goToNewsDetail = (item) => {
|
||||
// Implement navigation to news detail page
|
||||
console.log('Go to news detail:', item);
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// Implement navigation to news detail page
|
||||
const encoded = encodeURIComponent(docUrl+item.path);
|
||||
navTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${item.title}`
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// });
|
||||
};
|
||||
const goSearch = () => {
|
||||
uni.sendNativeEvent('goHomeSearch',{
|
||||
msg: 'news'
|
||||
});
|
||||
};
|
||||
|
||||
@ -499,6 +522,16 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img-icon {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
.nav-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
.news-list-page {
|
||||
background-color: #f8f8f8;
|
||||
height: 100vh;
|
||||
@ -544,7 +577,7 @@
|
||||
}
|
||||
|
||||
&.active {
|
||||
color: #ff4757;
|
||||
color: #8B2316;
|
||||
font-weight: bold;
|
||||
|
||||
&::after {
|
||||
@ -610,7 +643,7 @@
|
||||
bottom:0;
|
||||
width:100%;
|
||||
top:240rpx;
|
||||
height: calc(100vh - 240rpx); // 减去导航栏、标签栏和banner的高度
|
||||
height: calc(100vh - var(--status-bar-height) - 44px - 100rpx); // 减去导航栏、标签栏和banner的高度
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
|
||||
@ -341,6 +341,7 @@ const isFilterActive = ref(false);
|
||||
const showFilter = ref(false);
|
||||
const yearList = ref([]);
|
||||
const selectYearContent = reactive({});
|
||||
const from = ref("");
|
||||
onBackPress(() => {
|
||||
// try {
|
||||
// uni.sendNativeEvent(
|
||||
@ -355,8 +356,10 @@ onBackPress(() => {
|
||||
// } catch (e) {
|
||||
// console.log(e);
|
||||
// }
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
const goSearch = () => {
|
||||
uni.sendNativeEvent(
|
||||
@ -416,7 +419,10 @@ const formatName = (name) => {
|
||||
}
|
||||
return name;
|
||||
};
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
// 调用真实API获取数据
|
||||
currentPage.value = 1;
|
||||
hasMoreData.value = true;
|
||||
@ -899,7 +905,11 @@ const goBack = () => {
|
||||
// });
|
||||
// },
|
||||
// });
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
const toggleSort = () => {
|
||||
sort.value = sort.value === 1 ? 2 : 1; // 1=最新, 2=最热(与后端约定)
|
||||
|
||||
BIN
static/clear_message.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/ding_message_big.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
static/fu_message_big.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/gandanhuiyi.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
static/gandanxinwen.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
static/hui_message_big.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/sui_message_big.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |