|
|
@@ -89,7 +89,7 @@ struct NewIndex {
|
|
|
.setLeftTitleBackground($r('app.color.title_bar_bg'))
|
|
|
.setOnLeftClickListener(() => {
|
|
|
// 打开菜单栏动画
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = true
|
|
|
this.offsetX = 0
|
|
|
})
|
|
|
@@ -140,7 +140,7 @@ struct NewIndex {
|
|
|
} else {
|
|
|
if (this.isShowDrawer) {
|
|
|
// 如果抽屉菜单打开,先关闭抽屉
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
} else {
|
|
|
@@ -254,7 +254,7 @@ struct NewIndex {
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.onClick(() => {
|
|
|
// 点击遮罩层关闭抽屉
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
})
|
|
|
@@ -346,11 +346,11 @@ struct NewIndex {
|
|
|
.onActionEnd(() => {
|
|
|
// 手势结束判断是否关闭抽屉
|
|
|
if (this.offsetX < -DisplayUtil.getWidth() / 15) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
} else {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = true
|
|
|
this.offsetX = 0
|
|
|
})
|
|
|
@@ -375,19 +375,30 @@ struct NewIndex {
|
|
|
buildUserInfoCard() {
|
|
|
Column() {
|
|
|
Row() {
|
|
|
- Image(this.userAvatarUrl && this.userAvatarUrl.length > 0 ? this.userAvatarUrl : this.userAvatar)
|
|
|
- .width(50)
|
|
|
- .height(50)
|
|
|
- .margin({ left: 12 })
|
|
|
- .borderRadius('50%')
|
|
|
- .clip(true)
|
|
|
- .backgroundColor(this.isDarkMode ? Color.Black : Color.White)
|
|
|
- .shadow({
|
|
|
- radius: 8,
|
|
|
- color: 0x11000000,
|
|
|
- offsetX: 0,
|
|
|
- offsetY: 2
|
|
|
- })
|
|
|
+ Stack({ alignContent: Alignment.BottomEnd }){
|
|
|
+ Image(this.userAvatarUrl && this.userAvatarUrl.length > 0 ? this.userAvatarUrl : this.userAvatar)
|
|
|
+ .width(55)
|
|
|
+ .height(55)
|
|
|
+ .margin({ left: 12 })
|
|
|
+ .borderRadius('50%')
|
|
|
+ .clip(true)
|
|
|
+ // .fillColor(this.themeColor)
|
|
|
+ .backgroundColor(this.isDarkMode ? Color.Black : Color.White)
|
|
|
+ Column() {
|
|
|
+ Text('VIP')
|
|
|
+ .fontSize(9)
|
|
|
+ .padding(2)
|
|
|
+ .fontWeight(FontWeight.Bolder)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .visibility(Utility.isNoble()?Visibility.Visible:Visibility.None)
|
|
|
+ }
|
|
|
+ .width(28)
|
|
|
+ .height(16)
|
|
|
+ .borderRadius(15)
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
Column() {
|
|
|
Row() {
|
|
|
Text(this.isLogin ? this.userName : '未登录用户')
|
|
|
@@ -404,11 +415,11 @@ struct NewIndex {
|
|
|
|
|
|
if (this.isLogin) {
|
|
|
if (this.hasActiveSubscription) {
|
|
|
- Text(this.subscriptionName)
|
|
|
- .fontSize(13)
|
|
|
- .fontColor(themeColorWithAlpha(this.themeColor, 0.8, false))
|
|
|
- .textAlign(TextAlign.Start)
|
|
|
- .padding({top:5})
|
|
|
+ // Text(this.subscriptionName)
|
|
|
+ // .fontSize(13)
|
|
|
+ // .fontColor(themeColorWithAlpha(this.themeColor, 0.8, false))
|
|
|
+ // .textAlign(TextAlign.Start)
|
|
|
+ // .padding({top:5})
|
|
|
this.TimeTextBuilder()
|
|
|
} else {
|
|
|
Text('普通用户')
|
|
|
@@ -427,11 +438,12 @@ struct NewIndex {
|
|
|
.margin({ left: 10 })
|
|
|
|
|
|
}
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.7})
|
|
|
.onClick(() => {
|
|
|
// if (!this.isLogin) {
|
|
|
this.mType = 1
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
// }
|
|
|
@@ -512,7 +524,7 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_MUSIC:
|
|
|
this.mType = 0
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
}
|
|
|
@@ -520,7 +532,7 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_FILE_SCAN:
|
|
|
this.mType = 2
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
}
|
|
|
@@ -528,32 +540,32 @@ struct NewIndex {
|
|
|
// case MainViewModel.MENU_HOME:
|
|
|
// this.mType = 0
|
|
|
// this.modeType = 0
|
|
|
- // animateTo({ duration: 555 }, () => {
|
|
|
+ // this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
// this.isShowDrawer = false
|
|
|
// })
|
|
|
// break
|
|
|
case MainViewModel.MENU_MIEDIA_KU:
|
|
|
this.modeType = 1
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
break
|
|
|
case MainViewModel.MENU_MIEDIA_ARTIST:
|
|
|
this.modeType = 2
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
break
|
|
|
case MainViewModel.MENU_MIEDIA_ALBUM:
|
|
|
this.modeType = 3
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
break
|
|
|
case MainViewModel.MENU_SETTING:
|
|
|
this.mType = 3
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
}
|
|
|
@@ -569,7 +581,7 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_USER:
|
|
|
this.mType = 1
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
}
|
|
|
@@ -579,7 +591,7 @@ struct NewIndex {
|
|
|
break
|
|
|
case MainViewModel.MENU_NET_CONNECT:
|
|
|
this.mType = 1
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
break
|
|
|
@@ -615,7 +627,7 @@ struct NewIndex {
|
|
|
case MainViewModel.MENU_ABOUT:
|
|
|
this.mType = 4
|
|
|
if (!this.isBigScreen()) {
|
|
|
- animateTo({ duration: 555 }, () => {
|
|
|
+ this.getUIContext()?.animateTo({ duration: 555 }, () => {
|
|
|
this.isShowDrawer = false
|
|
|
})
|
|
|
}
|