2.6提交

This commit is contained in:
zoujiandong 2026-02-06 17:30:16 +08:00
parent db9ca707ae
commit ae9a961a42
17 changed files with 416 additions and 181 deletions

View File

@ -9,16 +9,16 @@
} }
}, },
"pages": [ "pages": [
{ // {
"path": "pages/upload/upload2", // "path": "pages/upload/upload2",
"style": { // "style": {
"navigationBarTitleText": "", // "navigationBarTitleText": "",
"navigationStyle": "custom", // "navigationStyle": "custom",
"app": { // "app": {
"bounce": "none" // "bounce": "none"
} // }
} // }
}, // },
{ {
"path": "pages/loading/loading", "path": "pages/loading/loading",
"style": { "style": {
@ -600,6 +600,38 @@
"bounce": "none" "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", "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", // "path": "patientSetting/patientSetting",
// "style": { // "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"
// }
// }
// },
// { // {

View File

@ -107,18 +107,18 @@
// //
// //
const goToCourse = (courseType) => { const goToCourse = (courseType) => {
console.log('进入课程:', courseType);
// //
switch(courseType) { switch(courseType) {
case 'course': case 'course':
navTo({ uni.sendNativeEvent('goCourse',{
url: '/pages_course/course/course' msg: 'course'
}) })
break; break;
case 'video': case 'video':
navTo({ navTo({
url: '/pages_app/video/video' url: '/pages_app/video/video?from=education'
}) })
break; break;
case 'ppt': case 'ppt':

View File

@ -3,6 +3,7 @@
<view class="status_bar"></view> <view class="status_bar"></view>
<uni-nav-bar <uni-nav-bar
title="肝胆会议" title="肝胆会议"
:left-icon="from?'left':''"
@clickLeft="goBack" @clickLeft="goBack"
color="#8B2316" color="#8B2316"
:border="false" :border="false"
@ -66,6 +67,7 @@
<scroll-view <scroll-view
ref="scrollView" ref="scrollView"
class="scroll-content" class="scroll-content"
:class="{'active':from}"
scroll-y="true" scroll-y="true"
refresher-enabled="true" refresher-enabled="true"
:refresher-triggered="isRefreshing" :refresher-triggered="isRefreshing"
@ -245,7 +247,7 @@
</view> </view>
<!-- 底部导航栏 --> <!-- 底部导航栏 -->
<CustomTabbar></CustomTabbar> <CustomTabbar v-if="!from"></CustomTabbar>
<topTip ref="topTipRef" title="相机权限使用说明" content="“肝胆相照”想使用您的相机和访问您的媒体,用于帮助您进行后续的扫码活动"></topTip> <topTip ref="topTipRef" title="相机权限使用说明" content="“肝胆相照”想使用您的相机和访问您的媒体,用于帮助您进行后续的扫码活动"></topTip>
</view> </view>
</template> </template>
@ -288,6 +290,7 @@ const pageSize = ref(10);
const scrollTop = ref(0); const scrollTop = ref(0);
const permissionListener=ref(null); const permissionListener=ref(null);
const topTipRef=ref(null); const topTipRef=ref(null);
const from=ref('');
const goToMeetHistroy = () => { const goToMeetHistroy = () => {
navTo({ navTo({
url: "/pages_app/meetHistroy/meetHistroy", url: "/pages_app/meetHistroy/meetHistroy",
@ -297,7 +300,10 @@ const goToMeetHistroy = () => {
onUnload (() => { onUnload (() => {
permissionListener.value?.stop(); permissionListener.value?.stop();
}); });
onLoad(()=>{ onLoad((options)=>{
if(options.from){
from.value=options.from;
}
// #ifdef APP-PLUS // #ifdef APP-PLUS
permissionListener.value=uni.createRequestPermissionListener(); permissionListener.value=uni.createRequestPermissionListener();
console.log('放在onLoad执行'); console.log('放在onLoad执行');
@ -384,8 +390,14 @@ const goDetail = (item) => {
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/webview/webview?url=${encoded}&sharetitle=${item.title}&bg=1&type=live_yugao&imgPath=${imgPath}&share=1&title=会议详情`, 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(() => { onBackPress(() => {
if(!from.value){
try{ try{
uni.sendNativeEvent('goTabbarPage', { uni.sendNativeEvent('goTabbarPage', {
msg: 'home' msg: 'home'
@ -397,6 +409,7 @@ const goDetail = (item) => {
} }
plus.runtime.quit() plus.runtime.quit()
return true; return true;
}
}) })
const sendWebsocketMsg = (code) => { const sendWebsocketMsg = (code) => {
let userInfo = uni.getStorageSync("userInfo"); let userInfo = uni.getStorageSync("userInfo");
@ -1068,6 +1081,9 @@ $shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
right: 0; right: 0;
bottom:120rpx; // bottom:120rpx; //
width: 100%; width: 100%;
&.active{
bottom:10rpx;
}
} }
// //

View File

@ -130,9 +130,14 @@
import api from "@/api/api.js" import api from "@/api/api.js"
import docUrl from '@/utils/docUrl.js'; import docUrl from '@/utils/docUrl.js';
import navTo from '@/utils/navTo.js'; import navTo from '@/utils/navTo.js';
import {onBackPress} from '@dcloudio/uni-app';
import navBar from "@/components/navBar/navBar.vue" import navBar from "@/components/navBar/navBar.vue"
import formatNumber from '@/utils/formatNumber.js'; import formatNumber from '@/utils/formatNumber.js';
const type=ref(1) const type=ref(1)
onBackPress(() => {
plus.runtime.quit();
return true;
});
// //
const currentPage = ref(1); const currentPage = ref(1);
@ -289,8 +294,8 @@
// //
const goToSearch = () => { const goToSearch = () => {
uni.navigateTo({ uni.sendNativeEvent('goHomeSearch',{
url: '/pages_app/search/search' msg: 'patientClass'
}); });
}; };
@ -357,16 +362,16 @@
// //
const hasSelected = filterTags.value.some(tag => tag.selected); const hasSelected = filterTags.value.some(tag => tag.selected);
isFilterActive.value = hasSelected; isFilterActive.value = hasSelected;
let words='';
// //
if (hasSelected) { if (hasSelected) {
const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.NAME); const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.NAME);
console.log('选中的标签:', selectedTags); console.log('选中的标签:', selectedTags);
keywords.value = selectedTags.join(','); words = selectedTags.join(',');
} else { } else {
keywords.value = ''; words = '';
} }
keywords.value = words;
// //
currentPage.value = 1; currentPage.value = 1;
hasMore.value = true; hasMore.value = true;
@ -665,16 +670,15 @@ $padding-small: 20rpx;
.filter-tags { .filter-tags {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 20rpx;
margin-bottom: 60rpx; margin-bottom: 60rpx;
max-height: 65vh; max-height: 65vh;
overflow-y: auto; overflow-y: auto;
.tag-item { .tag-item {
background-color: #f8f8f8; background-color: #f8f8f8;
color: $gray-dark; color: $gray-dark;
padding: 8rpx 0rpx; padding: 8rpx 0rpx;
width:150rpx; width:152rpx;
margin:8rpx;
text-align:center; text-align:center;
border-radius: 30rpx; border-radius: 30rpx;
font-size: 26rpx; font-size: 26rpx;

View File

@ -1,47 +1,53 @@
<template> <template>
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<view class="navbox">
<view class="status_bar"></view>
<uni-nav-bar <uni-nav-bar
left-icon="left" left-icon="left"
title="消息" :title="'消息'"
right-text="清除"
@clickRight="clearMsg"
@clickLeft="goBack" @clickLeft="goBack"
fixed
color="#8B2316" color="#8B2316"
height="180rpx"
:border="false" :border="false"
backgroundColor="#eeeeee" backgroundColor="#eeeeee"
></uni-nav-bar> >
<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="msg-page">
<!-- 四宫格入口 --> <!-- 四宫格入口 -->
<view class="shortcut-grid"> <view class="shortcut-grid">
<view class="grid-item" @click="goBenefit"> <view class="grid-item" @click="goBenefit">
<view class="icon-wrap gift"> <view class="icon-wrap">
<uni-icons type="gift" size="34" color="#fff"></uni-icons> <image :src="fuliImg" class="imgcell"/>
<view class="badge" v-if="badgeData.Module_Welfare > 0">{{ badgeData.Module_Welfare }}</view> <view class="badge" v-if="badgeData.Module_Welfare > 0">{{ badgeData.Module_Welfare }}</view>
</view> </view>
<text class="label">福利</text> <text class="label">福利</text>
</view> </view>
<view class="grid-item" @click="goOrder"> <view class="grid-item" @click="goOrder">
<view class="icon-wrap order"> <view class="icon-wrap ">
<uni-icons type="list" size="34" color="#fff"></uni-icons> <image :src="orderImg" class="imgcell"/>
<view class="badge" v-if="badgeData.Module_Order > 0">{{ badgeData.Module_Order }}</view> <view class="badge" v-if="badgeData.Module_Order > 0">{{ badgeData.Module_Order }}</view>
</view> </view>
<text class="label">订单</text> <text class="label">订单</text>
</view> </view>
<view class="grid-item" @click="goFollow"> <view class="grid-item" @click="goFollow">
<view class="icon-wrap visit"> <view class="icon-wrap">
<uni-icons type="heart" size="34" color="#fff"></uni-icons> <image :src="followImg" class="imgcell"/>
<view class="badge" v-if="badgeData.Module_Relation > 0">{{ badgeData.Module_Relation }}</view> <view class="badge" v-if="badgeData.Module_Relation > 0">{{ badgeData.Module_Relation }}</view>
</view> </view>
<text class="label">随访</text> <text class="label">随访</text>
</view> </view>
<view class="grid-item" @click="goReply"> <view class="grid-item" @click="goReply">
<view class="icon-wrap reply"> <view class="icon-wrap">
<uni-icons type="chatbubble" size="34" color="#fff"></uni-icons> <image :src="replyImg" class="imgcell"/>
<view class="badge" v-if="badgeData.Module_Comment > 0">{{ badgeData.Module_Comment }}</view> <view class="badge" v-if="badgeData.Module_Comment > 0">{{ badgeData.Module_Comment }}</view>
</view> </view>
<text class="label">回复我的</text> <text class="label">回复我的</text>
@ -53,11 +59,11 @@
class="msg-list" class="msg-list"
scroll-y="true" scroll-y="true"
:show-scrollbar="false" :show-scrollbar="false"
refresher-enabled="true" :refresher-enabled="true"
:refresher-triggered="refreshing" :refresher-triggered="refreshing"
@refresherrefresh="onRefresh" @refresherrefresh="onRefresh"
@scrolltolower="onLoadMore" @scrolltolower="onLoadMore"
lower-threshold="80" :lower-threshold="100"
> >
<!-- 回复我的模块 - 聊天列表样式 --> <!-- 回复我的模块 - 聊天列表样式 -->
<view v-if="currentModule === 4" class="chat-list"> <view v-if="currentModule === 4" class="chat-list">
@ -78,23 +84,24 @@
<!-- 其他模块 - 卡片样式 --> <!-- 其他模块 - 卡片样式 -->
<view v-else> <view v-else>
<view class="card" v-for="(msg, idx) in msgList" :key="msg.id" @click="goMsgDetail(msg)"> <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-content">{{ msg.content }}</view>
<view class="card-time">{{ msg.create_date }}</view> <view class="card-time">{{ msg.create_date }}</view>
</view> </view>
</view> </view>
<!-- 空状态 --> <!-- 空状态 -->
<view v-if="msgList.length === 0" class="empty-state"> <view v-if="msgList.length === 0 && !loading && !refreshing" class="empty-state">
<text class="empty-text">暂无消息</text> <empty></empty>
</view> </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> <text class="loading-text">加载中...</text>
</view> </view>
<!-- 没有更多数据提示 --> <!-- 没有更多数据提示 -->
<view v-if="noMore" class="no-more"> <view v-if="noMore && msgList.length > 0 && !loading" class="no-more">
<text class="no-more-text">没有更多数据了</text> <text class="no-more-text"> 没有更多数据了 </text>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -105,6 +112,17 @@
import api from '@/api/api.js'; import api from '@/api/api.js';
import docUrl from '@/utils/docUrl'; import docUrl from '@/utils/docUrl';
import navTo from '@/utils/navTo'; 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({ const badgeData = ref({
@ -123,44 +141,53 @@
const loading = ref(false); const loading = ref(false);
const noMore = ref(false); const noMore = ref(false);
const page = ref(1); const page = ref(1);
const pageSize = ref(10); const pageSize = 10;
//
const resetPagination = () => {
page.value = 1;
noMore.value = false;
msgList.value = [];
};
const goBack = () => { const goBack = () => {
uni.navigateBack({ plus.runtime.quit();
fail() { };
uni.redirectTo({
url: '/pages/index/index' //
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 = () => { const clearMsg = () => {
uni.showModal({ uni.showModal({
title: '提醒', title: '提醒',
content: '是否要清除所有未读消息?', content: '是否要清除所有未读消息?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
api.appMesageRead({}).then(res => { api.appMesageRead().then(res => {
console.log(res); console.log(res);
}); });
getUnReadList(); getUnReadList();
@ -170,9 +197,26 @@
} }
const goMsgDetail = (msg) => { const goMsgDetail = (msg) => {
console.log(msg); console.log(msg);
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=""; let url="";
if(msg.extra.module==1 && msg.extra.type==36){ 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){ }else if(msg.extra.module==3 && msg.extra.type==12){
url=`/pages_app/myPatient/myPatient` url=`/pages_app/myPatient/myPatient`
} }
@ -180,36 +224,51 @@
url: url url: url
}) })
} }
// = }
//
const onRefresh = async () => { const onRefresh = async () => {
if (refreshing.value) return; if (refreshing.value) return;
refreshing.value = true; refreshing.value = true;
try { try {
// //
getAppMesageList(currentModule.value); resetPagination();
// await Promise.all([
getUnReadList(); getAppMesageList(true),
getUnReadList()
]);
} catch (err) {
console.error('刷新失败:', err);
uni.showToast({
title: '刷新失败',
icon: 'none'
});
} finally { } finally {
refreshing.value = false; refreshing.value = false;
} }
}; };
// //
const onLoadMore = async () => { const onLoadMore = async () => {
if (loading.value || noMore.value) return; if (loading.value || noMore.value || refreshing.value) return;
loading.value = true; loading.value = true;
try { try {
// page.value++;
// await getAppMesageList(false);
// getAppMesageList } catch (err) {
noMore.value = true; // // 退
page.value = Math.max(1, page.value - 1);
console.error('加载更多失败:', err);
uni.showToast({
title: '加载失败',
icon: 'none'
});
} finally { } finally {
loading.value = false; loading.value = false;
} }
}; };
const getUnReadList = () => { const getUnReadList = () => {
api.unReadList({}).then(res => { return api.unReadList({}).then(res => {
console.log(res); console.log(res);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
// //
@ -220,17 +279,24 @@
Module_Relation: parseInt(res.data.Module_Relation) || 0 Module_Relation: parseInt(res.data.Module_Relation) || 0
}; };
} }
return res;
}).catch(err => { }).catch(err => {
console.error('获取未读消息列表失败:', 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); console.log(res);
if (res.code === 200 && res.data && res.data.list) { if (res.code === 200 && res.data && res.data.list) {
// const newList = res.data.list.map(item => ({
msgList.value = res.data.list.map(item => ({
id: item.id, id: item.id,
title: item.title, title: item.title,
content: item.content, content: item.content,
@ -245,9 +311,31 @@
`${getBaseUrl()}${item.extra.user_photo}`) : `${getBaseUrl()}${item.extra.user_photo}`) :
'/static/default-avatar.png' '/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 => { }).catch(err => {
console.error('获取消息列表失败:', err); console.error('获取消息列表失败:', err);
throw err;
}); });
}; };
@ -264,7 +352,7 @@
onMounted(() => { onMounted(() => {
getUnReadList(); getUnReadList();
getAppMesageList(1); getAppMesageList(true); //
}); });
</script> </script>
@ -283,16 +371,27 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.imgcell{
width:74rpx;
height: 74rpx;
}
.nav-right{
display: flex;
align-items: center;
.collect-img{
width: 34rpx;
height: 34rpx;
}
}
.msg-page { .msg-page {
min-height: 100vh; min-height: 100vh;
background: $bg; background: $bg;
padding-top: $nav-h; //
} }
.shortcut-grid { .shortcut-grid {
position: fixed; position: fixed;
top: $nav-h; top: calc(var(--status-bar-height) + 44px);
left: 0; left: 0;
right: 0; right: 0;
z-index: 9; 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 { .card {
background: #fff; background: #fff;
border-radius: 16rpx; border-radius: 16rpx;
@ -372,6 +498,9 @@
color: $text-primary; color: $text-primary;
font-weight: 600; font-weight: 600;
margin-bottom: 14rpx; margin-bottom: 14rpx;
&.active{
color: red;
}
} }
.card-content { .card-content {

View File

@ -194,12 +194,20 @@
<script setup> <script setup>
import api from "@/api/api.js"; import api from "@/api/api.js";
import docUrl from '@/utils/docUrl.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 { reactive,ref,onMounted } from "vue";
import unidialog from '@/components/dialog/dialog.vue' import unidialog from '@/components/dialog/dialog.vue'
const from = ref('');
onBackPress(() => { onBackPress(() => {
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
return true; return true;
}
});
onLoad((options) => {
if(options.from){
from.value = options.from;
}
}); });
import navTo from "@/utils/navTo.js"; import navTo from "@/utils/navTo.js";
import nosigninImg from "@/static/sign_day_false.png" import nosigninImg from "@/static/sign_day_false.png"
@ -261,7 +269,11 @@ const refresherTriggered = ref(false);
// //
const goBack = () => { const goBack = () => {
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
}else{
uni.navigateBack();
}
}; };
const showRules = () => { const showRules = () => {

View File

@ -117,9 +117,12 @@
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import {onShow,onBackPress,onLoad,onHide} from '@dcloudio/uni-app'; import {onShow,onBackPress,onLoad,onHide} from '@dcloudio/uni-app';
import docUrl from '@/utils/docUrl.js'; import docUrl from '@/utils/docUrl.js';
const from = ref('');
onBackPress(() => { onBackPress(() => {
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
return true; return true;
}
}); });
//import jifenImg from "@/static/duihuan.png" //import jifenImg from "@/static/duihuan.png"
import api from '@/api/api'; import api from '@/api/api';
@ -190,7 +193,11 @@
// //
const goBack = () => { const goBack = () => {
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
}else{
uni.navigateBack();
}
}; };
const showRules = () => { const showRules = () => {
@ -239,6 +246,10 @@
} }
}; };
onLoad((options) => { onLoad((options) => {
if(options.from){
from.value = options.from;
}
getWelfarePage(); getWelfarePage();
}); });
onHide(() => { onHide(() => {
@ -261,7 +272,7 @@
}); });
}else if(benefit.name == 'video'){ }else if(benefit.name == 'video'){
navTo({ navTo({
url: '/pages_app/video/video' url: '/pages_app/video/video?from=myWelfare'
}); });
}else if(benefit.name == 'kejian'){ }else if(benefit.name == 'kejian'){
navTo({ navTo({

View File

@ -1,6 +1,18 @@
<template> <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"> <view class="news-page">
<!-- Fixed Banner Swiper --> <!-- Fixed Banner Swiper -->
<view class="banner-container"> <view class="banner-container">
@ -45,7 +57,7 @@
<!-- 肝胆新闻 --> <!-- 肝胆新闻 -->
<view class="news-item" @click="goToNews('news')"> <view class="news-item" @click="goToNews('news')">
<view class="news-icon blue"> <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>
<view class="news-content"> <view class="news-content">
<view class="news-title">肝胆新闻</view> <view class="news-title">肝胆新闻</view>
@ -101,7 +113,7 @@
<!-- 肝胆会议 --> <!-- 肝胆会议 -->
<view class="news-item" @click="goToCourse('hepatoBiliaryConference')"> <view class="news-item" @click="goToCourse('hepatoBiliaryConference')">
<view class="news-icon yellow"> <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>
<view class="news-content"> <view class="news-content">
<view class="news-title">肝胆会议</view> <view class="news-title">肝胆会议</view>
@ -136,6 +148,9 @@
import docUrl from "@/utils/docUrl.js"; import docUrl from "@/utils/docUrl.js";
import navTo from '../../utils/navTo'; import navTo from '../../utils/navTo';
import navBar from '@/components/navBar/navBar.vue'; 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(() => { onMounted(() => {
loadNewsBanner(); loadNewsBanner();
@ -145,6 +160,10 @@
loadNewsBanner(); loadNewsBanner();
}); });
onBackPress(() => {
plus.runtime.quit();
return true;
});
// //
const loadNewsBanner = async () => { const loadNewsBanner = async () => {
try { try {
@ -170,16 +189,6 @@
// Banner // Banner
const bannerList = ref([]); const bannerList = ref([]);
const currentBannerIndex = ref(0); const currentBannerIndex = ref(0);
//
const goBack = () => {
uni.navigateBack({
fail() {
uni.redirectTo({
url: '/pages/index/index'
});
}
});
};
// Banner // Banner
const getMockBannerData = () => { const getMockBannerData = () => {
return [ return [
@ -212,11 +221,14 @@
}; };
const playBannerVideo = (banner) => { const playBannerVideo = (banner) => {
uni.navigateTo({ const encoded = encodeURIComponent(docUrl+banner.path);
url: `/pages/videoDetail/videoDetail?id=${banner.id}` navTo({
url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${banner.title}`
}); });
}; };
const goBack = () => {
plus.runtime.quit();
};
// //
const goToNews = (type) => { const goToNews = (type) => {
if(type=="news"){ if(type=="news"){
@ -228,7 +240,7 @@
const goToCourse = (type) => { const goToCourse = (type) => {
navTo({ navTo({
url:'/pages/live/live' url:'/pages/live/live?from=news'
}) })
}; };
</script> </script>
@ -332,6 +344,10 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 30rpx; margin-right: 30rpx;
image{
width: 100%;
height: 100%;
}
&.blue { &.blue {
background-color: $blue-color; background-color: $blue-color;

View File

@ -1,16 +1,27 @@
<template> <template>
<view class="news-list-page"> <view class="news-list-page">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<!-- <navBar title="肝胆新闻" /> -->
<view class="navbox">
<view class="status_bar"></view>
<uni-nav-bar <uni-nav-bar
left-icon="left" left-icon="left"
title="肝胆新闻" :title="'肝胆新闻'"
@clickLeft="goBack" @clickLeft="goBack"
fixed
color="#8B2316" color="#8B2316"
height="180rpx"
:border="false" :border="false"
backgroundColor="#eeeeee" backgroundColor="#eeeeee"
></uni-nav-bar> >
<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"> <view class="nav-tabs">
@ -130,7 +141,10 @@
import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'; import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import api from '@/api/api.js'; import api from '@/api/api.js';
import docUrl from '@/utils/docUrl.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 dayjs from 'dayjs';
import searchImg from "@/static/search.png";
// Banner // Banner
const bannerList = ref([]); const bannerList = ref([]);
const currentBannerIndex = ref(0); const currentBannerIndex = ref(0);
@ -167,9 +181,9 @@
currentBannerIndex.value = e.detail.current; currentBannerIndex.value = e.detail.current;
}; };
const playBannerVideo = (banner) => { const playBannerVideo = (banner) => {
let url=encodeURIComponent(docUrl+banner.path) const encoded = encodeURIComponent(docUrl+banner.path);
uni.navigateTo({ navTo({
url: `/pages_app/webview/webview?url=${url}&title=${banner.title}` url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${banner.title}`
}); });
}; };
// scroll-view // scroll-view
@ -477,10 +491,19 @@
}; };
const goToNewsDetail = (item) => { const goToNewsDetail = (item) => {
// Implement navigation to news detail page
console.log('Go to news detail:', item); console.log('Go to news detail:', item);
uni.navigateTo({ // Implement navigation to news detail page
url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}` 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.img-icon {
width: 34rpx;
height: 34rpx;
}
.nav-actions {
display: flex;
align-items: center;
justify-content: center;
}
.news-list-page { .news-list-page {
background-color: #f8f8f8; background-color: #f8f8f8;
height: 100vh; height: 100vh;
@ -544,7 +577,7 @@
} }
&.active { &.active {
color: #ff4757; color: #8B2316;
font-weight: bold; font-weight: bold;
&::after { &::after {
@ -610,7 +643,7 @@
bottom:0; bottom:0;
width:100%; width:100%;
top:240rpx; top:240rpx;
height: calc(100vh - 240rpx); // banner height: calc(100vh - var(--status-bar-height) - 44px - 100rpx); // banner
background-color: #f8f8f8; background-color: #f8f8f8;
} }

View File

@ -341,6 +341,7 @@ const isFilterActive = ref(false);
const showFilter = ref(false); const showFilter = ref(false);
const yearList = ref([]); const yearList = ref([]);
const selectYearContent = reactive({}); const selectYearContent = reactive({});
const from = ref("");
onBackPress(() => { onBackPress(() => {
// try { // try {
// uni.sendNativeEvent( // uni.sendNativeEvent(
@ -355,8 +356,10 @@ onBackPress(() => {
// } catch (e) { // } catch (e) {
// console.log(e); // console.log(e);
// } // }
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
return true; return true;
}
}); });
const goSearch = () => { const goSearch = () => {
uni.sendNativeEvent( uni.sendNativeEvent(
@ -416,7 +419,10 @@ const formatName = (name) => {
} }
return name; return name;
}; };
onLoad(() => { onLoad((options) => {
if(options.from){
from.value = options.from;
}
// API // API
currentPage.value = 1; currentPage.value = 1;
hasMoreData.value = true; hasMoreData.value = true;
@ -899,7 +905,11 @@ const goBack = () => {
// }); // });
// }, // },
// }); // });
if(!from.value){
plus.runtime.quit(); plus.runtime.quit();
}else{
uni.navigateBack();
}
}; };
const toggleSort = () => { const toggleSort = () => {
sort.value = sort.value === 1 ? 2 : 1; // 1=, 2= sort.value = sort.value === 1 ? 2 : 1; // 1=, 2=

BIN
static/clear_message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/ding_message_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/fu_message_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/gandanhuiyi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
static/gandanxinwen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
static/hui_message_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/sui_message_big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB