1.2.0部分代码
This commit is contained in:
@@ -30,4 +30,6 @@ export { VideoSelected } from './src/main/ets/pages/VideoSelected'
|
||||
|
||||
export { videoTools } from './src/main/ets/polyv/VideoUtil'
|
||||
|
||||
export { CustomScanResultComp }from './src/main/ets/components/CustomScanResultComp'
|
||||
export { CustomScanResultComp }from './src/main/ets/components/CustomScanResultComp'
|
||||
|
||||
export { EducationVideo } from './src/main/ets/pages/EducationVideo'
|
||||
@@ -6,6 +6,7 @@ import { router } from '@kit.ArkUI'
|
||||
export struct HomeSwiperComp {
|
||||
@Prop newslist: newsModel[];
|
||||
@Prop expertData:expertDetailModel;
|
||||
@State isSuccessImage:boolean = false
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
@@ -13,17 +14,21 @@ export struct HomeSwiperComp {
|
||||
ForEach(this.newslist, (item: newsModel,index:number) => {
|
||||
Stack({alignContent:Alignment.Center}) {
|
||||
Image(item.headImg)
|
||||
.alt($r('app.media.home_top_scroll_default'))
|
||||
.objectFit(ImageFit.Fill)// 图片填充模式
|
||||
.onComplete(() => {
|
||||
this.isSuccessImage = true
|
||||
})
|
||||
.width('100%').height('100%')
|
||||
if (index == 0) {
|
||||
Column({space:5}){
|
||||
Text(this.expertData.realName+'专家工作室')
|
||||
.fontSize(19)
|
||||
.fontColor(Color.White)
|
||||
.fontColor(this.isSuccessImage?Color.White:Color.Black)
|
||||
.margin({left:20,top:60})
|
||||
Text(this.expertData.hospitalName)
|
||||
.fontSize(16)
|
||||
.fontColor(Color.White)
|
||||
.fontColor(this.isSuccessImage?Color.White:Color.Black)
|
||||
.margin({left:20})
|
||||
}.width('100%').alignItems(HorizontalAlign.Start)
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export struct ListCompGandan {
|
||||
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
||||
@Prop@Watch('onUpdate') sort:string='2'
|
||||
|
||||
@Prop pageType:string = ''
|
||||
// @Consume@Watch('gotoTop')
|
||||
// toTop:boolean;
|
||||
@Prop@Watch('onUpdate')
|
||||
@@ -67,7 +68,7 @@ export struct ListCompGandan {
|
||||
this.hashMap.set('page', this.page+"")
|
||||
this.hashMap.set("sort", this.sort);
|
||||
this.hashMap.set('typeUuid', this.type_uuid)
|
||||
hdHttp.httpReq<string>(BasicConstant.videoByKeyWordsNew,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
hdHttp.httpReq<string>(this.pageType=='患教视频'?BasicConstant.patientVideoByKeyWordsNew:BasicConstant.videoByKeyWordsNew,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response videoByTypeNew'+res);
|
||||
let json:VideoMoreModel = JSON.parse(res+'') as VideoMoreModel;
|
||||
this.dialog.close()
|
||||
|
||||
@@ -19,10 +19,13 @@ import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { VideoTypeModel,TypeList,VideoType } from '../model/VideoTypeModel'
|
||||
import { ArrayList } from '@kit.ArkTS';
|
||||
import { ListCompGandan } from '../components/ListCompGandan'
|
||||
import { TagListModel,TagList } from '../model/TagListModel'
|
||||
import { TagListModel,TagList } from '@itcast/basic/src/main/ets/models/TagListModel'
|
||||
import { promptAction } from '@kit.ArkUI'
|
||||
import { it } from '@ohos/hypium';
|
||||
|
||||
@Component
|
||||
export struct SecondaryLink {
|
||||
@Prop pageType:string = ''
|
||||
@State currentTagIndex: number = 0; // 一级列表焦点索引值
|
||||
@State currentTagIndex2: number = -1; // 2级列表焦点索引值
|
||||
@State private tagLists:VideoType[] = []; // 一级列表数据
|
||||
@@ -112,7 +115,7 @@ export struct SecondaryLink {
|
||||
Row().height(10).width('100%') .backgroundColor('#efefef')
|
||||
Stack({alignContent:Alignment.Top})
|
||||
{
|
||||
ListCompGandan({ sort:this.sort,type_uuid:this.type_uuid,keywords:this.keywords}).padding({left:10,right:10})
|
||||
ListCompGandan({ pageType:this.pageType,sort:this.sort,type_uuid:this.type_uuid,keywords:this.keywords}).padding({left:10,right:10})
|
||||
if(this.isOpenSelect1)
|
||||
{
|
||||
Column()
|
||||
@@ -126,6 +129,8 @@ export struct SecondaryLink {
|
||||
.padding({left:5,right:5})
|
||||
.fontWeight(FontWeight.Regular)
|
||||
.fontSize(13)
|
||||
.maxLines(1)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontColor(this.tagPosition.indexOf(item)!=-1 ? $r('app.color.top_title'): $r('app.color.848284'))
|
||||
.textAlign(TextAlign.Center)
|
||||
.border({ width: 1, color:this.tagPosition.indexOf(item)!=-1 ? $r('app.color.top_title'): '#999999' })
|
||||
@@ -213,76 +218,110 @@ export struct SecondaryLink {
|
||||
}
|
||||
if(this.isOpenSelect)
|
||||
{
|
||||
Row() {
|
||||
// TODO:知识点: 2.一级列表绑定Scroller对象
|
||||
List() {
|
||||
// 性能知识点:此处为横向列表,列表项确定且数量较少,使用了ForEach,在列表项多的情况下,推荐使用LazyForeEach
|
||||
ForEach(this.tagLists, (item: VideoType, index: number) => {
|
||||
ListItem() {
|
||||
Text(item.name)
|
||||
.width('100%')
|
||||
.padding(10)
|
||||
.fontWeight(FontWeight.Regular)
|
||||
.fontSize(15)
|
||||
.fontColor(this.currentTagIndex === index ? $r('app.color.top_title'): $r('app.color.848284'))
|
||||
.textAlign(TextAlign.Center)
|
||||
.backgroundColor(this.currentTagIndex === index ? $r('sys.color.ohos_id_color_background') : '')
|
||||
|
||||
.onClick(() => {
|
||||
this.currentTagIndex = index;
|
||||
this.contentData=this.arrayList[index];
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor('#efefef')
|
||||
.width('27%')
|
||||
.height('100%')
|
||||
// 二级列表
|
||||
List() {
|
||||
if(this.currentTagIndex==0)
|
||||
{
|
||||
ListItem() {
|
||||
Row() {
|
||||
Text('全部视频')
|
||||
.fontSize(15)
|
||||
.padding(10)
|
||||
.fontColor(this.currentTagIndex2 === -2 ? $r('app.color.top_title'): $r('app.color.848284'))
|
||||
if (this.pageType == '患教视频') {
|
||||
Row() {
|
||||
List() {
|
||||
ForEach(this.tagLists, (item: VideoType, index: number) => {
|
||||
ListItem() {
|
||||
Column() {
|
||||
Text(item.name)
|
||||
.width('100%')
|
||||
.padding(10)
|
||||
.fontWeight(FontWeight.Regular)
|
||||
.fontSize(15)
|
||||
.fontColor(this.currentTagIndex === index ? $r('app.color.top_title') : Color.Gray)
|
||||
.onClick(() => {
|
||||
this.currentTagIndex = index;
|
||||
this.videoTitle = item.name
|
||||
this.type_uuid = item.uuid
|
||||
this.changeSelectRescourse()
|
||||
})
|
||||
Blank()
|
||||
.width('95%')
|
||||
.height(0.5)
|
||||
.backgroundColor(Color.Gray)
|
||||
.margin({left:10,right:10})
|
||||
}
|
||||
}
|
||||
}.onClick(()=>{
|
||||
this.videoTitle='全部视频'
|
||||
this.currentTagIndex2=-2
|
||||
this.changeSelectRescourse()
|
||||
this.type_uuid=''
|
||||
})
|
||||
}
|
||||
ForEach(this.contentData, (item: TypeList,index: number) => {
|
||||
ListItem() {
|
||||
Row() {
|
||||
.backgroundColor(Color.White)
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
}.width('100%').alignItems(VerticalAlign.Top)
|
||||
} else {
|
||||
Row() {
|
||||
// TODO:知识点: 2.一级列表绑定Scroller对象
|
||||
List() {
|
||||
// 性能知识点:此处为横向列表,列表项确定且数量较少,使用了ForEach,在列表项多的情况下,推荐使用LazyForeEach
|
||||
ForEach(this.tagLists, (item: VideoType, index: number) => {
|
||||
ListItem() {
|
||||
Text(item.name)
|
||||
.fontSize(15)
|
||||
.width('100%')
|
||||
.padding(10)
|
||||
.fontColor(this.currentTagIndex2 === index&& this.videoTitle==item.name ? $r('app.color.top_title'): $r('app.color.848284'))
|
||||
.fontWeight(FontWeight.Regular)
|
||||
.fontSize(15)
|
||||
.fontColor(this.currentTagIndex === index ? $r('app.color.top_title') : $r('app.color.848284'))
|
||||
.textAlign(TextAlign.Center)
|
||||
.backgroundColor(this.currentTagIndex === index ? $r('sys.color.ohos_id_color_background') : '')
|
||||
|
||||
.onClick(() => {
|
||||
this.currentTagIndex = index;
|
||||
this.contentData = this.arrayList[index];
|
||||
|
||||
})
|
||||
}
|
||||
}.onClick(()=>{
|
||||
this.currentTagIndex2=index
|
||||
this.videoTitle=item.name
|
||||
this.type_uuid=item.uuid
|
||||
this.changeSelectRescourse()
|
||||
})
|
||||
}
|
||||
.backgroundColor('#efefef')
|
||||
.width('27%')
|
||||
.height('100%')
|
||||
|
||||
// 二级列表
|
||||
List() {
|
||||
if (this.currentTagIndex == 0) {
|
||||
ListItem() {
|
||||
Row() {
|
||||
Text('全部视频')
|
||||
.fontSize(15)
|
||||
.padding(10)
|
||||
.fontColor(this.currentTagIndex2 === -2 ? $r('app.color.top_title') : $r('app.color.848284'))
|
||||
}
|
||||
}.onClick(() => {
|
||||
this.videoTitle = '全部视频'
|
||||
this.currentTagIndex2 = -2
|
||||
this.changeSelectRescourse()
|
||||
this.type_uuid = ''
|
||||
})
|
||||
}
|
||||
ForEach(this.contentData, (item: TypeList, index: number) => {
|
||||
ListItem() {
|
||||
Row() {
|
||||
Text(item.name)
|
||||
.fontSize(15)
|
||||
.padding(10)
|
||||
.fontColor(this.currentTagIndex2 === index && this.videoTitle == item.name ?
|
||||
$r('app.color.top_title') : $r('app.color.848284'))
|
||||
}
|
||||
}.onClick(() => {
|
||||
this.currentTagIndex2 = index
|
||||
this.videoTitle = item.name
|
||||
this.type_uuid = item.uuid
|
||||
this.changeSelectRescourse()
|
||||
})
|
||||
})
|
||||
}
|
||||
.backgroundColor(Color.White)
|
||||
.layoutWeight(1)
|
||||
.divider({
|
||||
strokeWidth: 1,
|
||||
color: $r('app.color.common_gray_border'),
|
||||
startMargin: 10,
|
||||
endMargin: 10
|
||||
})
|
||||
}
|
||||
.backgroundColor(Color.White)
|
||||
.layoutWeight(1)
|
||||
.divider({
|
||||
strokeWidth: 1,
|
||||
color: $r('app.color.common_gray_border'),
|
||||
startMargin:10,
|
||||
endMargin:10
|
||||
})
|
||||
.height('100%')
|
||||
}.width('100%').alignItems(VerticalAlign.Top)
|
||||
.height('100%')
|
||||
}.width('100%').alignItems(VerticalAlign.Top)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,81 +329,117 @@ export struct SecondaryLink {
|
||||
}
|
||||
}
|
||||
|
||||
changeSelectRescourse()
|
||||
{
|
||||
changeSelectRescourse() {
|
||||
this.videoImg=$r('app.media.video_select')
|
||||
this.videoImgt=$r('app.media.select_video')
|
||||
this.videoText=$r('app.color.top_title')
|
||||
this.isOpenSelect=false
|
||||
}
|
||||
|
||||
initList()
|
||||
{
|
||||
initList() {
|
||||
let hashMap: HashMap<string, string> = new HashMap();
|
||||
hdHttp.httpReq<string>(BasicConstant.expertVideoTypeList,hashMap).then(async (res: HdResponse<string>) => {
|
||||
|
||||
hdHttp.httpReq<string>(this.pageType=='患教视频'?BasicConstant.patientVideoNew:BasicConstant.expertVideoTypeList,hashMap).then(async (res: HdResponse<string>) => {
|
||||
let json:VideoTypeModel = JSON.parse(res+'') as VideoTypeModel;
|
||||
this.tagLists=json.data
|
||||
for (let i = 0;i<this.tagLists.length;i++){
|
||||
let datatagname=json.data[i].list;
|
||||
let k:number[]=[];
|
||||
for(let j=0;j<datatagname.length;j++)
|
||||
{
|
||||
let s:string;
|
||||
if ("z-BMS专家端"==(datatagname[j].name)){
|
||||
k.push(j);
|
||||
if (this.pageType=='患教视频') {
|
||||
this.tagLists.push({name:'全部视频',uuid:''} as VideoType)
|
||||
for (let j = 0; j < json.data.length; j++) {
|
||||
let s: string;
|
||||
if ("z-BMS专家端" == (json.data[j].name)) {
|
||||
}
|
||||
let title:string = datatagname[j].name
|
||||
let digit:boolean = ChangeUtil.isFirstDigit(title.charAt(0));//判断首位是否是数字
|
||||
let asciiAlpha :boolean= ChangeUtil.isLetter(title.charAt(0));//字母
|
||||
if(digit||asciiAlpha){
|
||||
let substring:string = '';
|
||||
if (title.length>=4){
|
||||
substring = title.substring(0, 4);//取出来前4位
|
||||
}else if(title.length>=3){
|
||||
substring = title.substring(0, 3);//取出来前3位
|
||||
}else if (title.length>=2){
|
||||
substring = title.substring(0, 2);//取出来前2位
|
||||
let title: string = json.data[j].name
|
||||
let itemUuid:string = json.data[j].uuid
|
||||
let digit: boolean = ChangeUtil.isFirstDigit(title.charAt(0)); //判断首位是否是数字
|
||||
let asciiAlpha: boolean = ChangeUtil.isLetter(title.charAt(0)); //字母
|
||||
if (digit || asciiAlpha) {
|
||||
let substring: string = '';
|
||||
if (title.length >= 4) {
|
||||
substring = title.substring(0, 4); //取出来前4位
|
||||
} else if (title.length >= 3) {
|
||||
substring = title.substring(0, 3); //取出来前3位
|
||||
} else if (title.length >= 2) {
|
||||
substring = title.substring(0, 2); //取出来前2位
|
||||
}
|
||||
if (substring.includes("-")){//含有-
|
||||
let split: string[] = substring.split("-");
|
||||
if (split.length>1){
|
||||
if (substring.includes("---")) { //含有-
|
||||
let split: string[] = substring.split("---");
|
||||
if (split.length > 1) {
|
||||
s = split[split.length - 1] + title.substring(4, title.length);
|
||||
}else {
|
||||
s = title.substring(4, title.length);
|
||||
} else {
|
||||
s = title.substring(4, title.length);
|
||||
}
|
||||
datatagname[j].name=s;
|
||||
this.tagLists.push({name:s,uuid:itemUuid} as VideoType)
|
||||
} else if (substring.includes("--")) {
|
||||
let split: string[] = substring.split("--");
|
||||
if (split.length > 1) {
|
||||
s = split[split.length - 1] + title.substring(4, title.length);
|
||||
} else {
|
||||
s = title.substring(4, title.length);
|
||||
}
|
||||
this.tagLists.push({name:s,uuid:itemUuid} as VideoType)
|
||||
} else if (substring.includes("-")) {
|
||||
let split: string[] = substring.split("-");
|
||||
if (split.length > 1) {
|
||||
s = split[split.length - 1] + title.substring(4, title.length);
|
||||
} else {
|
||||
s = title.substring(4, title.length);
|
||||
}
|
||||
this.tagLists.push({name:s,uuid:itemUuid} as VideoType)
|
||||
} else {
|
||||
this.tagLists.push({name:title,uuid:itemUuid} as VideoType)
|
||||
}
|
||||
} else {
|
||||
this.tagLists.push({name:title,uuid:itemUuid} as VideoType)
|
||||
}
|
||||
}
|
||||
const indexesToRemove = new Set(k); // 使用 Set 提高查找效率
|
||||
const newArr = datatagname.filter((_, index) => !indexesToRemove.has(index));
|
||||
this.arrayList.add(newArr)
|
||||
k=[]
|
||||
} else {
|
||||
this.tagLists = json.data
|
||||
for (let i = 0; i < this.tagLists.length; i++) {
|
||||
let datatagname = json.data[i].list;
|
||||
let k: number[] = [];
|
||||
for (let j = 0; j < datatagname.length; j++) {
|
||||
let s: string;
|
||||
if ("z-BMS专家端" == (datatagname[j].name)) {
|
||||
k.push(j);
|
||||
}
|
||||
let title: string = datatagname[j].name
|
||||
let digit: boolean = ChangeUtil.isFirstDigit(title.charAt(0)); //判断首位是否是数字
|
||||
let asciiAlpha: boolean = ChangeUtil.isLetter(title.charAt(0)); //字母
|
||||
if (digit || asciiAlpha) {
|
||||
let substring: string = '';
|
||||
if (title.length >= 4) {
|
||||
substring = title.substring(0, 4); //取出来前4位
|
||||
} else if (title.length >= 3) {
|
||||
substring = title.substring(0, 3); //取出来前3位
|
||||
} else if (title.length >= 2) {
|
||||
substring = title.substring(0, 2); //取出来前2位
|
||||
}
|
||||
if (substring.includes("-")) {
|
||||
let split: string[] = substring.split("-");
|
||||
if (split.length > 1) {
|
||||
s = split[split.length - 1] + title.substring(4, title.length);
|
||||
} else {
|
||||
s = title.substring(4, title.length);
|
||||
}
|
||||
datatagname[j].name = s;
|
||||
}
|
||||
}
|
||||
}
|
||||
const indexesToRemove = new Set(k); // 使用 Set 提高查找效率
|
||||
const newArr = datatagname.filter((_, index) => !indexesToRemove.has(index));
|
||||
this.arrayList.add(newArr)
|
||||
k = []
|
||||
}
|
||||
}
|
||||
this.contentData=this.arrayList[0];
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
})
|
||||
let hashMap1: HashMap<string, string> = new HashMap();
|
||||
hashMap1.set("type", "2")
|
||||
hdHttp.post<string>(BasicConstant.tagList,{
|
||||
type:'2'
|
||||
type:this.pageType=='患教视频'?'5':'2'
|
||||
} as TagModel).then(async (res: HdResponse<string>) => {
|
||||
let json:TagListModel = JSON.parse(res+'') as TagListModel;
|
||||
this.tags=json.data
|
||||
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
interface TagModel
|
||||
{
|
||||
interface TagModel {
|
||||
type:string
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
export interface TagListModel {
|
||||
code:string;
|
||||
data:TagList[];
|
||||
message:string;
|
||||
}
|
||||
|
||||
export interface TagList{
|
||||
|
||||
DES:string;
|
||||
ID:string;
|
||||
sort:string;
|
||||
create_date:string;
|
||||
TYPE:string;
|
||||
NAME:string;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ export interface VideoTypeModel {
|
||||
}
|
||||
|
||||
export interface VideoType{
|
||||
|
||||
uuid:string;
|
||||
name:string;
|
||||
list:TypeList[];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { SecondaryLink } from '../components/SecondaryLink';
|
||||
import router from '@ohos.router';
|
||||
import { HdNav } from '@itcast/basic'
|
||||
|
||||
@Component
|
||||
export struct EducationVideo {
|
||||
@State isShowNaviLeft:boolean = false
|
||||
@State rightBottom:string = ''
|
||||
@State rightBottomPath:string = ''
|
||||
@State rightBottomTitle:string = ''
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
HdNav({ title: '患教视频', showRightIcon: true, showLeftIcon:true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{
|
||||
router.pushUrl({
|
||||
url:'pages/SearchPage/VideoSearchPage',
|
||||
params:{'pageName':'视频'}
|
||||
})
|
||||
}})
|
||||
SecondaryLink({pageType:'患教视频'}).layoutWeight(1)
|
||||
}.width('100%')
|
||||
.height('100%')
|
||||
.backgroundColor($r('app.color.top_bg'))
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { HomeReplayVideoComp } from '../components/HomeReplayVideoComp'
|
||||
import { getDisplayWindowWidth } from 'media-player-common'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
import { BasicConstant,hdHttp, HdResponse ,logger,HdHomeNav} from '@itcast/basic/Index'
|
||||
import { BasicConstant,hdHttp, HdResponse ,logger,HdHomeNav, ChangeUtil} from '@itcast/basic/Index'
|
||||
import { HomeModel,dataModel, newsModel,iconsModel } from '../model/HomeModel';
|
||||
import { DefaultHintProWindows,SignPopWindow,HdLoadingDialog } from '@itcast/basic'
|
||||
import { promptAction, router } from '@kit.ArkUI';
|
||||
@@ -21,6 +21,9 @@ export struct HomePage {
|
||||
// toTop:boolean;
|
||||
@State hintMessage:string = '';
|
||||
@State signData:Record<string,string> = {};
|
||||
@State rightBottom:string = ''
|
||||
@State rightBottomPath:string = ''
|
||||
@State rightBottomTitle:string = ''
|
||||
|
||||
scroller:Scroller = new Scroller()
|
||||
|
||||
@@ -64,10 +67,12 @@ export struct HomePage {
|
||||
gotoTop() {
|
||||
this.scroller.scrollToIndex(0);
|
||||
this.initData()
|
||||
this.getAppActivity()
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.initData()
|
||||
this.getAppActivity()
|
||||
}
|
||||
|
||||
initData() {
|
||||
@@ -112,6 +117,25 @@ export struct HomePage {
|
||||
})
|
||||
}
|
||||
|
||||
getAppActivity() {
|
||||
const hashMap: HashMap<string, string> = new HashMap()
|
||||
this.dialog.open()
|
||||
hashMap.clear()
|
||||
hashMap.set('id','6')
|
||||
hdHttp.httpReq<string>(BasicConstant.getAppActivity,hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response addBonusPoints'+res)
|
||||
this.dialog.close()
|
||||
let json:Record<string,string | Record<string,string>> = JSON.parse(res+'') as Record<string,string | Record<string,string>>
|
||||
if (json.code == '200') {
|
||||
this.rightBottom = json.data['img']
|
||||
this.rightBottomPath = json.data['url_path']
|
||||
this.rightBottomTitle = json.data['name']
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
this.dialog.close()
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
Stack(){
|
||||
Scroll(this.scroller) {
|
||||
@@ -164,6 +188,19 @@ export struct HomePage {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Image(BasicConstant.urlImage+this.rightBottom)
|
||||
.width(76)
|
||||
.height(40)
|
||||
.position({ x: '100%', y: '100%' })
|
||||
.translate({ x: -76, y: -76 })
|
||||
.visibility(ChangeUtil.stringIsUndefinedAndNull(this.rightBottom)?Visibility.None:Visibility.Visible)
|
||||
.onClick(()=>{
|
||||
router.pushUrl({
|
||||
url: 'pages/WebView/WebPage',
|
||||
params: {'title':this.rightBottomTitle,'url':this.rightBottomPath}
|
||||
})
|
||||
})
|
||||
}
|
||||
.alignContent(Alignment.Top)
|
||||
.backgroundColor('#f4f4f4')
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { HdNav } from '@itcast/basic'
|
||||
import { ListCompBack } from '../components/ListCompBack'
|
||||
import { router } from '@kit.ArkUI';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
export struct PlayBack {
|
||||
|
||||
@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 yearWords:Array<string> =[]
|
||||
@@ -16,22 +17,32 @@ export struct PlayBack {
|
||||
@State timeText:string='会议时间';
|
||||
@State typeText:string='会议类别';
|
||||
@State type:string='';
|
||||
onPageShow(): void {
|
||||
console.log('VideoPage onPageShow!');
|
||||
}
|
||||
@State isShowNaviRight:boolean = false
|
||||
|
||||
onPageHide(): void {
|
||||
console.log('VideoPage onPageHide!');
|
||||
}
|
||||
aboutToAppear(): void {
|
||||
this.getSelect()
|
||||
|
||||
if (this.params) {
|
||||
if (this.params["pageName"] == '肝胆视频') {
|
||||
this.isShowNaviRight = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build() {
|
||||
Column()
|
||||
{
|
||||
HdNav({ title: '肝胆回放', showRightIcon: false, showLeftIcon: true})
|
||||
if (this.isShowNaviRight) {
|
||||
HdNav({ title: '肝胆视频', showRightIcon: true, showLeftIcon:true,showRightText:false,showTwoRightItem:true,twoRightIcon:$r('app.media.video_gandan_navigation2'),rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{
|
||||
router.pushUrl({
|
||||
url:'pages/SearchPage/VideoSearchPage',
|
||||
params:{'pageName':'视频'}
|
||||
})
|
||||
},twoRightItemAction:()=>{
|
||||
router.back()
|
||||
}})
|
||||
} else {
|
||||
HdNav({ title: '肝胆回放', showRightIcon: false, showLeftIcon: true})
|
||||
}
|
||||
Row() {
|
||||
|
||||
Row() {
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { SecondaryLink } from '../components/SecondaryLink';
|
||||
import router from '@ohos.router';
|
||||
import { BasicConstant, HdNav } from '@itcast/basic'
|
||||
import { BasicConstant, ChangeUtil, hdHttp, HdNav, HdResponse } from '@itcast/basic'
|
||||
import { SwiperComp } from '../components/SwiperComp'
|
||||
import { emitter } from '@kit.BasicServicesKit';
|
||||
import { BusinessError, emitter } from '@kit.BasicServicesKit';
|
||||
import { getDisplayWindowWidth } from 'media-player-common'
|
||||
import { HashMap } from '@kit.ArkTS';
|
||||
|
||||
@Component
|
||||
export struct VideoGandan {
|
||||
@State params:Record<string, string> = router.getParams() as Record<string, string>
|
||||
@State isShowNaviLeft:boolean = false
|
||||
@State rightBottom:string = ''
|
||||
@State rightBottomPath:string = ''
|
||||
@State rightBottomTitle:string = ''
|
||||
|
||||
aboutToAppear(): void {
|
||||
if (this.params) {
|
||||
@@ -16,19 +20,73 @@ export struct VideoGandan {
|
||||
this.isShowNaviLeft = true
|
||||
}
|
||||
}
|
||||
this.getAppActivity()
|
||||
}
|
||||
|
||||
|
||||
getAppActivity() {
|
||||
const hashMap: HashMap<string, string> = new HashMap()
|
||||
hashMap.clear()
|
||||
hashMap.set('id','6')
|
||||
hdHttp.httpReq<string>(BasicConstant.getAppActivity,hashMap).then(async (res: HdResponse<string>) => {
|
||||
let json:Record<string,string | Record<string,string>> = JSON.parse(res+'') as Record<string,string | Record<string,string>>
|
||||
if (json.code == '200') {
|
||||
this.rightBottom = json.data['img']
|
||||
this.rightBottomPath = json.data['url_path']
|
||||
this.rightBottomTitle = json.data['name']
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
HdNav({ title: '肝胆视频', showRightIcon: true, showLeftIcon: this.isShowNaviLeft,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{
|
||||
HdNav({ title: '肝胆视频', showRightIcon: true, showLeftIcon: this.isShowNaviLeft,showRightText:false,showTwoRightItem:true,twoRightIcon:$r('app.media.video_gandan_navigation_change'),rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{
|
||||
router.pushUrl({
|
||||
url:'pages/SearchPage/VideoSearchPage',
|
||||
params:{'pageName':'视频'}
|
||||
})
|
||||
},twoRightItemAction:()=>{
|
||||
router.pushUrl({
|
||||
url:'pages/VideoPage/PlayBackPage',
|
||||
params:{'pageName':'肝胆视频'}
|
||||
})
|
||||
}})
|
||||
SwiperComp().height(getDisplayWindowWidth().vp / 16 * 9)
|
||||
SecondaryLink().layoutWeight(1)
|
||||
SecondaryLink({pageType:'肝胆视频'})
|
||||
.margin({bottom:55})
|
||||
.layoutWeight(1)
|
||||
|
||||
Row(){
|
||||
Image($r('app.media.video_gandan_bottom_icon'))
|
||||
.size({width:22,height:22})
|
||||
Text('患教视频')
|
||||
.fontSize(16)
|
||||
.fontColor(Color.White)
|
||||
}
|
||||
.justifyContent(FlexAlign.Center)
|
||||
.width('100%')
|
||||
.height(53)
|
||||
.position({y:'94%'})
|
||||
.backgroundColor('rgb(63,199,193)')
|
||||
.onClick(() => {
|
||||
router.pushUrl({
|
||||
url: 'pages/VideoPage/EducationVideoPage'
|
||||
})
|
||||
})
|
||||
|
||||
Image(BasicConstant.urlImage+this.rightBottom)
|
||||
.width(76)
|
||||
.height(40)
|
||||
.position({ x: '100%', y: '100%' })
|
||||
.translate({ x: -76, y: -126 })
|
||||
.visibility(ChangeUtil.stringIsUndefinedAndNull(this.rightBottom)?Visibility.None:Visibility.Visible)
|
||||
.onClick(()=>{
|
||||
router.pushUrl({
|
||||
url: 'pages/WebView/WebPage',
|
||||
params: {'title':this.rightBottomTitle,'url':this.rightBottomPath}
|
||||
})
|
||||
})
|
||||
}.width('100%')
|
||||
.height('100%')
|
||||
.backgroundColor($r('app.color.top_bg'))
|
||||
|
||||
@@ -99,7 +99,7 @@ export struct VideoPage {
|
||||
.layoutWeight(1)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
.onClick(() => {
|
||||
router.pushUrl({url:'pages/VideoPage/PlayBackPage'})
|
||||
router.pushUrl({url:'pages/VideoPage/PlayBackPage', params:{'pageName':'肝胆会议'}})
|
||||
|
||||
})
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in New Issue
Block a user