1.2.0部分代码
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
import { gandanfileModel, guideModel } from "../model/HomeModel";
|
||||
|
||||
@Component
|
||||
export struct HomeGanDanFileComp {
|
||||
@Prop gandanFileList:gandanfileModel[]
|
||||
@Prop guideList:guideModel[]
|
||||
@State currentIndex: number = 0
|
||||
private tabsController: TabsController = new TabsController()
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
this.headerView()
|
||||
this.tabContent()
|
||||
}
|
||||
.width('100%')
|
||||
.backgroundColor('#F5F5F5')
|
||||
}
|
||||
|
||||
@Builder
|
||||
headerView() {
|
||||
Stack() {
|
||||
Row() {
|
||||
Image($r('app.media.home_guideAndShare_icon'))
|
||||
.width('70%')
|
||||
.height(50)
|
||||
.objectFit(ImageFit.Cover)
|
||||
}
|
||||
.width('100%')
|
||||
.height(50)
|
||||
.justifyContent(FlexAlign.End)
|
||||
|
||||
Row() {
|
||||
Row() {
|
||||
Column() {
|
||||
Text('实用指南')
|
||||
.fontSize(this.currentIndex === 0 ? 17 :14)
|
||||
.fontColor(this.currentIndex === 0 ? '#000000' : '#666666')
|
||||
.fontWeight(this.currentIndex === 0 ? FontWeight.Bold : FontWeight.Normal)
|
||||
Blank()
|
||||
.width(32)
|
||||
.height(2)
|
||||
.margin({top:5})
|
||||
.backgroundColor($r('app.color.main_color'))
|
||||
.visibility(this.currentIndex == 0? Visibility.Visible: Visibility.Hidden)
|
||||
}
|
||||
.width(80)
|
||||
.height(50)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
.onClick(() => {
|
||||
this.currentIndex = 0
|
||||
this.tabsController.changeIndex(0)
|
||||
})
|
||||
|
||||
Column() {
|
||||
Text('课件分享')
|
||||
.fontSize(this.currentIndex === 1 ? 17 : 14)
|
||||
.fontColor(this.currentIndex === 1 ? '#000000' : '#666666')
|
||||
.fontWeight(this.currentIndex === 1 ? FontWeight.Bold : FontWeight.Normal)
|
||||
Blank()
|
||||
.width(32)
|
||||
.height(2)
|
||||
.margin({top:5})
|
||||
.backgroundColor($r('app.color.main_color'))
|
||||
.visibility(this.currentIndex == 1? Visibility.Visible: Visibility.Hidden)
|
||||
}
|
||||
.width(80)
|
||||
.height(50)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
.onClick(() => {
|
||||
this.currentIndex = 1
|
||||
this.tabsController.changeIndex(1)
|
||||
})
|
||||
}
|
||||
.width('80%')
|
||||
.justifyContent(FlexAlign.Start)
|
||||
.margin({ left: 15 })
|
||||
|
||||
Row() {
|
||||
Text('更多')
|
||||
.fontSize(15)
|
||||
.fontColor('#999999')
|
||||
Image($r('app.media.arrow_right'))
|
||||
.width(10)
|
||||
.height(15)
|
||||
.margin({ left: 5 })
|
||||
}
|
||||
.width(100)
|
||||
.height('100%')
|
||||
.padding({right:10})
|
||||
}
|
||||
.width('100%')
|
||||
.height(60)
|
||||
.alignItems(VerticalAlign.Center)
|
||||
}
|
||||
.width('100%')
|
||||
.height(50)
|
||||
.backgroundColor(Color.White)
|
||||
}
|
||||
|
||||
@Builder
|
||||
tabContent() {
|
||||
Tabs({ index: this.currentIndex, controller: this.tabsController }) {
|
||||
TabContent() {
|
||||
this.BuildGuideList()
|
||||
}
|
||||
TabContent() {
|
||||
this.BuildShareList()
|
||||
}
|
||||
}
|
||||
.onChange((index: number) => {
|
||||
this.currentIndex = index
|
||||
})
|
||||
.width('100%')
|
||||
.barWidth(0)
|
||||
.animationDuration(0)
|
||||
.backgroundColor(Color.White)
|
||||
}
|
||||
|
||||
@Builder
|
||||
BuildGuideList() {
|
||||
Column() {
|
||||
this.BuildListItem(
|
||||
'一学就会的keynote教程番外篇】keynote 线下实训你们要的带练来了',
|
||||
'查看'
|
||||
)
|
||||
|
||||
this.BuildListItem(
|
||||
'胆源性肝脏疾病一专题研讨会成功举行',
|
||||
'查看'
|
||||
)
|
||||
}
|
||||
.width('100%')
|
||||
}
|
||||
|
||||
// 构建课件分享列表
|
||||
@Builder
|
||||
BuildShareList() {
|
||||
Column() {
|
||||
this.BuildListItem(
|
||||
'肝病学新领域:肝硬化合并慢性肾脏病 | 深度综述大的并慢性肾脏病 | 深度综述并慢并慢性...',
|
||||
'↓'
|
||||
)
|
||||
|
||||
this.BuildListItem(
|
||||
'【一学就会的keynote教程番外篇】keynote 线下实训你们要的带练来了',
|
||||
'↓'
|
||||
)
|
||||
|
||||
this.BuildListItem(
|
||||
'段钟平教授:终末期肝病营养治疗的价值及研究进展',
|
||||
'↓'
|
||||
)
|
||||
}
|
||||
.width('100%')
|
||||
}
|
||||
|
||||
// 构建列表项
|
||||
@Builder
|
||||
BuildListItem(title: string, action: string) {
|
||||
Row() {
|
||||
Text(title)
|
||||
.fontSize(14)
|
||||
.fontColor('#000000')
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.maxLines(2)
|
||||
.layoutWeight(1)
|
||||
|
||||
Text(action)
|
||||
.fontSize(14)
|
||||
.fontColor('#FF0000')
|
||||
.margin({ left: 10 })
|
||||
}
|
||||
.width('95%')
|
||||
.padding(10)
|
||||
.backgroundColor('#f4f4f4')
|
||||
.borderRadius(8)
|
||||
.margin({ left: 10, bottom: 10, right:10 })
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ export struct HomeIconComp {
|
||||
@State consultation: string = '公益咨询';
|
||||
@State consultationRed: boolean = false;
|
||||
@State iconListtmp:iconsModel[]=[];
|
||||
|
||||
listener: (info: uiObserver.RouterPageInfo) => void = (info: uiObserver.RouterPageInfo) => {
|
||||
let routerInfo: uiObserver.RouterPageInfo | undefined = this.queryRouterPageInfo();
|
||||
if (info.pageId == routerInfo?.pageId) {
|
||||
@@ -36,6 +37,7 @@ export struct HomeIconComp {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
let uiObserver: UIObserver = this.getUIContext().getUIObserver();
|
||||
uiObserver.on('routerPageUpdate', this.listener);
|
||||
@@ -79,52 +81,39 @@ export struct HomeIconComp {
|
||||
{
|
||||
consultcount++
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
unreadCount=unreadCount-consultcount
|
||||
if(unreadCount>0)
|
||||
{
|
||||
if(unreadCount>0) {
|
||||
this.patientRed=true
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.patientRed=false
|
||||
hdHttp.post<string>(BasicConstant.applyList,{
|
||||
expertUuid: authStore.getUser().uuid,
|
||||
} as updateExtraData).then(async (res: HdResponse<string>) => {
|
||||
let json:applyListCallBacl = JSON.parse(res+'') as applyListCallBacl;
|
||||
if(json.code == 1) {
|
||||
if(json.data!=null&&json.data.length>0)
|
||||
{
|
||||
if(json.data!=null&&json.data.length>0) {
|
||||
this.patientRed=true
|
||||
}
|
||||
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
})
|
||||
}
|
||||
if(consultcount>0)
|
||||
{
|
||||
if(consultcount>0) {
|
||||
this.consultationRed=true
|
||||
}
|
||||
|
||||
this.initList()
|
||||
const hashMap: HashMap<string, string> = new HashMap();
|
||||
hdHttp.httpReq<string>(BasicConstant.indexV2,hashMap).then(async (res: HdResponse<string>) => {
|
||||
let json:HomeModel = JSON.parse(res+'') as HomeModel;
|
||||
if(json.data!=null&&json.data.consult_list!=null&&json.data.consult_list.list!=null)
|
||||
{
|
||||
if(json.data!=null&&json.data.consult_list!=null&&json.data.consult_list.list!=null) {
|
||||
consultcount=consultcount>0?consultcount:json.data.consult_list.list.length
|
||||
if(consultcount>0)
|
||||
{
|
||||
if(consultcount>0) {
|
||||
this.consultationRed=true
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.consultationRed=false
|
||||
}
|
||||
this.initList()
|
||||
@@ -132,17 +121,18 @@ export struct HomeIconComp {
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
initList()
|
||||
{
|
||||
initList() {
|
||||
const targetNews:iconsModel | undefined = this.iconList.find((model: iconsModel) => model.name === '肝胆新闻');
|
||||
const targekejian:iconsModel | undefined = this.iconList.find((model: iconsModel) => model.name === '肝胆课件');
|
||||
this.iconListtmp=[...[{ 'img': this.patientIcon, 'name': this.patientName,'isRed':this.patientRed } as iconsModel,
|
||||
{ 'img': this.videoIcon, 'name': this.videoName} as iconsModel,
|
||||
{'img':this.zixunIcon,'name':this.consultation,'isRed':this.consultationRed} as iconsModel]]
|
||||
{'img':this.zixunIcon,'name':this.consultation,'isRed':this.consultationRed} as iconsModel],
|
||||
{'img':targekejian == undefined?$r('app.media.home_kejian_icon'):targekejian?.img,'name':'肝胆课件','isRed':false} as iconsModel,
|
||||
{'img':targetNews == undefined?$r('app.media.home_news_icon'):targetNews?.img,'name':'肝胆新闻','isRed':false} as iconsModel]
|
||||
}
|
||||
|
||||
|
||||
build() {
|
||||
Row() {
|
||||
Grid() {
|
||||
@@ -173,8 +163,15 @@ export struct HomeIconComp {
|
||||
url:'pages/VideoPage/VideoGandanPage',
|
||||
params:{"page":"首页"}
|
||||
})
|
||||
} else if (item.name == '肝胆新闻') {
|
||||
router.pushUrl({
|
||||
url:'pages/News/GandanNewsPages'
|
||||
})
|
||||
} else if (item.name == '肝胆课件') {
|
||||
router.pushUrl({
|
||||
url:'pages/Courseware/CoursewarePage'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}.width('100%').backgroundColor(Color.White)
|
||||
|
||||
@@ -10,6 +10,7 @@ import { BasicConstant,hdHttp, HdResponse ,logger,HdHomeNav, ChangeUtil} from '@
|
||||
import { HomeModel,dataModel, newsModel,iconsModel } from '../model/HomeModel';
|
||||
import { DefaultHintProWindows,SignPopWindow,HdLoadingDialog } from '@itcast/basic'
|
||||
import { promptAction, router } from '@kit.ArkUI';
|
||||
import { HomeGanDanFileComp } from '../components/HomeGanDanFileComp'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@@ -158,6 +159,9 @@ export struct HomePage {
|
||||
if (this.homeData.video_list && this.homeData.video_list.length > 0) {
|
||||
HomeReplayVideoComp({ videoList: this.homeData.video_list })
|
||||
}
|
||||
if (this.homeData.gandanfile_list && this.homeData.gandanfile_list.length > 0) {
|
||||
HomeGanDanFileComp({ gandanFileList:this.homeData.gandanfile_list,guideList:this.homeData.guide_ist })
|
||||
}
|
||||
}
|
||||
}
|
||||
.edgeEffect(EdgeEffect.Spring)
|
||||
|
||||
@@ -75,6 +75,18 @@ export struct VideoGandan {
|
||||
})
|
||||
})
|
||||
|
||||
Image($r('app.media.send_follow_icon'))
|
||||
.width(48)
|
||||
.height(48)
|
||||
.position({ x: '100%', y: '100%' })
|
||||
.translate({ x: -48, y: -176 })
|
||||
.visibility(ChangeUtil.stringIsUndefinedAndNull(this.rightBottom)?Visibility.None:Visibility.Visible)
|
||||
.onClick(()=>{
|
||||
router.pushUrl({
|
||||
url: 'pages/Pay/SendFollowPage'
|
||||
})
|
||||
})
|
||||
|
||||
Image(BasicConstant.urlImage+this.rightBottom)
|
||||
.width(76)
|
||||
.height(40)
|
||||
|
||||
@@ -12,7 +12,7 @@ import { http } from '@kit.NetworkKit';
|
||||
@Entry
|
||||
@Component
|
||||
export struct VideoPage {
|
||||
|
||||
@State params:Record<string, string> = router.getParams() as Record<string, string>
|
||||
@State notselectImg: ResourceStr = $r('app.media.triangle_normal');
|
||||
@State selectImg: ResourceStr = $r('app.media.triangle_green_theme');
|
||||
@State monthWords:Array<string> =[]
|
||||
@@ -42,7 +42,7 @@ export struct VideoPage {
|
||||
{
|
||||
Column()
|
||||
{
|
||||
HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: false,showRightText:true,rightText:'扫一扫',rightTextColor:$r('app.color.main_color'),rightItemAction:()=>{
|
||||
HdNav({ title: '肝胆会议',showLeftIcon:this.params?true:false, showRightIcon: false,showRightText:true,rightText:'扫一扫',rightTextColor:$r('app.color.main_color'),rightItemAction:()=>{
|
||||
if (ScanUtil.canIUseScan()) {
|
||||
ScanUtil.startScanForResult().then((scanResult) => {
|
||||
decryptString(scanResult.originalValue)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
Reference in New Issue
Block a user