图片组件跟患者列表
This commit is contained in:
parent
1cdb5a3311
commit
75277f5bb5
@ -243,8 +243,7 @@ export struct SenderMessageComponent {
|
|||||||
}.alignItems(HorizontalAlign.End).margin({ left: 8 }).width('75%')
|
}.alignItems(HorizontalAlign.End).margin({ left: 8 }).width('75%')
|
||||||
|
|
||||||
CommonAvatar({
|
CommonAvatar({
|
||||||
item: new AvatarItem(this.chatUserInfo != null ?
|
item: new AvatarItem( BasicConstant.urlHtml+authStore.getUser().photo,
|
||||||
this.chatUserInfo?.getCurrentUserAvatarUrl() : BasicConstant.urlHtml+authStore.getUser().photo,
|
|
||||||
this.chatUserInfo?.getCurrentUserAvatarName() ?? '',
|
this.chatUserInfo?.getCurrentUserAvatarName() ?? '',
|
||||||
AvatarColorUntil.getBackgroundColorById(this.message.message.senderId),
|
AvatarColorUntil.getBackgroundColorById(this.message.message.senderId),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -29,7 +29,8 @@ export struct CommonAvatar {
|
|||||||
if (this.item != null) {
|
if (this.item != null) {
|
||||||
|
|
||||||
if (this.item.avatarUrl == null || this.item.avatarUrl.toString().length <= 0) {
|
if (this.item.avatarUrl == null || this.item.avatarUrl.toString().length <= 0) {
|
||||||
Image(BasicConstant.urlHtml+authStore.getUser().photo)
|
// Image(BasicConstant.urlHtml+authStore.getUser().photo)
|
||||||
|
Image($r('app.media.icon_touxiang_persion_new'))
|
||||||
.onError(() => {
|
.onError(() => {
|
||||||
if(this.item!=null)
|
if(this.item!=null)
|
||||||
{
|
{
|
||||||
@ -88,7 +89,7 @@ export struct CommonAvatar {
|
|||||||
export function buildAvatar(item: AvatarItem, width: Length, height: Length,
|
export function buildAvatar(item: AvatarItem, width: Length, height: Length,
|
||||||
borderRadius?: Length | null) {
|
borderRadius?: Length | null) {
|
||||||
Stack() {
|
Stack() {
|
||||||
if (item.avatarUrl == null || item.avatarUrl.toString().length <= 0) {
|
if (item.avatarUrl == null || item.avatarUrl.toString().length <= 0||item.avatarUrl=='') {
|
||||||
Column() {
|
Column() {
|
||||||
}.width('100%').height('100%').backgroundColor(item.color)
|
}.width('100%').height('100%').backgroundColor(item.color)
|
||||||
|
|
||||||
|
|||||||
@ -89,4 +89,6 @@ export { InputPopWindow } from './src/main/ets/Views/InputPopWindow'
|
|||||||
|
|
||||||
export { ChatExtModel,ChatParam } from './src/main/ets/models/ChatExtModel'
|
export { ChatExtModel,ChatParam } from './src/main/ets/models/ChatExtModel'
|
||||||
|
|
||||||
export { PatientListModel,PatientsData } from './src/main/ets/models/PatientListModel'
|
export { PatientListModel,PatientsData } from './src/main/ets/models/PatientListModel'
|
||||||
|
|
||||||
|
export { applyListCallBacl, applyListModel, applyHistoryCallBacl , historyObjectModel, historyModel } from './src/main/ets/models/ApplyModel'
|
||||||
@ -147,6 +147,7 @@ export struct PreviewPhotos {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.index(this.previewIndex)
|
||||||
.indicator(false)
|
.indicator(false)
|
||||||
.loop(false) // 禁用循环滑动
|
.loop(false) // 禁用循环滑动
|
||||||
.onChange((index: number) => {
|
.onChange((index: number) => {
|
||||||
|
|||||||
@ -41,9 +41,9 @@ export struct ChangePhotoGrids {
|
|||||||
.width(20).height(20)
|
.width(20).height(20)
|
||||||
.position({ x: 55, y: 5 })
|
.position({ x: 55, y: 5 })
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
|
|
||||||
this.removeImg=!this.removeImg
|
|
||||||
this.removeIndex=index
|
this.removeIndex=index
|
||||||
|
this.removeImg=!this.removeImg
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
56
commons/basic/src/main/ets/models/ApplyModel.ets
Normal file
56
commons/basic/src/main/ets/models/ApplyModel.ets
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
export interface applyListCallBacl {
|
||||||
|
code:number,
|
||||||
|
msg:string,
|
||||||
|
data:applyListModel[],
|
||||||
|
message:string,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface applyHistoryCallBacl {
|
||||||
|
code:number,
|
||||||
|
msg:string,
|
||||||
|
data:historyObjectModel,
|
||||||
|
message:string,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class applyListModel {
|
||||||
|
mobile?:string;
|
||||||
|
photo?:string;
|
||||||
|
birthDate?:string;
|
||||||
|
sex?:number;
|
||||||
|
realName?:string;
|
||||||
|
checkDate?:string;
|
||||||
|
uuid?:string;
|
||||||
|
createDate?:string;
|
||||||
|
patientUuid?:string;
|
||||||
|
expertUuid?:string;
|
||||||
|
status?:number;
|
||||||
|
content?:string;
|
||||||
|
nationName?:string;
|
||||||
|
provName?:string;
|
||||||
|
cityName?:string;
|
||||||
|
countyName?:string;
|
||||||
|
nation?:string;
|
||||||
|
note?:string
|
||||||
|
nickname?:string
|
||||||
|
groupType?:string
|
||||||
|
groupUuid?:string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface historyObjectModel {
|
||||||
|
list:historyModel[];
|
||||||
|
isFirstPage?:string;
|
||||||
|
isLastPage?:string;
|
||||||
|
pageNum?:string;
|
||||||
|
pages?:string;
|
||||||
|
pageSize?:string;
|
||||||
|
total?:string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class historyModel {
|
||||||
|
status?:string;//审核状态(1.待审核2.审核通过3.拒绝4.已过期 5.患者取消 6专家解除)
|
||||||
|
patient_photo?:string;
|
||||||
|
create_date?:string;
|
||||||
|
content?:string;
|
||||||
|
nickname?:string;
|
||||||
|
patient_name?:string;
|
||||||
|
}
|
||||||
@ -233,5 +233,15 @@ export class ChangeUtil {
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
//将第一位移动到最后一位
|
||||||
|
static moveFirstToEnd(arr: string[]): string[] {
|
||||||
|
if (arr.length <= 1) return arr;
|
||||||
|
const first = arr[0];
|
||||||
|
// 前移后续元素(从索引1开始)
|
||||||
|
for (let i = 1; i < arr.length; i++) {
|
||||||
|
arr[i - 1] = arr[i];
|
||||||
|
}
|
||||||
|
arr[arr.length - 1] = first; // 首位移至末尾
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -14,6 +14,10 @@ class PreferenceStore {
|
|||||||
this.getStore().putSync(keyword, value)
|
this.getStore().putSync(keyword, value)
|
||||||
this.getStore().flush()
|
this.getStore().flush()
|
||||||
}
|
}
|
||||||
|
setItemNumber(keyword: string,value:number) {
|
||||||
|
this.getStore().putSync(keyword, value)
|
||||||
|
this.getStore().flush()
|
||||||
|
}
|
||||||
setItemBoolean(keyword: string,value:boolean) {
|
setItemBoolean(keyword: string,value:boolean) {
|
||||||
this.getStore().putSync(keyword, value)
|
this.getStore().putSync(keyword, value)
|
||||||
this.getStore().flush()
|
this.getStore().flush()
|
||||||
@ -25,6 +29,9 @@ class PreferenceStore {
|
|||||||
getItemString(keyword: string) {
|
getItemString(keyword: string) {
|
||||||
return this.getStore().getSync(keyword,'') as string
|
return this.getStore().getSync(keyword,'') as string
|
||||||
}
|
}
|
||||||
|
getItemNumber(keyword: string) {
|
||||||
|
return this.getStore().getSync(keyword,0) as number
|
||||||
|
}
|
||||||
getItemBooleanT(keyword: string):boolean {
|
getItemBooleanT(keyword: string):boolean {
|
||||||
return this.getStore().getSync(keyword,true) as boolean
|
return this.getStore().getSync(keyword,true) as boolean
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
commons/basic/src/main/resources/base/media/close.png
Normal file
BIN
commons/basic/src/main/resources/base/media/close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
commons/basic/src/main/resources/base/media/patientgif.png
Normal file
BIN
commons/basic/src/main/resources/base/media/patientgif.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
@ -16,6 +16,7 @@ export struct MyOpinionComp {
|
|||||||
@State photos: string[] = []
|
@State photos: string[] = []
|
||||||
@State previewIndex: number = -1
|
@State previewIndex: number = -1
|
||||||
@State maxSelectNumber: number = 6
|
@State maxSelectNumber: number = 6
|
||||||
|
|
||||||
private photoSheetDialog!: CustomDialogController;
|
private photoSheetDialog!: CustomDialogController;
|
||||||
@State
|
@State
|
||||||
@Watch('onRemoveImg')
|
@Watch('onRemoveImg')
|
||||||
@ -36,7 +37,8 @@ export struct MyOpinionComp {
|
|||||||
onRemoveImg()
|
onRemoveImg()
|
||||||
{
|
{
|
||||||
this.photos.splice(this.removeIndex, 1)
|
this.photos.splice(this.removeIndex, 1)
|
||||||
this.maxSelectNumber = this.maxSelectNumber - this.photos.length;
|
this.maxSelectNumber =6- this.photos.length;
|
||||||
|
let a= this.maxSelectNumber
|
||||||
}
|
}
|
||||||
private custom!:CustomDialogController;
|
private custom!:CustomDialogController;
|
||||||
dialog: CustomDialogController = new CustomDialogController({
|
dialog: CustomDialogController = new CustomDialogController({
|
||||||
@ -89,8 +91,7 @@ export struct MyOpinionComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.photos.push(...selectedUris);
|
this.photos.push(...selectedUris);
|
||||||
this.maxSelectNumber = this.maxSelectNumber - this.photos.length;
|
this.maxSelectNumber = 6- this.photos.length;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +113,7 @@ export struct MyOpinionComp {
|
|||||||
if(this.params.myAnswer.imgs!=null)
|
if(this.params.myAnswer.imgs!=null)
|
||||||
{
|
{
|
||||||
this.photos.push(...this.changeToImgs(this.params.myAnswer.imgs.split(",")))
|
this.photos.push(...this.changeToImgs(this.params.myAnswer.imgs.split(",")))
|
||||||
this.maxSelectNumber = this.maxSelectNumber - this.photos.length;
|
this.maxSelectNumber = 6- this.photos.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,19 @@
|
|||||||
import { authStore, BasicConstant, hdHttp, HdLoadingDialog,HdNav, HdResponse, patientDbManager,
|
import {
|
||||||
|
applyListCallBacl,
|
||||||
|
applyListModel,
|
||||||
|
authStore, BasicConstant,
|
||||||
|
ChangeUtil,
|
||||||
|
hdHttp, HdLoadingDialog,HdNav, HdResponse, patientDbManager,
|
||||||
PatientListModel,
|
PatientListModel,
|
||||||
PatientsData} from '@itcast/basic'
|
PatientsData,
|
||||||
|
preferenceStore} from '@itcast/basic'
|
||||||
import { Groups } from '../model/Groups';
|
import { Groups } from '../model/Groups';
|
||||||
import { display } from '@kit.ArkUI';
|
import { display } from '@kit.ArkUI';
|
||||||
import { StringIsEmpty } from '@nimkit/common';
|
import { StringIsEmpty } from '@nimkit/common';
|
||||||
import I18n from '@ohos.i18n';
|
import I18n from '@ohos.i18n';
|
||||||
import Intl from '@ohos.intl';
|
import Intl from '@ohos.intl';
|
||||||
|
import { BusinessError } from '@kit.BasicServicesKit';
|
||||||
|
|
||||||
let collator = new Intl.Collator(I18n.System.getSystemLocale(), {
|
let collator = new Intl.Collator(I18n.System.getSystemLocale(), {
|
||||||
usage: 'sort',
|
usage: 'sort',
|
||||||
collation: 'pinyin',
|
collation: 'pinyin',
|
||||||
@ -22,18 +30,51 @@ export struct PatientListComp {
|
|||||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#']
|
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '#']
|
||||||
|
|
||||||
private indexUtil = I18n.getInstance(I18n.System.getSystemLocale());
|
private indexUtil = I18n.getInstance(I18n.System.getSystemLocale());
|
||||||
|
displayClass = display.getDefaultDisplaySync()
|
||||||
@State alphabetSelected: number = 0
|
@State alphabetSelected: number = 0
|
||||||
dialog: CustomDialogController = new CustomDialogController({
|
dialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||||
customStyle: true,
|
customStyle: true,
|
||||||
alignment: DialogAlignment.Center
|
alignment: DialogAlignment.Center
|
||||||
})
|
})
|
||||||
|
@State count: number = 0
|
||||||
|
@State total: number = 0
|
||||||
|
@State old:number=preferenceStore.getItemNumber('old_patient_num')
|
||||||
|
@State applyArray:applyListModel[] = [];
|
||||||
|
@State needShow:boolean=false
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
this. PatientsData()
|
this. PatientsData()
|
||||||
|
|
||||||
this.loadPatients()
|
this.loadPatients()
|
||||||
|
this.getApplyList()
|
||||||
|
}
|
||||||
|
getApplyList() {
|
||||||
|
this.dialog.open()
|
||||||
|
hdHttp.post<string>(BasicConstant.applyList, {
|
||||||
|
expertUuid: authStore.getUser().uuid,
|
||||||
|
} as updateExtraData).then(async (res: HdResponse<string>) => {
|
||||||
|
this.dialog.close();
|
||||||
|
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
|
||||||
|
if(json.code == 1) {
|
||||||
|
this.applyArray = json.data;
|
||||||
|
if( this.applyArray!=null)
|
||||||
|
{
|
||||||
|
this.applyArray.forEach( item=>{
|
||||||
|
if(1==item.status)
|
||||||
|
{
|
||||||
|
this.count++
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}).catch((err: BusinessError) => {
|
||||||
|
this.dialog.close();
|
||||||
|
|
||||||
|
console.info(`Response fails: ${err}`);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
PatientsData()
|
PatientsData()
|
||||||
@ -47,7 +88,32 @@ export struct PatientListComp {
|
|||||||
console.log('服务器返回的患者数据:', json);
|
console.log('服务器返回的患者数据:', json);
|
||||||
if(json.data!=null)
|
if(json.data!=null)
|
||||||
{
|
{
|
||||||
this.collationData(json.data);
|
// let regionRequestData: PatientsData[]=[...json.data]
|
||||||
|
// regionRequestData =[...json.data]
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// regionRequestData.push(...json.data)
|
||||||
|
// this.collationData(regionRequestData);
|
||||||
|
if(json.data!=null&&json.data.length>0)
|
||||||
|
{
|
||||||
|
this.total=json.data.length
|
||||||
|
if(this.old<this.total/10)
|
||||||
|
{
|
||||||
|
this.needShow=true
|
||||||
|
preferenceStore.setItemNumber('old_patient_num',this.total/10)
|
||||||
|
}
|
||||||
|
this.collationData(json.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -77,7 +143,6 @@ export struct PatientListComp {
|
|||||||
.alignItems(VerticalAlign.Center)
|
.alignItems(VerticalAlign.Center)
|
||||||
.justifyContent(FlexAlign.Start)
|
.justifyContent(FlexAlign.Start)
|
||||||
.backgroundColor($r('sys.color.ohos_id_color_panel_bg'))
|
.backgroundColor($r('sys.color.ohos_id_color_panel_bg'))
|
||||||
// .enabled(this.selectState)
|
|
||||||
.height(40)
|
.height(40)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.padding({ left: 15,})
|
.padding({ left: 15,})
|
||||||
@ -89,8 +154,7 @@ export struct PatientListComp {
|
|||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws')})
|
HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws')})
|
||||||
Stack({ alignContent: Alignment.TopEnd }) {
|
Stack({ }) {
|
||||||
Column() {
|
|
||||||
List({ scroller: this.scroller, space: 0, initialIndex: 0 }) {
|
List({ scroller: this.scroller, space: 0, initialIndex: 0 }) {
|
||||||
ListItem() {
|
ListItem() {
|
||||||
Column()
|
Column()
|
||||||
@ -110,7 +174,7 @@ export struct PatientListComp {
|
|||||||
.maxLines(1)
|
.maxLines(1)
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
.ellipsisMode(EllipsisMode.END)
|
.ellipsisMode(EllipsisMode.END)
|
||||||
Text('(待审核'+'人)')
|
Text('(待审核'+this.count+'人)')
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.fontColor(Color.Red)
|
.fontColor(Color.Red)
|
||||||
.layoutWeight(1)
|
.layoutWeight(1)
|
||||||
@ -119,8 +183,9 @@ export struct PatientListComp {
|
|||||||
.maxLines(1)
|
.maxLines(1)
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
.ellipsisMode(EllipsisMode.END)
|
.ellipsisMode(EllipsisMode.END)
|
||||||
|
.visibility(this.count>0?Visibility.Visible:Visibility.Hidden)
|
||||||
}.layoutWeight(1)
|
}.layoutWeight(1)
|
||||||
|
|
||||||
.align(Alignment.Start)
|
.align(Alignment.Start)
|
||||||
|
|
||||||
Column()
|
Column()
|
||||||
@ -136,7 +201,7 @@ export struct PatientListComp {
|
|||||||
.alignItems(VerticalAlign.Center)
|
.alignItems(VerticalAlign.Center)
|
||||||
.padding({ top:10,bottom:10})
|
.padding({ top:10,bottom:10})
|
||||||
.width('100%')
|
.width('100%')
|
||||||
Text().height(0.5).backgroundColor($r('sys.color.ohos_id_color_list_separator')).width('100%')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -162,7 +227,7 @@ export struct PatientListComp {
|
|||||||
.maxLines(1)
|
.maxLines(1)
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
.ellipsisMode(EllipsisMode.END)
|
.ellipsisMode(EllipsisMode.END)
|
||||||
Text('(随访'+'人)')
|
Text('(随访'+this.total+'人)')
|
||||||
.fontSize(16)
|
.fontSize(16)
|
||||||
.fontColor(Color.Red)
|
.fontColor(Color.Red)
|
||||||
.layoutWeight(1)
|
.layoutWeight(1)
|
||||||
@ -171,7 +236,7 @@ export struct PatientListComp {
|
|||||||
.maxLines(1)
|
.maxLines(1)
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
.ellipsisMode(EllipsisMode.END)
|
.ellipsisMode(EllipsisMode.END)
|
||||||
|
.visibility(this.total>0?Visibility.Visible:Visibility.Hidden)
|
||||||
}.layoutWeight(1)
|
}.layoutWeight(1)
|
||||||
.align(Alignment.Start)
|
.align(Alignment.Start)
|
||||||
|
|
||||||
@ -197,101 +262,76 @@ export struct PatientListComp {
|
|||||||
ForEach(this.regionDataGroupsList, (regionDataGroups: Groups, index) => {
|
ForEach(this.regionDataGroupsList, (regionDataGroups: Groups, index) => {
|
||||||
|
|
||||||
ListItemGroup({ header: this.itemHead(regionDataGroups.title) }) {
|
ListItemGroup({ header: this.itemHead(regionDataGroups.title) }) {
|
||||||
ListItem() {
|
|
||||||
List() {
|
|
||||||
ForEach(regionDataGroups.regionDataList, (regionData: PatientsData, index?: number) => {
|
ForEach(regionDataGroups.regionDataList, (regionData: PatientsData, index?: number) => {
|
||||||
ListItem() {
|
ListItem() {
|
||||||
Row() {
|
Column()
|
||||||
Image(BasicConstant.urlHtml+regionData.photo)
|
{
|
||||||
.alt($r('app.media.userPhoto_default'))
|
Row() {
|
||||||
.width(50)
|
Image(BasicConstant.urlHtml+regionData.photo)
|
||||||
.height(50)
|
.alt($r('app.media.userPhoto_default'))
|
||||||
.margin({ left:10 })
|
.width(50)
|
||||||
.borderRadius(8)
|
.height(50)
|
||||||
Column()
|
|
||||||
{
|
|
||||||
Text(regionData.realName)
|
|
||||||
.fontSize(16)
|
|
||||||
.fontColor($r('app.color.common_gray_01'))
|
|
||||||
.width('100%')
|
|
||||||
.textAlign(TextAlign.Start)
|
|
||||||
.padding({left:10,right:10})
|
|
||||||
.maxLines(1)
|
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
||||||
.ellipsisMode(EllipsisMode.END)
|
|
||||||
Text(regionData.diagnosis?regionData.diagnosis.includes("甲、乙、丙、丁") ? '肝炎' :regionData.diagnosis:'')
|
|
||||||
.fontSize(12)
|
|
||||||
.borderColor($r('app.color.top_title'))
|
|
||||||
.fontColor($r('app.color.top_title'))
|
|
||||||
.padding({left:8,right:8,top:3,bottom:3})
|
|
||||||
.borderRadius(17)
|
|
||||||
.borderWidth(1)
|
|
||||||
.textAlign(TextAlign.Center)
|
|
||||||
.margin({top:5,left:10})
|
|
||||||
.visibility(regionData.diagnosis?Visibility.Visible:Visibility.None)
|
|
||||||
.alignSelf(ItemAlign.Start)
|
|
||||||
|
|
||||||
}.layoutWeight(1)
|
|
||||||
.align(Alignment.Start)
|
|
||||||
|
|
||||||
Column()
|
|
||||||
{
|
|
||||||
Image($r('app.media.edit_patitent'))
|
|
||||||
.width(24)
|
|
||||||
.height(24)
|
|
||||||
.margin({ left:10 })
|
.margin({ left:10 })
|
||||||
.alignSelf(ItemAlign.End)
|
.borderRadius(8)
|
||||||
|
Column()
|
||||||
|
{
|
||||||
|
Text(regionData.realName)
|
||||||
|
.fontSize(16)
|
||||||
|
.fontColor($r('app.color.common_gray_01'))
|
||||||
|
.width('100%')
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
.padding({left:10,right:10})
|
||||||
|
.maxLines(1)
|
||||||
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
|
.ellipsisMode(EllipsisMode.END)
|
||||||
|
Text(regionData.diagnosis?regionData.diagnosis.includes("甲、乙、丙、丁") ? '肝炎' :regionData.diagnosis:'')
|
||||||
|
.fontSize(12)
|
||||||
|
.borderColor($r('app.color.top_title'))
|
||||||
|
.fontColor($r('app.color.top_title'))
|
||||||
|
.padding({left:8,right:8,top:3,bottom:3})
|
||||||
|
.borderRadius(17)
|
||||||
|
.borderWidth(1)
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
|
.margin({top:5,left:10})
|
||||||
|
.visibility(regionData.diagnosis?Visibility.Visible:Visibility.None)
|
||||||
|
.alignSelf(ItemAlign.Start)
|
||||||
|
|
||||||
Text(regionData.join_date ?"随访于"+ regionData.join_date.split(" ")[0] :'')
|
}.layoutWeight(1)
|
||||||
.fontSize(12)
|
.align(Alignment.Start)
|
||||||
.fontColor($r('app.color.666666'))
|
|
||||||
.margin({top:5})
|
|
||||||
.textAlign(TextAlign.Center)
|
|
||||||
.visibility(regionData.join_date?Visibility.Visible:Visibility.None)
|
|
||||||
|
|
||||||
}.align(Alignment.End).padding({right:30})
|
Column()
|
||||||
|
{
|
||||||
|
Image($r('app.media.edit_patitent'))
|
||||||
|
.width(24)
|
||||||
|
.height(24)
|
||||||
|
.margin({ left:10 })
|
||||||
|
.alignSelf(ItemAlign.End)
|
||||||
|
|
||||||
|
Text(regionData.join_date ?"随访于"+ regionData.join_date.split(" ")[0] :'')
|
||||||
|
.fontSize(12)
|
||||||
|
.fontColor($r('app.color.666666'))
|
||||||
|
.margin({top:5})
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
|
.visibility(regionData.join_date?Visibility.Visible:Visibility.None)
|
||||||
|
|
||||||
|
}.align(Alignment.End).padding({right:30})
|
||||||
|
}
|
||||||
|
.alignItems(VerticalAlign.Center)
|
||||||
|
.padding({ top:10,bottom:10})
|
||||||
|
.width('100%')
|
||||||
|
Text().height(1).width('100%').backgroundColor( $r('sys.color.ohos_id_color_panel_bg'))
|
||||||
}
|
}
|
||||||
.alignItems(VerticalAlign.Center)
|
|
||||||
.padding({ top:10,bottom:10})
|
|
||||||
.width('100%')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// .height(100)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.align(Alignment.Start)
|
.align(Alignment.Start)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
// // 暂不选择需要退出
|
|
||||||
// if (regionData.name === this.noSelect) {
|
|
||||||
// this.selectedRegion = '';
|
|
||||||
// // 页面返回
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// this.selectedRegion = regionData.name;
|
|
||||||
// this.selectState = false;
|
|
||||||
// if (this.pageLevel < 4) {
|
|
||||||
// this.pageLevel++;
|
|
||||||
// }
|
|
||||||
// let regionData1 = this.getData('data2');
|
|
||||||
// if (this.pageLevel > 1) {
|
|
||||||
// regionData1 = this.getData('data3');
|
|
||||||
// }
|
|
||||||
// if (regionData1.regionInfos.length === 0) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (this.pageLevel < 4) {
|
|
||||||
// this.collationData(regionData1, false);
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
.divider({
|
|
||||||
strokeWidth: 0.5,
|
|
||||||
color: $r('sys.color.ohos_id_color_list_separator'),
|
|
||||||
startMargin: 0,
|
|
||||||
endMargin: 0
|
|
||||||
})
|
|
||||||
.width('100%')
|
|
||||||
}
|
|
||||||
.width('100%')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
@ -300,21 +340,30 @@ export struct PatientListComp {
|
|||||||
|
|
||||||
}
|
}
|
||||||
.sticky(StickyStyle.None)
|
.sticky(StickyStyle.None)
|
||||||
|
.divider({
|
||||||
|
strokeWidth: 1,
|
||||||
|
color: $r('sys.color.ohos_id_color_panel_bg'),
|
||||||
|
startMargin: 0,
|
||||||
|
endMargin: 0
|
||||||
|
})
|
||||||
.onScrollIndex((start: number, end: number) => {
|
.onScrollIndex((start: number, end: number) => {
|
||||||
|
if(start<3)
|
||||||
|
{
|
||||||
|
start=0
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
start=start-2
|
||||||
|
}
|
||||||
let target = this.indexList[start]
|
let target = this.indexList[start]
|
||||||
let indexList = this.normalIndexValue;
|
let indexList = this.normalIndexValue;
|
||||||
let index = this.searchIndex(indexList, target)
|
let index = this.searchIndex(indexList, target)
|
||||||
this.alphabetSelected = index === -1 ? this.onSlideList(indexList, target) - 1 : index;
|
this.alphabetSelected = index === -1 ? this.onSlideList(indexList, target) - 1 : index;
|
||||||
|
|
||||||
})
|
})
|
||||||
.layoutWeight(1)
|
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.scrollBar(BarState.Off)
|
.scrollBar(BarState.Off)
|
||||||
// Text().height(56).width('100%')
|
|
||||||
}
|
|
||||||
.width('100%')
|
|
||||||
.height('100%')
|
|
||||||
|
|
||||||
Column() {
|
|
||||||
AlphabetIndexer({
|
AlphabetIndexer({
|
||||||
arrayValue: this.normalIndexValue,
|
arrayValue: this.normalIndexValue,
|
||||||
selected: 0
|
selected: 0
|
||||||
@ -329,26 +378,17 @@ export struct PatientListComp {
|
|||||||
let pos = 0
|
let pos = 0
|
||||||
let useValue = this.normalIndexValue
|
let useValue = this.normalIndexValue
|
||||||
let currentWord = useValue[index] // 在右侧索引上的位置
|
let currentWord = useValue[index] // 在右侧索引上的位置
|
||||||
if (currentWord === '·') { // 在右侧索引上的位置 刚号是点,则需要找右侧索引上一个字母
|
|
||||||
|
|
||||||
let beforeWord = useValue[index - 1]; // 这个是右侧索引点的上一个字母
|
pos = this.searchIndex(this.indexList, currentWord)
|
||||||
let afterWord = useValue[index + 1];
|
|
||||||
|
|
||||||
pos = this.onClickPointIndex(this.indexList, beforeWord, afterWord)
|
|
||||||
} else {
|
|
||||||
pos = this.searchIndex(this.indexList, currentWord)
|
|
||||||
}
|
|
||||||
if (pos === -1) {
|
if (pos === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.scroller.scrollToIndex(pos);
|
this.scroller.scrollToIndex(pos+2);
|
||||||
})
|
})
|
||||||
.id('id_hwid_region_choose_alphabetIndexer')
|
.id('id_hwid_region_choose_alphabetIndexer')
|
||||||
.onAreaChange((oldValue: Area, newValue: Area) => {
|
.onAreaChange((oldValue: Area, newValue: Area) => {
|
||||||
// 获取屏幕对象
|
|
||||||
let displayObj: display.Display = display.getDefaultDisplaySync();
|
|
||||||
// 获取屏幕高度
|
|
||||||
let displayHeight: number = displayObj.height / displayObj.densityPixels;
|
|
||||||
})
|
})
|
||||||
.itemSize('20')
|
.itemSize('20')
|
||||||
.font({ size: '20vp' })
|
.font({ size: '20vp' })
|
||||||
@ -356,13 +396,27 @@ export struct PatientListComp {
|
|||||||
size: '20vp', style: FontStyle.Normal,
|
size: '20vp', style: FontStyle.Normal,
|
||||||
weight: FontWeight.Bolder
|
weight: FontWeight.Bolder
|
||||||
})
|
})
|
||||||
|
.position({ x: this.displayClass.width / this.displayClass.densityPixels - 25 }) // 侧边栏位置
|
||||||
|
|
||||||
|
Column()
|
||||||
|
{
|
||||||
|
Image($r('app.media.close')).width(40).height(40).margin({right:50,top:60})
|
||||||
|
.position({x:this.displayClass.width / this.displayClass.densityPixels-50,y:60})
|
||||||
|
.onClick(()=>{
|
||||||
|
this.needShow=false
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.visibility(this.needShow?Visibility.Visible:Visibility.None)
|
||||||
|
.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
.backgroundColor(Color.Transparent)
|
.backgroundImageSize(ImageSize.Contain)
|
||||||
|
.backgroundImagePosition(Alignment.Center)
|
||||||
|
.backgroundImage($r('app.media.patientgif'))
|
||||||
|
.backgroundColor('#44444444')
|
||||||
}
|
}
|
||||||
.layoutWeight(1)
|
.layoutWeight(1)
|
||||||
|
.width('100%')
|
||||||
|
|
||||||
}.width('100%')
|
}.width('100%')
|
||||||
.height('100%')
|
.height('100%')
|
||||||
@ -388,17 +442,21 @@ export struct PatientListComp {
|
|||||||
this.regionDataGroupsList = [];
|
this.regionDataGroupsList = [];
|
||||||
this.regionInfo.forEach((value: PatientsData) => {
|
this.regionInfo.forEach((value: PatientsData) => {
|
||||||
let index = this.indexUtil.getIndex(value.nickname);
|
let index = this.indexUtil.getIndex(value.nickname);
|
||||||
|
if(!ChangeUtil.isLetter(index))
|
||||||
|
{
|
||||||
|
index='#'
|
||||||
|
}
|
||||||
|
|
||||||
if (this.indexList.indexOf(index) === -1) {
|
if (this.indexList.indexOf(index) === -1) {
|
||||||
let regionDataGroups: Groups = new Groups();
|
let regionDataGroups: Groups = new Groups();
|
||||||
if(this.normalIndexValue.includes(index))
|
// if(this.normalIndexValue.includes(index))
|
||||||
{
|
// {
|
||||||
regionDataGroups.title = index;
|
regionDataGroups.title = index;
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
regionDataGroups.title = '#';
|
// regionDataGroups.title = '#';
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.indexList.push(index);
|
this.indexList.push(index);
|
||||||
regionDataGroups.regionDataList.push(value);
|
regionDataGroups.regionDataList.push(value);
|
||||||
@ -408,6 +466,10 @@ export struct PatientListComp {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if( this.indexList.length>0&&!ChangeUtil.isLetter(this.indexList[0]))
|
||||||
|
{
|
||||||
|
ChangeUtil.moveFirstToEnd(this.indexList)
|
||||||
|
}
|
||||||
this.regionDataGroupsList.sort((a, b) => {
|
this.regionDataGroupsList.sort((a, b) => {
|
||||||
return this.normalIndexValue.indexOf(a.title) - this.normalIndexValue.indexOf(b.title);
|
return this.normalIndexValue.indexOf(a.title) - this.normalIndexValue.indexOf(b.title);
|
||||||
});
|
});
|
||||||
@ -420,15 +482,7 @@ export struct PatientListComp {
|
|||||||
}
|
}
|
||||||
private onSlideList(indexList: string[], target: string): number {
|
private onSlideList(indexList: string[], target: string): number {
|
||||||
for (let i = 1; i < indexList.length; i++) {
|
for (let i = 1; i < indexList.length; i++) {
|
||||||
if (indexList[i] > target && indexList[i] !== '·') {
|
if (indexList[i] > target ) {
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
private onClickPointIndex(indexList: string[], beforeWord: string, afterWord: string): number {
|
|
||||||
for (let i = 1; i < indexList.length; i++) {
|
|
||||||
if (indexList[i] > beforeWord && indexList[i] < afterWord) {
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user