Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
liyubing
2024-06-25 10:58:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e577061331a471c50df3fca013b24916bf827013
e5770613
1 parent
cf278702
feat:1)修改lottieView
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
48 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/LiveBigImage02Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/lottie/LottieView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/template/TemplatePageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
e577061
...
...
@@ -186,8 +186,8 @@ export struct CardParser {
contentDTO: contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
pageName: this.pageName,
index:this.compIndex
})
} else {
// todo:组件未实现 / Component Not Implemented
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/LiveBigImage02Component.ets
View file @
e577061
...
...
@@ -19,7 +19,7 @@ export struct LiveBigImage02Component {
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
index: number = 0
async aboutToAppear() {
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId,curRouter)
...
...
@@ -102,8 +102,7 @@ export struct LiveBigImage02Component {
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
title: item.newsTitle
loop: true
})
.margin({
right: '2vp'
...
...
sight_harmony/features/wdComponent/src/main/ets/components/lottie/LottieView.ets
View file @
e577061
...
...
@@ -14,28 +14,16 @@ export struct LottieView {
private politeChickyController: CanvasRenderingContext2D =
new CanvasRenderingContext2D(); // CanvasRenderingContext2D对象
private animateItem: AnimationItem | null = null; // 初始化loadAnimation接口的返回对象
@Prop title: string
// 页面隐藏销毁动画
// onPageHide(): void {
// this.animateItem?.destroy()
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// }
/**
* 加载动画
* @param autoplay 控制动画是否自动播放参数
*/
loadAnimation() {
// 销毁动画,减少缓存
if (this.animateItem !== null) {
this.animateItem.destroy(this.name);
this.animateItem = null;
}
this.onDestroyAnimation()
this.animateItem = lottie.loadAnimation({
container: this.politeChickyController,
renderer: 'canvas',
...
...
@@ -55,31 +43,18 @@ export struct LottieView {
}
aboutToAppear(): void {
// console.error('XXXXZZZZ', '-------aboutToAppear-------' + this.title)
//lottie?.play()
// if(this.init){
// if(this.animateItem = null){
// this.loadAnimation();
// }
// }
/**
* 摧毁动画
*/
onDestroyAnimation(){
// 销毁动画,减少缓存
if (this.animateItem !== null) {
this.animateItem.destroy(this.name);
this.animateItem = null;
}
}
aboutToDisappear(): void {
// console.error('XXXXZZZZ', '-------aboutToDisappear-------' + this.title)
// if(this.init){
// lottie?.destroy(this.name)
//
// if (this.onComplete) {
// this.animateItem?.removeEventListener('complete', this.onComplete)
// }
// this.animateItem = null;
// // }
}
build() {
Stack({ alignContent: Alignment.TopStart }) {
...
...
@@ -92,10 +67,10 @@ export struct LottieView {
this.onReady(this.animateItem)
}
})
.onDisAppear(() => {
lottie.destroy(this.name)
this.animateItem = null;
}).onAppear(()=>{
.onDisAppear(()=>{
this.onDestroyAnimation()
})
.onAppear(()=>{
this.loadAnimation();
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/template/TemplatePageComponent.ets
View file @
e577061
...
...
@@ -41,6 +41,7 @@ export default struct TemplatePageComponent {
extra: string = ''
async aboutToAppear() {
Logger.debug(TAG, 'aboutToAppear')
this.requestPageData()
...
...
@@ -78,9 +79,6 @@ export default struct TemplatePageComponent {
})
}
aboutToDisappear(): void {
}
build() {
if (this.templatePage.pageCompType === TemplatePageStateType.LOADING) {
...
...
Please
register
or
login
to post a comment