1.2.0部分代码
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { CoursewareComp } from 'study';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct CoursewarePage {
|
||||
build() {
|
||||
Column() {
|
||||
CoursewareComp()
|
||||
}
|
||||
.height('100%')
|
||||
.width('100%')
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { TabBarCompModel } from '../../models/TabBarCompModel'
|
||||
import { TabBarItems } from '../../contants/TabBarItems'
|
||||
import { BasicConstant,AESEncryptionDecryption,authStore,preferenceStore } from '@itcast/basic'
|
||||
import mediaquery from '@ohos.mediaquery';
|
||||
import { KeepStudyComp, SchoolhouseComp } from 'study'
|
||||
|
||||
@Component
|
||||
export struct TabBarComp {
|
||||
@@ -48,41 +49,50 @@ export struct TabBarComp {
|
||||
index: this.activeIndex
|
||||
}) {
|
||||
|
||||
TabContent() {
|
||||
if (this.activeIndex === 0) HomePage()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder( {
|
||||
defaultIcon: $r('app.media.home_default_icon'),
|
||||
activeIcon: $r('app.media.home_selected_icon'),
|
||||
label: '首页'
|
||||
}, 0))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 1) VideoPage()
|
||||
if (this.activeIndex === 0) HomePage()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder( {
|
||||
defaultIcon: $r('app.media.home_default_icon'),
|
||||
activeIcon: $r('app.media.home_selected_icon'),
|
||||
label: '首页'
|
||||
}, 0))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 1) SchoolhouseComp()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder({
|
||||
defaultIcon: $r('app.media.new_home_huaunjiao_icon'),
|
||||
activeIcon: $r('app.media.new_home_huaunjiao_SelectedIcon'),
|
||||
label: '患教学堂'
|
||||
}, 1))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 2) VideoPage()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder({
|
||||
defaultIcon: $r('app.media.home_my_meeting_nor'),
|
||||
activeIcon: $r('app.media.home_my_meeting_sel'),
|
||||
label: '会议·直播'
|
||||
}, 1))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 2) VideoGandan()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder({
|
||||
defaultIcon: $r('app.media.video_tabbar_icon'),
|
||||
activeIcon: $r('app.media.video_tabbar_selected_icon'),
|
||||
label: '视频'
|
||||
}, 2))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 3) MyHomePage()
|
||||
if (this.activeIndex === 3) KeepStudyComp()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder({
|
||||
defaultIcon: $r('app.media.new_nextStudy_default'),
|
||||
activeIcon: $r('app.media.new_nextStudy_selected'),
|
||||
label: '继续教育'
|
||||
}, 3))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
TabContent() {
|
||||
if (this.activeIndex === 4) MyHomePage()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder({
|
||||
defaultIcon: $r('app.media.my_tabbar_icon'),
|
||||
activeIcon: $r('app.media.my_tabbar_selected_icon'),
|
||||
label: '我的'
|
||||
}, 3))
|
||||
}, 4))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { EducationVideo } from 'home'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct EducationVideoPage {
|
||||
build() {
|
||||
Column() {
|
||||
EducationVideo()
|
||||
}
|
||||
.height('100%')
|
||||
.width('100%')
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import webview from '@ohos.web.webview';
|
||||
import { BasicConstant, HdNav, preferenceStore } from '@itcast/basic';
|
||||
import router from '@ohos.router';
|
||||
import { image } from '@kit.ImageKit';
|
||||
import { photoAccessHelper } from '@kit.MediaLibraryKit';
|
||||
import { promptAction } from '@kit.ArkUI';
|
||||
import { fileIo, fileUri } from '@kit.CoreFileKit';
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { PatientTBean } from '@itcast/basic/src/main/ets/models/TeachModel';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct EducationDetailsWebPage {
|
||||
private controller: webview.WebviewController = new webview.WebviewController();
|
||||
@State params:RouteParams = router.getParams() as RouteParams;
|
||||
|
||||
// 修改为移动端User-Agent,解决链接中有视频的问题
|
||||
private customUserAgent: string = 'Mozilla/5.0 (Linux; Android 10; HarmonyOS) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 gdxz-expert';
|
||||
|
||||
@State contentWidth: number = 0;
|
||||
@State contentHeight: number = 0;
|
||||
@State url: string = BasicConstant.urlHtml+this.params.model.path;
|
||||
@State title: string = '患教详情';
|
||||
|
||||
onBackPress(): boolean | void {
|
||||
if (this.controller.accessStep(-1)) {
|
||||
this.controller.backward();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
HdNav({ title: this.title, showRightIcon: false, hasBorder: true ,isLeftAction:true,leftItemAction:()=>{
|
||||
if (this.controller.accessBackward()) {
|
||||
this.controller.backward();
|
||||
} else {
|
||||
router.back();
|
||||
}
|
||||
}})
|
||||
Web({
|
||||
src: this.url,
|
||||
controller: this.controller
|
||||
})
|
||||
.id('webView')
|
||||
.mixedMode(MixedMode.All)
|
||||
.overScrollMode(OverScrollMode.ALWAYS)
|
||||
.domStorageAccess(true)
|
||||
.onControllerAttached(() => {
|
||||
let userAgent = this.controller.getUserAgent() + this.customUserAgent;
|
||||
this.controller.setCustomUserAgent(userAgent);
|
||||
})
|
||||
.onPageEnd(() => {
|
||||
// 注入JS获取body高度
|
||||
this.controller.runJavaScript(
|
||||
'document.documentElement.scrollWidth', (error, result) => {
|
||||
if (!error) this.contentWidth = Number(result);
|
||||
}
|
||||
);
|
||||
this.controller.runJavaScript('document.body.scrollHeight',(error,result)=>{
|
||||
if (!error) this.contentHeight = Number(result);
|
||||
})
|
||||
|
||||
})
|
||||
.width('100%')
|
||||
.layoutWeight(1)
|
||||
.height('calc(100% - 80vp)')
|
||||
|
||||
Row(){
|
||||
Row(){
|
||||
Image('')
|
||||
.size({width:20,height:20})
|
||||
}
|
||||
.margin({left:15,top:12})
|
||||
}
|
||||
.alignItems(VerticalAlign.Top)
|
||||
.backgroundColor(Color.White)
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
}
|
||||
}
|
||||
|
||||
interface RouteParams {
|
||||
model:PatientTBean
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -46,6 +46,9 @@
|
||||
"pages/VideoPage/PLVMediaPlayerOnlyVideoPage",
|
||||
"pages/Netease/OutpatientPage",
|
||||
"pages/PatientsPage/GroupSendMessagePage",
|
||||
"pages/VideoPage/CustomScanResultPage"
|
||||
"pages/VideoPage/CustomScanResultPage",
|
||||
"pages/VideoPage/EducationVideoPage",
|
||||
"pages/Courseware/CoursewarePage",
|
||||
"pages/WebView/EducationDetailsWebPage"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user