|
@@ -168,6 +168,14 @@ struct NewIndex {
|
|
|
this.hasActiveSubscription = PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
|
|
this.hasActiveSubscription = PreferencesUtil.getBooleanSync('hasActiveSubscription', false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ onPageShow() {
|
|
|
|
|
+
|
|
|
|
|
+ if(this.isHiCar()||this.isBigScreen()){
|
|
|
|
|
+ this.isShowDrawer = true
|
|
|
|
|
+ this.isShowTitleBar = false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 页面显示生命周期钩子
|
|
* 页面显示生命周期钩子
|
|
|
* - 注册断点系统
|
|
* - 注册断点系统
|
|
@@ -179,9 +187,7 @@ struct NewIndex {
|
|
|
|
|
|
|
|
async aboutToAppear() {
|
|
async aboutToAppear() {
|
|
|
this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, true)
|
|
this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, true)
|
|
|
- if(this.isHiCar()){
|
|
|
|
|
- this.isShowTitleBar = false
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
Utility.enableFullScreen()
|
|
Utility.enableFullScreen()
|
|
|
this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
@@ -540,7 +546,7 @@ struct NewIndex {
|
|
|
Text(item.title)
|
|
Text(item.title)
|
|
|
.margin({ left: 10, right: 20 })
|
|
.margin({ left: 10, right: 20 })
|
|
|
.fontSize(15)
|
|
.fontSize(15)
|
|
|
- .fontColor(this.mType == index ? this.themeColor : $r('app.color.index_tab_font_color'))
|
|
|
|
|
|
|
+ .fontColor(this.isTextSelected(index) ? this.themeColor : $r('app.color.index_tab_font_color'))
|
|
|
.fontWeight(480)
|
|
.fontWeight(480)
|
|
|
Blank()
|
|
Blank()
|
|
|
// 右侧箭头
|
|
// 右侧箭头
|
|
@@ -561,19 +567,11 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_MUSIC:
|
|
case MainViewModel.MENU_MUSIC:
|
|
|
this.mType = 0
|
|
this.mType = 0
|
|
|
this.modeType = 0
|
|
this.modeType = 0
|
|
|
- if (!this.isBigScreen()) {
|
|
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_FILE_SCAN:
|
|
case MainViewModel.MENU_FILE_SCAN:
|
|
|
this.mType = 2
|
|
this.mType = 2
|
|
|
- if (!this.isBigScreen()) {
|
|
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
// case MainViewModel.MENU_HOME:
|
|
// case MainViewModel.MENU_HOME:
|
|
|
// this.mType = 0
|
|
// this.mType = 0
|
|
@@ -585,34 +583,22 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_MIEDIA_KU:
|
|
case MainViewModel.MENU_MIEDIA_KU:
|
|
|
this.modeType = 1
|
|
this.modeType = 1
|
|
|
this.mType = 0
|
|
this.mType = 0
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_MIEDIA_ARTIST:
|
|
case MainViewModel.MENU_MIEDIA_ARTIST:
|
|
|
this.modeType = 2
|
|
this.modeType = 2
|
|
|
this.mType = 0
|
|
this.mType = 0
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_MIEDIA_ALBUM:
|
|
case MainViewModel.MENU_MIEDIA_ALBUM:
|
|
|
this.modeType = 3
|
|
this.modeType = 3
|
|
|
this.mType = 0
|
|
this.mType = 0
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_SETTING:
|
|
case MainViewModel.MENU_SETTING:
|
|
|
this.mType = 3
|
|
this.mType = 3
|
|
|
- if (!this.isBigScreen()) {
|
|
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- // router.pushUrl({
|
|
|
|
|
- // url: 'pages/SettingPage'
|
|
|
|
|
- // }, router.RouterMode.Single);
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
|
|
+
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_VIP:
|
|
case MainViewModel.MENU_VIP:
|
|
|
router.pushUrl({
|
|
router.pushUrl({
|
|
@@ -621,31 +607,18 @@ struct NewIndex {
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_USER:
|
|
case MainViewModel.MENU_USER:
|
|
|
this.mType = 1
|
|
this.mType = 1
|
|
|
- if (!this.isBigScreen()) {
|
|
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- // router.pushUrl({
|
|
|
|
|
- // url: 'pages/UserCenter'
|
|
|
|
|
- // }, router.RouterMode.Single);
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_NET_CONNECT:
|
|
case MainViewModel.MENU_NET_CONNECT:
|
|
|
this.mType = 1
|
|
this.mType = 1
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_SIMI:
|
|
case MainViewModel.MENU_SIMI:
|
|
|
router.pushUrl({
|
|
router.pushUrl({
|
|
|
url: 'pages/VerifyPage'
|
|
url: 'pages/VerifyPage'
|
|
|
});
|
|
});
|
|
|
break
|
|
break
|
|
|
- case MainViewModel.MENU_LIKE:
|
|
|
|
|
- router.pushUrl({
|
|
|
|
|
- url: 'pages/LikeVideoPage'
|
|
|
|
|
- });
|
|
|
|
|
- break
|
|
|
|
|
|
|
+
|
|
|
case MainViewModel.MENU_DUTY:
|
|
case MainViewModel.MENU_DUTY:
|
|
|
router.pushUrl({
|
|
router.pushUrl({
|
|
|
url: 'pages/WebIndex',
|
|
url: 'pages/WebIndex',
|
|
@@ -655,26 +628,10 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_HAOPING:
|
|
case MainViewModel.MENU_HAOPING:
|
|
|
Utility.gotoMarket(getContext(this) as common.UIAbilityContext, this.bundleName)
|
|
Utility.gotoMarket(getContext(this) as common.UIAbilityContext, this.bundleName)
|
|
|
break
|
|
break
|
|
|
- case MainViewModel.MENU_TEST_SPEED:
|
|
|
|
|
- router.pushUrl({
|
|
|
|
|
- url: 'pages/SpeedIndex'
|
|
|
|
|
- });
|
|
|
|
|
- break
|
|
|
|
|
- case MainViewModel.MENU_OPTIMIZE:
|
|
|
|
|
- router.pushUrl({
|
|
|
|
|
- url: 'pages/AddSpeedPage'
|
|
|
|
|
- });
|
|
|
|
|
- break
|
|
|
|
|
|
|
+
|
|
|
case MainViewModel.MENU_ABOUT:
|
|
case MainViewModel.MENU_ABOUT:
|
|
|
this.mType = 4
|
|
this.mType = 4
|
|
|
- if (!this.isBigScreen()) {
|
|
|
|
|
- this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
- this.isShowDrawer = false
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- // router.pushUrl({
|
|
|
|
|
- // url: 'pages/AboutPage'
|
|
|
|
|
- // }, router.RouterMode.Single);
|
|
|
|
|
|
|
+ this.doShowDrawer()
|
|
|
break
|
|
break
|
|
|
case MainViewModel.MENU_UPDATE:
|
|
case MainViewModel.MENU_UPDATE:
|
|
|
AlertDialog.show({
|
|
AlertDialog.show({
|
|
@@ -726,6 +683,26 @@ struct NewIndex {
|
|
|
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
|
|
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ isTextSelected(index:number):boolean{
|
|
|
|
|
+ if(this.isShowTitleBar&&!this.isHiCar()){
|
|
|
|
|
+ return this.mType ==index
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(this.mType == 0){
|
|
|
|
|
+ return this.modeType == index
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.mType+3 == index
|
|
|
|
|
+ }
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ doShowDrawer(){
|
|
|
|
|
+ if (!this.isBigScreen()) {
|
|
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
|
|
+ this.isShowDrawer = false
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
gotoShare() {
|
|
gotoShare() {
|
|
|
let shareData: systemShare.SharedData = new systemShare.SharedData({
|
|
let shareData: systemShare.SharedData = new systemShare.SharedData({
|
|
|
utd: uniformTypeDescriptor.UniformDataType.TEXT,
|
|
utd: uniformTypeDescriptor.UniformDataType.TEXT,
|