Compare commits
34
Commits
1e99b3a082
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bafde6e744 | ||
|
|
c7dbbfda16 | ||
|
|
fd78b504a6 | ||
|
|
a26fc1a4a7 | ||
|
|
ab812a2bc6 | ||
|
|
5d31c3658b | ||
|
|
3140db227c | ||
|
|
5f9a346960 | ||
|
|
7180e176eb | ||
|
|
e3a852cb43 | ||
|
|
0a51901807 | ||
|
|
8a879df4b4 | ||
|
|
18c7f7386d | ||
|
|
b5cc11ddd3 | ||
|
|
4a22470f38 | ||
|
|
6cdd8b90db | ||
|
|
cbc427e41c | ||
|
|
45a9478790 | ||
|
|
c6ce198c31 | ||
|
|
f4fe516224 | ||
|
|
80772749b2 | ||
|
|
0fa310e422 | ||
|
|
761a8fdaa4 | ||
|
|
ca69dfbe4b | ||
|
|
4042df6762 | ||
|
|
4e3a30b863 | ||
|
|
2831de027c | ||
|
|
08e3ba22c5 | ||
|
|
40f5ddf4a5 | ||
|
|
1fa822ed72 | ||
|
|
89848ba321 | ||
|
|
7fb1200528 | ||
|
|
b833a00d65 | ||
|
|
e8e9c84cdf |
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
import version from '@/utils/version.js'
|
||||
export default {
|
||||
globalData: {
|
||||
plAd: true,
|
||||
@@ -20,6 +21,13 @@ export default {
|
||||
options.referrerInfo.extraData.token
|
||||
);
|
||||
uni.setStorageSync("userInfo", options.referrerInfo.extraData.userInfo);
|
||||
if(process.env.UNI_PLATFORM =="mp-weixin"){
|
||||
uni.setStorageSync("app_version",version);
|
||||
}else{
|
||||
let app_version=options.referrerInfo.extraData.app_version?options.referrerInfo.extraData.app_version:version;
|
||||
uni.setStorageSync("app_version",app_version);
|
||||
};
|
||||
|
||||
//getApp({allowDefault: true}).globalData.apiHost = options.referrerInfo.extraData.apiHost;
|
||||
}
|
||||
if (
|
||||
|
||||
+17
-1
@@ -336,6 +336,9 @@ const api = {
|
||||
applyList(data){
|
||||
return request('/expertAPI/applyList', data, 'post', false);
|
||||
},
|
||||
patientListByGBKPage(data){
|
||||
return request('/expertAPI/patientListByGBKPage', data, 'post', false);
|
||||
},
|
||||
patientListByGBK(data){
|
||||
return request('/expertAPI/patientListByGBK', data, 'post', false);
|
||||
},
|
||||
@@ -711,9 +714,22 @@ const api = {
|
||||
getCollect(data){
|
||||
return request('/expertAPI/collection', data, 'post', false);
|
||||
},
|
||||
getDiscollect(data){
|
||||
return request('/expertAPI/discollection', data, 'post', false);
|
||||
},
|
||||
getGanDanFileOrder(data){
|
||||
return request('/expertPay/getGanDanFileOrder', data, 'post', false);
|
||||
}
|
||||
},
|
||||
publishOutPatient(data){
|
||||
return request('/expertAPI/addGroupSendMsg4YunXin', data, 'post', false);
|
||||
},
|
||||
polularScienceArticleListIndexNew(data){
|
||||
return request('/expertAPI/polularScienceArticleListIndexNew', data, 'post', false);
|
||||
},
|
||||
getNewsDetail(data){
|
||||
return request('/expertAPI/newsDetial', data, 'post', false);
|
||||
},
|
||||
|
||||
//https://dev-app.igandan.com/app/expertPay/getGanDanFileOrder
|
||||
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
|
||||
@click="oncancel"
|
||||
>
|
||||
<text class="btn-text">取消</text>
|
||||
<text class="btn-text">{{ cancelText }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="dialog-btn confirm"
|
||||
@click="onconfirm"
|
||||
>
|
||||
<text class="btn-text">确定</text>
|
||||
<text class="btn-text">{{ confirmText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="emptybox">
|
||||
<view class="empty-image-wrap" :style="imageWrapStyle">
|
||||
<up-image
|
||||
:src="props.emptyImg || emptyImg"
|
||||
:src="emptyImage || emptyImg"
|
||||
:width="renderWidth"
|
||||
:height="renderHeight"
|
||||
:mode="imgMode"
|
||||
@@ -16,7 +16,7 @@
|
||||
import { computed } from 'vue';
|
||||
import emptyImg from "@/static/icon_empty.png"
|
||||
const props = defineProps({
|
||||
emptyImg: {
|
||||
emptyImage: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
"name" : "肝胆相照专家版",
|
||||
"appid" : "__UNI__89F511F",
|
||||
"description" : "",
|
||||
"versionName" : "4.2.4",
|
||||
"versionCode" : 424,
|
||||
"versionName" : "4.2.7",
|
||||
"versionCode" : 427,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
/* 5+App特有相关 */
|
||||
|
||||
+97
-43
@@ -514,6 +514,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "search/search",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarRightButton":{ "hide": true},
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "myAnswer/myAnswer",
|
||||
"style": {
|
||||
@@ -741,6 +752,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patientMsg/patientList",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patientMsg/patientPlan",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patientMsg/patientListPerf",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "patientGroup/patientGroup",
|
||||
"style": {
|
||||
@@ -771,6 +812,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "caseRecord/caseRecord",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "searchPatient/searchPatient",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visitPlan/visitPlan",
|
||||
"style": {
|
||||
@@ -901,6 +962,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "myAccount/billDetail",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "详情",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "myAccount/withdrawal",
|
||||
"style": {
|
||||
@@ -924,6 +995,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "selectPatientSingle/selectPatientSingle",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarRightButton":{ "hide": true},
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "visitNote/visitNote",
|
||||
"style": {
|
||||
@@ -990,17 +1072,7 @@
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "selectPatientSingle/selectPatientSingle",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarRightButton":{ "hide": true},
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
// {
|
||||
// "path": "patientInfo/patientInfo",
|
||||
// "style": {
|
||||
@@ -1054,17 +1126,7 @@
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "search/search",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarRightButton":{ "hide": true},
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
// {
|
||||
// "path": "video/video",
|
||||
// "style": {
|
||||
@@ -1104,26 +1166,8 @@
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "caseRecord/caseRecord",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "searchPatient/searchPatient",
|
||||
// "style": {
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTitleText": "uni-app分页",
|
||||
// "app": {
|
||||
// "bounce": "none"
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
|
||||
|
||||
// {
|
||||
// "path": "qikan/qikan",
|
||||
// "style": {
|
||||
@@ -1556,6 +1600,16 @@
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "video/searchVideo",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "uni-app分页",
|
||||
"app": {
|
||||
"bounce": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1686,7 +1740,7 @@
|
||||
"list": [
|
||||
{
|
||||
"name": "",
|
||||
"path": "/pages_app/idcardAuth/bankCardList",
|
||||
"path": "pages/patientClass/patientClass",
|
||||
"query": ""
|
||||
}
|
||||
]
|
||||
|
||||
+20
-8
@@ -305,6 +305,15 @@ onUnload (() => {
|
||||
from.value=options.from;
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
// uni.sendNativeEvent("portraitReport",{
|
||||
// msg:{
|
||||
// event_nickname: "list_page",
|
||||
// page_type: "会议直播",
|
||||
// },
|
||||
// },
|
||||
// (ret) => {
|
||||
// console.log(ret);
|
||||
// });
|
||||
permissionListener.value=uni.createRequestPermissionListener();
|
||||
console.log('放在onLoad执行');
|
||||
console.log(permissionListener.value);
|
||||
@@ -379,6 +388,7 @@ const generateMonthList = () => {
|
||||
console.log("生成的月份列表:", monthList.value);
|
||||
};
|
||||
const goDetail = (item) => {
|
||||
console.log(item);
|
||||
// uni.sendNativeEvent('noticeBack', {
|
||||
// msg: 'go'
|
||||
// }, ret => {
|
||||
@@ -388,7 +398,7 @@ const goDetail = (item) => {
|
||||
const encoded = encodeURIComponent(item.path);
|
||||
let imgPath=encodeURIComponent('https://doc.igandan.com/app/html/img/2016/20160714132557.png');
|
||||
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=会议详情&tags=${item.tags}`,
|
||||
});
|
||||
};
|
||||
const goBack = () => {
|
||||
@@ -631,6 +641,7 @@ const meetingListBySearch = async (isRefresh = false) => {
|
||||
poster: item.liveimg, // 使用 liveimg 作为海报
|
||||
time: timeStr,
|
||||
location: item.location || "线上",
|
||||
tags: item.tags || '',
|
||||
status: getStatusText(item.status),
|
||||
// 保留原始数据用于其他功能
|
||||
originalData: item,
|
||||
@@ -744,6 +755,7 @@ const getMeetingList = async (isRefresh = false) => {
|
||||
liveurl: item.liveurl,
|
||||
spareurl: item.spareurl,
|
||||
path: item.path,
|
||||
tags: item.tags || '',
|
||||
status_code: item.status,
|
||||
};
|
||||
});
|
||||
@@ -937,12 +949,12 @@ const selectProvince = (province) => {
|
||||
|
||||
// 播放视频
|
||||
const playVideo = (item) => {
|
||||
uni.sendNativeEvent('noticeBack', {
|
||||
msg: 'go'
|
||||
}, ret => {
|
||||
console.log('ret数据');
|
||||
console.log(ret);
|
||||
})
|
||||
// uni.sendNativeEvent('noticeBack', {
|
||||
// msg: 'go'
|
||||
// }, ret => {
|
||||
// console.log('ret数据');
|
||||
// console.log(ret);
|
||||
// })
|
||||
if(item.status_code==1 || item.status_code==2 || item.status_code==4){
|
||||
let zhiboUrl=OTHER_HOST+'/hcp/setInfo';
|
||||
let userInfo=uni.getStorageSync('userInfo');
|
||||
@@ -953,7 +965,7 @@ const playVideo = (item) => {
|
||||
const encoded = encodeURIComponent(tempUrl);
|
||||
let imgPath=encodeURIComponent(docUrl+item.liveimg);
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webview?url=${encoded}&sharetitle=${item.title}&bg=1&type=live&imgPath=${imgPath}&share=1&title=会议直播`,
|
||||
url: `/pages_app/webview/webview?url=${encoded}&sharetitle=${item.title}&bg=1&type=live&imgPath=${imgPath}&share=1&title=会议直播&tags=${item.tags}`,
|
||||
});
|
||||
}else{
|
||||
goDetail(item);
|
||||
|
||||
@@ -15,7 +15,7 @@ const countDown=()=>{
|
||||
}
|
||||
timer.value=setInterval(()=>{
|
||||
count.value++;
|
||||
if(count.value>=5){
|
||||
if(count.value>=8){
|
||||
clearInterval(timer.value);
|
||||
plus.runtime.quit();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import {onShow,onLoad,onBackPress } from "@dcloudio/uni-app";
|
||||
import CustomTabbar from '@/components/tabBar/tabBar.vue';
|
||||
import upImg from "@/static/cb_up.png"
|
||||
import downImg from "@/static/cb_up.png"
|
||||
@@ -131,7 +131,6 @@
|
||||
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)
|
||||
@@ -139,7 +138,17 @@
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "患教文库",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
})
|
||||
// 分页相关状态
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(10);
|
||||
@@ -288,7 +297,7 @@
|
||||
// 跳转到详情页
|
||||
if (article.path) {
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/webview/webviewClass?url=${encodeURIComponent(docUrl+article.path+'?fromtype=doctor')}&title=患教详情&uuid=${article.uuid}&sharetitle=${article.title}&summary=${article.summary}&type=huanjiao&imgPath=${encodeURIComponent(article.image)}`
|
||||
url: `/pages_app/webview/webviewClass?url=${encodeURIComponent(docUrl+article.path+'?fromtype=doctor')}&title=患教详情&uuid=${article.uuid}&sharetitle=${article.title}&summary=${article.summary}&type=huanjiao&imgPath=${encodeURIComponent(article.image)}&tags=${article.tags}`
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -383,7 +392,8 @@
|
||||
};
|
||||
|
||||
onShow(() => {
|
||||
polularScienceArticleListByKeywordsNew(false);
|
||||
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
loadGuideTags();
|
||||
});
|
||||
</script>
|
||||
@@ -513,13 +523,14 @@ $padding-small: 20rpx;
|
||||
border-radius: $border-radius;
|
||||
padding: $padding;
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
|
||||
|
||||
.article-image {
|
||||
width: 260rpx;
|
||||
height: 160rpx;
|
||||
border-radius: $border-radius-small;
|
||||
flex-shrink: 0;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.article-content {
|
||||
|
||||
@@ -104,6 +104,7 @@ import unidialog from '@/components/dialog/dialog.vue';
|
||||
const freeVisible = ref(false)
|
||||
const freeContent = ref('')
|
||||
const goods_order_id = ref('')
|
||||
const goodsName = ref('');
|
||||
import navTo from '@/utils/navTo';
|
||||
const freeClose = () => {
|
||||
freeVisible.value = false
|
||||
@@ -210,7 +211,8 @@ onLoad((opts) => {
|
||||
console.log(22);
|
||||
console.log(opts);
|
||||
goodsUuid.value = opts.goodsUuid
|
||||
goodsNum.value = opts.goodsNum
|
||||
goodsNum.value = opts.goodsNum;
|
||||
goodsName.value = opts.goodsName;
|
||||
getAddress()
|
||||
})
|
||||
|
||||
@@ -240,6 +242,20 @@ const submit = () => {
|
||||
if (!/^1\d{10}$/.test(mobile.value)) return uni.showToast({ title: '请输入正确手机号', icon: 'none' })
|
||||
if (!regionText.value) return uni.showToast({ title: '请选择地址', icon: 'none' })
|
||||
if (!detail.value) return uni.showToast({ title: '请输入详细地址', icon: 'none' })
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "boint_jifengood",
|
||||
page_type: "积分商城",
|
||||
resource_name:goodsName.value,
|
||||
event_val:0,
|
||||
event_unit:'积分',
|
||||
number:goodsNum.value,
|
||||
belong:'U盘',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
saveAddress();
|
||||
api.createGoodsOrder({
|
||||
goodsUuid: goodsUuid.value,
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
// TODO: 调用兑换接口
|
||||
navTo({
|
||||
url:'/pages_app/buyUpan/address?goodsUuid='+goodsUuid.value+'&goodsNum='+quantity.value
|
||||
url:'/pages_app/buyUpan/address?goodsUuid='+goodsUuid.value+'&goodsNum='+quantity.value+'&goodsName='+goodsInfo.value.name
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@@ -33,10 +33,11 @@
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<!-- 空状态 -->
|
||||
<view class="empty-state" v-if="recordList.length === 0 && !loading">
|
||||
<empty v-if="recordList.length === 0 && !loading" :emptyDesc="'您暂未添加病情记录'"></empty>
|
||||
<!-- <view class="empty-state" v-if="recordList.length === 0 && !loading">
|
||||
<text class="empty-text">暂无病情记录</text>
|
||||
<button class="add-first-btn" @click="addRecord">添加第一条记录</button>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 时间线容器 -->
|
||||
<view class="timeline-container" v-else>
|
||||
@@ -108,6 +109,7 @@ import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
import api from '@/api/api.js'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import empty from '@/components/empty/empty.vue'
|
||||
|
||||
const patientUuid = ref('')
|
||||
const getRecordList = (isRefresh = false) => {
|
||||
@@ -200,7 +202,7 @@ const goBack = () => {
|
||||
const addRecord = () => {
|
||||
// 跳转到添加记录页面
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/addRecord/addRecord?patientUuid=' + patientUuid.value
|
||||
url: '/pages_app/caseRecord/caseRecord?patientUuid=' + patientUuid.value
|
||||
})
|
||||
}
|
||||
|
||||
@@ -396,7 +398,7 @@ onMounted(() => {
|
||||
height: 200rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
}
|
||||
|
||||
.content-image {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 头部导航 -->
|
||||
<uni-nav-bar
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="病情记录"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
@@ -16,10 +16,11 @@
|
||||
<text class="modify-btn" @click="saveRecord" v-if="recordUuid"
|
||||
>修改</text
|
||||
>
|
||||
<text class="save-btn" @click="saveRecord" v-else>保存</text>
|
||||
<text class="save-btn" @click="saveRecord" v-else>提交</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<view class="main-content">
|
||||
@@ -40,6 +41,7 @@
|
||||
class="description-input"
|
||||
v-model="des"
|
||||
placeholder="请输入患者病情"
|
||||
:adjust-position="false"
|
||||
></textarea>
|
||||
</view>
|
||||
</view>
|
||||
@@ -337,7 +339,16 @@ const saveRecord = () => {
|
||||
|
||||
/* 主要内容区域 */
|
||||
.main-content {
|
||||
padding: 0rpx 30rpx;
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
bottom:150rpx;
|
||||
z-index:1;
|
||||
overflow-y: scroll;
|
||||
padding:0 30rpx;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
|
||||
@@ -229,7 +229,12 @@ onMounted(() => {
|
||||
|
||||
/* 主要内容区域 */
|
||||
.main-content {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right:0;
|
||||
bottom: 0rpx;
|
||||
overflow-y: scroll;
|
||||
|
||||
}
|
||||
|
||||
@@ -314,7 +319,7 @@ onMounted(() => {
|
||||
height: 200rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
}
|
||||
|
||||
.report-image {
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
|
||||
|
||||
<!-- 顶部导航栏 -->
|
||||
<navBar :title="'意见反馈'"></navBar>
|
||||
<navBar :title="'投诉反馈'"></navBar>
|
||||
|
||||
<!-- 反馈输入区域 -->
|
||||
<view class="feedback-input-container">
|
||||
<view class="input-area">
|
||||
<text class="input-placeholder" v-show="!feedbackText">欢迎对我们的软件提供建议,帮助我们更好更快的改进"肝胆相照"APP (200字以内)</text>
|
||||
<!-- <text class="input-placeholder" v-show="!feedbackText">欢迎对我们的软件提供建议,帮助我们更好更快的改进"肝胆相照"APP (200字以内)</text> -->
|
||||
<textarea
|
||||
class="feedback-textarea"
|
||||
v-model="feedbackText"
|
||||
:maxlength="200"
|
||||
placeholder=""
|
||||
placeholder="尊敬的医生您好,若在交流过程中发现患者发布不适当内容,请您及时填写相关信息,我们将第一时间处理,谢谢您的支持。"
|
||||
:adjust-position="false"
|
||||
@input="onInput"
|
||||
></textarea>
|
||||
<!-- <view class="voice-button" @click="toggleVoiceInput">
|
||||
@@ -24,7 +25,7 @@
|
||||
|
||||
<!-- 底部提交按钮 -->
|
||||
<view class="submit-container">
|
||||
<button class="submit-btn" @click="submitFeedback" :disabled="!feedbackText.trim()">
|
||||
<button class="submit-btn" @click="submitFeedback" >
|
||||
提交
|
||||
</button>
|
||||
</view>
|
||||
@@ -126,9 +127,15 @@
|
||||
|
||||
/* 反馈输入区域 */
|
||||
.feedback-input-container {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 160rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
padding: 30rpx;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input-area {
|
||||
@@ -200,10 +207,10 @@
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background-color: #ffffff;
|
||||
border: 2rpx solid #e0e0e0;
|
||||
background-color: #fff;
|
||||
border: 2rpx solid #8B2316;
|
||||
border-radius: 8rpx;
|
||||
color: #ff0000;
|
||||
color: #8B2316;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
</uni-nav-bar> -->
|
||||
|
||||
<!-- 患者行 -->
|
||||
<view class="row" @click="noop">
|
||||
<view class="contentbox">
|
||||
<view class="row" @click="noop">
|
||||
<text class="row-label">患者</text>
|
||||
<text class="row-value">{{ patientName }}</text>
|
||||
</view>
|
||||
@@ -28,7 +29,8 @@
|
||||
|
||||
<!-- 输入框区域 -->
|
||||
<view class="note-box">
|
||||
<textarea class="note-textarea" v-model.trim="note" placeholder="请填写随访内容" auto-height :maxlength="200" />
|
||||
<textarea class="note-textarea" v-model.trim="note" placeholder="请填写随访内容" auto-height :maxlength="200" :adjust-position="false"/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部删除按钮 -->
|
||||
<view class="fixed-footer">
|
||||
@@ -93,19 +95,29 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentbox{
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow-y: scroll;
|
||||
bottom:128rpx;
|
||||
z-index:1;
|
||||
|
||||
}
|
||||
.visit-note-page{
|
||||
min-height: 100vh; background:#f5f5f5; padding-bottom: 120rpx;
|
||||
background:#f5f5f5; padding-bottom: 120rpx;
|
||||
}
|
||||
.nav-right{ display:flex; align-items:center; }
|
||||
.submit-text{ color:#8B2316; font-size: 30rpx; }
|
||||
|
||||
.row{
|
||||
margin-top: 20rpx; background:#fff; padding: 26rpx 30rpx; display:flex; align-items:center; justify-content:space-between; border-bottom: 1rpx solid #eee;
|
||||
background:#fff; padding: 26rpx 30rpx; display:flex; align-items:center; justify-content:space-between; border-bottom: 1rpx solid #eee;
|
||||
.row-label{ font-size: 32rpx; color:#8B2316; font-weight: 500; }
|
||||
.row-value{ font-size: 32rpx; color:#333; }
|
||||
}
|
||||
|
||||
.section-title{ background:#fff; padding: 22rpx 30rpx; color:#8B2316; font-size: 30rpx; border-top: 1rpx solid #eee; border-bottom: 1rpx solid #eee; }
|
||||
.section-title{ background:#fff; padding: 22rpx 30rpx; color:#8B2316; font-size: 30rpx;border-bottom: 1rpx solid #eee; }
|
||||
|
||||
.note-box{ background:#fff; padding: 20rpx 24rpx; }
|
||||
.note-textarea{
|
||||
|
||||
@@ -32,16 +32,14 @@
|
||||
<view class="section-header">分组成员</view>
|
||||
|
||||
<view class="add-member" @click="addMember">
|
||||
<view class="add-circle">
|
||||
<up-icon name="plus" size="34" color="#bfbfbf" />
|
||||
</view>
|
||||
<up-image :src="addImg" width="120rpx" height="120rpx" />
|
||||
<text class="add-text">添加组患者</text>
|
||||
</view>
|
||||
<!-- 已选中的成员 -->
|
||||
<view class="selected-members" v-if="members.length > 0">
|
||||
<view class="selected-item" v-for="(m, idx) in members" :key="m.uuid || idx">
|
||||
<image class="selected-avatar" :src="docUrl + (m.photo || '')" mode="aspectFill" />
|
||||
<text class="selected-name">{{ m.realName || '未知' }}</text>
|
||||
<image class="selected-avatar" :src="getMemberAvatar(m)" mode="aspectFill" @error="handleMemberAvatarError(m)" />
|
||||
<text class="selected-name">{{ m.nickname || m.realName }}</text>
|
||||
<view class="remove-selected" @click="removeMember(idx)">
|
||||
<text class="remove-text">——</text>
|
||||
<!-- <up-icon name="minus" size="43rpx" color="#fff" bold /> -->
|
||||
@@ -68,12 +66,35 @@
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import delImg from "@/static/iv_delete.png"
|
||||
import addImg from "@/static/addpatient.png"
|
||||
import api from '@/api/api.js'
|
||||
import defaultImg from "@/static/default.png"
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
const groupUuid = ref('')
|
||||
const groupName = ref('')
|
||||
const members = ref([])
|
||||
const visible = ref(false)
|
||||
const avatarErrorMap = ref({})
|
||||
const getAvatarKey = (member = {}) => String(member.uuid || member.id || member.realName || '')
|
||||
const normalizeAvatarUrl = (photo) => {
|
||||
const raw = String(photo || '').trim()
|
||||
if (!raw) return defaultImg
|
||||
if (/^https?:\/\//i.test(raw)) return raw
|
||||
return `${docUrl}${raw}`
|
||||
}
|
||||
const getMemberAvatar = (member = {}) => {
|
||||
const key = getAvatarKey(member)
|
||||
if (key && avatarErrorMap.value[key]) return defaultImg
|
||||
return normalizeAvatarUrl(member.photo)
|
||||
}
|
||||
const handleMemberAvatarError = (member) => {
|
||||
const key = getAvatarKey(member)
|
||||
if (!key) return
|
||||
avatarErrorMap.value = {
|
||||
...avatarErrorMap.value,
|
||||
[key]: true
|
||||
}
|
||||
}
|
||||
const confirmDelete = () => {
|
||||
deleteGroup();
|
||||
}
|
||||
@@ -187,6 +208,7 @@
|
||||
})
|
||||
}
|
||||
const patientListByGroup = async () => {
|
||||
avatarErrorMap.value = {}
|
||||
const res = await api.patientListByGroup({
|
||||
group_uuid: groupUuid.value,
|
||||
list_sort:0
|
||||
@@ -208,13 +230,13 @@
|
||||
padding-bottom: 160rpx;
|
||||
}
|
||||
.save-text{
|
||||
background:#8B2316;
|
||||
color:#8B2316;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 15rpx 25rpx;
|
||||
color:#fff;
|
||||
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="group-manage-page">
|
||||
<view class="nabox">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
@@ -16,7 +16,8 @@
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<!-- 已选中的分组 -->
|
||||
<view class="content-box">
|
||||
<!-- 已选中的分组 -->
|
||||
<view class="selected-section">
|
||||
<view class="tag-list">
|
||||
<view
|
||||
@@ -31,7 +32,7 @@
|
||||
|
||||
<!-- 所有分组 -->
|
||||
<view class="all-groups-section">
|
||||
<view class="section-title">所有分组(选择分组)</view>
|
||||
<view class="section-title"><text calss="red">所有分组</text>(选择分组)</view>
|
||||
<view class="tag-list">
|
||||
<view
|
||||
class="tag-item"
|
||||
@@ -44,6 +45,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部添加按钮 -->
|
||||
<view class="bottom-bar">
|
||||
@@ -81,7 +83,9 @@ const loadAllGroups = async () => {
|
||||
try {
|
||||
const res = await api.groupList();
|
||||
if (res.code === 200) {
|
||||
allGroups.value = res.data || [];
|
||||
const hiddenGroupNames = new Set(['待分组患者', '肝系一生非患教组', '肝系一生患教组']);
|
||||
const arr = (res.data || []).filter((item) => !hiddenGroupNames.has(String(item?.name || '').trim()));
|
||||
allGroups.value = arr;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("加载分组列表失败:", e);
|
||||
@@ -166,11 +170,20 @@ const saveGroups = () => {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.content-box{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
bottom: 140rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
}
|
||||
.selected-section {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
|
||||
min-height: 300rpx;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
border-bottom: 20rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.all-groups-section {
|
||||
@@ -178,9 +191,12 @@ const saveGroups = () => {
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
.red{
|
||||
color: #8b2316;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-list {
|
||||
@@ -235,7 +251,7 @@ const saveGroups = () => {
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
padding: 20rpx 30rpx env(safe-area-inset-bottom);
|
||||
padding: 20rpx 30rpx 20rpx;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
|
||||
@@ -384,6 +384,20 @@ const downLoad = (item) => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "magazine_donwload",
|
||||
page_type: "诊疗指南",
|
||||
resource_name:item.title,
|
||||
belong:title.value,
|
||||
number:1,
|
||||
resource_option:item.tags
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
addDownloadTask({
|
||||
url: docUrl + item.path,
|
||||
title: item.title,
|
||||
@@ -406,6 +420,18 @@ const viewGuideline = (cell) => {
|
||||
console.log(downloadTasks.value);
|
||||
downloadTasks.value.forEach(item => {
|
||||
if(item.id == cell.uuid) {
|
||||
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: "诊疗指南",
|
||||
resource_name:cell.title,
|
||||
resource_option:cell.tags
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
// if(isAndroid){
|
||||
plus.runtime.openFile(item.localPath, function(e) {
|
||||
console.log('打开成功');
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
left-icon="left"
|
||||
title="常用银行卡"
|
||||
@clickLeft="goBack"
|
||||
right-text="添加"
|
||||
right-icon="plusempty"
|
||||
right-icon-color="#8B2316"
|
||||
@clickRight="addBankCard"
|
||||
color="#8B2316"
|
||||
|
||||
@@ -19,28 +20,44 @@
|
||||
</view>
|
||||
<!-- 银行卡列表 -->
|
||||
<view class="card-list">
|
||||
<view class="card-item" v-for="(card, index) in bankCards" :key="card.uuid">
|
||||
<view class="card-logo">
|
||||
<image
|
||||
v-if="getBankLogoImg(card.open_bank)"
|
||||
class="bank-logo-img"
|
||||
:src="getBankLogoImg(card.open_bank)"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view v-else class="logo-bg">
|
||||
<text class="logo-text">{{ getBankLogo(card.open_bank) }}</text>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item
|
||||
v-for="(card, index) in bankCards"
|
||||
:key="card.uuid"
|
||||
|
||||
@change="onSwipeChange($event, card)"
|
||||
>
|
||||
<template v-slot:right>
|
||||
<view class="swipe-right">
|
||||
|
||||
<view class="card-delete-btn" @click.stop="handleDeleteBankCard(card)">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="card-item" :class="{ 'is-swiping': openedSwipeUuid === card.uuid }">
|
||||
<view class="card-logo">
|
||||
<image
|
||||
v-if="getBankLogoImg(card.open_bank)"
|
||||
class="bank-logo-img"
|
||||
:src="getBankLogoImg(card.open_bank)"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view v-else class="logo-bg">
|
||||
<text class="logo-text">{{ getBankLogo(card.open_bank) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<view class="card-number">尾号{{ card.card_number }}储蓄卡</view>
|
||||
<view class="bank-name">{{ card.open_bank }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<view class="card-number">尾号{{ card.card_number }}储蓄卡</view>
|
||||
<view class="bank-name">{{ card.open_bank }}</view>
|
||||
</view>
|
||||
<view class="card-delete" @click.stop="handleDeleteBankCard(card)">
|
||||
删除
|
||||
</view>
|
||||
</view>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
</view>
|
||||
<empty v-if="bankCards.length === 0" imgWidth="50%" empty-img="/static/empty_bank.png" empty-desc="使用常用卡,支付更快捷"></empty>
|
||||
<view class="empty-container" v-if="bankCards.length === 0">
|
||||
<image :src="emptyBankImg" class="empty-image"></image>
|
||||
<text class="empty-text">使用常用卡,支付更快捷</text>
|
||||
</view>
|
||||
<!-- <empty v-if="bankCards.length === 0" :imgWidth="'218rpx'" :imgHeight="'164rpx'" :emptyImage="emptyBankImg" emptyDesc="使用常用卡,支付更快捷"></empty> -->
|
||||
|
||||
<!-- 底部导航指示器 -->
|
||||
<view class="bottom-indicator"></view>
|
||||
@@ -52,17 +69,32 @@ import { ref, onMounted } from 'vue';
|
||||
import navTo from '@/utils/navTo';
|
||||
import api from '@/api/api';
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import emptyBankImg from "@/static/empty_bank.png"
|
||||
const bankCards = ref([]);
|
||||
import { onLoad,onBackPress } from '@dcloudio/uni-app';
|
||||
const openedSwipeUuid = ref('');
|
||||
import { onLoad,onBackPress,onShow } from '@dcloudio/uni-app';
|
||||
const from = ref('');
|
||||
const returnTo = ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
if (options.returnTo) {
|
||||
returnTo.value = decodeURIComponent(options.returnTo);
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "常用银行卡",
|
||||
},
|
||||
});
|
||||
});
|
||||
onShow(() => {
|
||||
getBankCardList();
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
uni.navigateBack();
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -85,8 +117,11 @@ const goBack = () => {
|
||||
};
|
||||
|
||||
const addBankCard = () => {
|
||||
const target = returnTo.value
|
||||
? `/pages_app/idcardAuth/idcardAuth?returnTo=${encodeURIComponent(returnTo.value)}`
|
||||
: '/pages_app/idcardAuth/idcardAuth';
|
||||
navTo({
|
||||
url: '/pages_app/idcardAuth/idcardAuth'
|
||||
url: target
|
||||
});
|
||||
};
|
||||
|
||||
@@ -111,7 +146,9 @@ const bankLogoMap = {
|
||||
};
|
||||
|
||||
const getBankLogoImg = (bankName) => {
|
||||
return bankLogoMap[bankName] || '';
|
||||
let name1=bankName.split(',')[0];
|
||||
let name2=bankName.split(',')[1];
|
||||
return bankLogoMap[name1] || bankLogoMap[name2];
|
||||
};
|
||||
|
||||
const handleDeleteBankCard = (card) => {
|
||||
@@ -146,6 +183,13 @@ const handleDeleteBankCard = (card) => {
|
||||
});
|
||||
};
|
||||
|
||||
const onSwipeChange = (e, card) => {
|
||||
const state = typeof e === 'string'
|
||||
? e
|
||||
: e?.position || e?.show || e?.detail?.position || e?.detail?.show || 'none';
|
||||
openedSwipeUuid.value = state === 'right' ? card.uuid : '';
|
||||
};
|
||||
|
||||
// 获取银行logo文字
|
||||
const getBankLogo = (bankName) => {
|
||||
const bankLogos = {
|
||||
@@ -168,12 +212,26 @@ const getBankLogo = (bankName) => {
|
||||
return bankLogos[bankName] || bankName.charAt(0);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getBankCardList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.empty-container {
|
||||
height:800rpx;
|
||||
min-width:600rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.empty-image {
|
||||
width: 218rpx;
|
||||
height: 164rpx;
|
||||
}
|
||||
.empty-text {
|
||||
margin-top: 20rpx;
|
||||
font-size: 30rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.bank-card-page {
|
||||
min-height: 100vh;
|
||||
background: #F5F5F5;
|
||||
@@ -181,24 +239,60 @@ onMounted(() => {
|
||||
|
||||
:deep(.uni-nav-bar-right-text) {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
:deep(.uni-swipe){
|
||||
margin-bottom: 20rpx!important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 银行卡列表样式 */
|
||||
.card-list {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.swipe-right {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
padding-right: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.card-delete-btn {
|
||||
min-width: 112rpx;
|
||||
height: 100%;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 0 16rpx 16rpx 0;
|
||||
background: #E60012;
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
&.is-swiping {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.card-logo {
|
||||
margin-right: 30rpx;
|
||||
|
||||
@@ -242,12 +336,6 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.card-delete {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #E60012;
|
||||
padding: 8rpx 0 8rpx 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
class="form-input"
|
||||
placeholder="请输入您的姓名"
|
||||
v-model="formData.name"
|
||||
:adjust-position="false"
|
||||
placeholder-style="color: #cccccc"
|
||||
/>
|
||||
</view>
|
||||
@@ -76,6 +77,7 @@
|
||||
<input
|
||||
class="form-input"
|
||||
placeholder="请输入您的身份证号"
|
||||
:adjust-position="false"
|
||||
v-model="formData.idNumber"
|
||||
placeholder-style="color: #cccccc"
|
||||
/>
|
||||
@@ -88,9 +90,12 @@
|
||||
<text class="form-label">银行卡号</text>
|
||||
<view class="input-container">
|
||||
<input
|
||||
class="form-input"
|
||||
class="form-input card-number-input"
|
||||
:class="{ 'is-filled': !!formData.cardNumber }"
|
||||
placeholder="仅限借记卡"
|
||||
v-model="formData.cardNumber"
|
||||
:value="cardNumberDisplay"
|
||||
:adjust-position="false"
|
||||
@input="onCardNumberInput"
|
||||
placeholder-style="color: #cccccc"
|
||||
/>
|
||||
|
||||
@@ -103,9 +108,10 @@
|
||||
<text class="form-label">手机号</text>
|
||||
<view class="input-container">
|
||||
<input
|
||||
class="form-input"
|
||||
class="form-input card-number-input"
|
||||
placeholder="银行预留手机号"
|
||||
v-model="formData.mobile"
|
||||
:adjust-position="false"
|
||||
placeholder-style="color: #cccccc"
|
||||
/>
|
||||
|
||||
@@ -171,6 +177,7 @@ import stepActiveImg from "@/static/add_card_yes.png"
|
||||
import navTo from '@/utils/navTo';
|
||||
import api from '@/api/api';
|
||||
import unidialog from '@/components/dialog/dialog.vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
const cardContent = ref('暂支持以下银行:农业银行、建设银行、光大银行、平安银行、兴业银行、中信银行、邮政储蓄银行、民生银行、中国银行、工商银行、交通银行、浦发银行、广发银行、华夏银行、招商银行、北京银行、上海银行。');
|
||||
const cardTitle = ref('银行卡说明');
|
||||
const cardVisible = ref(false);
|
||||
@@ -199,6 +206,13 @@ const smsCode = ref('');
|
||||
const sendingCode = ref(false);
|
||||
const countdown = ref(0);
|
||||
let countdownTimer = null;
|
||||
const returnTo = ref('');
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.returnTo) {
|
||||
returnTo.value = decodeURIComponent(options.returnTo);
|
||||
}
|
||||
});
|
||||
|
||||
const maskedMobile = computed(() => {
|
||||
const m = formData.value.mobile || '';
|
||||
@@ -207,6 +221,18 @@ const maskedMobile = computed(() => {
|
||||
}
|
||||
return m || '***********';
|
||||
});
|
||||
|
||||
const formatCardNumber = (value) => {
|
||||
const digits = String(value || '').replace(/\D/g, '').slice(0, 19);
|
||||
return digits.replace(/(\d{4})(?=\d)/g, '$1 ');
|
||||
};
|
||||
|
||||
const cardNumberDisplay = computed(() => formatCardNumber(formData.value.cardNumber));
|
||||
|
||||
const onCardNumberInput = (e) => {
|
||||
const value = e?.detail?.value || '';
|
||||
formData.value.cardNumber = String(value).replace(/\D/g, '').slice(0, 19);
|
||||
};
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
@@ -275,7 +301,7 @@ const onNextStep = async () => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('身份验证失败:', error);
|
||||
uni.showToast({ title: '网络错误,请重试', icon: 'none' });
|
||||
uni.showToast({ title: error.data.message || error.message, icon: 'none' });
|
||||
isLoading.value = false;
|
||||
}
|
||||
} else if (currentStep.value === 2) {
|
||||
@@ -325,7 +351,9 @@ const onGetSmsCode = async () => {
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '短信验证码发送失败', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: res.msg || res.data.message, icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -344,9 +372,16 @@ const onConfirmSms = async () => {
|
||||
});
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '银行卡添加成功', icon: 'none' });
|
||||
navTo({
|
||||
url: '/pages_app/idcardAuth/bankCardList'
|
||||
});
|
||||
uni.navigateBack();
|
||||
// if (returnTo.value) {
|
||||
// uni.redirectTo({
|
||||
// url: returnTo.value
|
||||
// });
|
||||
// } else {
|
||||
// navTo({
|
||||
// url: '/pages_app/idcardAuth/bankCardList'
|
||||
// });
|
||||
// }
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '银行卡添加失败', icon: 'none' });
|
||||
}
|
||||
@@ -361,12 +396,17 @@ const onCancelSms = () => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.idcard-auth-page {
|
||||
min-height: 100vh;
|
||||
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.content-area {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
padding: 0rpx 0rpx 0;
|
||||
}
|
||||
|
||||
@@ -484,42 +524,55 @@ const onCancelSms = () => {
|
||||
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
padding: 0 30rpx 20rpx;
|
||||
height: 92rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000000;
|
||||
width: 120rpx;
|
||||
font-weight: 500;
|
||||
text-align: right;
|
||||
text-align-last: auto;
|
||||
letter-spacing: 0;
|
||||
white-space: nowrap;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
min-height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
font-size: 28rpx;
|
||||
background: #ffffff;
|
||||
border: none;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: #8B2316;
|
||||
}
|
||||
}
|
||||
.info-icon {
|
||||
flex:1;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
right: 30rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
@@ -539,20 +592,26 @@ const onCancelSms = () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
flex: 1;
|
||||
padding-right: 56rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.form-input {
|
||||
flex: 9;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
line-height: 80rpx;
|
||||
padding: 0;
|
||||
font-size: 28rpx;
|
||||
background: #ffffff;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
/* 去除边框后无需变更边框颜色 */
|
||||
&.card-number-input.is-filled {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,6 +733,10 @@ const onCancelSms = () => {
|
||||
background: #eeeeee;
|
||||
color: #8B2316;
|
||||
font-size: 26rpx;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.sms-actions {
|
||||
|
||||
+23
-1
@@ -178,6 +178,14 @@
|
||||
if(res.code==200){
|
||||
msgList.value.forEach(item => {
|
||||
if(item.id==id){
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "read_message",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
item.is_read=1;
|
||||
}
|
||||
});
|
||||
@@ -192,7 +200,17 @@
|
||||
if (res.confirm) {
|
||||
api.appMesageRead().then(res => {
|
||||
console.log(res);
|
||||
|
||||
getUnReadList();
|
||||
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "clear_message",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
@@ -226,8 +244,12 @@
|
||||
navTo({
|
||||
url: url
|
||||
})
|
||||
}else if(msg.extra.type==18){
|
||||
let url=`/pages_app/myFlower/myFlower?from=msg`
|
||||
navTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
|
||||
}else{
|
||||
let url="";
|
||||
if(msg.extra.module==1 && msg.extra.type==36){
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<view class="bill-detail-page">
|
||||
<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="detail-content">
|
||||
<view class="detail-row">
|
||||
<text class="label">交易号:</text>
|
||||
<text class="value">{{ detail.tradeNo || '-' }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="label">类型:</text>
|
||||
<text class="value">{{ detail.typeName || '-' }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="label">金额:</text>
|
||||
<text class="value amount" :class="amountClass">{{ detail.accountStr || '-' }}元</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="label">用户:</text>
|
||||
<text class="value">{{ detail.userName || '-' }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="label">时间:</text>
|
||||
<text class="value">{{ formatDateTime(detail.createTime) }}</text>
|
||||
</view>
|
||||
<view class="detail-row">
|
||||
<text class="label">备注:</text>
|
||||
<text class="value">{{ detail.remark || '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
const detail = ref({})
|
||||
const from = ref('')
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.from) {
|
||||
from.value = decodeURIComponent(options.from)
|
||||
}
|
||||
})
|
||||
|
||||
const amountClass = computed(() => {
|
||||
const amount = Number(detail.value?.accountStr || 0)
|
||||
return amount < 0 ? 'negative' : 'positive'
|
||||
})
|
||||
|
||||
const formatDateTime = (value) => {
|
||||
if (!value) return '-'
|
||||
const text = String(value).trim()
|
||||
const date = new Date(text)
|
||||
if (Number.isNaN(date.getTime())) return text
|
||||
const y = date.getFullYear()
|
||||
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const d = String(date.getDate()).padStart(2, '0')
|
||||
const hh = String(date.getHours()).padStart(2, '0')
|
||||
const mm = String(date.getMinutes()).padStart(2, '0')
|
||||
const ss = String(date.getSeconds()).padStart(2, '0')
|
||||
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
if (from.value === 'billDetails') {
|
||||
uni.navigateBack()
|
||||
return
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/myAccount/billDetails?from=myAccount'
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const cache = uni.getStorageSync('billDetailItem')
|
||||
detail.value = cache || {}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bill-detail-page {
|
||||
min-height: 100vh;
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
bottom: 0;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
min-height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1rpx solid #efefef;
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 30rpx;
|
||||
color: #2c2c2c;
|
||||
}
|
||||
|
||||
.value {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
font-size: 30rpx;
|
||||
color: #666666;
|
||||
margin-left: 20rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.amount {
|
||||
&.positive {
|
||||
color: #8B2316;
|
||||
}
|
||||
|
||||
&.negative {
|
||||
color: #3f3f3f;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -35,7 +35,7 @@
|
||||
@scrolltolower="onLoadMore"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<view class="transaction-item" v-for="(item, index) in orderList" :key="item.id">
|
||||
<view class="transaction-item" v-for="(item, index) in orderList" :key="item.id" @click="goToDetail(item)">
|
||||
<view class="cell business-type">{{ item.typeName }}</view>
|
||||
<view class="cell user">{{ item.userName }}</view>
|
||||
<view class="cell date-amount">
|
||||
@@ -65,6 +65,7 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '@/api/api.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
// 响应式数据
|
||||
const orderList = ref([])
|
||||
@@ -74,6 +75,13 @@ const page = ref(1)
|
||||
const total = ref(0)
|
||||
const isFirstPage = ref(true)
|
||||
const isLastPage = ref(false)
|
||||
const from = ref('')
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.from) {
|
||||
from.value = decodeURIComponent(options.from)
|
||||
}
|
||||
})
|
||||
|
||||
const stopRefresh = () => {
|
||||
refreshing.value = false
|
||||
@@ -106,13 +114,15 @@ const getOrderList = async (isRefresh = false) => {
|
||||
const safeList = Array.isArray(list) ? list : []
|
||||
const processedList = safeList.map(item => ({
|
||||
id: item.trade_no,
|
||||
tradeNo: item.trade_no,
|
||||
typeName: item.type_name,
|
||||
userName: item.user_name,
|
||||
createTime: item.create_time,
|
||||
accountStr: item.accountstr,
|
||||
payChannel: item.pay_channel,
|
||||
orderType: item.order_type,
|
||||
status: item.status
|
||||
status: item.status,
|
||||
remark: item.remark || item.message || ''
|
||||
}))
|
||||
|
||||
orderList.value.push(...processedList)
|
||||
@@ -164,9 +174,23 @@ const formatDate = (dateStr) => {
|
||||
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
if (from.value === 'myAccount') {
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/myAccount/myAccount?from=billDetails'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const goToDetail = (item) => {
|
||||
uni.setStorageSync('billDetailItem', item || {})
|
||||
const fromPage = encodeURIComponent('billDetails')
|
||||
uni.navigateTo({
|
||||
url: `/pages_app/myAccount/billDetail?from=${fromPage}`
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOrderList()
|
||||
})
|
||||
@@ -207,7 +231,7 @@ onMounted(() => {
|
||||
border-bottom: 1rpx solid #ccc;
|
||||
|
||||
.header-cell {
|
||||
font-size: 28rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
@@ -257,7 +281,7 @@ onMounted(() => {
|
||||
border-bottom: 1rpx solid #e5e5e5;
|
||||
|
||||
.cell {
|
||||
font-size: 26rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
&.business-type {
|
||||
flex: 1;
|
||||
@@ -268,7 +292,7 @@ onMounted(() => {
|
||||
&.user {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: #ff0000;
|
||||
color: #8B2316;
|
||||
}
|
||||
|
||||
&.date-amount {
|
||||
@@ -280,7 +304,7 @@ onMounted(() => {
|
||||
|
||||
.date {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
color: #999;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
@@ -288,11 +312,11 @@ onMounted(() => {
|
||||
font-size: 24rpx;
|
||||
|
||||
&.positive {
|
||||
color: #ff0000;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
&.negative {
|
||||
color: #666;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
></uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<!-- 账户余额区域 -->
|
||||
<view class="contentbox">
|
||||
<!-- 账户余额区域 -->
|
||||
<view class="account-summary">
|
||||
<view class="profile-section">
|
||||
<image class="profile-avatar" :src="avatar" mode="aspectFill"></image>
|
||||
@@ -42,7 +43,7 @@
|
||||
<view class="action-items">
|
||||
<view class="action-item" @click="handleWithdrawal">
|
||||
<view class="action-icon withdrawal-icon">
|
||||
<text class="icon-text">💰</text>
|
||||
<image class="icon-img" :src="withdrawalsIcon" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="action-content">
|
||||
<text class="action-title">提现</text>
|
||||
@@ -53,7 +54,7 @@
|
||||
|
||||
<view class="action-item" @click="handleBillDetails">
|
||||
<view class="action-icon bill-icon">
|
||||
<text class="icon-text">📋</text>
|
||||
<image class="icon-img" :src="accountIcon" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="action-content">
|
||||
<text class="action-title">账单明细</text>
|
||||
@@ -61,9 +62,10 @@
|
||||
<uni-icons type="right" size="25" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部指示器 -->
|
||||
<view class="bottom-indicator"></view>
|
||||
<!-- <view class="bottom-indicator"></view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -71,12 +73,20 @@
|
||||
import { ref, onMounted } from 'vue'
|
||||
import api from '@/api/api.js'
|
||||
import docUrl from '@/utils/docUrl'
|
||||
import { onLoad,onBackPress } from '@dcloudio/uni-app';
|
||||
import withdrawalsIcon from '@/static/withdrawals.png'
|
||||
import accountIcon from '@/static/account_icon.png'
|
||||
import { onLoad,onBackPress,onShow } from '@dcloudio/uni-app';
|
||||
const from = ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的账户",
|
||||
},
|
||||
});
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
@@ -91,7 +101,7 @@ const withdrawalBalanceFee = ref(0)
|
||||
const lessWithdrawalBalance = ref(0)
|
||||
const avatar = ref('')
|
||||
|
||||
onMounted(() => {
|
||||
onShow(() => {
|
||||
getMyAccount()
|
||||
|
||||
let userInfo= uni.getStorageSync('userInfo')
|
||||
@@ -129,8 +139,9 @@ const handleWithdrawal = () => {
|
||||
cancelText: '取消',
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
const returnTo = encodeURIComponent('/pages_app/myAccount/myAccount')
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/idcardAuth/bankCardList'
|
||||
url: `/pages_app/idcardAuth/idcardAuth?returnTo=${returnTo}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -141,8 +152,9 @@ const handleWithdrawal = () => {
|
||||
}
|
||||
|
||||
const handleBillDetails = () => {
|
||||
const from = encodeURIComponent('myAccount')
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/myAccount/billDetails'
|
||||
url: `/pages_app/myAccount/billDetails?from=${from}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -160,6 +172,14 @@ const getMyAccount = async () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentbox{
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
}
|
||||
.my-account-page {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
@@ -168,17 +188,15 @@ const getMyAccount = async () => {
|
||||
|
||||
// 账户余额区域样式
|
||||
.account-summary {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
background: linear-gradient(135deg, #8B2316, #A0522D);
|
||||
// margin: 30rpx;
|
||||
// border-radius: 20rpx;
|
||||
padding: 60rpx 40rpx;
|
||||
padding: 30rpx 40rpx 10rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0 8rpx 24rpx rgba(139, 35, 22, 0.3);
|
||||
position: relative;
|
||||
|
||||
.profile-section {
|
||||
margin-bottom: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.profile-avatar {
|
||||
width: 120rpx;
|
||||
@@ -193,18 +211,18 @@ const getMyAccount = async () => {
|
||||
display: block;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.balance-amount {
|
||||
display: block;
|
||||
color: #ffffff;
|
||||
font-size: 72rpx;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.2);
|
||||
letter-spacing: 2rpx;
|
||||
margin-bottom: 40rpx;
|
||||
margin-bottom: 0rpx;
|
||||
}
|
||||
|
||||
// 账户信息详情样式
|
||||
@@ -242,7 +260,7 @@ const getMyAccount = async () => {
|
||||
// 操作选项样式
|
||||
.action-items {
|
||||
background-color: #ffffff;
|
||||
margin-top: 30rpx;
|
||||
margin-top: 0rpx;
|
||||
// border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
// box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
|
||||
@@ -250,7 +268,7 @@ const getMyAccount = async () => {
|
||||
.action-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 40rpx 30rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
transition: background-color 0.2s ease;
|
||||
|
||||
@@ -275,6 +293,11 @@ const getMyAccount = async () => {
|
||||
.icon-text {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.withdrawal-icon {
|
||||
|
||||
@@ -26,20 +26,27 @@
|
||||
<text class="section-title">结算银行卡</text>
|
||||
<text class="withdrawal-rules" @click="showWithdrawalRules">提现规则</text>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="bank-card-info" @click="selectBankCard" v-if="selectedBankCard">
|
||||
<view class="bank-logo">
|
||||
<text class="bank-icon">{{ selectedBankCard.bankName ? selectedBankCard.bankName.charAt(0) : '工' }}</text>
|
||||
<image
|
||||
v-if="getBankLogoImg(getBankName(selectedBankCard))"
|
||||
class="bank-logo-img"
|
||||
:src="getBankLogoImg(getBankName(selectedBankCard))"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view v-else class="logo-bg">
|
||||
<text class="bank-icon">{{ getBankLogo(getBankName(selectedBankCard)) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bank-details">
|
||||
<text class="bank-name">{{ selectedBankCard.bankName || '工商银行' }}</text>
|
||||
<text class="bank-card-number">尾号为{{ selectedBankCard.cardNumber ? selectedBankCard.cardNumber.slice(-4) : '8937' }}储蓄卡</text>
|
||||
<text class="bank-name">{{ getBankName(selectedBankCard) || '工商银行' }}</text>
|
||||
<text class="bank-card-number">尾号为{{ getCardTail(selectedBankCard) }}储蓄卡</text>
|
||||
</view>
|
||||
<text class="arrow-icon">›</text>
|
||||
<uni-icons type="right" size="25" color="#999"></uni-icons>
|
||||
</view>
|
||||
<view class="no-bank-card" v-else>
|
||||
<text class="no-card-text">请先添加银行卡</text>
|
||||
<text class="arrow-icon">›</text>
|
||||
<uni-icons type="right" size="25" color="#999"></uni-icons>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
</view>
|
||||
@@ -164,6 +171,63 @@ const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const bankLogoMap = {
|
||||
'工商银行': '/static/icon_bankcard_gongshang.png',
|
||||
'中国银行': '/static/icon_bankcard_zhongguo.png',
|
||||
'建设银行': '/static/icon_bankcard_jianseyinhang.png',
|
||||
'农业银行': '/static/icon_bankcard_nongyeyinhang.png',
|
||||
'交通银行': '/static/icon_bankcard_jiatong.png',
|
||||
'招商银行': '/static/icon_bankcard_zhaoshangyinhang.png',
|
||||
'民生银行': '/static/icon_bankcard_minshneg.png',
|
||||
'兴业银行': '/static/icon_bankcard_xingye.png',
|
||||
'浦发银行': '/static/icon_bankcard_shanghaipudongfazhanyinhang.png',
|
||||
'光大银行': '/static/icon_bankcard_guangda.png',
|
||||
'华夏银行': '/static/icon_bankcard_huaxiayinhnag.png',
|
||||
'中信银行': '/static/icon_bankcard_zhongxinshiye.png',
|
||||
'平安银行': '/static/icon_bankcard_pingan.png',
|
||||
'广发银行': '/static/icon_bankcard_guangfa.png',
|
||||
'邮储银行': '/static/icon_bankcard_youzheng.png',
|
||||
'上海银行': '/static/icon_bankcard_shanghai.png',
|
||||
'北京银行': '/static/icon_bankcard_beijingyinhang.png'
|
||||
}
|
||||
|
||||
const getBankName = (card) => {
|
||||
if (!card) return ''
|
||||
return card.bankName || card.open_bank || ''
|
||||
}
|
||||
|
||||
const getCardTail = (card) => {
|
||||
if (!card) return '8937'
|
||||
const raw = card.cardNumber || card.card_number || ''
|
||||
return raw ? String(raw).slice(-4) : '8937'
|
||||
}
|
||||
|
||||
const getBankLogoImg = (bankName) => {
|
||||
return bankLogoMap[bankName] || ''
|
||||
}
|
||||
|
||||
const getBankLogo = (bankName) => {
|
||||
const bankLogos = {
|
||||
'工商银行': '工',
|
||||
'中国银行': '中',
|
||||
'建设银行': '建',
|
||||
'农业银行': '农',
|
||||
'交通银行': '交',
|
||||
'招商银行': '招',
|
||||
'民生银行': '民',
|
||||
'兴业银行': '兴',
|
||||
'浦发银行': '浦',
|
||||
'光大银行': '光',
|
||||
'华夏银行': '华',
|
||||
'中信银行': '信',
|
||||
'平安银行': '平',
|
||||
'广发银行': '广',
|
||||
'邮储银行': '邮'
|
||||
}
|
||||
if (!bankName) return '工'
|
||||
return bankLogos[bankName] || bankName.charAt(0)
|
||||
}
|
||||
|
||||
// 获取我的账户信息
|
||||
const getMyAccount = async () => {
|
||||
try {
|
||||
@@ -219,8 +283,9 @@ const getBankCardList = async () => {
|
||||
confirmText: '去添加',
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm) {
|
||||
const returnTo = encodeURIComponent('/pages_app/myAccount/withdrawal?from=bankCardList')
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/idcardAuth/bankCardList'
|
||||
url: `/pages_app/idcardAuth/bankCardList?from=withdrawal&returnTo=${returnTo}`
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -243,7 +308,7 @@ const selectBankCard = () => {
|
||||
|
||||
// 这里可以实现银行卡选择逻辑
|
||||
uni.showActionSheet({
|
||||
itemList: bankCardList.value.map(card => `${card.bankName} 尾号${card.cardNumber.slice(-4)}`),
|
||||
itemList: bankCardList.value.map(card => `${getBankName(card)} 尾号${getCardTail(card)}`),
|
||||
success: (res) => {
|
||||
selectedBankCard.value = bankCardList.value[res.tapIndex]
|
||||
}
|
||||
@@ -257,8 +322,8 @@ const showWithdrawalRules = () => {
|
||||
const feeAmount = (withdrawalBalanceFee.value / 100).toFixed(2)
|
||||
|
||||
uni.showModal({
|
||||
title: '提现规则',
|
||||
content: `1. 提现金额不得少于${minAmount}元\n2. 单次提现限额为${maxAmount}元\n3. 提现手续费为${feeAmount}元\n4. 工作日24小时内到账`,
|
||||
title: '温馨提示',
|
||||
content: `提交成功后会有工作人员与您联系`,
|
||||
showCancel: false,
|
||||
confirmText: '我知道了'
|
||||
})
|
||||
@@ -283,15 +348,7 @@ const confirmWithdrawal = () => {
|
||||
return
|
||||
}
|
||||
|
||||
// 检查单次提现限额
|
||||
const maxAmount = withdrawalBalanceMaxOnce.value / 100
|
||||
if (parseFloat(withdrawalAmount.value) > maxAmount) {
|
||||
uni.showToast({
|
||||
title: `单次提现限额为${maxAmount.toFixed(2)}元`,
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// 弹出短信验证码弹框
|
||||
showSmsDialog.value = true
|
||||
@@ -342,7 +399,8 @@ const onGetSmsCode = async () => {
|
||||
} catch (error) {
|
||||
console.error('发送短信验证码失败:', error)
|
||||
uni.showToast({
|
||||
title: '网络错误,请重试',
|
||||
title:error.data.message || error.message || error.data.msg || error.msg || '频繁发送短信,请稍后再试'
|
||||
,
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
@@ -410,7 +468,9 @@ const onCancelSms = () => {
|
||||
|
||||
// 主内容区域
|
||||
.main-content {
|
||||
|
||||
padding-top: calc(var(--status-bar-height) + 44px);
|
||||
padding-bottom: 180rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 加载状态
|
||||
@@ -453,8 +513,8 @@ const onCancelSms = () => {
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1rpx;
|
||||
background-color: #f0f0f0;
|
||||
height: 2rpx;
|
||||
background-color: #bab7b7;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -467,17 +527,29 @@ const onCancelSms = () => {
|
||||
.bank-logo {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background-color: #8B2316;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 24rpx;
|
||||
|
||||
.bank-icon {
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
.bank-logo-img {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.logo-bg {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background: #E60012;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2rpx solid #E60012;
|
||||
|
||||
.bank-icon {
|
||||
font-size: 28rpx;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,7 +571,7 @@ const onCancelSms = () => {
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 32rpx;
|
||||
font-size: 62rpx;
|
||||
color: #cccccc;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -674,6 +746,10 @@ const onCancelSms = () => {
|
||||
color: #8B2316;
|
||||
font-size: 26rpx;
|
||||
border: none;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&:disabled {
|
||||
background: #f5f5f5;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
placeholder="请依据患者的个人信息、疾病资料及患者所咨询的问题详细解答患者的问题(信息仅提问患者及医生可见,最多输入300个字)"
|
||||
placeholder-class="ph"
|
||||
auto-height
|
||||
:adjust-position="false"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -178,6 +178,12 @@ const goBack = () => {
|
||||
};
|
||||
onLoad((options) => {
|
||||
from.value = options.from;
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的二维码",
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
// 页面显示时拉取用户信息,并尽量把图片转成 base64,避免 html2canvas 跨域污染
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">支付方式:</text>
|
||||
<text class="info-value">{{ detail.payType || "--" }}</text>
|
||||
<text class="info-value">{{ detail.payType}}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="info-label">支付时间:</text>
|
||||
@@ -77,7 +77,7 @@ const formatAmount = (value) => {
|
||||
if (value === undefined || value === null || value === "") return "";
|
||||
const num = Number(value);
|
||||
if (Number.isNaN(num)) return "";
|
||||
const amount = num > 1000 ? num / 100 : num;
|
||||
const amount = num / 100;
|
||||
return `${amount.toFixed(2)}元`;
|
||||
};
|
||||
|
||||
@@ -90,13 +90,15 @@ const formatStatus = (raw) => {
|
||||
};
|
||||
|
||||
const formatPayType = (raw) => {
|
||||
if (raw === undefined || raw === null || raw === "") return "免费";
|
||||
const text = String(raw).toLowerCase();
|
||||
if (text === "0" || text === "free") return "免费";
|
||||
if (text === "1" || text.includes("wx") || text.includes("wechat")) return "微信";
|
||||
if (text === "2" || text.includes("ali")) return "支付宝";
|
||||
if (text === "3" || text.includes("balance")) return "余额";
|
||||
return String(raw);
|
||||
if(raw=='balance'){
|
||||
return '余额支付';
|
||||
}else if(raw=='FREE'){
|
||||
return '免费'
|
||||
}else if(raw=='USEWELFARENUM'){
|
||||
return '免费次数';
|
||||
}else if(raw=='wx'){
|
||||
return '微信支付';
|
||||
}
|
||||
};
|
||||
|
||||
const fetchCoursewareDetail = async () => {
|
||||
@@ -115,10 +117,11 @@ const fetchCoursewareDetail = async () => {
|
||||
author: data.provider_name || data.author || data.nickname || "",
|
||||
amountText: formatAmount(data.pay_amount || data.total_fee || data.amount || data.price || 0),
|
||||
createTime: formatDateTime(data.create_date || data.create_time || data.order_time || ""),
|
||||
payType: formatPayType(data.pay_type_name || data.pay_type || data.payment_method || ""),
|
||||
payType: formatPayType(data.pay_channel),
|
||||
payTime: formatDateTime(data.pay_date || data.pay_time || ""),
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
uni.showToast({
|
||||
title: "获取详情失败",
|
||||
icon: "none",
|
||||
@@ -134,13 +137,18 @@ onLoad((options) => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.detail-page {
|
||||
min-height: 100vh;
|
||||
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
background: #fff;
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right:0;
|
||||
z-index: 10;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.order-top {
|
||||
@@ -152,8 +160,8 @@ onLoad((options) => {
|
||||
}
|
||||
|
||||
.download-no {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.pay-status {
|
||||
@@ -192,8 +200,8 @@ onLoad((options) => {
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 18rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
|
||||
@@ -49,12 +49,15 @@
|
||||
<scroll-view
|
||||
scroll-y
|
||||
class="courseware-list"
|
||||
:scroll-top="listScrollTop"
|
||||
:scroll-into-view="scrollIntoViewId"
|
||||
refresher-enabled
|
||||
@refresherrefresh="onRefresh"
|
||||
:refresher-triggered="refreshing"
|
||||
@scrolltolower="onLoadMore"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<view id="courseware-top"></view>
|
||||
<!-- 空状态 -->
|
||||
<view v-if="coursewareList.length === 0 && !loading" class="empty-state">
|
||||
<text>{{ activeTab === 'download' ? '暂无下载数据' : '暂无分享数据' }}</text>
|
||||
@@ -62,21 +65,22 @@
|
||||
|
||||
<view class="courseware-item" v-for="(item, index) in coursewareList" :key="index" @click="onItemClick(item)">
|
||||
<view class="item-content">
|
||||
<view class="courseware-provider" v-if="activeTab === 'share'">
|
||||
<text class="label">下载医生</text>
|
||||
<text class="value">:{{ item.providername }}</text>
|
||||
</view>
|
||||
<view class="courseware-name">
|
||||
<text class="label">课件名称:</text>
|
||||
<text class="value">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="courseware-provider" v-if="item.providername">
|
||||
<text class="label">{{ activeTab === 'download' ? '提供者' : '下载者' }}:</text>
|
||||
<text class="value">{{ item.providername }}</text>
|
||||
<text class="label">课件名称</text>
|
||||
<text class="value">:{{ item.name }}</text>
|
||||
</view>
|
||||
|
||||
<view class="courseware-time">
|
||||
<text class="label">时间:</text>
|
||||
<text class="value">{{ item.time }}</text>
|
||||
<text class="label">时间</text>
|
||||
<text class="value">:{{ item.time }}</text>
|
||||
</view>
|
||||
<view class="courseware-status" v-if="activeTab === 'download'">
|
||||
<text class="label">状态:</text>
|
||||
<text class="value status-paid">{{ item.status }}</text>
|
||||
<text class="label">状态</text>
|
||||
<text class="value status-paid">:{{item.status}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -95,13 +99,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, nextTick } from 'vue';
|
||||
import api from '@/api/api';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import { onLoad,onBackPress } from '@dcloudio/uni-app';
|
||||
import downLoadImg from "@/static/course_download.png"
|
||||
import moneyImg from "@/static/course_yuan.png"
|
||||
const activeTab = ref('download');
|
||||
const listScrollTop = ref(0);
|
||||
const scrollIntoViewId = ref('');
|
||||
const refreshing = ref(false);
|
||||
const loading = ref(false);
|
||||
const noMore = ref(false);
|
||||
@@ -122,11 +128,26 @@ onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的课件",
|
||||
},
|
||||
});
|
||||
});
|
||||
onMounted(() => {
|
||||
onRefresh();
|
||||
});
|
||||
|
||||
const getStatusText = (status) => {
|
||||
console.log(status);
|
||||
if(status === 'paid'){
|
||||
return '已支付';
|
||||
}else if(status === 'unpaid'){
|
||||
return '未支付';
|
||||
}else{
|
||||
return '已分享';
|
||||
}
|
||||
};
|
||||
const goBack = () => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
@@ -143,6 +164,11 @@ onLoad((options) => {
|
||||
})
|
||||
const switchTab = (tab) => {
|
||||
activeTab.value = tab;
|
||||
listScrollTop.value = 0;
|
||||
scrollIntoViewId.value = '';
|
||||
nextTick(() => {
|
||||
scrollIntoViewId.value = 'courseware-top';
|
||||
});
|
||||
// 切换标签时重置数据
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
@@ -182,7 +208,7 @@ const onRefresh = () => {
|
||||
uuid: item.uuid,
|
||||
order_id: item.order_id,
|
||||
type: item.type,
|
||||
providername: item.providername
|
||||
providername: item.downloadername
|
||||
}));
|
||||
|
||||
// 判断是否还有更多数据
|
||||
@@ -354,7 +380,7 @@ const onLoadMore = () => {
|
||||
.courseware-list {
|
||||
// height: calc(100vh - 180rpx - 116rpx - 80rpx);
|
||||
position: fixed;
|
||||
top: 336rpx; // 调整顶部位置,为固定的摘要栏腾出空间
|
||||
top: calc(var(--status-bar-height) + 44px + 124rpx + 80rpx); // 调整顶部位置,为固定的摘要栏腾出空间
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -380,6 +406,15 @@ const onLoadMore = () => {
|
||||
width: 120rpx;
|
||||
color: #8B2316;
|
||||
font-size: 28rpx;
|
||||
display: inline-block;
|
||||
text-align: justify;
|
||||
text-align-last: justify;
|
||||
text-justify: inter-ideograph;
|
||||
}
|
||||
.label::after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.value {
|
||||
|
||||
+239
-64
@@ -16,22 +16,24 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="stats-bar">
|
||||
<view class="stat">
|
||||
<up-image :src="flowerImg" width="36rpx" height="36rpx" ></up-image>
|
||||
<text class="num">{{ stat.totalCount }}</text>
|
||||
<view class="fixed-top-block">
|
||||
<view class="stats-bar">
|
||||
<view class="stat">
|
||||
<up-image :src="flowerImg" width="36rpx" height="36rpx" ></up-image>
|
||||
<text class="num">{{ stat.totalCount }}</text>
|
||||
</view>
|
||||
<view class="stat">
|
||||
<up-image :src="moneyImg" width="36rpx" height="36rpx" ></up-image>
|
||||
<text class="num">{{ stat.totalAmount.toFixed(2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="stat">
|
||||
<up-image :src="moneyImg" width="36rpx" height="36rpx" ></up-image>
|
||||
<text class="num">{{ stat.totalAmount.toFixed(2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表头条(红底白字) -->
|
||||
<view class="table-header">
|
||||
<text class="col name">姓名</text>
|
||||
<text class="col time">时间</text>
|
||||
<text class="col qty">数量</text>
|
||||
<!-- 表头条(红底白字) -->
|
||||
<view class="table-header">
|
||||
<text class="col name">姓名</text>
|
||||
<text class="col time">时间</text>
|
||||
<text class="col qty">数量</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 表体/列表或空状态 -->
|
||||
@@ -46,43 +48,55 @@
|
||||
lower-threshold="100"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<view v-if="records.length === 0" class="empty-wrap">
|
||||
<up-image :src="emptyImg" width="176rpx" height="204rpx" ></up-image>
|
||||
<text class="empty-text">您暂未收到鲜花</text>
|
||||
</view>
|
||||
<view class="list-content">
|
||||
<view v-if="records.length === 0" class="empty-wrap">
|
||||
<up-image :src="emptyImg" width="176rpx" height="204rpx" ></up-image>
|
||||
<text class="empty-text">您暂未收到鲜花</text>
|
||||
</view>
|
||||
|
||||
<view v-else class="row" v-for="(item, idx) in records" :key="idx">
|
||||
<text class="cell name">{{ item.name }}</text>
|
||||
<text class="cell time">{{ item.time }}</text>
|
||||
<text class="cell qty" :class="{ plus: item.amount > 0, minus: item.amount < 0 }">{{ item.amount }}</text>
|
||||
</view>
|
||||
<view v-else class="row" v-for="(item, idx) in records" :key="idx">
|
||||
<text class="cell name">{{ item.name }}</text>
|
||||
<text class="cell time">{{ item.time }}</text>
|
||||
<text class="cell qty" :class="{ plus: item.amount > 0, minus: item.amount < 0 }">{{ item.amount }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="loading" class="loading">
|
||||
<text>加载中...</text>
|
||||
<view v-if="loading" class="loading">
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
<view v-if="noMore && records.length > 0" class="no-more">
|
||||
<text>没有更多数据了</text>
|
||||
</view>
|
||||
<!-- <view class="debug-actions">
|
||||
<button @click="testLoadMore" size="mini" type="primary">测试加载更多</button>
|
||||
<text class="debug-info">当前页: {{ page }}, 加载中: {{ loading }}, 无更多: {{ noMore }}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view v-if="noMore && records.length > 0" class="no-more">
|
||||
<text>没有更多数据了</text>
|
||||
</view>
|
||||
<!-- <view class="debug-actions">
|
||||
<button @click="testLoadMore" size="mini" type="primary">测试加载更多</button>
|
||||
<text class="debug-info">当前页: {{ page }}, 加载中: {{ loading }}, 无更多: {{ noMore }}</text>
|
||||
</view> -->
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, nextTick } from 'vue';
|
||||
import flowerImg from "@/static/flowers.png"
|
||||
import moneyImg from "@/static/mind_totle_money.png"
|
||||
import emptyImg from "@/static/icon_empty.png"
|
||||
import api from '@/api/api.js';
|
||||
import { onBackPress,onLoad } from '@dcloudio/uni-app';
|
||||
const from=ref('');
|
||||
const user_uuid=ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
let userInfo= uni.getStorageSync('userInfo')
|
||||
user_uuid.value = userInfo.uuid;
|
||||
loadFirstTwoPages();
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的鲜花",
|
||||
},
|
||||
});
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
@@ -103,6 +117,25 @@ const noMore = ref(false);
|
||||
const page = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const scrollTop = ref(0);
|
||||
const autoLoading = ref(false);
|
||||
|
||||
const formatDateToYDM = (value) => {
|
||||
if (!value) return '-';
|
||||
const raw = String(value).trim();
|
||||
const directMatch = raw.match(/^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})/);
|
||||
if (directMatch) {
|
||||
const [, year, month, day] = directMatch;
|
||||
return `${year}-${day.padStart(2, '0')}-${month.padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
const parsedDate = new Date(raw);
|
||||
if (Number.isNaN(parsedDate.getTime())) return '-';
|
||||
|
||||
const year = parsedDate.getFullYear();
|
||||
const month = String(parsedDate.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(parsedDate.getDate()).padStart(2, '0');
|
||||
return `${year}-${day}-${month}`;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -116,6 +149,12 @@ const goBack = () => {
|
||||
|
||||
const getFlowerList = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('[myFlower] getFlowerList:start', {
|
||||
page: page.value,
|
||||
loading: loading.value,
|
||||
refreshing: refreshing.value,
|
||||
noMore: noMore.value
|
||||
});
|
||||
// 只在第一页时设置loading状态,避免与onLoadMore冲突
|
||||
if (page.value === 1) {
|
||||
loading.value = true;
|
||||
@@ -123,20 +162,30 @@ const getFlowerList = () => {
|
||||
|
||||
console.log('正在获取第', page.value, '页数据...');
|
||||
|
||||
api.getFlowerList({page: page.value}).then(res => {
|
||||
api.getFlowerList({
|
||||
page: page.value,
|
||||
user_uuid: user_uuid.value,
|
||||
}).then(res => {
|
||||
console.log('接口返回数据:', res);
|
||||
if (res.code === 200 && res.data) {
|
||||
const { flower_data, total_amount, total_num } = res.data;
|
||||
console.log('[myFlower] getFlowerList:response', {
|
||||
reqPage: page.value,
|
||||
pageNum: flower_data?.pageNum,
|
||||
pages: flower_data?.pages,
|
||||
isLastPage: flower_data?.isLastPage,
|
||||
listLength: flower_data?.list?.length || 0
|
||||
});
|
||||
|
||||
// 更新统计数据
|
||||
stat.value.totalCount = total_num || 0;
|
||||
stat.value.totalAmount = total_amount || 0;
|
||||
|
||||
// 处理列表数据
|
||||
if (flower_data && flower_data.list) {
|
||||
if (flower_data && Array.isArray(flower_data.list)) {
|
||||
const newRecords = flower_data.list.map(item => ({
|
||||
name: item.patient_name || '未知',
|
||||
time: item.create_date || '',
|
||||
name: item.patient_name || '账号已注销',
|
||||
time: formatDateToYDM(item.create_date),
|
||||
amount: item.num || 0,
|
||||
// 保留原始数据以备后用
|
||||
original: item
|
||||
@@ -151,12 +200,28 @@ const getFlowerList = () => {
|
||||
console.log('第', page.value, '页数据,追加到列表,新增', newRecords.length, '条');
|
||||
}
|
||||
|
||||
// 判断是否还有更多数据
|
||||
noMore.value = flower_data.isLastPage;
|
||||
console.log('是否最后一页:', flower_data.isLastPage, ',总页数:', flower_data.pages);
|
||||
// 判断是否还有更多数据,兼容不同接口字段
|
||||
if (typeof flower_data.isLastPage === 'boolean') {
|
||||
noMore.value = flower_data.isLastPage;
|
||||
} else if (Number(flower_data.pages) > 0) {
|
||||
noMore.value = page.value >= Number(flower_data.pages);
|
||||
} else {
|
||||
// 未返回分页字段时,仅在本页无数据时判定到底
|
||||
noMore.value = newRecords.length === 0;
|
||||
}
|
||||
console.log('是否最后一页:', noMore.value, ',总页数:', flower_data.pages);
|
||||
}
|
||||
console.log('[myFlower] getFlowerList:end', {
|
||||
page: page.value,
|
||||
records: records.value.length,
|
||||
noMore: noMore.value
|
||||
});
|
||||
resolve(res);
|
||||
} else {
|
||||
console.log('[myFlower] getFlowerList:invalid', {
|
||||
code: res?.code,
|
||||
msg: res?.msg
|
||||
});
|
||||
reject(new Error('接口返回错误'));
|
||||
}
|
||||
}).catch(err => {
|
||||
@@ -172,18 +237,11 @@ const getFlowerList = () => {
|
||||
});
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getFlowerList();
|
||||
});
|
||||
|
||||
const onRefresh = async () => {
|
||||
if (refreshing.value) return;
|
||||
if (refreshing.value || loading.value) return;
|
||||
refreshing.value = true;
|
||||
try {
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
records.value = []; // 清空数据
|
||||
getFlowerList(); // 重新获取第一页数据
|
||||
await loadFirstTwoPages();
|
||||
uni.showToast({ title: '刷新成功', icon: 'none' });
|
||||
} catch (error) {
|
||||
console.error('刷新失败:', error);
|
||||
@@ -193,39 +251,136 @@ const onRefresh = async () => {
|
||||
|
||||
const onLoadMore = async () => {
|
||||
console.log('触发上拉加载更多事件');
|
||||
console.log('[myFlower] onLoadMore:enter', {
|
||||
page: page.value,
|
||||
loading: loading.value,
|
||||
refreshing: refreshing.value,
|
||||
noMore: noMore.value
|
||||
});
|
||||
|
||||
// 检查各种状态
|
||||
if (loading.value) {
|
||||
if (loading.value || refreshing.value) {
|
||||
console.log('正在加载中,忽略重复请求');
|
||||
console.log('[myFlower] onLoadMore:blockByState');
|
||||
return;
|
||||
}
|
||||
|
||||
if (noMore.value) {
|
||||
console.log('已经没有更多数据了');
|
||||
console.log('[myFlower] onLoadMore:blockByNoMore');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('开始加载下一页,当前页码:', page.value);
|
||||
|
||||
loading.value = true;
|
||||
const currentPage = page.value;
|
||||
try {
|
||||
page.value += 1;
|
||||
page.value = currentPage + 1;
|
||||
console.log('[myFlower] onLoadMore:request', {
|
||||
fromPage: currentPage,
|
||||
toPage: page.value
|
||||
});
|
||||
await getFlowerList(); // 等待数据加载完成
|
||||
console.log('加载完成,当前页码:', page.value);
|
||||
console.log('[myFlower] onLoadMore:done', {
|
||||
page: page.value,
|
||||
records: records.value.length,
|
||||
noMore: noMore.value
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('加载更多失败:', error);
|
||||
page.value -= 1; // 恢复页码
|
||||
page.value = currentPage; // 恢复页码
|
||||
console.log('[myFlower] onLoadMore:rollback', { page: page.value });
|
||||
uni.showToast({ title: '加载失败', icon: 'error' });
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const getListLayoutInfo = () => {
|
||||
return new Promise((resolve) => {
|
||||
const query = uni.createSelectorQuery();
|
||||
query.select('.table-body').boundingClientRect();
|
||||
query.select('.list-content').boundingClientRect();
|
||||
query.exec((res = []) => {
|
||||
const bodyHeight = Number(res?.[0]?.height || 0);
|
||||
const contentHeight = Number(res?.[1]?.height || 0);
|
||||
resolve({ bodyHeight, contentHeight });
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const ensureListCanScroll = async () => {
|
||||
if (autoLoading.value || loading.value || refreshing.value || noMore.value) return;
|
||||
autoLoading.value = true;
|
||||
try {
|
||||
while (!noMore.value) {
|
||||
await nextTick();
|
||||
await new Promise((resolve) => setTimeout(resolve, 50));
|
||||
const { bodyHeight, contentHeight } = await getListLayoutInfo();
|
||||
if (!bodyHeight || !contentHeight) break;
|
||||
if (contentHeight > bodyHeight) break;
|
||||
await onLoadMore();
|
||||
if (loading.value) break;
|
||||
}
|
||||
} finally {
|
||||
autoLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const loadFirstTwoPages = async () => {
|
||||
console.log('[myFlower] loadFirstTwoPages:start');
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
records.value = [];
|
||||
console.log('[myFlower] loadFirstTwoPages:reset', {
|
||||
page: page.value,
|
||||
records: records.value.length,
|
||||
noMore: noMore.value
|
||||
});
|
||||
await getFlowerList();
|
||||
// 第1页 Promise resolve 早于 finally 复位 loading,这里手动兜底复位
|
||||
loading.value = false;
|
||||
console.log('[myFlower] loadFirstTwoPages:afterPage1', {
|
||||
page: page.value,
|
||||
records: records.value.length,
|
||||
noMore: noMore.value
|
||||
});
|
||||
if (!noMore.value) {
|
||||
console.log('[myFlower] loadFirstTwoPages:triggerPage2');
|
||||
const firstPage = page.value;
|
||||
try {
|
||||
page.value = firstPage + 1;
|
||||
console.log('[myFlower] loadFirstTwoPages:requestPage2', {
|
||||
fromPage: firstPage,
|
||||
toPage: page.value,
|
||||
refreshing: refreshing.value
|
||||
});
|
||||
await getFlowerList();
|
||||
loading.value = false;
|
||||
} catch (error) {
|
||||
page.value = firstPage;
|
||||
console.log('[myFlower] loadFirstTwoPages:page2FailedRollback', { page: page.value });
|
||||
throw error;
|
||||
}
|
||||
} else {
|
||||
console.log('[myFlower] loadFirstTwoPages:skipPage2(noMore=true)');
|
||||
}
|
||||
console.log('[myFlower] loadFirstTwoPages:end', {
|
||||
page: page.value,
|
||||
records: records.value.length,
|
||||
noMore: noMore.value
|
||||
});
|
||||
};
|
||||
|
||||
// 测试加载更多功能
|
||||
const testLoadMore = () => {
|
||||
console.log('手动测试加载更多');
|
||||
onLoadMore();
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -237,13 +392,27 @@ $card: #ffffff;
|
||||
|
||||
.flower-page {
|
||||
background: $bg;
|
||||
--nav-offset: calc(var(--status-bar-height) + 44px);
|
||||
--stats-height: 86rpx;
|
||||
--header-height: 74rpx;
|
||||
/* 导航栏下方固定区域总高度:统计栏 + 表头 */
|
||||
--fixed-block-height: calc(var(--stats-height) + var(--header-height));
|
||||
}
|
||||
|
||||
.fixed-top-block {
|
||||
position: fixed;
|
||||
top: var(--nav-offset);
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.stats-bar {
|
||||
display: flex;
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
height: var(--stats-height);
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
|
||||
@@ -260,20 +429,25 @@ $card: #ffffff;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 22rpx 30rpx;
|
||||
align-items: center;
|
||||
height: var(--header-height);
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 30rpx;
|
||||
position: sticky;
|
||||
top: 180rpx; /* nav 高度 */
|
||||
z-index: 5;
|
||||
|
||||
.col { width: 33%; }
|
||||
.name { text-align: left; }
|
||||
.time { text-align: center; }
|
||||
.qty { text-align: right; }
|
||||
.qty { text-align: center; }
|
||||
}
|
||||
|
||||
.table-body {
|
||||
height: calc(100vh - 180rpx - 88rpx - 70rpx);
|
||||
position: fixed;
|
||||
top: calc(var(--nav-offset) + var(--fixed-block-height));
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
/* 充满剩余高度,避免滚动穿透 */
|
||||
}
|
||||
|
||||
@@ -282,16 +456,17 @@ $card: #ffffff;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 26rpx 30rpx;
|
||||
border-bottom: 2rpx solid #f2f2f2;
|
||||
background: #fff;
|
||||
border-bottom: 2rpx solid #ccc;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
|
||||
.cell { width: 33%; }
|
||||
.name { text-align: left; }
|
||||
.time { text-align: center; color: #666; }
|
||||
.qty { text-align: right; }
|
||||
.qty.plus { color: #2dbd85; }
|
||||
.qty.minus { color: #e34d4d; }
|
||||
.qty { text-align: center; }
|
||||
.qty.plus { color: #333; }
|
||||
.qty.minus { color: #333; }
|
||||
}
|
||||
|
||||
.empty-wrap { padding-top: 200rpx; display: flex; flex-direction: column; align-items: center; color: #bdbdbd; }
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="header">
|
||||
<text class="title">scroll-view 上拉加载 Demo</text>
|
||||
<text class="sub">下拉刷新 + 触底加载更多</text>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="list-scroll"
|
||||
scroll-y
|
||||
lower-threshold="80"
|
||||
refresher-enabled
|
||||
:refresher-triggered="refreshing"
|
||||
@refresherrefresh="onRefresh"
|
||||
@scrolltolower="onLoadMore"
|
||||
>
|
||||
<view v-for="item in list" :key="item.id" class="list-item">
|
||||
<text class="item-title">{{ item.title }}</text>
|
||||
<text class="item-time">{{ item.time }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="loading" class="tip">加载中...</view>
|
||||
<view v-else-if="noMore && list.length > 0" class="tip">没有更多数据了</view>
|
||||
<view v-else-if="list.length === 0" class="tip">暂无数据</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
|
||||
const page = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const list = ref([]);
|
||||
const loading = ref(false);
|
||||
const refreshing = ref(false);
|
||||
const noMore = ref(false);
|
||||
|
||||
const totalMockCount = 37;
|
||||
const fullData = Array.from({ length: totalMockCount }, (_, i) => {
|
||||
const index = i + 1;
|
||||
return {
|
||||
id: index,
|
||||
title: `第 ${index} 条数据`,
|
||||
time: `2026-03-${String((index % 28) + 1).padStart(2, '0')}`
|
||||
};
|
||||
});
|
||||
|
||||
const getPageData = (pageNum, size) => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
const start = (pageNum - 1) * size;
|
||||
const end = start + size;
|
||||
resolve(fullData.slice(start, end));
|
||||
}, 350);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchList = async (isRefresh = false) => {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
try {
|
||||
if (isRefresh) {
|
||||
page.value = 1;
|
||||
noMore.value = false;
|
||||
}
|
||||
const rows = await getPageData(page.value, pageSize.value);
|
||||
if (isRefresh) {
|
||||
list.value = rows;
|
||||
} else {
|
||||
list.value = [...list.value, ...rows];
|
||||
}
|
||||
noMore.value = rows.length < pageSize.value;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
refreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const onRefresh = async () => {
|
||||
if (refreshing.value) return;
|
||||
refreshing.value = true;
|
||||
await fetchList(true);
|
||||
};
|
||||
|
||||
const onLoadMore = async () => {
|
||||
if (loading.value || refreshing.value || noMore.value) return;
|
||||
page.value += 1;
|
||||
await fetchList(false);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
fetchList(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
height: 100vh;
|
||||
background: #f7f8fa;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 30rpx;
|
||||
background: #ffffff;
|
||||
border-bottom: 1rpx solid #ededed;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
font-size: 34rpx;
|
||||
color: #222;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.sub {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.list-scroll {
|
||||
height: calc(100vh - 130rpx);
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 20rpx 24rpx 0;
|
||||
padding: 24rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
display: block;
|
||||
font-size: 30rpx;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.item-time {
|
||||
display: block;
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tip {
|
||||
padding: 28rpx 0 40rpx;
|
||||
text-align: center;
|
||||
color: #9aa0a6;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<navBar :title="from == 'msg' ? '新的患者' : '我的患者'" />
|
||||
<navBar :title="'新的患者'" />
|
||||
<view class="new-patient-page">
|
||||
<!-- 提醒区域 -->
|
||||
<view class="reminder-section">
|
||||
<view class="contentbox">
|
||||
<view class="reminder-section">
|
||||
<view class="reminder-icon">
|
||||
<uni-icons type="notification" size="16" color="#ff9500"></uni-icons>
|
||||
<up-image :src="tipImg" width="35rpx" height="42rpx"></up-image>
|
||||
</view>
|
||||
<text class="reminder-text">提醒: 为了避免不必要的纠纷,请您务必选择线下就诊过的患者</text>
|
||||
</view>
|
||||
@@ -15,15 +16,15 @@
|
||||
<view class="pending-request" v-for="(item, index) in applyList" :key="index">
|
||||
<view class="request-item">
|
||||
<view class="avatar">
|
||||
<up-image :src="docUrl+item.photo" radius="10rpx" width="80rpx" height="80rpx" ></up-image>
|
||||
<up-image :src="docUrl+item.photo" radius="10rpx" width="120rpx" height="120rpx" ></up-image>
|
||||
</view>
|
||||
<view class="request-content">
|
||||
<view class="request-time">{{ item.createDate }}</view>
|
||||
<view class="request-text">{{ item.content }}</view>
|
||||
|
||||
<view class="action-buttons">
|
||||
<button class="reject-btn" @click="applyListOperate(item.uuid,3)">拒绝</button>
|
||||
<button class="agree-btn" @click="applyListOperate(item.uuid,2)">同意</button>
|
||||
<button class="reject-btn" @click="applyListOperate(item.uuid,3,item.content,item.patientUuid)">拒绝</button>
|
||||
<button class="agree-btn" @click="applyListOperate(item.uuid,2,item.content,item.patientUuid)">同意</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -34,14 +35,14 @@
|
||||
<view class="history-section" v-if="historyList.length > 0">
|
||||
<view class="section-title">申请记录(近一月)</view>
|
||||
<view class="history-list">
|
||||
<view class="history-item" v-for="(item, index) in historyList" :key="index">
|
||||
<view class="history-item" v-for="(item, index) in historyList" :key="index" @click="goPatientDetail(item.patient_uuid,item.status)">
|
||||
<view class="avatar">
|
||||
<up-image v-if="docUrl+item.patient_photo" :src="docUrl + item.patient_photo" radius="10rpx" width="80rpx" height="80rpx"></up-image>
|
||||
<up-image v-if="docUrl+item.patient_photo" :src="docUrl + item.patient_photo" radius="10rpx" width="120rpx" height="120rpx"></up-image>
|
||||
|
||||
</view>
|
||||
<view class="history-content">
|
||||
<view class="history-time">{{ formatDate(item.createDate) }}</view>
|
||||
<view class="nickname">{{ item.nickname || item.patient_name }}</view>
|
||||
<view class="history-time">{{ formatDate2(item.create_date) }}</view>
|
||||
<view class="nickname">昵称:{{ item.patient_name || item.nickname }}</view>
|
||||
<view class="history-text">{{ item.content}}</view>
|
||||
<view class="status-info">
|
||||
<up-image :src="goImg" width="30rpx" height="30rpx" v-if="item.status==2"></up-image>
|
||||
@@ -51,8 +52,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<empty v-if="applyList.length == 0 && historyList.length == 0" :emptyDesc="'暂无新随访申请患者'" />
|
||||
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-button">
|
||||
<button class="add-patient-btn" @click="addPatient">加患者</button>
|
||||
@@ -66,9 +69,11 @@ import { onLoad,onShow,onBackPress} from '@dcloudio/uni-app';
|
||||
import goImg from "@/static/go_big.png"
|
||||
import api from '@/api/api.js'
|
||||
import docUrl from "@/utils/docUrl"
|
||||
import dayjs from 'dayjs'
|
||||
import navTo from "@/utils/navTo.js"
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import navBar from "@/components/navBar/navBar.vue"
|
||||
import tipImg from "@/static/sendgroup_tishi_big.png"
|
||||
const from=ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
@@ -167,20 +172,27 @@ const getApplyList = async () => { // 申请列表
|
||||
});
|
||||
}
|
||||
};
|
||||
const applyListOperate = async (uuid,status) => {
|
||||
const applyListOperate = async (uuid,status,content,patientUuid) => {
|
||||
let data = {
|
||||
uuid: uuid,
|
||||
status: status
|
||||
}
|
||||
const res = await api.applyListOperate(data);
|
||||
if(res.code === 200){
|
||||
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
let nickname = content.split(',')[0].replace('我是', '');
|
||||
getApplyList();
|
||||
getRelationRecordLately();
|
||||
if(status == 2){
|
||||
navTo({
|
||||
url: `/pages_app/patientRemark/patientRemark?uuid=${patientUuid}&&nickname=${nickname}`
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
onShow(() => {
|
||||
@@ -189,6 +201,15 @@ const getApplyList = async () => { // 申请列表
|
||||
|
||||
});
|
||||
|
||||
const goPatientDetail = (uuid,status) => {
|
||||
|
||||
if(status == 2){
|
||||
navTo({
|
||||
url: `/pages_app/patientDetail/patientDetail?uuid=${uuid}&from=myPatient`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 辅助方法
|
||||
// 格式化日期
|
||||
const formatDate = (dateString) => {
|
||||
@@ -201,6 +222,9 @@ const formatDate = (dateString) => {
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
};
|
||||
const formatDate2 = (dateString) => {
|
||||
return dayjs(dateString).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status) => {
|
||||
@@ -213,7 +237,7 @@ const getStatusText = (status) => {
|
||||
|
||||
const addPatient = () => {
|
||||
navTo({
|
||||
url:'/pages_app/myCode/myCode'
|
||||
url:'/pages_app/myCode/myCode?from=myPatient'
|
||||
});
|
||||
// 这里可以跳转到添加患者页面
|
||||
};
|
||||
@@ -221,7 +245,7 @@ const addPatient = () => {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.new-patient-page {
|
||||
min-height: 100vh;
|
||||
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
@@ -316,35 +340,47 @@ const addPatient = () => {
|
||||
margin-right: 60rpx; // 为了保持标题居中
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox{
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 100rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.reminder-section {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items:center;
|
||||
padding: 30rpx;
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
|
||||
.reminder-icon {
|
||||
width: 35rpx;
|
||||
height: 42rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.reminder-text {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.follow-up-section {
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
|
||||
.section-title {
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
padding: 30rpx 30rpx 30rpx;
|
||||
font-size: 32rpx;
|
||||
background-color: #f0f0f0;
|
||||
font-weight: normal;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
@@ -355,11 +391,12 @@ const addPatient = () => {
|
||||
|
||||
.request-item {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
|
||||
|
||||
.avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffb6c1;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
@@ -367,8 +404,8 @@ const addPatient = () => {
|
||||
justify-content: center;
|
||||
|
||||
.avatar-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
@@ -376,7 +413,7 @@ const addPatient = () => {
|
||||
|
||||
.request-content {
|
||||
flex: 1;
|
||||
|
||||
margin-left: 20rpx;
|
||||
.request-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
@@ -438,18 +475,19 @@ const addPatient = () => {
|
||||
margin-bottom: 120rpx; // 为底部按钮留出空间
|
||||
|
||||
.section-title {
|
||||
padding: 30rpx 30rpx 20rpx;
|
||||
padding: 30rpx 30rpx 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
background-color: #f0f0f0;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.history-list {
|
||||
margin-bottom: 100rpx;
|
||||
margin-bottom: 30rpx;
|
||||
.history-item {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
@@ -458,8 +496,9 @@ const addPatient = () => {
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffb6c1;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
@@ -476,18 +515,24 @@ const addPatient = () => {
|
||||
|
||||
.history-content {
|
||||
flex: 1;
|
||||
|
||||
margin-left: 20rpx;
|
||||
min-width: 0;
|
||||
.nickname {
|
||||
font-size: 28rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: normal;
|
||||
color: #8B2316;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.history-text {
|
||||
font-size: 28rpx;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,12 @@ onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的积分",
|
||||
},
|
||||
});
|
||||
});
|
||||
import navTo from "@/utils/navTo.js";
|
||||
import nosigninImg from "@/static/sign_day_false.png"
|
||||
@@ -234,7 +240,8 @@ const showSign = ref(false)
|
||||
const signInfo=reactive({
|
||||
news:{
|
||||
summary:'',
|
||||
title:''
|
||||
title:'',
|
||||
tags:''
|
||||
}
|
||||
})
|
||||
// 分页相关数据 - 收益
|
||||
@@ -368,6 +375,11 @@ try {
|
||||
// 签到成功后刷新数据
|
||||
getMyBonusPoints();
|
||||
getBonusPointsList();
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "signin"
|
||||
},
|
||||
});
|
||||
// uni.showToast({
|
||||
// title: '签到成功,获得'+res.bonuspoints+'积分',
|
||||
// icon: 'none'
|
||||
|
||||
@@ -250,6 +250,12 @@
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "我的福利",
|
||||
},
|
||||
});
|
||||
getWelfarePage();
|
||||
});
|
||||
onHide(() => {
|
||||
|
||||
@@ -139,6 +139,12 @@
|
||||
});
|
||||
onLoad((options) => {
|
||||
from.value = options.from;
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "福利卡兑换",
|
||||
},
|
||||
});
|
||||
})
|
||||
const goWelfare = () => {
|
||||
uni.setStorageSync('lookWelfare', 'useWelfare');
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<swiper-item
|
||||
v-for="(banner, index) in bannerList"
|
||||
:key="banner.id"
|
||||
@click="playBannerVideo(banner)"
|
||||
@click="goToNewsDetail(banner)"
|
||||
>
|
||||
<view class="banner-item">
|
||||
<image
|
||||
@@ -108,11 +108,14 @@
|
||||
<view class="item-title">{{ news.title }}</view>
|
||||
<view class="item-meta">
|
||||
<text class="item-date">{{ formatDate(news.createDate) }}</text>
|
||||
<view class="item-stats">
|
||||
<view class="item-stats middel" >
|
||||
<uni-icons type="eye" size="14" color="#999"></uni-icons>
|
||||
<text>{{ news.readnum || 0 }}</text>
|
||||
|
||||
</view>
|
||||
<view class="item-stats">
|
||||
<uni-icons type="hand-up" size="14" color="#999" style="margin-left: 20rpx;"></uni-icons>
|
||||
<text>{{ news.likenum || 0 }}</text>
|
||||
<text>{{ news.agreenum || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -138,13 +141,34 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { onShow, onPullDownRefresh, onReachBottom,onLoad,onBackPress} 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";
|
||||
const from=ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "肝胆新闻",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true
|
||||
}
|
||||
});
|
||||
// Banner相关数据
|
||||
const bannerList = ref([]);
|
||||
const currentBannerIndex = ref(0);
|
||||
@@ -222,7 +246,11 @@
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
};
|
||||
|
||||
const goToSearch = () => {
|
||||
@@ -493,10 +521,13 @@
|
||||
const goToNewsDetail = (item) => {
|
||||
console.log('Go to news detail:', item);
|
||||
// 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}`
|
||||
});
|
||||
//const encoded = encodeURIComponent(docUrl+item.path);
|
||||
// navTo({
|
||||
// url: `/pages_app/webview/webview?url=${encoded}&type=news&share=1&sharetitle=${item.title}`
|
||||
// });
|
||||
navTo({
|
||||
url: `/pages_app/webview/webviewClass?url=${encodeURIComponent(docUrl+item.path+'?fromtype=doctor')}&title=新闻详情&uuid=${item.uuid}&sharetitle=${item.title}&summary=${item.summary}&type=huanjiao_news&imgPath=${encodeURIComponent(item.headImg)}`
|
||||
});
|
||||
// uni.navigateTo({
|
||||
// url: `/pages_app/newsDetail/newsDetail?id=${item.uuid || item.id}`
|
||||
// });
|
||||
@@ -717,6 +748,8 @@
|
||||
color: #999;
|
||||
|
||||
.item-date {
|
||||
width:125rpx;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -724,10 +757,15 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
text {
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
.middel {
|
||||
width:95rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right" @click.stop="editPatient">
|
||||
<uni-icons type="compose" size="22" color="#8B2316"></uni-icons>
|
||||
<up-image :src="editImg" width="40rpx" height="40rpx"></up-image>
|
||||
<!-- <uni-icons type="compose" size="22" color="#8B2316"></uni-icons> -->
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
@@ -21,13 +22,13 @@
|
||||
|
||||
<!-- 头部信息卡片 -->
|
||||
<view class="card header-card">
|
||||
<image class="avatar" :src="docUrl+patientInfo.photo" mode="aspectFill"></image>
|
||||
<image class="avatar" :src="avatarSrc" mode="aspectFill" @error="handleAvatarError"></image>
|
||||
<view class="base-info">
|
||||
<view class="name-row">
|
||||
<text class="name">{{ patientInfo.realName || '未知' }}</text>
|
||||
<text class="name">{{nickname || patientInfo.realName }}</text>
|
||||
<up-image :src="genderIcon" width="36rpx" height="36rpx"></up-image>
|
||||
</view>
|
||||
<view class="line"><text class="label">昵称:</text><text class="value">{{nickname }}</text></view>
|
||||
<view class="line" v-if="nickname"><text class="label">昵称:</text><text class="value">{{ patientInfo.realName || '未知' }}</text></view>
|
||||
<view class="line">
|
||||
<text class="label">年龄:</text><text class="value">{{ patientDetail.age || '未知' }}</text>
|
||||
<text class="sep">|</text>
|
||||
@@ -42,9 +43,16 @@
|
||||
|
||||
<!-- 功能分组条目 -->
|
||||
<view class="cell" @click="openGroup" style="margin-top: 20rpx;">
|
||||
<text class="cell-label">备注</text>
|
||||
<view class="cell-right">
|
||||
<text class="hint">{{nickname || '给患者添加备注名'}}</text>
|
||||
<uni-icons type="right" color="#999" size="18"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell" @click="openGroup" >
|
||||
<text class="cell-label">分组</text>
|
||||
<view class="cell-right">
|
||||
<text class="hint">{{ group.name }}</text>
|
||||
<text class="hint">{{ group.name || '通过分组给患者分类' }}</text>
|
||||
<uni-icons type="right" color="#999" size="18"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@@ -58,27 +66,32 @@
|
||||
<view class="cell">
|
||||
<text class="cell-label">电话号码</text>
|
||||
<view class="cell-right">
|
||||
<text class="phone">{{ patientInfo.mobile || '未设置' }}</text>
|
||||
<text class="phone" @click="alertDialog">{{ patientInfo.mobile || '未设置' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 患者病史 -->
|
||||
<view class="history-section" v-if="patientDetail.medicalHistoryContent">
|
||||
<view class="history-section">
|
||||
<view class="section-title">患者病史</view>
|
||||
<view class="card history-card">
|
||||
<view class="card history-card" v-if="patientDetail.medicalHistoryContent">
|
||||
<text class="history-text" :class="{ fold: !showAllHistory }">{{ patientDetail.medicalHistoryContent }}</text>
|
||||
<text class="toggle" @click="toggleHistory" v-if="patientDetail.medicalHistoryContent">{{ showAllHistory ? '收起' : '展开全部' }}</text>
|
||||
</view>
|
||||
<view class="card history-card" v-else>
|
||||
<text class="history-text">暂无</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 检查报告 -->
|
||||
<view class="history-section" v-if="patientDetail.patientCase && patientDetail.patientCase.length>0">
|
||||
<view class="section-title">检查报告</view>
|
||||
<view class="card report-card">
|
||||
<view class="report-item" v-for="item in patientDetail.patientCase" :key="item.diseaseUuid" @click="openCase(item.uuid)">
|
||||
<view class="report-item-title">{{ $u.timeFormat(item.createDate, 'yyyy-mm-dd') }}</view>
|
||||
<view class="report-item-content">{{ item.diseaseName }}</view>
|
||||
<scroll-view class="card report-card-scroll" scroll-x>
|
||||
<view class="report-card">
|
||||
<view class="report-item" v-for="item in patientDetail.patientCase" :key="item.diseaseUuid" @click="openCase(item.uuid)">
|
||||
<view class="report-item-title">{{ $u.timeFormat(item.createDate, 'yyyy-mm-dd') }}</view>
|
||||
<view class="report-item-content">{{ item.diseaseName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作 -->
|
||||
@@ -88,20 +101,29 @@
|
||||
<text class="action-text">发消息</text>
|
||||
</view>
|
||||
<view class="action" @click="goMakePlan">
|
||||
<up-image :src="planImg" width="44rpx" height="44rpx" ></up-image>
|
||||
<up-image :src="recordImg" width="44rpx" height="44rpx" ></up-image>
|
||||
<text class="action-text">制定随访计划</text>
|
||||
</view>
|
||||
<view class="action" @click="recordIllness">
|
||||
<up-image :src="recordImg" width="44rpx" height="44rpx" ></up-image>
|
||||
<up-image :src="planImg" width="44rpx" height="44rpx" ></up-image>
|
||||
<text class="action-text">记录病情</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="showDialog"
|
||||
@close="showDialog=false"
|
||||
@confirm="confirmDialog"
|
||||
:content="'复制该患者手机号码'"
|
||||
:confirmText="'确定'"
|
||||
:cancelText="'取消'"
|
||||
>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow,onLoad } from '@dcloudio/uni-app'
|
||||
import { onShow,onLoad,onBackPress} from '@dcloudio/uni-app'
|
||||
import api from '@/api/api.js'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
@@ -110,15 +132,42 @@
|
||||
import recordImg from "@/static/image_backgrond_red_big.png"
|
||||
import manImg from "@/static/new_man_big.png"
|
||||
import womanImg from "@/static/new_woman_big.png"
|
||||
|
||||
import defaultImg from "@/static/default.png"
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import editImg from "@/static/edit_patitent.png"
|
||||
const showAllHistory = ref(false);
|
||||
const showDialog = ref(false);
|
||||
const patientDetail = ref({});
|
||||
const patient_uuid = ref('');
|
||||
const note = ref('');
|
||||
const avatarLoadError = ref(false);
|
||||
const from = ref('');
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
const confirmDialog = ()=>{
|
||||
showDialog.value = false;
|
||||
uni.setClipboardData({
|
||||
data: patientInfo.value.mobile,
|
||||
success: () => {
|
||||
uni.showToast({ title: '复制成功', icon: 'none' });
|
||||
}
|
||||
})
|
||||
}
|
||||
// 计算属性:患者基本信息
|
||||
const patientInfo = computed(() => {
|
||||
return patientDetail.value.patient || {};
|
||||
});
|
||||
const avatarSrc = computed(() => {
|
||||
if (avatarLoadError.value) return defaultImg;
|
||||
return patientInfo.value.photo ? (docUrl + patientInfo.value.photo) : defaultImg;
|
||||
});
|
||||
const handleAvatarError = () => {
|
||||
avatarLoadError.value = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -137,9 +186,19 @@
|
||||
// 计算属性:患者病史文本
|
||||
|
||||
onLoad((options) => {
|
||||
console.log(options);
|
||||
patient_uuid.value = options.uuid;
|
||||
if(options.from){
|
||||
from.value=options.from
|
||||
}
|
||||
});
|
||||
const goBack = ()=> uni.navigateBack()
|
||||
const goBack = ()=> {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
const openCase = (uuid)=>{
|
||||
navTo({
|
||||
url:'/pages_app/checkRecord/checkRecord?uuid='+uuid
|
||||
@@ -155,6 +214,12 @@
|
||||
url:'/pages_app/patientRemark/patientRemark?uuid=' + patientInfo.value.uuid
|
||||
})
|
||||
}
|
||||
const alertDialog = ()=>{
|
||||
|
||||
if(patientInfo.value.mobile){
|
||||
showDialog.value = true;
|
||||
}
|
||||
}
|
||||
const editDesc = ()=> uni.showToast({ title:'编辑描述', icon:'none' })
|
||||
const sendMessage = async()=>{
|
||||
let userId=uni.getStorageSync('userInfo').uuid.toLowerCase();
|
||||
@@ -163,6 +228,8 @@
|
||||
// navTo({
|
||||
// url:'/pages_chat/chat/index'
|
||||
// })
|
||||
console.log(patientInfo.value.realName);
|
||||
console.log(nickname.value);
|
||||
uni.sendNativeEvent('goSendMsg', {
|
||||
msg: {
|
||||
patientuuid: patientInfo.value.uuid,
|
||||
@@ -205,6 +272,7 @@
|
||||
}).then(res=>{
|
||||
if(res.code == 200){
|
||||
patientDetail.value = res.data;
|
||||
avatarLoadError.value = false;
|
||||
console.log('患者详情数据:', res.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -227,7 +295,7 @@
|
||||
});
|
||||
const goMakePlan = ()=> {
|
||||
navTo({
|
||||
url:'/pages_app/visitPlan/visitPlan'
|
||||
url:'/pages_app/visitPlan/visitPlan?uuid='+patient_uuid.value+'&patient_name='+patientInfo.value.realName+'&type=patientDetail'
|
||||
})
|
||||
}
|
||||
const recordIllness = ()=> {
|
||||
@@ -239,15 +307,18 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.report-card-scroll{
|
||||
white-space: nowrap;
|
||||
}
|
||||
.report-card{
|
||||
display: flex;
|
||||
gap: 55rpx;
|
||||
flex-wrap: wrap;
|
||||
display: inline-flex;
|
||||
gap: 24rpx;
|
||||
}
|
||||
.report-item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10rpx;
|
||||
min-width: 260rpx;
|
||||
|
||||
background: #f5f5f5;
|
||||
padding: 20rpx;
|
||||
@@ -272,11 +343,11 @@
|
||||
.avatar { width: 140rpx; height: 140rpx; border-radius: 12rpx; margin-right: 20rpx; }
|
||||
.base-info { flex:1; }
|
||||
.name-row { display:flex; align-items:center; margin-bottom: 10rpx; }
|
||||
.name { font-size: 40rpx; color:#222; margin-right: 10rpx;}
|
||||
.name { font-size: 36rpx; color:#222; margin-right: 10rpx;}
|
||||
.line { font-size: 28rpx; color:#666; margin-top: 6rpx; display:flex; align-items:center; }
|
||||
.label { color:#999;white-space: nowrap; }
|
||||
.value { color:#333; }
|
||||
.sep { color:#ddd; margin: 0 10rpx; }
|
||||
.label { color:#666;white-space: nowrap; }
|
||||
.value { color:#666; }
|
||||
.sep { color:#666; margin: 0 10rpx; }
|
||||
.multi{
|
||||
display: inline;
|
||||
}
|
||||
@@ -287,9 +358,9 @@
|
||||
.hint { font-size: 28rpx; color:#999; margin-right: 12rpx; }
|
||||
.phone { font-size: 32rpx; color:#b10000; }
|
||||
|
||||
.section-title { padding: 16rpx 30rpx; color:#8B2316; font-size: 30rpx; margin-top: 20rpx; background: #fff;}
|
||||
.section-title { padding: 16rpx 30rpx; color:#333; font-size: 28rpx; margin-top: 20rpx; background: #fff;}
|
||||
.history-card { position: relative; }
|
||||
.history-text { font-size: 28rpx; color:#666; line-height: 1.7; display:block; }
|
||||
.history-text { font-size: 28rpx; color:#999; line-height: 1.7; display:block; }
|
||||
.history-text.fold { display:-webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.toggle { position:absolute; right: 20rpx; bottom: 25rpx; color:#b10000; font-size: 28rpx;background: #fff; z-index: 10;}
|
||||
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
<!-- 筛选排序栏 -->
|
||||
<view class="filter-sort-bar">
|
||||
<view class="sort-section" @click="toggleGroupSort">
|
||||
<text class="sort-label">{{ groupSortTitle }}</text>
|
||||
<text class="sort-label" :class="{ 'is-selected': groupSortSelected }">{{ groupSortTitle }}</text>
|
||||
<view class="imgbox">
|
||||
<up-image :src="upImg" width="26rpx" height="26rpx" ></up-image>
|
||||
<up-image :src="groupSortIcon" width="26rpx" height="26rpx" ></up-image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="current-sort" @click="toggleInnerSort">
|
||||
<text class="sort-text">{{ innerSortTitle }}</text>
|
||||
<text class="sort-text" :class="{ 'is-selected': innerSortSelected }">{{ innerSortTitle }}</text>
|
||||
<view class="imgbox">
|
||||
<up-image :src="upImg" width="26rpx" height="26rpx" ></up-image>
|
||||
<up-image :src="innerSortIcon" width="26rpx" height="26rpx" ></up-image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -84,7 +84,7 @@
|
||||
<view class="patient-list" v-if="openGroups[gi]">
|
||||
<view class="patient-item" v-for="(patient, index) in getVisiblePatients(group, gi)" :key="patient.uuid || index" @click="goPatientDetail(patient.uuid)">
|
||||
<view class="patient-avatar">
|
||||
<up-image :src="patient._photoUrl" width="80rpx" height="80rpx" mode="aspectFill"></up-image>
|
||||
<up-image :src="patient._avatarLoadError ? defaultImg : patient._photoUrl" width="80rpx" height="80rpx" mode="aspectFill" @error="handlePatientAvatarError(patient)"></up-image>
|
||||
</view>
|
||||
<view class="patient-info">
|
||||
<view class="patient-name">{{ patient._displayName }}</view>
|
||||
@@ -94,23 +94,29 @@
|
||||
<view v-if="isGroupRendering(group, gi)" class="rendering-tip">加载中...</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="groups.length == 0" :emptyDesc="'暂无分组'" />
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted,nextTick } from 'vue';
|
||||
import { onShow,onBackPress,onLoad } from "@dcloudio/uni-app";
|
||||
import upImg from "@/static/triangle_green_theme.png"
|
||||
import downImg from "@/static/triangle_normal.png"
|
||||
import groupRightImg from "@/static/groupright_big.png"
|
||||
import groupDownImg from "@/static/groupup_big.png"
|
||||
import normalImg from "@/static/triangle_normal.png"
|
||||
import api from '@/api/api.js';
|
||||
import docUrl from '@/utils/docUrl'
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import dayjs from 'dayjs'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import defaultImg from "@/static/default.png"
|
||||
const list_sort = ref(0);
|
||||
const group_sort = ref(0);
|
||||
const groupSortSelected = ref(false);
|
||||
const innerSortSelected = ref(false);
|
||||
const from = ref('');
|
||||
onLoad((options) => {
|
||||
if(options.from){
|
||||
@@ -148,9 +154,17 @@ const formatYMD = (val) => {
|
||||
return d.isValid() ? d.format('YYYY-MM-DD') : '';
|
||||
};
|
||||
|
||||
// 排序栏标题
|
||||
const groupSortTitle = computed(() => group_sort.value === 0 ? '按首字母' : '分组人数');
|
||||
const innerSortTitle = computed(() => list_sort.value === 0 ? '按首字母' : '随访时间');
|
||||
// 排序栏标题/图标(初始化为默认文案+灰色图标,选择后展示具体文案+主题图标)
|
||||
const groupSortTitle = computed(() => {
|
||||
if (!groupSortSelected.value) return '分组排序';
|
||||
return group_sort.value === 0 ? '按首字母' : '分组人数';
|
||||
});
|
||||
const innerSortTitle = computed(() => {
|
||||
if (!innerSortSelected.value) return '组内排序';
|
||||
return list_sort.value === 0 ? '按首字母' : '随访时间';
|
||||
});
|
||||
const groupSortIcon = computed(() => groupSortSelected.value ? upImg : normalImg);
|
||||
const innerSortIcon = computed(() => innerSortSelected.value ? upImg : normalImg);
|
||||
|
||||
|
||||
const fetchGroupList = async () => {
|
||||
@@ -166,8 +180,9 @@ const fetchGroupList = async () => {
|
||||
openGroups.value = {};
|
||||
groupRenderCount.value = {};
|
||||
groups.value.forEach((_, idx) => openGroups.value[idx] = false);
|
||||
|
||||
uni.hideLoading();
|
||||
nextTick(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -183,8 +198,8 @@ const preprocessGroups = (rawGroups) => {
|
||||
const list = Array.isArray(group.patientList) ? group.patientList : [];
|
||||
list.forEach((patient) => {
|
||||
patient._formattedJoinDate = formatYMD(patient.join_date);
|
||||
patient._displayName = patient.realName || patient.nickname || '-';
|
||||
patient._photoUrl = `${docUrl}${patient.photo || ''}`;
|
||||
patient._displayName = patient.nickname || patient.realName ;
|
||||
patient._photoUrl = patient.photo ? `${docUrl}${patient.photo}` : defaultImg;
|
||||
});
|
||||
return {
|
||||
...group,
|
||||
@@ -193,6 +208,11 @@ const preprocessGroups = (rawGroups) => {
|
||||
});
|
||||
};
|
||||
|
||||
const handlePatientAvatarError = (patient) => {
|
||||
if (!patient) return;
|
||||
patient._avatarLoadError = true;
|
||||
};
|
||||
|
||||
const startProgressiveRender = (idx) => {
|
||||
const group = groups.value[idx];
|
||||
if (!group) return;
|
||||
@@ -260,6 +280,7 @@ const chooseGroupSort = (type) => {
|
||||
selectedGroupSort.value = type;
|
||||
// 修改接口字段:按首字母=0,分组人数=1
|
||||
group_sort.value = type === 'letter' ? 0 : 1;
|
||||
groupSortSelected.value = true;
|
||||
closeGroupSort();
|
||||
fetchGroupList();
|
||||
};
|
||||
@@ -281,6 +302,7 @@ const chooseInnerSort = (type) => {
|
||||
selectedInnerSort.value = type;
|
||||
// 组内排序:按首字母=0,随访时间=1
|
||||
list_sort.value = type === 'letter' ? 0 : 1;
|
||||
innerSortSelected.value = true;
|
||||
closeInnerSort();
|
||||
fetchGroupList();
|
||||
};
|
||||
@@ -326,7 +348,7 @@ const createNew = () => {
|
||||
|
||||
.popup-panel {
|
||||
position: fixed;
|
||||
top: 220rpx; /* 紧贴筛选栏 */
|
||||
top: calc(var(--status-bar-height) + 44px + 82rpx); /* 紧贴筛选栏 */
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
@@ -497,7 +519,10 @@ const createNew = () => {
|
||||
|
||||
.sort-label {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
color: #999;
|
||||
&.is-selected {
|
||||
color: #8B2316;
|
||||
}
|
||||
}
|
||||
|
||||
.sort-icon.down {
|
||||
@@ -523,7 +548,10 @@ const createNew = () => {
|
||||
|
||||
.sort-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
color: #999;
|
||||
&.is-selected {
|
||||
color: #8B2316;
|
||||
}
|
||||
}
|
||||
|
||||
.sort-icon.up {
|
||||
@@ -541,7 +569,7 @@ const createNew = () => {
|
||||
}
|
||||
|
||||
.patient-list-section {
|
||||
top: 240rpx;
|
||||
top: calc(var(--status-bar-height) + 44px + 100rpx);
|
||||
width:100%;
|
||||
bottom:0;
|
||||
position: fixed;
|
||||
|
||||
@@ -0,0 +1,825 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="患者列表"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right">
|
||||
<uni-icons type="search" size="24" color="#8B2316" @click="searchPatients"></uni-icons>
|
||||
<uni-icons type="plusempty" size="24" color="#8B2316" @click="goCode" style="margin-left: 30rpx;"></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<view class="patient-list">
|
||||
<view class="listbox alertContent" v-if="showAlert">
|
||||
<image :src="delImg" class="del-img" mode="widthFix" @click="hideAlert"></image>
|
||||
<image :src="alertImg" class="alert-img" mode="widthFix"></image>
|
||||
</view>
|
||||
|
||||
<view class="listbox patient-building" v-if="patientDataLoading && !loadFinish">
|
||||
<text class="patient-building-text">正在整理患者数据,请稍候...</text>
|
||||
</view>
|
||||
|
||||
<view class="listbox" v-show="patientList.length > 0">
|
||||
<scroll-view
|
||||
class="groups-scroll"
|
||||
scroll-y="true"
|
||||
:scroll-into-view="scrollIntoViewId"
|
||||
:scroll-with-animation="true"
|
||||
@scroll="onGroupsScroll"
|
||||
@scrolltolower="onGroupsScrollToLower"
|
||||
:lower-threshold="120"
|
||||
v-show="loadFinish"
|
||||
>
|
||||
<view class="special-actions">
|
||||
<view class="action-item" @click="addNewPatient">
|
||||
<view class="action-icon new-patient">
|
||||
<up-image :src="newPatientImg" width="60rpx" height="60rpx"></up-image>
|
||||
</view>
|
||||
<text class="action-text">新的患者<text class="new-patient-count" v-if="applyList.length > 0">(待审核{{ applyList.length }}人)</text></text>
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
|
||||
<view class="action-item" @click="managePatientGroups">
|
||||
<view class="action-icon group-icon">
|
||||
<view class="grid-icon">
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="action-text">患者分组 <text class="new-patient-count" v-if="patientList.length > 0">(随访{{ patientListTotal }}人)</text></text>
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group-section" v-for="group in patientGroups" :key="group.letter" :id="`anchor-${group.letter}`">
|
||||
<view class="group-header">{{ group.letter }}</view>
|
||||
<view class="patient-item" v-for="item in group.items" :key="item.uuid || item.id" @longpress="onPatientItemLongPress(item)" @click="goPatientDetail(item.uuid)">
|
||||
<image
|
||||
v-if="hasPatientAvatar(item)"
|
||||
class="patient-avatar"
|
||||
:src="getPatientAvatar(item)"
|
||||
mode="aspectFill"
|
||||
lazy-load="true"
|
||||
@error="handlePatientAvatarError(item)"
|
||||
@click.stop="goPatientDetail(item.uuid)"
|
||||
></image>
|
||||
<view v-else class="patient-avatar avatar-placeholder"></view>
|
||||
<view class="patient-info">
|
||||
<text class="patient-name">{{ item.nickname || item.realName }}</text>
|
||||
</view>
|
||||
<view class="patient-status">
|
||||
<view class="edit-icon" @click.stop="editPatient(item.uuid)">
|
||||
<view class="edit-pen"></view>
|
||||
</view>
|
||||
<text class="follow-date">随访于{{ item.joinDateYMD }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="load-more" v-if="patientListLoadingMore">
|
||||
<text class="load-more-text">加载中...</text>
|
||||
</view>
|
||||
<view class="load-more" v-else-if="!patientListHasMore && patientList.length > 0">
|
||||
<text class="load-more-text">没有更多了</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="letter-index" v-if="loadFinish && indexList.length > 0">
|
||||
<view class="letter-item" v-for="letter in indexList" :key="letter" :class="{ active: activeLetter === letter }" @click="onLetterTap(letter)">
|
||||
{{ letter }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="listbox" v-show="patientList.length === 0 && !patientDataLoading">
|
||||
<view class="special-actions">
|
||||
<view class="action-item" @click="addNewPatient">
|
||||
<view class="action-icon new-patient">
|
||||
<up-image :src="newPatientImg" width="60rpx" height="60rpx"></up-image>
|
||||
</view>
|
||||
<text class="action-text">新的患者<text class="new-patient-count" v-if="applyList.length > 0">(待审核{{ applyList.length }}人)</text></text>
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
<view class="action-item" @click="managePatientGroups">
|
||||
<view class="action-icon group-icon">
|
||||
<view class="grid-icon">
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
<view class="grid-item"></view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="action-text">患者分组</text>
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<empty></empty>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item" @click="goMessageTab">
|
||||
<text class="tab-text">患者消息</text>
|
||||
</view>
|
||||
<view class="tab-item active">
|
||||
<text class="tab-text">患者列表</text>
|
||||
<view class="tab-dot" v-if="hasNewPatient"><uni-badge class="uni-badge-left-margin" :text="applyList.length" :offset="[-3, -3]" size="small"></uni-badge></view>
|
||||
</view>
|
||||
<view class="tab-item" @click="goPlanTab">
|
||||
<text class="tab-text">随访计划</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<unidialog :visible="visible" :content="message" @close="visible=false" @confirm="deleteFollowUpFromList"></unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, nextTick, ref, shallowRef } from 'vue';
|
||||
import { onBackPress, onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import dayjs from 'dayjs';
|
||||
import pinyin from 'pinyin';
|
||||
import api from '@/api/api.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import unidialog from '@/components/dialog/dialog.vue';
|
||||
import newPatientImg from '@/static/new_patient.png';
|
||||
import delImg from '@/static/iv_delete.png';
|
||||
import alertImg from '@/static/patientgif.png';
|
||||
|
||||
const patientList = ref([]);
|
||||
const patientDataLoaded = ref(false);
|
||||
const patientDataLoading = ref(false);
|
||||
const loadFinish = ref(false);
|
||||
const showAlert = ref(false);
|
||||
const applyList = ref([]);
|
||||
const visible = ref(false);
|
||||
const message = ref('');
|
||||
const selectedPatientUuid = ref('');
|
||||
const selectedPatientName = ref('');
|
||||
|
||||
const firstLetterCache = new Map();
|
||||
const LETTER_ORDER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||
const GROUP_BUILD_CHUNK_SIZE = 180;
|
||||
const PERF_TRACE = true;
|
||||
const SCROLL_LOG_MIN_INTERVAL = 180;
|
||||
|
||||
const activeLetter = ref('');
|
||||
const scrollIntoViewId = ref('');
|
||||
const groupScrollRanges = ref([]);
|
||||
const indexList = ref([]);
|
||||
const avatarErrorMap = ref({});
|
||||
const patientGroups = shallowRef([]);
|
||||
const allPatientGroups = shallowRef([]);
|
||||
const lastScrollTop = ref(0);
|
||||
const lastScrollLogAt = ref(0);
|
||||
const buildStartedAt = ref(0);
|
||||
const fetchStartedAt = ref(0);
|
||||
const patientListPage = ref(1);
|
||||
const patientListPageSize = ref(300);
|
||||
const patientListHasMore = ref(true);
|
||||
const patientListLoadingMore = ref(false);
|
||||
const canTriggerLowerLoad = ref(true);
|
||||
const lastLowerTriggerTop = ref(0);
|
||||
const LOWER_RESET_DISTANCE = 120;
|
||||
const patientListTotal = ref(0);
|
||||
|
||||
const hasNewPatient = computed(() => applyList.value.length > 0);
|
||||
const perfLog = (...args) => {
|
||||
if (!PERF_TRACE) return;
|
||||
console.log('[patientList/perf]', ...args);
|
||||
};
|
||||
|
||||
const sortLetter = (a, b) => {
|
||||
if (a === '#') return 1;
|
||||
if (b === '#') return -1;
|
||||
const ai = LETTER_ORDER.indexOf(a);
|
||||
const bi = LETTER_ORDER.indexOf(b);
|
||||
if (ai === -1 && bi === -1) return String(a).localeCompare(String(b));
|
||||
if (ai === -1) return 1;
|
||||
if (bi === -1) return -1;
|
||||
return ai - bi;
|
||||
};
|
||||
const formatYMD = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('YYYY-MM-DD') : '';
|
||||
};
|
||||
const getFirstLetter = (name = '') => {
|
||||
const firstChar = String(name).trim().charAt(0);
|
||||
if (!firstChar) return '#';
|
||||
if (/^[A-Za-z]$/.test(firstChar)) return firstChar.toUpperCase();
|
||||
if (firstLetterCache.has(firstChar)) return firstLetterCache.get(firstChar);
|
||||
try {
|
||||
const py = pinyin(firstChar, { style: pinyin.STYLE_NORMAL })?.[0]?.[0] || '';
|
||||
const letter = py ? py.charAt(0).toUpperCase() : '#';
|
||||
firstLetterCache.set(firstChar, letter);
|
||||
return letter;
|
||||
} catch (error) {
|
||||
return '#';
|
||||
}
|
||||
};
|
||||
|
||||
const getAvatarKey = (item = {}) => String(item.uuid || item.id || item.realName || item.nickname || '');
|
||||
const normalizeAvatarUrl = (photo) => {
|
||||
const raw = String(photo || '').trim();
|
||||
if (!raw) return '';
|
||||
if (/^https?:\/\//i.test(raw)) return raw;
|
||||
return `${docUrl}${raw}`;
|
||||
};
|
||||
const hasPatientAvatar = (item = {}) => {
|
||||
const key = getAvatarKey(item);
|
||||
if (!item.avatarUrl) return false;
|
||||
if (key && avatarErrorMap.value[key]) return false;
|
||||
return true;
|
||||
};
|
||||
const getPatientAvatar = (item = {}) => {
|
||||
return item.avatarUrl || '';
|
||||
};
|
||||
const handlePatientAvatarError = (item) => {
|
||||
if (!item) return;
|
||||
const key = getAvatarKey(item);
|
||||
if (!key) return;
|
||||
avatarErrorMap.value = { ...avatarErrorMap.value, [key]: true };
|
||||
};
|
||||
|
||||
const rebuildIndexList = () => {
|
||||
indexList.value = allPatientGroups.value
|
||||
.map(g => String(g?.letter || '').toUpperCase())
|
||||
.filter((letter, index, arr) => (letter === '#' || /^[A-Z]$/.test(letter)) && arr.indexOf(letter) === index)
|
||||
.sort(sortLetter);
|
||||
activeLetter.value = indexList.value[0] || '';
|
||||
};
|
||||
const rpxToPx = (rpx) => {
|
||||
const { screenWidth } = uni.getSystemInfoSync();
|
||||
return Math.round((screenWidth / 750) * rpx);
|
||||
};
|
||||
const buildGroupScrollRanges = () => {
|
||||
const actionHeight = rpxToPx(120);
|
||||
const headerHeight = rpxToPx(80);
|
||||
const itemHeight = rpxToPx(150);
|
||||
let cursor = actionHeight * 2;
|
||||
groupScrollRanges.value = patientGroups.value.map(group => {
|
||||
const groupHeight = headerHeight + (group.items?.length || 0) * itemHeight;
|
||||
const range = { letter: group.letter, start: cursor, end: cursor + groupHeight };
|
||||
cursor += groupHeight;
|
||||
return range;
|
||||
});
|
||||
};
|
||||
const onGroupsScroll = (e) => {
|
||||
const top = Number(e?.detail?.scrollTop || 0);
|
||||
if (!canTriggerLowerLoad.value && top < lastLowerTriggerTop.value - LOWER_RESET_DISTANCE) {
|
||||
canTriggerLowerLoad.value = true;
|
||||
}
|
||||
if (!groupScrollRanges.value.length) return;
|
||||
let current = groupScrollRanges.value[0].letter;
|
||||
for (let i = 0; i < groupScrollRanges.value.length; i++) {
|
||||
const range = groupScrollRanges.value[i];
|
||||
if (top >= range.start) {
|
||||
current = range.letter;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
activeLetter.value = current;
|
||||
const now = Date.now();
|
||||
if (now - lastScrollLogAt.value >= SCROLL_LOG_MIN_INTERVAL) {
|
||||
perfLog('scroll', {
|
||||
top,
|
||||
deltaTop: top - lastScrollTop.value,
|
||||
activeLetter: current,
|
||||
groupCount: patientGroups.value.length,
|
||||
patientCount: patientList.value.length
|
||||
});
|
||||
lastScrollLogAt.value = now;
|
||||
lastScrollTop.value = top;
|
||||
}
|
||||
};
|
||||
const onLetterTap = (letter) => {
|
||||
if (!letter) return;
|
||||
activeLetter.value = letter;
|
||||
const targetId = `anchor-${letter}`;
|
||||
if (scrollIntoViewId.value === targetId) {
|
||||
scrollIntoViewId.value = '';
|
||||
nextTick(() => {
|
||||
scrollIntoViewId.value = targetId;
|
||||
});
|
||||
return;
|
||||
}
|
||||
scrollIntoViewId.value = targetId;
|
||||
};
|
||||
|
||||
const waitForNextFrame = () => new Promise(resolve => setTimeout(resolve, 0));
|
||||
const buildGroupsFromPatients = async () => {
|
||||
buildStartedAt.value = Date.now();
|
||||
perfLog('build:start', { count: patientList.value.length });
|
||||
avatarErrorMap.value = {};
|
||||
const map = new Map();
|
||||
const source = patientList.value || [];
|
||||
for (let i = 0; i < source.length; i++) {
|
||||
const p = source[i] || {};
|
||||
const normalized = { ...p, avatarUrl: normalizeAvatarUrl(p.photo), joinDateYMD: formatYMD(p.join_date) };
|
||||
const first = getFirstLetter(normalized.nickname || normalized.realName);
|
||||
const letter = /^[A-Z]$/.test(first) ? first : '#';
|
||||
if (!map.has(letter)) map.set(letter, []);
|
||||
map.get(letter).push(normalized);
|
||||
if (i > 0 && i % GROUP_BUILD_CHUNK_SIZE === 0) {
|
||||
await waitForNextFrame();
|
||||
}
|
||||
}
|
||||
const letters = Array.from(map.keys()).sort(sortLetter);
|
||||
allPatientGroups.value = letters.map(l => ({ letter: l, items: map.get(l) }));
|
||||
patientGroups.value = allPatientGroups.value;
|
||||
rebuildIndexList();
|
||||
buildGroupScrollRanges();
|
||||
perfLog('build:done', {
|
||||
costMs: Date.now() - buildStartedAt.value,
|
||||
groupCount: patientGroups.value.length,
|
||||
patientCount: patientList.value.length
|
||||
});
|
||||
};
|
||||
|
||||
const getApplyList = async () => {
|
||||
try {
|
||||
const res = await api.applyList();
|
||||
if (res && res.code === 200) applyList.value = res.data || [];
|
||||
} catch (error) {}
|
||||
};
|
||||
const isApiSuccess = (res) => Number(res?.code) === 1 || Number(res?.code) === 200;
|
||||
const parsePagedPatients = (res) => {
|
||||
const data = res?.data;
|
||||
if (Array.isArray(data)) {
|
||||
return { list: data, total: undefined, pageNum: undefined, pages: undefined, isLastPage: undefined };
|
||||
}
|
||||
const list =
|
||||
(Array.isArray(data?.list) && data.list) ||
|
||||
(Array.isArray(data?.records) && data.records) ||
|
||||
(Array.isArray(data?.rows) && data.rows) ||
|
||||
(Array.isArray(data?.data) && data.data) ||
|
||||
[];
|
||||
const total = Number(
|
||||
data?.total ??
|
||||
data?.count ??
|
||||
data?.totalCount ??
|
||||
undefined
|
||||
);
|
||||
const pageNum = Number(data?.pageNum ?? data?.page ?? data?.current ?? undefined);
|
||||
const pages = Number(data?.pages ?? data?.pageCount ?? undefined);
|
||||
const isLastPage =
|
||||
typeof data?.isLastPage === 'boolean'
|
||||
? data.isLastPage
|
||||
: undefined;
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : undefined
|
||||
,
|
||||
pageNum: Number.isFinite(pageNum) ? pageNum : undefined,
|
||||
pages: Number.isFinite(pages) ? pages : undefined,
|
||||
isLastPage
|
||||
};
|
||||
};
|
||||
const mergePatientListUnique = (base = [], incoming = []) => {
|
||||
if (!incoming.length) return base;
|
||||
const seen = new Set();
|
||||
const merged = [];
|
||||
const pushUnique = (item) => {
|
||||
const key = String(item?.uuid || item?.id || item?.mobile || '');
|
||||
if (!key) {
|
||||
merged.push(item);
|
||||
return;
|
||||
}
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
merged.push(item);
|
||||
};
|
||||
for (let i = 0; i < base.length; i++) pushUnique(base[i]);
|
||||
for (let i = 0; i < incoming.length; i++) pushUnique(incoming[i]);
|
||||
return merged;
|
||||
};
|
||||
const applyPatientListData = async (list, total) => {
|
||||
patientList.value = list || [];
|
||||
patientListTotal.value = total || 0;
|
||||
await buildGroupsFromPatients();
|
||||
loadFinish.value = true;
|
||||
patientDataLoaded.value = true;
|
||||
if (patientListTotal.value > 1000) {
|
||||
const hasAlert = uni.getStorageSync('hasAlert');
|
||||
showAlert.value = !hasAlert;
|
||||
}
|
||||
};
|
||||
const patientListByGBKPage = async ({ showLoading = true, reset = false } = {}) => {
|
||||
if (patientDataLoading.value || patientListLoadingMore.value) return;
|
||||
if (!reset && !patientListHasMore.value) return;
|
||||
if (reset) {
|
||||
patientDataLoading.value = true;
|
||||
loadFinish.value = false;
|
||||
patientListPage.value = 1;
|
||||
patientListHasMore.value = true;
|
||||
canTriggerLowerLoad.value = true;
|
||||
lastLowerTriggerTop.value = 0;
|
||||
} else {
|
||||
patientListLoadingMore.value = true;
|
||||
}
|
||||
fetchStartedAt.value = Date.now();
|
||||
perfLog('api:start', { showLoading, reset, page: patientListPage.value, pageSize: patientListPageSize.value });
|
||||
if (showLoading) uni.showLoading({ title: '加载中...', mask: true });
|
||||
try {
|
||||
const requestPage = patientListPage.value;
|
||||
const res = await api.patientListByGBKPage({
|
||||
page: requestPage,
|
||||
pageSize: patientListPageSize.value,
|
||||
});
|
||||
if (isApiSuccess(res)) {
|
||||
const { list, total, pageNum, pages, isLastPage } = parsePagedPatients(res);
|
||||
const merged = reset ? list : mergePatientListUnique(patientList.value, list);
|
||||
await applyPatientListData(merged, total);
|
||||
if (typeof isLastPage === 'boolean') {
|
||||
patientListHasMore.value = !isLastPage;
|
||||
} else if (typeof pages === 'number' && typeof pageNum === 'number') {
|
||||
patientListHasMore.value = pageNum < pages;
|
||||
} else if (typeof total === 'number') {
|
||||
patientListHasMore.value = merged.length < total;
|
||||
} else {
|
||||
patientListHasMore.value = list.length >= patientListPageSize.value;
|
||||
}
|
||||
if (patientListHasMore.value) {
|
||||
if (typeof pageNum === 'number') {
|
||||
patientListPage.value = pageNum + 1;
|
||||
} else {
|
||||
patientListPage.value = requestPage + 1;
|
||||
}
|
||||
}
|
||||
perfLog('api:done', {
|
||||
totalMs: Date.now() - fetchStartedAt.value,
|
||||
requestPage,
|
||||
page: typeof pageNum === 'number' ? pageNum : (reset ? 1 : patientListPage.value - 1),
|
||||
pageDataCount: list.length,
|
||||
mergedCount: merged.length,
|
||||
hasMore: patientListHasMore.value
|
||||
});
|
||||
} else {
|
||||
perfLog('api:bad-code', { code: res.code });
|
||||
}
|
||||
} catch (error) {
|
||||
perfLog('api:error', error?.message || error);
|
||||
throw error;
|
||||
} finally {
|
||||
patientDataLoading.value = false;
|
||||
patientListLoadingMore.value = false;
|
||||
if (showLoading) uni.hideLoading();
|
||||
}
|
||||
};
|
||||
const onGroupsScrollToLower = () => {
|
||||
|
||||
void patientListByGBKPage({ showLoading: false, reset: false });
|
||||
};
|
||||
|
||||
const goPatientDetail = (uuid) => {
|
||||
navTo({ url: `/pages_app/patientDetail/patientDetail?uuid=${uuid}` });
|
||||
};
|
||||
const editPatient = (uuid) => {
|
||||
navTo({ url: `/pages_app/patientSetting/patientSetting?uuid=${uuid}` });
|
||||
};
|
||||
const searchPatients = () => {
|
||||
navTo({ url: '/pages_app/searchPatient/searchPatient' });
|
||||
};
|
||||
const addNewPatient = () => {
|
||||
navTo({ url: '/pages_app/myPatient/myPatient?from=patientMsg' });
|
||||
};
|
||||
const managePatientGroups = () => {
|
||||
navTo({ url: '/pages_app/patientGroup/patientGroup?from=patientMsg' });
|
||||
};
|
||||
const goCode = () => {
|
||||
navTo({ url: '/pages_app/myCode/myCode' });
|
||||
};
|
||||
const hideAlert = () => {
|
||||
showAlert.value = false;
|
||||
uni.setStorageSync('hasAlert', true);
|
||||
};
|
||||
const onPatientItemLongPress = (item) => {
|
||||
if (!item?.uuid) return;
|
||||
selectedPatientUuid.value = item.uuid;
|
||||
selectedPatientName.value = item.nickname || item.realName;
|
||||
message.value = `确认解除[${selectedPatientName.value || '该患者'}]的随访关系?`;
|
||||
visible.value = true;
|
||||
};
|
||||
const deleteFollowUpFromList = async () => {
|
||||
if (!selectedPatientUuid.value) {
|
||||
visible.value = false;
|
||||
return;
|
||||
}
|
||||
const res = await api.cancelRes({ patientUuid: selectedPatientUuid.value });
|
||||
if (isApiSuccess(res)) {
|
||||
uni.showToast({ title: '解除成功', icon: 'none' });
|
||||
await patientListByGBKPage({ showLoading: true, reset: true });
|
||||
}
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
const goMessageTab = () => {
|
||||
navTo({ url: '/pages_app/patientMsg/patientMsg' });
|
||||
};
|
||||
const goPlanTab = () => {
|
||||
navTo({ url: '/pages_app/patientMsg/patientPlan' });
|
||||
};
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
onLoad(async () => {
|
||||
perfLog('lifecycle:onLoad');
|
||||
getApplyList();
|
||||
void patientListByGBKPage({ showLoading: true, reset: true });
|
||||
});
|
||||
onShow(async () => {
|
||||
perfLog('lifecycle:onShow', { patientDataLoaded: patientDataLoaded.value });
|
||||
getApplyList();
|
||||
if (!patientDataLoaded.value) {
|
||||
void patientListByGBKPage({ showLoading: true, reset: true });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background-color: #f8f8f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1rpx solid #e0e0e0;
|
||||
z-index: 999;
|
||||
}
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
.tab-item:nth-child(2) {
|
||||
border: 2rpx solid #ccc;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
.tab-item .tab-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
.tab-item.active .tab-text {
|
||||
color: #8B2316;
|
||||
font-weight: 500;
|
||||
}
|
||||
.tab-dot {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
.patient-list {
|
||||
width: 100%;
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
height: calc(100vh - var(--status-bar-height) - 44px - 103rpx);
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.listbox {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
.patient-building {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.patient-building-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.groups-scroll {
|
||||
height: 100%;
|
||||
}
|
||||
.load-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 80rpx;
|
||||
}
|
||||
.load-more-text {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.special-actions {
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.action-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.action-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.new-patient,
|
||||
.group-icon {
|
||||
background-color: #8B2316;
|
||||
}
|
||||
.grid-icon {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
gap: 2rpx;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.grid-item {
|
||||
background-color: #fff;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
.action-text {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.new-patient-count {
|
||||
color: red;
|
||||
font-size: 32rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.group-header {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #e4e4e4;
|
||||
font-size: 36rpx;
|
||||
color: #666;
|
||||
}
|
||||
.patient-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 80rpx 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
background-color: #fff;
|
||||
}
|
||||
.patient-avatar {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.avatar-placeholder {
|
||||
position: relative;
|
||||
background: #e0e0e0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.avatar-placeholder::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
background: #ffffff;
|
||||
top: 16rpx;
|
||||
left: 31rpx;
|
||||
}
|
||||
.avatar-placeholder::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 56rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 28rpx 28rpx 12rpx 12rpx;
|
||||
background: #ffffff;
|
||||
left: 17rpx;
|
||||
bottom: 14rpx;
|
||||
}
|
||||
.patient-info {
|
||||
flex: 1;
|
||||
}
|
||||
.patient-name {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
.patient-status {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
flex-direction: column;
|
||||
}
|
||||
.edit-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.edit-pen {
|
||||
position: relative;
|
||||
width: 24rpx;
|
||||
height: 6rpx;
|
||||
background: #8B2316;
|
||||
border-radius: 3rpx;
|
||||
transform: rotate(-35deg);
|
||||
}
|
||||
.edit-pen::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: -8rpx;
|
||||
top: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 3rpx solid transparent;
|
||||
border-bottom: 3rpx solid transparent;
|
||||
border-right: 8rpx solid #8B2316;
|
||||
}
|
||||
.edit-pen::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: -5rpx;
|
||||
top: 0;
|
||||
width: 5rpx;
|
||||
height: 6rpx;
|
||||
background: #d9d9d9;
|
||||
border-radius: 0 3rpx 3rpx 0;
|
||||
}
|
||||
.follow-date {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
.letter-index {
|
||||
position: fixed;
|
||||
right: 10rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx 5rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
.letter-item {
|
||||
padding: 8rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.letter-item.active {
|
||||
color: #8B2316;
|
||||
font-weight: 600;
|
||||
}
|
||||
.alertContent {
|
||||
z-index: 99;
|
||||
position: fixed;
|
||||
bottom: 100rpx;
|
||||
width: 100%;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
pointer-events: none;
|
||||
}
|
||||
.alert-img {
|
||||
width: 100%;
|
||||
}
|
||||
.del-img {
|
||||
position: absolute;
|
||||
top: 280rpx;
|
||||
z-index: 999;
|
||||
right: 100rpx;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
pointer-events: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,430 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="患者列表压测"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right">
|
||||
<uni-icons type="search" size="24" color="#8B2316"></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<view class="patient-list">
|
||||
<view class="perf-toolbar">
|
||||
<view class="perf-btn primary" @click="loadRealData">加载真实数据</view>
|
||||
<view class="perf-btn" @click="loadRealData(true)">强制刷新</view>
|
||||
<view class="perf-btn" @click="clearData">清空</view>
|
||||
</view>
|
||||
<view class="perf-tip">当前数据量: {{ patientList.length }},分组: {{ patientGroups.length }},当前字母: {{ activeLetter || '-' }}</view>
|
||||
|
||||
<view class="listbox patient-building" v-if="patientDataLoading && !loadFinish">
|
||||
<text class="patient-building-text">正在生成并整理模拟数据...</text>
|
||||
</view>
|
||||
|
||||
<view class="listbox" v-show="patientList.length > 0">
|
||||
<scroll-view
|
||||
class="groups-scroll"
|
||||
scroll-y="true"
|
||||
:scroll-into-view="scrollIntoViewId"
|
||||
:scroll-with-animation="true"
|
||||
@scroll="onGroupsScroll"
|
||||
v-show="loadFinish"
|
||||
>
|
||||
<view class="special-actions">
|
||||
<view class="action-item">
|
||||
<view class="action-icon new-patient"></view>
|
||||
<text class="action-text">新的患者(模拟)</text>
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="group-section" v-for="group in patientGroups" :key="group.letter" :id="`anchor-${group.letter}`">
|
||||
<view class="group-header">{{ group.letter }}</view>
|
||||
<view class="patient-item" v-for="item in group.items" :key="item.uuid || item.id">
|
||||
<view class="patient-avatar avatar-placeholder"></view>
|
||||
<view class="patient-info">
|
||||
<text class="patient-name">{{ item.nickname || item.realName }}</text>
|
||||
</view>
|
||||
<view class="patient-status">
|
||||
<text class="follow-date">随访于{{ item.joinDateYMD }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="letter-index" v-if="loadFinish && indexList.length > 0">
|
||||
<view class="letter-item" v-for="letter in indexList" :key="letter" :class="{ active: activeLetter === letter }" @click="onLetterTap(letter)">
|
||||
{{ letter }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="listbox" v-show="patientList.length === 0 && !patientDataLoading">
|
||||
<empty></empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick, ref, shallowRef } from 'vue';
|
||||
import { onBackPress } from '@dcloudio/uni-app';
|
||||
import dayjs from 'dayjs';
|
||||
import pinyin from 'pinyin';
|
||||
import api from '@/api/api.js';
|
||||
|
||||
const patientList = ref([]);
|
||||
const patientDataLoading = ref(false);
|
||||
const loadFinish = ref(false);
|
||||
|
||||
const firstLetterCache = new Map();
|
||||
const LETTER_ORDER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||
const GROUP_BUILD_CHUNK_SIZE = 180;
|
||||
const indexList = ref([]);
|
||||
const patientGroups = shallowRef([]);
|
||||
const allPatientGroups = shallowRef([]);
|
||||
const activeLetter = ref('');
|
||||
const scrollIntoViewId = ref('');
|
||||
const groupScrollRanges = ref([]);
|
||||
|
||||
const sortLetter = (a, b) => {
|
||||
if (a === '#') return 1;
|
||||
if (b === '#') return -1;
|
||||
const ai = LETTER_ORDER.indexOf(a);
|
||||
const bi = LETTER_ORDER.indexOf(b);
|
||||
if (ai === -1 && bi === -1) return String(a).localeCompare(String(b));
|
||||
if (ai === -1) return 1;
|
||||
if (bi === -1) return -1;
|
||||
return ai - bi;
|
||||
};
|
||||
|
||||
const formatYMD = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('YYYY-MM-DD') : '';
|
||||
};
|
||||
|
||||
const getFirstLetter = (name = '') => {
|
||||
const firstChar = String(name).trim().charAt(0);
|
||||
if (!firstChar) return '#';
|
||||
if (/^[A-Za-z]$/.test(firstChar)) return firstChar.toUpperCase();
|
||||
if (firstLetterCache.has(firstChar)) return firstLetterCache.get(firstChar);
|
||||
try {
|
||||
const py = pinyin(firstChar, { style: pinyin.STYLE_NORMAL })?.[0]?.[0] || '';
|
||||
const letter = py ? py.charAt(0).toUpperCase() : '#';
|
||||
firstLetterCache.set(firstChar, letter);
|
||||
return letter;
|
||||
} catch (error) {
|
||||
return '#';
|
||||
}
|
||||
};
|
||||
|
||||
const rebuildIndexList = () => {
|
||||
indexList.value = allPatientGroups.value
|
||||
.map(g => String(g?.letter || '').toUpperCase())
|
||||
.filter((letter, index, arr) => (letter === '#' || /^[A-Z]$/.test(letter)) && arr.indexOf(letter) === index)
|
||||
.sort(sortLetter);
|
||||
activeLetter.value = indexList.value[0] || '';
|
||||
};
|
||||
const onLetterTap = (letter) => {
|
||||
if (!letter) return;
|
||||
activeLetter.value = letter;
|
||||
const targetId = `anchor-${letter}`;
|
||||
if (scrollIntoViewId.value === targetId) {
|
||||
scrollIntoViewId.value = '';
|
||||
nextTick(() => {
|
||||
scrollIntoViewId.value = targetId;
|
||||
});
|
||||
return;
|
||||
}
|
||||
scrollIntoViewId.value = targetId;
|
||||
};
|
||||
const rpxToPx = (rpx) => {
|
||||
const { screenWidth } = uni.getSystemInfoSync();
|
||||
return Math.round((screenWidth / 750) * rpx);
|
||||
};
|
||||
const buildGroupScrollRanges = () => {
|
||||
const actionHeight = rpxToPx(120); // action-item 高度近似
|
||||
const headerHeight = rpxToPx(80); // group-header 高度近似
|
||||
const itemHeight = rpxToPx(150); // patient-item 高度近似
|
||||
let cursor = actionHeight;
|
||||
groupScrollRanges.value = patientGroups.value.map(group => {
|
||||
const groupHeight = headerHeight + (group.items?.length || 0) * itemHeight;
|
||||
const range = {
|
||||
letter: group.letter,
|
||||
start: cursor,
|
||||
end: cursor + groupHeight
|
||||
};
|
||||
cursor += groupHeight;
|
||||
return range;
|
||||
});
|
||||
};
|
||||
const onGroupsScroll = (e) => {
|
||||
const top = Number(e?.detail?.scrollTop || 0);
|
||||
if (!groupScrollRanges.value.length) return;
|
||||
let current = groupScrollRanges.value[0].letter;
|
||||
for (let i = 0; i < groupScrollRanges.value.length; i++) {
|
||||
const range = groupScrollRanges.value[i];
|
||||
if (top >= range.start) {
|
||||
current = range.letter;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
activeLetter.value = current;
|
||||
};
|
||||
|
||||
const waitForNextFrame = () => new Promise(resolve => setTimeout(resolve, 0));
|
||||
const buildGroupsFromPatients = async () => {
|
||||
const map = new Map();
|
||||
const source = patientList.value || [];
|
||||
for (let i = 0; i < source.length; i++) {
|
||||
const p = source[i] || {};
|
||||
const normalized = {
|
||||
...p,
|
||||
joinDateYMD: formatYMD(p.join_date)
|
||||
};
|
||||
const first = getFirstLetter(normalized.nickname || normalized.realName);
|
||||
const letter = /^[A-Z]$/.test(first) ? first : '#';
|
||||
if (!map.has(letter)) map.set(letter, []);
|
||||
map.get(letter).push(normalized);
|
||||
if (i > 0 && i % GROUP_BUILD_CHUNK_SIZE === 0) {
|
||||
await waitForNextFrame();
|
||||
}
|
||||
}
|
||||
const letters = Array.from(map.keys()).sort(sortLetter);
|
||||
allPatientGroups.value = letters.map(l => ({ letter: l, items: map.get(l) }));
|
||||
patientGroups.value = allPatientGroups.value;
|
||||
rebuildIndexList();
|
||||
buildGroupScrollRanges();
|
||||
};
|
||||
const loadRealData = async (force = false) => {
|
||||
if (patientDataLoading.value) return;
|
||||
if (!force && patientList.value.length > 0) return;
|
||||
patientDataLoading.value = true;
|
||||
loadFinish.value = false;
|
||||
try {
|
||||
const t1 = Date.now();
|
||||
const res = await api.patientListByGBK();
|
||||
if (res?.code !== 1) {
|
||||
uni.showToast({ title: '获取数据失败', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
patientList.value = res.data || [];
|
||||
await buildGroupsFromPatients();
|
||||
loadFinish.value = true;
|
||||
const t2 = Date.now();
|
||||
uni.showToast({
|
||||
title: `加载完成 ${patientList.value.length}条/${t2 - t1}ms`,
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
} finally {
|
||||
patientDataLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const clearData = () => {
|
||||
patientList.value = [];
|
||||
patientGroups.value = [];
|
||||
allPatientGroups.value = [];
|
||||
indexList.value = [];
|
||||
groupScrollRanges.value = [];
|
||||
activeLetter.value = '';
|
||||
scrollIntoViewId.value = '';
|
||||
loadFinish.value = false;
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.patient-list {
|
||||
width: 100%;
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
height: calc(100vh - var(--status-bar-height) - 44px);
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.perf-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
background: #fff;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
}
|
||||
.perf-btn {
|
||||
padding: 10rpx 16rpx;
|
||||
background: #f2f2f2;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #555;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.perf-btn.primary {
|
||||
background: #8B2316;
|
||||
color: #fff;
|
||||
}
|
||||
.perf-tip {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding: 8rpx 20rpx 14rpx;
|
||||
}
|
||||
.listbox {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
.patient-building {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.patient-building-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
.groups-scroll {
|
||||
height: 100%;
|
||||
}
|
||||
.special-actions {
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.action-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.action-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.new-patient {
|
||||
background-color: #8B2316;
|
||||
}
|
||||
.action-text {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
.group-header {
|
||||
padding: 20rpx 30rpx;
|
||||
background-color: #e4e4e4;
|
||||
font-size: 36rpx;
|
||||
color: #666;
|
||||
}
|
||||
.patient-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 80rpx 20rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
background-color: #fff;
|
||||
}
|
||||
.patient-avatar {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.avatar-placeholder {
|
||||
position: relative;
|
||||
background: #e0e0e0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.avatar-placeholder::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
background: #ffffff;
|
||||
top: 16rpx;
|
||||
left: 31rpx;
|
||||
}
|
||||
.avatar-placeholder::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 56rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 28rpx 28rpx 12rpx 12rpx;
|
||||
background: #ffffff;
|
||||
left: 17rpx;
|
||||
bottom: 14rpx;
|
||||
}
|
||||
.patient-info {
|
||||
flex: 1;
|
||||
}
|
||||
.patient-name {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
.patient-status {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
flex-direction: column;
|
||||
}
|
||||
.follow-date {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
.letter-index {
|
||||
position: fixed;
|
||||
right: 10rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx 5rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
.letter-item {
|
||||
padding: 8rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.letter-item.active {
|
||||
color: #8B2316;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
+143
-1177
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,481 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="患者消息"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right">
|
||||
<uni-icons type="search" size="24" color="#8B2316" @click="searchPatients"></uni-icons>
|
||||
<uni-icons type="staff" size="24" color="#8B2316" @click="managePatients" style="margin-left: 30rpx;"></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="message-list"
|
||||
scroll-y="true"
|
||||
refresher-enabled="true"
|
||||
:refresher-triggered="isRefreshing"
|
||||
@refresherrefresh="onRefresh"
|
||||
>
|
||||
<empty></empty>
|
||||
</scroll-view>
|
||||
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item active">
|
||||
<text class="tab-text">患者消息</text>
|
||||
</view>
|
||||
<view class="tab-item" @click="goListTab">
|
||||
<text class="tab-text">患者列表</text>
|
||||
<view class="tab-dot" v-if="hasNewPatient">
|
||||
<uni-badge class="uni-badge-left-margin" :text="applyList.length" :offset="[-3, -3]" size="small"></uni-badge>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-item" @click="goPlanTab">
|
||||
<text class="tab-text">随访计划</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<<<<<<< HEAD
|
||||
import { computed, ref } from 'vue';
|
||||
import { onBackPress, onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import api from '@/api/api.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
=======
|
||||
import { ref, getCurrentInstance, computed, nextTick, shallowRef } from 'vue';
|
||||
import { onShow,onLoad,onBackPress,onHide} from "@dcloudio/uni-app";
|
||||
import dayImg from "@/static/visit_data11.png"
|
||||
import planImg from "@/static/visitplan.png"
|
||||
import api from '@/api/api.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import defaultImg from "@/static/default.png"
|
||||
import newPatientImg from "@/static/new_patient.png"
|
||||
import delImg from "@/static/iv_delete.png"
|
||||
import editImg from "@/static/edit_patitent.png"
|
||||
const patientList = ref([]);
|
||||
const visible = ref(false)
|
||||
const message = ref('')
|
||||
const selectedPatientUuid = ref('')
|
||||
const selectedPatientName = ref('')
|
||||
const patientDataLoaded = ref(false);
|
||||
const patientDataLoading = ref(false);
|
||||
const firstLetterCache = new Map();
|
||||
const showAlert = ref(false);
|
||||
const navHeight = ref(40);
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
onHide(() => {
|
||||
patientDataLoaded.value = false;
|
||||
});
|
||||
import alertImg from "@/static/patientgif.png"
|
||||
const getNavHeight = () => {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
console.log(2223);
|
||||
console.log(systemInfo);
|
||||
navHeight.value = systemInfo.statusBarHeight + 44;
|
||||
console.log(navHeight.value);
|
||||
}
|
||||
import pinyin from 'pinyin';
|
||||
import dayjs from 'dayjs'
|
||||
import lineImg from "@/static/item_visitplan_fg.png"
|
||||
const loadFinish = ref(false);
|
||||
//import ConversationList from './conversation-list/index.vue'
|
||||
const title = ref('患者消息');
|
||||
const goPatientDetail = (uuid) => {
|
||||
navTo({
|
||||
url: `/pages_app/patientDetail/patientDetail?uuid=${uuid}&from=patientMsg`
|
||||
})
|
||||
}
|
||||
const editPatient = (uuid) => {
|
||||
console.log(uuid)
|
||||
navTo({
|
||||
url: `/pages_app/patientSetting/patientSetting?uuid=${uuid}?from=patientMsg`
|
||||
})
|
||||
}
|
||||
const onPatientItemLongPress = (item) => {
|
||||
if (!item || !item.uuid) return
|
||||
selectedPatientUuid.value = item.uuid
|
||||
selectedPatientName.value = item.nickname || item.realName
|
||||
message.value = `确认解除[${selectedPatientName.value || '该患者'}]的随访关系?`
|
||||
visible.value = true
|
||||
}
|
||||
const deleteFollowUpFromList = async () => {
|
||||
if (!selectedPatientUuid.value) {
|
||||
visible.value = false
|
||||
return
|
||||
}
|
||||
const res = await api.cancelRes({
|
||||
patientUuid: selectedPatientUuid.value
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '解除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
patientListByGBK()
|
||||
}
|
||||
visible.value = false
|
||||
}
|
||||
const avatarErrorMap = ref({});
|
||||
const getAvatarKey = (item = {}) => String(item.uuid || item.id || item.realName || item.nickname || '');
|
||||
const normalizeAvatarUrl = (photo) => {
|
||||
const raw = String(photo || '').trim();
|
||||
if (!raw) return defaultImg;
|
||||
if (/^https?:\/\//i.test(raw)) return raw;
|
||||
return `${docUrl}${raw}`;
|
||||
};
|
||||
const getPatientAvatar = (item = {}) => {
|
||||
const key = getAvatarKey(item);
|
||||
if (key && avatarErrorMap.value[key]) return defaultImg;
|
||||
return item.avatarUrl || defaultImg;
|
||||
};
|
||||
const handlePatientAvatarError = (item) => {
|
||||
if (!item) return;
|
||||
const key = getAvatarKey(item);
|
||||
if (!key) return;
|
||||
avatarErrorMap.value = {
|
||||
...avatarErrorMap.value,
|
||||
[key]: true
|
||||
};
|
||||
}
|
||||
const goCode = () => {
|
||||
navTo({
|
||||
url: `/pages_app/myCode/myCode?from=patientMsg`
|
||||
})
|
||||
}
|
||||
// 仅保留年月日
|
||||
const formatYMD = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('YYYY-MM-DD') : '';
|
||||
}
|
||||
|
||||
const formatYearMonth = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('YYYY年MM月') : '';
|
||||
}
|
||||
// 格式化显示日(如:03)
|
||||
const formatDay = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('DD日') : '';
|
||||
}
|
||||
// 申请列表数据
|
||||
const messageList = ref([
|
||||
{
|
||||
id: 1,
|
||||
patientName: '测试',
|
||||
messagePreview: '[图片]',
|
||||
time: '2025-08-11',
|
||||
avatar: ''
|
||||
}
|
||||
]);
|
||||
|
||||
// 当前激活的标签
|
||||
const activeTab = ref('message');
|
||||
const activeLetter = ref('A');
|
||||
const scrollIntoViewId = ref('');
|
||||
|
||||
// 控制添加菜单弹窗显示
|
||||
const showAddMenuFlag = ref(false);
|
||||
|
||||
// 组件实例(用于 selectorQuery 作用域)
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const LETTER_ORDER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||
const sortLetter = (a, b) => {
|
||||
if (a === '#') return 1;
|
||||
if (b === '#') return -1;
|
||||
const ai = LETTER_ORDER.indexOf(a);
|
||||
const bi = LETTER_ORDER.indexOf(b);
|
||||
if (ai === -1 && bi === -1) return String(a).localeCompare(String(b));
|
||||
if (ai === -1) return 1;
|
||||
if (bi === -1) return -1;
|
||||
return ai - bi;
|
||||
};
|
||||
// up-index-list 索引使用实际分组字母,避免索引与锚点数量不一致
|
||||
const indexList = ref([]);
|
||||
// 列表高度(像素):窗口高度 - 顶部导航(rpx转px) - 底部tab(约100rpx->px) - 操作区(约200rpx->px)
|
||||
const groupsListHeight = ref(0);
|
||||
const rpxToPx = (rpx) => {
|
||||
const { screenWidth } = uni.getSystemInfoSync();
|
||||
return Math.round((screenWidth / 750) * rpx);
|
||||
};
|
||||
const computeListHeight = () => {
|
||||
const { windowHeight } = uni.getSystemInfoSync();
|
||||
const reserved = rpxToPx(240); // 140rpx(nav) + 100rpx(tab) 近似
|
||||
groupsListHeight.value = Math.max(0, windowHeight - reserved);
|
||||
};
|
||||
>>>>>>> cbc427e41ce2bf41f4bd01d9206215c015e257ae
|
||||
|
||||
const applyList = ref([]);
|
||||
const isRefreshing = ref(false);
|
||||
const hasNewPatient = computed(() => applyList.value.length > 0);
|
||||
|
||||
const getApplyList = async () => {
|
||||
try {
|
||||
const res = await api.applyList();
|
||||
if (res && res.code === 200) {
|
||||
applyList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const onRefresh = async () => {
|
||||
isRefreshing.value = true;
|
||||
try {
|
||||
await getApplyList();
|
||||
uni.showToast({
|
||||
title: '刷新成功',
|
||||
icon: 'none',
|
||||
duration: 1200
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
} finally {
|
||||
isRefreshing.value = false;
|
||||
=======
|
||||
};
|
||||
|
||||
// 随访计划上拉加载
|
||||
const onFollowUpLoadMore = async () => {
|
||||
if (!followUpHasMore.value || followUpLoading.value) return;
|
||||
await getFollowUpList(false);
|
||||
};
|
||||
|
||||
// 搜索患者
|
||||
const searchPatients = () => {
|
||||
navTo({
|
||||
url: `/pages_app/searchPatient/searchPatient?from=patientMsg`
|
||||
})
|
||||
};
|
||||
|
||||
// 管理患者
|
||||
const managePatients = () => {
|
||||
uni.showToast({
|
||||
title: '患者管理',
|
||||
icon: 'none'
|
||||
});
|
||||
};
|
||||
|
||||
// 打开消息
|
||||
const openMessage = (item) => {
|
||||
uni.showToast({
|
||||
title: `打开患者 ${item?.patientName || '未知'} 的消息`,
|
||||
icon: 'none'
|
||||
});
|
||||
// 这里可以跳转到消息详情页面
|
||||
// uni.navigateTo({
|
||||
// url: `/pages_app/messageDetail/messageDetail?id=${item?.id}`
|
||||
// });
|
||||
};
|
||||
|
||||
// 切换标签
|
||||
const switchTab = (tab) => {
|
||||
activeTab.value = tab;
|
||||
|
||||
|
||||
switch(tab) {
|
||||
case 'message':
|
||||
// 患者消息页面逻辑 - 刷新申请列表
|
||||
uni.sendNativeEvent('goPatientMsg', {
|
||||
msg: 'goPatientMsg'
|
||||
},ret => {
|
||||
console.log(ret);
|
||||
})
|
||||
// getApplyList();
|
||||
// title.value = '患者消息';
|
||||
break;
|
||||
case 'list':
|
||||
title.value = '患者列表';
|
||||
if (patientDataLoaded.value) {
|
||||
loadFinish.value = true;
|
||||
break;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
});
|
||||
patientListByGBK();
|
||||
// 显示患者列表
|
||||
break;
|
||||
case 'plan':
|
||||
title.value = '随访计划';
|
||||
// 随访计划页面 - 加载随访计划数据
|
||||
if (followUpList.value.length === 0) {
|
||||
getFollowUpList(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// 添加新患者
|
||||
const addNewPatient = () => {
|
||||
navTo({
|
||||
url: '/pages_app/myPatient/myPatient?from=patientMsg'
|
||||
})
|
||||
};
|
||||
|
||||
// 管理患者分组
|
||||
const managePatientGroups = () => {
|
||||
navTo({
|
||||
url: '/pages_app/patientGroup/patientGroup?from=patientMsg'
|
||||
})
|
||||
};
|
||||
|
||||
// 打开患者详情
|
||||
const openPatient = (patientName) => {
|
||||
uni.showToast({
|
||||
title: `打开患者: ${patientName}`,
|
||||
icon: 'none'
|
||||
});
|
||||
};
|
||||
|
||||
// 添加随访计划
|
||||
const addFollowUpPlan = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/visit/visit?from=patientMsg'
|
||||
});
|
||||
};
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
>>>>>>> cbc427e41ce2bf41f4bd01d9206215c015e257ae
|
||||
}
|
||||
};
|
||||
|
||||
const searchPatients = () => {
|
||||
navTo({
|
||||
url: '/pages_app/searchPatient/searchPatient'
|
||||
});
|
||||
};
|
||||
|
||||
const managePatients = () => {
|
||||
uni.showToast({
|
||||
title: '患者管理',
|
||||
icon: 'none'
|
||||
});
|
||||
};
|
||||
|
||||
const goListTab = () => {
|
||||
navTo({
|
||||
url: '/pages_app/patientMsg/patientList'
|
||||
});
|
||||
};
|
||||
|
||||
const goPlanTab = () => {
|
||||
navTo({
|
||||
url: '/pages_app/patientMsg/patientPlan'
|
||||
});
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
|
||||
const notifyNativePatientMsg = () => {
|
||||
uni.sendNativeEvent('goPatientMsg', { msg: 'goPatientMsg' }, () => {});
|
||||
};
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.type === 'list') {
|
||||
goListTab();
|
||||
return;
|
||||
}
|
||||
if (options.type === 'plan') {
|
||||
goPlanTab();
|
||||
return;
|
||||
}
|
||||
getApplyList();
|
||||
notifyNativePatientMsg();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
getApplyList();
|
||||
notifyNativePatientMsg();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
height: calc(100vh - var(--status-bar-height) - 44px - 103rpx);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background-color: #f8f8f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1rpx solid #e0e0e0;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tab-item:nth-child(2) {
|
||||
border: 2rpx solid #ccc;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #8B2316;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tab-dot {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="患者消息"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right">
|
||||
<uni-icons type="search" size="24" color="#8B2316" @click="searchPatients"></uni-icons>
|
||||
<uni-icons type="staff" size="24" color="#8B2316" @click="managePatients" style="margin-left: 30rpx;"></uni-icons>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="message-list"
|
||||
scroll-y="true"
|
||||
refresher-enabled="true"
|
||||
:refresher-triggered="isRefreshing"
|
||||
@refresherrefresh="onRefresh"
|
||||
>
|
||||
<empty></empty>
|
||||
</scroll-view>
|
||||
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item active">
|
||||
<text class="tab-text">患者消息</text>
|
||||
</view>
|
||||
<view class="tab-item" @click="goListTab">
|
||||
<text class="tab-text">患者列表</text>
|
||||
<view class="tab-dot" v-if="hasNewPatient">
|
||||
<uni-badge class="uni-badge-left-margin" :text="applyList.length" :offset="[-3, -3]" size="small"></uni-badge>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-item" @click="goPlanTab">
|
||||
<text class="tab-text">随访计划</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { onBackPress, onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import api from '@/api/api.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
|
||||
const applyList = ref([]);
|
||||
const isRefreshing = ref(false);
|
||||
const hasNewPatient = computed(() => applyList.value.length > 0);
|
||||
|
||||
const getApplyList = async () => {
|
||||
try {
|
||||
const res = await api.applyList();
|
||||
if (res && res.code === 200) {
|
||||
applyList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const onRefresh = async () => {
|
||||
isRefreshing.value = true;
|
||||
try {
|
||||
await getApplyList();
|
||||
uni.showToast({
|
||||
title: '刷新成功',
|
||||
icon: 'none',
|
||||
duration: 1200
|
||||
});
|
||||
} finally {
|
||||
isRefreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const searchPatients = () => {
|
||||
navTo({
|
||||
url: '/pages_app/searchPatient/searchPatient'
|
||||
});
|
||||
};
|
||||
|
||||
const managePatients = () => {
|
||||
uni.showToast({
|
||||
title: '患者管理',
|
||||
icon: 'none'
|
||||
});
|
||||
};
|
||||
|
||||
const goListTab = () => {
|
||||
navTo({
|
||||
url: '/pages_app/patientMsg/patientList'
|
||||
});
|
||||
};
|
||||
|
||||
const goPlanTab = () => {
|
||||
navTo({
|
||||
url: '/pages_app/patientMsg/patientPlan'
|
||||
});
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
|
||||
const notifyNativePatientMsg = () => {
|
||||
uni.sendNativeEvent('goPatientMsg', { msg: 'goPatientMsg' }, () => {});
|
||||
};
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.type === 'list') {
|
||||
goListTab();
|
||||
return;
|
||||
}
|
||||
if (options.type === 'plan') {
|
||||
goPlanTab();
|
||||
return;
|
||||
}
|
||||
getApplyList();
|
||||
notifyNativePatientMsg();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
getApplyList();
|
||||
notifyNativePatientMsg();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
height: calc(100vh - var(--status-bar-height) - 44px - 103rpx);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background-color: #f8f8f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1rpx solid #e0e0e0;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tab-item:nth-child(2) {
|
||||
border: 2rpx solid #ccc;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #8B2316;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tab-dot {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="随访计划"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right" @click="showAddMenu">
|
||||
<view class="save-btn">添加</view>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<view class="plan">
|
||||
<scroll-view
|
||||
class="plan-scroll"
|
||||
scroll-y="true"
|
||||
refresher-enabled="true"
|
||||
:refresher-triggered="followUpRefreshing"
|
||||
@refresherrefresh="onFollowUpRefresh"
|
||||
@scrolltolower="onFollowUpLoadMore"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<view class="plan-list" v-if="groupedFollowUpList.length > 0">
|
||||
<view class="plan-group" v-for="group in groupedFollowUpList" :key="group.yearMonth">
|
||||
<view class="group-header">{{ group.yearMonth }}</view>
|
||||
<view class="plan-card" v-for="item in group.items" :key="item.uuid" @click="goFollowDetail(item)">
|
||||
<view class="left-rail">
|
||||
<text class="day">{{ formatDay(item.datetime) }}</text>
|
||||
</view>
|
||||
<view class="linebox">
|
||||
<up-image :src="lineImg" width="14rpx" height="180rpx"></up-image>
|
||||
</view>
|
||||
<view class="right-content">
|
||||
<view class="leftcontent">
|
||||
<view class="note">{{ item.note }}</view>
|
||||
<view class="name">{{ item.patientname }}</view>
|
||||
</view>
|
||||
<uni-icons type="forward" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="load-more" v-if="followUpLoading">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999"></uni-icons>
|
||||
<text class="load-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view class="no-more" v-if="!followUpHasMore && followUpList.length > 0">
|
||||
<text class="no-more-text">没有更多数据了</text>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-else></empty>
|
||||
</scroll-view>
|
||||
|
||||
<view class="add-menu-popup" v-if="showAddMenuFlag" @click="hideAddMenu">
|
||||
<view class="menu-content" @click.stop>
|
||||
<view class="menu-item" @click="addSchedule">
|
||||
<up-image :src="dayImg" width="34rpx" height="34rpx"></up-image>
|
||||
<text class="menu-text">添加日程</text>
|
||||
</view>
|
||||
<view class="menu-divider"></view>
|
||||
<view class="menu-item" @click="addFollowUpPlan">
|
||||
<up-image :src="planImg" width="34rpx" height="34rpx"></up-image>
|
||||
<text class="menu-text">添加随访计划</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar">
|
||||
<view class="tab-item" @click="goMessageTab">
|
||||
<text class="tab-text">患者消息</text>
|
||||
</view>
|
||||
<view class="tab-item" @click="goListTab">
|
||||
<text class="tab-text">患者列表</text>
|
||||
<view class="tab-dot" v-if="hasNewPatient"><uni-badge class="uni-badge-left-margin" :text="applyList.length" :offset="[-3, -3]" size="small" /></view>
|
||||
</view>
|
||||
<view class="tab-item active">
|
||||
<text class="tab-text">随访计划</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { onBackPress, onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import dayjs from 'dayjs';
|
||||
import api from '@/api/api.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import dayImg from '@/static/visit_data11.png';
|
||||
import planImg from '@/static/visitplan.png';
|
||||
import lineImg from '@/static/item_visitplan_fg.png';
|
||||
|
||||
const applyList = ref([]);
|
||||
const page = ref(1);
|
||||
const followUpList = ref([]);
|
||||
const followUpLoading = ref(false);
|
||||
const followUpRefreshing = ref(false);
|
||||
const followUpHasMore = ref(true);
|
||||
const followUpPageSize = ref(10);
|
||||
const showAddMenuFlag = ref(false);
|
||||
|
||||
const hasNewPatient = computed(() => applyList.value.length > 0);
|
||||
const formatYearMonth = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('YYYY年MM月') : '';
|
||||
};
|
||||
const formatDay = (input) => {
|
||||
if (!input) return '';
|
||||
const d = dayjs(input);
|
||||
return d.isValid() ? d.format('DD日') : '';
|
||||
};
|
||||
|
||||
const groupedFollowUpList = computed(() => {
|
||||
if (!followUpList.value.length) return [];
|
||||
const groups = new Map();
|
||||
followUpList.value.forEach(item => {
|
||||
const yearMonth = formatYearMonth(item.datetime);
|
||||
if (!groups.has(yearMonth)) groups.set(yearMonth, []);
|
||||
groups.get(yearMonth).push(item);
|
||||
});
|
||||
return Array.from(groups.entries())
|
||||
.map(([yearMonth, items]) => ({
|
||||
yearMonth,
|
||||
items: items.sort((a, b) => new Date(a.datetime) - new Date(b.datetime))
|
||||
}))
|
||||
.sort((a, b) => new Date(a.items[0].datetime) - new Date(b.items[0].datetime));
|
||||
});
|
||||
|
||||
const getApplyList = async () => {
|
||||
try {
|
||||
const res = await api.applyList();
|
||||
if (res && res.code === 200) {
|
||||
applyList.value = res.data || [];
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const getFollowUpList = async (isRefresh = false) => {
|
||||
if (followUpLoading.value) return;
|
||||
followUpLoading.value = true;
|
||||
try {
|
||||
const currentPage = isRefresh ? 1 : page.value;
|
||||
const res = await api.followUpList({
|
||||
page: currentPage,
|
||||
pageSize: followUpPageSize.value
|
||||
});
|
||||
if (res.code === 200) {
|
||||
const newData = res.data.list || [];
|
||||
if (isRefresh) {
|
||||
followUpList.value = newData;
|
||||
page.value = 1;
|
||||
} else {
|
||||
followUpList.value = [...followUpList.value, ...newData];
|
||||
}
|
||||
followUpHasMore.value = newData.length >= followUpPageSize.value;
|
||||
if (!isRefresh) page.value++;
|
||||
}
|
||||
} finally {
|
||||
followUpLoading.value = false;
|
||||
followUpRefreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const onFollowUpRefresh = async () => {
|
||||
followUpRefreshing.value = true;
|
||||
await getFollowUpList(true);
|
||||
uni.showToast({ title: '刷新成功', icon: 'none', duration: 1200 });
|
||||
};
|
||||
const onFollowUpLoadMore = async () => {
|
||||
if (!followUpHasMore.value || followUpLoading.value) return;
|
||||
await getFollowUpList(false);
|
||||
};
|
||||
|
||||
const addFollowUpPlan = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
navTo({ url: '/pages_app/visit/visit?from=patientMsg' });
|
||||
};
|
||||
const addSchedule = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
navTo({ url: '/pages_app/schedule/schedule' });
|
||||
};
|
||||
const showAddMenu = () => {
|
||||
showAddMenuFlag.value = true;
|
||||
};
|
||||
const hideAddMenu = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
};
|
||||
const goFollowDetail = (raw) => {
|
||||
if (!raw) return;
|
||||
navTo({
|
||||
url: `/pages_app/followDetail/followDetail?followUpUuid=${encodeURIComponent(raw.uuid || '')}&patient_name=${raw.patientname}`
|
||||
});
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
plus.runtime.quit();
|
||||
};
|
||||
const goMessageTab = () => {
|
||||
navTo({ url: '/pages_app/patientMsg/patientMsg' });
|
||||
};
|
||||
const goListTab = () => {
|
||||
navTo({ url: '/pages_app/patientMsg/patientList' });
|
||||
};
|
||||
|
||||
onBackPress(() => {
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
onLoad(() => {
|
||||
getApplyList();
|
||||
getFollowUpList(true);
|
||||
});
|
||||
onShow(() => {
|
||||
getApplyList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
height: 100vh;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.save-btn {
|
||||
font-size: 32rpx;
|
||||
color: #8b2316;
|
||||
font-weight: 500;
|
||||
}
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 100rpx;
|
||||
background-color: #f8f8f8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1rpx solid #e0e0e0;
|
||||
z-index: 999;
|
||||
}
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
.tab-item:nth-child(2) {
|
||||
border: 2rpx solid #ccc;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
.tab-item .tab-text {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
.tab-item.active .tab-text {
|
||||
color: #8B2316;
|
||||
font-weight: 500;
|
||||
}
|
||||
.tab-dot {
|
||||
position: absolute;
|
||||
top: 18rpx;
|
||||
right: 28rpx;
|
||||
}
|
||||
.plan {
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 110rpx;
|
||||
}
|
||||
.plan-scroll {
|
||||
height: 100%;
|
||||
}
|
||||
.plan-list {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.plan-group {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.group-header {
|
||||
text-align: left;
|
||||
background: #eee;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
.plan-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 26rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.linebox {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
.left-rail .day {
|
||||
font-size: 36rpx;
|
||||
color: #8B2316;
|
||||
}
|
||||
.right-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.note {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.name {
|
||||
margin-top: 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: #8B2316;
|
||||
}
|
||||
.load-more,
|
||||
.no-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.load-text,
|
||||
.no-more-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.add-menu-popup {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
.menu-content {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.2);
|
||||
width: 80%;
|
||||
max-width: 400rpx;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 48px);
|
||||
right: 20rpx;
|
||||
}
|
||||
.menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 40rpx;
|
||||
}
|
||||
.menu-text {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.menu-divider {
|
||||
height: 1rpx;
|
||||
background-color: #f0f0f0;
|
||||
margin: 0 40rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -16,29 +16,38 @@
|
||||
<view class="contentbox">
|
||||
<view class="form-block">
|
||||
<view class="label">备注</view>
|
||||
<input class="input" v-model.trim="remark" :placeholder="groupInfo.nickname || '给患者添加备注名'" placeholder-class="ph" maxlength="20"/>
|
||||
<input class="input" v-model.trim="remark" :placeholder="groupInfo.nickname || '给患者添加备注名'" placeholder-class="ph" maxlength="20" />
|
||||
</view>
|
||||
<view class="row" v-if="nickname">
|
||||
<view class="left">申请消息为:我是{{ nickname }}</view>
|
||||
<view class="right" @click="fillNickname">
|
||||
填入
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-block" @click="goGroup">
|
||||
<view class="label">分组</view>
|
||||
<view class="label" @click.stop="goGroup">分组</view>
|
||||
<view class="iptbox readonly">
|
||||
<input class="input readonly-input" v-model.trim="groupName" :placeholder="groupInfo.name || '通过分组给患者分类'" placeholder-class="ph" maxlength="20" readonly disabled/>
|
||||
<uni-icons type="right" size="20" color="#666"></uni-icons>
|
||||
<view class="input readonly-input" :class="{'ph':!groupInfo.name}" @click.stop="goGroup">{{groupInfo.name || '通过分组给患者分类'}}</view>
|
||||
<uni-icons type="right" size="20" color="#666" @click.stop="goGroup"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-block">
|
||||
<view class="label">描述</view>
|
||||
<textarea class="textarea" v-model.trim="note" :placeholder="groupInfo.note || '补充患者关键信息,方便随访患者'" placeholder-class="ph" auto-height maxlength="140"/>
|
||||
<view class="textarea-wrap">
|
||||
<textarea class="textarea" v-model.trim="note" :placeholder="groupInfo.note || '补充患者关键信息,方便随访患者'" placeholder-class="ph" auto-height maxlength="100" :adjust-position="false"/>
|
||||
<view class="textarea-count">已输入{{ noteLength }}/100</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-bar">
|
||||
<button class="save-btn" @click="updateNicknameNote">保存</button>
|
||||
<button class="save-btn" :class="{ disabled: isRemarkEmpty }" :disabled="isRemarkEmpty" @click="updateNicknameNote">完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, computed } from 'vue'
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
@@ -48,6 +57,10 @@
|
||||
const patientUuid = ref('')
|
||||
const patientCardData = ref({})
|
||||
const groupInfo = ref({})
|
||||
const noteLength = computed(() => (note.value || '').length)
|
||||
const isRemarkEmpty = computed(() => !(remark.value || '').trim())
|
||||
const nickname = ref('')
|
||||
const tempName=ref('')
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
@@ -60,6 +73,9 @@
|
||||
|
||||
onLoad((options) => {
|
||||
patientUuid.value = options.uuid || ''
|
||||
if(options.nickname){
|
||||
nickname.value = options.nickname
|
||||
}
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
@@ -73,13 +89,14 @@
|
||||
patientCardData.value = res
|
||||
groupInfo.value = res.group || {}
|
||||
// 初始化表单数据
|
||||
remark.value = res.group?.nickname || ''
|
||||
remark.value = res.group?.nickname || remark.value
|
||||
note.value = res.group?.note || ''
|
||||
groupName.value = res.group?.name || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
const updateNicknameNote = async() => {
|
||||
if (isRemarkEmpty.value) return
|
||||
const res = await api.updateNicknameNote({
|
||||
patient_uuid: patientUuid.value,
|
||||
nickname: remark.value,
|
||||
@@ -100,16 +117,41 @@
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
setTimeout(() => goBack(), 700)
|
||||
}
|
||||
const fillNickname = () => {
|
||||
remark.value = nickname.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.row{
|
||||
margin-top: -20rpx;
|
||||
display: flex;
|
||||
background: #fff;
|
||||
padding:0 30rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.left{
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.right{
|
||||
font-size: 32rpx;
|
||||
color: #3ec7c0;
|
||||
}
|
||||
}
|
||||
.contentbox{
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 140rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
}
|
||||
.remark-page{
|
||||
height: 100vh;
|
||||
background: #f7f7f7;
|
||||
padding-bottom: 140rpx;
|
||||
|
||||
}
|
||||
.form-block{
|
||||
.iptbox{
|
||||
@@ -138,18 +180,33 @@
|
||||
color: #333;
|
||||
&.readonly-input {
|
||||
background: transparent;
|
||||
color: #999;
|
||||
color: #333;
|
||||
}
|
||||
&.ph{
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
.textarea{
|
||||
background: #f8f8f8;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx;
|
||||
padding: 24rpx 24rpx 58rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
min-height: 180rpx;
|
||||
min-height: 250rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.textarea-wrap{
|
||||
position: relative;
|
||||
}
|
||||
.textarea-count{
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 16rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
.ph{
|
||||
color: #bfbfbf;
|
||||
}
|
||||
@@ -159,18 +216,22 @@
|
||||
left: 0; right: 0; bottom: 0;
|
||||
background: #ffffff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
padding: 20rpx 24rpx env(safe-area-inset-bottom);
|
||||
padding: 20rpx 24rpx 20rpx;
|
||||
.save-btn{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 92rpx;
|
||||
background: #8B2316;
|
||||
background: #3ec7c0;
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 12rpx;
|
||||
font-size: 32rpx;
|
||||
&.disabled{
|
||||
background: #d9d9d9;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="cell" @click="goGroup">
|
||||
<view class="cell" @click="goRemark">
|
||||
<text class="cell-left">设置分组</text>
|
||||
<view class="cell-right">
|
||||
<text class="cell-desc">{{ groupInfo.name || '通过分组给患者分类' }}</text>
|
||||
@@ -53,11 +53,12 @@
|
||||
<uni-icons type="right" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="danger-action">
|
||||
<button class="danger-btn" @click="visible=true">解除随访</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="danger-block">
|
||||
<text class="danger-text" @click="visible=true">解除随访</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<unidialog :visible="visible" :content="message" @close="visible=false" @confirm="deleteFollowUp" ></unidialog>
|
||||
</template>
|
||||
@@ -65,7 +66,7 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow,onBackPress} from '@dcloudio/uni-app'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
import api from '@/api/api.js'
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
@@ -75,8 +76,19 @@
|
||||
const groupInfo = ref({})
|
||||
const visible = ref(false)
|
||||
const message = ref('')
|
||||
const from = ref('');
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
const goRemark = () => {
|
||||
navTo({ url: '/pages_app/patientRemark/patientRemark?uuid=' + patientUuid.value })
|
||||
@@ -87,6 +99,9 @@
|
||||
}
|
||||
onLoad((options) => {
|
||||
patientUuid.value = options.uuid;
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
console.log(patientUuid.value)
|
||||
})
|
||||
onShow(() => {
|
||||
@@ -108,8 +123,10 @@
|
||||
patient_uuid: patientUuid.value
|
||||
}).then(res => {
|
||||
if(res.code == 200){
|
||||
patientName.value = res.group.nickname || res.patient.realName
|
||||
message.value = `解除[${patientName.value}]的随访关系?`
|
||||
console.log(res.patient)
|
||||
patientName.value = res.patient.nickname?res.patient.nickname:res.patient.realname;
|
||||
console.log(patientName.value)
|
||||
message.value = `确认解除[${patientName.value}]的随访关系?`
|
||||
patientCardData.value = res
|
||||
groupInfo.value = res.group || {}
|
||||
}
|
||||
@@ -124,9 +141,9 @@
|
||||
title: '解除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.redirectTo({
|
||||
url: '/pages_app/patientMsg/patientMsg'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
visible.value = false
|
||||
})
|
||||
@@ -143,7 +160,7 @@
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
bottom: 0rpx;
|
||||
background: #fff;
|
||||
.cell{
|
||||
display: flex;
|
||||
@@ -160,22 +177,41 @@
|
||||
.cell-right{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
justify-content: flex-end;
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
min-width: 0;
|
||||
|
||||
.cell-desc{
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
margin-right: 16rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.danger-block{
|
||||
margin-top: 30rpx;
|
||||
.danger-action{
|
||||
margin-top: 30rpx;
|
||||
background: #fff;
|
||||
padding: 40rpx 0;
|
||||
|
||||
padding: 20rpx 30rpx calc(20rpx + env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.align-center{ align-items: center; }
|
||||
.danger-text{
|
||||
.danger-btn{
|
||||
width: 100%;
|
||||
height: 92rpx;
|
||||
line-height: 92rpx;
|
||||
border: 1rpx solid #8B2316;
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
color: #8B2316;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
const videoId = video.id || video.uuid;
|
||||
|
||||
navTo({
|
||||
url: `/pages_app/videoDetail/videoDetail?id=${videoId}`
|
||||
url: `/pages_app/videoDetail/videoDetail?id=${videoId}&type=patientVideo`
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+14
-4
@@ -113,17 +113,17 @@
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="pptVisible"
|
||||
:showCancel="false"
|
||||
:showConfirm="true"
|
||||
:confirmText="'知道了'"
|
||||
:cancelText="'取消'"
|
||||
:confirmText="'保存二维码'"
|
||||
@close="pptVisible=false"
|
||||
@confirm="pptConfirm"
|
||||
>
|
||||
<template v-slot:content>
|
||||
<view class="ppt-content">
|
||||
<image :src="contactImg" width="80rpx" height="80rpx" class="contact-img" @longpress.stop.prevent="saveContactImgToAlbum"></image>
|
||||
<image :src="contactImg" width="80rpx" height="80rpx" class="contact-img"></image>
|
||||
<view class="ppt-content-title">
|
||||
<text style="color:#666">APP下载课件为pdf格式,扫码联系平台文献助手获取原版PPT。</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -160,6 +160,7 @@
|
||||
const page = ref(1);
|
||||
const pageSize = ref(10);
|
||||
const pptConfirm=()=>{
|
||||
saveContactImgToAlbum();
|
||||
pptVisible.value=false;
|
||||
//feedBack();
|
||||
}
|
||||
@@ -224,6 +225,15 @@
|
||||
|
||||
checkUser();
|
||||
loadData(false);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "肝胆课件",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
})
|
||||
const goSearch = () => {
|
||||
uni.sendNativeEvent(
|
||||
|
||||
@@ -153,6 +153,7 @@ import isAndroid from "@/utils/platform.js";
|
||||
const isFirstDownload = ref(false);
|
||||
const path=ref('');
|
||||
const from=ref('');
|
||||
const tags = ref('');
|
||||
const pptVisible = ref(false);
|
||||
const nativeDownloadMaskView = ref(null);
|
||||
const nativeDownloadPopupView = ref(null);
|
||||
@@ -168,7 +169,8 @@ const nativeDownloadPopupInfo = ref({
|
||||
imageLeft: 0,
|
||||
imageSize: 0,
|
||||
buttonTop: 0,
|
||||
buttonH: 0
|
||||
buttonH: 0,
|
||||
leftButtonW: 0
|
||||
});
|
||||
let downloadLongPressTimer = null;
|
||||
let downloadLongPressTriggered = false;
|
||||
@@ -289,6 +291,7 @@ function createNativeDownloadPopup() {
|
||||
const dialogTop = Math.round((screenH - dialogH) / 2);
|
||||
const buttonH = uni.upx2px(96);
|
||||
const buttonTop = dialogH - buttonH;
|
||||
const leftButtonW = Math.round(dialogW / 2);
|
||||
const titleTop = uni.upx2px(46);
|
||||
const imageSize = uni.upx2px(280);
|
||||
const imageTop = titleTop + uni.upx2px(72);
|
||||
@@ -306,7 +309,8 @@ function createNativeDownloadPopup() {
|
||||
imageLeft,
|
||||
imageSize,
|
||||
buttonTop,
|
||||
buttonH
|
||||
buttonH,
|
||||
leftButtonW
|
||||
};
|
||||
|
||||
nativeDownloadMaskView.value = new plus.nativeObj.View('native-download-mask', {
|
||||
@@ -394,10 +398,29 @@ function createNativeDownloadPopup() {
|
||||
height: '1px'
|
||||
});
|
||||
|
||||
nativeDownloadPopupView.value.drawText('知道了', {
|
||||
nativeDownloadPopupView.value.drawRect({ color: '#F0F0F0' }, {
|
||||
left: leftButtonW + 'px',
|
||||
top: buttonTop + 'px',
|
||||
width: '1px',
|
||||
height: buttonH + 'px'
|
||||
});
|
||||
|
||||
nativeDownloadPopupView.value.drawText('取消', {
|
||||
left: '0px',
|
||||
top: buttonTop + 'px',
|
||||
width: dialogW + 'px',
|
||||
width: leftButtonW + 'px',
|
||||
height: buttonH + 'px'
|
||||
}, {
|
||||
size: uni.upx2px(32) + 'px',
|
||||
color: '#666666',
|
||||
align: 'center',
|
||||
verticalAlign: 'middle'
|
||||
});
|
||||
|
||||
nativeDownloadPopupView.value.drawText('保存二维码', {
|
||||
left: leftButtonW + 'px',
|
||||
top: buttonTop + 'px',
|
||||
width: (dialogW - leftButtonW) + 'px',
|
||||
height: buttonH + 'px'
|
||||
}, {
|
||||
size: uni.upx2px(32) + 'px',
|
||||
@@ -433,18 +456,25 @@ function createNativeDownloadPopup() {
|
||||
downloadLongPressTriggered = false;
|
||||
return;
|
||||
}
|
||||
const { relativeY } = point;
|
||||
const { relativeX, relativeY } = point;
|
||||
if (relativeY >= info.buttonTop) {
|
||||
closeNativeDownloadPopup();
|
||||
if (relativeX >= info.leftButtonW) {
|
||||
// 点击“保存二维码”
|
||||
saveNativePopupImageToAlbum();
|
||||
closeNativeDownloadPopup();
|
||||
} else {
|
||||
// 点击“取消”
|
||||
closeNativeDownloadPopup();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
nativeDownloadMaskView.value.addEventListener('click', handleDownloadMaskClick, false);
|
||||
nativeDownloadMaskView.value.addEventListener('touchstart', handleDownloadMaskClick, false);
|
||||
nativeDownloadPopupView.value.addEventListener('click', handleDownloadPanelClick, false);
|
||||
nativeDownloadPopupView.value.addEventListener('touchstart', handleDownloadPanelTouchStart, false);
|
||||
nativeDownloadPopupView.value.addEventListener('touchend', handleDownloadPanelTouchEnd, false);
|
||||
nativeDownloadPopupView.value.addEventListener('touchcancel', handleDownloadPanelTouchEnd, false);
|
||||
// nativeDownloadPopupView.value.addEventListener('touchstart', handleDownloadPanelTouchStart, false);
|
||||
// nativeDownloadPopupView.value.addEventListener('touchend', handleDownloadPanelTouchEnd, false);
|
||||
// nativeDownloadPopupView.value.addEventListener('touchcancel', handleDownloadPanelTouchEnd, false);
|
||||
// #endif
|
||||
}
|
||||
|
||||
@@ -611,7 +641,7 @@ onShow(() => {
|
||||
console.log('canDownload');
|
||||
console.log(canDownload.value);
|
||||
if(!canDownload.value){
|
||||
ganDanFileDetials();
|
||||
ganDanFileDetials(true);
|
||||
}else{
|
||||
if(!hasDownload.value){
|
||||
downloadGanDanFile('auto');
|
||||
@@ -894,8 +924,6 @@ function createNativePopup() {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -962,6 +990,17 @@ const collection = () => {
|
||||
title: "收藏成功",
|
||||
icon: "none",
|
||||
});
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "collect",
|
||||
page_type: "肝胆课件",
|
||||
resource_name:shareTitle.value,
|
||||
resource_option: tags.value,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
ganDanFileDetials();
|
||||
}
|
||||
});
|
||||
@@ -1125,19 +1164,45 @@ const downLoadByType=()=>{
|
||||
const downloadGanDanFile = (type) => {
|
||||
showPptDownloadTip();
|
||||
let order_id='';
|
||||
let event_val=0;
|
||||
let event_unit='分';
|
||||
if(type=='free'){
|
||||
order_id='FREE';
|
||||
event_val=0;
|
||||
|
||||
} else if(type=='welfare'){
|
||||
order_id='USEWELFARENUM';
|
||||
event_val=0;
|
||||
|
||||
}else if(type=='freeRecord'){
|
||||
order_id='FREERECORD';
|
||||
event_val=0;
|
||||
|
||||
}else if(type=="auto"){
|
||||
order_id= orderId.value;
|
||||
event_val=orderInfo.value.price;
|
||||
|
||||
}else if(type=="reDownload"){
|
||||
order_id=orderInfo.value.order.order_id+"&R";
|
||||
event_val=0;
|
||||
|
||||
}
|
||||
|
||||
console.log('1218');
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "order_gdfile_download",
|
||||
page_type: "肝胆课件",
|
||||
resource_name:shareTitle.value,
|
||||
resource_option: tags.value,
|
||||
event_val:event_val,
|
||||
event_unit:'分',
|
||||
number:1,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
api.downloadGanDanFileV2({
|
||||
file_uuid: uuid.value,
|
||||
order_id: order_id,
|
||||
@@ -1281,11 +1346,13 @@ const base64ToFile=(base64Str, fileName, callback)=>{
|
||||
|
||||
|
||||
|
||||
const ganDanFileDetials = async () => {
|
||||
const ganDanFileDetials = async (flag = false) => {
|
||||
const res = await api.ganDanFileDetials({
|
||||
file_uuid: uuid.value,
|
||||
});
|
||||
if (res.code == 200) {res.data
|
||||
if (res.code == 200) {
|
||||
tags.value = res.data.tags?res.data.tags:'';
|
||||
|
||||
orderInfo.value = res.data;
|
||||
// 设置分享文案
|
||||
shareTitle.value = res.data.name;
|
||||
@@ -1297,7 +1364,23 @@ const ganDanFileDetials = async () => {
|
||||
order.value = res.data.order;
|
||||
let money = res.data.price/ 100;
|
||||
price.value = money > 1 ? money.toFixed(1) : money.toFixed(2);
|
||||
if(flag){
|
||||
try {
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: "肝胆课件",
|
||||
resource_name:res.data.name,
|
||||
resource_option: tags.value,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
downloadTasks.value.forEach(item => {
|
||||
if (item.id == uuid.value) {
|
||||
uni.getSavedFileInfo({
|
||||
@@ -1449,6 +1532,17 @@ const resumeDownloadingTasks = () => {
|
||||
// ===== 分享到微信 =====
|
||||
const shareToWechat = () => {
|
||||
// #ifdef APP-PLUS
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "肝胆课件",
|
||||
resource_name:shareTitle.value,
|
||||
resource_option: tags.value,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
uni.downloadFile({
|
||||
url: 'https://doc.igandan.com/app/html/img/2016/20160714132557.png',
|
||||
success: function (res) {
|
||||
@@ -1531,6 +1625,17 @@ const shareToWechat = () => {
|
||||
// ===== 分享到朋友圈 =====
|
||||
const shareToMoments = () => {
|
||||
// #ifdef APP-PLUS
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "肝胆课件",
|
||||
resource_name:shareTitle.value,
|
||||
resource_option: tags.value,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
uni.downloadFile({
|
||||
url: 'https://doc.igandan.com/app/html/img/2016/20160714132557.png',
|
||||
success: function (res) {
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
<textarea
|
||||
class="form-textarea"
|
||||
type="text"
|
||||
:adjust-position="false"
|
||||
placeholder="不支持关键字/广泛查询"
|
||||
v-model="literature.literatureName"
|
||||
/>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<textarea
|
||||
class="reply-input"
|
||||
v-model="replyText"
|
||||
:adjust-position="false"
|
||||
:placeholder="placeholder"
|
||||
:auto-height="true"
|
||||
:maxlength="maxLength"
|
||||
@@ -75,15 +76,18 @@ const addCommentV2=async()=>{
|
||||
comment:replyText.value+'||'+name.value+':'+comment_partent.value
|
||||
})
|
||||
if(res.code==200){
|
||||
uni.$emit('replySuccess',true);
|
||||
console.log('replySuccess')
|
||||
uni.showToast({ title: '回复成功', icon: 'none' })
|
||||
replyText.value = '';
|
||||
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
// 清理工作
|
||||
console.log('回复页面已卸载')
|
||||
//console.log('回复页面已卸载')
|
||||
})
|
||||
|
||||
// 方法
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
<view class="section-content">
|
||||
<text class="content-text">{{ selectedPatient || '请选择患者' }}</text>
|
||||
<uni-icons type="right" class ="icon" size="20" color="#999"></uni-icons>
|
||||
<uni-icons type="right" class ="icon" size="20" color="#999" v-if="type != 'patientDetail'"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
v-model="followUpContent"
|
||||
placeholder="请输入随访内容"
|
||||
:maxlength="500"
|
||||
:adjust-position="false"
|
||||
auto-height
|
||||
></textarea>
|
||||
</view>
|
||||
@@ -80,7 +81,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-overlay :show="show">
|
||||
<up-overlay :show="show">
|
||||
<view class="warp">
|
||||
|
||||
<view class="calendarbox">
|
||||
@@ -94,17 +95,17 @@
|
||||
<uni-calendar class="uni-calendar--hook" @change="change" @monthSwitch="monthSwitch" />
|
||||
<view class="calendarbottom">
|
||||
<view class="cancel" @click="show=false">取消</view>
|
||||
<view class="ok">确定</view>
|
||||
<view class="ok" @click="confirmDate">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
</up-overlay>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import { onShow,onLoad } from "@dcloudio/uni-app";
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import api from '@/api/api.js';
|
||||
// 表单数据
|
||||
@@ -118,10 +119,25 @@
|
||||
const headerYear = ref('');
|
||||
const headerDay = ref('');
|
||||
const patientUuid = ref('');
|
||||
let tempDate=('');
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
const patientName = ref('')
|
||||
const type = ref('')
|
||||
onLoad((options) => {
|
||||
if(options.uuid){
|
||||
patientUuid.value = options.uuid
|
||||
}
|
||||
if(options.patient_name){
|
||||
selectedPatient.value = options.patient_name
|
||||
}
|
||||
if(options.type){
|
||||
type.value = options.type
|
||||
}
|
||||
})
|
||||
const addFollowUps=()=>{
|
||||
api.addFollowUps({
|
||||
patient_uuid: patientUuid.value,
|
||||
@@ -138,6 +154,12 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const confirmDate=()=>{
|
||||
selectedDate.value = tempDate;
|
||||
//visits.value[dealIndex.value].date = tempDate.value;
|
||||
show.value=false;
|
||||
}
|
||||
// 提交日程
|
||||
const submitSchedule = () => {
|
||||
if (!selectedPatient.value) {
|
||||
@@ -152,7 +174,10 @@
|
||||
|
||||
// 选择患者
|
||||
const selectPatient = () => {
|
||||
navTo({
|
||||
if(type.value == 'patientDetail'){
|
||||
return
|
||||
}else{
|
||||
navTo({
|
||||
url:'/pages_app/selectPatientSingle/selectPatientSingle',
|
||||
events: {
|
||||
onPatientsSelected: (data) => {
|
||||
@@ -161,6 +186,8 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 选择日期
|
||||
@@ -196,7 +223,8 @@
|
||||
headerYear.value = `${y}年`;
|
||||
headerDay.value = `${m}月${dd}日周${w}`;
|
||||
datetime.value = `${y}-${m}-${dd}`;
|
||||
selectedDate.value = `${y}年${m}月${dd}日(星期${w})`;
|
||||
//selectedDate.value = `${y}年${m}月${dd}日(星期${w})`;
|
||||
tempDate= `${y}年${m}月${dd}日(星期${w})`;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
<template>
|
||||
<view class="select-page">
|
||||
|
||||
<navBar title="搜索患者" />
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="搜索患者"
|
||||
@clickLeft="goBack"
|
||||
|
||||
color="#8B2316"
|
||||
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-bar">
|
||||
@@ -19,6 +33,7 @@
|
||||
<image class="avatar" :src="docUrl + (p.photo || '')" mode="aspectFill" />
|
||||
<view class="name">{{ p.nickname || p.realName }}</view>
|
||||
</view>
|
||||
<empty v-if="availablePatientList.length == 0" :emptyDesc="'暂无搜索结果'"></empty>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -26,29 +41,38 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import { onShow,onLoad} from "@dcloudio/uni-app";
|
||||
import { onShow,onLoad,onBackPress} from "@dcloudio/uni-app";
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
const from = ref('');
|
||||
const keyword = ref('')
|
||||
const patientList = ref([])
|
||||
const availablePatientList = ref([])
|
||||
// 计算属性:显示所有患者,但标记已选中的状态
|
||||
const availablePatientList = computed(() => {
|
||||
return patientList.value
|
||||
})
|
||||
// const availablePatientList = computed(() => {
|
||||
// return patientList.value
|
||||
// })
|
||||
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
const patientListByGBK = async () => {
|
||||
|
||||
const res = await api.patientListByGBK();
|
||||
if(res.code == 1){
|
||||
patientList.value = res.data;
|
||||
availablePatientList.value = res.data;
|
||||
}
|
||||
};
|
||||
onLoad((options) => {
|
||||
if(options.from == 'chatMsg'){
|
||||
from.value = 'chatMsg';
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
|
||||
})
|
||||
onShow(() => {
|
||||
patientListByGBK();
|
||||
@@ -58,13 +82,19 @@
|
||||
|
||||
|
||||
const goDetail = (uuid) => {
|
||||
navTo({ url: `/pages_app/patientDetail/patientDetail?uuid=${uuid}` })
|
||||
navTo({ url: `/pages_app/patientDetail/patientDetail?uuid=${uuid}&from=searchPatient`})
|
||||
}
|
||||
|
||||
const onSearch = () => {
|
||||
patientList.value = patientList.value.filter(p => p.realName.indexOf(keyword.value) !== -1 || (p.nickname && p.nickname.indexOf(keyword.value) !== -1) || p.mobile.indexOf(keyword.value) !== -1)
|
||||
availablePatientList.value = patientList.value.filter(p => p.realName.indexOf(keyword.value) !== -1 || (p.nickname && p.nickname.indexOf(keyword.value) !== -1) || p.mobile.indexOf(keyword.value) !== -1)
|
||||
}
|
||||
const goBack = () => uni.navigateBack()
|
||||
const goBack = () => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -75,8 +105,12 @@ const goDetail = (uuid) => {
|
||||
.confirm-btn{ background:#7f7f7f; padding: 10rpx 18rpx; border-radius: 26rpx; }
|
||||
.confirm-btn.active{ background:#8B2316; }
|
||||
.search-bar{
|
||||
position: fixed;
|
||||
left:30rpx;
|
||||
right:30rpx;
|
||||
top:calc(var(--status-bar-height) + 44px);
|
||||
border: 2rpx solid #eee;
|
||||
margin: 20rpx 30rpx; display:flex; align-items:center; gap: 16rpx;
|
||||
margin: 20rpx 0rpx; display:flex; align-items:center; gap: 16rpx;
|
||||
.input-wrap{ flex:1; background:#fff; border-radius: 12rpx; padding: 16rpx 20rpx; }
|
||||
.search-input{ font-size: 28rpx; color:#333; }
|
||||
.ph{ color:#bfbfbf; }
|
||||
@@ -87,7 +121,14 @@ const goDetail = (uuid) => {
|
||||
width: 88rpx; height: 72rpx; background:#fff;
|
||||
}
|
||||
}
|
||||
.list{ border-radius: 12rpx; }
|
||||
.list{
|
||||
border-radius: 12rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: calc(var(--status-bar-height) + 44px + 115rpx);
|
||||
bottom: 0rpx;
|
||||
}
|
||||
.item{background:#fff; display:flex; align-items:center;padding: 24rpx 30rpx; border-bottom: 2rpx solid #eee; }
|
||||
.avatar{ width: 96rpx; height:96rpx; border-radius: 16rpx; background:#ffe; }
|
||||
.name{ flex:1; margin-left: 20rpx; font-size: 32rpx; color:#333; }
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<view class="select-page">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="选择患者"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
<template #right>
|
||||
<view class="confirm-btn" :class="{ active: selectedIds.length > 0 }" @click="confirmSelect">
|
||||
<text class="confirm-text">确定({{ selectedIds.length }})</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-bar">
|
||||
<view class="input-wrap">
|
||||
<input class="search-input" v-model.trim="keyword" placeholder="搜索患者的备注名、昵称或手机号" placeholder-class="ph" @input="$u.debounce(onSearch, 500)" />
|
||||
</view>
|
||||
<view class="search-btn" @click="onSearch">
|
||||
<uni-icons type="search" size="50rpx" color="#999" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view class="list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100">
|
||||
<view class="item" @click="toggle(p.uuid)" v-for="p in availablePatientList" :key="p.uuid">
|
||||
<image class="avatar" :src="getAvatarSrc(p)" mode="aspectFill" @error="handleAvatarError(p)" />
|
||||
<view class="name">{{ p.realName || p.nickname}}</view>
|
||||
<view class="check" >
|
||||
<view class="circle" :class="{ active: selectedIds.includes(p.uuid) }"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="bottom-actions">
|
||||
<view class="select-all-btn" @click="toggleSelectAll">
|
||||
{{ isAllSelected ? '全不选' : '全选' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed,nextTick} from 'vue'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import { onShow,onLoad} from "@dcloudio/uni-app";
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import defaultImg from "@/static/default.png"
|
||||
const from = ref('');
|
||||
const keyword = ref('')
|
||||
const selectedIds = ref([])
|
||||
const patientList = ref([])
|
||||
const selectedDetail = ref([])
|
||||
const availablePatientList = ref([])
|
||||
const patientListPage = ref(1)
|
||||
const patientListPageSize = ref(200)
|
||||
const patientListHasMore = ref(true)
|
||||
const patientListLoading = ref(false)
|
||||
const patientListLoadingMore = ref(false)
|
||||
const isAllSelected = computed(() => {
|
||||
const total = patientList.value.length
|
||||
return total > 0 && selectedIds.value.length === total
|
||||
})
|
||||
// 计算属性:显示所有患者,但标记已选中的状态
|
||||
// const availablePatientList = computed(() => {
|
||||
// return patientList.value
|
||||
// })
|
||||
const isApiSuccess = (res) => Number(res?.code) === 1 || Number(res?.code) === 200
|
||||
const parsePagedPatients = (res) => {
|
||||
const data = res?.data
|
||||
if (Array.isArray(data)) {
|
||||
return { list: data, total: undefined, pageNum: undefined, pages: undefined, isLastPage: undefined }
|
||||
}
|
||||
const list =
|
||||
(Array.isArray(data?.list) && data.list) ||
|
||||
(Array.isArray(data?.records) && data.records) ||
|
||||
(Array.isArray(data?.rows) && data.rows) ||
|
||||
(Array.isArray(data?.data) && data.data) ||
|
||||
[]
|
||||
const total = Number(data?.total ?? data?.count ?? data?.totalCount ?? undefined)
|
||||
const pageNum = Number(data?.pageNum ?? data?.page ?? data?.current ?? undefined)
|
||||
const pages = Number(data?.pages ?? data?.pageCount ?? undefined)
|
||||
const isLastPage = typeof data?.isLastPage === 'boolean' ? data.isLastPage : undefined
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : undefined,
|
||||
pageNum: Number.isFinite(pageNum) ? pageNum : undefined,
|
||||
pages: Number.isFinite(pages) ? pages : undefined,
|
||||
isLastPage
|
||||
}
|
||||
}
|
||||
const mergePatientListUnique = (base = [], incoming = []) => {
|
||||
if (!incoming.length) return base
|
||||
const seen = new Set()
|
||||
const merged = []
|
||||
const pushUnique = (item) => {
|
||||
const key = String(item?.uuid || item?.id || item?.mobile || '')
|
||||
if (!key) {
|
||||
merged.push(item)
|
||||
return
|
||||
}
|
||||
if (seen.has(key)) return
|
||||
seen.add(key)
|
||||
merged.push(item)
|
||||
}
|
||||
base.forEach(pushUnique)
|
||||
incoming.forEach(pushUnique)
|
||||
return merged
|
||||
}
|
||||
const applyPatientList = (list = []) => {
|
||||
patientList.value = list
|
||||
onSearch()
|
||||
}
|
||||
const patientListByGBKPage = async ({ reset = false, showLoading = false } = {}) => {
|
||||
if (patientListLoading.value || patientListLoadingMore.value) return
|
||||
if (!reset && !patientListHasMore.value) return
|
||||
if (reset) {
|
||||
patientListLoading.value = true
|
||||
patientListPage.value = 1
|
||||
patientListHasMore.value = true
|
||||
} else {
|
||||
patientListLoadingMore.value = true
|
||||
}
|
||||
if (showLoading) {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
}
|
||||
try {
|
||||
const requestPage = patientListPage.value
|
||||
const res = await api.patientListByGBKPage({
|
||||
page: requestPage,
|
||||
//pageNum: requestPage,
|
||||
//current: requestPage,
|
||||
pageSize: patientListPageSize.value,
|
||||
//size: patientListPageSize.value
|
||||
})
|
||||
if (!isApiSuccess(res)) return
|
||||
const { list, total, pageNum, pages, isLastPage } = parsePagedPatients(res)
|
||||
const merged = reset ? list : mergePatientListUnique(patientList.value, list)
|
||||
applyPatientList(merged)
|
||||
if (typeof isLastPage === 'boolean') {
|
||||
patientListHasMore.value = !isLastPage
|
||||
} else if (typeof pages === 'number' && typeof pageNum === 'number') {
|
||||
patientListHasMore.value = pageNum < pages
|
||||
} else if (typeof total === 'number') {
|
||||
patientListHasMore.value = merged.length < total
|
||||
} else {
|
||||
patientListHasMore.value = list.length >= patientListPageSize.value
|
||||
}
|
||||
if (patientListHasMore.value) {
|
||||
patientListPage.value = typeof pageNum === 'number' ? pageNum + 1 : requestPage + 1
|
||||
}
|
||||
} finally {
|
||||
patientListLoading.value = false
|
||||
patientListLoadingMore.value = false
|
||||
if (showLoading) {
|
||||
nextTick(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
const onScrollToLower = () => {
|
||||
void patientListByGBKPage({ reset: false, showLoading: false })
|
||||
}
|
||||
onLoad((options) => {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
if(options.from ){
|
||||
from.value =options.from;
|
||||
}
|
||||
// 读取已选中的成员ID
|
||||
try {
|
||||
const preSelected = uni.getStorageSync('preSelectedIds')
|
||||
if (Array.isArray(preSelected)) {
|
||||
selectedIds.value = [...preSelected]
|
||||
// 清理缓存
|
||||
uni.removeStorageSync('preSelectedIds')
|
||||
}
|
||||
} catch (e) {}
|
||||
void patientListByGBKPage({ reset: true, showLoading: true });
|
||||
})
|
||||
onShow(() => {
|
||||
|
||||
|
||||
// 根据已选中的ID更新selectedDetail
|
||||
updateSelectedDetail();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 根据已选中的ID更新selectedDetail
|
||||
const updateSelectedDetail = () => {
|
||||
selectedDetail.value = selectedIds.value.map(id => {
|
||||
const p = patientList.value.find(x => x.uuid === id)
|
||||
return { uuid: id, realName: p?.realName || '', photo: p?.photo || '',nickName: p?.nickName || '' }
|
||||
})
|
||||
}
|
||||
|
||||
const toggle = (id) => {
|
||||
const i = selectedIds.value.indexOf(id)
|
||||
if (i > -1) {
|
||||
// 如果已选中,则取消选中
|
||||
selectedIds.value.splice(i, 1)
|
||||
const di = selectedDetail.value.findIndex(it => it.uuid === id)
|
||||
if (di > -1) selectedDetail.value.splice(di, 1)
|
||||
} else {
|
||||
// 如果未选中,则选中
|
||||
selectedIds.value.push(id)
|
||||
const p = patientList.value.find(x => x.uuid === id)
|
||||
selectedDetail.value.push({ uuid: id, realName: p?.realName || '', photo: p?.photo || '',nickName: p?.nickName || '' })
|
||||
}
|
||||
}
|
||||
|
||||
const getAvatarSrc = (patient) => {
|
||||
if (patient?._avatarLoadError) return defaultImg
|
||||
return patient?.photo ? (docUrl + patient.photo) : defaultImg
|
||||
}
|
||||
|
||||
const handleAvatarError = (patient) => {
|
||||
if (!patient) return
|
||||
patient._avatarLoadError = true
|
||||
}
|
||||
|
||||
const toggleSelectAll = () => {
|
||||
if (!patientList.value.length) return
|
||||
if (isAllSelected.value) {
|
||||
selectedIds.value = []
|
||||
selectedDetail.value = []
|
||||
return
|
||||
}
|
||||
selectedIds.value = patientList.value.map(item => item.uuid)
|
||||
selectedDetail.value = patientList.value.map(item => ({
|
||||
uuid: item.uuid,
|
||||
realName: item?.realName || '',
|
||||
photo: item?.photo || '',
|
||||
nickName: item?.nickName || ''
|
||||
}))
|
||||
}
|
||||
|
||||
const onSearch = () => {
|
||||
if(keyword.value.replace(/\s/g, "")){
|
||||
availablePatientList.value = patientList.value.filter(p => p.realName.indexOf(keyword.value) !== -1 || (p.nickname && p.nickname.indexOf(keyword.value) !== -1) || p.mobile.indexOf(keyword.value) !== -1)
|
||||
}else{
|
||||
availablePatientList.value = patientList.value
|
||||
}
|
||||
|
||||
}
|
||||
const goBack = () => uni.navigateBack()
|
||||
const confirmSelect = () => {
|
||||
if(from.value == 'chatMsg' || from.value == 'videoDetail'){
|
||||
if(selectedIds.value.length >200){
|
||||
uni.showToast({
|
||||
title: '选择人数不能超过200',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
const payload = { ids: selectedIds.value, list: selectedDetail.value }
|
||||
// 通过事件通道回传
|
||||
try {
|
||||
const pages = getCurrentPages()
|
||||
const curr = pages[pages.length - 1]
|
||||
const ec = curr?.getOpenerEventChannel?.()
|
||||
ec?.emit && ec.emit('onPatientsSelected', payload);
|
||||
console.log(selectedDetail.value)
|
||||
uni.$emit('selectedChatPatientsSingle', {patients: selectedDetail.value });
|
||||
} catch (e) {}
|
||||
// 兜底:使用本地存储
|
||||
try {
|
||||
uni.setStorageSync('patientsSelectedPayload', payload) } catch (e) {}
|
||||
uni.setStorageSync('selectedChatPatientsSingle', {patients: selectedDetail.value })
|
||||
if(from.value == 'chatMsg'){
|
||||
navTo({
|
||||
url: '/pages_chat/groupSend/groupSend?from=chatMsg'
|
||||
})
|
||||
}else{
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.select-page{
|
||||
min-height: 100vh; background:#fefefe;overflow: hidden;
|
||||
}
|
||||
.confirm-text{ color:#fff; font-size: 28rpx;white-space: nowrap; }
|
||||
.confirm-btn{ background:#7f7f7f; padding: 10rpx 18rpx; border-radius: 26rpx; }
|
||||
.confirm-btn.active{ background:#8B2316; }
|
||||
.search-bar{
|
||||
|
||||
border: 2rpx solid #eee;
|
||||
margin: 0rpx 30rpx; display:flex;
|
||||
margin-top: calc(var(--status-bar-height) + 64px);
|
||||
align-items:center; gap: 16rpx;
|
||||
.input-wrap{ flex:1; background:#fff; border-radius: 12rpx; padding: 16rpx 20rpx; }
|
||||
.search-input{ font-size: 28rpx; color:#333; }
|
||||
.ph{ color:#bfbfbf; }
|
||||
.search-btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 88rpx; height: 72rpx; background:#fff;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
border-radius: 12rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: calc(var(--status-bar-height) + 64px + 94rpx);
|
||||
bottom: 130rpx;
|
||||
}
|
||||
.item{background:#fff; display:flex; align-items:center;padding: 24rpx 30rpx; border-bottom: 2rpx solid #eee; }
|
||||
.avatar{ width: 96rpx; height:96rpx; border-radius: 16rpx; background:#ffe; }
|
||||
.name{ flex:1; margin-left: 20rpx; font-size: 32rpx; color:#333; }
|
||||
.check{ padding-left: 12rpx; }
|
||||
.circle{ width: 40rpx; height: 40rpx; border-radius: 50%; border: 2rpx solid #cfcfcf; }
|
||||
.circle.active{ background:#8B2316; border-color:#8B2316; position: relative; }
|
||||
.circle.active::after{ content:''; position:absolute; left: 14rpx; top: 6rpx; width: 10rpx; height: 18rpx; border: 4rpx solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }
|
||||
.bottom-actions{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
padding: 20rpx 30rpx 20rpx;
|
||||
}
|
||||
.select-all-btn{
|
||||
height: 88rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #8B2316;
|
||||
background: #fff;
|
||||
border: 2rpx solid #8B2316;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -29,57 +29,154 @@
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<scroll-view class="list" scroll-y>
|
||||
<scroll-view class="list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100">
|
||||
<view class="item" @click="toggle(p.uuid)" v-for="p in availablePatientList" :key="p.uuid">
|
||||
<image class="avatar" :src="docUrl + (p.photo || '')" mode="aspectFill" />
|
||||
<view class="name">{{ p.nickname || p.realName }}</view>
|
||||
<image class="avatar" :src="getAvatarSrc(p)" mode="aspectFill" @error="handleAvatarError(p)" />
|
||||
<view class="name">{{ p.realName || p.nickname}}</view>
|
||||
<view class="check" >
|
||||
<view class="circle" :class="{ active: selectedIds.includes(p.uuid) }"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="bottom-actions">
|
||||
<view class="select-all-btn" @click="toggleSelectAll">
|
||||
{{ isAllSelected ? '全不选' : '全选' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed,nextTick} from 'vue'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import { onShow,onLoad} from "@dcloudio/uni-app";
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import defaultImg from "@/static/default.png"
|
||||
const from = ref('');
|
||||
const keyword = ref('')
|
||||
const selectedIds = ref([])
|
||||
const patientList = ref([])
|
||||
const selectedDetail = ref([])
|
||||
const availablePatientList = ref([])
|
||||
const patientListPage = ref(1)
|
||||
const patientListPageSize = ref(200)
|
||||
const patientListHasMore = ref(true)
|
||||
const patientListLoading = ref(false)
|
||||
const patientListLoadingMore = ref(false)
|
||||
const isAllSelected = computed(() => {
|
||||
const total = patientList.value.length
|
||||
return total > 0 && selectedIds.value.length === total
|
||||
})
|
||||
// 计算属性:显示所有患者,但标记已选中的状态
|
||||
// const availablePatientList = computed(() => {
|
||||
// return patientList.value
|
||||
// })
|
||||
const patientListByGBK = async () => {
|
||||
|
||||
const res = await api.patientListByGBK();
|
||||
if(res.code == 1){
|
||||
patientList.value = res.data;
|
||||
availablePatientList.value = res.data;
|
||||
if(res.data.length > 1000){
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
}else{
|
||||
uni.hideLoading();
|
||||
const isApiSuccess = (res) => Number(res?.code) === 1 || Number(res?.code) === 200
|
||||
const parsePagedPatients = (res) => {
|
||||
const data = res?.data
|
||||
if (Array.isArray(data)) {
|
||||
return { list: data, total: undefined, pageNum: undefined, pages: undefined, isLastPage: undefined }
|
||||
}
|
||||
const list =
|
||||
(Array.isArray(data?.list) && data.list) ||
|
||||
(Array.isArray(data?.records) && data.records) ||
|
||||
(Array.isArray(data?.rows) && data.rows) ||
|
||||
(Array.isArray(data?.data) && data.data) ||
|
||||
[]
|
||||
const total = Number(data?.total ?? data?.count ?? data?.totalCount ?? undefined)
|
||||
const pageNum = Number(data?.pageNum ?? data?.page ?? data?.current ?? undefined)
|
||||
const pages = Number(data?.pages ?? data?.pageCount ?? undefined)
|
||||
const isLastPage = typeof data?.isLastPage === 'boolean' ? data.isLastPage : undefined
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : undefined,
|
||||
pageNum: Number.isFinite(pageNum) ? pageNum : undefined,
|
||||
pages: Number.isFinite(pages) ? pages : undefined,
|
||||
isLastPage
|
||||
}
|
||||
}
|
||||
const mergePatientListUnique = (base = [], incoming = []) => {
|
||||
if (!incoming.length) return base
|
||||
const seen = new Set()
|
||||
const merged = []
|
||||
const pushUnique = (item) => {
|
||||
const key = String(item?.uuid || item?.id || item?.mobile || '')
|
||||
if (!key) {
|
||||
merged.push(item)
|
||||
return
|
||||
}
|
||||
if (seen.has(key)) return
|
||||
seen.add(key)
|
||||
merged.push(item)
|
||||
}
|
||||
base.forEach(pushUnique)
|
||||
incoming.forEach(pushUnique)
|
||||
return merged
|
||||
}
|
||||
const applyPatientList = (list = []) => {
|
||||
patientList.value = list
|
||||
onSearch()
|
||||
}
|
||||
const patientListByGBKPage = async ({ reset = false, showLoading = false } = {}) => {
|
||||
if (patientListLoading.value || patientListLoadingMore.value) return
|
||||
if (!reset && !patientListHasMore.value) return
|
||||
if (reset) {
|
||||
patientListLoading.value = true
|
||||
patientListPage.value = 1
|
||||
patientListHasMore.value = true
|
||||
} else {
|
||||
patientListLoadingMore.value = true
|
||||
}
|
||||
if (showLoading) {
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
}
|
||||
try {
|
||||
const requestPage = patientListPage.value
|
||||
const res = await api.patientListByGBKPage({
|
||||
page: requestPage,
|
||||
//pageNum: requestPage,
|
||||
//current: requestPage,
|
||||
pageSize: patientListPageSize.value,
|
||||
//size: patientListPageSize.value
|
||||
})
|
||||
if (!isApiSuccess(res)) return
|
||||
const { list, total, pageNum, pages, isLastPage } = parsePagedPatients(res)
|
||||
const merged = reset ? list : mergePatientListUnique(patientList.value, list)
|
||||
applyPatientList(merged)
|
||||
if (typeof isLastPage === 'boolean') {
|
||||
patientListHasMore.value = !isLastPage
|
||||
} else if (typeof pages === 'number' && typeof pageNum === 'number') {
|
||||
patientListHasMore.value = pageNum < pages
|
||||
} else if (typeof total === 'number') {
|
||||
patientListHasMore.value = merged.length < total
|
||||
} else {
|
||||
patientListHasMore.value = list.length >= patientListPageSize.value
|
||||
}
|
||||
if (patientListHasMore.value) {
|
||||
patientListPage.value = typeof pageNum === 'number' ? pageNum + 1 : requestPage + 1
|
||||
}
|
||||
} finally {
|
||||
patientListLoading.value = false
|
||||
patientListLoadingMore.value = false
|
||||
if (showLoading) {
|
||||
nextTick(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
const onScrollToLower = () => {
|
||||
void patientListByGBKPage({ reset: false, showLoading: false })
|
||||
}
|
||||
onLoad((options) => {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})
|
||||
if(options.from == 'chatMsg'){
|
||||
from.value = 'chatMsg';
|
||||
if(options.from ){
|
||||
from.value =options.from;
|
||||
}
|
||||
// 读取已选中的成员ID
|
||||
try {
|
||||
@@ -90,7 +187,7 @@
|
||||
uni.removeStorageSync('preSelectedIds')
|
||||
}
|
||||
} catch (e) {}
|
||||
patientListByGBK();
|
||||
void patientListByGBKPage({ reset: true, showLoading: true });
|
||||
})
|
||||
onShow(() => {
|
||||
|
||||
@@ -124,6 +221,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
const getAvatarSrc = (patient) => {
|
||||
if (patient?._avatarLoadError) return defaultImg
|
||||
return patient?.photo ? (docUrl + patient.photo) : defaultImg
|
||||
}
|
||||
|
||||
const handleAvatarError = (patient) => {
|
||||
if (!patient) return
|
||||
patient._avatarLoadError = true
|
||||
}
|
||||
|
||||
const toggleSelectAll = () => {
|
||||
if (!patientList.value.length) return
|
||||
if (isAllSelected.value) {
|
||||
selectedIds.value = []
|
||||
selectedDetail.value = []
|
||||
return
|
||||
}
|
||||
selectedIds.value = patientList.value.map(item => item.uuid)
|
||||
selectedDetail.value = patientList.value.map(item => ({
|
||||
uuid: item.uuid,
|
||||
realName: item?.realName || '',
|
||||
photo: item?.photo || '',
|
||||
nickName: item?.nickName || ''
|
||||
}))
|
||||
}
|
||||
|
||||
const onSearch = () => {
|
||||
if(keyword.value.replace(/\s/g, "")){
|
||||
availablePatientList.value = patientList.value.filter(p => p.realName.indexOf(keyword.value) !== -1 || (p.nickname && p.nickname.indexOf(keyword.value) !== -1) || p.mobile.indexOf(keyword.value) !== -1)
|
||||
@@ -134,6 +257,15 @@
|
||||
}
|
||||
const goBack = () => uni.navigateBack()
|
||||
const confirmSelect = () => {
|
||||
if(from.value == 'chatMsg' || from.value == 'videoDetail'){
|
||||
if(selectedIds.value.length >200){
|
||||
uni.showToast({
|
||||
title: '选择人数不能超过200',
|
||||
icon: 'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
}
|
||||
const payload = { ids: selectedIds.value, list: selectedDetail.value }
|
||||
// 通过事件通道回传
|
||||
try {
|
||||
@@ -182,7 +314,14 @@
|
||||
width: 88rpx; height: 72rpx; background:#fff;
|
||||
}
|
||||
}
|
||||
.list{ border-radius: 12rpx; }
|
||||
.list{
|
||||
border-radius: 12rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: calc(var(--status-bar-height) + 64px + 94rpx);
|
||||
bottom: 130rpx;
|
||||
}
|
||||
.item{background:#fff; display:flex; align-items:center;padding: 24rpx 30rpx; border-bottom: 2rpx solid #eee; }
|
||||
.avatar{ width: 96rpx; height:96rpx; border-radius: 16rpx; background:#ffe; }
|
||||
.name{ flex:1; margin-left: 20rpx; font-size: 32rpx; color:#333; }
|
||||
@@ -190,4 +329,24 @@
|
||||
.circle{ width: 40rpx; height: 40rpx; border-radius: 50%; border: 2rpx solid #cfcfcf; }
|
||||
.circle.active{ background:#8B2316; border-color:#8B2316; position: relative; }
|
||||
.circle.active::after{ content:''; position:absolute; left: 14rpx; top: 6rpx; width: 10rpx; height: 18rpx; border: 4rpx solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }
|
||||
.bottom-actions{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
padding: 20rpx 30rpx 20rpx;
|
||||
}
|
||||
.select-all-btn{
|
||||
height: 88rpx;
|
||||
border-radius: 12rpx;
|
||||
color: #8B2316;
|
||||
background: #fff;
|
||||
border: 2rpx solid #8B2316;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<!-- 列表 -->
|
||||
<scroll-view class="list" scroll-y>
|
||||
<view class="item" @click="toggle(p.uuid)" v-for="p in availablePatientList" :key="p.uuid">
|
||||
<image class="avatar" :src="docUrl + (p.photo || '')" mode="aspectFill" />
|
||||
<view class="name">{{ p.nickname || p.realName }}</view>
|
||||
<image class="avatar" :src="getAvatarSrc(p)" mode="aspectFill" @error="handleAvatarError(p)" />
|
||||
<view class="name">{{ p.realName || p.nickname }}</view>
|
||||
<view class="check" >
|
||||
<view class="circle" :class="{ active: selectedIds.includes(p.uuid) }"></view>
|
||||
</view>
|
||||
@@ -42,11 +42,11 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed,nextTick } from 'vue'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import { onShow,onLoad} from "@dcloudio/uni-app";
|
||||
import api from '@/api/api.js'
|
||||
|
||||
import defaultImg from "@/static/default.png"
|
||||
const keyword = ref('')
|
||||
const selectedIds = ref([])
|
||||
const patientList = ref([])
|
||||
@@ -62,13 +62,16 @@
|
||||
if(res.code == 1){
|
||||
patientList.value = res.data;
|
||||
availablePatientList.value = res.data;
|
||||
if(res.data.length > 1000){
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
}else{
|
||||
nextTick(() => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
// if(res.data.length > 1000){
|
||||
// setTimeout(() => {
|
||||
// uni.hideLoading();
|
||||
// }, 5000);
|
||||
// }else{
|
||||
// uni.hideLoading();
|
||||
// }
|
||||
}
|
||||
|
||||
};
|
||||
@@ -126,6 +129,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
const getAvatarSrc = (patient) => {
|
||||
if (patient?._avatarLoadError) return defaultImg
|
||||
return patient?.photo ? (docUrl + patient.photo) : defaultImg
|
||||
}
|
||||
|
||||
const handleAvatarError = (patient) => {
|
||||
if (!patient) return
|
||||
patient._avatarLoadError = true
|
||||
}
|
||||
|
||||
const onSearch = () => {
|
||||
if(keyword.value.replace(/\s/g, "")){
|
||||
availablePatientList.value = patientList.value.filter(p => p.realName.indexOf(keyword.value) !== -1 || (p.nickname && p.nickname.indexOf(keyword.value) !== -1) || p.mobile.indexOf(keyword.value) !== -1)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="肝胆视频1"
|
||||
title="肝胆视频"
|
||||
@clickLeft="goBack"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
@@ -435,6 +435,15 @@ onLoad((options) => {
|
||||
setTimeout(() => {
|
||||
loadCategoryVideos("all");
|
||||
}, 500);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "肝胆视频",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
});
|
||||
|
||||
// 加载轮播数据
|
||||
@@ -690,9 +699,11 @@ const switchTab = (tabIndex) => {
|
||||
// 播放视频
|
||||
const playVideo = (video) => {
|
||||
const videoId = video.id || video.uuid;
|
||||
console.log(222);
|
||||
console.log(video.tags);
|
||||
|
||||
navTo({
|
||||
url: `/pages_app/videoDetail/videoDetail?id=${videoId}`,
|
||||
url: `/pages_app/videoDetail/videoDetail?id=${videoId}&tags=${video.tags}`,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
id="myVideo"
|
||||
object-fit="contain"
|
||||
:autoplay="false"
|
||||
@play="onVideoPlay"
|
||||
@pause="onVideoPause"
|
||||
@ended="onVideoEnded"
|
||||
@error="onVideoError"
|
||||
></video>
|
||||
<!-- <sunny-video
|
||||
@@ -204,6 +207,12 @@
|
||||
<view class="share-popup">
|
||||
<view class="share-title">分享到</view>
|
||||
<view class="share-content">
|
||||
<!-- <view class="share-item" @click="shareToPatient" v-if="type == 'patientVideo'">
|
||||
<view class="share-icon wechat-icon" style="background: none;">
|
||||
<image class="share-img" :src="paitientImg" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="share-text">患者</text>
|
||||
</view> -->
|
||||
<view class="share-item" @click="shareToWechat">
|
||||
<view class="share-icon wechat-icon">
|
||||
<image class="share-img" :src="wxImg" mode="aspectFill" />
|
||||
@@ -228,12 +237,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 选择弹窗(复制自 groupMessage) -->
|
||||
<view v-if="showModal" class="mask" @click="closeModal"></view>
|
||||
<view v-if="showModal" class="center-modal">
|
||||
<view class="modal-title">温馨提示</view>
|
||||
<view class="modal-divider"></view>
|
||||
<view class="modal-item" @click="onSelect('single')">
|
||||
<text class="text">单独选择</text>
|
||||
</view>
|
||||
<view class="modal-divider"></view>
|
||||
<view class="modal-item" @click="onSelect('group')">
|
||||
<text class="text">分组选择</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, nextTick } from "vue";
|
||||
//import uniVideo from "@/components/uniVideo/uniVideo.vue";
|
||||
import { onLoad, onShow,onReady } from "@dcloudio/uni-app";
|
||||
import { onLoad, onShow,onReady,onUnload,onHide } from "@dcloudio/uni-app";
|
||||
import unidialog from "@/components/dialog/dialog.vue";
|
||||
import collectImg from "@/static/icon_book_collect_sel.png";
|
||||
import discollectImg from "@/static/icon_book_collect_nor.png";
|
||||
@@ -245,13 +267,16 @@ import logoImg from "@/static/weiboShare.png";
|
||||
import isAndroid from "@/utils/platform.js";
|
||||
import avastarImg from "@/static/avastar.png";
|
||||
import playImg from "@/static/play.png";
|
||||
import paitientImg from "@/static/info_icon_1.png";
|
||||
import api from "@/api/api";
|
||||
import docUrl from "@/utils/docUrl";
|
||||
import navTo from "@/utils/navTo";
|
||||
const shareLink = ref("");
|
||||
import otherHost from "@/utils/otherHost";
|
||||
const selectedPatients = ref([]);
|
||||
const video_uuid = ref("");
|
||||
const videoInfo = ref({});
|
||||
const tags = ref("");
|
||||
const networkVisible = ref(false);
|
||||
const networkContent = ref("");
|
||||
const pointVisible = ref(false);
|
||||
@@ -260,6 +285,9 @@ const notEnoughVisible = ref(false);
|
||||
const notEnoughContent = ref("");
|
||||
const welfareNum = ref(0);
|
||||
const isPlaying = ref(false);
|
||||
const playTime = ref(0);
|
||||
const timer = ref(null);
|
||||
const hasPlay = ref(false);
|
||||
// 删除弹窗相关
|
||||
const showDeleteModal = ref(false);
|
||||
const currentDeleteItem = ref(null);
|
||||
@@ -270,6 +298,7 @@ const downLoadStatus = ref('start');
|
||||
let downList = uni.getStorageSync("downLoadVideo") || [];
|
||||
const downLoadList = ref(downList);
|
||||
const isFullScreen = ref(false);
|
||||
const showModal = ref(false);
|
||||
|
||||
//import DomVideoPlayer from 'uniapp-video-player'
|
||||
//import sunnyVideo from "@/uni_modules/sunny-video/components/sunny-video/sunny-video.vue";
|
||||
@@ -291,7 +320,29 @@ const onFullscreenChange = (e) => {
|
||||
};
|
||||
const onVideoPlay = () => {
|
||||
isPlaying.value = true;
|
||||
hasPlay.value = true;
|
||||
timer.value = setInterval(() => {
|
||||
playTime.value++;
|
||||
}, 1000);
|
||||
};
|
||||
const onVideoPause = () => {
|
||||
isPlaying.value = false;
|
||||
if(timer.value) {
|
||||
clearInterval(timer.value);
|
||||
timer.value = null;
|
||||
}
|
||||
|
||||
};
|
||||
const onVideoEnded = () => {
|
||||
isPlaying.value = false;
|
||||
if(timer.value) {
|
||||
clearInterval(timer.value);
|
||||
timer.value = null;
|
||||
}
|
||||
};
|
||||
onHide(() => {
|
||||
|
||||
});
|
||||
// const playVideo = () => {
|
||||
// videoContext.value.play();
|
||||
// };
|
||||
@@ -314,6 +365,7 @@ const startDownload = (index) => {
|
||||
hasDownload.value = true;
|
||||
isVideoDownloadRecord.value=true;
|
||||
downLoadStatus.value = 'loading';
|
||||
|
||||
const task = uni.downloadFile({
|
||||
url: taskItem.url,
|
||||
success: (res1) => {
|
||||
@@ -449,6 +501,20 @@ const useWelfareNum = async () => {
|
||||
if (res.code == 1) {
|
||||
uni.showToast({ title: "使用次数成功", icon: "none" });
|
||||
welfareNum.value--;
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "viorder_deo_download",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
event_unit:'分',
|
||||
number:1,
|
||||
event_val:0,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
addDownloadTask({
|
||||
url: videoSrc.value,
|
||||
id: video_uuid.value,
|
||||
@@ -465,12 +531,13 @@ const onVideoError = (e) => {
|
||||
// });
|
||||
videoSrc.value= videoSrc.value.replace('.mp4', '.m3u8');
|
||||
};
|
||||
const videoDetail = async () => {
|
||||
const videoDetail = async (flag = false) => {
|
||||
const res = await api.videoDetail({ video_uuid: video_uuid.value });
|
||||
if (res.code == 200) {
|
||||
|
||||
const userInfo = uni.getStorageSync("userInfo");
|
||||
videoInfo.value = res.video;
|
||||
|
||||
tags.value = res.video.tags;
|
||||
//hasDownload.value = downLoadList.value.includes(video_uuid.value);
|
||||
let vid =res.video.polyv_uuid || extractPolyvVid(res.video.content);
|
||||
console.log(222222);
|
||||
@@ -488,6 +555,24 @@ const videoDetail = async () => {
|
||||
"/video/hcp_detial?share=1&uuid=" +
|
||||
video_uuid.value +
|
||||
"&expertshare=videoshare&fromtype=doctor";
|
||||
console.log(videoInfo.value.name)
|
||||
if(flag) {
|
||||
try {
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:''
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const collection = async () => {
|
||||
@@ -497,9 +582,30 @@ const collection = async () => {
|
||||
});
|
||||
if (res.code == 200) {
|
||||
uni.showToast({ title: "收藏成功", icon: "none" });
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "collect",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
videoDetail();
|
||||
}
|
||||
};
|
||||
|
||||
const addpoint=()=>{
|
||||
api.addBonusPointsN({
|
||||
score_type:5
|
||||
}).then(res=>{
|
||||
if(res.code==200){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const discollection = async () => {
|
||||
const res = await api.discollection({
|
||||
other_uuid: video_uuid.value,
|
||||
@@ -573,8 +679,76 @@ const resumeDownloadingTasks = () => {
|
||||
});
|
||||
});
|
||||
};
|
||||
onUnload(() => {
|
||||
console.log('onUnload');
|
||||
uni.$off('selectedChatPatientsSingle');
|
||||
uni.$off('replySuccess', handleReplySuccess);
|
||||
if(timer.value) {
|
||||
clearInterval(timer.value);
|
||||
timer.value = null;
|
||||
};
|
||||
if(hasPlay.value) {
|
||||
let id=videoInfo.value.polyv_uuid || extractPolyvVid(videoInfo.value.content);
|
||||
console.log(id);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "watch_video",
|
||||
page_type:'',
|
||||
resource_name:id,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
event_val:playTime.value,
|
||||
event_unit:'秒',
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
const replySuccessLocked = ref(false);
|
||||
const lastReplySuccessAt = ref(0);
|
||||
const runReplySuccessOnce = (action) => {
|
||||
const now = Date.now();
|
||||
if (replySuccessLocked.value) return false;
|
||||
if (now - Number(lastReplySuccessAt.value || 0) < 1000) return false;
|
||||
replySuccessLocked.value = true;
|
||||
lastReplySuccessAt.value = now;
|
||||
try {
|
||||
action && action();
|
||||
return true;
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
replySuccessLocked.value = false;
|
||||
}, 300);
|
||||
}
|
||||
};
|
||||
const handleReplySuccess = () => {
|
||||
runReplySuccessOnce(() => {
|
||||
console.log('reply-success');
|
||||
try {
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "comment",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
onShow(() => {
|
||||
uni.$on('selectedChatPatientsSingle',(data)=>{
|
||||
console.log(data)
|
||||
selectedPatients.value = data.patients;
|
||||
if(type.value == 'patientVideo') {
|
||||
addGroupSendMsg4YunXin()
|
||||
}
|
||||
});
|
||||
uni.$off('replySuccess', handleReplySuccess);
|
||||
uni.$on('replySuccess', handleReplySuccess);
|
||||
hasDownload.value = false;
|
||||
downLoadStatus.value = 'start';
|
||||
console.log('onShow');
|
||||
@@ -614,18 +788,72 @@ onShow(() => {
|
||||
if (activeTab.value == "comment") {
|
||||
videoCommentListV2();
|
||||
}
|
||||
if(from.value != 'download') {
|
||||
videoDetail();
|
||||
if (from.value != "download") {
|
||||
videoDetail(true);
|
||||
}
|
||||
uni.hideLoading();
|
||||
|
||||
});
|
||||
|
||||
const shareRef = ref();
|
||||
const shareActionLocked = ref(false);
|
||||
const lastShareActionAt = ref(0);
|
||||
const runShareActionOnce = (action) => {
|
||||
const now = Date.now();
|
||||
if (shareActionLocked.value) return false;
|
||||
if (now - Number(lastShareActionAt.value || 0) < 800) return false;
|
||||
shareActionLocked.value = true;
|
||||
lastShareActionAt.value = now;
|
||||
try {
|
||||
action && action();
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
shareActionLocked.value = false;
|
||||
}, 500);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
// 分享APP
|
||||
const shareToggle = () => {
|
||||
shareRef.value.open();
|
||||
};
|
||||
const shareToPatient = () => {
|
||||
if (!runShareActionOnce(() => {})) return;
|
||||
closeShare();
|
||||
setTimeout(() => {
|
||||
openModal();
|
||||
}, 120);
|
||||
};
|
||||
const openModal = () => {
|
||||
showModal.value = true;
|
||||
};
|
||||
const closeModal = () => {
|
||||
showModal.value = false;
|
||||
};
|
||||
const addGroupSendMsg4YunXin=async()=>{
|
||||
const res=await api.addGroupSendMsg4YunXin({
|
||||
patient_user_uuid: selectedPatients.value.map(item => item.uuid).join(','),
|
||||
msg_content: videoInfo.value.uuid,
|
||||
msg_type:4,
|
||||
});
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: "推荐成功", icon: "none" });
|
||||
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: "none" });
|
||||
}
|
||||
}
|
||||
const onSelect = (type) => {
|
||||
showModal.value = false;
|
||||
if (type === "single") {
|
||||
navTo({
|
||||
url: "/pages_app/selectPatient/selectPatient?from=videoDetail",
|
||||
});
|
||||
} else if (type === "group") {
|
||||
navTo({
|
||||
url: "/pages_chat/patientGroup/patientGroup?from=videoDetail",
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 关闭分享弹窗
|
||||
const closeShare = () => {
|
||||
@@ -634,6 +862,22 @@ const closeShare = () => {
|
||||
|
||||
// 分享到微信
|
||||
const shareToWechat = () => {
|
||||
if (!runShareActionOnce(() => {})) return;
|
||||
if(type.value == 'patientVideo') {
|
||||
addpoint();
|
||||
}
|
||||
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
// #ifdef APP-PLUS
|
||||
// 使用系统分享
|
||||
uni.downloadFile({
|
||||
@@ -652,6 +896,7 @@ const shareToWechat = () => {
|
||||
href: shareLink.value,
|
||||
imageUrl: res2.tempFilePath,
|
||||
success: function (res) {
|
||||
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
@@ -729,6 +974,21 @@ const shareToWechat = () => {
|
||||
|
||||
// 分享到朋友圈
|
||||
const shareToMoments = () => {
|
||||
if (!runShareActionOnce(() => {})) return;
|
||||
if(type.value == 'patientVideo') {
|
||||
addpoint();
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
// #ifdef APP-PLUS
|
||||
uni.downloadFile({
|
||||
url: isAndroid?docUrl + videoInfo.value.imgpath:'https://doc.igandan.com/app/html/img/2016/20160714132557.png',
|
||||
@@ -746,6 +1006,7 @@ const shareToMoments = () => {
|
||||
href: shareLink.value,
|
||||
imageUrl: res2.tempFilePath,
|
||||
success: function (res) {
|
||||
|
||||
//console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
@@ -783,6 +1044,7 @@ const shareToMoments = () => {
|
||||
|
||||
// 分享到新浪微博
|
||||
const shareToWeibo = () => {
|
||||
if (!runShareActionOnce(() => {})) return;
|
||||
// #ifdef APP-PLUS
|
||||
uni.share({
|
||||
provider: "sinaweibo",
|
||||
@@ -831,14 +1093,23 @@ const shareToWeibo = () => {
|
||||
closeShare();
|
||||
};
|
||||
const from = ref('');
|
||||
const type = ref('');
|
||||
// 使用uni-app的onLoad生命周期
|
||||
onLoad((options) => {
|
||||
console.log(options);
|
||||
if(options.type) {
|
||||
type.value = options.type;
|
||||
}
|
||||
if(options.tags) {
|
||||
tags.value = options.tags;
|
||||
}
|
||||
uni.getSystemInfo({
|
||||
success: function (res) {
|
||||
videoWidth.value = res.windowWidth; // 窗口宽度
|
||||
},
|
||||
});
|
||||
console.log('enrtyVideoDetail');
|
||||
//这个是处理关于滋滋声的问题,不能删掉
|
||||
uni.sendNativeEvent('enrtyVideoDetail', {
|
||||
msg: 'enrtyVideoDetail'
|
||||
}, ret => {
|
||||
@@ -897,6 +1168,20 @@ const payVideoDownload = async () => {
|
||||
const res = await api.payVideoDownload({ video_uuid: video_uuid.value });
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "viorder_deo_download",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
event_unit:'积分',
|
||||
number:1,
|
||||
event_val:videoInfo.value.point,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
addDownloadTask({
|
||||
url: videoSrc.value,
|
||||
id: video_uuid.value,
|
||||
@@ -978,6 +1263,17 @@ const addCommentV2 = async () => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({ title: "评论成功", icon: "none" });
|
||||
commentText.value = "";
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "comment",
|
||||
page_type: type.value == 'patientVideo' ? '患教视频' : "肝胆视频",
|
||||
resource_name:videoInfo.value.name,
|
||||
resource_option:tags.value?tags.value:'',
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
videoCommentListV2();
|
||||
}
|
||||
};
|
||||
@@ -1503,6 +1799,50 @@ $theme-color: #8b2316;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
/* 选择弹窗(与 groupMessage 保持一致) */
|
||||
.mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
.center-modal {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
margin-top:100rpx;
|
||||
width: 650rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
z-index: 9999999;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
color: #8b2316;
|
||||
padding: 28rpx 20rpx;
|
||||
}
|
||||
|
||||
.modal-item {
|
||||
padding: 36rpx 28rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.modal-divider {
|
||||
height: 2rpx;
|
||||
background: #eeeeee;
|
||||
}
|
||||
|
||||
// 删除确认弹窗
|
||||
.delete-modal-mask {
|
||||
position: fixed;
|
||||
|
||||
+15
-11
@@ -7,9 +7,7 @@
|
||||
left-icon="left"
|
||||
title="添加随访计划"
|
||||
@clickLeft="goBack"
|
||||
|
||||
color="#8B2316"
|
||||
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
@@ -106,10 +104,17 @@
|
||||
const dealIndex=ref(0);
|
||||
import api from '@/api/api.js'
|
||||
const from = ref('');
|
||||
const type = ref('');
|
||||
onLoad((options) => {
|
||||
console.log(options)
|
||||
patientUuid.value = options.uuid;
|
||||
patientName.value = options.patient_name;
|
||||
from.value = options.from;
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
if(options.type){
|
||||
type.value = options.type;
|
||||
}
|
||||
});
|
||||
const selectedPatient = ref('');
|
||||
const defaultContent = '请近日来医院复诊、复查';
|
||||
@@ -191,11 +196,13 @@
|
||||
const goBack=()=>uni.navigateBack();
|
||||
const submitPlan=()=>{
|
||||
addFollowUps();
|
||||
uni.showToast({ title: '已提交', icon: 'none' });
|
||||
setTimeout(()=>uni.navigateBack(),1000);
|
||||
//uni.showToast({ title: '已提交', icon: 'none' });
|
||||
//setTimeout(()=>uni.navigateBack(),1000);
|
||||
};
|
||||
const selectPatient=()=>{
|
||||
if(from.value=='patientMsg'){
|
||||
if(type.value == 'patientDetail'){
|
||||
return false
|
||||
}else if(from.value=='patientMsg'){
|
||||
navTo({
|
||||
url:'/pages_app/selectPatient/selectPatient',
|
||||
events: {
|
||||
@@ -310,19 +317,16 @@
|
||||
}
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
|
||||
|
||||
}
|
||||
.content {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
|
||||
}
|
||||
.nav-right { display: flex; align-items: center; }
|
||||
.submit-text { font-size: 32rpx; color: #8B2316; font-weight: 500; }
|
||||
|
||||
.form-section {
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
|
||||
// margin-top: 20rpx;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
padding: 30rpx; background: #ffffff; border-bottom: 1rpx solid #f0f0f0;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<!-- 输入框区域 -->
|
||||
<view class="note-box">
|
||||
<textarea class="note-textarea" v-model.trim="note" placeholder="请填写随访内容" auto-height :maxlength="200" />
|
||||
<textarea class="note-textarea" v-model.trim="note" placeholder="请填写随访内容" auto-height :maxlength="200" :adjust-position="false"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -44,7 +44,7 @@
|
||||
const note = ref('请近日来医院复诊、复查')
|
||||
const idx = ref(0)
|
||||
onLoad((options) => {
|
||||
console.log(options.patient_name==undefined)
|
||||
console.log(options.patient_name)
|
||||
patientName.value =options.patient_name ?decodeURIComponent(options.patient_name):'';
|
||||
console.log(patientName.value)
|
||||
if (options?.note) note.value = decodeURIComponent(options.note)
|
||||
@@ -68,10 +68,14 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contentbox{
|
||||
margin-top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right:0;
|
||||
overflow-y: scroll;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
}
|
||||
.visit-note-page{
|
||||
min-height: 100vh; background:#f5f5f5;
|
||||
background:#f5f5f5;
|
||||
}
|
||||
.nav-right{ display:flex; align-items:center; }
|
||||
.submit-text{ color:#8B2316; font-size: 30rpx; }
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<uni-nav-bar
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="随访计划"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
|
||||
:border="false"
|
||||
backgroundColor="#eee"
|
||||
>
|
||||
@@ -17,7 +19,8 @@
|
||||
</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
<view class="plan">
|
||||
</view>
|
||||
|
||||
<scroll-view
|
||||
class="plan-scroll"
|
||||
scroll-y="true"
|
||||
@@ -75,20 +78,33 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow,onLoad } from '@dcloudio/uni-app'
|
||||
import dayjs from 'dayjs'
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import dayImg from '@/static/visit_data11.png'
|
||||
import planImg from '@/static/visitplan.png'
|
||||
import lineImg from '@/static/item_visitplan_fg.png'
|
||||
|
||||
const patientUuid = ref('')
|
||||
const patientName = ref('')
|
||||
const type = ref('')
|
||||
onLoad((options) => {
|
||||
if(options.uuid){
|
||||
patientUuid.value = options.uuid
|
||||
}
|
||||
if(options.patient_name){
|
||||
patientName.value = options.patient_name
|
||||
}
|
||||
if(options.type){
|
||||
type.value = options.type
|
||||
}
|
||||
})
|
||||
const formatYearMonth = (input) => {
|
||||
if (!input) return ''
|
||||
const d = dayjs(input)
|
||||
@@ -159,8 +175,31 @@ const goBack = () => uni.navigateBack()
|
||||
const showAddMenuFlag = ref(false)
|
||||
const showAddMenu = () => { showAddMenuFlag.value = true }
|
||||
const hideAddMenu = () => { showAddMenuFlag.value = false }
|
||||
const addFollowUpPlan = () => { showAddMenuFlag.value = false; uni.navigateTo({ url: '/pages_app/visit/visit?from=visitPlan' }) }
|
||||
const addSchedule = () => { showAddMenuFlag.value = false; uni.navigateTo({ url: '/pages_app/schedule/schedule' }) }
|
||||
const addFollowUpPlan = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
if(type.value == 'patientDetail'){
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/visit/visit?uuid='+patientUuid.value+'&patient_name='+patientName.value+'&type=patientDetail'
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/visit/visit?from=visitPlan'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
const addSchedule = () => {
|
||||
showAddMenuFlag.value = false;
|
||||
if(type.value == 'patientDetail'){
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/schedule/schedule?uuid='+patientUuid.value+'&patient_name='+patientName.value+'&type=patientDetail'
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/schedule/schedule'
|
||||
})
|
||||
}
|
||||
}
|
||||
const goFollowDetail = (raw) => { if (!raw) return; navTo({ url: `/pages_app/followDetail/followDetail?followUpUuid=${encodeURIComponent(raw.uuid || '')}&patient_name=${raw.patientname}` }) }
|
||||
|
||||
onShow(() => {
|
||||
@@ -182,8 +221,8 @@ onShow(() => {
|
||||
|
||||
.content { background-color: #f5f5f5; height: 100vh; overflow-y: hidden; }
|
||||
.linebox{ margin:0 20rpx; }
|
||||
.plan{ position: fixed; top: 180rpx; left: 0; right: 0; bottom:0rpx; }
|
||||
.plan-scroll { height: 100%; }
|
||||
.plan-scroll{ position: fixed; top: calc(var(--status-bar-height) + 44px); left: 0; right: 0; bottom:0rpx;z-index:1; }
|
||||
|
||||
.plan-list{ padding-bottom: 20rpx; }
|
||||
.plan-group{ background:#f5f5f5; }
|
||||
.group-header{ text-align: center; background:#e4e4e4; color:#333; font-size: 30rpx; padding: 20rpx 30rpx; }
|
||||
@@ -200,7 +239,10 @@ onShow(() => {
|
||||
.floating-add-btn { position: fixed; bottom: 140rpx; right: 30rpx; background-color: #8B2316; border-radius: 50%; width: 100rpx; height: 100rpx; display:flex; flex-direction:column; align-items:center; justify-content:center; z-index:999; box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1); }
|
||||
.floating-add-btn .btn-text{ font-size:20rpx; color:#fff; margin-top:4rpx; }
|
||||
.add-menu-popup { position: fixed; top:0; left:0; right:0; bottom:0; background-color: rgba(0,0,0,0); display:flex; align-items:center; justify-content:center; z-index:1000; }
|
||||
.menu-content { background:#fff; border-radius:20rpx; box-shadow:0 8rpx 24rpx rgba(0,0,0,0.2); width:80%; max-width:400rpx; overflow:hidden; }
|
||||
.menu-content { background:#fff; border-radius:20rpx; box-shadow:0 8rpx 24rpx rgba(0,0,0,0.2); width:80%; max-width:400rpx; overflow:hidden; position: fixed;
|
||||
top: calc(var(--status-bar-height) + 48px);
|
||||
z-index: 9999;
|
||||
right: 20rpx;}
|
||||
.menu-item { display:flex; align-items:center; padding:30rpx 40rpx; border-bottom:1rpx solid #f0f0f0; }
|
||||
.menu-item:last-child{ border-bottom:none; }
|
||||
.menu-text{ font-size:32rpx; color:#333; margin-left:20rpx; }
|
||||
|
||||
@@ -74,6 +74,9 @@ const summary = ref("");
|
||||
const shareLink = ref("");
|
||||
const shareImg = ref("");
|
||||
const shareTitle = ref("");
|
||||
const type = ref("");
|
||||
const tags = ref("");
|
||||
const reportTitle = ref("");
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
fail() {
|
||||
@@ -97,9 +100,16 @@ onHide(() => {
|
||||
// plus.screen.lockOrientation('landscape-primary');
|
||||
});
|
||||
onLoad((query) => {
|
||||
console.log(query);
|
||||
if (query.title) {
|
||||
title.value = query.title;
|
||||
}
|
||||
if (query.tags) {
|
||||
tags.value = query.tags;
|
||||
}
|
||||
if (query.type) {
|
||||
type.value = query.type;
|
||||
}
|
||||
if (query.share == 1) {
|
||||
canShare.value = true;
|
||||
}
|
||||
@@ -122,13 +132,39 @@ 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:reportTitle.value,
|
||||
// resource_option:tags.value,
|
||||
// },
|
||||
// },
|
||||
// (ret) => {
|
||||
// console.log(ret);
|
||||
// });
|
||||
}else if(query.type=='news'){
|
||||
shareTitle.value = query.sharetitle;
|
||||
summary.value ='';
|
||||
@@ -231,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,
|
||||
@@ -577,7 +622,7 @@ function createNativePopup() {
|
||||
);
|
||||
if (relativeY >= cancelTop) {
|
||||
console.log("点击了取消按钮");
|
||||
closeNativePopup();
|
||||
tryCommitNativePanelAction(() => closeNativePopup());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -611,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();
|
||||
@@ -634,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();
|
||||
}
|
||||
@@ -668,6 +715,16 @@ function closeNativePopup() {
|
||||
// 分享到微信
|
||||
const shareToWechat = () => {
|
||||
// #ifdef APP-PLUS
|
||||
if(type.value == "live" || type.value == "live_yugao"){
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "会议直播",
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
});
|
||||
}
|
||||
// 使用系统分享
|
||||
uni.downloadFile({
|
||||
url: shareImg.value,
|
||||
@@ -770,6 +827,16 @@ onUnload(() => {
|
||||
// 分享到朋友圈
|
||||
const shareToMoments = () => {
|
||||
// #ifdef APP-PLUS
|
||||
if(type.value == "live" || type.value == "live_yugao"){
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "share",
|
||||
page_type: "会议直播",
|
||||
resource_name:reportTitle.value,
|
||||
resource_option:tags.value,
|
||||
},
|
||||
});
|
||||
}
|
||||
uni.downloadFile({
|
||||
url: shareImg.value,
|
||||
success: function (res) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+792
-190
File diff suppressed because it is too large
Load Diff
@@ -23,10 +23,11 @@
|
||||
:placeholder="placeholder"
|
||||
placeholder-class="ph"
|
||||
v-model.trim="content"
|
||||
:adjust-position="false"
|
||||
|
||||
>
|
||||
</input>
|
||||
<textarea v-else v-model.trim="content" :placeholder="placeholderTextArea" placeholder-class="ph" auto-height> </textarea>
|
||||
<textarea v-else v-model.trim="content" :placeholder="placeholderTextArea" placeholder-class="ph" auto-height :adjust-position="false"> </textarea>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
+44
-31
@@ -22,7 +22,7 @@
|
||||
|
||||
<view class="divider"></view>
|
||||
<view class="filter-item" @click="showFilterPopup">
|
||||
<text :class="{active: keywords}">筛选</text>
|
||||
<text :class="{ active: keywords }">筛选</text>
|
||||
<up-image
|
||||
:src="keywords ? filterOn : filter"
|
||||
width="36rpx"
|
||||
@@ -50,12 +50,20 @@
|
||||
:errorIcon="lazyImg"
|
||||
:lazy-load="true"
|
||||
>
|
||||
<template #error>
|
||||
<image :src="lazyImg" class="category-icon" mode="widthFix"></image>
|
||||
</template>
|
||||
<template v-slot:loading>
|
||||
<image :src="lazyImg" class="category-icon" mode="widthFix"></image>
|
||||
</template>
|
||||
<template #error>
|
||||
<image
|
||||
:src="lazyImg"
|
||||
class="category-icon"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</template>
|
||||
<template v-slot:loading>
|
||||
<image
|
||||
:src="lazyImg"
|
||||
class="category-icon"
|
||||
mode="widthFix"
|
||||
></image>
|
||||
</template>
|
||||
</up-image>
|
||||
</view>
|
||||
<view class="item-content">
|
||||
@@ -157,6 +165,7 @@
|
||||
<textarea
|
||||
class="form-textarea"
|
||||
type="text"
|
||||
:adjust-position="false"
|
||||
placeholder="不支持关键字/广泛查询"
|
||||
v-model="literature.literatureName"
|
||||
/>
|
||||
@@ -292,7 +301,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { onShow, onBackPress,onLoad} from "@dcloudio/uni-app";
|
||||
import { onShow, onBackPress, onLoad } from "@dcloudio/uni-app";
|
||||
import upImg from "@/static/cb_up.png";
|
||||
import downImg from "@/static/cb_up.png";
|
||||
import filter from "@/static/cb_screen_no.png";
|
||||
@@ -340,9 +349,7 @@ onBackPress(() => {
|
||||
return true;
|
||||
});
|
||||
// 页面加载
|
||||
onMounted(() => {
|
||||
|
||||
});
|
||||
onMounted(() => {});
|
||||
const showFilter = ref(false);
|
||||
// 筛选弹窗相关方法
|
||||
const showFilterPopup = () => {
|
||||
@@ -394,32 +401,40 @@ const confirmFilter = throttle(() => {
|
||||
isFilterActive.value = true;
|
||||
hideFilterPopup();
|
||||
const selectedTags = filterTags.value.filter((tag) => tag.selected);
|
||||
let words="";
|
||||
let words = "";
|
||||
console.log("选中的筛选标签:", selectedTags);
|
||||
for (let i = 0; i < selectedTags.length; i++) {
|
||||
if (words) {
|
||||
words += "," + selectedTags[i].NAME;
|
||||
} else {
|
||||
words= selectedTags[i].NAME;
|
||||
words = selectedTags[i].NAME;
|
||||
}
|
||||
}
|
||||
keywords.value=words;
|
||||
if(!keywords.value) return;
|
||||
console.log(1111111);
|
||||
console.log('看看执行了几次');
|
||||
navTo({
|
||||
url: "/pages_app/hot/hot?keywords="+encodeURIComponent(keywords.value)
|
||||
});
|
||||
keywords.value = words;
|
||||
if (!keywords.value) return;
|
||||
console.log(1111111);
|
||||
console.log("看看执行了几次");
|
||||
navTo({
|
||||
url: "/pages_app/hot/hot?keywords=" + encodeURIComponent(keywords.value),
|
||||
});
|
||||
|
||||
// 根据选中的标签重新加载数据
|
||||
},1000);
|
||||
}, 1000);
|
||||
onLoad(() => {
|
||||
loadGuideTypes();
|
||||
loadSearchLibrary();
|
||||
loadGuideTags();
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "诊疗指南",
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
});
|
||||
onShow(() => {
|
||||
});
|
||||
onShow(() => {});
|
||||
|
||||
// 加载指南分类(guideType)
|
||||
const loadGuideTypes = async () => {
|
||||
@@ -464,7 +479,6 @@ const loadGuideTags = async () => {
|
||||
...tag,
|
||||
selected: false,
|
||||
}));
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("加载指南标签失败:", e);
|
||||
@@ -669,7 +683,7 @@ $accent-color: #4a90e2;
|
||||
gap: 5px;
|
||||
|
||||
.search-text {
|
||||
font-size:36rpx;
|
||||
font-size: 36rpx;
|
||||
color: $gray-medium;
|
||||
}
|
||||
}
|
||||
@@ -689,13 +703,12 @@ $accent-color: #4a90e2;
|
||||
gap: 3px;
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
text{
|
||||
margin-top:-1rpx;
|
||||
text {
|
||||
margin-top: -1rpx;
|
||||
&.active {
|
||||
color: #8b2316;
|
||||
color: #8b2316;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1158,7 +1171,7 @@ $accent-color: #4a90e2;
|
||||
padding: 8rpx 0; /* 去掉左右padding,仅保留上下 */
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
margin:8rpx 5rpx;
|
||||
margin: 8rpx 5rpx;
|
||||
border: 2rpx solid #efefef;
|
||||
transition: all 0.3s ease;
|
||||
width: 152rpx; /* 固定宽度 */
|
||||
|
||||
@@ -460,6 +460,19 @@ const downLoad = (item) => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "magazine_donwload",
|
||||
page_type: "诊疗指南",
|
||||
resource_name:item.title,
|
||||
belong:title.value,
|
||||
number:1,
|
||||
resource_option:item.tags
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
addDownloadTask({
|
||||
url: docUrl + item.path,
|
||||
title: item.title,
|
||||
@@ -485,6 +498,17 @@ const viewGuideline = (cell) => {
|
||||
if(item.id == cell.uuid) {
|
||||
console.log(2222222222);
|
||||
console.log(item.localPath);
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "detail_page",
|
||||
page_type: "诊疗指南",
|
||||
resource_name:cell.title,
|
||||
resource_option:cell.tags
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
// if(isAndroid){
|
||||
plus.runtime.openFile(item.localPath, function(e) {
|
||||
console.log('打开成功');
|
||||
|
||||
@@ -17,15 +17,16 @@
|
||||
|
||||
<view class="card-actions">
|
||||
<view class="action" @click="edit(item)">
|
||||
<text class="icon">✎</text>
|
||||
<up-image :src="editImg" width="30rpx" height="30rpx"></up-image>
|
||||
<text class="text">编辑</text>
|
||||
</view>
|
||||
<view class="action" @click="remove(item)">
|
||||
<text class="icon">🗑</text>
|
||||
<up-image :src="deleteImg" width="30rpx" height="30rpx"></up-image>
|
||||
<text class="text">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="addressList.length === 0" :emptyDesc="'暂无执业地点'"/>
|
||||
</view>
|
||||
|
||||
<!-- 底部新增按钮 -->
|
||||
@@ -41,9 +42,12 @@
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
import empty from '@/components/empty/empty.vue'
|
||||
import api from '@/api/api.js'
|
||||
import navTo from '@/utils/navTo'
|
||||
const title = ref('执业地点管理')
|
||||
import editImg from '@/static/edit_icon.png'
|
||||
import deleteImg from '@/static/delete_icon.png'
|
||||
const addressList = ref([])
|
||||
|
||||
const getTypeTag = (type) => {
|
||||
@@ -171,11 +175,11 @@ const addNew = () => {
|
||||
.action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
}
|
||||
|
||||
.icon { font-size: 26rpx; }
|
||||
.text { font-size: 26rpx; color: #666; }
|
||||
.text { font-size: 26rpx; color: #666; margin-left: 8rpx;margin-top: 3rpx;}
|
||||
|
||||
.bottom-actions {
|
||||
position: fixed;
|
||||
|
||||
@@ -99,6 +99,17 @@
|
||||
<!-- 底部导航栏 -->
|
||||
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'是否确定发送此患教科普'"
|
||||
:content="content"
|
||||
:confirmText="'发送'"
|
||||
:cancelText="'取消'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -111,7 +122,16 @@
|
||||
import api from "@/api/api.js"
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import navBar from '@/components/navBar/navBar.vue';
|
||||
const content=ref('');
|
||||
const noticeVisible=ref(false);
|
||||
const noticeConfirm=()=>{
|
||||
noticeVisible.value=false;
|
||||
content.value='';
|
||||
uni.$emit('articelItem', articeItem.value);
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
const type=ref(1)
|
||||
|
||||
@@ -125,6 +145,7 @@
|
||||
const activeTab = ref(0);
|
||||
const showFilter = ref(false);
|
||||
const isFilterActive = ref(false);
|
||||
const articeItem=ref(null);
|
||||
const toggleSort = () => {
|
||||
type.value = type.value === 1 ? 2 : 1;
|
||||
// 重置分页状态
|
||||
@@ -250,9 +271,11 @@
|
||||
|
||||
const goToDetail = (article) => {
|
||||
console.log('查看文章详情:', article);
|
||||
articeItem.value=article;
|
||||
noticeVisible.value=true;
|
||||
content.value=article.title;
|
||||
// 跳转到详情页
|
||||
uni.$emit('articelItem', article);
|
||||
uni.navigateBack();
|
||||
|
||||
};
|
||||
|
||||
// 跳转到搜索页面
|
||||
@@ -365,7 +388,7 @@ $padding-small: 10px;
|
||||
.top{
|
||||
width:100%;
|
||||
position: fixed;
|
||||
top:140rpx;
|
||||
top:calc(var(--status-bar-height) + 44px);
|
||||
}
|
||||
// 选项卡
|
||||
.tabs {
|
||||
@@ -447,7 +470,7 @@ $padding-small: 10px;
|
||||
.article-list {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top:240rpx;
|
||||
top:calc(var(--status-bar-height) + 44px + 100rpx);
|
||||
padding-bottom: 0rpx;
|
||||
.article-item {
|
||||
background-color: $white;
|
||||
@@ -458,7 +481,7 @@ $padding-small: 10px;
|
||||
gap: 12px;
|
||||
|
||||
.article-image {
|
||||
width: 80px;
|
||||
width: 160px;
|
||||
height: 80px;
|
||||
border-radius: $border-radius-small;
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 输入框上按钮组 -->
|
||||
<div class="msg-button-group">
|
||||
<!-- <div class="msg-button-group">
|
||||
<div
|
||||
@tap="handleAudioVisible"
|
||||
v-if="!(isWeb || isHarmonyOs || isGroupSend)"
|
||||
@@ -78,11 +78,11 @@
|
||||
<div class="msg-input-button">
|
||||
<Icon @tap="handleSendMoreVisible" type="send-more" :size="20" />
|
||||
</div>
|
||||
<!-- <div class="msg-input-button">
|
||||
<div class="msg-input-button">
|
||||
<Icon @tap="handleSetting" type="icon-shezhi" :size="20" />
|
||||
</div> -->
|
||||
</div>
|
||||
<div v-if="inputVisible" class="msg-input">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="msg-input">
|
||||
<!-- 当从表情面板切换到文字输入时,直接唤起键盘,会导致input框滚动消失,故此处需要用EmojiInput兼容下,保证先隐藏表情面板,再弹出键盘 -->
|
||||
<div
|
||||
v-show="showEmojiInput"
|
||||
@@ -96,7 +96,7 @@
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
<textarea
|
||||
v-show="!showEmojiInput"
|
||||
:focus="isFocus"
|
||||
class="msg-input-input"
|
||||
@@ -105,9 +105,9 @@
|
||||
isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')
|
||||
"
|
||||
v-model="inputText"
|
||||
type="text"
|
||||
:disabled="isTeamMute"
|
||||
:confirm-hold="true"
|
||||
:auto-height="true"
|
||||
cursor-spacing="20"
|
||||
adjust-position="true"
|
||||
confirm-type="send"
|
||||
@@ -116,6 +116,12 @@
|
||||
@input="handleInput"
|
||||
id="msg-input"
|
||||
/>
|
||||
<view class="rightbox">
|
||||
<view class="send-text-btn" v-if="inputText" @tap="handleSendTextMsg">
|
||||
发送
|
||||
</view>
|
||||
<up-image @tap="handleSendMoreVisible" v-else :src="addImg" width="68rpx" height="68rpx" ></up-image>
|
||||
</view>
|
||||
</div>
|
||||
<!-- 表情面板 -->
|
||||
<div v-if="emojiVisible" class="msg-emoji-panel" @click.stop="() => {}">
|
||||
@@ -157,6 +163,25 @@
|
||||
</div>
|
||||
<div class="icon-text">{{ t('albumText') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="send-more-panel-item-wrapper">
|
||||
<div
|
||||
class="send-more-panel-item"
|
||||
@tap="(event: any) => handleSendImageMsg('album', event)"
|
||||
>
|
||||
<image :src="picImg" mode="widthFix"></image>
|
||||
</div>
|
||||
<div class="icon-text">图片</div>
|
||||
</div>
|
||||
<div class="send-more-panel-item-wrapper">
|
||||
<div
|
||||
class="send-more-panel-item"
|
||||
@tap="(event: any) => handleSendImageMsg('camera', event)"
|
||||
>
|
||||
<image :src="cameraImg" mode="widthFix"></image>
|
||||
</div>
|
||||
<div class="icon-text">拍摄</div>
|
||||
</div>
|
||||
<div class="send-more-panel-item-wrapper">
|
||||
<div
|
||||
class="send-more-panel-item"
|
||||
@@ -171,7 +196,7 @@
|
||||
class="send-more-panel-item"
|
||||
@tap="(event: any) => handleCustom('hj', event)"
|
||||
>
|
||||
<image :src="quickImg" mode="widthFix"></image>
|
||||
<image :src="hjImg" mode="widthFix"></image>
|
||||
</div>
|
||||
<div class="icon-text">患教</div>
|
||||
</div>
|
||||
@@ -281,6 +306,20 @@
|
||||
</view>
|
||||
</view>
|
||||
</div>
|
||||
<unidialog
|
||||
:visible="outDialog"
|
||||
:content="'您是否发送您的出/停诊公告?'"
|
||||
@close="outDialog = false"
|
||||
@confirm="confirmOutDialog"
|
||||
>
|
||||
</unidialog>
|
||||
<unidialog
|
||||
:visible="mallDialog"
|
||||
:content="'您是否发送该商品详情?'"
|
||||
@close="mallDialog = false"
|
||||
@confirm="confirmMallDialog"
|
||||
>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -293,9 +332,11 @@ import { ref, getCurrentInstance, computed, onUnmounted, onMounted } from 'vue'
|
||||
import { ALLOW_AT, events, REPLY_MSG_TYPE_MAP } from '@/utils/im/constants'
|
||||
import { emojiMap } from '@/utils/im/emoji'
|
||||
import { t } from '@/utils/im/i18n'
|
||||
import { pathToBase64 } from "image-tools";
|
||||
import { handleNoPermission } from '@/utils/im/permission'
|
||||
import { customNavigateTo } from '@/utils/im/customNavigate'
|
||||
import MessageOneLine from '@/components/MessageOneLine.vue'
|
||||
import addImg from '@/static/addIcon.png';
|
||||
import {
|
||||
isAndroidApp,
|
||||
stopAllAudio,
|
||||
@@ -319,8 +360,11 @@ import quickImg from '@/static/quck_message.png'
|
||||
import chuzhenImg from '@/static/outpatient_true.png'
|
||||
import mallImg from '@/static/ytx_chattingfooter_shopping.png'
|
||||
import hospitalImg from '@/static/ytx_chatting_hospital.png'
|
||||
import hjImg from '@/static/huanjiao.png'
|
||||
import picImg from '@/static/im_icon_images_on.png'
|
||||
import cameraImg from '@/static/im_icon_camera_on.png'
|
||||
import {onShow,onUnload} from '@dcloudio/uni-app'
|
||||
|
||||
import unidialog from "@/components/dialog/dialog.vue";
|
||||
import {
|
||||
V2NIMTeam,
|
||||
V2NIMTeamChatBannedMode,
|
||||
@@ -343,6 +387,10 @@ let expert_name=userInfo.realName;
|
||||
let patient_uuid='';
|
||||
const articleInfo=ref({});
|
||||
const videoInfo=ref({});
|
||||
const textMsg=ref('');
|
||||
const outDialog = ref(false);
|
||||
const mallDialog = ref(false);
|
||||
|
||||
const patientListByGBK = async () => {
|
||||
|
||||
const res = await api.patientListByGBK();
|
||||
@@ -480,7 +528,8 @@ let rawStr="{\"gdxz_content\":\"我已入驻肝胆相照互联网医院,复诊
|
||||
const sendMallMsg = () => {
|
||||
showMallModal.value = false;
|
||||
//handleSendTextMsg('mall');
|
||||
senCustomMsg('mall');
|
||||
//senCustomMsg('mall');
|
||||
mallDialog.value = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -806,31 +855,86 @@ const handleAudioVisible = () => {
|
||||
}
|
||||
|
||||
/** 发送图片消息 */
|
||||
const handleSendImageMsg = () => {
|
||||
const handleSendImageMsg = (type) => {
|
||||
if (isTeamMute.value) return
|
||||
stopAllAudio()
|
||||
uni.$emit(events.CLOSE_PANEL)
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
//sizeType: ['compressed'],
|
||||
sourceType: [type],
|
||||
crop: {
|
||||
width: 800,
|
||||
height:800,
|
||||
resize: true,
|
||||
quality:100,
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('第一步成功');
|
||||
console.log(res.tempFilePaths)
|
||||
// const imgMsg = uni.$UIKitNIM.V2NIMMessageCreator.createImageMessage(
|
||||
// res.tempFilePaths[0]
|
||||
// )
|
||||
if(props.isGroupSend){
|
||||
const fileManager = uni.getFileSystemManager();
|
||||
fileManager.readFile({
|
||||
filePath: res.tempFilePaths[0],
|
||||
encoding: 'base64',
|
||||
success: (res) => {
|
||||
emits('send',{
|
||||
content:res.data,
|
||||
msg_type:2,
|
||||
console.log('第二步成功');
|
||||
uni.getImageInfo({
|
||||
src: res.tempFilePaths[0],
|
||||
success: (result) => {
|
||||
console.log('第三步成功');
|
||||
console.log(result);
|
||||
if(result.width > 1000){
|
||||
uni.compressImage({
|
||||
src: res.tempFilePaths[0],
|
||||
quality:100,
|
||||
success: (res2) => {
|
||||
console.log('第四 步成功');
|
||||
pathToBase64(res2.tempFilePath)
|
||||
.then((base64) => {
|
||||
console.log('转base64成功');
|
||||
console.log(base64);
|
||||
let img=base64.split(",")[1];
|
||||
emits('send',{
|
||||
content:img,
|
||||
msg_type:2,
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('chooseImage', error);
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('chooseImage', error)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
pathToBase64(res.tempFilePaths[0])
|
||||
.then((base64) => {
|
||||
console.log('转base64成功');
|
||||
console.log(base64);
|
||||
let img=base64.split(",")[1];
|
||||
emits('send',{
|
||||
content:img,
|
||||
msg_type:2
|
||||
})
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('chooseImage', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// const fileManager = uni.getFileSystemManager();
|
||||
// fileManager.readFile({
|
||||
// filePath: res.tempFilePaths[0],
|
||||
// encoding: 'base64',
|
||||
// success: (res) => {
|
||||
// emits('send',{
|
||||
// content:res.data,
|
||||
// msg_type:2,
|
||||
// })
|
||||
// },
|
||||
// fail: (error) => {
|
||||
// console.log('chooseImage', error)
|
||||
// }
|
||||
// })
|
||||
}else{
|
||||
const conversationId = ensureConversationId()
|
||||
if (!conversationId) return
|
||||
@@ -937,6 +1041,14 @@ const senCustomMsg = (type:string) => {
|
||||
}
|
||||
}
|
||||
|
||||
const confirmOutDialog = () => {
|
||||
outDialog.value = false;
|
||||
senCustomMsg('outpatient');
|
||||
}
|
||||
const confirmMallDialog = () => {
|
||||
mallDialog.value = false;
|
||||
senCustomMsg('mall')
|
||||
}
|
||||
const handleCustom = (type: string, event: any) => {
|
||||
if (isTeamMute.value) return
|
||||
if(type == 'reply'){
|
||||
@@ -957,7 +1069,8 @@ const handleCustom = (type: string, event: any) => {
|
||||
url: '/pages_chat/outpatient/outpatient',
|
||||
})
|
||||
}else{
|
||||
senCustomMsg('outpatient');
|
||||
//senCustomMsg('outpatient');
|
||||
outDialog.value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1317,23 +1430,52 @@ onUnmounted(() => {
|
||||
.msg-input-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #eff1f3;
|
||||
background-color: #fff;
|
||||
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.rightbox{
|
||||
width:100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 10rpx;
|
||||
.send-text-btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f0f0f0;
|
||||
padding: 0rpx 20rpx;
|
||||
height:38px;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 10rpx;
|
||||
// margin-top:-2rpx;
|
||||
margin-bottom:12rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
.msg-input {
|
||||
overflow-x: hidden;
|
||||
padding: 7px;
|
||||
background-color: #eff1f3;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
background-color: #fff;
|
||||
|
||||
&-input {
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
min-height: 40px;
|
||||
max-height: 120px;
|
||||
overflow-y: auto;
|
||||
line-height: 1.5;
|
||||
border-bottom: 1rpx solid #CCC;
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
padding: 0 12px;
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::placeholder {
|
||||
padding: 0 12px;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<view class="form-item">
|
||||
<view class="label">医院 <text class="required">*</text></view>
|
||||
<view class="value full">
|
||||
<input class="input" v-model.trim="form.hospital_name" placeholder="请输入医院名称" @input="onHospitalInput" @keydown.enter.prevent="onHospitalEnter" />
|
||||
<input class="input hospital-input" v-model.trim="form.hospital_name" placeholder="请输入医院名称" @input="onHospitalInput" @keydown.enter.prevent="onHospitalEnter" />
|
||||
<view v-if="showHospitalList" class="suggestion">
|
||||
<view v-for="h in hospitalList" :key="h.uuid" class="suggestion-item" @click="pickHospital(h)">
|
||||
{{ h.name }}
|
||||
@@ -34,7 +34,7 @@
|
||||
<view class="form-item">
|
||||
<view class="label">地址 <text class="required">*</text></view>
|
||||
<view class="value">
|
||||
<input class="input" v-model.trim="form.location" placeholder="请输入地址" />
|
||||
<input class="input" v-model.trim="form.location" placeholder="如门诊楼东侧502室" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -53,18 +53,70 @@
|
||||
</view>
|
||||
|
||||
<view class="bottom-actions">
|
||||
<view class="submit-btn" @click="submit">
|
||||
<view class="submit-btn" @click="alertDialog">
|
||||
<text class="btn-text">{{form.uuid?'确定修改':'确定新增'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'执业地点'"
|
||||
:cancelText="'返回修改'"
|
||||
:confirmText="'确认发布'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
<template v-slot:content>
|
||||
<view class="ppt-content">
|
||||
<view class="notice-row">
|
||||
<view class="name">医院:</view>
|
||||
<view class="value">{{ form.hospital_name }}</view>
|
||||
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">科室:</view>
|
||||
<view class="value">
|
||||
{{ form.office_name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">地址:</view>
|
||||
<view class="value">
|
||||
{{ form.location }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">门诊类型:</view>
|
||||
<view class="value" v-if="form.type==1">
|
||||
普通门诊
|
||||
</view>
|
||||
<view class="value" v-if="form.type==2">
|
||||
专家门诊
|
||||
</view>
|
||||
<view class="value" v-if="form.type==3">
|
||||
特需门诊
|
||||
</view>
|
||||
<view class="value" v-if="form.type==4">
|
||||
专科/专病门诊
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import api from '@/api/api.js'
|
||||
const noticeVisible = ref(false)
|
||||
const noticeConfirm = () => {
|
||||
noticeVisible.value = false
|
||||
submit()
|
||||
}
|
||||
|
||||
const pageTitle = ref('新增执业地点')
|
||||
const form = ref({
|
||||
@@ -72,7 +124,7 @@ const form = ref({
|
||||
hospital_name: '',
|
||||
office_name: '',
|
||||
location: '',
|
||||
type: 4
|
||||
type: 1
|
||||
})
|
||||
|
||||
const selectType = (t) => { form.value.type = t }
|
||||
@@ -111,9 +163,15 @@ const validate = () => {
|
||||
return ''
|
||||
}
|
||||
|
||||
const submit = async () => {
|
||||
|
||||
|
||||
const alertDialog = () => {
|
||||
const err = validate()
|
||||
if (err) { uni.showToast({ title: err, icon: 'none' }); return }
|
||||
noticeVisible.value = true
|
||||
}
|
||||
const submit = async () => {
|
||||
|
||||
// 示例更新接口;若不存在可替换为新增或本地处理
|
||||
try {
|
||||
const res =form.value.uuid?await api.updateWorkPlace(form.value) : await api.addWorkPlace(form.value)
|
||||
@@ -146,8 +204,31 @@ onLoad((options) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.notice-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
.name{
|
||||
width: 160rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.value{
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.edit-address-page { min-height: 100vh; background: #fff; }
|
||||
.form-container { padding: 24rpx;margin-top: calc(var(--status-bar-height) + 44px); }
|
||||
.form-container {
|
||||
padding: 0 24rpx;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 160rpx;
|
||||
overflow-y: scroll;
|
||||
z-index: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form-item { display: flex; align-items: center; justify-content: space-between; padding: 24rpx 0; }
|
||||
.form-item.column { flex-direction: column; align-items: flex-start; }
|
||||
@@ -158,7 +239,9 @@ onLoad((options) => {
|
||||
.value-text { font-size: 30rpx; color: #333; }
|
||||
.value-text.placeholder { color: #999; }
|
||||
.input { width: 100%; font-size: 30rpx; color: #333; }
|
||||
|
||||
.hospital-input{
|
||||
padding-left:24rpx;
|
||||
}
|
||||
.suggestion { position: absolute; top: 84rpx; left: 0; right: 0; background: #fff; border: 2rpx solid #eee; border-radius: 10rpx; max-height: 480rpx; overflow-y: auto; z-index: 10; }
|
||||
.suggestion-item { padding: 20rpx 24rpx; font-size: 28rpx; color: #333; border-bottom: 2rpx solid #f5f5f5; }
|
||||
.suggestion-item:last-child { border-bottom: 0; }
|
||||
|
||||
@@ -34,16 +34,18 @@
|
||||
<view class="card" >
|
||||
|
||||
<view class="card-body">
|
||||
|
||||
<view class="leftcircel"></view>
|
||||
<view class="rightcircel"></view>
|
||||
<view class="card-header">
|
||||
<text class="label">{{ item.realname.split(',').length }}位患者:</text>
|
||||
<view class="close" @click="delGroupSendMsg(item)">
|
||||
<text>×</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line" >
|
||||
<view class="line name" >
|
||||
{{ item.realname }}
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="line phone" v-if="item.msg_type==1">
|
||||
{{ item.msg_content }}
|
||||
</view>
|
||||
@@ -52,7 +54,7 @@
|
||||
</view>
|
||||
<view class="line phone" v-if="item.msg_type==3" @click="onDetail(item)">
|
||||
<view class="custom">
|
||||
<view class="title">{{JSON.parse(item.msg_content).summary }}</view>
|
||||
<view class="title">{{JSON.parse(item.msg_content).topic }}</view>
|
||||
<view class="row">
|
||||
<view class="left">{{ docUrl+JSON.parse(item.msg_content).path }}</view>
|
||||
<view class="right">
|
||||
@@ -102,14 +104,9 @@
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view class="card" v-else>
|
||||
<view class="card-header">
|
||||
<text class="label">群发消息记录</text>
|
||||
</view>
|
||||
<view class="card-body">
|
||||
<view class="line">暂无群发消息记录</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<empty :emptyDesc="'暂无群发消息记录'" v-else></empty>
|
||||
|
||||
|
||||
<!-- 加载状态 -->
|
||||
<view class="loading-state" v-if="loading">
|
||||
@@ -129,7 +126,7 @@
|
||||
<view class="bottom-bar" @click="openModal">
|
||||
<view class="btn-primary" >群发消息</view>
|
||||
</view>
|
||||
<!-- 弹窗与遮罩 -->
|
||||
<!-- 选择弹窗 -->
|
||||
<view v-if="showModal" class="mask" @click="closeModal"></view>
|
||||
<view v-if="showModal" class="center-modal">
|
||||
<view class="modal-title">温馨提示</view>
|
||||
@@ -152,6 +149,7 @@ import api from '@/api/api.js'
|
||||
import { onShow,onBackPress,onLoad } from '@dcloudio/uni-app'
|
||||
import docUrl from '@/utils/docUrl.js'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import empty from '@/components/empty/empty.vue'
|
||||
const currentTime = ref('')
|
||||
const patientCount = ref(1)
|
||||
const patientName = ref('测试')
|
||||
@@ -170,10 +168,12 @@ onLoad((options) => {
|
||||
}
|
||||
});
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
}
|
||||
// if(!from.value){
|
||||
// plus.runtime.quit();
|
||||
// return true;
|
||||
// }
|
||||
plus.runtime.quit();
|
||||
return true;
|
||||
});
|
||||
const goBack = () => {
|
||||
if(!from.value){
|
||||
@@ -296,7 +296,7 @@ onMounted(() => {
|
||||
|
||||
})
|
||||
onShow(() => {
|
||||
listGroupSendMsg()
|
||||
listGroupSendMsg(true)
|
||||
})
|
||||
const onBack = () => {
|
||||
uni.navigateBack()
|
||||
@@ -470,7 +470,7 @@ $red: #D32F2F;
|
||||
// 滚动容器样式
|
||||
.scroll-container {
|
||||
position: fixed;
|
||||
top: 180rpx;
|
||||
top: calc(var(--status-bar-height) + 62px);
|
||||
width:100%;
|
||||
bottom: 107rpx;
|
||||
|
||||
@@ -479,7 +479,7 @@ $red: #D32F2F;
|
||||
.time-row {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
padding: 32rpx 0;
|
||||
padding: 8rpx 0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@@ -507,8 +507,9 @@ $red: #D32F2F;
|
||||
margin: 24rpx 0;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.06);
|
||||
|
||||
overflow: hidden;
|
||||
border-top:12rpx solid #8B2316;
|
||||
.card-header {
|
||||
position: relative;
|
||||
padding: 28rpx 28rpx 12rpx 28rpx;
|
||||
@@ -516,10 +517,10 @@ $red: #D32F2F;
|
||||
.label { font-size: 32rpx; color: #333; }
|
||||
.close {
|
||||
position: absolute;
|
||||
right: -30rpx;
|
||||
top: -36rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
right: -13rpx;
|
||||
top: -28rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-bottom-left-radius: 100rpx;
|
||||
background: #8B2316;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
@@ -527,26 +528,57 @@ $red: #D32F2F;
|
||||
}
|
||||
}
|
||||
.card-body {
|
||||
padding: 20rpx 28rpx 8rpx 28rpx;
|
||||
.line { font-size: 32rpx; color: #333; padding: 16rpx 0; }
|
||||
.phone { font-size: 36rpx; }
|
||||
position: relative;
|
||||
.leftcircel{
|
||||
position: absolute;
|
||||
left: -20rpx;;
|
||||
top: 156rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
z-index: 2;
|
||||
background: #f5f5f5;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.rightcircel{
|
||||
position: absolute;
|
||||
right: -20rpx;
|
||||
z-index: 2;
|
||||
top: 156rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.line { font-size: 32rpx; color: #666; padding: 16rpx 0; }
|
||||
.divider{
|
||||
height: 2rpx;
|
||||
background: #eee;
|
||||
margin: 10rpx 0;
|
||||
}
|
||||
.name{
|
||||
padding:20rpx 28rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
.phone {
|
||||
word-break: break-all;
|
||||
font-size: 36rpx;color:#000;
|
||||
padding: 0 28rpx 20rpx;
|
||||
}
|
||||
}
|
||||
.card-footer {
|
||||
display: flex;
|
||||
background:#f1ebeb;
|
||||
justify-content: flex-end;
|
||||
padding: 16rpx 28rpx 28rpx 28rpx;
|
||||
padding: 18rpx 28rpx 18rpx 28rpx;
|
||||
.btn-outline {
|
||||
border: 2rpx solid $red;
|
||||
color: $red;
|
||||
padding: 10rpx 24rpx;
|
||||
border: 2rpx solid #8B2316;
|
||||
color: #8B2316;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 28rpx;
|
||||
font-size: 28rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.spacer { height: 200rpx; }
|
||||
|
||||
.bottom-bar {
|
||||
position: fixed;
|
||||
left: 0; right: 0; bottom: 0;
|
||||
|
||||
@@ -23,7 +23,10 @@
|
||||
|
||||
<!-- 警告提示区域 -->
|
||||
<view class="warning-section">
|
||||
<view class="warning-icon">🔔</view>
|
||||
<view class="iconbox">
|
||||
<uni-icons type="notification" size="24" color="#e65100"></uni-icons>
|
||||
</view>
|
||||
<view class="bar"></view>
|
||||
<text class="warning-text"
|
||||
>若群发消息选择患者过多(建议少于200人), 部分患者可能将延迟收到消息</text
|
||||
>
|
||||
@@ -85,6 +88,7 @@
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -94,6 +98,7 @@ import api from "@/api/api.js";
|
||||
import { events } from "@/utils/im/constants";
|
||||
import { onShow,onLoad,onUnload } from "@dcloudio/uni-app";
|
||||
import navTo from "@/utils/navTo.js";
|
||||
import unidialog from "@/components/dialog/dialog.vue";
|
||||
import MessageInput from "@/pages_chat/chat/message/message-input.vue";
|
||||
const showModal = ref(false);
|
||||
const selectedPatients = ref([]);
|
||||
@@ -103,6 +108,7 @@ const conversationType = ref("1");
|
||||
const msg_content = ref("");
|
||||
const msg_type = ref("1");
|
||||
const to = ref("");
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.from == 'chatMsg'){
|
||||
from.value = 'chatMsg';
|
||||
@@ -221,13 +227,27 @@ $red: #d32f2f;
|
||||
|
||||
// 警告提示区域
|
||||
.warning-section {
|
||||
.bar{
|
||||
width: 2rpx;
|
||||
height: 60rpx;
|
||||
margin:0 30rpx;
|
||||
background: #CCC;
|
||||
}
|
||||
.iconbox{
|
||||
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 24rpx 30rpx;
|
||||
background: #fff8e1;
|
||||
border-left: 6rpx solid #ff9800;
|
||||
margin: 20rpx 30rpx;
|
||||
margin-top: calc(var(--status-bar-height) + 64px);
|
||||
align-items: center;
|
||||
padding: 24rpx 22rpx;
|
||||
background: #fff;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.warning-icon {
|
||||
@@ -238,7 +258,8 @@ $red: #d32f2f;
|
||||
|
||||
.warning-text {
|
||||
font-size: 26rpx;
|
||||
color: #e65100;
|
||||
color: #666;
|
||||
|
||||
line-height: 1.5;
|
||||
flex: 1;
|
||||
}
|
||||
@@ -246,12 +267,17 @@ $red: #d32f2f;
|
||||
|
||||
// 消息预览卡片
|
||||
.message-preview-card {
|
||||
top: calc(var(--status-bar-height) + 200rpx);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
margin: 30rpx;
|
||||
background: #fff;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||
overflow: hidden;
|
||||
border-top: 6rpx solid $red;
|
||||
border-top: 11rpx solid $red;
|
||||
|
||||
.card-header {
|
||||
position: relative;
|
||||
@@ -259,6 +285,7 @@ $red: #d32f2f;
|
||||
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
padding:0 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@@ -287,8 +314,8 @@ $red: #d32f2f;
|
||||
|
||||
.patient-list {
|
||||
.patient-name {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
v-model="outpatientInfo"
|
||||
placeholder="请输入门诊信息..."
|
||||
:maxlength="500"
|
||||
:adjust-position="false"
|
||||
:auto-height="true"
|
||||
></textarea>
|
||||
|
||||
@@ -54,7 +55,11 @@ const addOutPatientA = () => {
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==0){
|
||||
uni.navigateBack()
|
||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -137,16 +137,55 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'门诊安排'"
|
||||
:cancelText="'返回修改'"
|
||||
:confirmText="'确认发布'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
<template v-slot:content>
|
||||
<view class="ppt-content">
|
||||
<view class="notice-row">
|
||||
<view class="name">门诊时间:</view>
|
||||
<view class="value" style="display: flex;align-items: center;gap: 10rpx;">
|
||||
<text class="weekday-text">{{ getWeekdayText(selectedWeekday) }}</text>
|
||||
<text class="time-text">{{ getTimePeriodText(selectedTimePeriod) }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">门诊地点:</view>
|
||||
<view class="value">
|
||||
<text class="value-text">{{ selectedLocation.hospital_name }};</text>
|
||||
<text class="value-text">{{ selectedLocation.office_name }};</text>
|
||||
<text class="value-text">{{ selectedLocation.location }};</text>
|
||||
<text class="value-text">
|
||||
{{ getTypeText(selectedLocation.type) }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import api from "@/api/api.js";
|
||||
import navTo from '@/utils/navTo'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
const title = ref('增加门诊安排')
|
||||
const uuid=ref('')
|
||||
const noticeVisible=ref(false)
|
||||
const noticeConfirm = () => {
|
||||
noticeVisible.value = false
|
||||
submit()
|
||||
}
|
||||
// 响应式数据
|
||||
const selectedWeekday = ref(null)
|
||||
const selectedTimePeriod = ref('')
|
||||
@@ -155,6 +194,14 @@ const selectedLocation = ref({})
|
||||
const map = { 1: '普通门诊', 2: '专家门诊', 3: '特需门诊', 4: '专科/专病门诊' }
|
||||
return map[type] || '普通门诊'
|
||||
}
|
||||
const getWeekdayText = (weekday) => {
|
||||
const map = { 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六', 7: '周日' }
|
||||
return map[weekday]
|
||||
}
|
||||
const getTimePeriodText = (timePeriod) => {
|
||||
const map = { a: '上午', b: '下午', c: '晚上', d: '全天' }
|
||||
return map[timePeriod]
|
||||
}
|
||||
onShow(()=>{
|
||||
listWorkPlace()
|
||||
})
|
||||
@@ -166,8 +213,13 @@ const workPlaceList=ref([])
|
||||
const listWorkPlace=async()=>{
|
||||
const res = await api.listWorkPlace()
|
||||
if(res.code == 200){
|
||||
workPlaceList.value = res.data
|
||||
|
||||
workPlaceList.value = res.data;
|
||||
for(let i=0;i<workPlaceList.value.length;i++){
|
||||
if(workPlaceList.value[i].uuid == selectedLocation.value.uuid){
|
||||
chooseLocation(workPlaceList.value[i]);
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const selectWeekday = (weekday) => {
|
||||
@@ -186,10 +238,12 @@ const addOutPatient=async()=>{
|
||||
title: '发布成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.$emit('updateOutPatient');
|
||||
uni.navigateBack()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const updateOutPatient=async()=>{
|
||||
const res = await api.updateOutPatient({
|
||||
uuid: uuid.value,
|
||||
@@ -197,7 +251,7 @@ const updateOutPatient=async()=>{
|
||||
type:1,
|
||||
week: selectedWeekday.value,
|
||||
day: selectedTimePeriod.value,
|
||||
workplace_uuid: selectedLocation.value
|
||||
workplace_uuid: selectedLocation.value.uuid
|
||||
})
|
||||
|
||||
if(res.code == 200){
|
||||
@@ -205,6 +259,7 @@ if(res.code == 200){
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.$emit('updateOutPatient')
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
@@ -213,12 +268,20 @@ const selectTimePeriod = (period) => {
|
||||
}
|
||||
|
||||
const chooseLocation = (item) => {
|
||||
console.log(item)
|
||||
selectedLocation.value = item
|
||||
}
|
||||
const getType=(type)=>{
|
||||
const map = { 1: 'a', 2: 'b', 3: 'c', 4: 'd' }
|
||||
return map[type]
|
||||
}
|
||||
const submit=()=>{
|
||||
if(uuid.value){
|
||||
updateOutPatient()
|
||||
}else{
|
||||
addOutPatient()
|
||||
}
|
||||
}
|
||||
const confirmPublish = () => {
|
||||
if (!selectedWeekday.value) {
|
||||
uni.showToast({
|
||||
@@ -236,7 +299,7 @@ const confirmPublish = () => {
|
||||
return
|
||||
}
|
||||
|
||||
if (!selectedLocation.value) {
|
||||
if (!selectedLocation.value.uuid) {
|
||||
uni.showToast({
|
||||
title: '请选择门诊地点',
|
||||
icon: 'none'
|
||||
@@ -244,11 +307,7 @@ const confirmPublish = () => {
|
||||
return
|
||||
}
|
||||
|
||||
if(uuid.value){
|
||||
updateOutPatient()
|
||||
}else{
|
||||
addOutPatient()
|
||||
}
|
||||
noticeVisible.value = true
|
||||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
@@ -256,7 +315,8 @@ const confirmPublish = () => {
|
||||
uuid.value = options.uuid;
|
||||
selectedWeekday.value = options.week;
|
||||
selectedLocation.value.uuid = options.workplace_uuid;
|
||||
selectedTimePeriod.value = getType(options.type);
|
||||
selectedTimePeriod.value =options.type;
|
||||
|
||||
if(uuid.value){
|
||||
title.value = '编辑门诊安排'
|
||||
}
|
||||
@@ -264,6 +324,13 @@ const confirmPublish = () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.value .weekday-text{
|
||||
color:red
|
||||
}
|
||||
.value .time-text{
|
||||
color:red;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.add-schedule-page {
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
@@ -329,6 +396,26 @@ const confirmPublish = () => {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.notice-row{
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
.name{
|
||||
width: 160rpx;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
.value{
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
text-align: left;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 34rpx;
|
||||
@@ -362,7 +449,6 @@ const confirmPublish = () => {
|
||||
.title-text {
|
||||
font-size: 32rpx;
|
||||
color: #8B2316;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.required-mark {
|
||||
@@ -543,6 +629,5 @@ const confirmPublish = () => {
|
||||
.btn-text {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">备注信息</text>
|
||||
<textarea class="form-textarea" placeholder="请输入备注信息" v-model="formData.remarks" />
|
||||
<textarea class="form-textarea" placeholder="请输入备注信息" v-model="formData.remarks" :adjust-position="false"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
>
|
||||
<template #right>
|
||||
<view class="nav-right">
|
||||
<up-icon name="share" color="#8B2316" size="24"></up-icon>
|
||||
<up-icon name="map" color="#8B2316" size="24" @click="goSite"></up-icon>
|
||||
<up-image :src="shareIcon" width="36rpx" height="36rpx" @click="shareToggle"></up-image>
|
||||
<!-- <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>
|
||||
</uni-nav-bar>
|
||||
@@ -34,17 +35,26 @@
|
||||
</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">
|
||||
<image :src="dateBg" mode="widthFix" class="date-bg"></image>
|
||||
<view class="card-header">
|
||||
<view class="date-tag">
|
||||
<view class="tag-dot"></view>
|
||||
<view class="date-tag" >
|
||||
|
||||
<text class="tag-date">{{ formatDate(announcement.expire_date) }}</text>
|
||||
</view>
|
||||
<view class="delete-btn" @click="deleteAnnouncement(announcement.uuid)">
|
||||
<text class="delete-icon">−</text>
|
||||
<uni-icons type="minus" size="30" color="#8B2316" ></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -58,7 +68,7 @@
|
||||
<text class="info-label">停诊时间:</text>
|
||||
<text class="info-value">{{ announcement.date_list[0]?.param1 }} ~ {{ announcement.date_list[0]?.param2 }}</text>
|
||||
</view>
|
||||
|
||||
<view class="divider"></view>
|
||||
<view class="info-row remarks-row">
|
||||
<text class="info-label">备注:</text>
|
||||
<view class="remarks-input" v-if="announcement.note">{{ announcement.note }}</view>
|
||||
@@ -68,7 +78,7 @@
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="stopOutPatientList.length === 0" class="empty-state">
|
||||
<text class="empty-text">暂无停诊公告</text>
|
||||
<empty :emptyDesc="'暂无停诊公告'"></empty>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -105,11 +115,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>
|
||||
@@ -117,10 +127,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-state">
|
||||
<text class="empty-text">暂无门诊安排</text>
|
||||
<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">
|
||||
@@ -131,9 +145,48 @@
|
||||
|
||||
<!-- 浮动编辑按钮 -->
|
||||
<view class="floating-edit-btn" @click="editAnnouncement">
|
||||
<text class="edit-icon">✎</text>
|
||||
<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>
|
||||
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:content="content"
|
||||
@close="noticeCancel"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -141,16 +194,80 @@ 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 shareIcon from '@/static/icon_share.png'
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
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 isEdit = ref(false);
|
||||
const noticeVisible = ref(false);
|
||||
const SHARE_TITLE = ref('医生门诊详情')
|
||||
const SHARE_SUMMARY = '肝胆相照®肝胆病在线服务平台'
|
||||
const content = ref('您的出/停诊信息有改动,是否通知您的患者?');
|
||||
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 patient_user_uuid = ref('');
|
||||
const isLock=ref(true)
|
||||
// 响应式数据
|
||||
const from = ref('');
|
||||
const currentTab = ref('suspension')
|
||||
const remarks = ref('')
|
||||
|
||||
const note = ref('')
|
||||
|
||||
const patientList = ref([]);
|
||||
const outpatientSchedules = ref([])
|
||||
const outPatientList = ref([]);
|
||||
const patientListByGBK=()=>{
|
||||
api.patientListByGBK().then(res=>{
|
||||
if(res.code==1){
|
||||
isLock.value = false;
|
||||
patientList.value = res.data;
|
||||
console.log(res.data)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const noticeConfirm = () => {
|
||||
noticeVisible.value = false;
|
||||
if(patientList.value.length >= 200 || isLock.value){
|
||||
uni.sendNativeEvent(
|
||||
"goGroupMessagePage",
|
||||
{
|
||||
msg: "goGroupMessagePage",
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
}
|
||||
);
|
||||
// navTo({
|
||||
// url:'/pages_chat/groupMessage/groupMessage?from=outPatient'
|
||||
// })
|
||||
}else{
|
||||
publishOutPatient();
|
||||
}
|
||||
|
||||
}
|
||||
const noticeCancel=()=>{
|
||||
noticeVisible.value = false;
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
onBackPress(() => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
@@ -161,15 +278,69 @@ onLoad((options) => {
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
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+'医生门诊详情'
|
||||
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "list_page",
|
||||
page_type: "出/停诊公告",
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
patientListByGBK();
|
||||
});
|
||||
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([]);
|
||||
@@ -194,6 +365,26 @@ const goSite = () => {
|
||||
url: '/pages_chat/addAddress/addAddress'
|
||||
})
|
||||
}
|
||||
const publishOutPatient = async (uuid) => {
|
||||
let uuids='';
|
||||
for(let i=0;i<patientList.value.length;i++){
|
||||
if(uuids){
|
||||
uuids+=','+patientList.value[i].uuid;
|
||||
}else{
|
||||
uuids += patientList.value[i].uuid;
|
||||
}
|
||||
}
|
||||
const res = await api.publishOutPatient({
|
||||
msg_type:'5',
|
||||
msg_content:'',
|
||||
patient_user_uuid:uuids
|
||||
})
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
const getStopReason = (type) => {
|
||||
const reasonMap = {
|
||||
1: '出差',
|
||||
@@ -222,8 +413,9 @@ const getWeekdayByWeek = (week) => {
|
||||
const getTimePeriod = (day) => {
|
||||
const timeMap = {
|
||||
'a': '上午',
|
||||
'p': '下午',
|
||||
'd': '晚上'
|
||||
'b': '下午',
|
||||
'c': '晚上',
|
||||
'd': '全天'
|
||||
};
|
||||
return timeMap[day] || '晚上';
|
||||
}
|
||||
@@ -240,18 +432,147 @@ const getTypeText = (type) => {
|
||||
}
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
console.log(isEdit.value);
|
||||
if(isEdit.value){
|
||||
noticeVisible.value = true;
|
||||
}else{
|
||||
if(!from.value){
|
||||
plus.runtime.quit();
|
||||
}else{
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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({})
|
||||
if (res && res.code === 200 && Array.isArray(res.data)) {
|
||||
addressList.value = res.data
|
||||
}
|
||||
}
|
||||
|
||||
const addNew = () => {
|
||||
@@ -262,9 +583,14 @@ const addNew = () => {
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
console.log('onShow')
|
||||
getStopOutPatientList();
|
||||
getListOutPatient();
|
||||
|
||||
getListOutPatient(true);
|
||||
fetchList();
|
||||
uni.$on('updateOutPatient',()=>{
|
||||
isEdit.value = true;
|
||||
console.log('更新');
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -273,7 +599,7 @@ const switchTab = (tab) => {
|
||||
if(tab=='suspension'){
|
||||
getStopOutPatientList();
|
||||
}else{
|
||||
getListOutPatient();
|
||||
getListOutPatient(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,6 +617,11 @@ const deleteAnnouncement = async (uuid) => {
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
if(stopOutPatientList.value.length-1>0){
|
||||
isEdit.value=true;
|
||||
}else{
|
||||
isEdit.value=false;
|
||||
}
|
||||
getStopOutPatientList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -331,20 +662,29 @@ const editAnnouncement = () => {
|
||||
|
||||
// 刷新数据
|
||||
const refreshData = () => {
|
||||
getListOutPatient();
|
||||
getListOutPatient(true);
|
||||
getStopOutPatientList();
|
||||
}
|
||||
|
||||
// 门诊安排相关方法
|
||||
const addSchedule = () => {
|
||||
navTo({
|
||||
if(addressList.value.length === 0){
|
||||
uni.showToast({
|
||||
title: '请先点击右上角设置执业地点',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
}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}`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -358,11 +698,16 @@ const deleteSchedule = async (uuid) => {
|
||||
const deleteRes = await api.deleteOutPatient({ uuid });
|
||||
if (deleteRes.code === 200) {
|
||||
outPatientList.value = outPatientList.value.filter(item => item.uuid !== uuid);
|
||||
if(outPatientList.value.length>0){
|
||||
isEdit.value=true;
|
||||
}else{
|
||||
isEdit.value=false;
|
||||
}
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
getListOutPatient();
|
||||
getListOutPatient(true);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: deleteRes.msg || '删除失败',
|
||||
@@ -379,6 +724,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>
|
||||
@@ -437,7 +800,12 @@ const deleteSchedule = async (uuid) => {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.divider{
|
||||
width: 100%;
|
||||
height: 2rpx;
|
||||
background-color: #ccc;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
/* 导航栏样式 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
@@ -500,7 +868,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;
|
||||
@@ -531,20 +902,37 @@ 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;
|
||||
}
|
||||
|
||||
/* 停诊公告卡片 */
|
||||
.announcement-card {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
margin:0 30rpx 20rpx;
|
||||
position: relative;
|
||||
.date-bg{
|
||||
position: absolute;
|
||||
top: 30rpx;
|
||||
left: -12rpx;;
|
||||
width: 241rpx;
|
||||
height: 64rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding:30rpx 30rpx 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -552,30 +940,28 @@ const deleteSchedule = async (uuid) => {
|
||||
}
|
||||
|
||||
.date-tag {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #20c997;
|
||||
padding: 10rpx 20rpx;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 10rpx 8rpx;
|
||||
border-radius: 20rpx;
|
||||
gap: 10rpx;
|
||||
|
||||
}
|
||||
|
||||
.tag-dot {
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
.tag-date {
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.announcement-card .delete-btn {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background-color: #8B2316;
|
||||
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -596,7 +982,8 @@ const deleteSchedule = async (uuid) => {
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
margin: 0 30rpx 20rpx;
|
||||
|
||||
}
|
||||
|
||||
.info-label {
|
||||
@@ -614,6 +1001,14 @@ const deleteSchedule = async (uuid) => {
|
||||
|
||||
.remarks-row {
|
||||
align-items: flex-start;
|
||||
.info-label{
|
||||
font-size: 26rpx;
|
||||
|
||||
}
|
||||
.info-value{
|
||||
font-size: 26rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.remarks-input {
|
||||
@@ -641,16 +1036,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;
|
||||
@@ -658,8 +1059,9 @@ const deleteSchedule = async (uuid) => {
|
||||
align-items: flex-start;
|
||||
}
|
||||
.schedule-left {
|
||||
height: 200rpx;
|
||||
border-right: 2rpx solid #f0f0f0;
|
||||
min-height: 200rpx;
|
||||
padding:20rpx 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
@@ -679,8 +1081,10 @@ const deleteSchedule = async (uuid) => {
|
||||
}
|
||||
|
||||
.schedule-right {
|
||||
border-left: 2rpx solid #f0f0f0;
|
||||
flex: 1;
|
||||
height: 200rpx;
|
||||
min-height: 200rpx;
|
||||
padding:20rpx 0;
|
||||
margin-left: 30prx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -706,13 +1110,10 @@ const deleteSchedule = async (uuid) => {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15rpx;
|
||||
}
|
||||
|
||||
|
||||
.location {
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
@@ -735,9 +1136,10 @@ const deleteSchedule = async (uuid) => {
|
||||
border: 2rpx solid #8B2316;
|
||||
border-radius: 20rpx;
|
||||
padding:2rpx 16rpx;
|
||||
white-space: nowrap;
|
||||
font-size: 20rpx;
|
||||
color: #8B2316;
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -755,7 +1157,7 @@ const deleteSchedule = async (uuid) => {
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
cursor: pointer;
|
||||
@@ -763,14 +1165,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 {
|
||||
@@ -781,6 +1176,8 @@ const deleteSchedule = async (uuid) => {
|
||||
white-space: nowrap;
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
margin-top: 5rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.edit-btn .action-text {
|
||||
@@ -788,7 +1185,7 @@ const deleteSchedule = async (uuid) => {
|
||||
}
|
||||
|
||||
.delete-btn .action-text {
|
||||
color: #e74c3c;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 底部操作按钮 */
|
||||
@@ -797,6 +1194,7 @@ const deleteSchedule = async (uuid) => {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
padding: 30rpx;
|
||||
background-color: #fff;
|
||||
border-top: 1rpx solid #eee;
|
||||
@@ -817,7 +1215,7 @@ const deleteSchedule = async (uuid) => {
|
||||
/* 浮动编辑按钮 */
|
||||
.floating-edit-btn {
|
||||
position: fixed;
|
||||
bottom: 120rpx;
|
||||
bottom: 180rpx;
|
||||
right: 30rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
@@ -833,4 +1231,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>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<view class="form-item">
|
||||
<text class="form-label">备注信息</text>
|
||||
<textarea class="form-textarea" placeholder="请输入备注信息" v-model="formData.remarks" />
|
||||
<textarea class="form-textarea" placeholder="请输入备注信息" v-model="formData.remarks" :adjust-position="false"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<view class="patient-group-page">
|
||||
|
||||
<!-- 头部 -->
|
||||
<uni-nav-bar
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<uni-nav-bar
|
||||
left-icon="left"
|
||||
title="患者分组"
|
||||
@clickLeft="goBack"
|
||||
fixed
|
||||
color="#8B2316"
|
||||
height="180rpx"
|
||||
:border="false"
|
||||
backgroundColor="#eeeeee"
|
||||
>
|
||||
@@ -16,6 +16,7 @@
|
||||
<view class="save-text" @click="confirmGroup">确定({{ totalSelectedCount }})</view>
|
||||
</template>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
<!-- 筛选排序栏 -->
|
||||
<!-- <view class="filter-sort-bar">
|
||||
<view class="sort-section" @click="toggleGroupSort">
|
||||
@@ -82,9 +83,16 @@
|
||||
<view class="patient-list" v-if="openGroups[gi]">
|
||||
<view class="patient-item" v-for="(patient, index) in (group.patientList || [])" :key="patient.uuid || index">
|
||||
|
||||
<view class="patient-avatar">
|
||||
<up-image :src="docUrl + patient.photo" width="80rpx" height="80rpx" mode="aspectFill"></up-image>
|
||||
<view class="namebox">
|
||||
<view class="patient-avatar">
|
||||
<up-image :src="patient._avatarLoadError ? defaultImg : getPatientAvatar(patient)" width="80rpx" height="80rpx" mode="aspectFill" @error="handlePatientAvatarError(patient)"></up-image>
|
||||
</view>
|
||||
<view class="name">
|
||||
<view class="real">{{ patient.realName}}</view>
|
||||
<view class="nick" v-if="patient.nickname">{{ patient.nickname}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="patient-checkbox" @click.stop="togglePatientSelection(gi, patient, index)">
|
||||
<view class="checkbox" :class="{ 'checked': isPatientSelected(gi, patient, index) }">
|
||||
<uni-icons v-if="isPatientSelected(gi, patient, index)" type="checkmarkempty" color="#8B2316" size="16"></uni-icons>
|
||||
@@ -94,6 +102,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="groups.length == 0" :emptyDesc="'暂无分组'" />
|
||||
</scroll-view>
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom-bar">
|
||||
@@ -103,16 +112,18 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed, onMounted,nextTick} from 'vue';
|
||||
import { onShow,onLoad } from "@dcloudio/uni-app";
|
||||
import upImg from "@/static/triangle_green_theme.png"
|
||||
import downImg from "@/static/triangle_normal.png"
|
||||
import groupRightImg from "@/static/groupright_big.png"
|
||||
import groupDownImg from "@/static/groupup_big.png"
|
||||
import defaultImg from "@/static/default.png"
|
||||
import api from '@/api/api.js';
|
||||
import docUrl from '@/utils/docUrl'
|
||||
import dayjs from 'dayjs'
|
||||
import navTo from '@/utils/navTo.js'
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
const list_sort = ref(0);
|
||||
const group_sort = ref(0);
|
||||
|
||||
@@ -160,9 +171,16 @@ const selectedPatientCount = computed(() => {
|
||||
|
||||
// 合计数量:只计算去重后的患者数量
|
||||
const totalSelectedCount = computed(() => selectedPatientCount.value);
|
||||
|
||||
onShow(() => {
|
||||
const from = ref('');
|
||||
onLoad((options) => {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
});
|
||||
fetchGroupList();
|
||||
if(options.from){
|
||||
from.value = options.from;
|
||||
}
|
||||
});
|
||||
|
||||
const fetchGroupList = async () => {
|
||||
@@ -183,6 +201,9 @@ const fetchGroupList = async () => {
|
||||
// 若组选中但患者为空,则保持组选中;否则按患者是否全选同步组选中状态
|
||||
updateGroupSelectionByPatients(idx);
|
||||
});
|
||||
nextTick(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -268,6 +289,10 @@ const chooseGroupSort = (type) => {
|
||||
};
|
||||
const confirmGroup = () => {
|
||||
// 收集已选患者,并做去重
|
||||
if(totalSelectedCount.value > 200){
|
||||
uni.showToast({ title: '选择人数不能超过200', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
const idSet = new Set();
|
||||
const dedupPatients = [];
|
||||
groups.value.forEach((group, gi) => {
|
||||
@@ -289,7 +314,11 @@ const confirmGroup = () => {
|
||||
}
|
||||
|
||||
try {
|
||||
uni.navigateTo({
|
||||
if(from.value){
|
||||
uni.$emit('selectedChatPatientsSingle', { patients: dedupPatients });
|
||||
uni.navigateBack();
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pages_chat/groupSend/groupSend',
|
||||
success: (res) => {
|
||||
try {
|
||||
@@ -300,6 +329,8 @@ const confirmGroup = () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('跳转失败', e);
|
||||
uni.showToast({ title: '跳转失败,请重试', icon: 'none' });
|
||||
@@ -341,9 +372,35 @@ const clearSelection = () => {
|
||||
selectedPatients.value = {};
|
||||
};
|
||||
|
||||
const getPatientAvatar = (patient) => {
|
||||
if (!patient) return defaultImg;
|
||||
return patient.photo ? (docUrl + patient.photo) : defaultImg;
|
||||
};
|
||||
|
||||
const handlePatientAvatarError = (patient) => {
|
||||
if (!patient) return;
|
||||
patient._avatarLoadError = true;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.namebox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.name{
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
.real{
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.nick{
|
||||
color:#666;
|
||||
font-size: 26rpx;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
}
|
||||
.patient-group-page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
@@ -578,9 +635,9 @@ const clearSelection = () => {
|
||||
}
|
||||
|
||||
.patient-list-section {
|
||||
top: 180rpx;
|
||||
top:calc(var(--status-bar-height) + 44px);
|
||||
width:100%;
|
||||
bottom:120rpx; // 预留底部操作栏高度
|
||||
bottom:144rpx; // 预留底部操作栏高度
|
||||
position: fixed;
|
||||
background-color: #ffffff;
|
||||
|
||||
@@ -694,14 +751,14 @@ const clearSelection = () => {
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
box-shadow: 0 -6rpx 20rpx rgba(0,0,0,0.06);
|
||||
padding: 20rpx 30rpx env(safe-area-inset-bottom);
|
||||
padding:30rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.align-right{justify-content:flex-end;}
|
||||
|
||||
.clear-btn{
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
:maxlength="-1"
|
||||
placeholder="请输入回复内容"
|
||||
auto-height
|
||||
:adjust-position="false"
|
||||
/>
|
||||
<view class="popup-actions">
|
||||
<view class="btn cancel" @click="onCancel">取消</view>
|
||||
@@ -159,9 +160,7 @@
|
||||
uni.showToast({ title: '请输入内容', icon: 'none' })
|
||||
return
|
||||
}
|
||||
replies.value = [text, ...replies.value]
|
||||
uni.setClipboardData({ data: text, showToast: false })
|
||||
uni.showToast({ title: '已添加并复制', icon: 'none' })
|
||||
addQuickReply();
|
||||
onCancel()
|
||||
}
|
||||
|
||||
@@ -216,7 +215,7 @@
|
||||
/* 列表区域 */
|
||||
.list {
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px + 272rpx); /* 导航栏 + 添加入口高度(约) */
|
||||
top: calc(var(--status-bar-height) + 44px + 140rpx); /* 导航栏 + 添加入口高度(约) */
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<view class="search-header">
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<view class="search-header">
|
||||
<view class="status_bar"></view>
|
||||
<view class="back-icon" @click="goBack">
|
||||
<uni-icons type="left" size="30" color="#8B2316"></uni-icons>
|
||||
</view>
|
||||
@@ -21,6 +24,7 @@
|
||||
<text class="cancel-text">搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page">
|
||||
<!-- <view class="top">
|
||||
|
||||
@@ -111,15 +115,26 @@
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view class="empty-state" v-if="articleList.length === 0 && !loading">
|
||||
<!-- <view class="empty-state" v-if="articleList.length === 0 && !loading">
|
||||
<uni-icons type="article" size="80" color="#cccccc"></uni-icons>
|
||||
<text class="empty-text">暂无文章</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<empty v-if="articleList.length === 0 && !loading" :emptyDesc="'暂无文章'"></empty>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'是否确定发送此患教科普'"
|
||||
:content="content"
|
||||
:confirmText="'发送'"
|
||||
:cancelText="'取消'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -130,9 +145,22 @@
|
||||
import filter from "@/static/cb_screen_no.png"
|
||||
import filterOn from "@/static/cb_screen_yes.png"
|
||||
import api from "@/api/api.js"
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import navBar from '@/components/navBar/navBar.vue';
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
//import navBar from '@/components/navBar/navBar.vue';
|
||||
const content=ref('');
|
||||
const noticeVisible=ref(false);
|
||||
const articeItem=ref(null);
|
||||
const noticeConfirm=()=>{
|
||||
noticeVisible.value=false;
|
||||
content.value='';
|
||||
uni.$emit('articelItem', articeItem.value);
|
||||
uni.navigateBack({
|
||||
delta:2
|
||||
});
|
||||
}
|
||||
|
||||
const type=ref(1)
|
||||
|
||||
@@ -187,10 +215,9 @@
|
||||
|
||||
try {
|
||||
const page = isRefresh ? 1 : currentPage.value;
|
||||
const res = await api.polularScienceArticleListByKeywordsNew({
|
||||
keywords: keywords.value,
|
||||
page: page,
|
||||
type: type.value
|
||||
const res = await api.polularScienceArticleListIndexNew({
|
||||
topic: keywords.value,
|
||||
page: page
|
||||
});
|
||||
|
||||
if (res && res.code === 200 && res.data) {
|
||||
@@ -281,9 +308,9 @@
|
||||
|
||||
const goToDetail = (article) => {
|
||||
console.log('查看文章详情:', article);
|
||||
// 跳转到详情页
|
||||
uni.$emit('articelItem', article);
|
||||
uni.navigateBack();
|
||||
articeItem.value=article;
|
||||
noticeVisible.value=true;
|
||||
content.value=article.title;
|
||||
};
|
||||
|
||||
// 跳转到搜索页面
|
||||
@@ -440,20 +467,11 @@ $padding-small: 10px;
|
||||
}
|
||||
// 头部搜索栏
|
||||
.search-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background-color: #eeeeee;
|
||||
|
||||
display: flex;
|
||||
height:140rpx;
|
||||
height:44px;
|
||||
align-items: center;
|
||||
padding:0 30rpx;
|
||||
gap: 20rpx;
|
||||
|
||||
|
||||
padding:0 30rpx 0 8rpx;
|
||||
.search-input-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -485,7 +503,7 @@ $padding-small: 10px;
|
||||
padding: 10rpx 20rpx;
|
||||
background:#8B2316;
|
||||
border-radius: 10rpx;
|
||||
|
||||
margin-left: 20rpx;
|
||||
.cancel-text {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="stop-page">
|
||||
<view class="stop-page" :class="{ 'picker-open': !showBottom }">
|
||||
<navBar :title="title" />
|
||||
|
||||
<view class="content-area">
|
||||
@@ -27,52 +27,139 @@
|
||||
<view class="add-more" @click="addRange">+ 再次添加</view>
|
||||
</view>
|
||||
|
||||
<view class="range-list">
|
||||
<view class="range-list" v-if="reason!=3">
|
||||
<view class="range-row" v-for="(item,idx) in ranges" :key="idx">
|
||||
<uni-datetime-picker type="daterange" value="item" :start="start" @change="(e)=>handleChange(e,idx)" />
|
||||
<uni-datetime-picker type="daterange" value="item" :start="start" @change="(e)=>handleChange(e,idx)" @show="closeBottom" @close="openBottom" @maskClick="openBottom"/>
|
||||
<uni-icons type="minus" size="30" color="#8B2316" @click="removeRange(idx)" v-if="idx > 0"></uni-icons>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="range-list" v-if="reason==3">
|
||||
<view class="range-row" v-for="(item,idx) in ranges" :key="idx">
|
||||
<uni-datetime-picker type="date" value="item[0]" :start="start" @change="(e)=>handleChangeDate(e,idx)" @show="closeBottom" @close="openBottom" @maskClick="openBottom"/>
|
||||
<view class="rowbox">
|
||||
<uni-data-select v-model="item[1]" placeholder="请选择时段" :localdata="rangeData" @change="(e)=>changeRangeData(e,idx)"></uni-data-select>
|
||||
</view>
|
||||
<uni-icons type="minus" size="30" color="#8B2316" @click="removeRange(idx)" v-if="idx > 0"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 备注 -->
|
||||
<view class="form-section">
|
||||
<view class="section-title"><text class="title-text">备注</text></view>
|
||||
<view class="remark-box">
|
||||
<textarea v-model="remark" class="remark" maxlength="300" :placeholder="remarkPh"/>
|
||||
<textarea v-model="remark" class="remark" maxlength="300" :placeholder="remarkPh" :adjust-position="false"/>
|
||||
<!-- <view class="voice-btn" @click="recordVoice">🎤</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-actions">
|
||||
<view class="bottom-actions" v-if="showBottom">
|
||||
<view class="confirm-btn" @click="submit">
|
||||
<text class="btn-text">确定发布</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'公告内容'"
|
||||
:cancelText="'返回修改'"
|
||||
:confirmText="'确认发布'"
|
||||
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
<template v-slot:content>
|
||||
<view class="ppt-content">
|
||||
<view class="notice-row">
|
||||
<view class="name">停诊原因:</view>
|
||||
<view class="value" v-if="reason==1">出差</view>
|
||||
<view class="value" v-if="reason==2">休假</view>
|
||||
<view class="value" v-if="reason==3">临时安排</view>
|
||||
<view class="value" v-if="reason==4">其他</view>
|
||||
</view>
|
||||
<view class="notice-row">
|
||||
<view class="name">停诊时间:</view>
|
||||
<view class="value">
|
||||
<view class="value-item" v-for="(item,idx) in ranges" :key="idx">
|
||||
<view class="value-item-date">{{ item[0] }}</view>
|
||||
<view class="value-item-separator" >{{ reason==3?' ':'至' }}</view>
|
||||
<view class="value-item-time">{{ item[1] }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="notice-row" v-if="remark">
|
||||
<view class="name">备注:</view>
|
||||
<view class="value">{{ remark }}</view>
|
||||
</view>
|
||||
<view class="tip">
|
||||
<view class="name"></view>
|
||||
<view class="value">{{date}}由医生本人发布</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
import navBar from '@/components/navBar/navBar.vue'
|
||||
import api from '@/api/api'
|
||||
|
||||
import dayjs from 'dayjs'
|
||||
import api from '@/api/api'
|
||||
const noticeVisible = ref(false)
|
||||
const date = ref(dayjs().format('YYYY年MM月DD日'))
|
||||
const removeRange = (idx) => {
|
||||
ranges.value.splice(idx,1)
|
||||
}
|
||||
const noticeConfirm = () => {
|
||||
noticeVisible.value = false
|
||||
addStopPatient()
|
||||
}
|
||||
const showBottom = ref(true)
|
||||
const title = ref('发布停诊')
|
||||
const reason = ref(1)
|
||||
const ranges = ref([[]])
|
||||
const ranges = ref([{}])
|
||||
const remark = ref('')
|
||||
const remarkPh = '您可以在这里填写想告诉患者的停诊补充信息,最多填写300个字哦~'
|
||||
const start = ref(new Date().getTime())
|
||||
const end = ref( Date.now()+10*365*24*3600*1000)
|
||||
const selectReason = (val) => { reason.value = val }
|
||||
const selectReason = (val) => {
|
||||
reason.value = val;
|
||||
if(val==3){
|
||||
ranges.value=[{}];
|
||||
}
|
||||
}
|
||||
const addRange = () => { ranges.value.push([]) }
|
||||
const rangeData=ref([{text:'上午',value:'上午'},{text:'下午',value:'下午'},{text:'晚上',value:'晚上'},{text:'全天',value:'全天'}])
|
||||
|
||||
|
||||
const closeBottom = () => {
|
||||
showBottom.value = false
|
||||
}
|
||||
const openBottom = () => {
|
||||
showBottom.value = true
|
||||
}
|
||||
const handleChange = (e,idx) => {
|
||||
console.log(e)
|
||||
ranges.value[idx] =e;
|
||||
openBottom();
|
||||
console.log(showBottom.value)
|
||||
}
|
||||
const handleChangeDate = (e,idx) => {
|
||||
console.log(e)
|
||||
ranges.value[idx][0] =e;
|
||||
openBottom();
|
||||
console.log(showBottom.value)
|
||||
}
|
||||
const changeRangeData = (e,idx) => {
|
||||
console.log(e)
|
||||
ranges.value[idx][1] =e;
|
||||
|
||||
}
|
||||
const addStopPatient = async () => {
|
||||
let date_arr=[]
|
||||
@@ -82,12 +169,14 @@ const addStopPatient = async () => {
|
||||
param2:item[1]
|
||||
})
|
||||
})
|
||||
//console.log(date_arr)
|
||||
const res = await api.addStopPatient({
|
||||
type: reason.value,
|
||||
date_list: date_arr,
|
||||
note: remark.value
|
||||
})
|
||||
if(res.code==200){
|
||||
uni.$emit('updateOutPatient')
|
||||
uni.showToast({ title: '发布成功', icon: 'none' })
|
||||
uni.navigateBack()
|
||||
}
|
||||
@@ -98,42 +187,132 @@ const recordVoice = () => {
|
||||
}
|
||||
|
||||
const submit = () => {
|
||||
console.log(ranges.value)
|
||||
const invalid = ranges.value.some(r => r.length==0)
|
||||
|
||||
let invalid=ranges.value.some(r => !r[0] || !r[1])
|
||||
if (invalid) {
|
||||
if(reason.value==3){
|
||||
uni.showToast({ title: '请选择停诊时间或者时间段', icon: 'none' })
|
||||
return
|
||||
}else{
|
||||
uni.showToast({ title: '请选择停诊起止时间', icon: 'none' })
|
||||
return
|
||||
}
|
||||
addStopPatient()
|
||||
|
||||
}
|
||||
//addStopPatient()
|
||||
noticeVisible.value = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.stop-page { min-height: 100vh; background: #fff; }
|
||||
.content-area { padding: 30rpx; margin-top: calc(var(--status-bar-height) + 44px);}
|
||||
.range-list{
|
||||
position: relative;
|
||||
z-index:99;
|
||||
:deep(.uni-date-btn--ok){
|
||||
position: relative;
|
||||
z-index:9999;
|
||||
}
|
||||
}
|
||||
.ppt-content{
|
||||
|
||||
.tip{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top:50rpx;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
.name{
|
||||
width: 160rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.value{
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.notice-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
.value-item-separator{
|
||||
min-width: 20rpx;
|
||||
}
|
||||
.name{
|
||||
width: 160rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.value{
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
.value-item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
}
|
||||
.rowbox{
|
||||
flex:1;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.stop-page {
|
||||
min-height: 100vh; background: #fff;
|
||||
:deep(.uni-date){
|
||||
position: relative;
|
||||
z-index:99;
|
||||
}
|
||||
/* iOS 端日期弹层容易被滚动容器裁切,强制提高层级并贴底展示 */
|
||||
:deep(.uni-calendar__mask){
|
||||
z-index: 9998 !important;
|
||||
}
|
||||
:deep(.uni-calendar--fixed){
|
||||
z-index: 9999 !important;
|
||||
bottom: 0 !important;
|
||||
}
|
||||
:deep(.uni-date-btn--ok){
|
||||
position: relative;
|
||||
z-index: 10000 !important;
|
||||
}
|
||||
}
|
||||
.content-area {
|
||||
position: fixed;
|
||||
overflow-y: scroll;
|
||||
padding: 30rpx;
|
||||
width: 100%;
|
||||
z-index:2;
|
||||
box-sizing: border-box;
|
||||
top: calc(var(--status-bar-height) + 44px);
|
||||
bottom:152rpx;
|
||||
}
|
||||
.stop-page.picker-open .content-area{
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.form-section { margin-bottom: 40rpx; }
|
||||
.section-head { display: flex; justify-content: space-between; align-items: center; }
|
||||
.section-title { display: flex; align-items: center; margin-bottom: 20rpx; }
|
||||
.title-text { font-size: 32rpx; color: #8B2316; font-weight: 600; }
|
||||
.title-text { font-size: 32rpx; color: #8B2316; }
|
||||
.required { color: #8B2316; margin-left: 6rpx; font-size: 28rpx; }
|
||||
|
||||
.reason-row { display: flex; gap: 20rpx; flex-wrap: wrap; }
|
||||
.reason-btn { flex: 1; text-align: center; height: 80rpx; line-height: 80rpx; border: 2rpx solid #ddd; border-radius: 10rpx; color: #666; }
|
||||
.reason-row { display: flex; flex-wrap: wrap; justify-content: space-between;}
|
||||
.reason-btn { width:150rpx; text-align: center; height: 80rpx; line-height: 80rpx; border: 2rpx solid #ddd; border-radius: 10rpx; color: #666; }
|
||||
.reason-btn.active { border-color: #8B2316; color: #8B2316; background: url('@/static/addoutpa_true.png') right bottom/39rpx 39rpx no-repeat; }
|
||||
|
||||
.add-more { color: #8B2316; font-size: 28rpx; }
|
||||
.range-row { display: flex; align-items: center; gap: 20rpx; margin-bottom: 20rpx; }
|
||||
.range-row { display: flex; align-items: center; margin-bottom: 20rpx; }
|
||||
.date-input { flex: 1; height: 80rpx; border: 2rpx solid #ddd; border-radius: 10rpx; display: flex; align-items: center; padding: 0 24rpx; color: #333; }
|
||||
.placeholder { color: #999; }
|
||||
.to-text { color: #666; }
|
||||
|
||||
.remark-box { position: relative; }
|
||||
.remark { width: 100%; min-height: 220rpx; background: #f2f2f2; border-radius: 10rpx; padding: 20rpx; color: #333; }
|
||||
.remark {box-sizing: border-box; width: 100%; min-height: 220rpx; background: #f2f2f2; border-radius: 10rpx; padding: 20rpx; color: #333; }
|
||||
.voice-btn { position: absolute; right: 20rpx; bottom: 20rpx; width: 88rpx; height: 88rpx; border-radius: 50%; background: #8B2316; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40rpx; }
|
||||
|
||||
.bottom-actions { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 30rpx; border-top: 1rpx solid #eee; }
|
||||
.bottom-actions { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 30rpx; border-top: 1rpx solid #eee; z-index:1;}
|
||||
.confirm-btn { background: #8B2316; border-radius: 12rpx; padding: 24rpx 0; text-align: center; }
|
||||
.btn-text { color: #fff; font-size: 32rpx; font-weight: 600; }
|
||||
.btn-text { color: #fff; font-size: 32rpx; }
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,894 @@
|
||||
<template>
|
||||
<view class="navbox">
|
||||
<view class="status_bar"></view>
|
||||
<view class="search-header">
|
||||
<view class="status_bar"></view>
|
||||
<view class="back-icon" @click="goBack">
|
||||
<uni-icons type="left" size="30" color="#8B2316"></uni-icons>
|
||||
</view>
|
||||
<view class="search-input-wrapper">
|
||||
<view class="search-icon">
|
||||
<uni-icons type="search" size="20" color="#999"></uni-icons>
|
||||
</view>
|
||||
<input
|
||||
class="search-input"
|
||||
placeholder="请输入搜索内容"
|
||||
v-model="keywords"
|
||||
@input="onSearchInput"
|
||||
@confirm="onSearchConfirm"
|
||||
confirm-type="search"
|
||||
/>
|
||||
|
||||
</view>
|
||||
<!-- <view class="type-btn" @click="showAllVideoPopup = true">
|
||||
<text class="type-btn-text">{{ typeName }}</text>
|
||||
<uni-icons type="bottom" size="14" color="#8B2316"></uni-icons>
|
||||
</view> -->
|
||||
<view class="cancel-btn" @click="goSearch">
|
||||
<text class="cancel-text">搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page">
|
||||
<!-- <view class="top">
|
||||
|
||||
<view class="filter-bar">
|
||||
<view class="search-box" @click="goToSearch">
|
||||
<uni-icons type="search" size="16" color="#999"></uni-icons>
|
||||
<text class="search-text">搜索</text>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="filter-item active" @click="toggleSort">
|
||||
<text>{{type==1?'最新':'最热'}}</text>
|
||||
<up-image v-if="type==1" :src="upImg" width="20rpx" height="26rpx" ></up-image>
|
||||
<up-image v-else :src="downImg" width="20rpx" height="26rpx" ></up-image>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
<view class="filter-item" :class="{ active: isFilterActive }" @click="showFilterPopup">
|
||||
<text>筛选</text>
|
||||
<up-image :src="isFilterActive ? filterOn : filter" width="30rpx" height="30rpx" ></up-image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
|
||||
<!-- 筛选弹窗 -->
|
||||
<view class="filter-popup" v-if="showFilter" @click="hideFilterPopup">
|
||||
<view class="filter-content" @click.stop>
|
||||
<!-- 筛选标签网格 -->
|
||||
<view class="filter-tags">
|
||||
<view
|
||||
class="tag-item"
|
||||
v-for="(tag, index) in filterTags"
|
||||
:key="index"
|
||||
:class="{ active: tag.selected }"
|
||||
@click="toggleTag(index)"
|
||||
>
|
||||
{{ tag.NAME }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="filter-buttons">
|
||||
<view class="btn-reset" @click="resetFilter">重置</view>
|
||||
<view class="btn-confirm" @click="confirmFilter">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 全部视频弹窗(复制自 video.vue) -->
|
||||
<view class="all-video-popup" v-if="showAllVideoPopup" @click="closeAllVideoPopup">
|
||||
<view class="popup-content" @click.stop>
|
||||
<view class="popup-body">
|
||||
<view
|
||||
class="category-item"
|
||||
:class="{ active: typeUuid === item.uuid }"
|
||||
v-for="item in videoTypeList"
|
||||
:key="item.uuid"
|
||||
@click="selectCategory(item.uuid)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view v-if="videoTypeList.length === 0" class="empty-content">
|
||||
<text>暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 文章列表 -->
|
||||
<scroll-view
|
||||
class="article-list"
|
||||
scroll-y
|
||||
refresher-enabled="true"
|
||||
:refresher-triggered="refreshing"
|
||||
@refresherrefresh="onRefresh"
|
||||
@scrolltolower="onLoadMore"
|
||||
:lower-threshold="100"
|
||||
>
|
||||
<view class="article-item" v-for="(article, index) in articleList" :key="article.uuid || index" @click="goToDetail(article)">
|
||||
<image class="article-image" :src="docUrl+article.imgpath" mode="aspectFill"></image>
|
||||
<view class="article-content">
|
||||
<view class="article-title">{{ article.name }}</view>
|
||||
<view class="article-author">{{ article.public_name }}</view>
|
||||
<view class="article-meta">
|
||||
<!-- <view class="date-tag" v-if="article.isToday">今日</view> -->
|
||||
<view class="date" >{{ formatDate(article.create_date) }}</view>
|
||||
<view class="stats">
|
||||
<view class="stat-item">
|
||||
<uni-icons type="eye" size="12" color="#999"></uni-icons>
|
||||
<text>{{ article.readnum }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加载更多状态 -->
|
||||
<view class="load-more" v-if="loading">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999"></uni-icons>
|
||||
<text class="load-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<!-- 没有更多数据 -->
|
||||
<view class="no-more" v-if="!hasMore && articleList.length > 0">
|
||||
<text class="no-more-text">没有更多数据了</text>
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<!-- <view class="empty-state" v-if="articleList.length === 0 && !loading">
|
||||
<uni-icons type="article" size="80" color="#cccccc"></uni-icons>
|
||||
<text class="empty-text">暂无文章</text>
|
||||
</view> -->
|
||||
<empty v-if="articleList.length === 0 && !loading" :emptyDesc="'暂无视频'"></empty>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 底部导航栏 -->
|
||||
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'是否确定发送此患教科普'"
|
||||
:content="content"
|
||||
:confirmText="'发送'"
|
||||
:cancelText="'取消'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onShow,onLoad } from "@dcloudio/uni-app";
|
||||
import upImg from "@/static/cb_up.png"
|
||||
import downImg from "@/static/cb_up.png"
|
||||
import filter from "@/static/cb_screen_no.png"
|
||||
import filterOn from "@/static/cb_screen_yes.png"
|
||||
import api from "@/api/api.js"
|
||||
import empty from "@/components/empty/empty.vue"
|
||||
import docUrl from '@/utils/docUrl.js';
|
||||
import navTo from '@/utils/navTo.js';
|
||||
import dayjs from 'dayjs';
|
||||
import unidialog from '@/components/dialog/dialog.vue'
|
||||
//import navBar from '@/components/navBar/navBar.vue';
|
||||
const content=ref('');
|
||||
const typeUuid=ref('');
|
||||
const typeName=ref('全部视频')
|
||||
const noticeVisible=ref(false);
|
||||
const videoItem=ref(null);
|
||||
const showAllVideoPopup = ref(false);
|
||||
const videoTypeList=ref([]);
|
||||
const noticeConfirm=()=>{
|
||||
noticeVisible.value=false;
|
||||
content.value='';
|
||||
uni.$emit('videoItem', videoItem.value);
|
||||
uni.navigateBack({
|
||||
delta:2
|
||||
});
|
||||
}
|
||||
|
||||
const type=ref(1)
|
||||
onLoad((options) => {
|
||||
if(options.typeUuid){
|
||||
typeUuid.value = options.typeUuid;
|
||||
}
|
||||
if(options.typeName){
|
||||
typeName.value = options.typeName;
|
||||
}
|
||||
});
|
||||
// 分页相关状态
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(20);
|
||||
const hasMore = ref(true);
|
||||
const loading = ref(false);
|
||||
const refreshing = ref(false);
|
||||
// 响应式数据
|
||||
const activeTab = ref(0);
|
||||
const showFilter = ref(false);
|
||||
const isFilterActive = ref(false);
|
||||
const toggleSort = () => {
|
||||
type.value = type.value === 1 ? 2 : 1;
|
||||
// 重置分页状态
|
||||
currentPage.value = 1;
|
||||
hasMore.value = true;
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
};
|
||||
const goSearch = () => {
|
||||
if(!keywords.value){
|
||||
uni.showToast({
|
||||
title: '请输入搜索内容',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
};
|
||||
const onSearchInput = (e) => {
|
||||
keywords.value = e.detail.value || '';
|
||||
};
|
||||
const onSearchConfirm = () => {
|
||||
goSearch();
|
||||
};
|
||||
const loadGuideTags = async () => {
|
||||
try {
|
||||
const res = await api.guideTag({
|
||||
type:4
|
||||
});
|
||||
if(res && res.code === 200 && res.data) {
|
||||
// 将API返回的标签数据转换为筛选标签格式
|
||||
filterTags.value = res.data.map(tag => ({
|
||||
...tag,
|
||||
selected: false
|
||||
}));
|
||||
console.log('指南标签加载成功:', filterTags.value);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载指南标签失败:', e);
|
||||
}
|
||||
};
|
||||
const patientVideoNew=async ()=>{
|
||||
const res=await api.patientVideoNew();
|
||||
if(res.code==200){
|
||||
videoTypeList.value=res.data || [];
|
||||
}
|
||||
}
|
||||
const polularScienceArticleListByKeywordsNew = async (isRefresh = false) => {
|
||||
if (loading.value) return;
|
||||
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const page = isRefresh ? 1 : currentPage.value;
|
||||
const res = await api.patientVideoByKeyWordsNew({
|
||||
keywords: keywords.value,
|
||||
page: page,
|
||||
typeUuid: typeUuid.value,
|
||||
sort:'2'
|
||||
});
|
||||
|
||||
if (res && res.code === 200 && res.data) {
|
||||
const newData = res.data.list || [];
|
||||
|
||||
if (isRefresh) {
|
||||
// 下拉刷新:替换数据
|
||||
articleList.value = newData;
|
||||
currentPage.value = 1;
|
||||
} else {
|
||||
// 上拉加载:追加数据
|
||||
//const formattedData = newData.map(item => formatArticleData(item));
|
||||
articleList.value = [...articleList.value, ...newData];
|
||||
}
|
||||
|
||||
// 判断是否还有更多数据(优先使用接口分页字段)
|
||||
const pageNumber = Number(res.data.pageNumber || 1);
|
||||
const totalPage = Number(res.data.totalPage || 1);
|
||||
hasMore.value = pageNumber < totalPage;
|
||||
currentPage.value = pageNumber + 1;
|
||||
|
||||
console.log('文章数据加载成功:', articleList.value);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取文章列表失败:', error);
|
||||
uni.showToast({
|
||||
title: '获取数据失败',
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
} finally {
|
||||
loading.value = false;
|
||||
refreshing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 格式化文章数据
|
||||
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (date) => {
|
||||
return dayjs(date).format('YYYY-MM-DD');
|
||||
};
|
||||
// 筛选标签数据
|
||||
const filterTags = ref([]);
|
||||
|
||||
// 文章列表数据
|
||||
const articleList = ref([]);
|
||||
|
||||
// 方法
|
||||
const switchTab = (index) => {
|
||||
|
||||
if(index==1){
|
||||
navTo({
|
||||
url: '/pages_app/patientVideo/patientVideo?from=searchArticle'
|
||||
})
|
||||
}else if(index==2){
|
||||
let url=encodeURIComponent('https://wx.igandan.com/wxPatient/index.htm#/problem?link=share&fromtype=doctor')
|
||||
navTo({
|
||||
url: '/pages_app/webview/webview?url='+url
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const goToDetail = (video) => {
|
||||
console.log('查看视频详情:', video);
|
||||
videoItem.value=video;
|
||||
noticeVisible.value=true;
|
||||
content.value=video.name;
|
||||
};
|
||||
|
||||
// 跳转到搜索页面
|
||||
const goToSearch = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/search/search'
|
||||
});
|
||||
};
|
||||
|
||||
// 下拉刷新
|
||||
const onRefresh = async () => {
|
||||
refreshing.value = true;
|
||||
await polularScienceArticleListByKeywordsNew(true);
|
||||
uni.showToast({
|
||||
title: '刷新成功',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
|
||||
// 上拉加载更多
|
||||
const onLoadMore = async () => {
|
||||
if (!hasMore.value || loading.value) return;
|
||||
await polularScienceArticleListByKeywordsNew(false);
|
||||
};
|
||||
|
||||
const goToPage = (page) => {
|
||||
console.log('跳转到页面:', page);
|
||||
// 根据页面名称进行跳转
|
||||
if (page === 'index') {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 筛选相关方法
|
||||
const showFilterPopup = () => {
|
||||
showFilter.value = true;
|
||||
};
|
||||
const goBack = () => {
|
||||
uni.navigateBack({
|
||||
delta:1,
|
||||
fail(){
|
||||
uni.redirectTo({
|
||||
url:'/pages/index/index'
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
const closeAllVideoPopup = () => {
|
||||
showAllVideoPopup.value = false;
|
||||
};
|
||||
const selectCategory = (uuid) => {
|
||||
typeUuid.value = uuid;
|
||||
typeName.value = (videoTypeList.value.find(item => item.uuid === uuid) || {}).name || '全部视频';
|
||||
closeAllVideoPopup();
|
||||
currentPage.value = 1;
|
||||
hasMore.value = true;
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
};
|
||||
const hideFilterPopup = () => {
|
||||
showFilter.value = false;
|
||||
};
|
||||
|
||||
const toggleTag = (index) => {
|
||||
filterTags.value[index].selected = !filterTags.value[index].selected;
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
filterTags.value.forEach(tag => {
|
||||
tag.selected = false;
|
||||
});
|
||||
isFilterActive.value = false;
|
||||
};
|
||||
const keywords=ref('');
|
||||
const confirmFilter = () => {
|
||||
// 检查是否有选中的标签
|
||||
const hasSelected = filterTags.value.some(tag => tag.selected);
|
||||
isFilterActive.value = hasSelected;
|
||||
|
||||
// 执行筛选逻辑
|
||||
if (hasSelected) {
|
||||
const selectedTags = filterTags.value.filter(tag => tag.selected).map(tag => tag.NAME);
|
||||
console.log('选中的标签:', selectedTags);
|
||||
keywords.value = selectedTags.join(',');
|
||||
} else {
|
||||
keywords.value = '';
|
||||
}
|
||||
|
||||
// 重置分页状态
|
||||
currentPage.value = 1;
|
||||
hasMore.value = true;
|
||||
|
||||
showFilter.value = false;
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
};
|
||||
|
||||
onShow(() => {
|
||||
polularScienceArticleListByKeywordsNew(true);
|
||||
loadGuideTags();
|
||||
patientVideoNew();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 颜色变量
|
||||
$primary-color: #ff6b6b;
|
||||
$theme-color: #8B2316;
|
||||
$white: #fff;
|
||||
$gray-bg: #f5f5f5;
|
||||
$gray-light: #eee;
|
||||
$gray-medium: #999;
|
||||
$gray-dark: #666;
|
||||
$text-color: #333;
|
||||
|
||||
// 尺寸变量
|
||||
$border-radius: 8px;
|
||||
$border-radius-small: 6px;
|
||||
$padding: 15px;
|
||||
$padding-small: 10px;
|
||||
|
||||
.page {
|
||||
background-color: $gray-bg;
|
||||
height: calc(100vh - 180rpx);
|
||||
display: flex;
|
||||
overflow-y: hidden;
|
||||
flex-direction: column;
|
||||
// 为固定导航栏留出空间
|
||||
}
|
||||
.top{
|
||||
width:100%;
|
||||
position: fixed;
|
||||
top:140rpx;
|
||||
}
|
||||
// 选项卡
|
||||
.tabs {
|
||||
background-color: $white;
|
||||
display: flex;
|
||||
border-bottom: 1px solid $gray-light;
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: $padding 0;
|
||||
font-size: 16px;
|
||||
color: $gray-dark;
|
||||
position: relative;
|
||||
|
||||
&.active {
|
||||
color: $theme-color;
|
||||
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 30px;
|
||||
height: 2px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 头部搜索栏
|
||||
.search-header {
|
||||
background-color: #eeeeee;
|
||||
display: flex;
|
||||
height:44px;
|
||||
align-items: center;
|
||||
padding:0 30rpx 0 8rpx;
|
||||
.search-input-wrapper {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
height:70rpx;
|
||||
|
||||
.search-icon {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.clear-icon {
|
||||
margin-left: 15rpx;
|
||||
padding: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
padding: 10rpx 20rpx;
|
||||
background:#8B2316;
|
||||
border-radius: 10rpx;
|
||||
margin-left: 20rpx;
|
||||
.cancel-text {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.type-btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 10rpx 16rpx;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
border: 1rpx solid #8B2316;
|
||||
margin-left: 12rpx;
|
||||
.type-btn-text{
|
||||
font-size: 24rpx;
|
||||
color: #8B2316;
|
||||
max-width: 120rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 筛选栏
|
||||
.filter-bar {
|
||||
background-color: $white;
|
||||
padding: $padding-small $padding;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid $gray-light;
|
||||
|
||||
.search-box {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
|
||||
.search-text {
|
||||
font-size: 14px;
|
||||
color: $gray-medium;
|
||||
}
|
||||
}
|
||||
|
||||
.divider {
|
||||
width: 1px;
|
||||
height: 16px;
|
||||
background-color: $gray-medium;
|
||||
margin: 0 $padding;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
flex:1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 3px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
.filter-item.active{
|
||||
color: $theme-color;
|
||||
}
|
||||
|
||||
|
||||
// 文章列表
|
||||
.article-list {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top:140rpx;
|
||||
padding-bottom: 0rpx;
|
||||
.article-item {
|
||||
background-color: $white;
|
||||
margin-bottom: $padding-small;
|
||||
border-radius: $border-radius;
|
||||
padding: $padding;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
.article-image {
|
||||
width: 125px;
|
||||
height: 80px;
|
||||
border-radius: $border-radius-small;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.article-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.article-title {
|
||||
font-size: 16px;
|
||||
color: $text-color;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 1px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.article-author {
|
||||
font-size: 13px;
|
||||
color: $gray-dark;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.article-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.date-tag {
|
||||
background-color: $primary-color;
|
||||
color: $white;
|
||||
font-size: 12px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-size: 12px;
|
||||
color: $gray-medium;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: flex;
|
||||
gap: $padding;
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
font-size: 12px;
|
||||
color: $gray-medium;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 加载状态样式
|
||||
.load-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
color: #999;
|
||||
|
||||
.load-text {
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.no-more {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 30rpx;
|
||||
|
||||
.no-more-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 100rpx 30rpx;
|
||||
|
||||
.empty-text {
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 底部导航栏
|
||||
.bottom-nav {
|
||||
background-color: $white;
|
||||
display: flex;
|
||||
border-top: 1px solid $gray-light;
|
||||
padding: 8px 0;
|
||||
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
font-size: 12px;
|
||||
color: $gray-medium;
|
||||
|
||||
&.active {
|
||||
color: $primary-color;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 筛选弹窗样式
|
||||
.filter-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
// background-color: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
z-index: 9999;
|
||||
|
||||
.filter-content {
|
||||
margin-top:329rpx;
|
||||
|
||||
background-color: $white;
|
||||
// border-radius: 20rpx 20rpx 0 0;
|
||||
padding: 20rpx 30rpx 60rpx;
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
|
||||
.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 24rpx;
|
||||
border-radius: 30rpx;
|
||||
font-size: 26rpx;
|
||||
border: 2rpx solid #efefef;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&.active {
|
||||
background-color: #fff;
|
||||
color: $theme-color;
|
||||
border-color: $theme-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.filter-buttons {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
position: fixed;
|
||||
bottom: 30rpx;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
|
||||
.btn-reset,
|
||||
.btn-confirm {
|
||||
flex: 1;
|
||||
height: 70rpx;
|
||||
border-radius: 14rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.btn-reset {
|
||||
background-color: $white;
|
||||
color: $theme-color;
|
||||
border: 2rpx solid $theme-color;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
border: 2rpx solid $theme-color;
|
||||
background-color: $theme-color;
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 全部视频弹窗样式(复制自 video.vue) */
|
||||
.all-video-popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.popup-content {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px + 116rpx);
|
||||
overflow-y: scroll;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.popup-body {
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
padding: 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
background-color: #fff;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.category-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.category-item.active {
|
||||
background-color: #f8f8f8;
|
||||
color: #8B2316;
|
||||
}
|
||||
|
||||
.category-item:active {
|
||||
background-color: #e8f4fd;
|
||||
}
|
||||
|
||||
.empty-content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 200rpx;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
</style>
|
||||
+85
-27
@@ -1,6 +1,16 @@
|
||||
<template>
|
||||
<uni-nav-bar left-icon="left"
|
||||
@clickLeft="goBack" title="患教视频" 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"
|
||||
@clickLeft="goBack"
|
||||
title="患教视频"
|
||||
color="#8B2316"
|
||||
:border="false"
|
||||
rightIcon="search"
|
||||
@clickRight="goSearch"
|
||||
rightColor="#8B2316"
|
||||
backgroundColor="#eeeeee"></uni-nav-bar>
|
||||
</view>
|
||||
<view class="video-page">
|
||||
<!-- Header -->
|
||||
<!-- Fixed Filter Tabs -->
|
||||
@@ -11,7 +21,7 @@
|
||||
@click="showAllVideoPopup=!showAllVideoPopup"
|
||||
>
|
||||
<up-image :src="isAllActive?allOnImg:allImg" width="30rpx" height="30rpx" ></up-image>
|
||||
<text class="tab-text" :class="{active:isAllActive}">{{typeName}}</text>
|
||||
<text class="tab-text" :class="{active:isAllActive}">{{formatName(typeName)}}</text>
|
||||
<up-image :src="isAllActive?selectOnImg:selectImg" width="30rpx" height="30rpx" ></up-image>
|
||||
</view>
|
||||
<view class="divider"></view>
|
||||
@@ -126,7 +136,7 @@
|
||||
:key="item.uuid"
|
||||
@click="selectCategory(item.uuid)"
|
||||
>
|
||||
{{ item.name }}
|
||||
{{ formatName(item.name) }}
|
||||
</view>
|
||||
<view v-if="videoTypeList.length === 0" class="empty-content">
|
||||
<text>暂无数据</text>
|
||||
@@ -135,11 +145,23 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<unidialog
|
||||
:visible="noticeVisible"
|
||||
:title="'是否确定发送此患教科普'"
|
||||
:content="content"
|
||||
:confirmText="'发送'"
|
||||
:cancelText="'取消'"
|
||||
@close="noticeVisible=false"
|
||||
@confirm="noticeConfirm"
|
||||
>
|
||||
|
||||
</unidialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed,reactive } from 'vue';
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import unidialog from '@/components/dialog/dialog.vue';
|
||||
import api from '@/api/api.js';
|
||||
import allImg from "@/static/video_all.png"
|
||||
import allOnImg from "@/static/video_select.png"
|
||||
@@ -153,6 +175,15 @@
|
||||
import navTo from '@/utils/navTo';
|
||||
import empty from '@/components/empty/empty.vue';
|
||||
const isAllActive=ref(false)
|
||||
const content=ref('');
|
||||
const noticeVisible=ref(false);
|
||||
const videoItem=ref(null);
|
||||
const noticeConfirm=()=>{
|
||||
noticeVisible.value=false;
|
||||
content.value='';
|
||||
uni.$emit('videoItem', videoItem.value);
|
||||
uni.navigateBack();
|
||||
}
|
||||
// 响应式数据
|
||||
const videoList = ref([]);
|
||||
const activeTab = ref(1); // 默认选中"最新"
|
||||
@@ -190,6 +221,18 @@
|
||||
}
|
||||
|
||||
const videoTypeList=ref([]);
|
||||
const formatName = (name) => {
|
||||
let nameStr=name.substring(0,4);
|
||||
let lateStr=name.substring(4,name.length);
|
||||
|
||||
let index = nameStr.lastIndexOf("-");
|
||||
|
||||
if (index > -1) {
|
||||
|
||||
return name.substring(index+1,4)+lateStr;
|
||||
}
|
||||
return name;
|
||||
};
|
||||
const patientVideoNew=async ()=>{
|
||||
const res=await api.patientVideoNew();
|
||||
if(res.code==200){
|
||||
@@ -318,8 +361,10 @@
|
||||
|
||||
// 播放视频
|
||||
const playVideo = (video) => {
|
||||
uni.$emit('videoItem', video);
|
||||
uni.navigateBack();
|
||||
videoItem.value=video;
|
||||
noticeVisible.value=true;
|
||||
content.value=video.name;
|
||||
//uni.navigateBack();
|
||||
};
|
||||
|
||||
|
||||
@@ -327,7 +372,7 @@
|
||||
// 搜索
|
||||
const goSearch = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages_app/search/search'
|
||||
url: '/pages_chat/video/searchVideo?typeUuid='+typeUuid.value
|
||||
});
|
||||
};
|
||||
|
||||
@@ -517,9 +562,9 @@
|
||||
.scroll-view {
|
||||
position: fixed;
|
||||
bottom: 0rpx;
|
||||
height: calc(100vh - 180rpx); /* 固定高度,减去导航栏高度 */
|
||||
/* 固定高度,减去导航栏高度 */
|
||||
background-color: #f5f5f5;
|
||||
top: 172rpx; /* 为导航栏留出空间 */
|
||||
top: calc(var(--status-bar-height) + 44px + 116rpx); /* 为导航栏留出空间 */
|
||||
}
|
||||
|
||||
|
||||
@@ -530,7 +575,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content:center;
|
||||
padding: 30rpx 30rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
@@ -563,6 +608,7 @@
|
||||
max-width:155rpx;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
margin-top: 4rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -574,7 +620,7 @@
|
||||
/* Fixed Filter Tabs Container */
|
||||
.filter-tabs-container {
|
||||
position: fixed;
|
||||
top: 180rpx; /* uni-nav-bar height */
|
||||
top: calc(var(--status-bar-height) + 44px); /* uni-nav-bar height */
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 40;
|
||||
@@ -601,27 +647,28 @@
|
||||
|
||||
/* Video List */
|
||||
.video-list {
|
||||
padding: 0 20rpx;
|
||||
margin-top: 100rpx; /* 为固定的Filter Tabs留出空间 */
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx; /* 卡片间距 */
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.video-item {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1);
|
||||
width: calc(50% - 8rpx); /* 两列布局,减半gap */
|
||||
min-width: 300rpx; /* 确保最小宽度 */
|
||||
flex-shrink: 0; /* 防止收缩 */
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.video-thumbnail {
|
||||
position: relative;
|
||||
height: 200rpx;
|
||||
width: 250rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10rpx;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.video-thumbnail image {
|
||||
@@ -641,7 +688,11 @@
|
||||
}
|
||||
|
||||
.video-info {
|
||||
padding: 24rpx;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.video-title {
|
||||
@@ -649,7 +700,7 @@
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
@@ -666,7 +717,12 @@
|
||||
|
||||
.author {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 20rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.stats {
|
||||
@@ -719,8 +775,10 @@
|
||||
.popup-content {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
height:calc(100vh - 272rpx);
|
||||
position: fixed;
|
||||
top: calc(var(--status-bar-height) + 44px + 116rpx);
|
||||
overflow-y: scroll;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.popup-header {
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
v-model="reviewContent"
|
||||
placeholder="在这里提交您对精品课的建议,帮助课程继续优化改进(300字以内)"
|
||||
maxlength="300"
|
||||
:adjust-position="false"
|
||||
:show-confirm-bar="false"
|
||||
></textarea>
|
||||
<view class="word-count">
|
||||
|
||||
@@ -111,6 +111,7 @@ const freeVisible = ref(false)
|
||||
const freeContent = ref('')
|
||||
const goods_order_id = ref('')
|
||||
const points = ref(0)
|
||||
const goodsPoints=ref(0);
|
||||
const freeClose = () => {
|
||||
freeVisible.value = false
|
||||
}
|
||||
@@ -125,6 +126,28 @@ const freeConfirm = () => {
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
let belong = '';
|
||||
if(goodsName.value.indexOf('U盘') > -1 || goodsName.value.indexOf('u盘') > -1){
|
||||
belong = 'U盘';
|
||||
}else if(goodsName.value.indexOf('京东E卡') > -1){
|
||||
belong = '京东E卡';
|
||||
}else{
|
||||
belong = '书籍';
|
||||
}
|
||||
uni.sendNativeEvent("portraitReport",{
|
||||
msg:{
|
||||
event_nickname: "boint_jifengood",
|
||||
page_type: "积分商城",
|
||||
resource_name:goodsName.value,
|
||||
event_val:goodsPoints.value,
|
||||
event_unit:'积分',
|
||||
number:goodsNum.value,
|
||||
belong:belong,
|
||||
},
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret);
|
||||
});
|
||||
setTimeout(() => {
|
||||
navTo({
|
||||
url: '/pages_goods/pointMall/pointMall?from=exchange'
|
||||
@@ -141,7 +164,8 @@ const email = ref('')
|
||||
const editingId = ref(null)
|
||||
const goodsUuid = ref('')
|
||||
const type = ref(1)
|
||||
const goodsNum = ref(1)
|
||||
const goodsNum = ref(1);
|
||||
const goodsName = ref('');
|
||||
const goBack = () => uni.navigateBack()
|
||||
|
||||
// 省市区数据(适配树形数组:[{code,label,value,children:[...] }...])
|
||||
@@ -213,6 +237,8 @@ onLoad((opts) => {
|
||||
goodsUuid.value = opts.goodsUuid
|
||||
goodsNum.value = opts.goodsNum;
|
||||
type.value = opts.type;
|
||||
goodsName.value = opts.goodsName;
|
||||
goodsPoints.value = opts.goodsPoints;
|
||||
getAddress()
|
||||
})
|
||||
const saveAddress = () => {
|
||||
|
||||
@@ -146,7 +146,7 @@ const goAddress = () => {
|
||||
freeVisible.value = true
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '/pages_goods/exchange/address?goodsUuid='+id.value+'&type='+type.value+'&goodsNum='+qty.value
|
||||
url: '/pages_goods/exchange/address?goodsUuid='+id.value+'&type='+type.value+'&goodsNum='+qty.value+'&goodsName='+title.value+'&goodsPoints='+needPoints.value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -263,6 +263,15 @@ onBackPress(() => {
|
||||
if(opts.name){
|
||||
name.value = opts.name;
|
||||
}
|
||||
// uni.sendNativeEvent("portraitReport",{
|
||||
// msg:{
|
||||
// event_nickname: "list_page",
|
||||
// page_type: "积分商城",
|
||||
// },
|
||||
// },
|
||||
// (ret) => {
|
||||
// console.log(ret);
|
||||
// });
|
||||
});
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user