Skip to content

Commit

Permalink
封面样式弹窗
Browse files Browse the repository at this point in the history
封面样式弹窗
  • Loading branch information
MaoXiaoone committed May 26, 2024
1 parent 111768b commit 058bce5
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 16 deletions.
16 changes: 8 additions & 8 deletions entry/src/main/ets/componets/bookDetail/BookOverlay.ets
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import CommonConstants from '../../common/constants/CommonConstants'

@Component
export default struct BookOverlay {
@Prop bookWidth:number
@Prop bookHeight:number
// @Prop bookWidth:number
// @Prop bookHeight:number
@Prop bookImage:Resource
@Prop isTop:boolean
@Prop isShow:boolean = false
Expand All @@ -16,7 +16,7 @@ export default struct BookOverlay {
}
.zIndex(3)
.backgroundColor('rgba(0,0,0,0.45)')
.width(this.bookWidth).height(this.bookHeight)
.width(CommonConstants.NOVEL_IMG_WIDTH).height(CommonConstants.NOVEL_IMG_HEIGHT)
}
Flex({
alignItems: ItemAlign.End,
Expand All @@ -27,21 +27,21 @@ export default struct BookOverlay {
}
}
.align(Alignment.Start)
.width(this.bookWidth).height(this.bookHeight)
.width(CommonConstants.NOVEL_IMG_WIDTH).height(CommonConstants.NOVEL_IMG_HEIGHT)
.backgroundImage(this.bookImage)
.backgroundImageSize({width:this.bookWidth,height:this.bookHeight})
.backgroundImageSize({width:CommonConstants.NOVEL_IMG_WIDTH,height:CommonConstants.NOVEL_IMG_HEIGHT})
.zIndex(2)

Row(){
Image($r('app.media.occlusion1'))
}
.zIndex(1)
.width(this.bookWidth + 5).height(this.bookHeight + 5)
.width(CommonConstants.NOVEL_IMG_WIDTH + 5).height(CommonConstants.NOVEL_IMG_HEIGHT - 5)

Row(){
Image($r('app.media.occlusion2'))
}.zIndex(0)
.width(this.bookWidth + 10).height(this.bookHeight + 10)
.width(CommonConstants.NOVEL_IMG_WIDTH + 10).height(CommonConstants.NOVEL_IMG_HEIGHT - 10)
}
.align(Alignment.BottomStart)
}
Expand Down
2 changes: 0 additions & 2 deletions entry/src/main/ets/pages/view/bookShelf/BookFolder.ets
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ export default struct BookFolder {
}){
BookOverlay({
bookImage:group.bookImage,
bookWidth:60,
bookHeight:80,
isTop:group.isTop
})
.gesture(
Expand Down
2 changes: 1 addition & 1 deletion entry/src/main/ets/pages/view/bookShelf/IndexShelf.ets
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default struct IndexShelf {
isClear: this.isClear
})
} else {
if (this.GROUP === '标签' && this.bookType !== '分组') {
if (this.searchValue === '浏览历史') {
if (this.currentIndex === 0) {
novelPage({
searchValue: this.searchValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export default struct BookFolderInfoManage {
}){
BookOverlay({
bookImage:this.folderList.bookImage,
bookWidth:60,
bookHeight:80,
isTop:this.folderList.isTop
})
Column({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export default struct BookShelfInfo{
Column(){
BookOverlay({
bookImage:this.bookShelf.bookList[0].bookImage,
bookWidth:60,
bookHeight:80,
isTop:false,
isShow:this.isShowCheck
})
Expand Down
22 changes: 21 additions & 1 deletion entry/src/main/ets/pages/view/dialog/FolderInfoDialog.ets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { buttonList } from '../../../componets/dataList/buttonList'
import { folderList } from '../../../componets/dataList/folderList'
import { updateBookListData } from '../../../storage/bookListData'
import { delGroupById } from '../../../storage/groupData'
import coverInfoDialog from './coverInfoDialog'

@CustomDialog
/**
Expand Down Expand Up @@ -91,7 +92,9 @@ export default struct FolderInfoDialog{
case 4 :
showMessage('加入书单'); break;
case 5 :
showMessage('封面样式'); break;
showMessage('封面样式');
this.coverDialog?.open();
break;
case 6 :
showMessage('隐藏分组');
this.dialogTitle = this.dialogHideTitle;
Expand Down Expand Up @@ -216,4 +219,21 @@ export default struct FolderInfoDialog{
this.cancel()
}

coverDialog: CustomDialogController | null = new CustomDialogController({
builder: coverInfoDialog({
cancel:()=>{
this.coverCancel()
}
}),
cancel: this.coverCancel,
autoCancel: true,
width:'100%',
alignment: DialogAlignment.Bottom,
customStyle:true
})

coverCancel(){
this.coverDialog?.close()
}

}
100 changes: 100 additions & 0 deletions entry/src/main/ets/pages/view/dialog/coverInfoDialog.ets
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import BookOverlay from '../../../componets/bookDetail/BookOverlay'
import commonInputDialog from '../../../componets/common/commonInputDialog'
import confirmDialogExample from '../../../componets/common/confirmDialog'
import InsideCircleIcon from '../../../componets/common/InsideCircleIcon'
import { showMessage } from '../../../componets/common/promptShow'
import TitleContentDialog from '../../../componets/common/TitleContentDialog'
import { buttonList } from '../../../componets/dataList/buttonList'
import { folderList } from '../../../componets/dataList/folderList'
import { updateBookListData } from '../../../storage/bookListData'
import { delGroupById } from '../../../storage/groupData'

@CustomDialog
/**
* 封面弹窗
*/
@Preview
export default struct coverInfoDialog{
controller?: CustomDialogController
//推送提醒
// @Link itemData:folderList

cancel: () => void = () => {
}
@State coverFolder:boolean = false
build() {
Column(){
Flex({
justifyContent:FlexAlign.SpaceBetween,
alignItems:ItemAlign.Center
}){
Column(){
Text('游戏').fontColor('rgba(0, 0, 0, 0.88)').fontSize(16).fontWeight(500).lineHeight(24)
Text(`共${12}本`).fontColor('rgba(0, 0, 0, 0.45)').fontWeight(400).lineHeight(20).fontSize(12)
}
Row(){
Text('仅用于当前分组')
Toggle({ type: ToggleType.Switch, isOn: this.coverFolder})
.selectedColor("#F60").hoverEffect(HoverEffect.None)
// .onChange(()=>{
// this.itemData.isUpdateReminder = !this.itemData.isUpdateReminder
// })
}
}.padding(20)
Divider().strokeWidth(0.5)
Flex({
direction: FlexDirection.Row,
justifyContent:FlexAlign.SpaceBetween
}){
this.coverImage($r('app.media.cover_list'))
this.coverImage($r('app.media.cover_list'))
this.coverImage($r('app.media.cover_list'))
}.padding(20)
Divider().strokeWidth(0.5).padding({bottom:16})
Column(){
Flex({
justifyContent:FlexAlign.SpaceBetween
}) {
Column(){
Text('取消').fontSize(16).fontWeight(400).fontColor($r('app.color.theme_color'))
.lineHeight(24)
.padding({left:32,right:32,bottom:8,top:8})
}
.onClick(()=>{
this.cancel()
})
.width('49%')
.borderRadius(20)
.alignItems(HorizontalAlign.Center)
.backgroundColor('rgba(255, 102, 0, 0.12)')
Column(){
Text('确定').fontSize(16).fontWeight(400).fontColor(Color.White)
.lineHeight(24)
.padding({left:32,right:32,bottom:8,top:8})
}
.width('49%')
.borderRadius(20)
.alignItems(HorizontalAlign.Center)
.backgroundColor($r('app.color.theme_color'))
}
}
.alignItems(HorizontalAlign.Center)
.padding({right:20,left:20,bottom:16})
}
.borderRadius({topLeft:20,topRight:20})
.backgroundColor(Color.White)
.width('100%')
}

@Builder coverImage(bookImage:Resource){
Column(){
BookOverlay({
bookImage:bookImage,
// isTop:this.folderList.isTop
})
Row().width(86).height(20).backgroundColor(Color.White).borderRadius(2)
.shadow({ radius: 5, color: 'rgba(0, 0, 0, 0.10)' })
// .border({width:1,color:'rgba(255, 255, 255, 0.10)'})
}
}
}

0 comments on commit 058bce5

Please sign in to comment.