3.9提交

This commit is contained in:
zoujiandong
2026-03-09 18:59:27 +08:00
parent 1fa822ed72
commit 40f5ddf4a5
28 changed files with 841 additions and 219 deletions
+367 -49
View File
@@ -15,7 +15,7 @@
>
<template #right>
<view class="nav-right">
<up-icon name="share" color="#8B2316" size="24"></up-icon>
<up-icon name="share" color="#8B2316" size="24" @click="shareToggle"></up-icon>
<up-image :src="siteImg" width="36rpx" height="36rpx" @click="goSite"></up-image>
</view>
</template>
@@ -34,7 +34,15 @@
</view>
<!-- 主内容区域 -->
<view class="content-area">
<!-- <view class="content-area"> -->
<scroll-view
class="content-scroll"
scroll-y
refresher-enabled
:refresher-triggered="isRefreshing"
@refresherrefresh="onRefresh"
@scrolltolower="onScrollToLower"
>
<!-- 停诊公告卡片 -->
<view v-if="currentTab === 'suspension'">
<view class="announcement-card" v-for="announcement in stopOutPatientList" :key="announcement.uuid">
@@ -106,11 +114,11 @@
</view>
<view class="schedule-actions">
<view class="action-btn edit-btn" @click="editSchedule(schedule)">
<text class="action-icon">✎</text>
<up-image :src="editImg" width="30rpx" height="30rpx"></up-image>
<text class="action-text">编辑</text>
</view>
<view class="action-btn delete-btn" @click="deleteSchedule(schedule.uuid)">
<text class="action-icon">🗑</text>
<up-image :src="deleteImg" width="30rpx" height="30rpx"></up-image>
<text class="action-text">删除</text>
</view>
</view>
@@ -120,8 +128,12 @@
<view v-else class="empty-state">
<empty :emptyDesc="'暂无门诊安排'"></empty>
</view>
<view v-if="outPatientList.length > 0" class="load-more-tip">
<text>{{ outPatientLoading ? '加载中...' : (hasMoreOutPatient ? '上拉加载更多' : '没有更多数据了') }}</text>
</view>
</view>
</view>
</scroll-view>
<!-- </view> -->
<!-- 底部操作按钮 -->
<view class="bottom-actions">
@@ -134,6 +146,36 @@
<view class="floating-edit-btn" @click="editAnnouncement">
<up-image :src="sendImg" width="88rpx" height="88rpx"></up-image>
</view>
<!-- 分享弹窗 -->
<uni-popup ref="shareRef" type="bottom" safeArea backgroundColor="#fff">
<view class="share-popup">
<view class="share-title">分享到</view>
<view class="share-content">
<view class="share-item" @click="shareToWechat">
<view class="share-icon wechat-icon">
<image class="share-img" :src="wxImg" mode="aspectFill" />
</view>
<text class="share-text">微信</text>
</view>
<view class="share-item" @click="shareToMoments">
<view class="share-icon moments-icon">
<image class="share-img" :src="friendImg" mode="aspectFill" />
</view>
<text class="share-text">朋友圈</text>
</view>
<view class="share-item" @click="shareToWeibo">
<view class="share-icon weibo-icon">
<image class="share-img" :src="sinaImg" mode="aspectFill" />
</view>
<text class="share-text">新浪微博</text>
</view>
</view>
<view class="share-cancel" @click="closeShare">
<text>取消</text>
</view>
</view>
</uni-popup>
</view>
</template>
@@ -142,12 +184,27 @@ import { ref, reactive } from 'vue'
import api from '@/api/api'
import {onShow,onUnload,onLoad,onBackPress} from '@dcloudio/uni-app'
import navTo from '@/utils/navTo'
import other_host from '@/utils/otherHost'
import siteImg from '@/static/zhiyedidian.png'
import empty from '@/components/empty/empty.vue'
import sendImg from '@/static/send_feed.png'
import dateBg from '@/static/data_sign.png'
import editImg from '@/static/edit_icon.png'
import deleteImg from '@/static/delete_icon.png'
import sinaImg from "@/static/share_sina.png"
import wxImg from "@/static/share_weixin.png"
import friendImg from "@/static/share_wxc.png"
import logoImg from "@/static/weiboShare.png"
const SHARE_TITLE = ref('医生门诊详情')
const SHARE_SUMMARY = '肝胆相照®肝胆病在线服务平台'
const page=ref(1);
const isRefreshing = ref(false)
const outPatientLoading = ref(false)
const hasMoreOutPatient = ref(true)
const addressList = ref([]);
const shareRef = ref()
const shareLink = ref('')
// 响应式数据
const from = ref('');
const currentTab = ref('suspension')
@@ -167,16 +224,61 @@ onLoad((options) => {
if(options.from){
from.value = options.from;
}
fetchList();
try {
const userInfo = uni.getStorageSync('userInfo') || {}
console.log(userInfo.realName)
const expertUuid = userInfo.uuid;
shareLink.value = other_host+'/wxPatient/index.htm#/outPatient?link=share&expertUuid='+expertUuid+'&from=doctor'
SHARE_TITLE.value = userInfo.realName+'医生门诊详情'
} catch (error) {
console.log(error)
}
});
const getListOutPatient = async () => {
const res = await api.listOutPatient({
page:page.value,
});
if(res.code == 200){
outPatientList.value = res.data.list.list;
console.log(res.data.note)
note.value = res.data.note.note;
const getListOutPatient = async (reset = false) => {
if (outPatientLoading.value) return;
if (!reset && !hasMoreOutPatient.value) return;
if (reset) {
page.value = 1;
hasMoreOutPatient.value = true;
}
outPatientLoading.value = true;
try {
const res = await api.listOutPatient({
page:page.value,
});
if(res.code == 200){
const pageData = res.data?.list || {};
const newList = Array.isArray(pageData.list) ? pageData.list : [];
if (reset) {
outPatientList.value = newList;
} else {
outPatientList.value = [...outPatientList.value, ...newList];
}
// 兼容不同分页字段结构
if (typeof pageData.totalPage === 'number' && typeof pageData.pageNumber === 'number') {
hasMoreOutPatient.value = pageData.pageNumber < pageData.totalPage;
} else if (typeof pageData.last_page === 'number' && typeof pageData.current_page === 'number') {
hasMoreOutPatient.value = pageData.current_page < pageData.last_page;
} else if (typeof pageData.pages === 'number' && typeof pageData.pageNum === 'number') {
hasMoreOutPatient.value = pageData.pageNum < pageData.pages;
} else if (typeof pageData.isLastPage === 'boolean') {
hasMoreOutPatient.value = !pageData.isLastPage;
} else {
hasMoreOutPatient.value = newList.length > 0;
}
if (hasMoreOutPatient.value) {
page.value += 1;
}
console.log(res.data.note)
note.value = res.data?.note?.note || '';
}
} finally {
outPatientLoading.value = false;
}
}
const stopOutPatientList = ref([]);
@@ -229,8 +331,9 @@ const getWeekdayByWeek = (week) => {
const getTimePeriod = (day) => {
const timeMap = {
'a': '上午',
'p': '下午',
'd': '晚上'
'b': '下午',
'c': '晚上',
'd': '全天'
};
return timeMap[day] || '晚上';
}
@@ -254,11 +357,129 @@ const goBack = () => {
}
}
const share = () => {
uni.showToast({
title: '分享功能',
icon: 'none'
})
const shareToggle = () => {
shareRef.value && shareRef.value.open()
}
const closeShare = () => {
shareRef.value && shareRef.value.close()
}
const shareToWechat = () => {
// #ifdef APP-PLUS
uni.downloadFile({
url: 'https://doc.igandan.com/app/html/img/2016/20160714132557.png',
success: function (res) {
uni.compressImage({
src: res.tempFilePath,
quality: 60,
success: function (res2) {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
title: SHARE_TITLE.value,
summary: SHARE_SUMMARY,
href: shareLink.value,
imageUrl: res2.tempFilePath,
});
},
});
},
});
// #endif
// #ifdef H5
if (navigator.share) {
navigator
.share({
title: SHARE_TITLE.value,
text: SHARE_SUMMARY,
url: shareLink.value,
})
.catch(() => {});
} else {
uni.setClipboardData({
data: `${SHARE_TITLE.value}:${shareLink.value}`,
success: () => {
uni.showToast({ title: "已复制到剪贴板", icon: "success" });
},
});
}
// #endif
// #ifdef MP-WEIXIN
uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
// #endif
closeShare();
}
const shareToMoments = () => {
// #ifdef APP-PLUS
uni.downloadFile({
url: 'https://doc.igandan.com/app/html/img/2016/20160714132557.png',
success: function (res) {
uni.compressImage({
src: res.tempFilePath,
quality: 60,
success: function (res2) {
uni.share({
provider: "weixin",
scene: "WXSceneTimeline",
type: 0,
title: SHARE_TITLE.value,
summary: SHARE_SUMMARY,
href: shareLink.value,
imageUrl: res2.tempFilePath,
});
},
});
},
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: `${SHARE_TITLE.value}:${shareLink.value}`,
success: () => {
uni.showToast({ title: "已复制到剪贴板,可分享到朋友圈", icon: "success" });
},
});
// #endif
// #ifdef MP-WEIXIN
uni.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
// #endif
closeShare();
}
const shareToWeibo = () => {
// #ifdef APP-PLUS
uni.share({
provider: "sinaweibo",
type: 0,
title: SHARE_TITLE.value,
summary: SHARE_SUMMARY,
href: shareLink.value,
imageUrl: logoImg,
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: `${SHARE_TITLE.value}:${shareLink.value}`,
success: () => {
uni.showToast({ title: "已复制到剪贴板,可分享到微博", icon: "success" });
},
});
// #endif
closeShare();
}
const fetchList = async () => {
const res = await api.listWorkPlace({})
@@ -276,8 +497,8 @@ const addNew = () => {
onShow(() => {
getStopOutPatientList();
getListOutPatient();
getListOutPatient(true);
fetchList();
})
@@ -286,7 +507,7 @@ const switchTab = (tab) => {
if(tab=='suspension'){
getStopOutPatientList();
}else{
getListOutPatient();
getListOutPatient(true);
}
}
@@ -344,7 +565,7 @@ const editAnnouncement = () => {
// 刷新数据
const refreshData = () => {
getListOutPatient();
getListOutPatient(true);
getStopOutPatientList();
}
@@ -355,16 +576,18 @@ const addSchedule = () => {
title: '请先点击右上角设置执业地点',
icon: 'none'
})
return
}
navTo({
}else{
navTo({
url: '/pages_chat/outManage/outManage'
})
}
}
const editSchedule = (schedule) => {
uni.navigateTo({
url: `/pages_chat/outManage/outManage?uuid=${schedule.uuid}&workplace_uuid=${schedule.workplace_uuid}&week=${schedule.week}&type=${schedule.type}`
url: `/pages_chat/outManage/outManage?uuid=${schedule.uuid}&workplace_uuid=${schedule.workplace_uuid}&week=${schedule.week}&type=${schedule.day}`
})
}
@@ -382,7 +605,7 @@ const deleteSchedule = async (uuid) => {
title: '删除成功',
icon: 'none'
});
getListOutPatient();
getListOutPatient(true);
} else {
uni.showToast({
title: deleteRes.msg || '删除失败',
@@ -399,6 +622,24 @@ const deleteSchedule = async (uuid) => {
}
})
}
const onRefresh = async () => {
isRefreshing.value = true;
try {
if (currentTab.value === 'suspension') {
await getStopOutPatientList();
} else {
await getListOutPatient(true);
}
} finally {
isRefreshing.value = false;
}
}
const onScrollToLower = () => {
if (currentTab.value !== 'outpatient') return;
getListOutPatient(false);
}
</script>
<style lang="scss" scoped>
@@ -525,7 +766,10 @@ const deleteSchedule = async (uuid) => {
/* 标签页样式 */
.tab-container {
margin-top: calc(var(--status-bar-height) + 44px);
position: fixed;
top: calc(var(--status-bar-height) + 44px);
left: 0;
right: 0;
display: flex;
align-items: center;
background-color: #fff;
@@ -556,9 +800,16 @@ const deleteSchedule = async (uuid) => {
}
/* 主内容区域 */
.content-area {
padding: 30rpx;
min-height: calc(100vh - 400rpx);
.content-scroll {
top: calc(var(--status-bar-height) + 44px + 118rpx);
position: fixed;
left: 0;
right: 0;
width: 100%;
bottom: 152rpx;
box-sizing: border-box;
}
/* 停诊公告卡片 */
@@ -566,7 +817,7 @@ const deleteSchedule = async (uuid) => {
background-color: #fff;
border-radius: 16rpx;
margin-bottom: 20rpx;
margin:0 30rpx 20rpx;
position: relative;
.date-bg{
position: absolute;
@@ -683,16 +934,22 @@ const deleteSchedule = async (uuid) => {
.schedule-list {
display: flex;
flex-direction: column;
gap: 20rpx;
margin:0rpx 30rpx 0;
}
.load-more-tip {
display: flex;
justify-content: center;
align-items: center;
color: #999;
font-size: 24rpx;
padding: 20rpx 0 30rpx;
}
.schedule-card {
background-color: #fff;
border-radius: 12rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
gap: 30rpx;
}
.cell-content {
padding: 0 30rpx;
@@ -797,7 +1054,7 @@ const deleteSchedule = async (uuid) => {
.action-btn {
display: flex;
align-items: center;
gap: 8rpx;
padding: 10rpx 20rpx;
border-radius: 8rpx;
cursor: pointer;
@@ -805,14 +1062,7 @@ const deleteSchedule = async (uuid) => {
.edit-btn {
white-space: nowrap;
background-color: #f8f9fa;
border: 1rpx solid #dee2e6;
}
.schedule-actions .delete-btn {
background-color: #fff5f5;
border: 1rpx solid #fed7d7;
}
.action-icon {
@@ -823,6 +1073,8 @@ const deleteSchedule = async (uuid) => {
white-space: nowrap;
font-size: 24rpx;
color: #666;
margin-top: 5rpx;
margin-left: 8rpx;
}
.edit-btn .action-text {
@@ -830,7 +1082,7 @@ const deleteSchedule = async (uuid) => {
}
.delete-btn .action-text {
color: #e74c3c;
color: #666;
}
/* 底部操作按钮 */
@@ -839,6 +1091,7 @@ const deleteSchedule = async (uuid) => {
bottom: 0;
left: 0;
right: 0;
z-index: 1;
padding: 30rpx;
background-color: #fff;
border-top: 1rpx solid #eee;
@@ -875,4 +1128,69 @@ const deleteSchedule = async (uuid) => {
color: #fff;
font-size: 32rpx;
}
/* 分享弹窗样式 */
.share-popup {
background-color: #fff;
border-radius: 20rpx 20rpx 0 0;
padding: 40rpx 0 0;
}
.share-title {
text-align: center;
font-size: 32rpx;
color: #333;
margin-bottom: 40rpx;
font-weight: 500;
}
.share-content {
display: flex;
justify-content: space-around;
padding: 0 40rpx 40rpx;
}
.share-item {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
.share-icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
}
.share-img {
width: 100rpx;
height:100rpx;
}
.weibo-icon {
background-color: #e6162d;
}
.share-text {
font-size: 24rpx;
color: #666;
}
.share-cancel {
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
border-top: 1rpx solid #f0f0f0;
font-size: 32rpx;
color: #333;
}
</style>