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
张善主
2024-05-31 15:35:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
14137894a7fb909c6b9fe6649039df8f60b85f35
14137894
1 parent
ba47549a
fix(toast):电子报toast样式调整
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
1413789
...
...
@@ -9,7 +9,7 @@ import font from '@ohos.font';
import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog';
import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
import { Logger, ToastUtils, NetworkUtil
, CustomToast
} from 'wdKit/Index';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
import { window } from '@kit.ArkUI';
...
...
@@ -36,6 +36,25 @@ export struct ENewspaperPageComponent {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State ratio: string = '100%'
@State toastText:ResourceStr = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
bgColor:$r("app.color.color_B3000000"),
opacityValue:1,
fontSizeValue:"25lpx",
lineHeightValue:"36lpx",
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
showToastTip(msg:ResourceStr){
this.toastText = msg
this.dialogToast.open()
}
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
...
...
@@ -323,7 +342,7 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_page_num')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000
)
this.showToastTip('网络出小差了,请检查网络后重试'
)
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
...
...
@@ -334,7 +353,7 @@ export struct ENewspaperPageComponent {
this.pageDialogController.close()
}
}else {
ToastUtils.showToast('暂无数据', 1000
)
this.showToastTip('暂无数据'
)
}
})
...
...
@@ -362,7 +381,7 @@ export struct ENewspaperPageComponent {
.id('e_newspaper_read')
.onClick((event: ClickEvent) => {
if(!NetworkUtil.isNetConnected()){
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000
)
this.showToastTip('网络出小差了,请检查网络后重试'
)
return
}
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
...
...
@@ -376,7 +395,7 @@ export struct ENewspaperPageComponent {
'currentNumber':this.swiperIndex,
})
}else {
ToastUtils.showToast('暂无数据', 1000
)
this.showToastTip('暂无数据'
)
}
})
}
...
...
@@ -414,7 +433,7 @@ export struct ENewspaperPageComponent {
let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight)
this.newspaperListBean = listBean;
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000
)
this.showToastTip('网络出小差了,请检查网络后重试'
)
}
} catch (exception) {
...
...
Please
register
or
login
to post a comment