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 14:55:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f8c68585d8196a09c8c5afb2fa8dfad23e297334
f8c68585
1 parent
399c9019
fix(toast):意见反馈toast样式调整
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
10 deletions
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
sight_harmony/features/wdComponent/src/main/ets/components/FeedBackActivity.ets
sight_harmony/features/wdComponent/src/main/resources/base/element/color.json
sight_harmony/commons/wdKit/src/main/ets/reusable/CustomToast.ets
View file @
f8c6858
...
...
@@ -3,10 +3,13 @@ export struct CustomToast {
public static LENGTH_LONG = 4000;
public static LENGTH_SHORT = 2000;
@State msg:
string
= ""
@State msg:
ResourceStr
= ""
@State duration: number = CustomToast.LENGTH_SHORT
@State bgBorderRadius: number = 10
opacityValue: number = 0.7
bgColor: ResourceColor = $r("app.color.black")
fontSizeValue :number | string | Resource = "27lpx"
lineHeightValue :number | string | Resource = "38lpx"
controller: CustomDialogController
dismiss: () => void = () => {
...
...
@@ -27,13 +30,13 @@ export struct CustomToast {
Text(this.msg)
.fontWeight(FontWeight.Regular)
.fontColor($r('app.color.white'))
.fontSize("27lpx")
.lineHeight("38lpx")
.fontSize(this.fontSizeValue)
.lineHeight(this.lineHeightValue)
.textAlign(TextAlign.Center)
}.borderRadius(`${this.bgBorderRadius}lpx`)
.constraintSize({maxWidth:"86%"})
.padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
.backgroundColor($r("app.color.black"))
.opacity(0.7)
.backgroundColor(this.bgColor)
.opacity(this.opacityValue)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/FeedBackActivity.ets
View file @
f8c6858
import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index';
import { AppUtils,
CustomToast,
DateTimeUtils,
DeviceUtil,
FastClickUtil, Logger, NetworkUtil, StringUtils,
ToastUtils,
UserDataLocal } from 'wdKit/Index';
FastClickUtil, Logger, NetworkUtil, StringUtils, UserDataLocal } from 'wdKit/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { CustomTitleUI } from './reusable/CustomTitleUI'
import { picker } from '@kit.CoreFileKit';
...
...
@@ -38,6 +39,21 @@ export struct FeedBackActivity {
addPic: PhotoListBean = {itemType:1} as PhotoListBean
@State pics: PhotoListBean[] = [this.addPic] as PhotoListBean[]
@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"
})
async aboutToAppear() {
await this.getContentDetailData()
}
...
...
@@ -124,7 +140,7 @@ export struct FeedBackActivity {
if(value.length> 500){
//隐藏键盘
inputMethod.getController().stopInputSession();
ToastUtils.shortToast
($r('app.string.res_feedback_commentsFail'))
this.showToastTip
($r('app.string.res_feedback_commentsFail'))
// Logger.debug(TAG, "onChange > 500 " + value)
this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean
}else{
...
...
@@ -409,13 +425,13 @@ export struct FeedBackActivity {
})
}else{
//
ToastUtils.shortToast
($r('app.string.feedback_opinion_type'))
this.showToastTip
($r('app.string.feedback_opinion_type'))
TrackingButton.click('feedbackPageSubmitFeedback',TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage)
return
}
//内容必填
if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){
ToastUtils.shortToast
($r('app.string.res_feedback_commentsFail'))
this.showToastTip
($r('app.string.res_feedback_commentsFail'))
return
}
...
...
@@ -458,4 +474,9 @@ export struct FeedBackActivity {
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.FeedbackPage,TrackConstants.PageName.FeedbackPage,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
}
showToastTip(msg:ResourceStr){
this.toastText = msg
this.dialogToast.open()
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/element/color.json
View file @
f8c6858
...
...
@@ -157,6 +157,10 @@
"value"
:
"#0D000000"
},
{
"name"
:
"color_B3000000"
,
"value"
:
"#B3000000"
},
{
"name"
:
"res_color_general_000000_30"
,
"value"
:
"#4D000000"
}
...
...
Please
register
or
login
to post a comment