Compare commits

..

No commits in common. "5a59fa16bf6166e0cccad45386564e3f70c835f8" and "195e42f50ee46e331cff0f50077a25c6cb6872c1" have entirely different histories.

15 changed files with 31 additions and 60 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

@ -70,31 +70,10 @@ export class ChangeUtil {
const buffer = new ArrayBuffer(stat.size); const buffer = new ArrayBuffer(stat.size);
fileIo.readSync(file.fd, buffer); fileIo.readSync(file.fd, buffer);
fileIo.closeSync(file); fileIo.closeSync(file);
const buffernew=await ChangeUtil.compression(buffer,"image/jpeg",0.5)
// 编码为 Base64 // 编码为 Base64
const base64Helper = new util.Base64Helper(); const base64Helper = new util.Base64Helper();
return base64Helper.encodeToStringSync(new Uint8Array(buffernew)); return base64Helper.encodeToStringSync(new Uint8Array(buffer));
}
/**
* 压缩图片
* @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字符串 * 将图片转换为base64字符串

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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