Skip to content

Commit cf2c8a0

Browse files
committed
2 parents c5a2a31 + 3201ca4 commit cf2c8a0

File tree

14 files changed

+601
-235
lines changed

14 files changed

+601
-235
lines changed

entry/src/main/ets/componets/common/confirmDialog.ets

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,21 @@ export default struct confirmDialogExample {
99
confirm: () => void = () => {
1010
}
1111
@Prop title:string = '删除'
12+
@Link delCache:boolean
13+
@Prop isShowCache:boolean = false
1214

1315
build() {
1416
Column() {
1517
Text(`确定${this.title}吗?` ).fontWeight(600).maxLines(1).minFontSize(12).maxFontSize(20).margin({ top: 20, bottom: 10 })
18+
if (this.isShowCache){
19+
Row({
20+
space:8
21+
}){
22+
Checkbox().selectedColor($r('app.color.theme_color')).select(this.delCache)
23+
Text('同时删除本地缓存')
24+
.fontColor('rgba(0, 0, 0, 0.45)').fontSize(14).fontWeight(400).lineHeight(22)
25+
}
26+
}
1627
Row({space:24}) {
1728
Text('取消')
1829
.onClick(() => {
@@ -37,6 +48,6 @@ export default struct confirmDialogExample {
3748
.fontColor(Color.White)
3849
.backgroundColor($r('app.color.theme_color'))
3950
}.padding({top:20,bottom:20})
40-
}.width(200)
51+
}
4152
}
4253
}
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
import BookType from '../head/BookType'
2+
import groupTypePanel from './groupTypePanel'
3+
4+
@Component
5+
export default struct groupTypeComponent {
6+
@State globalPositionY: Length = 0
7+
@Link bookType: string
8+
@Link currentIndex: number
9+
@Link groupCoverShow:boolean
10+
11+
build() {
12+
if (this.groupCoverShow){
13+
Stack(){
14+
Rect()
15+
// .fillOpacity(0)
16+
.height('85%')
17+
.width('100%')
18+
.fill('rgba(0, 0, 0, 0.45)')
19+
groupTypePanel({
20+
groupCoverShow:this.groupCoverShow
21+
}).zIndex(9999)
22+
}.alignContent(Alignment.Top)
23+
} else {
24+
Flex(
25+
{
26+
alignItems: ItemAlign.Center,
27+
justifyContent: FlexAlign.SpaceBetween
28+
}
29+
) {
30+
Scroll() {
31+
Row({ space: 10 }) {
32+
BookType({ title: '全部', bookType: this.bookType }).onClick(() => {
33+
this.bookType = '全部'
34+
})
35+
BookType({ title: '未分组', bookType: this.bookType }).onClick(() => {
36+
this.bookType = '未分组'
37+
})
38+
BookType({ title: '本地', bookType: this.bookType }).onClick(() => {
39+
this.bookType = '本地'
40+
})
41+
BookType({ title: '书单', bookType: this.bookType }).onClick(() => {
42+
this.bookType = '书单'
43+
})
44+
if (this.currentIndex === 0) {
45+
BookType({ title: '玄幻', bookType: this.bookType }).onClick(() => {
46+
this.bookType = '玄幻'
47+
})
48+
BookType({ title: '修仙', bookType: this.bookType }).onClick(() => {
49+
this.bookType = '修仙'
50+
})
51+
BookType({ title: '女同', bookType: this.bookType }).onClick(() => {
52+
this.bookType = '女同'
53+
})
54+
BookType({ title: '军事', bookType: this.bookType }).onClick(() => {
55+
this.bookType = '军事'
56+
})
57+
} else if (this.currentIndex === 1) {
58+
BookType({ title: '国漫', bookType: this.bookType }).onClick(() => {
59+
this.bookType = '国漫'
60+
})
61+
BookType({ title: '日漫', bookType: this.bookType }).onClick(() => {
62+
this.bookType = '日漫'
63+
})
64+
} else if (this.currentIndex === 2) {
65+
BookType({ title: '广播', bookType: this.bookType }).onClick(() => {
66+
this.bookType = '广播'
67+
})
68+
BookType({ title: '深夜电台', bookType: this.bookType }).onClick(() => {
69+
this.bookType = '深夜电台'
70+
})
71+
}
72+
}
73+
}
74+
.scrollBar(BarState.Off)
75+
.scrollable(ScrollDirection.Horizontal)
76+
Row(){
77+
Image($r('app.media.more_search')).width(25).height(25)
78+
}.width(
79+
'10%'
80+
).onClick(()=>{
81+
this.groupCoverShow = true
82+
})
83+
// .bindPopup(this.groupCoverShow, {
84+
// builder: this.groupTypePanel,
85+
// placement: Placement.Bottom,
86+
// // mask:true,
87+
// radius:10,
88+
// offset: {y:-35},
89+
// // mask:{color:'rgba(0,0,0,0.45)'},
90+
// enableArrow: false,
91+
// // autoCancel:false,
92+
// width:'100%',
93+
// popupColor:Color.Transparent,
94+
// onStateChange: (e) => {
95+
// if (!e.isVisible) {
96+
// this.groupCoverShow = false;
97+
// }
98+
// }
99+
// })
100+
}.margin({ left: 15,bottom:10})
101+
}
102+
103+
}
104+
105+
@Builder
106+
groupTypePanel() {
107+
Column({
108+
space:15
109+
}){
110+
Flex({
111+
justifyContent:FlexAlign.SpaceBetween,
112+
alignItems:ItemAlign.End
113+
}){
114+
Row({space:12}){
115+
Text('显示分组').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.88)')
116+
Text('点击进入').fontSize(12).fontWeight(400).lineHeight(20).fontColor('rgba(0, 0, 0, 0.45)')
117+
}.alignItems(VerticalAlign.Bottom)
118+
Row({space:12}){
119+
Text('管理').fontSize(12).fontWeight(400).lineHeight(20).fontColor($r('app.color.theme_color'))
120+
Image($r('app.media.close')).width(24).height(20).onClick(()=>{
121+
this.groupCoverShow = false
122+
})
123+
}
124+
}
125+
Flex({
126+
direction: FlexDirection.Row, wrap: FlexWrap.Wrap,
127+
justifyContent:FlexAlign.Start
128+
}){
129+
Row(){
130+
this.GroupType()
131+
}.width('25%')
132+
Row(){
133+
this.GroupType1('全部')
134+
//后续添加右上角图
135+
}.width('25%')
136+
Row(){
137+
this.GroupType1('未分组')
138+
}.width('25%')
139+
Row(){
140+
this.GroupType1('本地')
141+
}.width('25%')
142+
Row(){
143+
this.GroupType1('书单')
144+
}.width('25%')
145+
}
146+
147+
Flex({
148+
justifyContent:FlexAlign.SpaceBetween,
149+
alignItems:ItemAlign.End
150+
}){
151+
Row({space:12}){
152+
Text('隐藏分组').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.88)')
153+
Text('点击进入,长按编辑').fontSize(12).fontWeight(400).lineHeight(20).fontColor('rgba(0, 0, 0, 0.45)')
154+
}.alignItems(VerticalAlign.Bottom)
155+
Row({space:8}){
156+
Image($r('app.media.help')).width(20).height(20)
157+
Text('标签锁').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.45)')
158+
Toggle({ type: ToggleType.Switch, isOn: false})
159+
.selectedColor("#F60").hoverEffect(HoverEffect.None)
160+
}.alignItems(VerticalAlign.Bottom).justifyContent(FlexAlign.End)
161+
}
162+
Scroll(){
163+
if (false){
164+
Flex({
165+
direction: FlexDirection.Row
166+
}){
167+
Row(){
168+
this.GroupType1('游戏')
169+
}.width('25%')
170+
Row(){
171+
this.GroupType1('未分组')
172+
}.width('25%')
173+
Row(){
174+
this.GroupType1('本地')
175+
}.width('25%')
176+
Row(){
177+
this.GroupType1('书单')
178+
}.width('25%')
179+
Row(){
180+
this.GroupType1('书单')
181+
}.width('25%')
182+
}
183+
} else {
184+
Flex({
185+
justifyContent:FlexAlign.Center
186+
}){
187+
Text('暂无隐藏分组').fontSize(12).fontWeight(400).fontColor('rgba(0, 0, 0, 0.45)')
188+
}
189+
.borderRadius(4)
190+
.width('100%')
191+
.backgroundColor('rgba(0, 0, 0, 0.04)')
192+
.padding({top:6,bottom:6})
193+
194+
}
195+
} .scrollBar(BarState.Off)
196+
.scrollable(ScrollDirection.Horizontal)
197+
198+
}
199+
.padding({left:20,right:20,top:12})
200+
.width('100%').height('30%').backgroundColor(Color.White)
201+
}
202+
203+
@Builder GroupType(){
204+
Row(){
205+
Text('分组').fontWeight(500).fontSize(12).textOverflow({
206+
overflow:TextOverflow.Ellipsis
207+
}).ellipsisMode(EllipsisMode.END)
208+
.maxLines(1).fontColor($r('app.color.theme_color'))
209+
.textAlign(TextAlign.Center)
210+
}
211+
.margin({ right: 16, bottom: 16 })
212+
.justifyContent(FlexAlign.Center)
213+
.alignItems(VerticalAlign.Center)
214+
.width(68)
215+
.backgroundColor('rgba(0, 0, 0, 0.04)').padding({left:16,right:16,top:6,bottom:6})
216+
}
217+
@Builder GroupType1(title:string){
218+
Row(){
219+
Text(title).fontWeight(500).fontSize(12).textOverflow({
220+
overflow:TextOverflow.Ellipsis
221+
}).ellipsisMode(EllipsisMode.END)
222+
.maxLines(1).fontColor(Color.Black)
223+
.textAlign(TextAlign.Center)
224+
}
225+
226+
.justifyContent(FlexAlign.Center)
227+
.alignItems(VerticalAlign.Center)
228+
.width(68)
229+
.backgroundColor('rgba(0, 0, 0, 0.04)').padding({left:16,right:16,top:6,bottom:6})
230+
}
231+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
@Component
2+
export default struct groupTypePanel{
3+
@Link groupCoverShow:boolean
4+
build() {
5+
Column({
6+
space:15
7+
}){
8+
Flex({
9+
justifyContent:FlexAlign.SpaceBetween,
10+
alignItems:ItemAlign.End
11+
}){
12+
Row({space:12}){
13+
Text('显示分组').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.88)')
14+
Text('点击进入').fontSize(12).fontWeight(400).lineHeight(20).fontColor('rgba(0, 0, 0, 0.45)')
15+
}.alignItems(VerticalAlign.Bottom)
16+
Row({space:12}){
17+
Text('管理').fontSize(12).fontWeight(400).lineHeight(20).fontColor($r('app.color.theme_color'))
18+
Image($r('app.media.close')).width(24).height(20).onClick(()=>{
19+
this.groupCoverShow = false
20+
})
21+
}
22+
}
23+
Flex({
24+
direction: FlexDirection.Row, wrap: FlexWrap.Wrap,
25+
justifyContent:FlexAlign.Start
26+
}){
27+
Row(){
28+
this.GroupType()
29+
}.width('25%')
30+
Row(){
31+
this.GroupType1('全部')
32+
//后续添加右上角图
33+
}.width('25%')
34+
Row(){
35+
this.GroupType1('未分组')
36+
}.width('25%')
37+
Row(){
38+
this.GroupType1('本地')
39+
}.width('25%')
40+
Row(){
41+
this.GroupType1('书单')
42+
}.width('25%')
43+
}
44+
45+
Flex({
46+
justifyContent:FlexAlign.SpaceBetween,
47+
alignItems:ItemAlign.End
48+
}){
49+
Row({space:12}){
50+
Text('隐藏分组').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.88)')
51+
Text('点击进入,长按编辑').fontSize(12).fontWeight(400).lineHeight(20).fontColor('rgba(0, 0, 0, 0.45)')
52+
}.alignItems(VerticalAlign.Bottom)
53+
Row({space:8}){
54+
Image($r('app.media.help')).width(20).height(20)
55+
Text('标签锁').fontSize(16).fontWeight(500).lineHeight(24).fontColor('rgba(0, 0, 0, 0.45)')
56+
Toggle({ type: ToggleType.Switch, isOn: false})
57+
.selectedColor("#F60").hoverEffect(HoverEffect.None)
58+
}.alignItems(VerticalAlign.Bottom).justifyContent(FlexAlign.End)
59+
}
60+
Scroll(){
61+
if (true){
62+
Flex({
63+
direction: FlexDirection.Row
64+
}){
65+
Row(){
66+
this.GroupType1('游戏')
67+
}.width('25%')
68+
Row(){
69+
this.GroupType1('未分组')
70+
}.width('25%')
71+
Row(){
72+
this.GroupType1('本地')
73+
}.width('25%')
74+
Row(){
75+
this.GroupType1('书单')
76+
}.width('25%')
77+
Row(){
78+
this.GroupType1('书单')
79+
}.width('25%')
80+
}
81+
} else {
82+
Flex({
83+
justifyContent:FlexAlign.Center
84+
}){
85+
Text('暂无隐藏分组').fontSize(12).fontWeight(400).fontColor('rgba(0, 0, 0, 0.45)')
86+
}
87+
.borderRadius(4)
88+
.width('100%')
89+
.backgroundColor('rgba(0, 0, 0, 0.04)')
90+
.padding({top:6,bottom:6})
91+
92+
}
93+
}.scrollBar(BarState.Off)
94+
.scrollable(ScrollDirection.Horizontal)
95+
96+
}
97+
.borderRadius({bottomLeft:20,bottomRight:20})
98+
.padding({left:20,right:20,top:12,bottom:20})
99+
.width('100%').backgroundColor(Color.White)
100+
}
101+
@Builder GroupType(){
102+
Row(){
103+
Text('分组').fontWeight(500).fontSize(12).textOverflow({
104+
overflow:TextOverflow.Ellipsis
105+
}).ellipsisMode(EllipsisMode.END)
106+
.maxLines(1).fontColor($r('app.color.theme_color'))
107+
.textAlign(TextAlign.Center)
108+
}
109+
.margin({ right: 16, bottom: 16 })
110+
.justifyContent(FlexAlign.Center)
111+
.alignItems(VerticalAlign.Center)
112+
.width(68)
113+
.backgroundColor('rgba(0, 0, 0, 0.04)').padding({left:16,right:16,top:6,bottom:6})
114+
}
115+
@Builder GroupType1(title:string){
116+
Row(){
117+
Text(title).fontWeight(500).fontSize(12).textOverflow({
118+
overflow:TextOverflow.Ellipsis
119+
}).ellipsisMode(EllipsisMode.END)
120+
.maxLines(1).fontColor(Color.Black)
121+
.textAlign(TextAlign.Center)
122+
}
123+
124+
.justifyContent(FlexAlign.Center)
125+
.alignItems(VerticalAlign.Center)
126+
.width(68)
127+
.backgroundColor('rgba(0, 0, 0, 0.04)').padding({left:16,right:16,top:6,bottom:6})
128+
}
129+
}

0 commit comments

Comments
 (0)