肝胆视频
@ -17,7 +17,7 @@
|
||||
],
|
||||
"buildModeSet": [
|
||||
{
|
||||
"name": "debug",
|
||||
"name": "debug"
|
||||
},
|
||||
{
|
||||
"name": "release"
|
||||
@ -43,15 +43,15 @@
|
||||
},
|
||||
{
|
||||
"name": "basic",
|
||||
"srcPath": "./commons/basic",
|
||||
"srcPath": "./commons/basic"
|
||||
},
|
||||
{
|
||||
"name": "Home",
|
||||
"srcPath": "./features/Home",
|
||||
"srcPath": "./features/Home"
|
||||
},
|
||||
{
|
||||
"name": "register",
|
||||
"srcPath": "./features/register",
|
||||
"srcPath": "./features/register"
|
||||
},
|
||||
{
|
||||
"name": "polyv",
|
||||
@ -61,5 +61,6 @@
|
||||
"name": "scene_single_video",
|
||||
"srcPath": "./scene_single_video"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
@ -30,5 +30,9 @@ export class BasicConstant {
|
||||
static readonly videoByTypeNew = BasicConstant.urlExpertApp + 'videoByTypeNew'
|
||||
static readonly videoDetail = BasicConstant.urlExpertAPI + "videoDetail";
|
||||
static readonly meetingHistoryList = BasicConstant.urlExpertAPI + "meetingHistoryList";
|
||||
static readonly videoRoll = BasicConstant.urlExpertAPI + "videoRoll";
|
||||
static readonly expertVideoTypeList = BasicConstant.urlExpertAPI + "expertVideoTypeList";
|
||||
static readonly videoByKeyWordsNew = BasicConstant.urlExpertApp + "videoByKeyWordsNew";
|
||||
static readonly tagList = BasicConstant.urlExpertApp + "tagList";
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import image from '@ohos.multimedia.image';
|
||||
import fs from '@ohos.file.fs';
|
||||
import { fileIo } from '@kit.CoreFileKit';
|
||||
import util from '@ohos.util';
|
||||
import { i18n } from '@kit.LocalizationKit';
|
||||
export class ChangeUtil {
|
||||
/**
|
||||
* 将HashMap转成JsonString
|
||||
@ -132,4 +133,14 @@ export class ChangeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
static isLetter(char: string): boolean {
|
||||
if (char.length !== 1) return false;
|
||||
const code = char.charCodeAt(0);
|
||||
return (code >= 65 && code <= 90) || (code >= 97 && code <= 122);
|
||||
}
|
||||
static isFirstDigit(str: string): boolean {
|
||||
if (str.length === 0) return false;
|
||||
return i18n.Unicode.isDigit(str.charAt(0));
|
||||
}
|
||||
|
||||
}
|
||||
@ -52,6 +52,7 @@ class HdHttp {
|
||||
|
||||
|
||||
return httpInstance.request(fullUrl, options).then((res) => {
|
||||
logger.info('Response param'+JSON.stringify(extraDatas))
|
||||
logger.info('Response fullUrl:' +fullUrl+ res.result);
|
||||
const result = res.result as HdResponse<T>
|
||||
return result
|
||||
|
||||
@ -9,3 +9,7 @@ export { VideoMore } from './src/main/ets/pages/VideoMore'
|
||||
export { VideoDetailModel } from './src/main/ets/model/VideoDetailModel'
|
||||
|
||||
export { PastVideo } from './src/main/ets/pages/PastVideo';
|
||||
|
||||
export { VideoGandan } from './src/main/ets/pages/VideoGandan';
|
||||
|
||||
export { PLVMockMediaResourceData } from './src/main/ets/polyv/PLVMockMediaResourceData'
|
||||
|
||||
@ -33,7 +33,7 @@ export struct ItemCompVideo {
|
||||
|
||||
Row(){
|
||||
Text(this.item.public_name).fontSize(14)
|
||||
.fontColor($r('app.color.999999'))
|
||||
.fontColor($r('app.color.999999')).maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis }).layoutWeight(1)
|
||||
Blank()
|
||||
Image($r('app.media.video_look')).width(18).height(11)
|
||||
Text(this.item.readnum+'').fontSize(14)
|
||||
|
||||
@ -59,9 +59,14 @@ export struct ListComp {
|
||||
{
|
||||
this.controller.loaded()
|
||||
}
|
||||
if(this.page==1&&json.data.list!=null&&json.data.list.length>0)
|
||||
if(this.page==1)
|
||||
{
|
||||
this.list = json.data.list
|
||||
this.list=[]
|
||||
if(json.data!=null&&json.data.list!)
|
||||
{
|
||||
this.list = json.data.list
|
||||
}
|
||||
|
||||
}
|
||||
else if(this.page>1)
|
||||
{
|
||||
|
||||
119
features/Home/src/main/ets/components/ListCompGandan.ets
Normal file
@ -0,0 +1,119 @@
|
||||
import { ItemCompVideo } from './ItemCompVideo'
|
||||
import { VideoMoreModel,VideoMore } from '../model/VideoMoreModel'
|
||||
import { HdGrid, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { HdLoadingDialog,EmptyViewComp } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@Component
|
||||
export struct ListCompGandan {
|
||||
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
||||
@Prop@Watch('onUpdate') sort:string='2'
|
||||
@Prop@Watch('onUpdate')
|
||||
type_uuid:string=''
|
||||
@Prop@Watch('onUpdate') keywords:string=''
|
||||
@State
|
||||
list: VideoMore[] = []
|
||||
controller = new HdListController()
|
||||
@State
|
||||
page: number = 1
|
||||
@State
|
||||
keyword: string = ''
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
onUpdate() {
|
||||
this.onRefresh()
|
||||
}
|
||||
|
||||
|
||||
onRefresh() {
|
||||
this.page = 1
|
||||
this.initData(0)
|
||||
}
|
||||
|
||||
initData(type:number)
|
||||
{
|
||||
this.dialog.open()
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set('keywords',this.keywords)
|
||||
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>) => {
|
||||
logger.info('Response videoByTypeNew'+res);
|
||||
let json:VideoMoreModel = JSON.parse(res+'') as VideoMoreModel;
|
||||
this.dialog.close()
|
||||
if(type==0)
|
||||
{
|
||||
this.controller.refreshed()
|
||||
}
|
||||
else
|
||||
{
|
||||
this.controller.loaded()
|
||||
}
|
||||
if(this.page==1)
|
||||
{
|
||||
this.list=[]
|
||||
if(json.data!=null&&json.data.list!)
|
||||
{
|
||||
this.list = json.data.list
|
||||
}
|
||||
|
||||
}
|
||||
else if(this.page>1)
|
||||
{
|
||||
this.list.push(...json.data.list)
|
||||
}
|
||||
|
||||
if (this.page >= json.data.totalPage) {
|
||||
this.controller.finished()
|
||||
} else {
|
||||
this.page++
|
||||
}
|
||||
if (this.list.length>0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
this.dialog.close()
|
||||
if (this.list.length>0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
if (this.isEmptyViewVisible){
|
||||
EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible})
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
} else {
|
||||
HdGrid({
|
||||
lw: 1,
|
||||
controller: this.controller,
|
||||
onRefresh: () => {
|
||||
this.onRefresh()
|
||||
},
|
||||
onLoad: () => {
|
||||
this.initData(1)
|
||||
}
|
||||
}) {
|
||||
ForEach(this.list, (items: VideoMore) => {
|
||||
GridItem() {
|
||||
ItemCompVideo({ item:items })
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -55,9 +55,14 @@ export struct ListCompVideo {
|
||||
{
|
||||
this.controller.loaded()
|
||||
}
|
||||
if(this.page==1&&json.data.list!=null&&json.data.list.length>0)
|
||||
if(this.page==1)
|
||||
{
|
||||
this.list = json.data.list
|
||||
this.list=[]
|
||||
if(json.data!=null&&json.data.list!)
|
||||
{
|
||||
this.list = json.data.list
|
||||
}
|
||||
|
||||
}
|
||||
else if(this.page>1)
|
||||
{
|
||||
|
||||
369
features/Home/src/main/ets/components/SecondaryLink.ets
Normal file
@ -0,0 +1,369 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
import { hdHttp, HdResponse ,logger,BasicConstant,ChangeUtil} from '@itcast/basic/Index'
|
||||
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 { promptAction } from '@kit.ArkUI'
|
||||
@Component
|
||||
export struct SecondaryLink {
|
||||
@State currentTagIndex: number = 0; // 一级列表焦点索引值
|
||||
@State currentTagIndex2: number = -1; // 2级列表焦点索引值
|
||||
@State private tagLists:VideoType[] = []; // 一级列表数据
|
||||
@State contentData:TypeList[]=[]; // 二级列表数据
|
||||
@State videoImg:ResourceStr=$r('app.media.video_all')
|
||||
@State videoImgt:ResourceStr=$r('app.media.all_video')
|
||||
@State videoText:ResourceStr=$r('app.color.848284')
|
||||
@State videoTitle:string='全部视频'
|
||||
@State videoSort:string='最新'
|
||||
@State videoImgs:ResourceStr=$r('app.media.cb_new')
|
||||
@State videoImgSe:ResourceStr=$r('app.media.cb_screen_no')
|
||||
@State videoSelect:ResourceStr=$r('app.color.848284')
|
||||
@State sort:string='2'
|
||||
@State type_uuid:string=''
|
||||
arrayList: ArrayList<TypeList[]> = new ArrayList();
|
||||
@State isOpenSelect:boolean=false
|
||||
@State isOpenSelect1:boolean=false//筛选
|
||||
@State private tags:TagList[] = [];
|
||||
@State tagPosition: TagList[] = [];
|
||||
@State tagPositiontmp: TagList[] = [];
|
||||
@State keywords:string=''
|
||||
/**
|
||||
* 生命周期函数
|
||||
*/
|
||||
aboutToAppear(): void {
|
||||
// 构造数据
|
||||
this.initList()
|
||||
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Row()
|
||||
{
|
||||
Row() {
|
||||
Image(this.videoImg).width(15).height(15).margin({ left:15 })
|
||||
Text(this.videoTitle).maxLines(1).fontSize(14).fontColor(this.videoText).textAlign(TextAlign.Start)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis }).margin({ left:5 })
|
||||
Image(this.videoImgt).width(15).height(15).margin({ left:5 })
|
||||
|
||||
}.layoutWeight(1).height(36)
|
||||
.onClick(()=>{
|
||||
this.isOpenSelect1=false
|
||||
this.isOpenSelect=!this.isOpenSelect
|
||||
})
|
||||
Text().width(60).height(10)
|
||||
Row()
|
||||
{
|
||||
Text(this.videoSort).fontSize(14).fontColor($r('app.color.top_title')).textAlign(TextAlign.Start)
|
||||
.margin({ left:5 })
|
||||
Image(this.videoImgs).width(15).height(15).margin({ left:5 })
|
||||
}
|
||||
|
||||
.onClick(()=>{
|
||||
if(this.videoSort=='最新')
|
||||
{
|
||||
this.sort='1'
|
||||
this.videoSort='最热'
|
||||
this.videoImgs=$r('app.media.cb_hot')
|
||||
}
|
||||
else
|
||||
{
|
||||
this.sort='2'
|
||||
this.videoSort='最新'
|
||||
this.videoImgs=$r('app.media.cb_new')
|
||||
}
|
||||
})
|
||||
Text('').backgroundColor($r('app.color.848284')).width(0.5).height(10)
|
||||
.margin({ left:5 })
|
||||
Row()
|
||||
{
|
||||
Text('筛选').fontSize(14).fontColor(this.videoSelect).textAlign(TextAlign.Start)
|
||||
.margin({ left:5 })
|
||||
Image(this.videoImgSe).width(15).height(15).margin({ left:5,right:10 })
|
||||
}
|
||||
|
||||
.onClick(()=>{
|
||||
|
||||
this.tagPosition = [...this.tagPositiontmp];
|
||||
this.isOpenSelect=false
|
||||
this.isOpenSelect1=!this.isOpenSelect1
|
||||
|
||||
})
|
||||
}
|
||||
.backgroundColor(Color.White)
|
||||
.width('100%')
|
||||
Row().height(10).width('100%') .backgroundColor('#efefef')
|
||||
Stack({alignContent:Alignment.Top})
|
||||
{
|
||||
ListCompGandan({ sort:this.sort,type_uuid:this.type_uuid,keywords:this.keywords})
|
||||
if(this.isOpenSelect1)
|
||||
{
|
||||
Column()
|
||||
{
|
||||
Grid() {
|
||||
ForEach(this.tags, (item: TagList, index: number) => {
|
||||
GridItem() {
|
||||
Text(item.NAME)
|
||||
.height(25)
|
||||
.width('100%')
|
||||
.padding({left:5,right:5})
|
||||
.fontWeight(FontWeight.Regular)
|
||||
.fontSize(13)
|
||||
.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' })
|
||||
.borderRadius(30)
|
||||
|
||||
.onClick(() => {
|
||||
|
||||
|
||||
if(this.tagPosition.indexOf(item)!=-1)
|
||||
{
|
||||
const newSelected = [...this.tagPosition];
|
||||
newSelected.splice(this.tagPosition.indexOf(item), 1);
|
||||
this.tagPosition = newSelected;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.tagPosition.length >= 3) {
|
||||
promptAction.showToast({ message: '最多选择三个标签!', duration: 1000 });
|
||||
return;
|
||||
}
|
||||
this.tagPosition.push(item)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.padding(10)
|
||||
.columnsTemplate('1fr 1fr 1fr 1fr')
|
||||
.columnsGap(10)
|
||||
.rowsGap(10)
|
||||
.backgroundColor(Color.White)
|
||||
.height('calc(100% - 175vp)')
|
||||
.width('100%')
|
||||
.layoutWeight(1)
|
||||
Row()
|
||||
{
|
||||
Text('重置').height(40)
|
||||
.textAlign(TextAlign.Center)
|
||||
.fontColor($r('app.color.top_title') )
|
||||
.border({ width: 1, color: $r('app.color.top_title') })
|
||||
.borderRadius(5)
|
||||
.layoutWeight(1)
|
||||
.margin({left:15})
|
||||
.onClick(()=>{
|
||||
this.tagPosition= [];
|
||||
})
|
||||
Text('确定')
|
||||
.height(40)
|
||||
.fontColor(Color.White).textAlign(TextAlign.Center)
|
||||
.border({ width: 1, color: $r('app.color.top_title') })
|
||||
.borderRadius(5)
|
||||
.layoutWeight(1)
|
||||
.backgroundColor($r('app.color.top_title'))
|
||||
.margin({left:10,right:15})
|
||||
.onClick(()=>{
|
||||
this.tagPositiontmp = [...this.tagPosition];
|
||||
if(this.tagPosition.length>0)
|
||||
{
|
||||
this.videoImgSe=$r('app.media.cb_screen_yes')
|
||||
this.videoSelect=$r('app.color.top_title')
|
||||
this.tagPosition.forEach(element => {
|
||||
this.keywords+=element.NAME+ ","
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.keywords=''
|
||||
this.videoSelect=$r('app.color.848284')
|
||||
this.videoImgSe=$r('app.media.cb_screen_no')
|
||||
}
|
||||
|
||||
this.isOpenSelect1=false
|
||||
})
|
||||
}.width('100%')
|
||||
.height(60)
|
||||
.backgroundColor(Color.White)
|
||||
|
||||
}
|
||||
.height('calc(100% - 175vp)')
|
||||
|
||||
}
|
||||
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('calc(100% - 175vp)')
|
||||
// 二级列表
|
||||
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 ? $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
|
||||
})
|
||||
.height('calc(100% - 175vp)')
|
||||
}.width('100%').alignItems(VerticalAlign.Top)
|
||||
}
|
||||
|
||||
}
|
||||
.layoutWeight(1)
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
let hashMap: HashMap<string, string> = new HashMap();
|
||||
hdHttp.httpReq<string>(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);
|
||||
}
|
||||
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'
|
||||
} as TagModel).then(async (res: HdResponse<string>) => {
|
||||
let json:TagListModel = JSON.parse(res+'') as TagListModel;
|
||||
this.tags=json.data
|
||||
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
interface TagModel
|
||||
{
|
||||
type:string
|
||||
}
|
||||
91
features/Home/src/main/ets/components/SwiperComp.ets
Normal file
@ -0,0 +1,91 @@
|
||||
import { VideoRollModel,VideoRoll } from '../model/VideoRollModel'
|
||||
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { HdLoadingDialog } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@Component
|
||||
export struct SwiperComp {
|
||||
@State
|
||||
list: VideoRoll[] = []
|
||||
|
||||
|
||||
|
||||
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.initData()
|
||||
}
|
||||
|
||||
initData()
|
||||
{
|
||||
this.dialog.open()
|
||||
this.hashMap.clear();
|
||||
hdHttp.httpReq<string>(BasicConstant.videoRoll,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response meetingListV2'+res);
|
||||
let json:VideoRollModel = JSON.parse(res+'') as VideoRollModel;
|
||||
this.dialog.close();
|
||||
this.list = json.data
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
this.dialog.close();
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() { // 使用堆叠布局实现按钮覆盖
|
||||
Swiper() {
|
||||
ForEach(this.list, (item: VideoRoll) => {
|
||||
Stack({alignContent:Alignment.Bottom}) {
|
||||
Image(BasicConstant.urlHtml + item.imgpath)
|
||||
.objectFit(ImageFit.Fill)// 图片填充模式
|
||||
.width('100%')
|
||||
.height(150)
|
||||
Text(item.name)
|
||||
.maxLines(1)
|
||||
.height(30)
|
||||
.fontColor('#F6F6F6')
|
||||
.textAlign(TextAlign.Start)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.backgroundColor('#88000000')
|
||||
.width('100%')
|
||||
.padding({right:100,left:5})
|
||||
.margin({ bottom: 0 })
|
||||
}.onClick(()=>{
|
||||
|
||||
})
|
||||
}, (item: VideoRoll) => JSON.stringify(item))
|
||||
|
||||
}
|
||||
.indicator(
|
||||
Indicator.dot()
|
||||
.right(0)
|
||||
.itemWidth(4)
|
||||
.itemHeight(4)
|
||||
.selectedItemWidth(4)
|
||||
.selectedItemHeight(4)
|
||||
.color($r('app.color.common_gray_02'))
|
||||
.selectedColor('#3cc9c0')
|
||||
)
|
||||
.loop(true)
|
||||
.autoPlay(true)
|
||||
.interval(3000)
|
||||
.onChange((index: number) => {
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
.width('100%')
|
||||
|
||||
}
|
||||
}
|
||||
15
features/Home/src/main/ets/model/TagListModel.ets
Normal file
@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
14
features/Home/src/main/ets/model/VideoRollModel.ets
Normal file
@ -0,0 +1,14 @@
|
||||
export interface VideoRollModel {
|
||||
code:string;
|
||||
data:VideoRoll[];
|
||||
message:string;
|
||||
}
|
||||
|
||||
export interface VideoRoll{
|
||||
|
||||
imgpath:string;
|
||||
uuid:string;
|
||||
name:string;
|
||||
path:string;
|
||||
tags:string;
|
||||
}
|
||||
16
features/Home/src/main/ets/model/VideoTypeModel.ets
Normal file
@ -0,0 +1,16 @@
|
||||
export interface VideoTypeModel {
|
||||
code:string;
|
||||
data:VideoType[];
|
||||
message:string;
|
||||
}
|
||||
|
||||
export interface VideoType{
|
||||
|
||||
name:string;
|
||||
list:TypeList[];
|
||||
}
|
||||
export interface TypeList{
|
||||
uuid:string;
|
||||
name:string;
|
||||
create_date:string;
|
||||
}
|
||||
20
features/Home/src/main/ets/pages/VideoGandan.ets
Normal file
@ -0,0 +1,20 @@
|
||||
import { SecondaryLink } from '../components/SecondaryLink';
|
||||
import router from '@ohos.router';
|
||||
import { HdNav } from '@itcast/basic'
|
||||
import { SwiperComp } from '../components/SwiperComp'
|
||||
|
||||
|
||||
@Component
|
||||
export struct VideoGandan {
|
||||
build() {
|
||||
|
||||
Column() {
|
||||
HdNav({ title: '肝胆视频', showRightIcon: false, showLeftIcon: false })
|
||||
SwiperComp()
|
||||
SecondaryLink()
|
||||
|
||||
|
||||
}.width('100%')
|
||||
.height('100%').backgroundColor($r('app.color.top_bg'))
|
||||
}
|
||||
}
|
||||
@ -31,7 +31,7 @@ export struct VideoPage {
|
||||
{
|
||||
Column()
|
||||
{
|
||||
HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'扫一扫' })
|
||||
HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: false,showRightText:false,rightText:'扫一扫' })
|
||||
Row() {
|
||||
Blank()
|
||||
.onClick(()=>{
|
||||
@ -82,7 +82,7 @@ export struct VideoPage {
|
||||
}.width('100%').height(45)
|
||||
Text().Line()
|
||||
Stack({ }) {
|
||||
ListComp().padding({bottom:20}).backgroundColor($r('app.color.e4e4e4'))
|
||||
ListComp().backgroundColor($r('app.color.e4e4e4'))
|
||||
if(this.tlistStatus)
|
||||
{
|
||||
List() {
|
||||
@ -129,16 +129,17 @@ export struct VideoPage {
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.padding({bottom:50})
|
||||
|
||||
|
||||
Image($r('app.media.past_metting')).width(76).height(40)
|
||||
.alignRules({
|
||||
right: { anchor: "__container__", align: HorizontalAlign.End },
|
||||
bottom:{ anchor: "__container__", align:VerticalAlign.Bottom}
|
||||
})
|
||||
.margin({bottom:120})
|
||||
.margin({bottom:40})
|
||||
.onClick(() => {
|
||||
router.pushUrl({url:'pages/VideoPage/PastVideoPage'})
|
||||
// router.pushUrl({url:'pages/VideoPage/VideoGandanPage'})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -67,6 +67,10 @@
|
||||
{
|
||||
"name": "22000000",
|
||||
"value": "#22000000"
|
||||
},
|
||||
{
|
||||
"name": "848284",
|
||||
"value": "#848284"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
features/Home/src/main/resources/base/media/all_video.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
features/Home/src/main/resources/base/media/cb_hot.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
features/Home/src/main/resources/base/media/cb_new.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
features/Home/src/main/resources/base/media/cb_screen_no.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
features/Home/src/main/resources/base/media/cb_screen_yes.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
features/Home/src/main/resources/base/media/select_video.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
features/Home/src/main/resources/base/media/video_all.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
features/Home/src/main/resources/base/media/video_select.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
@ -2,6 +2,11 @@
|
||||
import { TabBarCompModel } from '../models/TabBarCompModel'
|
||||
|
||||
export const TabBarItems: TabBarCompModel[] = [
|
||||
{
|
||||
defaultIcon: $r('app.media.home_my_meeting_nor'),
|
||||
activeIcon: $r('app.media.home_my_meeting_sel'),
|
||||
label: '会议·直播'
|
||||
},
|
||||
{
|
||||
defaultIcon: $r('app.media.video_tabbar_icon'),
|
||||
activeIcon: $r('app.media.video_tabbar_selected_icon'),
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { VideoPage } from 'home'
|
||||
import { VideoPage,VideoGandan } from 'home'
|
||||
import { MyHomePage } from 'mypage'
|
||||
import { TabBarCompModel } from '../../models/TabBarCompModel'
|
||||
import { TabBarItems } from '../../contants/TabBarItems'
|
||||
@ -39,10 +39,10 @@ export struct TabBarComp {
|
||||
}) {
|
||||
ForEach(TabBarItems, (item: TabBarCompModel, index: number) => {
|
||||
TabContent() {
|
||||
if (index === 0) VideoPage()
|
||||
// else if (index === 1) ProjectComp()
|
||||
// else if (index === 2) InterviewComp()
|
||||
else MyHomePage()
|
||||
if (index === 0) VideoPage().padding({bottom:70})
|
||||
else if (index === 1) VideoGandan().padding({bottom:70})
|
||||
else if (index === 2) MyHomePage()
|
||||
// else MyHomePage()
|
||||
}
|
||||
.tabBar(this.TabBarBuilder(item, index))
|
||||
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
import { VideoGandan } from 'home'
|
||||
@Entry
|
||||
@Component
|
||||
struct VideoGandanPage {
|
||||
|
||||
|
||||
build() {
|
||||
RelativeContainer() {
|
||||
VideoGandan()
|
||||
}
|
||||
.height('100%')
|
||||
.width('100%')
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@ -23,6 +23,7 @@
|
||||
"pages/VideoPage/VideoMorePage",
|
||||
"pages/VideoPage/PLVMediaPlayerSingleVideoPage",
|
||||
"pages/WebView/LivebroadcastPages",
|
||||
"pages/VideoPage/PastVideoPage"
|
||||
"pages/VideoPage/PastVideoPage",
|
||||
"pages/VideoPage/VideoGandanPage"
|
||||
]
|
||||
}
|
||||