| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- import TitleBar from '../view/TitleBar'
- import { router } from '@kit.ArkUI'
- import { CommonConstants } from '../common/constants/CommonConstants'
- import { AppUtil, DeviceUtil, DisplayUtil, ToastUtil } from '@pura/harmony-utils'
- import { Utility } from '../common/util/Utility'
- import { ConfigurationConstant } from '@kit.AbilityKit'
- import { BreakpointTypeEnum } from '../common/util/BreakpointSystem'
- import { resourceManager } from '@kit.LocalizationKit'
- @Preview
- @Entry
- @Component
- export struct AboutPage{
- @State isDarkMode: boolean = false
- @StorageProp('currentColorMode') @Watch('onColorModeChange') currentMode: number =
- ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT;
- /** 当前断点类型(如大屏/小屏) */
- @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointTypeEnum.MD;
- onColorModeChange() {
- this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK
- this.titleBarModel
- .setTitleBarBackground($r('app.color.title_bar_bg'))
- .setLeftTitleBackground($r('app.color.title_bar_bg'))
- }
- @State titleBarModel: TitleBar.Model = new TitleBar.Model()
- .setTitleTextStyle(FontStyle.Normal)
- .setTitleBarStyle(TitleBar.BarStyle.TRANSPARENT)
- .setLeftIcon($r('app.media.left_back_white'))
- .setTitleName('关于我们')
- .setTitleFontColor(Color.White)
- .setTitleBarBackground($r('app.color.title_bar_bg'))
- .setLeftTitleBackground($r('app.color.title_bar_bg'))
- .setTitleBarBottomLineColor($r('app.color.title_bar_bg'))
- .setOnLeftClickListener(() => {
- router.back()
- })
- @State verName:string = ''
- @State appName:string = ''
- // 组件生命周期
- aboutToAppear() {
- // Utility.disableFullScreen()
- this.verName = AppUtil.getVersionName()
- Utility.getAppName(getContext(this)).then((appName:string)=>{
- this.appName = appName
- })
- this.onColorModeChange()
- console.info('LifeCycleComponent aboutToAppear');
- }
- // 组件生命周期
- aboutToDisappear() {
- console.info('LifeCycleComponent aboutToDisappear');
- }
- //是不是手机横屏
- isPhoneLan() {
- if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
- && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
- if (DisplayUtil.getFoldStatus() === 0 ) {
- return true
- }
- }
- return false
- }
- build() {
- Column(){
- Column(){
- Line().width('100%').height('100%')
- }
- .height(this.isPhoneLan()?0:px2vp(AppUtil.getStatusBarHeight()))
- .backgroundColor($r('app.color.title_bar_bg'))
- .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
- TitleBar({model:$titleBarModel})
- Scroll(){
- Column(){
- Image($r('app.media.icon'))
- .width(150)
- .height(150)
- .borderRadius('100%')
- .clip(true)
- .margin({top:55})
- Text(this.appName+'V:'+this.verName)
- .fontColor(this.isDarkMode ? Color.White : Color.Black)
- .fontWeight(480)
- .fontSize(17)
- .margin({top:20,bottom:20})
- Text(CommonConstants.ICP_NO)
- .fontColor(this.isDarkMode ? Color.White : Color.Black)
- .fontWeight(480)
- .decoration({ type: TextDecorationType.Underline, color: this.isDarkMode ? Color.White : Color.Black })
- .fontSize(18)
- .margin({top:20,bottom:20})
- .onClick(()=>{
- router.pushUrl({url:'pages/WebIndex',
- params:{ titleName:'ICP备案',webUrl:CommonConstants.ICP_URL}
- });
- })
- Button('加入Q群:685109858', { type: ButtonType.Capsule, stateEffect: false })
- .width('60%')
- .height(55)
- .margin({top:50,bottom:20})
- // .visibility(Visibility.None)
- .stateEffect(true)
- .backgroundColor(this.isDarkMode ? '#1E90FF' : '#FF4081')
- .stateStyles({
- pressed: { opacity: 0.6 }
- })
- .onClick(()=>{
- ToastUtil.showToast('复制群号成功!')
- Utility.copyText('685109858')
- })
- Button('用户反馈', { type: ButtonType.Capsule, stateEffect: false })
- .width('60%')
- .height(55)
- .stateEffect(true)
- .margin({bottom:20})
- .backgroundColor(this.isDarkMode ? '#1E90FF' : '#FF4081')
- .stateStyles({
- pressed: { opacity: 0.6 }
- })
- .onClick(()=>{
- AlertDialog.show({
- title:'发送邮件',
- message:'感谢你的支持,如果有什么不支持的格式不能播放请反馈给我们修复,谢谢!有建议和反馈的请邮件联系我们:'+CommonConstants.CONTACT_MAIL,
- autoCancel:true,
- alignment:DialogAlignment.Center,
- offset:{dx:0,dy:-20},
- confirm:{
- value:'确定',
- fontColor:Color.White,
- backgroundColor:$r('app.color.title_bar_bg'),
- action:()=>{
- ToastUtil.showToast('复制邮件地址成功!')
- Utility.copyText(CommonConstants.CONTACT_MAIL)
- }
- }
- })
- })
- }
- .height('100%')
- .width('100%')
- }
- .height(px2vp(DisplayUtil.getHeight()-AppUtil.getStatusBarHeight()-AppUtil.getNavigationIndicatorHeight()))
- .backgroundColor(this.isDarkMode ? '#1A1A1A' : undefined)
- .linearGradient(!this.isDarkMode ? {colors:[['#FF4081', 0.0], ['#FF8C00', 0.6]]} : undefined)
- }
- }
- }
|