Merge remote-tracking branch 'origin/master'

# Conflicts:
#	.hvigor/outputs/build-logs/build.log
This commit is contained in:
xiaoxiao 2025-05-09 16:24:12 +08:00
commit 7de570c9d8
10 changed files with 1841 additions and 13488 deletions

File diff suppressed because it is too large Load Diff

View File

@ -25,3 +25,5 @@ export { DataWebModel } from './src/main/ets/models/DataWebModel'
export { PromptActionClass } from './src/main/ets/components/PromptActionClass'
export { RequestDefaultModel } from './src/main/ets/models/RequestDefaultModel'
export { HdList, HdListController } from './src/main/ets/components/HdList'

View File

@ -0,0 +1,119 @@
import { BasicConstant } from '../constants/BasicConstant'
export class HdListController {
loaded: () => void = () => {
}
finished: () => void = () => {
}
refreshed: () => void = () => {
}
reload: () => void = () => {
}
}
@Component
export struct HdList {
@State
refreshing: boolean = false
@State
finished: boolean = false
@State
loading: boolean = false
// options
lw: number = 0
@Builder
defaultListContent() {
}
@BuilderParam
listContent: () => void = this.defaultListContent
// function
onLoad: () => void = () => {
}
onRefresh: () => void = () => {
}
// controller
controller: HdListController = new HdListController()
scroller: Scroller = new Scroller()
aboutToAppear() {
if (this.controller) {
this.controller.loaded = () => this.loading = false
this.controller.finished = () => this.finished = true
this.controller.refreshed = () => this.refreshing = false
this.controller.reload = () => {
this.finished = false
this.refreshing = true
}
}
}
@Builder
loadMoreBuilder() {
ListItem() {
if (this.finished) {
Row() {
Text($r('app.string.hd_list_finished'))
.fontColor(Color.Gray)
.fontSize($r('app.float.hd_list_load_font'))
}
.height($r('app.float.hd_list_load_height'))
.width('100%')
.justifyContent(FlexAlign.Center)
} else if (this.loading && !this.finished) {
Row() {
LoadingProgress()
.width($r('app.float.hd_list_load_icon'))
Text($r('app.string.hd_list_loading'))
.fontColor(Color.Gray)
.fontSize($r('app.float.hd_list_load_font'))
}
.height($r('app.float.hd_list_load_height'))
.width('100%')
.justifyContent(FlexAlign.Center)
}
}
.height($r('app.float.hd_list_load_height'))
}
build() {
Refresh({ refreshing: $$this.refreshing }) {
List({ scroller: this.scroller }) {
this.listContent()
this.loadMoreBuilder()
}
.width('100%')
.height('100%')
.padding({ left: BasicConstant.SPACE_LG, right: BasicConstant.SPACE_LG })
.divider({
strokeWidth: $r('app.float.common_border_width'),
color: $r('app.color.common_gray_border')
})
.onReachEnd(() => {
if (this.loading || this.refreshing || this.finished) {
return;
}
this.loading = true
this.onLoad()
})
.scrollBar(BarState.Off)
.nestedScroll({
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.edgeEffect(EdgeEffect.None)
}
.width('100%')
.height('100%')
.layoutWeight(this.lw)
.onRefreshing(() => {
if (this.loading) {
return;
}
this.finished = false
this.onRefresh()
// tip: must next tick
})
}
}

View File

@ -0,0 +1,13 @@
import { MeetingItemModel,ItemModel } from '../model/ItemModel'
@Component
export struct ItemComp {
item: MeetingItemModel = new MeetingItemModel({} as ItemModel)
build() {
Column({ space: 12 }) {
}
}
}

View File

@ -0,0 +1,105 @@
import { ItemComp } from './ItemComp'
import { MeetingItemModel } from '../model/ItemModel'
import { HdList, HdListController,BasicConstant } from '@itcast/basic/Index'
import promptAction from '@ohos.promptAction'
import HashMap from '@ohos.util.HashMap';
import { hdHttp } from '@itcast/basic'
@Component
export struct ListComp {
@State
list: MeetingItemModel[] = []
controller = new HdListController()
@State
page: number = 1
@State
keyword: string = ''
@Prop
@Watch('onUpdate')
sort: number = 30
timer: number = -1
hashMap: HashMap<string, string> = new HashMap();
onUpdate() {
if (this.timer) clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.controller.reload()
this.onRefresh()
}, 500)
}
onRefresh() {
this.page = 1
this.hashMap.clear();
// this.hashMap.set('mobile',this.mobile)
//
// this.hashMap.set('current_spec','hongmeng')
// hdHttp.httpReq<string>(this.loginUrl,this.hashMap).then(async (res: HdResponse<string>) => {
// this.loading = false
// logger.info('Response login'+res);
// console.info(`Response login succeeded: ${res}`);
// let json:LoginInfo = JSON.parse(res+'') as LoginInfo;
//
// if(json.code=='1')
// {
// this.getSaveUserInfor(1,json)
// }
// else
// {
// promptAction.showToast({ message: json.message, duration: 1000 })
// }
//
// }).catch((err: BusinessError) => {
// this.loading = false
// console.info(`Response login fail: ${err}`);
// })
// InterviewService.findInterviewList({
// questionBankType: 9,
// page: this.page,
// sort: this.sort,
// keyword: this.keyword
// }).then(res => {
// this.list = res.data.rows
// this.controller.refreshed()
// if (this.page >= res.data.pageTotal) {
// this.controller.finished()
// } else {
// this.page++
// }
// promptAction.showToast({ message: '已更新' })
// })
}
build() {
HdList({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
// InterviewService.findInterviewList({
// questionBankType: 9,
// page: this.page,
// sort: this.sort,
// keyword: this.keyword
// }).then(res => {
// this.list.push(...res.data.rows)
// this.controller.loaded()
// if (this.page >= res.data.pageTotal) {
// this.controller.finished()
// } else {
// this.page++
// }
// })
}
}) {
ForEach(this.list, (item: MeetingItemModel) => {
ListItem() {
ItemComp({ item })
}
})
}
}
}

View File

@ -1,9 +1,27 @@
import { HdNav } from '@itcast/basic'
class RdbData{
key:string = ''
value:string = ''
constructor(key:string,value:string) {
this.key = key
this.value = value
}
}
@Entry
@Component
export struct VideoPage {
@State message: string = 'Hello World333';
@State notselectImg: ResourceStr = $r('app.media.triangle_normal');
@State selectImg: ResourceStr = $r('app.media.triangle_green_theme');
@State monthWords:Array<string> =[]
@State timePosition:number=-1;
@State tlistStatus:boolean=false;
@State timeText:string='会议时间';
@State rdbDataArray:RdbData[] = []
onPageShow(): void {
console.log('VideoPage onPageShow!');
}
@ -11,19 +29,123 @@ export struct VideoPage {
onPageHide(): void {
console.log('VideoPage onPageHide!');
}
aboutToAppear(): void {
this.getNowMonth()
}
build() {
Row() {
Column() {
Text(this.message)
.fontSize($r('app.float.page_text_font_size'))
.fontWeight(FontWeight.Bold)
.onClick(() => {
this.message = 'Welcome';
})
Column()
{
HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'扫一扫' })
Row() {
Blank()
Row() {
if(this.timePosition!=-1)
{
Text(this.timeText).customStyle().fontColor($r('app.color.top_title'))
Image(this.selectImg).width(13).margin({left:5})
}
else {
Text(this.timeText).customStyle()
Image(this.notselectImg).width(13).margin({left:5})
}
}
.onClick(()=>{
this.tlistStatus=!this.tlistStatus
})
Blank()
Text('|').customStyle()
Blank()
Row() {
Text('会议地点').customStyle()
Image(this.notselectImg).width(13).margin({left:5})
}
Blank()
Text('|').customStyle()
Blank()
Row() {
Text('会议直播').customStyle()
}
Blank()
}.width('100%').height(45)
Text().Line()
if(this.tlistStatus)
{
List() {
ForEach(this.monthWords, (item: string,index:number) => {
ListItem() {
Column() {
if(this.timePosition==index)
{
Row()
{
Text(item).customStyle().height(40).fontColor($r('app.color.top_title'))
Blank()
Image($r('app.media.chose_card')).width(22).margin({right:25})
}
.width('100%')
.alignSelf(ItemAlign.Start)
Text().Line().backgroundColor($r('app.color.top_title'))
}
else
{
Text(item).customStyle().height(40).alignSelf(ItemAlign.Start)
Text().Line()
}
}.padding({left:22})
.width('100%')
.justifyContent(FlexAlign.Start)
.onClick(()=>{
this.timePosition=index
this.tlistStatus=false
this.timeText=item
})
}
}, (item: string) => JSON.stringify(item))
}
}
.width('100%')
}
.width('100%')
.height('100%')
}
getNowMonth()
{
this.monthWords.push("所有");
let month:number= new Date().getMonth()+1;
for(let i =month;i<13;i++){
this.monthWords.push(i+"月");
}
for(let i =1;i<month;i++){
this.monthWords.push(i+"月");
}
}
}
@Extend(Text)
function customStyle() {
.fontColor($r('app.color.tab_text_nor'))
.fontSize(13)
}
@Extend(Text)
function Line() {
.height(0.5).width('100%').backgroundColor($r('app.color.devider_line'))
}

View File

@ -0,0 +1,32 @@
{
"color": [
{
"name": "common_gray_01",
"value": "#222222"
},
{
"name": "common_gray_02",
"value": "#ffbebbb4"
},
{
"name": "common_gray_03",
"value": "#666666"
},
{
"name": "tab_text_nor",
"value": "#848284"
},
{
"name": "devider_line",
"value": "#CCCCCC"
},
{
"name": "top_title",
"value": "#8D2316"
},
{
"name": "top_bg",
"value": "#FFEFEFEF"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB