|
|
@@ -11,6 +11,20 @@ export struct Mine {
|
|
|
@StorageProp(UserInfo.KEY) userInfo: UserInfo = userInfo
|
|
|
|
|
|
setArr: Array<BasicType> = [
|
|
|
+ {
|
|
|
+ text: '我的押金',
|
|
|
+ click: () => {
|
|
|
+
|
|
|
+ },
|
|
|
+ src: $r('app.media.mine_right_arrow')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '地址管理',
|
|
|
+ click: () => {
|
|
|
+
|
|
|
+ },
|
|
|
+ src: $r('app.media.mine_right_arrow')
|
|
|
+ },
|
|
|
{
|
|
|
text: '意见反馈',
|
|
|
click: () => {
|
|
|
@@ -69,106 +83,89 @@ export struct Mine {
|
|
|
}
|
|
|
|
|
|
build() {
|
|
|
- RelativeContainer() {
|
|
|
- // 头像 - 用户名
|
|
|
- Row({space: 16}){
|
|
|
- Image(this.userInfo.getHeadImg())
|
|
|
- .aspectRatio(1)
|
|
|
- .height(80)
|
|
|
- .borderRadius(999)
|
|
|
- .border({ width: 4, color: Color.White })
|
|
|
-
|
|
|
- Text(this.userInfo.getName())
|
|
|
- .fontSize(18)
|
|
|
- .fontColor('#FF1C1C1C')
|
|
|
- .fontWeight(500)
|
|
|
- }
|
|
|
- .id('userInfo')
|
|
|
- .width('100%')
|
|
|
- .padding({top: 50})
|
|
|
- .onClick(() => {
|
|
|
- if (!this.userInfo.checkLogin()) {
|
|
|
- yTRouter.router2LoginPage()
|
|
|
- } else {
|
|
|
- yTRouter.router2SettingPage()
|
|
|
+ Scroll() {
|
|
|
+ Column(){
|
|
|
+ // 头像 - 用户名
|
|
|
+ Row({space: 16}){
|
|
|
+ Image(this.userInfo.getHeadImg())
|
|
|
+ .aspectRatio(1)
|
|
|
+ .height(80)
|
|
|
+ .borderRadius(999)
|
|
|
+ .border({ width: 4, color: Color.White })
|
|
|
+
|
|
|
+ Text(this.userInfo.getName())
|
|
|
+ .fontSize(18)
|
|
|
+ .fontColor('#FF1C1C1C')
|
|
|
+ .fontWeight(500)
|
|
|
}
|
|
|
- })
|
|
|
- .alignRules({
|
|
|
- top: { anchor: "__container__", align: VerticalAlign.Top },
|
|
|
- left: { anchor: "__container__", align: HorizontalAlign.Start },
|
|
|
- })
|
|
|
-
|
|
|
- // 已借阅数量
|
|
|
- Row(){
|
|
|
- Text('已借阅')
|
|
|
- .fontSize(20)
|
|
|
- .fontWeight(500)
|
|
|
- .fontColor('#FF000000')
|
|
|
+ .width('100%')
|
|
|
+ .padding({top: 50})
|
|
|
+ .onClick(() => {
|
|
|
+ if (!this.userInfo.checkLogin()) {
|
|
|
+ yTRouter.router2LoginPage()
|
|
|
+ } else {
|
|
|
+ yTRouter.router2SettingPage()
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- Text(`${0} 本`)
|
|
|
- .fontSize(20)
|
|
|
- .fontWeight(500)
|
|
|
- .fontColor('#FF000000')
|
|
|
- }
|
|
|
- .width("100%")
|
|
|
- .id('BorrowCount')
|
|
|
- .padding({top: 40, bottom: 20})
|
|
|
- .justifyContent(FlexAlign.SpaceBetween)
|
|
|
- .alignRules({
|
|
|
- top: { anchor: "userInfo", align: VerticalAlign.Bottom },
|
|
|
- left: { anchor: "__container__", align: HorizontalAlign.Start },
|
|
|
- })
|
|
|
+ // 已借阅数量
|
|
|
+ Row(){
|
|
|
+ Text('已借阅')
|
|
|
+ .fontSize(20)
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#FF000000')
|
|
|
+
|
|
|
+ Text(`${0} 本`)
|
|
|
+ .fontSize(20)
|
|
|
+ .fontWeight(500)
|
|
|
+ .fontColor('#FF000000')
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .padding({top: 40, bottom: 20})
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
|
|
|
- MineBorrow({ userInfo: this.userInfo })
|
|
|
- .alignRules({
|
|
|
- top: { anchor: "BorrowCount", align: VerticalAlign.Bottom },
|
|
|
- left: { anchor: "__container__", align: HorizontalAlign.Start },
|
|
|
- })
|
|
|
+ MineBorrow({ userInfo: this.userInfo })
|
|
|
|
|
|
- // 功能栏
|
|
|
- Column() {
|
|
|
+ // 功能栏
|
|
|
+ Column() {
|
|
|
ForEach(this.setArr, (item: BasicType, index) => {
|
|
|
- Row() {
|
|
|
- Text(item.text)
|
|
|
- .fontColor('#FF1C1C1C')
|
|
|
- .fontSize(16)
|
|
|
- if (index == 1) {
|
|
|
- Text('去分享')
|
|
|
- .fontColor('#801C1C1C')
|
|
|
- .fontSize(14)
|
|
|
- .fontWeight(400)
|
|
|
- } else {
|
|
|
- Image($r('app.media.right_arrow'))
|
|
|
- .width(24)
|
|
|
- .aspectRatio(1)
|
|
|
- }
|
|
|
+ Row() {
|
|
|
+ Text(item.text)
|
|
|
+ .fontColor('#FF1C1C1C')
|
|
|
+ .fontSize(16)
|
|
|
+ if (item.text == '分享给好友') {
|
|
|
+ Text('去分享')
|
|
|
+ .fontColor('#801C1C1C')
|
|
|
+ .fontSize(14)
|
|
|
+ .fontWeight(400)
|
|
|
+ } else {
|
|
|
+ Image($r('app.media.right_arrow'))
|
|
|
+ .width(24)
|
|
|
+ .aspectRatio(1)
|
|
|
}
|
|
|
- .width('100%')
|
|
|
- .padding({top: 29, bottom: 18})
|
|
|
- .justifyContent(FlexAlign.SpaceBetween)
|
|
|
- .onClick(() => {
|
|
|
- item.click?.()
|
|
|
- })
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .padding({top: 29, bottom: 18})
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .onClick(() => {
|
|
|
+ item.click?.()
|
|
|
+ })
|
|
|
|
|
|
Divider().height(1).width("100%").backgroundColor('#1A1C1C1C')
|
|
|
})
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .padding({bottom: 32})
|
|
|
+ .margin({top: 16})
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({ topRight: 32 })
|
|
|
}
|
|
|
.width('100%')
|
|
|
- .padding({bottom: 32})
|
|
|
- .backgroundColor(Color.White)
|
|
|
- .borderRadius({ topRight: 32 })
|
|
|
- .alignRules({
|
|
|
- bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
|
|
|
- left: { anchor: "__container__", align: HorizontalAlign.Start },
|
|
|
- })
|
|
|
- .id("bottomColumn")
|
|
|
- }
|
|
|
- .height('100%')
|
|
|
- .height('100%')
|
|
|
- .backgroundImagePosition(Alignment.Top)
|
|
|
- .backgroundImage($r('app.media.mine_bgc'))
|
|
|
- .padding({left: 22, right: 22, top: this.safeTop})
|
|
|
- .backgroundImageSize({ width: '100%', height: 298 })
|
|
|
+ .backgroundImagePosition(Alignment.Top)
|
|
|
+ .backgroundImage($r('app.media.mine_bgc'))
|
|
|
+ .padding({left: 22, right: 22, top: this.safeTop})
|
|
|
+ .backgroundImageSize({ width: '100%', height: 298 })
|
|
|
+ }.scrollBar(BarState.Off)
|
|
|
}
|
|
|
|
|
|
async shareData() {
|