Skip to content

Commit

Permalink
Merge pull request #284 from mgz0227/cat_dev
Browse files Browse the repository at this point in the history
订阅源-收藏-取消重命名、删除功能
  • Loading branch information
MaoXiaoone authored Dec 3, 2024
2 parents 840639c + 1df5caa commit f9a1f3c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion entry/src/main/ets/componets/import/SubscriptionImport.ets
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export default struct SubscriptionImport {
await SubscriptionDao.batchInsert(insertRssSources)
this.show = false;
this.resetState()
showMessage('添加成功')
showMessage('导入成功')
})
}
.backgroundColor(Color.White)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default struct SubscriptionContent{
this.rightDialogBuilder(this.Item_Right_Dialog_Data, async (index: number) => {
switch (index) {
case 0:
showMessage('编辑')
showMessage('重命名')
break
case 1:
showMessage('置顶')
Expand Down Expand Up @@ -314,6 +314,13 @@ export default struct SubscriptionContent{
}

Item_Right_Dialog_Data: IconTitleVo[] = [
new IconTitleVo($r('app.media.ic_public_edit'), '重命名'),
new IconTitleVo($r('app.media.icon_operate_top'), '置顶'),
new IconTitleVo($r('app.media.icon_operate_move'), '移动至'),
new IconTitleVo($r('app.media.delete_svg'), '删除'),
]

Item_Dialog_Data: IconTitleVo[] = [
new IconTitleVo($r('app.media.ic_public_edit'), '编辑'),
new IconTitleVo($r('app.media.icon_operate_top'), '置顶'),
new IconTitleVo($r('app.media.icon_operate_move'), '移动至'),
Expand All @@ -327,7 +334,7 @@ export default struct SubscriptionContent{
GridRow({
columns:4
}){
ForEach(this.Item_Right_Dialog_Data,(item:IconTitleVo,index:number)=>{
ForEach(this.Item_Dialog_Data,(item:IconTitleVo,index:number)=>{
GridCol(){
CircleIcon({
item:item
Expand Down Expand Up @@ -414,7 +421,7 @@ export default struct SubscriptionContent{
direction:FlexDirection.Column
}){
ForEach(list, (item: IconTitleVo, index) => {
if (!(this.subscriptionTitle === '收藏' && item.title === '删除')){
if (this.subscriptionTitle.indexOf('收藏') === -1){
dialogTitleFuction({
title: item.title,
icon: item.icon,
Expand All @@ -423,6 +430,17 @@ export default struct SubscriptionContent{
.onClick(() => {
dialogRightChange(index)
})
} else {
if (item.title !== '重命名' && item.title !== '删除') {
dialogTitleFuction({
title: item.title,
icon: item.icon,
isBorder: list.length !== index + 1
})
.onClick(() => {
dialogRightChange(index)
})
}
}

})
Expand Down

0 comments on commit f9a1f3c

Please sign in to comment.