Compare commits

..

3 Commits

Author SHA1 Message Date
XiuYun CHEN
5a59fa16bf 更新空白 2025-06-04 11:26:56 +08:00
XiuYun CHEN
ca68e42541 Merge branch 'master' of https://gitea.igandanyiyuan.com/gdxz/harmony 2025-06-04 11:26:24 +08:00
XiuYun CHEN
3f84f2b918 更新空白 2025-06-04 11:26:13 +08:00
15 changed files with 60 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,6 @@ export struct EmptyViewComp {
@Prop isVisibility:boolean = false;
build() {
Stack({ alignContent: Alignment.Center }) {
Column() {
Image(this.imageSrc)
.width(100)
@ -15,12 +14,11 @@ export struct EmptyViewComp {
.fontSize(16)
.fontColor(Color.Gray)
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
}
.alignItems(HorizontalAlign.Center)
.width('100%')
.height('100%')
// .backgroundColor(Color.Pink)
.visibility(this.isVisibility?Visibility.Visible:Visibility.Hidden)
}
}

View File

@ -70,10 +70,31 @@ export class ChangeUtil {
const buffer = new ArrayBuffer(stat.size);
fileIo.readSync(file.fd, buffer);
fileIo.closeSync(file);
const buffernew=await ChangeUtil.compression(buffer,"image/jpeg",0.5)
// 编码为 Base64
const base64Helper = new util.Base64Helper();
return base64Helper.encodeToStringSync(new Uint8Array(buffer));
return base64Helper.encodeToStringSync(new Uint8Array(buffernew));
}
/**
* 压缩图片
* @param buffer 二进制
* @param contentType image/jpeg 保存后的文件格式
* @param compressionRatio 1 就是 100% 0.5 就是50%
* @returns
*/
static async compression(buffer: ArrayBuffer, contentType: string, compressionRatio: number = 0.5) {
// 这里判断 1是因为压缩的时候传了 100%,也会丢失一点精度,所以直接返回了。
if (compressionRatio == 1) {
return buffer
}
const imageSource: image.ImageSource = image.createImageSource(buffer);
const imagePackerApi = image.createImagePacker();
const bf = await imagePackerApi.packing(imageSource, { format: contentType, quality: compressionRatio * 100 })
return bf
}
/**
* 将图片转换为base64字符串

View File

@ -92,6 +92,7 @@ export struct ListComp {
} else {
this.isEmptyViewVisible = true;
}
}).catch((err: BusinessError) => {
this.dialog.close();
if (this.list.length > 0) {

View File

@ -130,8 +130,7 @@ export struct ListCompBack {
build() {
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无回放',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('100%')
} else {
HdList({
lw: 1,

View File

@ -109,6 +109,7 @@ export struct ListCompPast {
} else {
this.isEmptyViewVisible = true;
}
}).catch((err: BusinessError) => {
this.dialog.close()
if (this.list.length > 0) {

View File

@ -91,9 +91,13 @@ export struct ListCompVideo {
build() {
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('100%')
EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible}).height('calc(100% - 100vp)')
} else {
HdGrid({
lw: 1,

View File

@ -112,7 +112,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})
ListCompGandan({ sort:this.sort,type_uuid:this.type_uuid,keywords:this.keywords}).padding({left:10,right:10})
if(this.isOpenSelect1)
{
Column()
@ -159,7 +159,7 @@ export struct SecondaryLink {
.columnsGap(10)
.rowsGap(10)
.backgroundColor(Color.White)
.height('calc(100% - 175vp)')
.height('100%')
.width('100%')
.layoutWeight(1)
Row()
@ -208,7 +208,7 @@ export struct SecondaryLink {
.backgroundColor(Color.White)
}
.height('calc(100% - 175vp)')
.height('calc(100% - 0vp)')
}
if(this.isOpenSelect)
@ -238,7 +238,7 @@ export struct SecondaryLink {
}
.backgroundColor('#efefef')
.width('27%')
.height('calc(100% - 175vp)')
.height('100%')
// 二级列表
List() {
if(this.currentTagIndex==0)
@ -263,7 +263,7 @@ export struct SecondaryLink {
Text(item.name)
.fontSize(15)
.padding(10)
.fontColor(this.currentTagIndex2 === index ? $r('app.color.top_title'): $r('app.color.848284'))
.fontColor(this.currentTagIndex2 === index&& this.videoTitle==item.name ? $r('app.color.top_title'): $r('app.color.848284'))
}
}.onClick(()=>{
this.currentTagIndex2=index
@ -281,7 +281,7 @@ export struct SecondaryLink {
startMargin:10,
endMargin:10
})
.height('calc(100% - 175vp)')
.height('100%')
}.width('100%').alignItems(VerticalAlign.Top)
}

View File

@ -74,8 +74,8 @@ export struct PlayBack {
}.width('100%').height(45)
Text().Line()
Stack({ }) {
ListCompBack({year:this.timeText,type:this.type}).padding({bottom:20}).backgroundColor($r('app.color.e4e4e4'))
Stack({ alignContent:Alignment.Top}) {
ListCompBack({year:this.timeText,type:this.type}).padding({bottom:20}).backgroundColor($r('app.color.e4e4e4')).height('calc(100% - 1vp)')
if(this.tlistStatus)
{
List() {

View File

@ -15,9 +15,13 @@ export struct VideoGandan {
params:{'pageName':'视频'}
})
}})
SwiperComp()
SecondaryLink()
SwiperComp().height(150)
SecondaryLink().layoutWeight(1)
}.width('100%')
.height('100%').backgroundColor($r('app.color.top_bg'))
.height('100%')
.backgroundColor($r('app.color.top_bg'))
}
}

View File

@ -15,7 +15,7 @@ export struct VideoMore {
Text('').height(1).width('100%')
.backgroundColor($r('app.color.1a000000'))
.margin({bottom:10})
ListCompVideo({type_uuid:this.params.uuid}).padding({bottom:20,left:10,right:10}).backgroundColor($r('app.color.top_bg'))
ListCompVideo({type_uuid:this.params.uuid}).padding({left:10,right:10}).backgroundColor($r('app.color.top_bg')).layoutWeight(1)
}.width('100%')
.height('100%').backgroundColor($r('app.color.top_bg'))
}

View File

@ -183,7 +183,7 @@ export struct VideoPage {
.height('100%')
}
}
}.layoutWeight(1)
}
.width('100%')
@ -195,7 +195,7 @@ export struct VideoPage {
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom:{ anchor: "__container__", align:VerticalAlign.Bottom}
})
.margin({bottom:40})
.margin({bottom:60})
.onClick(() => {
router.pushUrl({url:'pages/VideoPage/PastVideoPage'})
// router.pushUrl({url:'pages/VideoPage/VideoGandanPage'})

View File

@ -140,6 +140,7 @@ export struct EditUserDataComp {
this.photoPath = uri;
console.info('Selected image URI:', uri);
const base64String = await ChangeUtil.convertUriToBase64(uri);
const updateDataUrl:string = BasicConstant.urlExpert + 'modify';
// 定义content请根据实际情况选择
const postContent = new rcp.MultipartForm({

View File

@ -152,10 +152,10 @@ struct VideoSearchPage {
this.onRefresh();
}})
if (this.isSearchData){
EmptyViewComp({promptText:'暂无搜索数据',isVisibility:this.isSearchData})
.width('100%')
.height('100%')
} else {
EmptyViewComp({promptText:'暂无搜索数据',isVisibility:this.isSearchData}).height('calc(100% - 140vp)')
}
else {
if (this.params.pageName === '视频') {
Column() {
Row(){

View File

@ -39,8 +39,8 @@ export struct TabBarComp {
}) {
ForEach(TabBarItems, (item: TabBarCompModel, index: number) => {
TabContent() {
if (index === 0) VideoPage().padding({bottom:70})
else if (index === 1) VideoGandan().padding({bottom:70})
if (index === 0) VideoPage()
else if (index === 1) VideoGandan()
else if (index === 2) MyHomePage()
// else MyHomePage()
}