Showing
90 changed files
with
3191 additions
and
418 deletions
| @@ -8,10 +8,13 @@ import router from '@ohos.router'; | @@ -8,10 +8,13 @@ import router from '@ohos.router'; | ||
| 8 | struct SettingPage { | 8 | struct SettingPage { |
| 9 | @State message: string = 'Hello World 02' | 9 | @State message: string = 'Hello World 02' |
| 10 | @State pageType: string = ''; | 10 | @State pageType: string = ''; |
| 11 | + @State params:any = router.getParams(); | ||
| 11 | 12 | ||
| 12 | onPageShow() { | 13 | onPageShow() { |
| 13 | - const params = router.getParams(); // 获取传递过来的参数对象 | ||
| 14 | - this.pageType = 'mainSetting';// 获取info属性的值 | 14 | + |
| 15 | + this.pageType = this.params.pageType; | ||
| 16 | + | ||
| 17 | + // this.pageType = 'mainSetting';// 获取info属性的值 | ||
| 15 | } | 18 | } |
| 16 | 19 | ||
| 17 | build() { | 20 | build() { |
| @@ -4,11 +4,11 @@ | @@ -4,11 +4,11 @@ | ||
| 4 | "pages/MainPage", | 4 | "pages/MainPage", |
| 5 | "pages/ColumnPage", | 5 | "pages/ColumnPage", |
| 6 | "pages/TestPage", | 6 | "pages/TestPage", |
| 7 | - "pages/SettingPage", | ||
| 8 | - "pages/PrivacySettingPage", | ||
| 9 | - "pages/SettingAboutPage", | 7 | + "components/page/SettingPage", |
| 8 | + "components/page/PrivacySettingPage", | ||
| 9 | + "components/page/SettingAboutPage", | ||
| 10 | "pages/AppointmentListPage", | 10 | "pages/AppointmentListPage", |
| 11 | - "pages/SettingPasswordPage", | 11 | + "components/page/SettingPasswordPage", |
| 12 | "pages/FollowListPage" | 12 | "pages/FollowListPage" |
| 13 | ] | 13 | ] |
| 14 | } | 14 | } |
| @@ -12,6 +12,7 @@ import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctio | @@ -12,6 +12,7 @@ import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctio | ||
| 12 | import storageStatistics from "@ohos.file.storageStatistics"; | 12 | import storageStatistics from "@ohos.file.storageStatistics"; |
| 13 | import { BusinessError } from '@ohos.base'; | 13 | import { BusinessError } from '@ohos.base'; |
| 14 | import ArrayList from '@ohos.util.ArrayList'; | 14 | import ArrayList from '@ohos.util.ArrayList'; |
| 15 | +import router from '@ohos.router'; | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | @Component | 18 | @Component |
| @@ -58,7 +59,12 @@ export struct AccountAndSecurityLayout { | @@ -58,7 +59,12 @@ export struct AccountAndSecurityLayout { | ||
| 58 | } | 59 | } |
| 59 | .onClick(() => { | 60 | .onClick(() => { |
| 60 | console.log(index + "") | 61 | console.log(index + "") |
| 61 | - RouteManager.jumpNewPage("pages/SettingPasswordPage") // 调用跳转方法,跳转新页面 | 62 | + if (index == 1) { |
| 63 | + router.pushUrl({ | ||
| 64 | + url:"pages/SettingPasswordPage", | ||
| 65 | + params : {'currentType' : 4} | ||
| 66 | + }) | ||
| 67 | + } | ||
| 62 | }) | 68 | }) |
| 63 | 69 | ||
| 64 | }, item => item) | 70 | }, item => item) |
| @@ -11,6 +11,7 @@ import RouteManager from '../../utils/RouteManager' | @@ -11,6 +11,7 @@ import RouteManager from '../../utils/RouteManager' | ||
| 11 | import storageStatistics from "@ohos.file.storageStatistics"; | 11 | import storageStatistics from "@ohos.file.storageStatistics"; |
| 12 | import { BusinessError } from '@ohos.base'; | 12 | import { BusinessError } from '@ohos.base'; |
| 13 | import RouteManager from '../../utils/RouteManager' | 13 | import RouteManager from '../../utils/RouteManager' |
| 14 | +import router from '@ohos.router'; | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | @Component | 17 | @Component |
| @@ -67,15 +68,25 @@ export struct MineSettingComponent { | @@ -67,15 +68,25 @@ export struct MineSettingComponent { | ||
| 67 | }.padding({ left: '27lpx' }) | 68 | }.padding({ left: '27lpx' }) |
| 68 | .onClick(() => { | 69 | .onClick(() => { |
| 69 | 70 | ||
| 70 | - // 在Home页面中 | ||
| 71 | - let paramsInfo: object = { | ||
| 72 | - pageId: 123, | ||
| 73 | - pageType:'AccountAndSecurityLayout' | ||
| 74 | - }; | ||
| 75 | - RouteManager.jumpNewPage("pages/SettingPasswordPage") // 调用跳转方法,跳转新页面 | ||
| 76 | - | 71 | + // // 在Home页面中 |
| 72 | + // let paramsInfo: object = { | ||
| 73 | + // pageId: 123, | ||
| 74 | + // pageType:'AccountAndSecurityLayout' | ||
| 75 | + // }; | ||
| 77 | console.log(subIndex + "") | 76 | console.log(subIndex + "") |
| 78 | - if (subIndex == 2) { | 77 | + if (subIndex == 0) { |
| 78 | + // router.pushUrl({ | ||
| 79 | + // url:"pages/SettingPasswordPage", | ||
| 80 | + // params : {'currentType' : 4} | ||
| 81 | + // }) | ||
| 82 | + | ||
| 83 | + router.pushUrl({ | ||
| 84 | + url:"pages/SettingPage", | ||
| 85 | + params : {'pageType' : 'AccountAndSecurityLayout'} | ||
| 86 | + }) | ||
| 87 | + //SettingPage | ||
| 88 | + // RouteManager.jumpNewPage("pages/SettingPasswordPage", {'currentType' : 4}) // 调用跳转方法,跳转新页面 | ||
| 89 | + }else if (subIndex == 2) { | ||
| 79 | // RouteManager.jumpNewPage("pages/SettingPage") // 调用跳转方法,跳转新页面 | 90 | // RouteManager.jumpNewPage("pages/SettingPage") // 调用跳转方法,跳转新页面 |
| 80 | RouteManager.jumpNewPage("pages/PrivacySettingPage") | 91 | RouteManager.jumpNewPage("pages/PrivacySettingPage") |
| 81 | } | 92 | } |
| @@ -2,13 +2,13 @@ import dataPreferences from '@ohos.data.preferences'; | @@ -2,13 +2,13 @@ import dataPreferences from '@ohos.data.preferences'; | ||
| 2 | import { PermissionUtil } from 'wdKit' | 2 | import { PermissionUtil } from 'wdKit' |
| 3 | import { SPHelper } from 'wdKit' | 3 | import { SPHelper } from 'wdKit' |
| 4 | import hilog from '@ohos.hilog'; | 4 | import hilog from '@ohos.hilog'; |
| 5 | -import {PrivacySettingModel} from '../../viewmodel/PrivacySettingModel' | 5 | +import { PrivacySettingModel } from '../../viewmodel/PrivacySettingModel' |
| 6 | 6 | ||
| 7 | const TAG = 'PrivacySettingComponents'; | 7 | const TAG = 'PrivacySettingComponents'; |
| 8 | 8 | ||
| 9 | @Component | 9 | @Component |
| 10 | -export struct PrivacySettingComponents { | ||
| 11 | - @State listData: Array<PrivacySettingModel> = [new PrivacySettingModel('开启个性推荐', false, null), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')]; | 10 | +export struct PrivacySettingComponents { |
| 11 | + @State listData: Array<PrivacySettingModel> = [new PrivacySettingModel('开启个性推荐', false, null), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')]; | ||
| 12 | @State tips: string = '设置前可查阅' | 12 | @State tips: string = '设置前可查阅' |
| 13 | @State privacyTips: string = '《隐私政策》' | 13 | @State privacyTips: string = '《隐私政策》' |
| 14 | 14 | ||
| @@ -17,7 +17,7 @@ export struct PrivacySettingComponents { | @@ -17,7 +17,7 @@ export struct PrivacySettingComponents { | ||
| 17 | // SPHelper.default.save('sdf','sdf'); | 17 | // SPHelper.default.save('sdf','sdf'); |
| 18 | // this.initListData(); | 18 | // this.initListData(); |
| 19 | this.getPermissionStatus(); | 19 | this.getPermissionStatus(); |
| 20 | - RefreshStatus; | 20 | + RefreshStatus; |
| 21 | 21 | ||
| 22 | } | 22 | } |
| 23 | 23 | ||
| @@ -31,13 +31,13 @@ export struct PrivacySettingComponents { | @@ -31,13 +31,13 @@ export struct PrivacySettingComponents { | ||
| 31 | // this.listData.push(model1, model2, model3, model4, model5); | 31 | // this.listData.push(model1, model2, model3, model4, model5); |
| 32 | // } | 32 | // } |
| 33 | 33 | ||
| 34 | - async getPermissionStatus(){ | ||
| 35 | - const permissionUtil = new PermissionUtil(); | 34 | + async getPermissionStatus() { |
| 35 | + const permissionUtil = new PermissionUtil(); | ||
| 36 | for (const element of this.listData) { | 36 | for (const element of this.listData) { |
| 37 | if (!element.permissionKey) { | 37 | if (!element.permissionKey) { |
| 38 | continue; | 38 | continue; |
| 39 | } | 39 | } |
| 40 | - const result = await permissionUtil.checkPermissions(element.permissionKey); | 40 | + const result = await permissionUtil.checkPermissions(element.permissionKey); |
| 41 | element.permission = result; | 41 | element.permission = result; |
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| @@ -52,49 +52,48 @@ export struct PrivacySettingComponents { | @@ -52,49 +52,48 @@ export struct PrivacySettingComponents { | ||
| 52 | .backgroundColor('#F8F8F8') | 52 | .backgroundColor('#F8F8F8') |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | - @Builder PrivacySettingComponentsUI() { | 55 | + @Builder PrivacySettingComponentsUI() { |
| 56 | Column() { | 56 | Column() { |
| 57 | 57 | ||
| 58 | - List({space:'23lpx'}){ | ||
| 59 | - ForEach(this.listData, (item:PrivacySettingModel, index) =>{ | 58 | + List({ space: '23lpx' }) { |
| 59 | + ForEach(this.listData, (item: PrivacySettingModel, index) => { | ||
| 60 | ListItem() { | 60 | ListItem() { |
| 61 | if (index == 0) { | 61 | if (index == 0) { |
| 62 | - getTuiJianCell({item, index}); | ||
| 63 | - }else{ | ||
| 64 | - getArrowCell({item, index}); | 62 | + getTuiJianCell({ item, index }); |
| 63 | + } else { | ||
| 64 | + getArrowCell({ item, index }); | ||
| 65 | } | 65 | } |
| 66 | - }.onClick(()=>{ | 66 | + }.onClick(() => { |
| 67 | if (index != 0) { | 67 | if (index != 0) { |
| 68 | - if (!item.permission){ | 68 | + if (!item.permission) { |
| 69 | //跳转权限设置 | 69 | //跳转权限设置 |
| 70 | - const permissionUtil = new PermissionUtil(); | 70 | + const permissionUtil = new PermissionUtil(); |
| 71 | PermissionUtil.reqPermissionsFromUser([item.permissionKey]); | 71 | PermissionUtil.reqPermissionsFromUser([item.permissionKey]); |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | }) | 74 | }) |
| 75 | }, item => item) | 75 | }, item => item) |
| 76 | } | 76 | } |
| 77 | - .padding({left:'29lpx', right:'29lpx'}) | ||
| 78 | - .margin({top:'38lpx'}) | 77 | + .padding({ left: '29lpx', right: '29lpx' }) |
| 78 | + .margin({ top: '38lpx' }) | ||
| 79 | 79 | ||
| 80 | - Row(){ | 80 | + Row() { |
| 81 | Text(this.tips) | 81 | Text(this.tips) |
| 82 | .fontSize('25lpx') | 82 | .fontSize('25lpx') |
| 83 | .textAlign(TextAlign.Start) | 83 | .textAlign(TextAlign.Start) |
| 84 | .fontColor($r("app.color.color_666666")) | 84 | .fontColor($r("app.color.color_666666")) |
| 85 | - .margin({left:'29lpx', top:'46lpx'}) | 85 | + .margin({ left: '29lpx', top: '46lpx' }) |
| 86 | // .backgroundColor(Color.Orange) | 86 | // .backgroundColor(Color.Orange) |
| 87 | Text(this.privacyTips) | 87 | Text(this.privacyTips) |
| 88 | .fontSize('25lpx') | 88 | .fontSize('25lpx') |
| 89 | .textAlign(TextAlign.Start) | 89 | .textAlign(TextAlign.Start) |
| 90 | .fontColor('#ED2800') | 90 | .fontColor('#ED2800') |
| 91 | - .margin({top:'46lpx'}) | ||
| 92 | - .onClick(()=>{ | 91 | + .margin({ top: '46lpx' }) |
| 92 | + .onClick(() => { | ||
| 93 | //跳转隐私政策 | 93 | //跳转隐私政策 |
| 94 | }) | 94 | }) |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | - | ||
| 98 | } | 97 | } |
| 99 | .width('100%') | 98 | .width('100%') |
| 100 | .height('100%') | 99 | .height('100%') |
| @@ -141,9 +140,10 @@ struct getArrowCell { | @@ -141,9 +140,10 @@ struct getArrowCell { | ||
| 141 | } | 140 | } |
| 142 | 141 | ||
| 143 | @Component | 142 | @Component |
| 144 | -struct getTuiJianCell{ | ||
| 145 | - @ObjectLink item :PrivacySettingModel; | 143 | +struct getTuiJianCell { |
| 144 | + @ObjectLink item: PrivacySettingModel; | ||
| 146 | index; | 145 | index; |
| 146 | + | ||
| 147 | build() { | 147 | build() { |
| 148 | //@Builder getTuiJianCell(item:PrivacySettingModel, index) | 148 | //@Builder getTuiJianCell(item:PrivacySettingModel, index) |
| 149 | Column() { | 149 | Column() { |
| 1 | import MinePageMoreFunctionModel from '../../../viewmodel/MinePageMoreFunctionModel' | 1 | import MinePageMoreFunctionModel from '../../../viewmodel/MinePageMoreFunctionModel' |
| 2 | import RouteManager from '../../../utils/RouteManager' | 2 | import RouteManager from '../../../utils/RouteManager' |
| 3 | +import router from '@ohos.router' | ||
| 3 | 4 | ||
| 4 | @Component | 5 | @Component |
| 5 | export default struct MinePageMoreFunctionUI{ | 6 | export default struct MinePageMoreFunctionUI{ |
| @@ -66,18 +67,14 @@ export default struct MinePageMoreFunctionUI{ | @@ -66,18 +67,14 @@ export default struct MinePageMoreFunctionUI{ | ||
| 66 | .onClick(()=>{ | 67 | .onClick(()=>{ |
| 67 | console.log(index+"") | 68 | console.log(index+"") |
| 68 | if (index == 3) { | 69 | if (index == 3) { |
| 69 | - RouteManager.jumpNewPage("pages/SettingPage") | 70 | + router.pushUrl({ |
| 71 | + url:"pages/SettingPage", | ||
| 72 | + params : {'pageType' : 'mainSetting'} | ||
| 73 | + }) | ||
| 70 | } else if (index == 2) { | 74 | } else if (index == 2) { |
| 71 | - RouteManager.jumpNewPage("pages/PrivacySettingPage") | 75 | + // RouteManager.jumpNewPage("pages/PrivacySettingPage") |
| 72 | } else if (index == 4) { | 76 | } else if (index == 4) { |
| 73 | RouteManager.jumpNewPage("pages/SettingAboutPage") | 77 | RouteManager.jumpNewPage("pages/SettingAboutPage") |
| 74 | - }else { | ||
| 75 | - // 在Home页面中 | ||
| 76 | - let paramsInfo: object = { | ||
| 77 | - pageId: 123, | ||
| 78 | - pageType:'mainSetting' | ||
| 79 | - }; | ||
| 80 | - RouteManager.jumpNewPage("pages/PrivacySettingPage",paramsInfo) | ||
| 81 | } | 78 | } |
| 82 | 79 | ||
| 83 | }) | 80 | }) |
| 1 | 1 | ||
| 2 | -import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem' | ||
| 3 | -import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' | ||
| 4 | -import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | ||
| 5 | -import { HttpUrlUtils } from '../network/HttpUrlUtils'; | 2 | +import MinePagePersonalFunctionsItem from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePagePersonalFunctionsItem' |
| 3 | +import MinePageCreatorFunctionsItem from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePageCreatorFunctionsItem' | ||
| 4 | +import MinePageMoreFunctionModel from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MinePageMoreFunctionModel'; | ||
| 5 | +import { HttpUrlUtils } from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/network/HttpUrlUtils'; | ||
| 6 | import HashMap from '@ohos.util.HashMap'; | 6 | import HashMap from '@ohos.util.HashMap'; |
| 7 | import { ResponseDTO, WDHttp } from 'wdNetwork'; | 7 | import { ResponseDTO, WDHttp } from 'wdNetwork'; |
| 8 | import { Logger } from 'wdKit'; | 8 | import { Logger } from 'wdKit'; |
| 9 | -import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem' | 9 | +import { MineMainSettingFunctionItem } from '../../../../../../../../PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MineMainSettingFunctionItem' |
| 10 | 10 | ||
| 11 | const TAG = "MineSettingDatasModel" | 11 | const TAG = "MineSettingDatasModel" |
| 12 | 12 | ||
| @@ -68,10 +68,10 @@ class MineSettingDatasModel{ | @@ -68,10 +68,10 @@ class MineSettingDatasModel{ | ||
| 68 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false)) | 68 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false)) |
| 69 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false)) | 69 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false)) |
| 70 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | 70 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) |
| 71 | - this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.mine_order_icon'), '绑定QQ', '立即绑定', 0, false)) | ||
| 72 | - this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.mine_order_icon'), '绑定微信', '立即绑定', 0, false)) | ||
| 73 | - this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.mine_order_icon'), '绑定新浪微博', '立即绑定', 0, false)) | ||
| 74 | - this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, 'Apple ID', null, 0, false)) | 71 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_qqicon'), '绑定QQ', '立即绑定', 0, false)) |
| 72 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_wechaticon'), '绑定微信', '立即绑定', 0, false)) | ||
| 73 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_weiboicon'), '绑定新浪微博', '立即绑定', 0, false)) | ||
| 74 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_appleicon'), 'Apple ID', null, 0, false)) | ||
| 75 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | 75 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) |
| 76 | 76 | ||
| 77 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false)) | 77 | this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false)) |
1.87 KB
2.53 KB
3.23 KB
| @@ -5,13 +5,13 @@ | @@ -5,13 +5,13 @@ | ||
| 5 | "name": "default", | 5 | "name": "default", |
| 6 | "type": "HarmonyOS", | 6 | "type": "HarmonyOS", |
| 7 | "material": { | 7 | "material": { |
| 8 | - "certpath": "C:\\Users\\PC\\.ohos\\config\\default_sight_harmony_vDjosN2opayZneQDLiBs3Lc0sT1uPzRAYaDxxv2LWEQ=.cer", | ||
| 9 | - "storePassword": "0000001A87430EDC6C0D1CD6A6473A6D385177DBFF70325BBD48C7E491A0D9B37F91920FD46D82B2436B", | 8 | + "certpath": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.cer", |
| 9 | + "storePassword": "0000001AD1ABE6FB1D5AEC538066BBDCACCDF8DFB85BA89D4A7B163112F48FDFAD37222DD5D2FBC6738C", | ||
| 10 | "keyAlias": "debugKey", | 10 | "keyAlias": "debugKey", |
| 11 | - "keyPassword": "0000001A8E615E1CB276AA122C291AFBCDFF792FEE8AA618B186EE7C99220C7F549B8C2ED6A209703D75", | ||
| 12 | - "profile": "C:\\Users\\PC\\.ohos\\config\\default_sight_harmony_vDjosN2opayZneQDLiBs3Lc0sT1uPzRAYaDxxv2LWEQ=.p7b", | 11 | + "keyPassword": "0000001AA4301CF4CB6CD92BFD749A3C09BC771B02A1E544A47EBBC557DB27E8150CB2AB5CB13029999D", |
| 12 | + "profile": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.p7b", | ||
| 13 | "signAlg": "SHA256withECDSA", | 13 | "signAlg": "SHA256withECDSA", |
| 14 | - "storeFile": "C:\\Users\\PC\\.ohos\\config\\default_sight_harmony_vDjosN2opayZneQDLiBs3Lc0sT1uPzRAYaDxxv2LWEQ=.p12" | 14 | + "storeFile": "/Users/ysy/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_30086000745972390.p12" |
| 15 | } | 15 | } |
| 16 | } | 16 | } |
| 17 | ], | 17 | ], |
| @@ -29,3 +29,5 @@ export { DeviceUtil } from './src/main/ets/utils/DeviceUtil' | @@ -29,3 +29,5 @@ export { DeviceUtil } from './src/main/ets/utils/DeviceUtil' | ||
| 29 | export { DisplayUtils } from './src/main/ets/utils/DisplayUtils' | 29 | export { DisplayUtils } from './src/main/ets/utils/DisplayUtils' |
| 30 | 30 | ||
| 31 | export { SystemUtils } from './src/main/ets/utils/SystemUtils' | 31 | export { SystemUtils } from './src/main/ets/utils/SystemUtils' |
| 32 | + | ||
| 33 | +export { PermissionUtil } from './src/main/ets/utils/PermissionUtil' |
| 1 | +import bundleManager from '@ohos.bundle.bundleManager'; | ||
| 2 | +import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; | ||
| 3 | +import common from '@ohos.app.ability.common'; | ||
| 4 | +import featureAbility from '@ohos.ability.featureAbility'; | ||
| 5 | +import wantConstant from '@ohos.ability.wantConstant'; | ||
| 6 | + | ||
| 7 | +export class PermissionUtil { | ||
| 8 | + async checkAccessToken(permission: Permissions): Promise<abilityAccessCtrl.GrantStatus> { | ||
| 9 | + let atManager = abilityAccessCtrl.createAtManager(); | ||
| 10 | + let grantStatus: abilityAccessCtrl.GrantStatus = abilityAccessCtrl.GrantStatus.PERMISSION_DENIED; | ||
| 11 | + | ||
| 12 | + // 获取应用程序的accessTokenID | ||
| 13 | + let tokenId: number = 0; | ||
| 14 | + try { | ||
| 15 | + let bundleInfo: bundleManager.BundleInfo = await bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); | ||
| 16 | + let appInfo: bundleManager.ApplicationInfo = bundleInfo.appInfo; | ||
| 17 | + tokenId = appInfo.accessTokenId; | ||
| 18 | + } catch (err) { | ||
| 19 | + console.error(`getBundleInfoForSelf failed, code is ${err.code}, message is ${err.message}`); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + // 校验应用是否被授予权限 | ||
| 23 | + try { | ||
| 24 | + grantStatus = await atManager.checkAccessToken(tokenId, permission); | ||
| 25 | + } catch (err) { | ||
| 26 | + console.error(`checkAccessToken failed, code is ${err.code}, message is ${err.message}`); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + return grantStatus; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + async checkPermissions(permission: Permissions): Promise<boolean> { | ||
| 33 | + let hasPermissions = false; | ||
| 34 | + let grantStatus: abilityAccessCtrl.GrantStatus = await this.checkAccessToken(permission); | ||
| 35 | + | ||
| 36 | + if (grantStatus === abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) { | ||
| 37 | + // 已经授权,可以继续访问目标操作 | ||
| 38 | + hasPermissions = true; | ||
| 39 | + } else { | ||
| 40 | + hasPermissions = false; | ||
| 41 | + // 申请日历权限 | ||
| 42 | + } | ||
| 43 | + return hasPermissions; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + static reqPermissionsFromUser(permissions: Array<Permissions>): void { | ||
| 47 | + // let context = getContext(this) as common.UIAbilityContext; | ||
| 48 | + // let atManager = abilityAccessCtrl.createAtManager(); | ||
| 49 | + // // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 | ||
| 50 | + // atManager.requestPermissionsFromUser(context, permissions).then((data) => { | ||
| 51 | + // let grantStatus: Array<number> = data.authResults; | ||
| 52 | + // let length: number = grantStatus.length; | ||
| 53 | + // for (let i = 0; i < length; i++) { | ||
| 54 | + // if (grantStatus[i] === 0) { | ||
| 55 | + // // 用户授权,可以继续访问目标操作 | ||
| 56 | + // | ||
| 57 | + // } else { | ||
| 58 | + // | ||
| 59 | + // this.jumpSetting(); | ||
| 60 | + // // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限 | ||
| 61 | + // AlertDialog.show({ | ||
| 62 | + // title: '权限设置', | ||
| 63 | + // message: '到系统设置中打开相应的权限', | ||
| 64 | + // confirm: { | ||
| 65 | + // value: "OK", | ||
| 66 | + // action: () => { | ||
| 67 | + // | ||
| 68 | + // }, | ||
| 69 | + // } | ||
| 70 | + // }) | ||
| 71 | + // return; | ||
| 72 | + // } | ||
| 73 | + // } | ||
| 74 | + // // 授权成功 | ||
| 75 | + // }).catch((err) => { | ||
| 76 | + // console.error(`requestPermissionsFromUser failed, code is ${err.code}, message is ${err.message}`); | ||
| 77 | + // }) | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + static jumpSetting() { | ||
| 82 | + | ||
| 83 | + } | ||
| 84 | +} |
| @@ -81,6 +81,11 @@ export class HttpUrlUtils { | @@ -81,6 +81,11 @@ export class HttpUrlUtils { | ||
| 81 | * 我的收藏 | 81 | * 我的收藏 |
| 82 | */ | 82 | */ |
| 83 | static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-interact/content/zh/c/interact"; | 83 | static readonly APPOINTMENT_MyCollectionList_PATH: string = "/api/rmrb-interact/content/zh/c/interact"; |
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * 个人中心 我的评论列表 | ||
| 87 | + */ | ||
| 88 | + static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList"; | ||
| 84 | /** | 89 | /** |
| 85 | * 早晚报列表 | 90 | * 早晚报列表 |
| 86 | * 根据页面id获取页面楼层列表 | 91 | * 根据页面id获取页面楼层列表 |
| @@ -305,6 +310,11 @@ export class HttpUrlUtils { | @@ -305,6 +310,11 @@ export class HttpUrlUtils { | ||
| 305 | return url | 310 | return url |
| 306 | } | 311 | } |
| 307 | 312 | ||
| 313 | + static getMineCommentListDataUrl() { | ||
| 314 | + let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH | ||
| 315 | + return url | ||
| 316 | + } | ||
| 317 | + | ||
| 308 | static getYcgCommonHeaders(): HashMap<string, string> { | 318 | static getYcgCommonHeaders(): HashMap<string, string> { |
| 309 | let headers: HashMap<string, string> = new HashMap<string, string>() | 319 | let headers: HashMap<string, string> = new HashMap<string, string>() |
| 310 | 320 |
| @@ -54,6 +54,8 @@ export function registerRouter() { | @@ -54,6 +54,8 @@ export function registerRouter() { | ||
| 54 | // } | 54 | // } |
| 55 | if (action.params?.detailPageType == 7 || action.params?.detailPageType == 8) { | 55 | if (action.params?.detailPageType == 7 || action.params?.detailPageType == 8) { |
| 56 | return WDRouterPage.detailPlayShortVideoPage | 56 | return WDRouterPage.detailPlayShortVideoPage |
| 57 | + } else if (action.params?.detailPageType == 9 ) { | ||
| 58 | + return WDRouterPage.multiPictureDetailPage | ||
| 57 | } | 59 | } |
| 58 | return WDRouterPage.detailPlayVodPage | 60 | return WDRouterPage.detailPlayVodPage |
| 59 | }) | 61 | }) |
| @@ -32,6 +32,8 @@ export class WDRouterPage { | @@ -32,6 +32,8 @@ export class WDRouterPage { | ||
| 32 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); | 32 | static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); |
| 33 | // 直播详情页 | 33 | // 直播详情页 |
| 34 | static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); | 34 | static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); |
| 35 | + // 多图(图集)详情页 | ||
| 36 | + static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); | ||
| 35 | 37 | ||
| 36 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); | 38 | static loginPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginPage"); |
| 37 | 39 | ||
| @@ -51,4 +53,16 @@ export class WDRouterPage { | @@ -51,4 +53,16 @@ export class WDRouterPage { | ||
| 51 | //我的收藏 | 53 | //我的收藏 |
| 52 | static myCollectionListPagePage = new WDRouterPage("wdComponent", "ets/components/page/MyCollectionListPage"); | 54 | static myCollectionListPagePage = new WDRouterPage("wdComponent", "ets/components/page/MyCollectionListPage"); |
| 53 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | 55 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); |
| 56 | + //我的主页 | ||
| 57 | + static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage"); | ||
| 58 | + // 隐私设置页 | ||
| 59 | + static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); | ||
| 60 | + // 关于页 | ||
| 61 | + static aboutPage = new WDRouterPage("wdComponent", "ets/components/page/SettingAboutPage"); | ||
| 62 | + // 设置页 | ||
| 63 | + static settingPage = new WDRouterPage("wdComponent", "ets/components/page/SettingPage"); | ||
| 64 | + // 账户与安全页 | ||
| 65 | + // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | ||
| 66 | + // 设置密码页、设置手机号页等等 (需要传参) | ||
| 67 | + // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | ||
| 54 | } | 68 | } |
| 1 | -import { CompDTO } from 'wdBean'; | 1 | +import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 3 | import { BannerComponent } from './view/BannerComponent'; | 3 | import { BannerComponent } from './view/BannerComponent'; |
| 4 | import { LabelComponent } from './view/LabelComponent'; | 4 | import { LabelComponent } from './view/LabelComponent'; |
| @@ -16,14 +16,78 @@ import { | @@ -16,14 +16,78 @@ import { | ||
| 16 | import { | 16 | import { |
| 17 | HorizontalStrokeCardThreeTwoRadioForOneComponent | 17 | HorizontalStrokeCardThreeTwoRadioForOneComponent |
| 18 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; | 18 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; |
| 19 | +import { | ||
| 20 | + HorizontalStrokeCardThreeTwoRadioForTwoComponent | ||
| 21 | +} from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent'; | ||
| 19 | import { AlbumCardComponent } from './view/AlbumCardComponent'; | 22 | import { AlbumCardComponent } from './view/AlbumCardComponent'; |
| 20 | 23 | ||
| 21 | /** | 24 | /** |
| 22 | * comp适配器. | 25 | * comp适配器. |
| 23 | */ | 26 | */ |
| 27 | +@Preview | ||
| 24 | @Component | 28 | @Component |
| 25 | export struct CompParser { | 29 | export struct CompParser { |
| 26 | - compDTO: CompDTO = {} as CompDTO; | 30 | + @State compDTO: CompDTO = { |
| 31 | + compStyle: '17', | ||
| 32 | + imageScale: 3, | ||
| 33 | + operDataList: [ | ||
| 34 | + { | ||
| 35 | + title: 'title0', | ||
| 36 | + description: "description0", | ||
| 37 | + coverUrl: 'https://uatjdcdnphoto.aikan.pdnews' + | ||
| 38 | + '.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg', | ||
| 39 | + fullColumnImgUrls: [{ | ||
| 40 | + url: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240104/image/display/c4a9b526e0994d1bbd3ac8450f5cfc6c.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 41 | + },{ | ||
| 42 | + url:'https://uatjdcdnphoto.aikan.pdnews' + | ||
| 43 | + '.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg', | ||
| 44 | + },{ | ||
| 45 | + url: 'https://uatjdcdnphoto.aikan.pdnews' + | ||
| 46 | + '.cn/sjbj-20231208/image/display/d4496925a1264a749975ae9b01a4ef46.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg', | ||
| 47 | + }] | ||
| 48 | + } as ContentDTO, | ||
| 49 | + { | ||
| 50 | + title: 'title1 title1 title1 title1 title1 title1 title1 title1 title1', | ||
| 51 | + description: "description1", | ||
| 52 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240104/image/display/c4a9b526e0994d1bbd3ac8450f5cfc6c.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 53 | + } as ContentDTO, | ||
| 54 | + { | ||
| 55 | + title: 'title2', | ||
| 56 | + description: "description2", | ||
| 57 | + coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231206/image/live/bbe6d821e92b48919d90c7dadfd1f05a.jpg?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg", | ||
| 58 | + } as ContentDTO, | ||
| 59 | + { | ||
| 60 | + title: 'title3', | ||
| 61 | + description: "description3", | ||
| 62 | + coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/sjbj-20231109/image/live/102e6eb9356b4ef19405b04c1f6ff875.png?x-oss-process=image/resize,l_850/auto-orient,1/quality,q_95/format,jpg' | ||
| 63 | + } as ContentDTO, | ||
| 64 | + { | ||
| 65 | + title: 'title4', | ||
| 66 | + description: "description4", | ||
| 67 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/62bdbbb35dbd45689e00790c81f04c4b.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 68 | + } as ContentDTO, | ||
| 69 | + { | ||
| 70 | + title: 'title5', | ||
| 71 | + description: "description5", | ||
| 72 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/f79bbaa5a33b4bd88176071c4f797ff6.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 73 | + } as ContentDTO, | ||
| 74 | + { | ||
| 75 | + title: 'title6', | ||
| 76 | + description: "description6", | ||
| 77 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231218/image/display/2c1d917009584ce2bb4a35cbb3a860a0.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 78 | + } as ContentDTO, | ||
| 79 | + { | ||
| 80 | + title: 'title7', | ||
| 81 | + description: "description7", | ||
| 82 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231222/image/display/117dc516ca5c42d5843c0d32050c9fc6.jpeg?x-oss-process=image/resize,w_240/quality,q_90/format,jpg", | ||
| 83 | + } as ContentDTO, | ||
| 84 | + { | ||
| 85 | + title: 'title8', | ||
| 86 | + description: "description8", | ||
| 87 | + coverUrl: "https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20231228/image/display/90a2db4077d44a1f887f068fc659d977.jpeg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 88 | + } as ContentDTO | ||
| 89 | + ] | ||
| 90 | + } as CompDTO | ||
| 27 | compIndex: number = 0; | 91 | compIndex: number = 0; |
| 28 | 92 | ||
| 29 | build() { | 93 | build() { |
| 1 | import { NewspaperListBean, NewspaperListItemBean } from 'wdBean'; | 1 | import { NewspaperListBean, NewspaperListItemBean } from 'wdBean'; |
| 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; | 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | -import { Logger } from 'wdKit'; | ||
| 5 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; | 4 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; |
| 6 | import { ENewspaperListDialog } from '../dialog/ENewspaperListDialog'; | 5 | import { ENewspaperListDialog } from '../dialog/ENewspaperListDialog'; |
| 7 | import display from '@ohos.display'; | 6 | import display from '@ohos.display'; |
| 8 | import { ENewspaperCalendarDialog } from '../dialog/ENewspaperCalendarDialog'; | 7 | import { ENewspaperCalendarDialog } from '../dialog/ENewspaperCalendarDialog'; |
| 9 | import font from '@ohos.font'; | 8 | import font from '@ohos.font'; |
| 9 | +import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | ||
| 10 | +import { RMCalendarBean } from './calendar/RMCalendarBean'; | ||
| 10 | 11 | ||
| 11 | @Component | 12 | @Component |
| 12 | export struct ENewspaperPageComponent { | 13 | export struct ENewspaperPageComponent { |
| 13 | - @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean | ||
| 14 | - @State currentPageNum: string = '01' | ||
| 15 | - @State pageNumPopup: boolean = false | ||
| 16 | - @State calendarPopup: boolean = false | ||
| 17 | - @State calendarDateTitle: string = '' | 14 | + private displayTool = display.getDefaultDisplaySync() |
| 15 | + private screenWidth: number = 0 | ||
| 16 | + private picWidth: number = 0 | ||
| 18 | @State picHeight: number = 0 | 17 | @State picHeight: number = 0 |
| 18 | + @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean | ||
| 19 | + @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' | ||
| 20 | + @State pageDialogShow: boolean = false | ||
| 21 | + @State calendarDialogShow: boolean = false | ||
| 22 | + @State calendarDate: string = '' | ||
| 19 | private swiperController: SwiperController = new SwiperController() | 23 | private swiperController: SwiperController = new SwiperController() |
| 24 | + @State swiperIndex: number = 0; | ||
| 25 | + | ||
| 26 | + //watch监听报纸页码回调 | ||
| 27 | + onCurrentPageNumUpdated(): void { | ||
| 28 | + console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | ||
| 29 | + let _swiperIndex = Number.parseInt(this.currentPageNum) | ||
| 30 | + console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex) | ||
| 31 | + this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + //日历选择弹框 | ||
| 20 | calendarDialogController: CustomDialogController = new CustomDialogController({ | 35 | calendarDialogController: CustomDialogController = new CustomDialogController({ |
| 21 | - builder: ENewspaperCalendarDialog(), | 36 | + builder: ENewspaperCalendarDialog({ |
| 37 | + onDateChange: (date: RMCalendarBean) => { | ||
| 38 | + console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date)) | ||
| 39 | + if (date.fullYear && date.month && date.date) { | ||
| 40 | + this.calendarDate = `${date.fullYear}-${date.month > 9 ? date.month + 1 : '0' + (date.month + 1)}-${date.date > 9 ? date.date : '0' + date.date}` | ||
| 41 | + this.getNewspaperTime() | ||
| 42 | + this.getNewspaperList() | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + }), | ||
| 22 | alignment: DialogAlignment.Top, | 46 | alignment: DialogAlignment.Top, |
| 23 | offset: { dx: 0, dy: 80 }, | 47 | offset: { dx: 0, dy: 80 }, |
| 24 | customStyle: true, | 48 | customStyle: true, |
| 25 | - // cornerRadius: 4 | ||
| 26 | }) | 49 | }) |
| 50 | + //图片版选择弹框 | ||
| 51 | + pageDialogController: CustomDialogController = new CustomDialogController({ | ||
| 52 | + builder: ENewspaperPageDialog({ | ||
| 53 | + dialogType: 0, | ||
| 54 | + newspaperListBean: this.newspaperListBean, | ||
| 55 | + }), | ||
| 56 | + alignment: DialogAlignment.BottomStart, | ||
| 57 | + offset: { dx: 0, dy: -90 }, | ||
| 58 | + customStyle: true, | ||
| 59 | + }) | ||
| 60 | + //文字报纸弹框 | ||
| 27 | listDialogController: CustomDialogController = new CustomDialogController({ | 61 | listDialogController: CustomDialogController = new CustomDialogController({ |
| 28 | - builder: ENewspaperListDialog({ newspaperListBean: this.newspaperListBean, | ||
| 29 | - currentPageNum: this.currentPageNum, | 62 | + builder: ENewspaperListDialog({ |
| 63 | + newspaperListBean: this.newspaperListBean | ||
| 30 | }), | 64 | }), |
| 31 | - alignment: DialogAlignment.Bottom | 65 | + alignment: DialogAlignment.Bottom, |
| 66 | + offset: { dx: 0, dy: 0 } | ||
| 32 | }) | 67 | }) |
| 33 | 68 | ||
| 34 | - @Builder | ||
| 35 | - popupBuilder() { | ||
| 36 | - Row() { | ||
| 37 | - GridRow({ columns: 5 }) { | ||
| 38 | - ForEach(this.newspaperListBean.list, (item: NewspaperListItemBean, index) => { | ||
| 39 | - GridCol() { | ||
| 40 | - Row() { | ||
| 41 | - Text(item.pageNum) | ||
| 42 | - .fontSize($r('app.float.normal_text_size')) | ||
| 43 | - .fontColor(this.currentPageNum == item.pageNum ? Color.White : $r('app.color.color_222222')) | ||
| 44 | - } | ||
| 45 | - .alignItems(VerticalAlign.Center) | ||
| 46 | - .justifyContent(FlexAlign.Center) | ||
| 47 | - .width(30) | ||
| 48 | - .height(30) | ||
| 49 | - .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800')) | ||
| 50 | - .onClick((event: ClickEvent) => { | ||
| 51 | - this.pageNumPopup = !this.pageNumPopup | ||
| 52 | - }) | ||
| 53 | - } | ||
| 54 | - }) | ||
| 55 | - } | ||
| 56 | - } | ||
| 57 | - .padding({ top: 20, bottom: 20 }) | ||
| 58 | - .margin({ left: 10 }) | ||
| 59 | - .width(260) | 69 | + async aboutToAppear() { |
| 70 | + //获取宽高尺寸 | ||
| 71 | + this.screenWidth = this.displayTool.width | ||
| 72 | + this.picWidth = this.screenWidth - vp2px(52) | ||
| 73 | + this.picHeight = this.picWidth * 566 / 378 | ||
| 74 | + //注册字体 | ||
| 75 | + font.registerFont({ | ||
| 76 | + familyName: 'BebasNeue_Regular', | ||
| 77 | + familySrc: $rawfile('font/BebasNeue_Regular.otf') | ||
| 78 | + }) | ||
| 79 | + this.getNewspaperTime() | ||
| 80 | + this.getNewspaperList() | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + aboutToDisappear() { | ||
| 84 | + // if (this.calendarDialogController) { | ||
| 85 | + // this.calendarDialogController = null | ||
| 86 | + // } | ||
| 87 | + // if (this.listDialogController) { | ||
| 88 | + // this.listDialogController = null | ||
| 89 | + // } | ||
| 60 | } | 90 | } |
| 61 | 91 | ||
| 62 | build() { | 92 | build() { |
| @@ -65,19 +95,21 @@ export struct ENewspaperPageComponent { | @@ -65,19 +95,21 @@ export struct ENewspaperPageComponent { | ||
| 65 | Image($r('app.media.icon_arrow_down')) | 95 | Image($r('app.media.icon_arrow_down')) |
| 66 | .height($r('app.float.top_arrow_size')) | 96 | .height($r('app.float.top_arrow_size')) |
| 67 | .width($r('app.float.top_arrow_size')) | 97 | .width($r('app.float.top_arrow_size')) |
| 68 | - .alignRules({ left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 69 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 98 | + .alignRules({ |
| 99 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 100 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 101 | + }) | ||
| 70 | .id('e_newspaper_back') | 102 | .id('e_newspaper_back') |
| 71 | .onClick((event: ClickEvent) => { | 103 | .onClick((event: ClickEvent) => { |
| 72 | - Logger.info("sfsfsd", "" + vp2px(10)) | ||
| 73 | router.back() | 104 | router.back() |
| 74 | }) | 105 | }) |
| 75 | 106 | ||
| 76 | Row() { | 107 | Row() { |
| 77 | - Text(this.calendarDateTitle) | 108 | + Text(this.calendarDate) |
| 78 | .fontSize($r('app.float.font_size_20')) | 109 | .fontSize($r('app.float.font_size_20')) |
| 79 | .fontColor($r('app.color.white')) | 110 | .fontColor($r('app.color.white')) |
| 80 | .fontFamily('BebasNeue_Regular') | 111 | .fontFamily('BebasNeue_Regular') |
| 112 | + .fontWeight(FontWeight.Bold) | ||
| 81 | 113 | ||
| 82 | Image($r('app.media.icon_triangle')) | 114 | Image($r('app.media.icon_triangle')) |
| 83 | .width($r('app.float.border_radius_6')) | 115 | .width($r('app.float.border_radius_6')) |
| @@ -85,12 +117,14 @@ export struct ENewspaperPageComponent { | @@ -85,12 +117,14 @@ export struct ENewspaperPageComponent { | ||
| 85 | .margin({ left: 2, bottom: 5 }) | 117 | .margin({ left: 2, bottom: 5 }) |
| 86 | } | 118 | } |
| 87 | .alignItems(VerticalAlign.Bottom) | 119 | .alignItems(VerticalAlign.Bottom) |
| 88 | - .alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center }, | ||
| 89 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 120 | + .alignRules({ |
| 121 | + middle: { anchor: "__container__", align: HorizontalAlign.Center }, | ||
| 122 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 123 | + }) | ||
| 90 | .id('e_newspaper_date') | 124 | .id('e_newspaper_date') |
| 91 | .onClick(() => { | 125 | .onClick(() => { |
| 92 | - this.calendarPopup = !this.calendarPopup | ||
| 93 | - if (this.calendarPopup) { | 126 | + this.calendarDialogShow = !this.calendarDialogShow |
| 127 | + if (this.calendarDialogShow) { | ||
| 94 | this.calendarDialogController.open() | 128 | this.calendarDialogController.open() |
| 95 | } else { | 129 | } else { |
| 96 | this.calendarDialogController.close() | 130 | this.calendarDialogController.close() |
| @@ -100,15 +134,19 @@ export struct ENewspaperPageComponent { | @@ -100,15 +134,19 @@ export struct ENewspaperPageComponent { | ||
| 100 | Image($r('app.media.icon_share')) | 134 | Image($r('app.media.icon_share')) |
| 101 | .height($r('app.float.top_arrow_size')) | 135 | .height($r('app.float.top_arrow_size')) |
| 102 | .width($r('app.float.top_arrow_size')) | 136 | .width($r('app.float.top_arrow_size')) |
| 103 | - .alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 104 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 137 | + .alignRules({ |
| 138 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 139 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 140 | + }) | ||
| 105 | .id('e_newspaper_share') | 141 | .id('e_newspaper_share') |
| 106 | } | 142 | } |
| 107 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 143 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 108 | .height($r('app.float.top_bar_height')) | 144 | .height($r('app.float.top_bar_height')) |
| 109 | - .alignRules({ top: { anchor: '__container__', align: VerticalAlign.Top }, | 145 | + .alignRules({ |
| 146 | + top: { anchor: '__container__', align: VerticalAlign.Top }, | ||
| 110 | left: { anchor: '__container__', align: HorizontalAlign.Start }, | 147 | left: { anchor: '__container__', align: HorizontalAlign.Start }, |
| 111 | - right: { anchor: '__container__', align: HorizontalAlign.End } }) | 148 | + right: { anchor: '__container__', align: HorizontalAlign.End } |
| 149 | + }) | ||
| 112 | .id('e_newspaper_top') | 150 | .id('e_newspaper_top') |
| 113 | 151 | ||
| 114 | if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 152 | if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| @@ -117,6 +155,7 @@ export struct ENewspaperPageComponent { | @@ -117,6 +155,7 @@ export struct ENewspaperPageComponent { | ||
| 117 | ENewspaperItemComponent({ newspaperListItemBean: item }) | 155 | ENewspaperItemComponent({ newspaperListItemBean: item }) |
| 118 | }) | 156 | }) |
| 119 | } | 157 | } |
| 158 | + .index(this.swiperIndex) | ||
| 120 | .width('100%') | 159 | .width('100%') |
| 121 | .height(px2vp(this.picHeight) + 32) | 160 | .height(px2vp(this.picHeight) + 32) |
| 122 | .vertical(true) | 161 | .vertical(true) |
| @@ -126,19 +165,24 @@ export struct ENewspaperPageComponent { | @@ -126,19 +165,24 @@ export struct ENewspaperPageComponent { | ||
| 126 | .displayCount(1) | 165 | .displayCount(1) |
| 127 | .margin({ top: 35, left: 10, right: 10 }) | 166 | .margin({ top: 35, left: 10, right: 10 }) |
| 128 | .id('e_newspaper_content') | 167 | .id('e_newspaper_content') |
| 129 | - .alignRules({ top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 130 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } }) | 168 | + .alignRules({ |
| 169 | + top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 170 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 171 | + }) | ||
| 131 | .onChange((index: number) => { | 172 | .onChange((index: number) => { |
| 132 | this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum | 173 | this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum |
| 174 | + this.swiperIndex = index | ||
| 133 | }) | 175 | }) |
| 134 | 176 | ||
| 135 | Image($r('app.media.newspaper_shadow')) | 177 | Image($r('app.media.newspaper_shadow')) |
| 136 | .height($r('app.float.vp_12')) | 178 | .height($r('app.float.vp_12')) |
| 137 | .margin({ left: 20, right: 20, top: -1 }) | 179 | .margin({ left: 20, right: 20, top: -1 }) |
| 138 | .objectFit(ImageFit.Contain) | 180 | .objectFit(ImageFit.Contain) |
| 139 | - .alignRules({ top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | 181 | + .alignRules({ |
| 182 | + top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 140 | left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | 183 | left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, |
| 141 | - right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } }) | 184 | + right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } |
| 185 | + }) | ||
| 142 | .id('e_newspaper_shadow') | 186 | .id('e_newspaper_shadow') |
| 143 | 187 | ||
| 144 | Row() { | 188 | Row() { |
| @@ -151,8 +195,10 @@ export struct ENewspaperPageComponent { | @@ -151,8 +195,10 @@ export struct ENewspaperPageComponent { | ||
| 151 | } | 195 | } |
| 152 | .justifyContent(FlexAlign.Center) | 196 | .justifyContent(FlexAlign.Center) |
| 153 | .margin({ top: $r('app.float.margin_16') }) | 197 | .margin({ top: $r('app.float.margin_16') }) |
| 154 | - .alignRules({ top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 155 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } }) | 198 | + .alignRules({ |
| 199 | + top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 200 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 201 | + }) | ||
| 156 | .id('e_newspaper_next') | 202 | .id('e_newspaper_next') |
| 157 | .onClick((event: ClickEvent) => { | 203 | .onClick((event: ClickEvent) => { |
| 158 | this.swiperController.showNext() | 204 | this.swiperController.showNext() |
| @@ -163,6 +209,7 @@ export struct ENewspaperPageComponent { | @@ -163,6 +209,7 @@ export struct ENewspaperPageComponent { | ||
| 163 | Text(this.currentPageNum) | 209 | Text(this.currentPageNum) |
| 164 | .fontSize($r('app.float.font_size_36')) | 210 | .fontSize($r('app.float.font_size_36')) |
| 165 | .fontColor($r('app.color.white')) | 211 | .fontColor($r('app.color.white')) |
| 212 | + .fontFamily('BebasNeue_Regular') | ||
| 166 | Text('版') | 213 | Text('版') |
| 167 | .fontSize($r('app.float.font_size_16')) | 214 | .fontSize($r('app.float.font_size_16')) |
| 168 | .fontColor($r('app.color.white')) | 215 | .fontColor($r('app.color.white')) |
| @@ -175,18 +222,26 @@ export struct ENewspaperPageComponent { | @@ -175,18 +222,26 @@ export struct ENewspaperPageComponent { | ||
| 175 | } | 222 | } |
| 176 | .alignItems(VerticalAlign.Bottom) | 223 | .alignItems(VerticalAlign.Bottom) |
| 177 | .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | 224 | .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) |
| 178 | - .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 179 | - left: { anchor: '__container__', align: HorizontalAlign.Start } }) | 225 | + .alignRules({ |
| 226 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 227 | + left: { anchor: '__container__', align: HorizontalAlign.Start } | ||
| 228 | + }) | ||
| 180 | .id('e_newspaper_page_num') | 229 | .id('e_newspaper_page_num') |
| 181 | .onClick((event: ClickEvent) => { | 230 | .onClick((event: ClickEvent) => { |
| 182 | - this.pageNumPopup = !this.pageNumPopup | ||
| 183 | - }) | ||
| 184 | - .bindPopup(this.pageNumPopup, { | ||
| 185 | - builder: this.popupBuilder, | ||
| 186 | - placement: Placement.Top, | ||
| 187 | - popupColor: Color.White | 231 | + this.pageDialogShow = !this.pageDialogShow |
| 232 | + if (this.pageDialogShow) { | ||
| 233 | + this.pageDialogController.open() | ||
| 234 | + } else { | ||
| 235 | + this.pageDialogController.close() | ||
| 236 | + } | ||
| 188 | }) | 237 | }) |
| 189 | 238 | ||
| 239 | + // .bindPopup(this.pageNumPopup, { | ||
| 240 | + // builder: this.popupBuilder, | ||
| 241 | + // placement: Placement.Top, | ||
| 242 | + // popupColor: Color.White | ||
| 243 | + // }) | ||
| 244 | + | ||
| 190 | Row() { | 245 | Row() { |
| 191 | Image($r('app.media.icon_read_paper')) | 246 | Image($r('app.media.icon_read_paper')) |
| 192 | .width($r('app.float.vp_20')) | 247 | .width($r('app.float.vp_20')) |
| @@ -198,8 +253,10 @@ export struct ENewspaperPageComponent { | @@ -198,8 +253,10 @@ export struct ENewspaperPageComponent { | ||
| 198 | } | 253 | } |
| 199 | .alignItems(VerticalAlign.Center) | 254 | .alignItems(VerticalAlign.Center) |
| 200 | .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | 255 | .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) |
| 201 | - .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 202 | - right: { anchor: '__container__', align: HorizontalAlign.End } }) | 256 | + .alignRules({ |
| 257 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 258 | + right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 259 | + }) | ||
| 203 | .id('e_newspaper_read') | 260 | .id('e_newspaper_read') |
| 204 | .onClick((event: ClickEvent) => { | 261 | .onClick((event: ClickEvent) => { |
| 205 | this.listDialogController.open() | 262 | this.listDialogController.open() |
| @@ -211,23 +268,17 @@ export struct ENewspaperPageComponent { | @@ -211,23 +268,17 @@ export struct ENewspaperPageComponent { | ||
| 211 | .id('e_newspaper_container') | 268 | .id('e_newspaper_container') |
| 212 | } | 269 | } |
| 213 | 270 | ||
| 214 | - async aboutToAppear() { | ||
| 215 | - //注册字体 | ||
| 216 | - font.registerFont({ | ||
| 217 | - familyName: 'BebasNeue_Regular', | ||
| 218 | - // familySrc: '/font/roboto_medium_numbers.ttf' // font文件夹与pages目录同级 | ||
| 219 | - familySrc: $rawfile('font/BebasNeue_Regular.otf') | ||
| 220 | - }) | ||
| 221 | - let newspaperTimes = await NewspaperViewModel.getNewspaperTime() | 271 | + private async getNewspaperTime() { |
| 272 | + let newspaperTimes = await NewspaperViewModel.getNewspaperTime(this.calendarDate) | ||
| 222 | if (newspaperTimes && newspaperTimes.length > 0) { | 273 | if (newspaperTimes && newspaperTimes.length > 0) { |
| 223 | - this.calendarDateTitle = newspaperTimes[0].date | 274 | + this.calendarDate = newspaperTimes[0].date |
| 275 | + this.currentPageNum = '01' | ||
| 224 | } | 276 | } |
| 277 | + } | ||
| 278 | + | ||
| 279 | + private async getNewspaperList() { | ||
| 225 | try { | 280 | try { |
| 226 | - let displayTool = display.getDefaultDisplaySync() | ||
| 227 | - let screenWidth = displayTool.width | ||
| 228 | - let picWidth = screenWidth - vp2px(52) | ||
| 229 | - this.picHeight = picWidth * 566 / 378 | ||
| 230 | - let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDateTitle, picWidth + 'x' + this.picHeight) | 281 | + let listBean = await NewspaperViewModel.getNewspaperList(this.calendarDate, this.picWidth + 'x' + this.picHeight) |
| 231 | this.newspaperListBean = listBean; | 282 | this.newspaperListBean = listBean; |
| 232 | } catch (exception) { | 283 | } catch (exception) { |
| 233 | 284 |
| 1 | // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; | 1 | // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; |
| 2 | -import { PageInfoBean } from 'wdBean'; | 2 | +import { CompList, PageInfoBean } from 'wdBean'; |
| 3 | import { DateTimeUtils, Logger } from 'wdKit/Index'; | 3 | import { DateTimeUtils, Logger } from 'wdKit/Index'; |
| 4 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; | 4 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; |
| 5 | import { AudioBarView } from './AudioBarView'; | 5 | import { AudioBarView } from './AudioBarView'; |
| @@ -15,6 +15,9 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包 | @@ -15,6 +15,9 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包 | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct MorningEveningPaperComponent { | 16 | export struct MorningEveningPaperComponent { |
| 17 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean | 17 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean |
| 18 | + // @State compInfoBean: CompInfoBean = {} as CompInfoBean | ||
| 19 | + @State compListItem: CompList = {} as CompList | ||
| 20 | + // @Provide compListItem: CompList = {} as CompList | ||
| 18 | // @State morningEveningPaperDTO: MorningEveningPaperDTO = { | 21 | // @State morningEveningPaperDTO: MorningEveningPaperDTO = { |
| 19 | // name: "新闻夜读", | 22 | // name: "新闻夜读", |
| 20 | // topicInfo: { | 23 | // topicInfo: { |
| @@ -31,7 +34,8 @@ export struct MorningEveningPaperComponent { | @@ -31,7 +34,8 @@ export struct MorningEveningPaperComponent { | ||
| 31 | // topicId: "10000002068", | 34 | // topicId: "10000002068", |
| 32 | // } | 35 | // } |
| 33 | // } as MorningEveningPaperDTO | 36 | // } as MorningEveningPaperDTO |
| 34 | - @State subTitle: string = '' | 37 | + @Provide title: string = '' |
| 38 | + @Provide subTitle: string = '' | ||
| 35 | 39 | ||
| 36 | async aboutToAppear() { | 40 | async aboutToAppear() { |
| 37 | console.info(TAG, `aboutToAppear`) | 41 | console.info(TAG, `aboutToAppear`) |
| @@ -40,8 +44,9 @@ export struct MorningEveningPaperComponent { | @@ -40,8 +44,9 @@ export struct MorningEveningPaperComponent { | ||
| 40 | Logger.info(TAG, "currentTime = " + currentTime) | 44 | Logger.info(TAG, "currentTime = " + currentTime) |
| 41 | Logger.info(TAG, `currentTime = ${currentTime}`) | 45 | Logger.info(TAG, `currentTime = ${currentTime}`) |
| 42 | try { | 46 | try { |
| 43 | - let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927") | 47 | + let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28949") |
| 44 | this.pageInfoBean = pageInfoBean; | 48 | this.pageInfoBean = pageInfoBean; |
| 49 | + this.title = this.pageInfoBean?.topicInfo?.title | ||
| 45 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); | 50 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); |
| 46 | this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 51 | this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) |
| 47 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | 52 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) |
| @@ -50,7 +55,12 @@ export struct MorningEveningPaperComponent { | @@ -50,7 +55,12 @@ export struct MorningEveningPaperComponent { | ||
| 50 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 55 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 51 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 56 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 52 | 57 | ||
| 53 | - let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "") | 58 | + let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 59 | + // this.compInfoBean = compInfoBean | ||
| 60 | + if (compInfoBean?.compList[0]) { | ||
| 61 | + this.compListItem = compInfoBean?.compList[0] | ||
| 62 | + } | ||
| 63 | + | ||
| 54 | Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) | 64 | Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) |
| 55 | } catch (exception) { | 65 | } catch (exception) { |
| 56 | 66 | ||
| @@ -65,31 +75,33 @@ export struct MorningEveningPaperComponent { | @@ -65,31 +75,33 @@ export struct MorningEveningPaperComponent { | ||
| 65 | ListItem() { | 75 | ListItem() { |
| 66 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 76 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 67 | } | 77 | } |
| 68 | - } | ||
| 69 | 78 | ||
| 70 | - ListItem() { | ||
| 71 | - AudioBarView() | 79 | + ListItem() { |
| 80 | + AudioBarView() | ||
| 81 | + } | ||
| 72 | } | 82 | } |
| 73 | 83 | ||
| 74 | ListItem() { | 84 | ListItem() { |
| 75 | - SingleColumn999Component() | 85 | + SingleColumn999Component({ compListItem: this.compListItem }).margin({ top: $r('app.float.top_bar_height') }) |
| 76 | } | 86 | } |
| 77 | } | 87 | } |
| 78 | // .backgroundColor('#FFF1F3F5') | 88 | // .backgroundColor('#FFF1F3F5') |
| 79 | // .backgroundColor(Color.Blue) | 89 | // .backgroundColor(Color.Blue) |
| 80 | .height('100%') | 90 | .height('100%') |
| 81 | - .margin({ left: 14, right: 14 }) | ||
| 82 | 91 | ||
| 83 | - PaperTitleComponent({ | ||
| 84 | - // title: this.morningEveningPaperDTO?.topicInfo?.title ?? "", | ||
| 85 | - title: this.pageInfoBean?.topicInfo?.title ?? "", | ||
| 86 | - // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' | ||
| 87 | - subtitle: this.subTitle | ||
| 88 | - }) | 92 | + // .margin({ left: 12, right: 12 }) |
| 93 | + | ||
| 94 | + PaperTitleComponent()// PaperTitleComponent({ | ||
| 95 | + // // title: this.morningEveningPaperDTO?.topicInfo?.title ?? "", | ||
| 96 | + // title: this.title ?? "", | ||
| 97 | + // // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' | ||
| 98 | + // subtitle: this.subTitle | ||
| 99 | + // }) | ||
| 89 | .margin({ left: 14, right: 14 }) | 100 | .margin({ left: 14, right: 14 }) |
| 90 | } | 101 | } |
| 91 | .width('100%') | 102 | .width('100%') |
| 92 | // .backgroundColor('#000080') | 103 | // .backgroundColor('#000080') |
| 93 | - .backgroundColor(Color.Black) | 104 | + // .backgroundColor(Color.Black) |
| 105 | + .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | ||
| 94 | } | 106 | } |
| 95 | } | 107 | } |
| @@ -3,11 +3,11 @@ import router from '@ohos.router'; | @@ -3,11 +3,11 @@ import router from '@ohos.router'; | ||
| 3 | /** | 3 | /** |
| 4 | * 早晚报页面标题bar | 4 | * 早晚报页面标题bar |
| 5 | */ | 5 | */ |
| 6 | -@Entry | 6 | +// @Entry |
| 7 | @Component | 7 | @Component |
| 8 | export struct PaperTitleComponent { | 8 | export struct PaperTitleComponent { |
| 9 | - @State title?: string = 'title' | ||
| 10 | - @State subtitle?: string = 'subtitle' | 9 | + @Consume title?: string |
| 10 | + @Consume subTitle?: string | ||
| 11 | 11 | ||
| 12 | aboutToAppear() { | 12 | aboutToAppear() { |
| 13 | } | 13 | } |
| @@ -31,7 +31,7 @@ export struct PaperTitleComponent { | @@ -31,7 +31,7 @@ export struct PaperTitleComponent { | ||
| 31 | .fontColor($r('app.color.white')) | 31 | .fontColor($r('app.color.white')) |
| 32 | .maxLines(1) | 32 | .maxLines(1) |
| 33 | 33 | ||
| 34 | - Text(this.subtitle ?? '')// Text('2024年\n1月16日') | 34 | + Text(this.subTitle ?? '')// Text('2024年\n1月16日') |
| 35 | // .width(50) | 35 | // .width(50) |
| 36 | .margin({ left: 5 }) | 36 | .margin({ left: 5 }) |
| 37 | .fontSize(12) | 37 | .fontSize(12) |
| @@ -61,6 +61,7 @@ export struct PaperTitleComponent { | @@ -61,6 +61,7 @@ export struct PaperTitleComponent { | ||
| 61 | // console.info(TAG, "img_close") | 61 | // console.info(TAG, "img_close") |
| 62 | router.back() | 62 | router.back() |
| 63 | }) | 63 | }) |
| 64 | + .margin({ right: 16 }) | ||
| 64 | 65 | ||
| 65 | Image($r('app.media.icon_share')) | 66 | Image($r('app.media.icon_share')) |
| 66 | .height($r('app.float.top_arrow_size')) | 67 | .height($r('app.float.top_arrow_size')) |
| @@ -69,9 +70,11 @@ export struct PaperTitleComponent { | @@ -69,9 +70,11 @@ export struct PaperTitleComponent { | ||
| 69 | right: { anchor: "img_close", align: HorizontalAlign.Start }, | 70 | right: { anchor: "img_close", align: HorizontalAlign.Start }, |
| 70 | center: { anchor: "__container__", align: VerticalAlign.Center } }) | 71 | center: { anchor: "__container__", align: VerticalAlign.Center } }) |
| 71 | .id('img_share') | 72 | .id('img_share') |
| 73 | + .margin({ right: 13 }) | ||
| 72 | } | 74 | } |
| 73 | // .margin({ left: 14, right: 14 }) | 75 | // .margin({ left: 14, right: 14 }) |
| 74 | .height($r('app.float.top_bar_height')) | 76 | .height($r('app.float.top_bar_height')) |
| 75 | - .backgroundColor(Color.Black) | 77 | + |
| 78 | + // .backgroundColor(Color.Black) | ||
| 76 | } | 79 | } |
| 77 | } | 80 | } |
| 1 | -import { CompDTO, ContentDTO, VideoInfoDTO, } from 'wdBean'; | 1 | +import { CompList, ContentDTO } from 'wdBean'; |
| 2 | import { BreakpointConstants } from 'wdConstant'; | 2 | import { BreakpointConstants } from 'wdConstant'; |
| 3 | import { Logger } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { PaperSingleColumn999CardView } from '../page/CardView'; | 4 | import { PaperSingleColumn999CardView } from '../page/CardView'; |
| @@ -11,67 +11,71 @@ const TAG = 'SingleColumn999Component'; | @@ -11,67 +11,71 @@ const TAG = 'SingleColumn999Component'; | ||
| 11 | */ | 11 | */ |
| 12 | @Component | 12 | @Component |
| 13 | export struct SingleColumn999Component { | 13 | export struct SingleColumn999Component { |
| 14 | + // @Consume compListItem?: CompList | ||
| 15 | + @Prop compListItem?: CompList | ||
| 14 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS; | 16 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_XS; |
| 15 | - @State compDTO: CompDTO = { | ||
| 16 | - compStyle: 'compStyle3', | ||
| 17 | - operDataList: [ | ||
| 18 | - { | ||
| 19 | - newsTitle: '时政微观察丨从外贸“成绩单”看中国经济新亮色', | ||
| 20 | - description: "description0", | ||
| 21 | - coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/a9028e7011bb440e94ba7c63d80b39b7.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg' | ||
| 22 | - } as ContentDTO, | ||
| 23 | - { | ||
| 24 | - newsTitle: '画好强国建设、民族复兴的最大同心圆', | ||
| 25 | - description: "description1", | ||
| 26 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/80351784d4da4fc08b8987ba45a7647f.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 27 | - } as ContentDTO, | ||
| 28 | - { | ||
| 29 | - newsTitle: '绿色“一带一路”十周年创新理念与实践案例', | ||
| 30 | - description: "description2", | ||
| 31 | - newsSummary: "共建“一带一路”倡议提出10年多来,在各方共同努力下,共建“一带一路”绿色发展取得积极进展,理念引领不断增强,交流机制不断完善,务实合作不断深化。", | ||
| 32 | - coverUrl: "", | ||
| 33 | - } as ContentDTO, | ||
| 34 | - { | ||
| 35 | - newsTitle: '瞭望 | 在深海聆听“幽灵粒子”', | ||
| 36 | - description: "description3", | ||
| 37 | - coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/b77a3577594d4d24b84e7b2b20e38e41.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg' | ||
| 38 | - } as ContentDTO, | ||
| 39 | - { | ||
| 40 | - newsTitle: '一图读懂|未来三年,长三角示范区安排了这些重大项目', | ||
| 41 | - description: "description4", | ||
| 42 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/8d54ef1cbbe14ef08d6ab38f07867e4c.jpeg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 43 | - } as ContentDTO, | ||
| 44 | - { | ||
| 45 | - newsTitle: '一头江豚的自述', | ||
| 46 | - description: "description5", | ||
| 47 | - newsSummary: "我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。", | ||
| 48 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/2ec7bccff2324b05ac4b6503d868a381.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 49 | - visitorComment: 10, | ||
| 50 | - videoInfo: { | ||
| 51 | - // clarity: 0, | ||
| 52 | - // resolutionHeight: 0, | ||
| 53 | - // resolutionWidth: 0, | ||
| 54 | - videoDuration: 229, | ||
| 55 | - videoLandScape: 1, | ||
| 56 | - // videoType: 0, | ||
| 57 | - videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4", | ||
| 58 | - firstFrameImageUri: "" | ||
| 59 | - } as VideoInfoDTO | ||
| 60 | - } as ContentDTO, | ||
| 61 | - { | ||
| 62 | - newsTitle: '遇见习近平丨北京正在书写历史', | ||
| 63 | - description: "description6", | ||
| 64 | - coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/7c54d59b63844464a261dcbba82c7aed.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 65 | - } as ContentDTO | ||
| 66 | - ] | ||
| 67 | - } as CompDTO | 17 | + |
| 18 | + // @State compDTO: CompDTO = { | ||
| 19 | + // compStyle: 'compStyle3', | ||
| 20 | + // operDataList: [ | ||
| 21 | + // { | ||
| 22 | + // newsTitle: '时政微观察丨从外贸“成绩单”看中国经济新亮色', | ||
| 23 | + // description: "description0", | ||
| 24 | + // coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/a9028e7011bb440e94ba7c63d80b39b7.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg' | ||
| 25 | + // } as ContentDTO, | ||
| 26 | + // { | ||
| 27 | + // newsTitle: '画好强国建设、民族复兴的最大同心圆', | ||
| 28 | + // description: "description1", | ||
| 29 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/80351784d4da4fc08b8987ba45a7647f.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 30 | + // } as ContentDTO, | ||
| 31 | + // { | ||
| 32 | + // newsTitle: '绿色“一带一路”十周年创新理念与实践案例', | ||
| 33 | + // description: "description2", | ||
| 34 | + // newsSummary: "共建“一带一路”倡议提出10年多来,在各方共同努力下,共建“一带一路”绿色发展取得积极进展,理念引领不断增强,交流机制不断完善,务实合作不断深化。", | ||
| 35 | + // coverUrl: "", | ||
| 36 | + // } as ContentDTO, | ||
| 37 | + // { | ||
| 38 | + // newsTitle: '瞭望 | 在深海聆听“幽灵粒子”', | ||
| 39 | + // description: "description3", | ||
| 40 | + // coverUrl: 'https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/b77a3577594d4d24b84e7b2b20e38e41.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg' | ||
| 41 | + // } as ContentDTO, | ||
| 42 | + // { | ||
| 43 | + // newsTitle: '一图读懂|未来三年,长三角示范区安排了这些重大项目', | ||
| 44 | + // description: "description4", | ||
| 45 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/8d54ef1cbbe14ef08d6ab38f07867e4c.jpeg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 46 | + // } as ContentDTO, | ||
| 47 | + // { | ||
| 48 | + // newsTitle: '一头江豚的自述', | ||
| 49 | + // description: "description5", | ||
| 50 | + // newsSummary: "我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。", | ||
| 51 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/2ec7bccff2324b05ac4b6503d868a381.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 52 | + // visitorComment: 10, | ||
| 53 | + // videoInfo: { | ||
| 54 | + // // clarity: 0, | ||
| 55 | + // // resolutionHeight: 0, | ||
| 56 | + // // resolutionWidth: 0, | ||
| 57 | + // videoDuration: 229, | ||
| 58 | + // videoLandScape: 1, | ||
| 59 | + // // videoType: 0, | ||
| 60 | + // videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4", | ||
| 61 | + // firstFrameImageUri: "" | ||
| 62 | + // } as VideoInfoDTO | ||
| 63 | + // } as ContentDTO, | ||
| 64 | + // { | ||
| 65 | + // newsTitle: '遇见习近平丨北京正在书写历史', | ||
| 66 | + // description: "description6", | ||
| 67 | + // coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/7c54d59b63844464a261dcbba82c7aed.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg", | ||
| 68 | + // } as ContentDTO | ||
| 69 | + // ] | ||
| 70 | + // } as CompDTO | ||
| 68 | 71 | ||
| 69 | watchCurrentBreakpoint() { | 72 | watchCurrentBreakpoint() { |
| 70 | Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); | 73 | Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); |
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | aboutToAppear() { | 76 | aboutToAppear() { |
| 74 | - Logger.info(TAG, `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); | 77 | + // Logger.info(TAG, `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); |
| 78 | + Logger.info(TAG, `aboutToAppear, beanList:${this.compListItem?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); | ||
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | aboutToDisappear() { | 81 | aboutToDisappear() { |
| @@ -106,16 +110,18 @@ export struct SingleColumn999Component { | @@ -106,16 +110,18 @@ export struct SingleColumn999Component { | ||
| 106 | } | 110 | } |
| 107 | 111 | ||
| 108 | build() { | 112 | build() { |
| 109 | - if (this.compDTO && this.compDTO?.operDataList?.length > 0) { | 113 | + // if (this.compDTO && this.compDTO?.operDataList?.length > 0) { |
| 114 | + if (this.compListItem && this.compListItem?.operDataList?.length > 0) { | ||
| 110 | List({ space: 2, initialIndex: 0 }) { | 115 | List({ space: 2, initialIndex: 0 }) { |
| 111 | // ListItemGroup({ | 116 | // ListItemGroup({ |
| 112 | // // footer: this.itemFooter("") | 117 | // // footer: this.itemFooter("") |
| 113 | // }) { | 118 | // }) { |
| 114 | - ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { | ||
| 115 | - ListItem() { | ||
| 116 | - this.buildPaperItem(item, index) | ||
| 117 | - } | ||
| 118 | - }, (item: ContentDTO, index: number) => JSON.stringify(item)) | 119 | + // ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { |
| 120 | + ForEach(this.compListItem?.operDataList, (item: ContentDTO, index: number) => { | ||
| 121 | + ListItem() { | ||
| 122 | + this.buildPaperItem(item, index) | ||
| 123 | + } | ||
| 124 | + }, (item: ContentDTO, index: number) => JSON.stringify(item)) | ||
| 119 | // } | 125 | // } |
| 120 | // .divider({ strokeWidth: 1, color: '#EFEFEF' }) // 每行之间的分界线 | 126 | // .divider({ strokeWidth: 1, color: '#EFEFEF' }) // 每行之间的分界线 |
| 121 | 127 |
| 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' | 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' |
| 2 | +import { WDRouterRule, WDRouterPage } from 'wdRouter' | ||
| 3 | +import { Action, Params } from 'wdBean'; | ||
| 4 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | ||
| 2 | 5 | ||
| 3 | @Component | 6 | @Component |
| 4 | -export default struct MinePageMoreFunctionUI{ | ||
| 5 | - @Link moreData:MinePageMoreFunctionModel[] | 7 | +export default struct MinePageMoreFunctionUI { |
| 8 | + @Link moreData: MinePageMoreFunctionModel[] | ||
| 6 | 9 | ||
| 7 | - build(){ | ||
| 8 | - Column(){ | ||
| 9 | - Column(){ | 10 | + build() { |
| 11 | + Column() { | ||
| 12 | + Column() { | ||
| 10 | Text(`更多功能`) | 13 | Text(`更多功能`) |
| 11 | .width('456lpx') | 14 | .width('456lpx') |
| 12 | .height('38lpx') | 15 | .height('38lpx') |
| 13 | .fontColor($r('app.color.color_666666')) | 16 | .fontColor($r('app.color.color_666666')) |
| 14 | .fontSize('29lpx') | 17 | .fontSize('29lpx') |
| 15 | - .margin({left:"31lpx"}) | 18 | + .margin({ left: "31lpx" }) |
| 16 | .fontWeight(600) | 19 | .fontWeight(600) |
| 17 | }.height('92lpx') | 20 | }.height('92lpx') |
| 18 | .width('100%') | 21 | .width('100%') |
| @@ -23,17 +26,17 @@ export default struct MinePageMoreFunctionUI{ | @@ -23,17 +26,17 @@ export default struct MinePageMoreFunctionUI{ | ||
| 23 | .width('100%') | 26 | .width('100%') |
| 24 | .height('1lpx') | 27 | .height('1lpx') |
| 25 | 28 | ||
| 26 | - List(){ | ||
| 27 | - ForEach(this.moreData,(item:MinePageMoreFunctionModel,index:number)=>{ | ||
| 28 | - ListItem(){ | ||
| 29 | - Column(){ | ||
| 30 | - Column(){ | ||
| 31 | - Row(){ | ||
| 32 | - if(item.imgSrc){ | 29 | + List() { |
| 30 | + ForEach(this.moreData, (item: MinePageMoreFunctionModel, index: number) => { | ||
| 31 | + ListItem() { | ||
| 32 | + Column() { | ||
| 33 | + Column() { | ||
| 34 | + Row() { | ||
| 35 | + if (item.imgSrc) { | ||
| 33 | Image(item.imgSrc) | 36 | Image(item.imgSrc) |
| 34 | .width('38lpx') | 37 | .width('38lpx') |
| 35 | .height('38lpx') | 38 | .height('38lpx') |
| 36 | - .margin({right:'15lpx'}) | 39 | + .margin({ right: '15lpx' }) |
| 37 | } | 40 | } |
| 38 | Text(`${item.msg}`) | 41 | Text(`${item.msg}`) |
| 39 | .width('456lpx') | 42 | .width('456lpx') |
| @@ -47,27 +50,36 @@ export default struct MinePageMoreFunctionUI{ | @@ -47,27 +50,36 @@ export default struct MinePageMoreFunctionUI{ | ||
| 47 | .width('27lpx') | 50 | .width('27lpx') |
| 48 | .height('27lpx') | 51 | .height('27lpx') |
| 49 | .objectFit(ImageFit.Auto) | 52 | .objectFit(ImageFit.Auto) |
| 50 | - .margin({left:'81lpx',right:'29lpx'}) | 53 | + .margin({ left: '81lpx', right: '29lpx' }) |
| 51 | }.alignItems(VerticalAlign.Center) | 54 | }.alignItems(VerticalAlign.Center) |
| 52 | .justifyContent(FlexAlign.Center) | 55 | .justifyContent(FlexAlign.Center) |
| 53 | }.height('108lpx') | 56 | }.height('108lpx') |
| 54 | .justifyContent(FlexAlign.Center) | 57 | .justifyContent(FlexAlign.Center) |
| 55 | .alignItems(HorizontalAlign.Start) | 58 | .alignItems(HorizontalAlign.Start) |
| 56 | - .padding({left:'27lpx'}) | 59 | + .padding({ left: '27lpx' }) |
| 57 | 60 | ||
| 58 | - if(index != this.moreData.length -1 ){ | 61 | + if (index != this.moreData.length - 1) { |
| 59 | Text().backgroundColor($r('app.color.color_F5F5F5')) | 62 | Text().backgroundColor($r('app.color.color_F5F5F5')) |
| 60 | .width('612lpx') | 63 | .width('612lpx') |
| 61 | .height('1lpx') | 64 | .height('1lpx') |
| 62 | } | 65 | } |
| 63 | } | 66 | } |
| 64 | } | 67 | } |
| 65 | - .onClick(()=>{ | ||
| 66 | - console.log(index+"") | ||
| 67 | - if (index == 3) { | ||
| 68 | - // RouteManager.jumpNewPage("pages/SettingPage") | ||
| 69 | - } else { | ||
| 70 | - // RouteManager.jumpNewPage("pages/PrivacySettingPage") | 68 | + .onClick(() => { |
| 69 | + console.log(index + "") | ||
| 70 | + if (index == 0) { | ||
| 71 | + // WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 72 | + } else if (index == 1) { | ||
| 73 | + // WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 74 | + } else if (index == 2) { | ||
| 75 | + | ||
| 76 | + } else if (index == 3) { //设置 | ||
| 77 | + let params: Params = { | ||
| 78 | + pageID: 'mainSetting' | ||
| 79 | + } | ||
| 80 | + WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | ||
| 81 | + }else if (index == 4) { // 关于 | ||
| 82 | + WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) | ||
| 71 | } | 83 | } |
| 72 | }) | 84 | }) |
| 73 | .height('117lpx') | 85 | .height('117lpx') |
| @@ -78,6 +90,6 @@ export default struct MinePageMoreFunctionUI{ | @@ -78,6 +90,6 @@ export default struct MinePageMoreFunctionUI{ | ||
| 78 | } | 90 | } |
| 79 | .backgroundColor($r('app.color.white')) | 91 | .backgroundColor($r('app.color.white')) |
| 80 | .borderRadius(8) | 92 | .borderRadius(8) |
| 81 | - .margin({left:'23lpx',right:'23lpx',top:"19lpx"}) | 93 | + .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) |
| 82 | } | 94 | } |
| 83 | } | 95 | } |
| 1 | -import { Logger, StringUtils } from 'wdKit' | 1 | +import { Logger } from 'wdKit' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 3 | 3 | ||
| 4 | @Component | 4 | @Component |
| @@ -22,7 +22,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -22,7 +22,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 22 | .backgroundColor($r('app.color.main_red')) | 22 | .backgroundColor($r('app.color.main_red')) |
| 23 | .width('110lpx') | 23 | .width('110lpx') |
| 24 | .height('110lpx') | 24 | .height('110lpx') |
| 25 | - Image($r('app.media.mine_head_icon')) | 25 | + Image($r('app.media.default_head')) |
| 26 | .width('108lpx') | 26 | .width('108lpx') |
| 27 | .height('108lpx') | 27 | .height('108lpx') |
| 28 | .objectFit(ImageFit.Cover) | 28 | .objectFit(ImageFit.Cover) |
| @@ -33,6 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | @@ -33,6 +33,8 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 33 | .onClick(()=>{ | 33 | .onClick(()=>{ |
| 34 | if(!this.isLogin){ | 34 | if(!this.isLogin){ |
| 35 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 35 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 36 | + }else { | ||
| 37 | + WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage) | ||
| 36 | } | 38 | } |
| 37 | }) | 39 | }) |
| 38 | 40 |
| @@ -43,7 +43,7 @@ export struct FollowListDetailUI{ | @@ -43,7 +43,7 @@ export struct FollowListDetailUI{ | ||
| 43 | ListHasNoMoreDataUI() | 43 | ListHasNoMoreDataUI() |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | - }.cachedCount(7) | 46 | + }.cachedCount(10) |
| 47 | .padding({left:'31lpx',right:'31lpx'}) | 47 | .padding({left:'31lpx',right:'31lpx'}) |
| 48 | .layoutWeight(1) | 48 | .layoutWeight(1) |
| 49 | .scrollBar(BarState.Off) | 49 | .scrollBar(BarState.Off) |
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomComponent.ets
0 → 100644
| 1 | +import { LazyDataSource, StringUtils } from 'wdKit'; | ||
| 2 | +import MinePageDatasModel from '../../../model/MinePageDatasModel'; | ||
| 3 | +import { CommentListItem } from '../../../viewmodel/CommentListItem'; | ||
| 4 | +import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | ||
| 5 | +import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | ||
| 6 | +import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | ||
| 7 | + | ||
| 8 | +const TAG = "HomePageBottomComponent" | ||
| 9 | +@Component | ||
| 10 | +export struct HomePageBottomComponent{ | ||
| 11 | + @State style:number = 0; //0 评论 ,1 关注 | ||
| 12 | + @State data_follow: LazyDataSource<FollowListDetailItem> = new LazyDataSource(); | ||
| 13 | + @State data_comment: LazyDataSource<CommentListItem> = new LazyDataSource(); | ||
| 14 | + @State isLoading:boolean = false | ||
| 15 | + @State hasMore:boolean = true | ||
| 16 | + curPageNum:number = 1; | ||
| 17 | + @State count:number = 0; | ||
| 18 | + | ||
| 19 | + aboutToAppear(){ | ||
| 20 | + this.getNewPageData() | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + build(){ | ||
| 24 | + Column(){ | ||
| 25 | + Divider().width('100%') | ||
| 26 | + .height('2lpx') | ||
| 27 | + .strokeWidth('1lpx') | ||
| 28 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 29 | + | ||
| 30 | + if(this.count === 0){ | ||
| 31 | + ListHasNoMoreDataUI({style:2}) | ||
| 32 | + .height('100%') | ||
| 33 | + }else{ | ||
| 34 | + if(this.style === 1){ | ||
| 35 | + List({ space: 3 }) { | ||
| 36 | + | ||
| 37 | + ListItem() { | ||
| 38 | + Row(){ | ||
| 39 | + Text("关注更多人民号") | ||
| 40 | + .fontWeight('400lpx') | ||
| 41 | + .fontColor($r('app.color.color_222222')) | ||
| 42 | + .lineHeight('38lpx') | ||
| 43 | + .fontSize('27lpx') | ||
| 44 | + .textAlign(TextAlign.Center) | ||
| 45 | + .margin({right:'4lpx'}) | ||
| 46 | + Image($r('app.media.arrow_icon_right')) | ||
| 47 | + .objectFit(ImageFit.Auto) | ||
| 48 | + .width('27lpx') | ||
| 49 | + .height('27lpx') | ||
| 50 | + }.height('69lpx') | ||
| 51 | + .width('659lpx') | ||
| 52 | + .alignItems(VerticalAlign.Center) | ||
| 53 | + .justifyContent(FlexAlign.Center) | ||
| 54 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 55 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | ||
| 59 | + ListItem() { | ||
| 60 | + ChildFollowComponent({data: item}) | ||
| 61 | + } | ||
| 62 | + .onClick(() => { | ||
| 63 | + }) | ||
| 64 | + }, (item: FollowListDetailItem, index: number) => index.toString()) | ||
| 65 | + | ||
| 66 | + //没有更多数据 显示提示 | ||
| 67 | + if(!this.hasMore){ | ||
| 68 | + ListItem(){ | ||
| 69 | + ListHasNoMoreDataUI() | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + }.cachedCount(15) | ||
| 73 | + .padding({left:'31lpx',right:'31lpx'}) | ||
| 74 | + .layoutWeight(1) | ||
| 75 | + .scrollBar(BarState.Off) | ||
| 76 | + .edgeEffect(EdgeEffect.None) | ||
| 77 | + .nestedScroll({ | ||
| 78 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 79 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 80 | + }) | ||
| 81 | + .onReachEnd(()=>{ | ||
| 82 | + console.log(TAG,"触底了"); | ||
| 83 | + if(!this.isLoading){ | ||
| 84 | + this.isLoading = true | ||
| 85 | + //加载分页数据 | ||
| 86 | + this.getNewPageData() | ||
| 87 | + } | ||
| 88 | + }) | ||
| 89 | + }else if(this.style === 0){ | ||
| 90 | + List({ space: 3 }) { | ||
| 91 | + LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { | ||
| 92 | + ListItem() { | ||
| 93 | + ChildCommentComponent({data: item}) | ||
| 94 | + } | ||
| 95 | + .onClick(() => { | ||
| 96 | + }) | ||
| 97 | + }, (item: CommentListItem, index: number) => index.toString()) | ||
| 98 | + | ||
| 99 | + //没有更多数据 显示提示 | ||
| 100 | + if(!this.hasMore){ | ||
| 101 | + ListItem(){ | ||
| 102 | + ListHasNoMoreDataUI() | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + }.cachedCount(15) | ||
| 106 | + .layoutWeight(1) | ||
| 107 | + .scrollBar(BarState.Off) | ||
| 108 | + .edgeEffect(EdgeEffect.None) | ||
| 109 | + .nestedScroll({ | ||
| 110 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 111 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 112 | + }) | ||
| 113 | + .onReachEnd(()=>{ | ||
| 114 | + console.log(TAG,"触底了"); | ||
| 115 | + if(!this.isLoading){ | ||
| 116 | + this.isLoading = true | ||
| 117 | + //加载分页数据 | ||
| 118 | + this.getNewPageData() | ||
| 119 | + } | ||
| 120 | + }) | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + .width('100%') | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + | ||
| 128 | + @Styles | ||
| 129 | + listStyle() { | ||
| 130 | + .backgroundColor(Color.White) | ||
| 131 | + .height(72) | ||
| 132 | + .width("100%") | ||
| 133 | + .borderRadius(12) | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + getNewPageData(){ | ||
| 137 | + this.isLoading = true | ||
| 138 | + //我的关注列表 | ||
| 139 | + if (this.style === 1){ | ||
| 140 | + if(this.hasMore){ | ||
| 141 | + let object = new FollowListDetailRequestItem(20,this.curPageNum) | ||
| 142 | + | ||
| 143 | + MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{ | ||
| 144 | + if (!this.data_follow || value.list.length == 0){ | ||
| 145 | + this.hasMore = false | ||
| 146 | + }else{ | ||
| 147 | + value.list.forEach((value)=>{ | ||
| 148 | + this.data_follow.push(new FollowListDetailItem(value.attentionHeadPhotoUrl,value.attentionUserName,value.fansNum,value.introduction,value.attentionCreatorId,"1")) | ||
| 149 | + }) | ||
| 150 | + this.data_follow.notifyDataReload() | ||
| 151 | + this.count = this.data_follow.totalCount() | ||
| 152 | + if (this.data_follow.totalCount() < value.totalCount) { | ||
| 153 | + this.curPageNum++ | ||
| 154 | + }else { | ||
| 155 | + this.hasMore = false | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + this.isLoading = false | ||
| 159 | + }).catch((err:Error)=>{ | ||
| 160 | + console.log(TAG,"请求失败") | ||
| 161 | + this.isLoading = false | ||
| 162 | + }) | ||
| 163 | + } | ||
| 164 | + }else if(this.style === 0){ | ||
| 165 | + if(this.hasMore){ | ||
| 166 | + let object = new FollowListDetailRequestItem(20,this.curPageNum) | ||
| 167 | + | ||
| 168 | + MinePageDatasModel.getMineCommentListData(object,getContext(this)).then((value)=>{ | ||
| 169 | + if (!this.data_comment || value.list.length == 0){ | ||
| 170 | + this.hasMore = false | ||
| 171 | + }else{ | ||
| 172 | + value.list.forEach((value)=>{ | ||
| 173 | + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent)) | ||
| 174 | + }) | ||
| 175 | + this.data_comment.notifyDataReload() | ||
| 176 | + this.count = this.data_comment.totalCount() | ||
| 177 | + if (this.data_comment.totalCount() < value.totalCount) { | ||
| 178 | + this.curPageNum++ | ||
| 179 | + }else { | ||
| 180 | + this.hasMore = false | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + this.isLoading = false | ||
| 184 | + }).catch((err:Error)=>{ | ||
| 185 | + console.log(TAG,"请求失败") | ||
| 186 | + this.isLoading = false | ||
| 187 | + }) | ||
| 188 | + } | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | +@Component | ||
| 194 | +struct ChildFollowComponent { | ||
| 195 | + @ObjectLink data: FollowListDetailItem | ||
| 196 | + | ||
| 197 | + build() { | ||
| 198 | + Column(){ | ||
| 199 | + Blank().height('27lpx') | ||
| 200 | + | ||
| 201 | + Row() { | ||
| 202 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | ||
| 203 | + .objectFit(ImageFit.Auto) | ||
| 204 | + .width('92lpx') | ||
| 205 | + .height('92lpx') | ||
| 206 | + .margin({right:'15lpx'}) | ||
| 207 | + | ||
| 208 | + Column(){ | ||
| 209 | + Text(this.data.cnUserName) | ||
| 210 | + .fontWeight('400lpx') | ||
| 211 | + .fontSize('31lpx') | ||
| 212 | + .lineHeight('38lpx') | ||
| 213 | + .fontColor($r('app.color.color_222222')) | ||
| 214 | + Text(`粉丝${this.data.cnFansNum}`) | ||
| 215 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 216 | + .fontSize('23lpx') | ||
| 217 | + .maxLines(1) | ||
| 218 | + Text(`${this.data.introduction}`) | ||
| 219 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 220 | + .fontSize('23lpx') | ||
| 221 | + .maxLines(2) | ||
| 222 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 223 | + }.layoutWeight(1) | ||
| 224 | + .alignItems(HorizontalAlign.Start) | ||
| 225 | + | ||
| 226 | + if(this.data.status == "1"){ | ||
| 227 | + Row(){ | ||
| 228 | + Text(`已关注`) | ||
| 229 | + .fontColor($r('app.color.color_CCCCCC')) | ||
| 230 | + .fontSize('23lpx') | ||
| 231 | + .fontWeight('500lpx') | ||
| 232 | + .lineHeight('35lpx') | ||
| 233 | + }.backgroundColor($r('app.color.color_F5F5F5')) | ||
| 234 | + .borderRadius('6lpx') | ||
| 235 | + .borderColor($r('app.color.color_F5F5F5')) | ||
| 236 | + .borderWidth('2lpx') | ||
| 237 | + .justifyContent(FlexAlign.Center) | ||
| 238 | + .width('100lpx') | ||
| 239 | + .height('46lpx') | ||
| 240 | + .margin({left:'4lpx',top:'23lpx'}) | ||
| 241 | + .onClick(()=>{ | ||
| 242 | + this.data.status = "0" | ||
| 243 | + }) | ||
| 244 | + }else{ | ||
| 245 | + Row(){ | ||
| 246 | + Image($r('app.media.follow_icon')) | ||
| 247 | + .margin({right:'4lpx'}) | ||
| 248 | + .width('23lpx') | ||
| 249 | + .height('23lpx') | ||
| 250 | + Text(`关注`) | ||
| 251 | + .fontColor($r('app.color.color_ED2800')) | ||
| 252 | + .fontSize('23lpx') | ||
| 253 | + .fontWeight('500lpx') | ||
| 254 | + .lineHeight('35lpx') | ||
| 255 | + }.borderColor($r('app.color.color_1AED2800')) | ||
| 256 | + .borderRadius('6lpx') | ||
| 257 | + .borderWidth('2lpx') | ||
| 258 | + .justifyContent(FlexAlign.Center) | ||
| 259 | + .width('100lpx') | ||
| 260 | + .height('46lpx') | ||
| 261 | + .margin({left:'4lpx',top:'23lpx'}) | ||
| 262 | + .onClick(()=>{ | ||
| 263 | + this.data.status = "1" | ||
| 264 | + }) | ||
| 265 | + } | ||
| 266 | + }.alignItems(VerticalAlign.Top) | ||
| 267 | + .width('100%') | ||
| 268 | + .layoutWeight(1) | ||
| 269 | + | ||
| 270 | + Divider().width('100%') | ||
| 271 | + .height('2lpx') | ||
| 272 | + .strokeWidth('1lpx') | ||
| 273 | + .backgroundColor($r('app.color.color_EDEDED')) | ||
| 274 | + | ||
| 275 | + }.height('146lpx') | ||
| 276 | + .justifyContent(FlexAlign.Center) | ||
| 277 | + } | ||
| 278 | +} | ||
| 279 | + | ||
| 280 | +@Component | ||
| 281 | +struct ChildCommentComponent { | ||
| 282 | + @ObjectLink data: CommentListItem | ||
| 283 | + | ||
| 284 | + build() { | ||
| 285 | + Column(){ | ||
| 286 | + Row() { | ||
| 287 | + Image(StringUtils.isEmpty(this.data.fromUserHeader)?$r('app.media.default_head'):this.data.fromUserHeader) | ||
| 288 | + .objectFit(ImageFit.Auto) | ||
| 289 | + .width('69lpx') | ||
| 290 | + .height('69lpx') | ||
| 291 | + .margin({right:'15lpx'}) | ||
| 292 | + | ||
| 293 | + Column(){ | ||
| 294 | + Text(this.data.fromUserName) | ||
| 295 | + .fontSize('25lpx') | ||
| 296 | + .lineHeight('35lpx') | ||
| 297 | + .fontWeight('600lpx') | ||
| 298 | + .fontColor($r('app.color.color_222222')) | ||
| 299 | + .margin({bottom:'6lpx'}) | ||
| 300 | + .maxLines(1) | ||
| 301 | + Text(`${this.data.createTime}`) | ||
| 302 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 303 | + .fontSize('23lpx') | ||
| 304 | + .lineHeight('31lpx') | ||
| 305 | + .fontWeight('400lpx') | ||
| 306 | + .maxLines(1) | ||
| 307 | + }.layoutWeight(1) | ||
| 308 | + .alignItems(HorizontalAlign.Start) | ||
| 309 | + } | ||
| 310 | + .margin({bottom:'10lpx'}) | ||
| 311 | + .width('100%') | ||
| 312 | + .height('108lpx') | ||
| 313 | + .padding({left:'31lpx',right:'31lpx'}) | ||
| 314 | + | ||
| 315 | + Row(){ | ||
| 316 | + Text(this.data.commentContent) | ||
| 317 | + .maxLines(3) | ||
| 318 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 319 | + .fontWeight('400lpx') | ||
| 320 | + .fontSize('31lpx') | ||
| 321 | + .lineHeight('46lpx') | ||
| 322 | + .fontColor($r('app.color.color_222222')) | ||
| 323 | + .margin({bottom:'10lpx'}) | ||
| 324 | + }.padding({left:'31lpx',right:'31lpx'}) | ||
| 325 | + .width('100%') | ||
| 326 | + | ||
| 327 | + Row(){ | ||
| 328 | + Text(this.data.targetTitle) | ||
| 329 | + .fontWeight('400lpx') | ||
| 330 | + .fontColor($r('app.color.color_222222')) | ||
| 331 | + .lineHeight('38lpx') | ||
| 332 | + .fontSize('27lpx') | ||
| 333 | + .textAlign(TextAlign.Center) | ||
| 334 | + .margin({right:'4lpx'}) | ||
| 335 | + .maxLines(3) | ||
| 336 | + .width('616lpx') | ||
| 337 | + Image($r('app.media.arrow_icon_right')) | ||
| 338 | + .objectFit(ImageFit.Auto) | ||
| 339 | + .width('27lpx') | ||
| 340 | + .height('27lpx') | ||
| 341 | + } | ||
| 342 | + .padding({top:'17lpx',bottom:'17lpx',left:'23lpx',right:'23lpx'}) | ||
| 343 | + .width('662lpx') | ||
| 344 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 345 | + .margin({top:'19lpx',bottom:'31lpx'}) | ||
| 346 | + | ||
| 347 | + Divider().width('100%') | ||
| 348 | + .height('12lpx') | ||
| 349 | + .strokeWidth('12lpx') | ||
| 350 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 351 | + | ||
| 352 | + } | ||
| 353 | + .justifyContent(FlexAlign.Center) | ||
| 354 | + } | ||
| 355 | +} |
| @@ -3,7 +3,6 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | @@ -3,7 +3,6 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | ||
| 3 | import { Logger } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 4 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | import { WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterRule } from 'wdRouter'; |
| 6 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | ||
| 7 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 6 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 8 | 7 | ||
| 9 | const TAG: string = 'CardView'; | 8 | const TAG: string = 'CardView'; |
| @@ -400,7 +399,8 @@ export struct PaperSingleColumn999CardView { | @@ -400,7 +399,8 @@ export struct PaperSingleColumn999CardView { | ||
| 400 | .fontWeight(FontWeight.Bold) | 399 | .fontWeight(FontWeight.Bold) |
| 401 | .alignSelf(ItemAlign.Start) | 400 | .alignSelf(ItemAlign.Start) |
| 402 | .maxLines(3) | 401 | .maxLines(3) |
| 403 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 402 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 403 | + .margin({ left: 22, right: 22, top: 28 }) | ||
| 404 | if (this.item?.coverUrl) { | 404 | if (this.item?.coverUrl) { |
| 405 | Stack({ alignContent: Alignment.BottomEnd }) { | 405 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 406 | Image(this.item?.coverUrl) | 406 | Image(this.item?.coverUrl) |
| @@ -418,7 +418,7 @@ export struct PaperSingleColumn999CardView { | @@ -418,7 +418,7 @@ export struct PaperSingleColumn999CardView { | ||
| 418 | .fitOriginalSize(true) | 418 | .fitOriginalSize(true) |
| 419 | }.width(CommonConstants.FULL_PARENT) | 419 | }.width(CommonConstants.FULL_PARENT) |
| 420 | } | 420 | } |
| 421 | - } | 421 | + }.margin({ left: 22, right: 22 }) |
| 422 | } | 422 | } |
| 423 | if (this.item?.newsSummary) { | 423 | if (this.item?.newsSummary) { |
| 424 | Text(this.item?.newsSummary) | 424 | Text(this.item?.newsSummary) |
| @@ -426,23 +426,26 @@ export struct PaperSingleColumn999CardView { | @@ -426,23 +426,26 @@ export struct PaperSingleColumn999CardView { | ||
| 426 | .padding({ top: 10 }) | 426 | .padding({ top: 10 }) |
| 427 | .alignSelf(ItemAlign.Start) | 427 | .alignSelf(ItemAlign.Start) |
| 428 | .maxLines(3) | 428 | .maxLines(3) |
| 429 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 429 | + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 430 | + .margin({ left: 22, right: 22 }) | ||
| 430 | } | 431 | } |
| 431 | if (this.item?.visitorComment) { | 432 | if (this.item?.visitorComment) { |
| 432 | Row() { | 433 | Row() { |
| 433 | Text(this.item?.visitorComment + "评") | 434 | Text(this.item?.visitorComment + "评") |
| 434 | .fontSize(12) | 435 | .fontSize(12) |
| 435 | .fontColor(Color.Gray) | 436 | .fontColor(Color.Gray) |
| 437 | + .margin({ left: 22 }) | ||
| 436 | Image($r('app.media.icon_share')) | 438 | Image($r('app.media.icon_share')) |
| 437 | .width(16) | 439 | .width(16) |
| 438 | .height(16) | 440 | .height(16) |
| 439 | - .margin(10) | 441 | + .margin({ left: 10, right: 22, top: 10, bottom: 10 }) |
| 440 | .backgroundColor(Color.Brown) | 442 | .backgroundColor(Color.Brown) |
| 441 | }.width(CommonConstants.FULL_PARENT) | 443 | }.width(CommonConstants.FULL_PARENT) |
| 442 | .justifyContent(FlexAlign.SpaceBetween) | 444 | .justifyContent(FlexAlign.SpaceBetween) |
| 443 | } | 445 | } |
| 444 | } | 446 | } |
| 445 | .backgroundColor(Color.White) | 447 | .backgroundColor(Color.White) |
| 446 | - .margin({ bottom: 5 }) | 448 | + .margin({ bottom: 5, left: 12, right: 12 }) |
| 449 | + .borderRadius(4) | ||
| 447 | } | 450 | } |
| 448 | } | 451 | } |
| @@ -19,7 +19,7 @@ const TAG = 'MinePageComponent'; | @@ -19,7 +19,7 @@ const TAG = 'MinePageComponent'; | ||
| 19 | export struct MinePageComponent { | 19 | export struct MinePageComponent { |
| 20 | //是否是创作者 | 20 | //是否是创作者 |
| 21 | @State isCreator:boolean = false | 21 | @State isCreator:boolean = false |
| 22 | - @State isLogin:boolean = false | 22 | + @State isLogin:boolean = false //默认 false 测试放开 |
| 23 | @State userName:string = "登陆注册" | 23 | @State userName:string = "登陆注册" |
| 24 | @State personalData:MinePagePersonalFunctionsItem[] = [] | 24 | @State personalData:MinePagePersonalFunctionsItem[] = [] |
| 25 | @State creatorData:MinePageCreatorFunctionsItem[] = [] | 25 | @State creatorData:MinePageCreatorFunctionsItem[] = [] |
| 1 | +import ArrayList from '@ohos.util.ArrayList' | ||
| 2 | +import { MineSettingComponent } from '../setting/MineSettingComponent'; | ||
| 3 | +import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | ||
| 4 | +import router from '@ohos.router'; | ||
| 5 | +import { Action, Params } from 'wdBean'; | ||
| 6 | + | ||
| 7 | +@Entry | ||
| 8 | +@Component | ||
| 9 | +struct SettingPage { | ||
| 10 | + @State message: string = 'Hello World 02' | ||
| 11 | + @State pageType: string = 'mainSetting'; | ||
| 12 | + @State params:Params = router.getParams() as Params; | ||
| 13 | + | ||
| 14 | + onPageShow() { | ||
| 15 | + | ||
| 16 | + this.pageType = this.params.pageID; | ||
| 17 | + | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + build() { | ||
| 21 | + Column() { | ||
| 22 | + if (this.pageType == 'mainSetting') { | ||
| 23 | + MineSettingComponent() | ||
| 24 | + } else { | ||
| 25 | + AccountAndSecurityLayout() | ||
| 26 | + } | ||
| 27 | + }.setFullWidth() | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + // 私有方法 | ||
| 31 | + @Styles setFullWidth(){ | ||
| 32 | + .width('100%') | ||
| 33 | + } | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +export { SettingPage }; | ||
| 37 | + | ||
| 38 | +/* | ||
| 39 | + | ||
| 40 | +* */ |
| 1 | +const TAG = 'AboutPageUI'; | ||
| 2 | + | ||
| 3 | +@Component | ||
| 4 | +export struct AboutPageUI { | ||
| 5 | + @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; | ||
| 6 | + @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' | ||
| 7 | + @State version: string = '版本号:v8.0.1.1' | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + build() { | ||
| 11 | + Navigation() { | ||
| 12 | + //滑动区域 | ||
| 13 | + this.aboutUi() | ||
| 14 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 15 | + .title('关于') | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + @Builder aboutUi() { | ||
| 19 | + Column() { | ||
| 20 | + Image($r('app.media.setting_about_logo')) | ||
| 21 | + .width('278lpx') | ||
| 22 | + .height('154lpx') | ||
| 23 | + .margin({top:'173lpx',bottom:'154lpx'}) | ||
| 24 | + | ||
| 25 | + // Row(){ | ||
| 26 | + // | ||
| 27 | + // }.backgroundColor(Color.Yellow) | ||
| 28 | + // .width('100%') | ||
| 29 | + // .height('97lpx') | ||
| 30 | + | ||
| 31 | + // Row(){ | ||
| 32 | + // | ||
| 33 | + // }.backgroundColor(Color.Yellow) | ||
| 34 | + // .width('100%') | ||
| 35 | + // .height('97lpx') | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + List(){ | ||
| 41 | + ForEach(this.listData, (item:string, index : number) =>{ | ||
| 42 | + ListItem() { | ||
| 43 | + this.getArrowCell(item, index) | ||
| 44 | + } | ||
| 45 | + }) | ||
| 46 | + }.divider({ | ||
| 47 | + strokeWidth: 1, | ||
| 48 | + startMargin: '29lpx', | ||
| 49 | + endMargin: '29lpx', | ||
| 50 | + color: '#EDEDED' | ||
| 51 | + }) | ||
| 52 | + | ||
| 53 | + Blank() | ||
| 54 | + | ||
| 55 | + Image($r('app.media.app_icon')) | ||
| 56 | + .width('192lpx') | ||
| 57 | + .height('192lpx') | ||
| 58 | + | ||
| 59 | + Text(this.version) | ||
| 60 | + .fontSize('25lpx') | ||
| 61 | + .textAlign(TextAlign.Center) | ||
| 62 | + .fontColor($r("app.color.color_666666")) | ||
| 63 | + .margin({bottom:'31lpx'}) | ||
| 64 | + | ||
| 65 | + Text(this.message) | ||
| 66 | + .fontSize('19lpx') | ||
| 67 | + .textAlign(TextAlign.Center) | ||
| 68 | + .fontColor($r("app.color.color_999999")) | ||
| 69 | + .margin({bottom:'35lpx'}) | ||
| 70 | + } | ||
| 71 | + .width('100%') | ||
| 72 | + .height('100%') | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + | ||
| 76 | + | ||
| 77 | + // 右文字+箭头cell | ||
| 78 | + @Builder getArrowCell(item:string, index:number) { | ||
| 79 | + | ||
| 80 | + Row() { | ||
| 81 | + // 左侧标题 | ||
| 82 | + Text(`${item}`) | ||
| 83 | + .fontColor('#666666') | ||
| 84 | + .fontSize('31lpx') | ||
| 85 | + | ||
| 86 | + Image($r('app.media.mine_user_arrow')) | ||
| 87 | + .width('27lpx') | ||
| 88 | + .height('27lpx') | ||
| 89 | + .objectFit(ImageFit.Auto) | ||
| 90 | + } | ||
| 91 | + .alignItems(VerticalAlign.Center) | ||
| 92 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 93 | + .height('97lpx') | ||
| 94 | + .width('100%') | ||
| 95 | + .padding({left:'29lpx',right:'29lpx'}) | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | + |
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
0 → 100644
| 1 | + | ||
| 2 | +import { BottomNavi, CommonConstants } from 'wdConstant'; | ||
| 3 | +import { Logger } from 'wdKit'; | ||
| 4 | +import { TopNavigationComponent } from '../page/TopNavigationComponent'; | ||
| 5 | +// import { BottomNavDTO } from '../../repository/bean/BottomNavDTO'; | ||
| 6 | +// import { UIUtils } from '../../repository/UIUtils'; | ||
| 7 | +// import { MinePageComponent } from './MinePageComponent'; | ||
| 8 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 9 | +import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem'; | ||
| 10 | +import MineSettingDatasModel from '../../model/MineSettingDatasModel'; | ||
| 11 | +// import MineMainSettingFunctionItem from '../../model/MineSettingDatasModel'; | ||
| 12 | +// import { MineMainSettingFunctionItem } from '../setting/MineSettingDatasModel' | ||
| 13 | + | ||
| 14 | +import storageStatistics from "@ohos.file.storageStatistics"; | ||
| 15 | +import { BusinessError } from '@ohos.base'; | ||
| 16 | +import ArrayList from '@ohos.util.ArrayList'; | ||
| 17 | +import router from '@ohos.router'; | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +@Component | ||
| 21 | +export struct AccountAndSecurityLayout { | ||
| 22 | + @State listData: Array<MineMainSettingFunctionItem> = new Array; | ||
| 23 | + @State privacySwitch: boolean = false | ||
| 24 | + @State cacheSice: number = 0 | ||
| 25 | + | ||
| 26 | + aboutToAppear() { | ||
| 27 | + // 获取设置页面数据 | ||
| 28 | + this.getAccountAndSecurityData() | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + getAccountAndSecurityData() { | ||
| 32 | + this.listData = MineSettingDatasModel.getAccountAndSecuritySettingData() | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + build() { | ||
| 36 | + Navigation() { | ||
| 37 | + //滑动区域 | ||
| 38 | + this.settingList() | ||
| 39 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 40 | + .title('账号与安全') | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + // 页面布局 | ||
| 44 | + @Builder settingList() { | ||
| 45 | + Stack({ alignContent: Alignment.Bottom }) { | ||
| 46 | + Column() { | ||
| 47 | + List() { | ||
| 48 | + ForEach(this.listData, (item: MineMainSettingFunctionItem, index: number) => { | ||
| 49 | + ListItem() { | ||
| 50 | + if (item.type == 0) { | ||
| 51 | + Column() { | ||
| 52 | + this.getArrowCell(item) | ||
| 53 | + }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) | ||
| 54 | + } else if (item.type == 1) { | ||
| 55 | + Column() { | ||
| 56 | + this.getSwitchCell(item) | ||
| 57 | + }.padding({ left: '27lpx' }).height('117lpx').justifyContent(FlexAlign.Center) | ||
| 58 | + } else { | ||
| 59 | + Column().width('100%').height('15lpx').backgroundColor(0xf0f0f0) | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + .onClick(() => { | ||
| 63 | + console.log(index + "") | ||
| 64 | + if (index == 1) { | ||
| 65 | + router.pushUrl({ | ||
| 66 | + url:"pages/SettingPasswordPage", | ||
| 67 | + params : {'currentType' : 4} | ||
| 68 | + }) | ||
| 69 | + } | ||
| 70 | + }) | ||
| 71 | + | ||
| 72 | + }) | ||
| 73 | + } | ||
| 74 | + .divider({ | ||
| 75 | + strokeWidth: 1, | ||
| 76 | + startMargin: 15, | ||
| 77 | + endMargin: 10, | ||
| 78 | + color: '#f0f0f0' | ||
| 79 | + }) | ||
| 80 | + .onScrollFrameBegin((offset, state) => { | ||
| 81 | + return { offsetRemain: 0 } | ||
| 82 | + }) | ||
| 83 | + }.height("100%") | ||
| 84 | + | ||
| 85 | + Column() { | ||
| 86 | + Button('退出登录',{ stateEffect: true }).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').onClick(()=>{ | ||
| 87 | + AlertDialog.show({ | ||
| 88 | + title: '🥟id : ' + "button", | ||
| 89 | + message: '标题:' + '退出登录', | ||
| 90 | + confirm: { | ||
| 91 | + value: "OK", | ||
| 92 | + action: () => { | ||
| 93 | + | ||
| 94 | + }, | ||
| 95 | + } | ||
| 96 | + }) | ||
| 97 | + }) | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + @Builder itemHead(text: string) { | ||
| 104 | + // 列表分组的头部组件,对应联系人分组A、B等位置的组件 | ||
| 105 | + if (text.length > 0) { | ||
| 106 | + Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0) | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + // 右侧开关cell | ||
| 111 | + @Builder getSwitchCell(item: MineMainSettingFunctionItem) { | ||
| 112 | + Column() { | ||
| 113 | + Row() { | ||
| 114 | + // 左侧logo和标题 | ||
| 115 | + Row() { | ||
| 116 | + // 判断有没有图片 | ||
| 117 | + if (item.imgSrc) { | ||
| 118 | + Image(item.imgSrc).height('38lpx').margin({ right: '5lpx' }) | ||
| 119 | + Text(`${item.title}`).margin({ top: '8lpx' }).height('38lpx').fontColor('#333333').fontSize('29lpx') | ||
| 120 | + } else { | ||
| 121 | + Text(`${item.title}`).margin({ top: '8lpx' }).height('38lpx').fontColor('#333333').fontSize('29lpx') | ||
| 122 | + } | ||
| 123 | + }.width('60%') | ||
| 124 | + | ||
| 125 | + // 右侧文案和右箭头 | ||
| 126 | + Row() { | ||
| 127 | + Toggle({ type: ToggleType.Switch, isOn: item.switchState }) | ||
| 128 | + .height('50lpx') | ||
| 129 | + .margin({ left: '81lpx', right: '29lpx' }) | ||
| 130 | + .selectedColor(Color.Pink) | ||
| 131 | + .onChange((isOn: boolean) => { | ||
| 132 | + this.privacySwitch = isOn; | ||
| 133 | + }) | ||
| 134 | + }.width('40%') | ||
| 135 | + .margin({ right: '29lpx' }) | ||
| 136 | + .justifyContent(FlexAlign.End) | ||
| 137 | + | ||
| 138 | + } | ||
| 139 | + .alignItems(VerticalAlign.Center) | ||
| 140 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 141 | + }.height('54lpx') | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + // 右文字+箭头cell | ||
| 145 | + @Builder getArrowCell(item: MineMainSettingFunctionItem) { | ||
| 146 | + Column() { | ||
| 147 | + Row() { | ||
| 148 | + // 左侧logo和标题 | ||
| 149 | + Row() { | ||
| 150 | + // 判断有没有图片 | ||
| 151 | + if (item.imgSrc) { | ||
| 152 | + Image(item.imgSrc) | ||
| 153 | + .height('38lpx') | ||
| 154 | + .margin({ right: '5lpx' }) | ||
| 155 | + } | ||
| 156 | + Text(`${item.title}`) | ||
| 157 | + .margin({ top: '8lpx' }) | ||
| 158 | + .height('38lpx') | ||
| 159 | + .fontColor('#333333') | ||
| 160 | + .fontSize('29lpx') | ||
| 161 | + }.width('60%') | ||
| 162 | + | ||
| 163 | + // 右侧文案和右箭头 | ||
| 164 | + Row() { | ||
| 165 | + Text(item.subTitle ? item.subTitle : '') | ||
| 166 | + .fontColor('#999999') | ||
| 167 | + .maxLines(1) | ||
| 168 | + Image($r('app.media.mine_user_arrow')) | ||
| 169 | + .width('27lpx') | ||
| 170 | + .height('27lpx') | ||
| 171 | + .objectFit(ImageFit.Auto) | ||
| 172 | + Column().width('29lpx') | ||
| 173 | + }.width('40%') | ||
| 174 | + .margin({ right: '29lpx' }) | ||
| 175 | + .justifyContent(FlexAlign.End) | ||
| 176 | + | ||
| 177 | + } | ||
| 178 | + .alignItems(VerticalAlign.Center) | ||
| 179 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 180 | + | ||
| 181 | + } | ||
| 182 | + .height('54lpx') | ||
| 183 | + } | ||
| 184 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/setting/MineSettingComponent.ets
0 → 100644
| 1 | +import { BottomNavi, CommonConstants } from 'wdConstant'; | ||
| 2 | +import { Logger } from 'wdKit'; | ||
| 3 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 4 | +import storageStatistics from "@ohos.file.storageStatistics"; | ||
| 5 | +import { BusinessError } from '@ohos.base'; | ||
| 6 | +import router from '@ohos.router'; | ||
| 7 | +import { WDRouterPage, WDRouterRule } from 'wdRouter'; | ||
| 8 | +import { Params } from 'wdBean'; | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +@Component | ||
| 12 | +export struct MineSettingComponent { | ||
| 13 | + @State listData: Array<string | Array<string>> = new Array(); | ||
| 14 | + @State privacySwitch: boolean = false | ||
| 15 | + @State cacheSice: number = 0 | ||
| 16 | + | ||
| 17 | + aboutToAppear() { | ||
| 18 | + // 获取设置页面数据 | ||
| 19 | + this.getSettingPageData() | ||
| 20 | + | ||
| 21 | + // 获取缓存数据 | ||
| 22 | + storageStatistics.getCurrentBundleStats((err: BusinessError, bundleStats: storageStatistics.BundleStats) => { | ||
| 23 | + if (err) { | ||
| 24 | + console.error(`Invoke getCurrentBundleStats failed, code is ${err.code}, message is ${err.message}`); | ||
| 25 | + } else { | ||
| 26 | + this.cacheSice = bundleStats.appSize / 1024.00 / 1024.00; | ||
| 27 | + } | ||
| 28 | + }); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + getSettingPageData() { | ||
| 32 | + let listArr = [['账户与安全', '接收推送', '隐私设罝', '仅WiFi网络加载图片', 'WiFi网络情况下自动播放视频', '开户播放器悬浮窗'], ['清除缓存', '去评分']]; | ||
| 33 | + this.listData = listArr; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + build() { | ||
| 37 | + Navigation() { | ||
| 38 | + //滑动区域 | ||
| 39 | + this.settingList() | ||
| 40 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 41 | + .title('设置') | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + // 页面布局 | ||
| 45 | + @Builder settingList() { | ||
| 46 | + Column() { | ||
| 47 | + List() { | ||
| 48 | + // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合 | ||
| 49 | + ForEach(this.listData, (item: Array<string>, index: number) => { | ||
| 50 | + ListItemGroup({ header: index === 0 ? this.itemHead("") : this.itemHead("1") }) { | ||
| 51 | + // 循环渲染ListItem | ||
| 52 | + ForEach(item, (subItem: string, subIndex: number) => { | ||
| 53 | + ListItem() { | ||
| 54 | + if (subIndex == 6) { | ||
| 55 | + this.getArrowCell(subItem, subIndex, index) | ||
| 56 | + } else if (subIndex == 1 || subIndex == 3 || subIndex == 4 || subIndex == 5) { | ||
| 57 | + this.getSwitchCell(subItem, subIndex) | ||
| 58 | + } else { | ||
| 59 | + this.getArrowCell(subItem, subIndex, index) | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + }.padding({ left: '27lpx' }) | ||
| 63 | + .onClick(() => { | ||
| 64 | + | ||
| 65 | + // // 在Home页面中 | ||
| 66 | + // let paramsInfo: object = { | ||
| 67 | + // pageId: 123, | ||
| 68 | + // pageType:'AccountAndSecurityLayout' | ||
| 69 | + // }; | ||
| 70 | + console.log(subIndex + "") | ||
| 71 | + if (subIndex == 0) { | ||
| 72 | + | ||
| 73 | + let params: Params = { | ||
| 74 | + pageID: 'AccountAndSecurityLayout' | ||
| 75 | + } | ||
| 76 | + WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | ||
| 77 | + }else if (subIndex == 2) { | ||
| 78 | + WDRouterRule.jumpWithPage(WDRouterPage.privacySettingPage) | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + }) | ||
| 82 | + .height('117lpx') | ||
| 83 | + }) | ||
| 84 | + } | ||
| 85 | + .divider({ | ||
| 86 | + strokeWidth: 1, | ||
| 87 | + startMargin: 15, | ||
| 88 | + endMargin: 10, | ||
| 89 | + color: '#f0f0f0' | ||
| 90 | + }) | ||
| 91 | + }) | ||
| 92 | + }.onScrollFrameBegin((offset, state) => { | ||
| 93 | + return { offsetRemain: 0 } | ||
| 94 | + }) | ||
| 95 | + } | ||
| 96 | + .backgroundColor(Color.White) | ||
| 97 | + .borderRadius(8) | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + @Builder itemHead(text: string) { | ||
| 101 | + // 列表分组的头部组件,对应联系人分组A、B等位置的组件 | ||
| 102 | + if (text.length > 0) { | ||
| 103 | + Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0) | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + // 右侧开关cell | ||
| 108 | + @Builder getSwitchCell(item:string, index:number) { | ||
| 109 | + Column() { | ||
| 110 | + Row() { | ||
| 111 | + // 左侧logo和标题 | ||
| 112 | + Row() { | ||
| 113 | + // 判断有没有图片 | ||
| 114 | + if (0) { | ||
| 115 | + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') | ||
| 116 | + .height('38lpx') | ||
| 117 | + .margin({ right: '5lpx' }) | ||
| 118 | + | ||
| 119 | + Text(`${item}`) | ||
| 120 | + .margin({ top: '8lpx' }) | ||
| 121 | + .height('38lpx') | ||
| 122 | + .fontColor('#333333') | ||
| 123 | + .fontSize('29lpx') | ||
| 124 | + } else { | ||
| 125 | + Text(`${item}`) | ||
| 126 | + .margin({ top: '8lpx' }) | ||
| 127 | + .height('38lpx') | ||
| 128 | + .fontColor('#333333') | ||
| 129 | + .fontSize('29lpx') | ||
| 130 | + } | ||
| 131 | + }.width('60%') | ||
| 132 | + | ||
| 133 | + // 右侧文案和右箭头 | ||
| 134 | + Row() { | ||
| 135 | + Toggle({ type: ToggleType.Switch, isOn: false }) | ||
| 136 | + .height('50lpx') | ||
| 137 | + .margin({ left: '81lpx', right: '29lpx' }) | ||
| 138 | + .selectedColor(Color.Pink) | ||
| 139 | + .onChange((isOn: boolean) => { | ||
| 140 | + this.privacySwitch = isOn; | ||
| 141 | + }) | ||
| 142 | + }.width('40%') | ||
| 143 | + .margin({ right: '29lpx' }) | ||
| 144 | + .justifyContent(FlexAlign.End) | ||
| 145 | + | ||
| 146 | + } | ||
| 147 | + .alignItems(VerticalAlign.Center) | ||
| 148 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 149 | + }.height('54lpx') | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + // 右文字+箭头cell | ||
| 153 | + @Builder getArrowCell(item:string, index:number, mainIndex:number) { | ||
| 154 | + Column() { | ||
| 155 | + | ||
| 156 | + Row() { | ||
| 157 | + // 左侧logo和标题 | ||
| 158 | + Row() { | ||
| 159 | + // 判断有没有图片 | ||
| 160 | + if (this.privacySwitch) { | ||
| 161 | + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000') | ||
| 162 | + .height('38lpx') | ||
| 163 | + .margin({ right: '5lpx' }) | ||
| 164 | + } | ||
| 165 | + Text(`${item}`) | ||
| 166 | + .margin({ top: '8lpx' }) | ||
| 167 | + .height('38lpx') | ||
| 168 | + .fontColor('#333333') | ||
| 169 | + .fontSize('29lpx') | ||
| 170 | + }.width('60%') | ||
| 171 | + | ||
| 172 | + // 右侧文案和右箭头 | ||
| 173 | + Row() { | ||
| 174 | + Text((index == 0 && mainIndex != 0) ? this.cacheSice.toFixed(2) + 'MB' : '') | ||
| 175 | + .fontColor('#999999') | ||
| 176 | + .maxLines(1) | ||
| 177 | + Image($r('app.media.mine_user_arrow')) | ||
| 178 | + .width('27lpx') | ||
| 179 | + .height('27lpx') | ||
| 180 | + .objectFit(ImageFit.Auto) | ||
| 181 | + Column().width('29lpx') | ||
| 182 | + }.width('40%') | ||
| 183 | + .margin({ right: '29lpx' }) | ||
| 184 | + .justifyContent(FlexAlign.End) | ||
| 185 | + | ||
| 186 | + } | ||
| 187 | + .alignItems(VerticalAlign.Center) | ||
| 188 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 189 | + | ||
| 190 | + } | ||
| 191 | + .height('54lpx') | ||
| 192 | + } | ||
| 193 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/setting/PrivacySettingComponents.ets
0 → 100644
| 1 | +import dataPreferences from '@ohos.data.preferences'; | ||
| 2 | +import { PermissionUtil } from 'wdKit' | ||
| 3 | +import { SPHelper } from 'wdKit' | ||
| 4 | +import hilog from '@ohos.hilog'; | ||
| 5 | +import { PrivacySettingModel } from '../../model/PrivacySettingModel' | ||
| 6 | + | ||
| 7 | +const TAG = 'PrivacySettingComponents'; | ||
| 8 | + | ||
| 9 | +@Component | ||
| 10 | +export struct PrivacySettingComponents { | ||
| 11 | + @State listData: Array<PrivacySettingModel> = [new PrivacySettingModel('开启个性推荐', false, 'ohos.permission.READ_MEDIA'), new PrivacySettingModel('相册权限', false, 'ohos.permission.READ_MEDIA'), new PrivacySettingModel('相机权限', false, 'ohos.permission.CAMERA'), new PrivacySettingModel('定位权限', false, 'ohos.permission.LOCATION'), new PrivacySettingModel('麦克风权限', false, 'ohos.permission.MICROPHONE')]; | ||
| 12 | + @State tips: string = '设置前可查阅' | ||
| 13 | + @State privacyTips: string = '《隐私政策》' | ||
| 14 | + | ||
| 15 | + aboutToAppear() { | ||
| 16 | + // 获取权限= | ||
| 17 | + // SPHelper.default.save('sdf','sdf'); | ||
| 18 | + // this.initListData(); | ||
| 19 | + this.getPermissionStatus(); | ||
| 20 | + // RefreshStatus; | ||
| 21 | + | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + async getPermissionStatus() { | ||
| 25 | + const permissionUtil = new PermissionUtil(); | ||
| 26 | + for (const element of this.listData) { | ||
| 27 | + if (element.privacyName = '开启个性推荐') { | ||
| 28 | + continue; | ||
| 29 | + } | ||
| 30 | + const result = await permissionUtil.checkPermissions(element.permissionKey); | ||
| 31 | + element.permission = result; | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + build() { | ||
| 36 | + Navigation() { | ||
| 37 | + //滑动区域 | ||
| 38 | + this.PrivacySettingComponentsUI() | ||
| 39 | + | ||
| 40 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 41 | + .title('隐私设置') | ||
| 42 | + .backgroundColor('#F8F8F8') | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Builder PrivacySettingComponentsUI() { | ||
| 46 | + Column() { | ||
| 47 | + | ||
| 48 | + List({ space: '23lpx' }) { | ||
| 49 | + ForEach(this.listData, (item: PrivacySettingModel, index:number) => { | ||
| 50 | + ListItem() { | ||
| 51 | + if (index == 0) { | ||
| 52 | + getTuiJianCell({ item:item, index:index }); | ||
| 53 | + } else { | ||
| 54 | + getArrowCell({ item:item, index:index }); | ||
| 55 | + } | ||
| 56 | + }.onClick(() => { | ||
| 57 | + if (index != 0) { | ||
| 58 | + if (!item.permission) { | ||
| 59 | + //跳转权限设置 | ||
| 60 | + const permissionUtil = new PermissionUtil(); | ||
| 61 | + PermissionUtil.reqPermissionsFromUser([item.permissionKey]); | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + }) | ||
| 65 | + }) | ||
| 66 | + } | ||
| 67 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 68 | + .margin({ top: '38lpx' }) | ||
| 69 | + | ||
| 70 | + Row() { | ||
| 71 | + Text(this.tips) | ||
| 72 | + .fontSize('25lpx') | ||
| 73 | + .textAlign(TextAlign.Start) | ||
| 74 | + .fontColor($r("app.color.color_666666")) | ||
| 75 | + .margin({ left: '29lpx', top: '46lpx' }) | ||
| 76 | + // .backgroundColor(Color.Orange) | ||
| 77 | + Text(this.privacyTips) | ||
| 78 | + .fontSize('25lpx') | ||
| 79 | + .textAlign(TextAlign.Start) | ||
| 80 | + .fontColor('#ED2800') | ||
| 81 | + .margin({ top: '46lpx' }) | ||
| 82 | + .onClick(() => { | ||
| 83 | + //跳转隐私政策 | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + } | ||
| 88 | + .width('100%') | ||
| 89 | + .height('100%') | ||
| 90 | + .backgroundColor('#F8F8F8') | ||
| 91 | + .alignItems(HorizontalAlign.Start) | ||
| 92 | + } | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | + | ||
| 96 | +@Component | ||
| 97 | +struct getArrowCell { | ||
| 98 | + @ObjectLink item: PrivacySettingModel; | ||
| 99 | + index:number = 0; | ||
| 100 | + // 右文字+箭头cell | ||
| 101 | + // @Builder getArrowCell(item:PrivacySettingModel, index) { | ||
| 102 | + build() { | ||
| 103 | + Row() { | ||
| 104 | + // 左侧标题 | ||
| 105 | + Text(this.item.privacyName) | ||
| 106 | + .fontColor('#666666') | ||
| 107 | + .fontSize('31lpx') | ||
| 108 | + | ||
| 109 | + Row() { | ||
| 110 | + Text(this.item.permission ? '已开启' : '去设置') | ||
| 111 | + .fontColor(this.item.permission ? '#666666' : '#CCCCCC') | ||
| 112 | + .fontSize('31lpx') | ||
| 113 | + .margin({ right: '8lpx' }) | ||
| 114 | + | ||
| 115 | + Image($r('app.media.mine_user_arrow')) | ||
| 116 | + .width('27lpx') | ||
| 117 | + .height('27lpx') | ||
| 118 | + .objectFit(ImageFit.Auto) | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + } | ||
| 122 | + .alignItems(VerticalAlign.Center) | ||
| 123 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 124 | + .height('97lpx') | ||
| 125 | + .width('100%') | ||
| 126 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 127 | + .backgroundColor('#FFFFFF') | ||
| 128 | + .borderRadius('8lpx') | ||
| 129 | + } | ||
| 130 | +} | ||
| 131 | + | ||
| 132 | +@Component | ||
| 133 | +struct getTuiJianCell { | ||
| 134 | + @ObjectLink item: PrivacySettingModel; | ||
| 135 | + index:number = 0; | ||
| 136 | + build() { | ||
| 137 | + Column() { | ||
| 138 | + | ||
| 139 | + Row() { | ||
| 140 | + // 左侧标题 | ||
| 141 | + Text(this.item.privacyName) | ||
| 142 | + .fontColor('#666666') | ||
| 143 | + .fontSize('31lpx') | ||
| 144 | + | ||
| 145 | + Row() { | ||
| 146 | + Toggle({ type: ToggleType.Switch, isOn: this.item.permission }) | ||
| 147 | + .height('58lpx') | ||
| 148 | + .width('96lpx') | ||
| 149 | + // .selectedColor(Color.Pink) | ||
| 150 | + .onChange((isOn: boolean) => { | ||
| 151 | + // this.privacySwitch = isOn; | ||
| 152 | + }) | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + } | ||
| 156 | + .alignItems(VerticalAlign.Center) | ||
| 157 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 158 | + .height('97lpx') | ||
| 159 | + .width('100%') | ||
| 160 | + | ||
| 161 | + | ||
| 162 | + Blank() | ||
| 163 | + .backgroundColor('#EDEDED') | ||
| 164 | + .height('1lpx') | ||
| 165 | + | ||
| 166 | + Text('关闭后,将无法看到个性化推荐的服务') | ||
| 167 | + .fontColor('#999999') | ||
| 168 | + .fontSize('23lpx') | ||
| 169 | + .margin({ right: '8lpx' }) | ||
| 170 | + .height('69lpx') | ||
| 171 | + | ||
| 172 | + } | ||
| 173 | + .alignItems(HorizontalAlign.Start) | ||
| 174 | + .backgroundColor('#FFFFFF') | ||
| 175 | + .borderRadius('8lpx') | ||
| 176 | + .padding({ left: '29lpx', right: '29lpx' }) | ||
| 177 | + } | ||
| 178 | +} |
| 1 | -import { CompDTO } from 'wdBean' | 1 | +import { Action, CompDTO, Params } from 'wdBean'; |
| 2 | import { DateTimeUtils, Logger } from 'wdKit'; | 2 | import { DateTimeUtils, Logger } from 'wdKit'; |
| 3 | +import { WDRouterRule } from 'wdRouter'; | ||
| 3 | 4 | ||
| 4 | const TAG = 'AlbumCardComponent'; | 5 | const TAG = 'AlbumCardComponent'; |
| 5 | 6 | ||
| @@ -97,6 +98,15 @@ export struct AlbumCardComponent { | @@ -97,6 +98,15 @@ export struct AlbumCardComponent { | ||
| 97 | } | 98 | } |
| 98 | .width(343) | 99 | .width(343) |
| 99 | .height(154) | 100 | .height(154) |
| 101 | + .onClick((event: ClickEvent) => { | ||
| 102 | + let taskAction: Action = { | ||
| 103 | + type: 'JUMP_DETAIL_PAGE', | ||
| 104 | + params: { | ||
| 105 | + detailPageType: 9 | ||
| 106 | + } as Params, | ||
| 107 | + }; | ||
| 108 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 109 | + }) | ||
| 100 | 110 | ||
| 101 | Row() { | 111 | Row() { |
| 102 | if (this.compDTO.operDataList[0].source) { | 112 | if (this.compDTO.operDataList[0].source) { |
| @@ -4,16 +4,20 @@ import { RMCalendarBean } from '../components/calendar/RMCalendarBean' | @@ -4,16 +4,20 @@ import { RMCalendarBean } from '../components/calendar/RMCalendarBean' | ||
| 4 | @CustomDialog | 4 | @CustomDialog |
| 5 | export struct ENewspaperCalendarDialog { | 5 | export struct ENewspaperCalendarDialog { |
| 6 | calendarDialogController?: CustomDialogController | 6 | calendarDialogController?: CustomDialogController |
| 7 | + // 选择变化监听, | ||
| 8 | + onDateChange?: (date: RMCalendarBean) => void | ||
| 7 | 9 | ||
| 8 | build() { | 10 | build() { |
| 9 | RMCalendar({ | 11 | RMCalendar({ |
| 10 | // 开始日期 | 12 | // 开始日期 |
| 11 | startDate: new Date(2023, 8, 1), | 13 | startDate: new Date(2023, 8, 1), |
| 12 | // 截止日期 | 14 | // 截止日期 |
| 13 | - endDate: new Date(2024, 2, 20), | 15 | + endDate: new Date(), |
| 14 | // 日期选择变化监听 | 16 | // 日期选择变化监听 |
| 15 | - onDateChange: (date1: RMCalendarBean) => { | ||
| 16 | - console.log("onDateChange", "date1:", JSON.stringify(date1)) | 17 | + onDateChange: (date: RMCalendarBean) => { |
| 18 | + if (this.onDateChange) { | ||
| 19 | + this.onDateChange(date) | ||
| 20 | + } | ||
| 17 | if (this.calendarDialogController) { | 21 | if (this.calendarDialogController) { |
| 18 | this.calendarDialogController.close() | 22 | this.calendarDialogController.close() |
| 19 | } | 23 | } |
| 1 | import { NewspaperListBean, NewspaperListItemBean, NewspaperPositionItemBean } from 'wdBean' | 1 | import { NewspaperListBean, NewspaperListItemBean, NewspaperPositionItemBean } from 'wdBean' |
| 2 | +import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' | ||
| 2 | 3 | ||
| 4 | +/** | ||
| 5 | + * 读报纸半屏弹窗 | ||
| 6 | + * 弹窗嵌套参考资料(https://developer.harmonyos.com/cn/docs/documentation/doc-references-V2/ts-methods-custom-dialog-box-0000001580345722-V2) | ||
| 7 | + */ | ||
| 3 | @CustomDialog | 8 | @CustomDialog |
| 4 | export struct ENewspaperListDialog { | 9 | export struct ENewspaperListDialog { |
| 5 | - @State currentPageNum: string = '01' | ||
| 6 | - controller: CustomDialogController | 10 | + @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string |
| 11 | + @State pageDialogShow: boolean = false | ||
| 12 | + @State scrollIndex: number = 0 | ||
| 7 | newspaperListBean: NewspaperListBean = {} as NewspaperListBean | 13 | newspaperListBean: NewspaperListBean = {} as NewspaperListBean |
| 14 | + private listScroller: Scroller = new Scroller(); | ||
| 15 | + //文字版选择弹框 | ||
| 16 | + pageListDialogController: CustomDialogController = new CustomDialogController({ | ||
| 17 | + builder: ENewspaperPageDialog({ | ||
| 18 | + dialogType: 1, | ||
| 19 | + newspaperListBean: this.newspaperListBean, | ||
| 20 | + }), | ||
| 21 | + alignment: DialogAlignment.TopStart, | ||
| 22 | + offset: { dx: 0, dy: 214 }, | ||
| 23 | + customStyle: true, | ||
| 24 | + }) | ||
| 25 | + //页面半屏弹窗(实现在上个组件)若尝试在CustomDialog中传入多个其他的Controller, | ||
| 26 | + // 以实现在CustomDialog中打开另一个或另一些CustomDialog, | ||
| 27 | + // 那么此处需要将指向自己的controller放在所有controller的后面 | ||
| 28 | + listDialogController: CustomDialogController | ||
| 29 | + | ||
| 30 | + //watch监听报纸页码回调 | ||
| 31 | + onCurrentPageNumUpdated(): void { | ||
| 32 | + console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | ||
| 33 | + let _scrollIndex = Number.parseInt(this.currentPageNum) | ||
| 34 | + console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "_scrollIndex:", _scrollIndex) | ||
| 35 | + this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex | ||
| 36 | + this.listScroller.scrollToIndex(this.scrollIndex) | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + aboutToAppear(): void { | ||
| 40 | + console.log("ENewspaperListDialog-aboutToAppear", "currentPageNum:", this.currentPageNum) | ||
| 41 | + let _scrollIndex = Number.parseInt(this.currentPageNum) | ||
| 42 | + console.log("ENewspaperListDialog-aboutToAppear", "_scrollIndex:", _scrollIndex) | ||
| 43 | + this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex | ||
| 44 | + // this.listScroller.scrollToIndex(this.scrollIndex) | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + aboutToDisappear() { | ||
| 48 | + // if (this.pageListDialogController) { | ||
| 49 | + // this.pageListDialogController = null | ||
| 50 | + // } | ||
| 51 | + } | ||
| 8 | 52 | ||
| 9 | build() { | 53 | build() { |
| 10 | Column() { | 54 | Column() { |
| 55 | + Row() | ||
| 56 | + .width(43) | ||
| 57 | + .height(4) | ||
| 58 | + .backgroundColor('#EDEDED') | ||
| 59 | + .margin({ | ||
| 60 | + top: 10, | ||
| 61 | + bottom: 10 | ||
| 62 | + }) | ||
| 11 | Row() { | 63 | Row() { |
| 12 | Text(this.currentPageNum) | 64 | Text(this.currentPageNum) |
| 13 | .fontSize($r('app.float.font_size_36')) | 65 | .fontSize($r('app.float.font_size_36')) |
| 14 | .fontColor($r('app.color.color_222222')) | 66 | .fontColor($r('app.color.color_222222')) |
| 67 | + .fontFamily('BebasNeue_Regular') | ||
| 15 | Text('版') | 68 | Text('版') |
| 16 | .fontSize($r('app.float.font_size_16')) | 69 | .fontSize($r('app.float.font_size_16')) |
| 17 | .fontColor($r('app.color.color_222222')) | 70 | .fontColor($r('app.color.color_222222')) |
| @@ -23,8 +76,16 @@ export struct ENewspaperListDialog { | @@ -23,8 +76,16 @@ export struct ENewspaperListDialog { | ||
| 23 | .margin({ left: 2, bottom: 6 }) | 76 | .margin({ left: 2, bottom: 6 }) |
| 24 | } | 77 | } |
| 25 | .alignItems(VerticalAlign.Bottom) | 78 | .alignItems(VerticalAlign.Bottom) |
| 26 | - .margin({ top: 25, left: 15 }) | 79 | + .margin({ left: 15 }) |
| 27 | .alignSelf(ItemAlign.Start) | 80 | .alignSelf(ItemAlign.Start) |
| 81 | + .onClick(() => { | ||
| 82 | + this.pageDialogShow = !this.pageDialogShow | ||
| 83 | + if (this.pageDialogShow) { | ||
| 84 | + this.pageListDialogController.open() | ||
| 85 | + } else { | ||
| 86 | + this.pageListDialogController.close() | ||
| 87 | + } | ||
| 88 | + }) | ||
| 28 | 89 | ||
| 29 | Image($r('app.media.line')) | 90 | Image($r('app.media.line')) |
| 30 | .width('100%') | 91 | .width('100%') |
| @@ -32,73 +93,85 @@ export struct ENewspaperListDialog { | @@ -32,73 +93,85 @@ export struct ENewspaperListDialog { | ||
| 32 | .margin({ top: 20, left: 16, right: 16 }) | 93 | .margin({ top: 20, left: 16, right: 16 }) |
| 33 | .objectFit(ImageFit.Contain) | 94 | .objectFit(ImageFit.Contain) |
| 34 | 95 | ||
| 35 | - List() { | 96 | + List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { |
| 36 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | 97 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { |
| 37 | - ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => { | ||
| 38 | - ListItem() { | ||
| 39 | - Column(){ | ||
| 40 | - if (itemIndex == 0) { | ||
| 41 | - Text(item.pageNum + item.pageName) | ||
| 42 | - .fontSize($r('app.float.font_size_14')) | ||
| 43 | - .fontColor($r('app.color.color_ED2800')) | ||
| 44 | - .margin({ top: 16 }) | ||
| 45 | - .maxLines(1) | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - if (positionItem.shortTitle) { | ||
| 49 | - Text(positionItem.shortTitle) | ||
| 50 | - .fontSize($r('app.float.font_size_14')) | ||
| 51 | - .fontColor($r('app.color.color_222222')) | ||
| 52 | - .margin({ top: 16 }) | ||
| 53 | - .maxLines(2) | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - if (positionItem.title) { | ||
| 57 | - Text(positionItem.title) | ||
| 58 | - .fontSize($r('app.float.font_size_17')) | ||
| 59 | - .fontColor($r('app.color.color_222222')) | ||
| 60 | - .margin({ top: 16 }) | ||
| 61 | - .maxLines(2) | 98 | + ListItem() { |
| 99 | + List() { | ||
| 100 | + ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => { | ||
| 101 | + ListItem() { | ||
| 102 | + Column() { | ||
| 103 | + if (itemIndex == 0) { | ||
| 104 | + Text(item.pageNum + item.pageName) | ||
| 105 | + .fontSize($r('app.float.font_size_14')) | ||
| 106 | + .fontColor($r('app.color.color_ED2800')) | ||
| 107 | + .fontWeight(600) | ||
| 108 | + .margin({ top: 16, bottom: 16 }) | ||
| 109 | + .maxLines(1) | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + if (positionItem.shortTitle) { | ||
| 113 | + Text(positionItem.shortTitle) | ||
| 114 | + .fontSize($r('app.float.font_size_14')) | ||
| 115 | + .fontColor($r('app.color.color_222222')) | ||
| 116 | + .fontWeight(600) | ||
| 117 | + .maxLines(2) | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + if (positionItem.title) { | ||
| 121 | + Text(positionItem.title) | ||
| 122 | + .fontSize($r('app.float.font_size_17')) | ||
| 123 | + .fontColor($r('app.color.color_222222')) | ||
| 124 | + .margin({ top: 8 }) | ||
| 125 | + .maxLines(2) | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + if (positionItem.downTitle) { | ||
| 129 | + Text(positionItem.downTitle) | ||
| 130 | + .fontSize($r('app.float.font_size_14')) | ||
| 131 | + .fontColor($r('app.color.color_222222')) | ||
| 132 | + .fontWeight(600) | ||
| 133 | + .margin({ top: 8 }) | ||
| 134 | + .maxLines(2) | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + if (positionItem.newsTxt) { | ||
| 138 | + Text(positionItem.newsTxt) | ||
| 139 | + .fontSize($r('app.float.font_size_14')) | ||
| 140 | + .fontColor($r('app.color.color_999999')) | ||
| 141 | + .margin({ top: 15, bottom: 15 }) | ||
| 142 | + .maxLines(5) | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + .alignItems(HorizontalAlign.Start) | ||
| 62 | } | 146 | } |
| 63 | 147 | ||
| 64 | - if (positionItem.downTitle) { | ||
| 65 | - Text(positionItem.downTitle) | ||
| 66 | - .fontSize($r('app.float.font_size_14')) | ||
| 67 | - .fontColor($r('app.color.color_222222')) | ||
| 68 | - .margin({ top: 16 }) | ||
| 69 | - .maxLines(2) | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - if (positionItem.newsTxt) { | ||
| 73 | - Text(positionItem.newsTxt) | ||
| 74 | - .fontSize($r('app.float.font_size_14')) | ||
| 75 | - .fontColor($r('app.color.color_999999')) | ||
| 76 | - .margin({ top: 16, bottom: 16 }) | ||
| 77 | - .maxLines(5) | ||
| 78 | - } | ||
| 79 | - } | ||
| 80 | - .alignItems(HorizontalAlign.Start) | 148 | + }) |
| 81 | } | 149 | } |
| 82 | - | ||
| 83 | - }) | ||
| 84 | - | 150 | + } |
| 85 | }) | 151 | }) |
| 86 | - | ||
| 87 | } | 152 | } |
| 88 | .width('100%') | 153 | .width('100%') |
| 89 | - .margin({ top: 16, left: 16, right: 16 }) | 154 | + .padding({ left: 15, right: 15 }) |
| 90 | .scrollBar(BarState.Off) | 155 | .scrollBar(BarState.Off) |
| 91 | .divider({ | 156 | .divider({ |
| 92 | - strokeWidth: 1, | 157 | + strokeWidth: 0.5, |
| 93 | color: '#EDEDED' | 158 | color: '#EDEDED' |
| 94 | }) | 159 | }) |
| 95 | .onScrollIndex((firstIndex: number) => { | 160 | .onScrollIndex((firstIndex: number) => { |
| 96 | - this.updateCurrentPageNum(firstIndex) | 161 | + console.log('firstIndex', firstIndex) |
| 162 | + }) | ||
| 163 | + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { | ||
| 164 | + console.info('first' + firstIndex) | ||
| 165 | + console.info('last' + lastIndex) | ||
| 166 | + console.info('center' + centerIndex) | ||
| 167 | + // this.updateCurrentPageNum(firstIndex) | ||
| 168 | + this.currentPageNum = `${centerIndex < 9 ? '0' + (centerIndex + 1) : centerIndex + 1}` | ||
| 169 | + }) | ||
| 170 | + .onScroll((scrollOffset: number, scrollState: ScrollState) => { | ||
| 171 | + console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) | ||
| 97 | }) | 172 | }) |
| 98 | - | ||
| 99 | } | 173 | } |
| 100 | .width('100%') | 174 | .width('100%') |
| 101 | - .height(674) | ||
| 102 | .backgroundColor(Color.White) | 175 | .backgroundColor(Color.White) |
| 103 | 176 | ||
| 104 | } | 177 | } |
| @@ -107,20 +180,19 @@ export struct ENewspaperListDialog { | @@ -107,20 +180,19 @@ export struct ENewspaperListDialog { | ||
| 107 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 180 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 108 | let index = 0; | 181 | let index = 0; |
| 109 | for (let itemBean of this.newspaperListBean.list) { | 182 | for (let itemBean of this.newspaperListBean.list) { |
| 110 | - if (itemBean.items && itemBean.items.length > 0){ | ||
| 111 | - for (let item of itemBean.items){ | 183 | + if (itemBean.items && itemBean.items.length > 0) { |
| 184 | + for (let item of itemBean.items) { | ||
| 112 | index++ | 185 | index++ |
| 113 | - if (index == firstIndex){ | 186 | + if (index == firstIndex) { |
| 114 | this.currentPageNum = itemBean.pageNum | 187 | this.currentPageNum = itemBean.pageNum |
| 115 | return | 188 | return |
| 116 | } | 189 | } |
| 117 | - | ||
| 118 | } | 190 | } |
| 119 | } | 191 | } |
| 120 | } | 192 | } |
| 121 | } | 193 | } |
| 122 | 194 | ||
| 123 | - } | 195 | + } |
| 124 | } | 196 | } |
| 125 | 197 | ||
| 126 | 198 |
| 1 | +import { NewspaperListBean, NewspaperListItemBean } from 'wdBean/Index' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 期刊日期选择弹窗 | ||
| 5 | + */ | ||
| 6 | +@CustomDialog | ||
| 7 | +export struct ENewspaperPageDialog { | ||
| 8 | + dialogType: number = 0 //0:图片版,1:文字版 | ||
| 9 | + pageDialogController?: CustomDialogController | ||
| 10 | + @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string | ||
| 11 | + @Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean | ||
| 12 | + | ||
| 13 | + onCurrentPageNumUpdated(): void { | ||
| 14 | + console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + build() { | ||
| 18 | + Column() { | ||
| 19 | + if (this.dialogType == 1) { | ||
| 20 | + Image($r("app.media.iv_e_news_pager_calendar_arrow_up")) | ||
| 21 | + .width(18).height(8.5) | ||
| 22 | + .margin({ left: 31 }) | ||
| 23 | + } | ||
| 24 | + Stack() { | ||
| 25 | + GridRow({ columns: 5, gutter: { x: 15, y: 15 } }) { | ||
| 26 | + ForEach(this.newspaperListBean.list, (item: NewspaperListItemBean, index) => { | ||
| 27 | + GridCol() { | ||
| 28 | + Row() { | ||
| 29 | + Text(item.pageNum) | ||
| 30 | + .fontSize($r('app.float.normal_text_size')) | ||
| 31 | + .fontColor(this.currentPageNum == item.pageNum ? Color.White : $r('app.color.color_222222')) | ||
| 32 | + .fontFamily('BebasNeue_Regular') | ||
| 33 | + } | ||
| 34 | + .alignItems(VerticalAlign.Center) | ||
| 35 | + .justifyContent(FlexAlign.Center) | ||
| 36 | + .width(30) | ||
| 37 | + .height(30) | ||
| 38 | + .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800')) | ||
| 39 | + .onClick((event: ClickEvent) => { | ||
| 40 | + this.currentPageNum = item.pageNum | ||
| 41 | + if (this.pageDialogController) { | ||
| 42 | + this.pageDialogController.close() | ||
| 43 | + } | ||
| 44 | + }) | ||
| 45 | + } | ||
| 46 | + }) | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | + .padding(20) | ||
| 50 | + .width(260) | ||
| 51 | + .borderRadius(4) | ||
| 52 | + .backgroundColor(Color.White) | ||
| 53 | + | ||
| 54 | + if (this.dialogType == 0) { | ||
| 55 | + Image($r("app.media.iv_e_news_pager_calendar_arrow_down")) | ||
| 56 | + .width(18).height(8.5) | ||
| 57 | + .margin({ left: 31 }) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + .margin({ left: 10 }) | ||
| 61 | + .alignItems(HorizontalAlign.Start) | ||
| 62 | + } | ||
| 63 | +} |
| @@ -12,6 +12,7 @@ import { FollowListItem } from '../viewmodel/FollowListItem'; | @@ -12,6 +12,7 @@ import { FollowListItem } from '../viewmodel/FollowListItem'; | ||
| 12 | import { MineFollowListItem } from '../viewmodel/MineFollowListItem'; | 12 | import { MineFollowListItem } from '../viewmodel/MineFollowListItem'; |
| 13 | import { QueryListIsFollowedItem } from '../viewmodel/QueryListIsFollowedItem'; | 13 | import { QueryListIsFollowedItem } from '../viewmodel/QueryListIsFollowedItem'; |
| 14 | import { FollowListStatusRequestItem } from '../viewmodel/FollowListStatusRequestItem'; | 14 | import { FollowListStatusRequestItem } from '../viewmodel/FollowListStatusRequestItem'; |
| 15 | +import { MineCommentListDetailItem } from '../viewmodel/MineCommentListDetailItem'; | ||
| 15 | 16 | ||
| 16 | const TAG = "MinePageDatasModel" | 17 | const TAG = "MinePageDatasModel" |
| 17 | 18 | ||
| @@ -295,6 +296,48 @@ class MinePageDatasModel{ | @@ -295,6 +296,48 @@ class MinePageDatasModel{ | ||
| 295 | } | 296 | } |
| 296 | 297 | ||
| 297 | 298 | ||
| 299 | + /** | ||
| 300 | + * 我的评论列表 | ||
| 301 | + * @param params | ||
| 302 | + * @param context | ||
| 303 | + * @returns | ||
| 304 | + */ | ||
| 305 | + getMineCommentListData(params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> { | ||
| 306 | + return new Promise<MineCommentListDetailItem>((success, error) => { | ||
| 307 | + Logger.info(TAG, `getAppointmentList start`); | ||
| 308 | + this.fetchMineCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { | ||
| 309 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 310 | + success(this.getMineCommentListDataLocal(context)) | ||
| 311 | + return | ||
| 312 | + } | ||
| 313 | + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 314 | + let navigationBean = navResDTO.data as MineCommentListDetailItem | ||
| 315 | + success(navigationBean); | ||
| 316 | + }).catch((err: Error) => { | ||
| 317 | + Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 318 | + success(this.getMineCommentListDataLocal(context)) | ||
| 319 | + }) | ||
| 320 | + }) | ||
| 321 | + } | ||
| 322 | + | ||
| 323 | + fetchMineCommentListData(object:FollowListDetailRequestItem) { | ||
| 324 | + let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}` | ||
| 325 | + let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); | ||
| 326 | + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) | ||
| 327 | + }; | ||
| 328 | + | ||
| 329 | + async getMineCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> { | ||
| 330 | + Logger.info(TAG, `getMineFollowListDataLocal start`); | ||
| 331 | + let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'mine_comment_list_data.json' ); | ||
| 332 | + if (!compRes || !compRes.data) { | ||
| 333 | + Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`); | ||
| 334 | + return new MineCommentListDetailItem() | ||
| 335 | + } | ||
| 336 | + Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 337 | + return compRes.data | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + | ||
| 298 | } | 341 | } |
| 299 | 342 | ||
| 300 | const minePageDatasModel = MinePageDatasModel.getInstance() | 343 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| 1 | + | ||
| 2 | +import HashMap from '@ohos.util.HashMap'; | ||
| 3 | +import { ResponseDTO, WDHttp } from 'wdNetwork'; | ||
| 4 | +import { Logger } from 'wdKit'; | ||
| 5 | +import { MineMainSettingFunctionItem } from '../viewmodel/MineMainSettingFunctionItem'; | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +const TAG = "MineSettingDatasModel" | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 我的设置页面 所有数据 获取封装类 | ||
| 12 | + */ | ||
| 13 | +class MineSettingDatasModel{ | ||
| 14 | + private static instance: MineSettingDatasModel; | ||
| 15 | + mainSettingData:Array<MineMainSettingFunctionItem> = [] | ||
| 16 | + accountAndSecurityData:Array<MineMainSettingFunctionItem> = [] | ||
| 17 | + | ||
| 18 | + private constructor() { } | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 单例模式 | ||
| 22 | + * @returns | ||
| 23 | + */ | ||
| 24 | + public static getInstance(): MineSettingDatasModel { | ||
| 25 | + if (!MineSettingDatasModel.instance) { | ||
| 26 | + MineSettingDatasModel.instance = new MineSettingDatasModel(); | ||
| 27 | + } | ||
| 28 | + return MineSettingDatasModel.instance; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 评论 关注 收藏 等7个数据 | ||
| 36 | + * 包含名字和图标 | ||
| 37 | + */ | ||
| 38 | + getMineMainSettingFunctionItemData():MineMainSettingFunctionItem[]{ | ||
| 39 | + if(this.mainSettingData.length === 7){ | ||
| 40 | + return this.mainSettingData | ||
| 41 | + } | ||
| 42 | + this.mainSettingData = [] | ||
| 43 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '账户与安全', '18888888888', 0, false)) | ||
| 44 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, false)) | ||
| 45 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false)) | ||
| 46 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅WiFi网络加载图片', null, 1, false)) | ||
| 47 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'WiFi网络情况下自动播放视频', null, 1, false)) | ||
| 48 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开户播放器悬浮窗', null, 1, false)) | ||
| 49 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 50 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清除缓存', '32MB', 0, false)) | ||
| 51 | + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '去评分', null, 0, false)) | ||
| 52 | + | ||
| 53 | + return this.mainSettingData | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * 评论 关注 收藏 等7个数据 | ||
| 58 | + * 包含名字和图标 | ||
| 59 | + */ | ||
| 60 | + getAccountAndSecuritySettingData():MineMainSettingFunctionItem[]{ | ||
| 61 | + if(this.accountAndSecurityData.length === 7){ | ||
| 62 | + return this.accountAndSecurityData | ||
| 63 | + } | ||
| 64 | + this.accountAndSecurityData = [] | ||
| 65 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false)) | ||
| 66 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false)) | ||
| 67 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 68 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_qqicon'), '绑定QQ', '立即绑定', 0, false)) | ||
| 69 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_wechaticon'), '绑定微信', '立即绑定', 0, false)) | ||
| 70 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_weiboicon'), '绑定新浪微博', '立即绑定', 0, false)) | ||
| 71 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_appleicon'), 'Apple ID', null, 0, false)) | ||
| 72 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null)) | ||
| 73 | + | ||
| 74 | + this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false)) | ||
| 75 | + | ||
| 76 | + return this.accountAndSecurityData | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + // 网络请求设置数据 | ||
| 82 | + fetchAppointmentListData(pageSize:string,pageNum:string) { | ||
| 83 | + // let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}` | ||
| 84 | + // let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders(); | ||
| 85 | + // return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers) | ||
| 86 | + }; | ||
| 87 | + | ||
| 88 | + // getAppointmentListData(pageSize:string,pageNum:string): Promise<MineAppointmentListItem> { | ||
| 89 | + // return new Promise<MineAppointmentListItem>((success, error) => { | ||
| 90 | + // Logger.info(TAG, `getAppointmentList start`); | ||
| 91 | + // this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => { | ||
| 92 | + // if (!navResDTO) { | ||
| 93 | + // error("page data invalid"); | ||
| 94 | + // return | ||
| 95 | + // } | ||
| 96 | + // Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 97 | + // let navigationBean = navResDTO.data | ||
| 98 | + // success(navigationBean); | ||
| 99 | + // }).catch((err: Error) => { | ||
| 100 | + // Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 101 | + // error(err); | ||
| 102 | + // }) | ||
| 103 | + // }) | ||
| 104 | + // } | ||
| 105 | + | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +const mineSettingDatasModel = MineSettingDatasModel.getInstance() | ||
| 109 | +export default mineSettingDatasModel as MineSettingDatasModel | ||
| 110 | +// export default MineMainSettingFunctionItem as MineMainSettingFunctionItem |
| 1 | +import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; | ||
| 2 | +@Observed | ||
| 3 | +export class PrivacySettingModel{ | ||
| 4 | + privacyName: string | ||
| 5 | + permission: boolean | ||
| 6 | + permissionKey: Permissions | ||
| 7 | + | ||
| 8 | + constructor(privacyName: string, permission: boolean, permissionKey: Permissions) { | ||
| 9 | + this.privacyName = privacyName; | ||
| 10 | + this.permission = permission; | ||
| 11 | + this.permissionKey = permissionKey; | ||
| 12 | + } | ||
| 13 | +} |
| 1 | +import router from '@ohos.router' | ||
| 2 | +import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; | ||
| 3 | + | ||
| 4 | +@Entry | ||
| 5 | +@Component | ||
| 6 | +struct MineHomePage { | ||
| 7 | + @State tileOpacity: number = 0; | ||
| 8 | + firstPositionY:number = 0; | ||
| 9 | + @State isHasIntroduction: boolean = true | ||
| 10 | + @State desc:string = "点击添加简介,让大家认识你" //text 搞两个样式,如果三行,就显示 另外一个text 没有显示高度的 | ||
| 11 | + fontColor: string = '#999999' | ||
| 12 | + selectedFontColor: string = '#000000' | ||
| 13 | + @State currentIndex: number = 0 | ||
| 14 | + private controller: TabsController = new TabsController() | ||
| 15 | + isChangeToUserEdit = false; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + build() { | ||
| 19 | + Stack({ alignContent: Alignment.Top }){ | ||
| 20 | + Image($r('app.media.title_bg')) | ||
| 21 | + .width('100%') | ||
| 22 | + .height('355lpx') | ||
| 23 | + .objectFit(ImageFit.Cover) | ||
| 24 | + | ||
| 25 | + Column(){ | ||
| 26 | + Stack({ alignContent: Alignment.Top }){ | ||
| 27 | + this.MineHomeTitleTransparent() | ||
| 28 | + this.MineHomeTitleWhite() | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + Scroll() { | ||
| 32 | + Column() { | ||
| 33 | + //用户信息区域 | ||
| 34 | + Row() { | ||
| 35 | + Image($r('app.media.default_head')) | ||
| 36 | + .width('115lpx') | ||
| 37 | + .height('115lpx') | ||
| 38 | + .objectFit(ImageFit.Cover) | ||
| 39 | + .borderRadius(50) | ||
| 40 | + | ||
| 41 | + Column() { | ||
| 42 | + Row() { | ||
| 43 | + Text("人民日报6G") | ||
| 44 | + .fontColor($r('app.color.white')) | ||
| 45 | + .maxLines(1) | ||
| 46 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 47 | + .fontSize('38lpx') | ||
| 48 | + .lineHeight('50lpx') | ||
| 49 | + .fontWeight('500lpx') | ||
| 50 | + | ||
| 51 | + Text("等级8") | ||
| 52 | + .textAlign(TextAlign.Center) | ||
| 53 | + .fontColor($r('app.color.color_ED2800')) | ||
| 54 | + .backgroundColor($r('app.color.white')) | ||
| 55 | + .fontSize('19lpx') | ||
| 56 | + .width('96lpx') | ||
| 57 | + .height('35lpx') | ||
| 58 | + .margin({ left: '10lpx' }) | ||
| 59 | + Blank() | ||
| 60 | + }.width('507lpx') | ||
| 61 | + | ||
| 62 | + Row() { | ||
| 63 | + Row() { | ||
| 64 | + Text("3.6万") | ||
| 65 | + .textStyle() | ||
| 66 | + Text("阅读") | ||
| 67 | + .textStyle2() | ||
| 68 | + } | ||
| 69 | + .margin({ right: '15lpx' }) | ||
| 70 | + | ||
| 71 | + Divider() | ||
| 72 | + .height('19lpx') | ||
| 73 | + .width('2lpx') | ||
| 74 | + .color($r('app.color.white')) | ||
| 75 | + .vertical(true) | ||
| 76 | + .opacity(0.4) | ||
| 77 | + Row() { | ||
| 78 | + Text("6242") | ||
| 79 | + .textStyle() | ||
| 80 | + Text("评论") | ||
| 81 | + .textStyle2() | ||
| 82 | + }.margin({ right: '15lpx', left: '15lpx' }) | ||
| 83 | + | ||
| 84 | + Divider() | ||
| 85 | + .height('19lpx') | ||
| 86 | + .width('2lpx') | ||
| 87 | + .color($r('app.color.white')) | ||
| 88 | + .vertical(true) | ||
| 89 | + .opacity(0.4) | ||
| 90 | + Row() { | ||
| 91 | + Text("86") | ||
| 92 | + .textStyle() | ||
| 93 | + Text("关注") | ||
| 94 | + .textStyle2() | ||
| 95 | + }.margin({ left: '15lpx' }) | ||
| 96 | + }.margin({ top: '23lpx' }) | ||
| 97 | + }.alignItems(HorizontalAlign.Start) | ||
| 98 | + .margin({ left: '32lpx' }) | ||
| 99 | + } | ||
| 100 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 101 | + if (this.firstPositionY === 0) { | ||
| 102 | + this.firstPositionY = newValue.globalPosition.y as number | ||
| 103 | + }else{ | ||
| 104 | + let persent = (this.firstPositionY - Number(newValue.globalPosition.y)) / (this.firstPositionY * 0.3) | ||
| 105 | + if(persent > 1){ | ||
| 106 | + persent = 1 | ||
| 107 | + } | ||
| 108 | + this.tileOpacity = persent | ||
| 109 | + } | ||
| 110 | + }) | ||
| 111 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 112 | + .height('184lpx') | ||
| 113 | + .width('100%') | ||
| 114 | + .padding({ left: '35lpx' }) | ||
| 115 | + //用户简介区域 | ||
| 116 | + Column() { | ||
| 117 | + Row() { | ||
| 118 | + Text(this.desc) | ||
| 119 | + .fontSize('27lpx') | ||
| 120 | + .maxLines(3) | ||
| 121 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 122 | + .lineHeight('40lpx') | ||
| 123 | + .fontWeight('400lpx') | ||
| 124 | + .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) | ||
| 125 | + .textAlign(TextAlign.Start) | ||
| 126 | + | ||
| 127 | + if(!this.isHasIntroduction){ | ||
| 128 | + Image($r('app.media.user_info_edit_icon')) | ||
| 129 | + .width('27lpx') | ||
| 130 | + .height('27lpx') | ||
| 131 | + .objectFit(ImageFit.Auto) | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + Text("来到人民日报365天") | ||
| 135 | + .fontSize('23lpx') | ||
| 136 | + .lineHeight('25lpx') | ||
| 137 | + .fontWeight('400lpx') | ||
| 138 | + .fontColor($r('app.color.color_999999')) | ||
| 139 | + .textAlign(TextAlign.Start) | ||
| 140 | + .margin({ top: '15lpx' }) | ||
| 141 | + | ||
| 142 | + }.padding({ left: '31lpx',right:'31lpx',top:'19lpx',bottom:'31lpx'}) | ||
| 143 | + .alignItems(HorizontalAlign.Start) | ||
| 144 | + .justifyContent(FlexAlign.Center) | ||
| 145 | + .width('100%') | ||
| 146 | + .backgroundColor($r('app.color.white')) | ||
| 147 | + //间隔符 | ||
| 148 | + | ||
| 149 | + Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | ||
| 150 | + | ||
| 151 | + //tab 页面 | ||
| 152 | + Tabs({controller: this.controller}) { | ||
| 153 | + TabContent() { | ||
| 154 | + HomePageBottomComponent({style:0}) | ||
| 155 | + }.tabBar(this.TabBuilder(0,"评论")) | ||
| 156 | + TabContent() { | ||
| 157 | + HomePageBottomComponent({style:1}) | ||
| 158 | + }.tabBar(this.TabBuilder(1,"关注")) | ||
| 159 | + } | ||
| 160 | + .backgroundColor($r('app.color.white')) | ||
| 161 | + .animationDuration(0) | ||
| 162 | + .onChange((index: number) => { | ||
| 163 | + this.currentIndex = index | ||
| 164 | + }) | ||
| 165 | + .vertical(false) | ||
| 166 | + .height("100%") | ||
| 167 | + }.width("100%") | ||
| 168 | + } | ||
| 169 | + .edgeEffect(EdgeEffect.None) | ||
| 170 | + .scrollBar(BarState.Off) | ||
| 171 | + .width('100%') | ||
| 172 | + .height('100%') | ||
| 173 | + } | ||
| 174 | + }.width('100%') | ||
| 175 | + .height('100%') | ||
| 176 | + | ||
| 177 | + } | ||
| 178 | + @Builder MineHomeTitleTransparent() { | ||
| 179 | + RelativeContainer() { | ||
| 180 | + //标题栏目 | ||
| 181 | + Image($r('app.media.icon_arrow_left_white') ) | ||
| 182 | + .width('46lpx') | ||
| 183 | + .height('46lpx') | ||
| 184 | + .objectFit(ImageFit.Auto) | ||
| 185 | + .id("back_icon") | ||
| 186 | + .alignRules({ | ||
| 187 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 188 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 189 | + }) | ||
| 190 | + .margin({ left: '31lpx' }) | ||
| 191 | + .onClick(() => { | ||
| 192 | + router.back() | ||
| 193 | + }) | ||
| 194 | + | ||
| 195 | + Text("编辑资料") | ||
| 196 | + .height('42lpx') | ||
| 197 | + .maxLines(1) | ||
| 198 | + .id("rightText") | ||
| 199 | + .fontSize('35lpx') | ||
| 200 | + .fontWeight('400lpx') | ||
| 201 | + .fontColor($r('app.color.white') ) | ||
| 202 | + .lineHeight('42lpx') | ||
| 203 | + .alignRules({ | ||
| 204 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 205 | + right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 206 | + }) | ||
| 207 | + .margin({ right: '31lpx' }) | ||
| 208 | + .onClick(()=>{ | ||
| 209 | + this.editUserInfo() | ||
| 210 | + }) | ||
| 211 | + } | ||
| 212 | + .visibility(this.tileOpacity > 0 ? 1 : 0) | ||
| 213 | + .height('84lpx') | ||
| 214 | + .width('100%') | ||
| 215 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + | ||
| 219 | + @Builder MineHomeTitleWhite() { | ||
| 220 | + RelativeContainer() { | ||
| 221 | + //标题栏目 | ||
| 222 | + Image($r('app.media.back_icon')) | ||
| 223 | + .width('46lpx') | ||
| 224 | + .height('46lpx') | ||
| 225 | + .objectFit(ImageFit.Auto) | ||
| 226 | + .id("back_icon") | ||
| 227 | + .alignRules({ | ||
| 228 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 229 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 230 | + }) | ||
| 231 | + .margin({ left: '31lpx' }) | ||
| 232 | + .onClick(() => { | ||
| 233 | + router.back() | ||
| 234 | + }) | ||
| 235 | + Image($r('app.media.default_head')) | ||
| 236 | + .width('60lpx') | ||
| 237 | + .height('60lpx') | ||
| 238 | + .objectFit(ImageFit.Auto) | ||
| 239 | + .id("head_icon") | ||
| 240 | + .alignRules({ | ||
| 241 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 242 | + left: { anchor: "back_icon", align: HorizontalAlign.End } | ||
| 243 | + }) | ||
| 244 | + .margin({ left: '31lpx' }) | ||
| 245 | + .onClick(() => { | ||
| 246 | + router.back() | ||
| 247 | + }) | ||
| 248 | + | ||
| 249 | + Text("我的昵称") | ||
| 250 | + .height('42lpx') | ||
| 251 | + .maxLines(1) | ||
| 252 | + .id("title") | ||
| 253 | + .fontSize('35lpx') | ||
| 254 | + .fontWeight('400lpx') | ||
| 255 | + .fontColor($r('app.color.color_222222')) | ||
| 256 | + .lineHeight('42lpx') | ||
| 257 | + .alignRules({ | ||
| 258 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 259 | + left: { anchor: "head_icon", align: HorizontalAlign.End } | ||
| 260 | + }) | ||
| 261 | + .margin({ left: '12lpx' }) | ||
| 262 | + | ||
| 263 | + Text("编辑资料") | ||
| 264 | + .height('42lpx') | ||
| 265 | + .maxLines(1) | ||
| 266 | + .id("rightText") | ||
| 267 | + .fontSize('35lpx') | ||
| 268 | + .fontWeight('400lpx') | ||
| 269 | + .fontColor($r('app.color.color_222222')) | ||
| 270 | + .lineHeight('42lpx') | ||
| 271 | + .alignRules({ | ||
| 272 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 273 | + right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 274 | + }) | ||
| 275 | + .margin({ right: '31lpx' }) | ||
| 276 | + .onClick(()=>{ | ||
| 277 | + this.editUserInfo() | ||
| 278 | + }) | ||
| 279 | + } | ||
| 280 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 281 | + .height('84lpx') | ||
| 282 | + .width('100%') | ||
| 283 | + .backgroundColor($r('app.color.white')) | ||
| 284 | + .opacity(this.tileOpacity ) | ||
| 285 | + | ||
| 286 | + } | ||
| 287 | + | ||
| 288 | + @Builder TabBuilder(index: number, title: string) { | ||
| 289 | + Stack(){ | ||
| 290 | + Text(title) | ||
| 291 | + .height('38lpx') | ||
| 292 | + .fontSize('33lpx') | ||
| 293 | + .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 294 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 295 | + .lineHeight('38lpx') | ||
| 296 | + | ||
| 297 | + if(this.currentIndex === index){ | ||
| 298 | + Divider() | ||
| 299 | + .width('31lpx') | ||
| 300 | + .height('4lpx') | ||
| 301 | + .color('#ED2800') | ||
| 302 | + .strokeWidth('4lpx') | ||
| 303 | + .margin({top:'50lpx'}) | ||
| 304 | + .id("divTag") | ||
| 305 | + } | ||
| 306 | + }.onClick(()=>{ | ||
| 307 | + this.currentIndex = index | ||
| 308 | + this.controller.changeIndex(this.currentIndex) | ||
| 309 | + }) | ||
| 310 | + .height('100%') | ||
| 311 | + .width('100%') | ||
| 312 | + .margin({right:'9lpx'}) | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + /** | ||
| 316 | + * 跳转编辑资料(防止二次点击) | ||
| 317 | + */ | ||
| 318 | + editUserInfo(){ | ||
| 319 | + if(!this.isChangeToUserEdit){ | ||
| 320 | + this.isChangeToUserEdit = true; | ||
| 321 | + let c = setInterval(() => { | ||
| 322 | + this.isChangeToUserEdit = false | ||
| 323 | + }, 1000); | ||
| 324 | + | ||
| 325 | + //route 跳转写这里 TODO | ||
| 326 | + } | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | +} | ||
| 330 | + | ||
| 331 | +@Extend(Text) function textStyle() { | ||
| 332 | + .fontColor($r('app.color.white')) | ||
| 333 | + .textStyleDefault() | ||
| 334 | + .margin({ right: '10lpx' }) | ||
| 335 | +} | ||
| 336 | + | ||
| 337 | +@Extend(Text) function textStyle2() { | ||
| 338 | + .textStyleDefault() | ||
| 339 | + .fontColor($r('app.color.color_B2FFFFFF')) | ||
| 340 | +} | ||
| 341 | + | ||
| 342 | +@Extend(Text) function textStyleDefault() { | ||
| 343 | + .textAlign(TextAlign.Start) | ||
| 344 | + .fontSize('23lpx') | ||
| 345 | + .fontWeight('400lpx') | ||
| 346 | + .lineHeight('31lpx') | ||
| 347 | +} | ||
| 348 | + |
| 1 | import HashMap from '@ohos.util.HashMap'; | 1 | import HashMap from '@ohos.util.HashMap'; |
| 2 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 2 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 3 | import { DateTimeUtils, Logger } from 'wdKit'; | 3 | import { DateTimeUtils, Logger } from 'wdKit'; |
| 4 | -import { ContentDetailDTO, NavigationBodyDTO, PageDTO,InteractDataDTO, MorningEveningPaperDTO, | ||
| 5 | - NewspaperTimeInfoBean, | 4 | +import { |
| 5 | + CompInfoBean, | ||
| 6 | + ContentDetailDTO, | ||
| 7 | + InteractDataDTO, | ||
| 8 | + MorningEveningPaperDTO, | ||
| 9 | + NavigationBodyDTO, | ||
| 6 | NewspaperListBean, | 10 | NewspaperListBean, |
| 7 | - PageInfoBean, | ||
| 8 | - CompInfoBean | 11 | + NewspaperTimeInfoBean, |
| 12 | + PageDTO, | ||
| 13 | + PageInfoBean | ||
| 9 | } from 'wdBean'; | 14 | } from 'wdBean'; |
| 15 | + | ||
| 10 | const TAG = 'HttpRequest'; | 16 | const TAG = 'HttpRequest'; |
| 17 | + | ||
| 11 | export class PageRepository { | 18 | export class PageRepository { |
| 12 | static getBottomNavGroupUrl() { | 19 | static getBottomNavGroupUrl() { |
| 13 | // https: //pd-apis-uat.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup | 20 | // https: //pd-apis-uat.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup |
| @@ -24,7 +31,7 @@ export class PageRepository { | @@ -24,7 +31,7 @@ export class PageRepository { | ||
| 24 | + "&refreshTime=" + DateTimeUtils.getTimeStamp() | 31 | + "&refreshTime=" + DateTimeUtils.getTimeStamp() |
| 25 | + "&pageId=" + pageId | 32 | + "&pageId=" + pageId |
| 26 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 33 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 27 | - Logger.info(TAG,"getPageInfoUrl url = "+url) | 34 | + Logger.info(TAG, "getPageInfoUrl url = " + url) |
| 28 | return url; | 35 | return url; |
| 29 | } | 36 | } |
| 30 | 37 | ||
| @@ -42,29 +49,29 @@ export class PageRepository { | @@ -42,29 +49,29 @@ export class PageRepository { | ||
| 42 | + "&pageSize=" + pageSize | 49 | + "&pageSize=" + pageSize |
| 43 | + "&pageNum=" + currentPage; | 50 | + "&pageNum=" + currentPage; |
| 44 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 51 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 45 | - Logger.info(TAG,"getCompInfoUrl url = "+url) | 52 | + Logger.info(TAG, "getCompInfoUrl url = " + url) |
| 46 | return url; | 53 | return url; |
| 47 | } | 54 | } |
| 48 | 55 | ||
| 49 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { | 56 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { |
| 50 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; | 57 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; |
| 51 | url = url + "?relId=" + relId | 58 | url = url + "?relId=" + relId |
| 52 | - + "&contentId=" + contentId | ||
| 53 | - + "&relType=" + relType; | 59 | + + "&contentId=" + contentId |
| 60 | + + "&relType=" + relType; | ||
| 54 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 61 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 55 | - Logger.info(TAG,"getDetailInfoUrl url = "+url) | 62 | + Logger.info(TAG, "getDetailInfoUrl url = " + url) |
| 56 | return url; | 63 | return url; |
| 57 | } | 64 | } |
| 58 | 65 | ||
| 59 | static getInteractDataUrl() { | 66 | static getInteractDataUrl() { |
| 60 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; | 67 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; |
| 61 | - Logger.info(TAG,"getInteractDataUrl url = "+url) | 68 | + Logger.info(TAG, "getInteractDataUrl url = " + url) |
| 62 | return url; | 69 | return url; |
| 63 | } | 70 | } |
| 64 | 71 | ||
| 65 | - static getNewspaperInfoUrl() { | ||
| 66 | - let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_INFO_PATH; | ||
| 67 | - Logger.info(TAG,"getNewspaperInfoUrl url = "+url) | 72 | + static getNewspaperInfoUrl(date: string) { |
| 73 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_INFO_PATH + "?date=" + date; | ||
| 74 | + Logger.info(TAG, "getNewspaperInfoUrl url = " + url) | ||
| 68 | return url; | 75 | return url; |
| 69 | } | 76 | } |
| 70 | 77 | ||
| @@ -72,7 +79,7 @@ export class PageRepository { | @@ -72,7 +79,7 @@ export class PageRepository { | ||
| 72 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_LIST_PATH; | 79 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_LIST_PATH; |
| 73 | url = url + "?date=" + date | 80 | url = url + "?date=" + date |
| 74 | + "&pagesSize=" + pageSize; | 81 | + "&pagesSize=" + pageSize; |
| 75 | - Logger.info(TAG,"getNewspaperListUrl url = "+url) | 82 | + Logger.info(TAG, "getNewspaperListUrl url = " + url) |
| 76 | return url; | 83 | return url; |
| 77 | } | 84 | } |
| 78 | 85 | ||
| @@ -82,7 +89,7 @@ export class PageRepository { | @@ -82,7 +89,7 @@ export class PageRepository { | ||
| 82 | static getMorningEveningPageInfoUrl(pageId: string) { | 89 | static getMorningEveningPageInfoUrl(pageId: string) { |
| 83 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; | 90 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; |
| 84 | url = url + "?pageId=" + pageId; | 91 | url = url + "?pageId=" + pageId; |
| 85 | - Logger.info(TAG,"getMorningEveningPageInfoUrl url = "+url) | 92 | + Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| 86 | return url; | 93 | return url; |
| 87 | } | 94 | } |
| 88 | 95 | ||
| @@ -99,11 +106,11 @@ export class PageRepository { | @@ -99,11 +106,11 @@ export class PageRepository { | ||
| 99 | * channelStrategy:频道策略 | 106 | * channelStrategy:频道策略 |
| 100 | * topicId:专题id | 107 | * topicId:专题id |
| 101 | * */ | 108 | * */ |
| 102 | - static getMorningEveningCompInfoUrl(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) { | 109 | + static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { |
| 103 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; | 110 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; |
| 104 | - url = url + "?loadStrategy=first_load&pageNum="+pageNum+"&refreshTime="+refreshTime+"&pageId=" | ||
| 105 | - +pageId+"&channelStrategy=2&groupId="+groupId+"&topicId=10000009445&pageSize="+pageSize; | ||
| 106 | - Logger.info(TAG,"getMorningEveningCompInfoUrl url = "+url) | 111 | + url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId=" |
| 112 | + + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize; | ||
| 113 | + Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url) | ||
| 107 | return url; | 114 | return url; |
| 108 | } | 115 | } |
| 109 | 116 | ||
| @@ -146,8 +153,8 @@ export class PageRepository { | @@ -146,8 +153,8 @@ export class PageRepository { | ||
| 146 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) | 153 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) |
| 147 | }; | 154 | }; |
| 148 | 155 | ||
| 149 | - static fetchNewspaperInfo() { | ||
| 150 | - let url = PageRepository.getNewspaperInfoUrl() | 156 | + static fetchNewspaperInfo(date: string) { |
| 157 | + let url = PageRepository.getNewspaperInfoUrl(date) | ||
| 151 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 158 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 152 | return WDHttp.get<ResponseDTO<NewspaperTimeInfoBean[]>>(url, headers) | 159 | return WDHttp.get<ResponseDTO<NewspaperTimeInfoBean[]>>(url, headers) |
| 153 | }; | 160 | }; |
| @@ -170,8 +177,8 @@ export class PageRepository { | @@ -170,8 +177,8 @@ export class PageRepository { | ||
| 170 | /** | 177 | /** |
| 171 | * 获取早晚报compInfo | 178 | * 获取早晚报compInfo |
| 172 | * */ | 179 | * */ |
| 173 | - static fetchMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) { | ||
| 174 | - let url = PageRepository.getMorningEveningCompInfoUrl(pageId,groupId,refreshTime,pageNum,pageSize) | 180 | + static fetchMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { |
| 181 | + let url = PageRepository.getMorningEveningCompInfoUrl(pageId, groupId, refreshTime, topicId, pageNum, pageSize) | ||
| 175 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 182 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 176 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) | 183 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) |
| 177 | }; | 184 | }; |
| 1 | + | ||
| 2 | + | ||
| 3 | +@Observed | ||
| 4 | +export class CommentListItem{ | ||
| 5 | + fromUserHeader:string = "" | ||
| 6 | + fromUserName:string = "" | ||
| 7 | + commentContent:string = "" | ||
| 8 | + targetTitle:string = "" | ||
| 9 | + createTime:string = "" | ||
| 10 | + | ||
| 11 | + constructor(fromUserHeader:string,fromUserName:string,targetTitle:string,createTime:string,commentContent:string ) { | ||
| 12 | + this.fromUserHeader = fromUserHeader | ||
| 13 | + this.fromUserName = fromUserName | ||
| 14 | + this.commentContent = commentContent | ||
| 15 | + this.targetTitle = targetTitle | ||
| 16 | + this.createTime = createTime | ||
| 17 | + } | ||
| 18 | +} |
| @@ -73,6 +73,7 @@ export class FollowListDetailItem{ | @@ -73,6 +73,7 @@ export class FollowListDetailItem{ | ||
| 73 | attentionUserName:string = "" | 73 | attentionUserName:string = "" |
| 74 | fansNum :number = 0 | 74 | fansNum :number = 0 |
| 75 | 75 | ||
| 76 | + | ||
| 76 | constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:number,introduction:string,creatorId:string,status:string ) { | 77 | constructor(headPhotoUrl:string,cnUserName:string,cnFansNum:number,introduction:string,creatorId:string,status:string ) { |
| 77 | this.headPhotoUrl = headPhotoUrl | 78 | this.headPhotoUrl = headPhotoUrl |
| 78 | this.cnUserName = cnUserName | 79 | this.cnUserName = cnUserName |
| 1 | +import { CommentListItem } from './CommentListItem' | ||
| 2 | + | ||
| 3 | +export class MineCommentListDetailItem{ | ||
| 4 | + list:CommentListItem[] = [] | ||
| 5 | + | ||
| 6 | + pageNum: number = 0 | ||
| 7 | + pageSize: number = 20 | ||
| 8 | + totalCount: number = 0 | ||
| 9 | + | ||
| 10 | + constructor(list?:CommentListItem[],pageNum?: number,pageSize?: number,totalCount?: number) { | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | +} |
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MineMainSettingFunctionItem.ets
0 → 100644
| 1 | + | ||
| 2 | +@Observed | ||
| 3 | +export class MineMainSettingFunctionItem { | ||
| 4 | + imgSrc?:Resource // 图标 | ||
| 5 | + title?:string // 标题 | ||
| 6 | + subTitle?:string // 副标题 | ||
| 7 | + type?:number // 数据类型 0默认箭头类型,1右侧switch按钮类型 | ||
| 8 | + switchState?:boolean // 右侧switch按钮状态 | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + constructor(imgSrc:Resource|null,title:string|null,subTitle:string|null,type:number|null,switchState:boolean|null){ | ||
| 12 | + if (imgSrc) { | ||
| 13 | + this.imgSrc = imgSrc | ||
| 14 | + } | ||
| 15 | + if (title) { | ||
| 16 | + this.title = title | ||
| 17 | + } | ||
| 18 | + if (subTitle) { | ||
| 19 | + this.subTitle = subTitle | ||
| 20 | + } | ||
| 21 | + if (type != null) { | ||
| 22 | + this.type = type | ||
| 23 | + } | ||
| 24 | + if (switchState != null) { | ||
| 25 | + this.switchState = switchState | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | +} |
| @@ -6,7 +6,6 @@ import { PageRepository } from '../repository/PageRepository'; | @@ -6,7 +6,6 @@ import { PageRepository } from '../repository/PageRepository'; | ||
| 6 | const TAG = 'MorningEveningViewModel' | 6 | const TAG = 'MorningEveningViewModel' |
| 7 | 7 | ||
| 8 | export class MorningEveningViewModel { | 8 | export class MorningEveningViewModel { |
| 9 | - | ||
| 10 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { | 9 | static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> { |
| 11 | return new Promise<PageInfoBean>((success, error) => { | 10 | return new Promise<PageInfoBean>((success, error) => { |
| 12 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); | 11 | Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`); |
| @@ -31,27 +30,29 @@ export class MorningEveningViewModel { | @@ -31,27 +30,29 @@ export class MorningEveningViewModel { | ||
| 31 | }) | 30 | }) |
| 32 | } | 31 | } |
| 33 | 32 | ||
| 34 | - static async getMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number = 1,pageSize:number = 20): Promise<CompInfoBean> { | 33 | + static async getMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number = 1, pageSize: number = 20): Promise<CompInfoBean> { |
| 35 | return new Promise<CompInfoBean>((success, error) => { | 34 | return new Promise<CompInfoBean>((success, error) => { |
| 36 | Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`); | 35 | Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`); |
| 37 | - PageRepository.fetchMorningEveningCompInfo(pageId,groupId,refreshTime,pageNum,pageSize).then((resDTO: ResponseDTO<CompInfoBean>) => { | ||
| 38 | - if (!resDTO || !resDTO.data) { | ||
| 39 | - Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty'); | ||
| 40 | - error('resDTO is empty'); | ||
| 41 | - return | ||
| 42 | - } | ||
| 43 | - if (resDTO.code != 0) { | ||
| 44 | - Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`); | ||
| 45 | - error('resDTO Response Code is failure'); | ||
| 46 | - return | ||
| 47 | - } | ||
| 48 | - // let navResStr = JSON.stringify(navResDTO); | ||
| 49 | - Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp); | ||
| 50 | - success(resDTO.data); | ||
| 51 | - }).catch((err: Error) => { | ||
| 52 | - Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 53 | - error(err); | ||
| 54 | - }) | 36 | + PageRepository.fetchMorningEveningCompInfo(pageId, groupId, refreshTime, topicId, pageNum, pageSize) |
| 37 | + .then((resDTO: ResponseDTO<CompInfoBean>) => { | ||
| 38 | + if (!resDTO || !resDTO.data) { | ||
| 39 | + Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty'); | ||
| 40 | + error('resDTO is empty'); | ||
| 41 | + return | ||
| 42 | + } | ||
| 43 | + if (resDTO.code != 0) { | ||
| 44 | + Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`); | ||
| 45 | + error('resDTO Response Code is failure'); | ||
| 46 | + return | ||
| 47 | + } | ||
| 48 | + // let navResStr = JSON.stringify(navResDTO); | ||
| 49 | + Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp); | ||
| 50 | + success(resDTO.data); | ||
| 51 | + }) | ||
| 52 | + .catch((err: Error) => { | ||
| 53 | + Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 54 | + error(err); | ||
| 55 | + }) | ||
| 55 | }) | 56 | }) |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| @@ -16,10 +16,10 @@ export class NewspaperViewModel { | @@ -16,10 +16,10 @@ export class NewspaperViewModel { | ||
| 16 | return newspaperTimeInfo.data | 16 | return newspaperTimeInfo.data |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | - static async getNewspaperTime(): Promise<NewspaperTimeInfoBean[]> { | 19 | + static async getNewspaperTime(date: string): Promise<NewspaperTimeInfoBean[]> { |
| 20 | return new Promise<NewspaperTimeInfoBean[]>((success, error) => { | 20 | return new Promise<NewspaperTimeInfoBean[]>((success, error) => { |
| 21 | Logger.info(TAG, `getNavData start`); | 21 | Logger.info(TAG, `getNavData start`); |
| 22 | - PageRepository.fetchNewspaperInfo().then((resDTO: ResponseDTO<NewspaperTimeInfoBean[]>) => { | 22 | + PageRepository.fetchNewspaperInfo(date).then((resDTO: ResponseDTO<NewspaperTimeInfoBean[]>) => { |
| 23 | if (!resDTO || !resDTO.data) { | 23 | if (!resDTO || !resDTO.data) { |
| 24 | Logger.error(TAG, 'getNewspaperTime then navResDTO is empty'); | 24 | Logger.error(TAG, 'getNewspaperTime then navResDTO is empty'); |
| 25 | error('resDTO is empty'); | 25 | error('resDTO is empty'); |
| @@ -71,6 +71,4 @@ export class NewspaperViewModel { | @@ -71,6 +71,4 @@ export class NewspaperViewModel { | ||
| 71 | } | 71 | } |
| 72 | return newspaperListBean.data | 72 | return newspaperListBean.data |
| 73 | } | 73 | } |
| 74 | - | ||
| 75 | - | ||
| 76 | } | 74 | } |
| @@ -81,27 +81,42 @@ | @@ -81,27 +81,42 @@ | ||
| 81 | "value": "#994D00" | 81 | "value": "#994D00" |
| 82 | }, | 82 | }, |
| 83 | { | 83 | { |
| 84 | - "name":"color_B15900", | 84 | + "name": "color_B15900", |
| 85 | "value": "#B15900" | 85 | "value": "#B15900" |
| 86 | }, | 86 | }, |
| 87 | { | 87 | { |
| 88 | "name": "main_red", | 88 | "name": "main_red", |
| 89 | "value": "#E84026" | 89 | "value": "#E84026" |
| 90 | - }, { | ||
| 91 | - "name":"color_4D000000", | 90 | + }, |
| 91 | + { | ||
| 92 | + "name": "color_4D000000", | ||
| 92 | "value": "#4D000000" | 93 | "value": "#4D000000" |
| 93 | }, | 94 | }, |
| 94 | { | 95 | { |
| 95 | - "name":"color_CCCCCC", | 96 | + "name": "color_CCCCCC", |
| 96 | "value": "#CCCCCC" | 97 | "value": "#CCCCCC" |
| 97 | }, | 98 | }, |
| 98 | { | 99 | { |
| 99 | - "name":"color_EDEDED", | 100 | + "name": "color_EDEDED", |
| 100 | "value": "#EDEDED" | 101 | "value": "#EDEDED" |
| 101 | }, | 102 | }, |
| 102 | { | 103 | { |
| 103 | "name": "color_1AED2800", | 104 | "name": "color_1AED2800", |
| 104 | "value": "#1AED2800" | 105 | "value": "#1AED2800" |
| 106 | + }, | ||
| 107 | + { | ||
| 108 | + "name": "color_B2FFFFFF", | ||
| 109 | + "value": "#B2FFFFFF" | ||
| 110 | + }, | ||
| 111 | + { | ||
| 112 | + "name": "color_00304c", | ||
| 113 | + "value": "#00304c" | ||
| 114 | + }, | ||
| 115 | + { | ||
| 116 | + "name": "color_transparent", | ||
| 117 | + "value": "#00000000" | ||
| 105 | } | 118 | } |
| 119 | + | ||
| 120 | + | ||
| 106 | ] | 121 | ] |
| 107 | } | 122 | } |
1.87 KB
2.99 KB
2.53 KB
3.23 KB
370 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_arrow_left_white.png
0 → 100644
570 Bytes
551 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_head_icon.png
deleted
100644 → 0
165 KB
1.91 KB
2.93 KB
18.7 KB
322 Bytes
| @@ -3,6 +3,10 @@ | @@ -3,6 +3,10 @@ | ||
| 3 | "components/MorningEveningPaper/MorningEveningPaperComponent", | 3 | "components/MorningEveningPaper/MorningEveningPaperComponent", |
| 4 | "components/page/AppointmentListPage", | 4 | "components/page/AppointmentListPage", |
| 5 | "components/page/FollowListPage", | 5 | "components/page/FollowListPage", |
| 6 | + "pages/MineHomePage", | ||
| 7 | + "components/page/SettingPage", | ||
| 8 | + "components/page/SettingAboutPage", | ||
| 9 | + "components/page/PrivacySettingPage", | ||
| 6 | "components/page/EditUserInfoPage", | 10 | "components/page/EditUserInfoPage", |
| 7 | "components/page/EditUserNikeNamePage", | 11 | "components/page/EditUserNikeNamePage", |
| 8 | "components/page/EditUserIntroductionPage", | 12 | "components/page/EditUserIntroductionPage", |
| @@ -7,10 +7,10 @@ | @@ -7,10 +7,10 @@ | ||
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | + "wdPlayer": "file:../../features/wdPlayer", | ||
| 10 | "wdKit": "file:../../commons/wdKit", | 11 | "wdKit": "file:../../commons/wdKit", |
| 11 | "wdBean": "file:../../features/wdBean", | 12 | "wdBean": "file:../../features/wdBean", |
| 12 | "wdRouter": "file:../../commons/wdRouter", | 13 | "wdRouter": "file:../../commons/wdRouter", |
| 13 | - "wdNetwork": "file:../../commons/wdNetwork", | ||
| 14 | - "wdPlayer": "file:../../features/wdPlayer" | 14 | + "wdNetwork": "file:../../commons/wdNetwork" |
| 15 | } | 15 | } |
| 16 | } | 16 | } |
| 1 | { | 1 | { |
| 2 | + "license": "Apache-2.0", | ||
| 3 | + "devDependencies": {}, | ||
| 4 | + "author": "", | ||
| 2 | "name": "wdlogin", | 5 | "name": "wdlogin", |
| 3 | - "version": "1.0.0", | ||
| 4 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 5 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 6 | - "author": "", | ||
| 7 | - "license": "Apache-2.0", | 8 | + "version": "1.0.0", |
| 8 | "dependencies": { | 9 | "dependencies": { |
| 9 | "wdConstant": "file:../../commons/wdConstant", | 10 | "wdConstant": "file:../../commons/wdConstant", |
| 10 | "wdKit": "file:../../commons/wdKit", | 11 | "wdKit": "file:../../commons/wdKit", |
| @@ -13,4 +14,4 @@ | @@ -13,4 +14,4 @@ | ||
| 13 | "wdRouter": "file:../../commons/wdRouter", | 14 | "wdRouter": "file:../../commons/wdRouter", |
| 14 | "wdNetwork": "file:../../commons/wdNetwork" | 15 | "wdNetwork": "file:../../commons/wdNetwork" |
| 15 | } | 16 | } |
| 16 | -} | ||
| 17 | +} |
| @@ -35,15 +35,17 @@ struct ForgetPasswordPage { | @@ -35,15 +35,17 @@ struct ForgetPasswordPage { | ||
| 35 | isCodeSend: $isCodeSend | 35 | isCodeSend: $isCodeSend |
| 36 | }) | 36 | }) |
| 37 | Row() { | 37 | Row() { |
| 38 | - Button("确认", { type: ButtonType.Normal }) | 38 | + Text("确认") |
| 39 | .layoutWeight(1) | 39 | .layoutWeight(1) |
| 40 | + .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") | ||
| 40 | .borderRadius(4) | 41 | .borderRadius(4) |
| 41 | - .fontSize(16) | 42 | + .fontSize(18) |
| 43 | + .textAlign(TextAlign.Center) | ||
| 42 | .fontWeight(FontWeight.Medium) | 44 | .fontWeight(FontWeight.Medium) |
| 43 | .margin({ top: 26 }) | 45 | .margin({ top: 26 }) |
| 44 | .height(44) | 46 | .height(44) |
| 45 | - .backgroundColor("#ED2800") | ||
| 46 | - .opacity(this.isSubmit ? 1 : 0.6) | 47 | + .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") |
| 48 | + .enabled(this.isSubmit ? true : false) | ||
| 47 | .onClick(() => { | 49 | .onClick(() => { |
| 48 | this.checkVerifyCode() | 50 | this.checkVerifyCode() |
| 49 | 51 |
| @@ -21,6 +21,7 @@ export struct LoginInputComponent { | @@ -21,6 +21,7 @@ export struct LoginInputComponent { | ||
| 21 | TextInput({ placeholder: "请输入手机号" }) | 21 | TextInput({ placeholder: "请输入手机号" }) |
| 22 | .fontSize(16) | 22 | .fontSize(16) |
| 23 | .height(48) | 23 | .height(48) |
| 24 | + .maxLength(11) | ||
| 24 | .margin({ top: 36 }) | 25 | .margin({ top: 36 }) |
| 25 | .backgroundColor("#F5F5F5") | 26 | .backgroundColor("#F5F5F5") |
| 26 | .borderRadius(4) | 27 | .borderRadius(4) |
| @@ -44,22 +45,19 @@ export struct LoginInputComponent { | @@ -44,22 +45,19 @@ export struct LoginInputComponent { | ||
| 44 | .fontColor("#222222") | 45 | .fontColor("#222222") |
| 45 | .backgroundColor("#00000000") | 46 | .backgroundColor("#00000000") |
| 46 | .borderRadius({ topLeft: 4, bottomLeft: 4 }) | 47 | .borderRadius({ topLeft: 4, bottomLeft: 4 }) |
| 47 | - .backgroundImage($r('app.media.login_code_bg_one'), ImageRepeat.NoRepeat) | ||
| 48 | - .backgroundImageSize(ImageSize.Contain) | 48 | + // .backgroundImage($r('app.media.login_code_bg_one'), ImageRepeat.NoRepeat) |
| 49 | + // .backgroundImageSize(ImageSize.Contain) | ||
| 49 | .onChange((value) => { | 50 | .onChange((value) => { |
| 50 | this.codeContent = value | 51 | this.codeContent = value |
| 51 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 6) | 52 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 6) |
| 52 | }) | 53 | }) |
| 53 | 54 | ||
| 54 | Text(this.isCodeSend ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新发送') | 55 | Text(this.isCodeSend ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新发送') |
| 55 | - .backgroundImage($r('app.media.login_code_bg'), ImageRepeat.NoRepeat) | ||
| 56 | - .backgroundImageSize(ImageSize.Cover) | ||
| 57 | - .fontColor('#ED2800') | 56 | + .fontColor(this.codeBtnState?'#ED2800':'#80ED2800') |
| 58 | .width(110) | 57 | .width(110) |
| 59 | .fontSize(14) | 58 | .fontSize(14) |
| 60 | - .fontWeight(this.codeBtnState ? FontWeight.Bold : FontWeight.Normal) | 59 | + .fontWeight( FontWeight.Bold) |
| 61 | .height(48) | 60 | .height(48) |
| 62 | - .enabled(this.codeBtnState)// .align(Alignment.End) | ||
| 63 | .textAlign(TextAlign.Center) | 61 | .textAlign(TextAlign.Center) |
| 64 | .onClick(() => { | 62 | .onClick(() => { |
| 65 | if (this.phoneContent.length < 11) { | 63 | if (this.phoneContent.length < 11) { |
| @@ -80,7 +78,12 @@ export struct LoginInputComponent { | @@ -80,7 +78,12 @@ export struct LoginInputComponent { | ||
| 80 | }) | 78 | }) |
| 81 | 79 | ||
| 82 | 80 | ||
| 83 | - }.margin({ top: 12 }).height(48).alignItems(VerticalAlign.Center).justifyContent(FlexAlign.Start) | 81 | + }.margin({ top: 12 }) |
| 82 | + .height(48) | ||
| 83 | + .alignItems(VerticalAlign.Center) | ||
| 84 | + .justifyContent(FlexAlign.Start) | ||
| 85 | + .backgroundImage($r('app.media.code_login_bg')) | ||
| 86 | + .backgroundImageSize({width:'100%',height:48}) | ||
| 84 | 87 | ||
| 85 | } | 88 | } |
| 86 | } | 89 | } |
| @@ -24,7 +24,6 @@ function isEmpty(obj: undefined | string | null): boolean { | @@ -24,7 +24,6 @@ function isEmpty(obj: undefined | string | null): boolean { | ||
| 24 | 24 | ||
| 25 | const TAG = "LoginPage" | 25 | const TAG = "LoginPage" |
| 26 | 26 | ||
| 27 | -@Preview | ||
| 28 | @Entry | 27 | @Entry |
| 29 | @Component | 28 | @Component |
| 30 | struct LoginPage { | 29 | struct LoginPage { |
| @@ -106,32 +105,32 @@ struct LoginPage { | @@ -106,32 +105,32 @@ struct LoginPage { | ||
| 106 | Text() { | 105 | Text() { |
| 107 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) | 106 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) |
| 108 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { | 107 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 109 | - //todo 协议 | ||
| 110 | let bean={contentId:"1",pageID:""} as Params | 108 | let bean={contentId:"1",pageID:""} as Params |
| 111 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | 109 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) |
| 112 | }) | 110 | }) |
| 113 | Span("及").fontColor("#999999").fontSize(12) | 111 | Span("及").fontColor("#999999").fontSize(12) |
| 114 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { | 112 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 115 | - //todo 协议 | ||
| 116 | let bean={contentId:"2",pageID:""} as Params | 113 | let bean={contentId:"2",pageID:""} as Params |
| 117 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) | 114 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean) |
| 118 | }) | 115 | }) |
| 119 | } | 116 | } |
| 120 | - }.margin({ top: 28 }).alignItems(VerticalAlign.Center) | 117 | + }.margin({ top: 48 }).alignItems(VerticalAlign.Center) |
| 121 | 118 | ||
| 122 | Row() { | 119 | Row() { |
| 123 | - Button("登录", { type: ButtonType.Normal }) | 120 | + Text("登录") |
| 124 | .borderRadius(4) | 121 | .borderRadius(4) |
| 125 | - .fontSize(20) | 122 | + .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") |
| 123 | + .fontSize(18) | ||
| 126 | .fontWeight(FontWeight.Medium) | 124 | .fontWeight(FontWeight.Medium) |
| 127 | .margin({ top: 20 }) | 125 | .margin({ top: 20 }) |
| 128 | .height(44) | 126 | .height(44) |
| 129 | - .opacity(this.isSubmit ? 1 : 0.6) | ||
| 130 | - .enabled(this.isSubmit ? true : false) | 127 | + .textAlign(TextAlign.Center) |
| 131 | .width("100%") | 128 | .width("100%") |
| 132 | - .backgroundColor("#ED2800") | 129 | + .backgroundColor(this.isSubmit?"#FFED2800":"#99ED2800") |
| 133 | .onClick(() => { | 130 | .onClick(() => { |
| 134 | - //todo 登录 | 131 | + if(!this.isSubmit){ |
| 132 | + return | ||
| 133 | + } | ||
| 135 | this.loginSubmit() | 134 | this.loginSubmit() |
| 136 | 135 | ||
| 137 | }) | 136 | }) |
| @@ -181,6 +180,7 @@ struct LoginPage { | @@ -181,6 +180,7 @@ struct LoginPage { | ||
| 181 | Column() { | 180 | Column() { |
| 182 | TextInput({ placeholder: "请输入账号", controller: this.phoneController }) | 181 | TextInput({ placeholder: "请输入账号", controller: this.phoneController }) |
| 183 | .fontSize(16) | 182 | .fontSize(16) |
| 183 | + .maxLength(11) | ||
| 184 | .height(48) | 184 | .height(48) |
| 185 | .backgroundColor("#F5F5F5") | 185 | .backgroundColor("#F5F5F5") |
| 186 | .borderRadius(4) | 186 | .borderRadius(4) |
| @@ -327,7 +327,6 @@ struct LoginPage { | @@ -327,7 +327,6 @@ struct LoginPage { | ||
| 327 | //登录 | 327 | //登录 |
| 328 | loginSubmit() { | 328 | loginSubmit() { |
| 329 | Logger.debug(TAG, "loginSubmit " + this.checkCodePage) | 329 | Logger.debug(TAG, "loginSubmit " + this.checkCodePage) |
| 330 | - //todo 判断是验证码登录还是密码登录 | ||
| 331 | if (this.checkCodePage) { | 330 | if (this.checkCodePage) { |
| 332 | if (isEmpty(this.phoneContent)) { | 331 | if (isEmpty(this.phoneContent)) { |
| 333 | Logger.debug(TAG, "手机号为空") | 332 | Logger.debug(TAG, "手机号为空") |
| 1 | +import ArrayList from '@ohos.util.ArrayList'; | ||
| 2 | +import promptAction from '@ohos.promptAction'; | ||
| 3 | + | ||
| 4 | +export default class AccoutPageDataModel { | ||
| 5 | + // 页面数据 | ||
| 6 | + compType: number // 0:标题 / 1:密码输入框 / 2:验证码输入框 / 3:desc描述 / 4:按钮 / 5:logo / 6:子标题 7:手机号输入框 7:空白 | ||
| 7 | + compLogo: string | ||
| 8 | + compTitle: string | ||
| 9 | + // compSubTitle: string | ||
| 10 | + compDesc: string | ||
| 11 | + compButtonTitle: string | ||
| 12 | + inputPlacholder: string | ||
| 13 | + inputTag: number | ||
| 14 | + | ||
| 15 | + constructor(compType: number, compTitle: string, compLogo: string, compDesc: string, compButtonTitle: string, inputPlacholder: string, inputTag: number) { | ||
| 16 | + this.compType = compType | ||
| 17 | + this.compTitle = compTitle | ||
| 18 | + this.compLogo = compLogo | ||
| 19 | + this.compDesc = compDesc | ||
| 20 | + this.compButtonTitle = compButtonTitle | ||
| 21 | + this.inputPlacholder = inputPlacholder | ||
| 22 | + this.inputTag = inputTag | ||
| 23 | + } | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +@Component | ||
| 27 | +export struct SettingPasswordLayout { | ||
| 28 | + @State listData: Array<AccoutPageDataModel> = new Array(); // 页面配置数据 | ||
| 29 | + @State btnStatus: boolean = false | ||
| 30 | + password01: string = ''; | ||
| 31 | + password02: string = ''; | ||
| 32 | + passwordOri: string = ''; | ||
| 33 | + | ||
| 34 | + aboutToAppear() { | ||
| 35 | + this.getPageListData(4) | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + getPageListData(pageId:number) { | ||
| 39 | + switch (pageId) { | ||
| 40 | + case 0: | ||
| 41 | + // 验证/更换手机号 | ||
| 42 | + this.listData.push(new AccoutPageDataModel(0, '更换手机号', '', '', '', '', 0)) | ||
| 43 | + this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010)) | ||
| 44 | + this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088)) | ||
| 45 | + this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0)) | ||
| 46 | + break; | ||
| 47 | + | ||
| 48 | + case 1: | ||
| 49 | + // 设置密码 | ||
| 50 | + this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0)) | ||
| 51 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086)) | ||
| 52 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087)) | ||
| 53 | + this.listData.push(new AccoutPageDataModel(4, '', '', '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', '', '', 0)) | ||
| 54 | + this.listData.push(new AccoutPageDataModel(5, '', '', '', '确认', '', 0)) | ||
| 55 | + break; | ||
| 56 | + | ||
| 57 | + case 2: | ||
| 58 | + // 修改密码 | ||
| 59 | + this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0)) | ||
| 60 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010)) | ||
| 61 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086)) | ||
| 62 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087)) | ||
| 63 | + this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', '', '', 0)) | ||
| 64 | + this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0)) | ||
| 65 | + this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0)) | ||
| 66 | + break; | ||
| 67 | + | ||
| 68 | + case 3: | ||
| 69 | + // 绑定手机号 | ||
| 70 | + this.listData.push(new AccoutPageDataModel(0, '绑定手机号', '', '', '', '', 0)) | ||
| 71 | + this.listData.push(new AccoutPageDataModel(7, '', '', '', '', '请输入手机号', 10010)) | ||
| 72 | + this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088)) | ||
| 73 | + this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0)) | ||
| 74 | + break; | ||
| 75 | + | ||
| 76 | + case 4: | ||
| 77 | + // 有logo的 | ||
| 78 | + this.listData.push(new AccoutPageDataModel(5, '', 'https://img-blog.csdnimg.cn/24f43f4d626d428891ebb2adb5c2c2e9.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5YyX5aSn5Z-55paH5byg6ICB5biI,size_20,color_FFFFFF,t_70,g_se,x_16', '', '', '' , 0)) | ||
| 79 | + this.listData.push(new AccoutPageDataModel(0, '修改密码', '', '', '', '', 0)) | ||
| 80 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入原密码', 10010)) | ||
| 81 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入新密码', 10086)) | ||
| 82 | + this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请再请输入原密码', 10087)) | ||
| 83 | + this.listData.push(new AccoutPageDataModel(2, '', '', '', '', '验证码', 10088)) | ||
| 84 | + this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6-20位,需答谢字母、小写字母、数字、特殊字符中组合三种及三种以上组成', '', '', 0)) | ||
| 85 | + this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0)) | ||
| 86 | + this.listData.push(new AccoutPageDataModel(3, '', '', '忘记密码', '', '', 0)) | ||
| 87 | + break; | ||
| 88 | + | ||
| 89 | + default: | ||
| 90 | + break; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + build() { | ||
| 95 | + Navigation() { | ||
| 96 | + this.settingList() //滑动区域 | ||
| 97 | + }.titleMode(NavigationTitleMode.Mini) | ||
| 98 | + .title('') | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + // 页面布局 | ||
| 102 | + @Builder settingList() { | ||
| 103 | + Column() { | ||
| 104 | + List() { | ||
| 105 | + ForEach(this.listData, (item: AccoutPageDataModel, index: number) => { | ||
| 106 | + ListItem() { | ||
| 107 | + if (item.compType == 0) { | ||
| 108 | + this.getTitleCell(item, HorizontalAlign.Start) | ||
| 109 | + } else if (item.compType == 1) { | ||
| 110 | + this.getPasswordCell(item) | ||
| 111 | + } else if (item.compType == 2) { | ||
| 112 | + this.getCodeCell(item) | ||
| 113 | + } else if (item.compType == 3) { | ||
| 114 | + if (index == this.listData.length - 1) { | ||
| 115 | + this.getDescCell(item, HorizontalAlign.Center) | ||
| 116 | + } else { | ||
| 117 | + this.getDescCell(item, HorizontalAlign.Start) | ||
| 118 | + } | ||
| 119 | + } else if (item.compType == 4) { | ||
| 120 | + this.getButtonCell(item) | ||
| 121 | + } else if (item.compType == 5) { | ||
| 122 | + this.getLogoCell(item) | ||
| 123 | + } else if (item.compType == 7) { | ||
| 124 | + this.getPhoneCell(item) | ||
| 125 | + } else { | ||
| 126 | + Text('' + item.compType) | ||
| 127 | + } | ||
| 128 | + } | ||
| 129 | + }) | ||
| 130 | + } | ||
| 131 | + // .divider({ | ||
| 132 | + // strokeWidth: 1, | ||
| 133 | + // startMargin: 15, | ||
| 134 | + // endMargin: 10, | ||
| 135 | + // color: '#f0f0f0' | ||
| 136 | + // }) | ||
| 137 | + }.width('100%').padding('30lpx') | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + /***************************** UI元素 ******************************************/ | ||
| 141 | + | ||
| 142 | + // 标题 | ||
| 143 | + @Builder getTitleCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | ||
| 144 | + Column() { | ||
| 145 | + Text(item.compTitle).fontWeight(FontWeight.Bold).fontSize(20).maxLines(1) | ||
| 146 | + } | ||
| 147 | + .width('100%') | ||
| 148 | + .height('75lpx') | ||
| 149 | + .alignItems(alignTitle) | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + // 密码输入框 | ||
| 153 | + @Builder getPasswordCell(item: AccoutPageDataModel) { | ||
| 154 | + Row() { | ||
| 155 | + Row() { | ||
| 156 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 157 | + .type(InputType.Password) | ||
| 158 | + .backgroundColor('#00000000') | ||
| 159 | + .onChange((value: string) => { | ||
| 160 | + this.inputTextChange(value, item.inputTag) | ||
| 161 | + }) | ||
| 162 | + .onSubmit((EnterKeyType) => { | ||
| 163 | + promptAction.showToast({ message: 'submit' }) | ||
| 164 | + }) | ||
| 165 | + } | ||
| 166 | + .alignItems(VerticalAlign.Center) | ||
| 167 | + .height('80lpx') | ||
| 168 | + .backgroundColor('#f5f5f5') | ||
| 169 | + .borderRadius('4vp') | ||
| 170 | + } | ||
| 171 | + .width('100%') | ||
| 172 | + .height('110lpx') | ||
| 173 | + .backgroundColor(0xffffff0) | ||
| 174 | + .alignItems(VerticalAlign.Center) | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + // 手机号输入框 | ||
| 178 | + @Builder getPhoneCell(item: AccoutPageDataModel) { | ||
| 179 | + Row() { | ||
| 180 | + Row() { | ||
| 181 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 182 | + .backgroundColor('#00000000') | ||
| 183 | + .onChange((value: string) => { | ||
| 184 | + this.inputTextChange(value, item.inputTag) | ||
| 185 | + }) | ||
| 186 | + .onSubmit((EnterKeyType) => { | ||
| 187 | + promptAction.showToast({ message: 'submit' }) | ||
| 188 | + }) | ||
| 189 | + } | ||
| 190 | + .alignItems(VerticalAlign.Center) | ||
| 191 | + .height('80lpx') | ||
| 192 | + .backgroundColor('#f5f5f5') | ||
| 193 | + .borderRadius('4vp') | ||
| 194 | + } | ||
| 195 | + .width('100%') | ||
| 196 | + .height('110lpx') | ||
| 197 | + .backgroundColor(0xffffff0) | ||
| 198 | + .alignItems(VerticalAlign.Center) | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + // 验证码码输入框 | ||
| 202 | + @Builder getCodeCell(item: AccoutPageDataModel) { | ||
| 203 | + Row() { | ||
| 204 | + Stack() { | ||
| 205 | + Image($r('app.media.get_code_bg')).width('100%').borderRadius('4vp') | ||
| 206 | + Row() { | ||
| 207 | + TextInput({ placeholder: item.inputPlacholder }) | ||
| 208 | + .backgroundColor('#00000000') | ||
| 209 | + .width('67.28%') | ||
| 210 | + .onChange((value: string) => { | ||
| 211 | + this.inputTextChange(value, item.inputTag) | ||
| 212 | + }) | ||
| 213 | + Button('发送验证码') | ||
| 214 | + .width('32.71%') | ||
| 215 | + .backgroundColor('#00000000') | ||
| 216 | + .fontColor('#da3e22') | ||
| 217 | + } | ||
| 218 | + .width('100%') | ||
| 219 | + }.height('80lpx') | ||
| 220 | + } | ||
| 221 | + .width('100%') | ||
| 222 | + .height('110lpx') | ||
| 223 | + .backgroundColor(0xffffff0) | ||
| 224 | + .alignItems(VerticalAlign.Center) | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + // desc | ||
| 228 | + @Builder getDescCell(item: AccoutPageDataModel, alignTitle: HorizontalAlign) { | ||
| 229 | + Column() { | ||
| 230 | + Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) | ||
| 231 | + .onClick(()=>{ | ||
| 232 | + if (item.compDesc == '忘记密码') { | ||
| 233 | + promptAction.showToast({ message: '密码不符合密码规范' }) | ||
| 234 | + } | ||
| 235 | + }) | ||
| 236 | + } | ||
| 237 | + .width('100%') | ||
| 238 | + .height('85lpx') | ||
| 239 | + .alignItems(alignTitle) | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + // 按钮 | ||
| 243 | + @Builder getButtonCell(item: AccoutPageDataModel) { | ||
| 244 | + Row() { | ||
| 245 | + Button(item.compButtonTitle, { type: ButtonType.Normal, stateEffect: true }) | ||
| 246 | + .width('100%') | ||
| 247 | + .height('80lpx') | ||
| 248 | + .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d') | ||
| 249 | + .fontColor('#fff') | ||
| 250 | + .borderRadius('4vp') | ||
| 251 | + .onClick(() => { | ||
| 252 | + this.buttonClick() | ||
| 253 | + }) | ||
| 254 | + } | ||
| 255 | + .padding({top:'25lpx'}) | ||
| 256 | + .alignItems(VerticalAlign.Center) | ||
| 257 | + .width('100%') | ||
| 258 | + .height('120lpx') | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + // 标题 | ||
| 262 | + @Builder getLogoCell(item: AccoutPageDataModel) { | ||
| 263 | + Column() { | ||
| 264 | + Image(item.compLogo).height('150lpx').width('150lpx') | ||
| 265 | + } | ||
| 266 | + .width('100%') | ||
| 267 | + .height('200lpx') | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + /***************************** 事件处理 ******************************************/ | ||
| 271 | + // 提交按钮点击事件 | ||
| 272 | + buttonClick() { | ||
| 273 | + if (this.btnStatus) { | ||
| 274 | + // 需要+手机号校验 | ||
| 275 | + if (this.password01.length < 6 || this.password01.length > 20) { | ||
| 276 | + promptAction.showToast({ message: '密码不符合密码规范' }) | ||
| 277 | + return | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + promptAction.showToast({ message: '请求接口' }) | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + // 输入框数据变动:输入数据处理 | ||
| 285 | + inputTextChange(text: string, tag: number) { | ||
| 286 | + if (tag == 10086) { | ||
| 287 | + this.password01 = text; | ||
| 288 | + } else if (tag == 10087) { | ||
| 289 | + this.password02 = text; | ||
| 290 | + } else { | ||
| 291 | + this.passwordOri = text; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + if (this.password01) { | ||
| 295 | + if (this.password01 == this.password02 && this.password01.length >= 6 && this.password01.length <= 20) { | ||
| 296 | + this.btnStatus = true; | ||
| 297 | + } else { | ||
| 298 | + this.btnStatus = false; | ||
| 299 | + } | ||
| 300 | + } | ||
| 301 | + } | ||
| 302 | +} |
| 1 | +import { SettingPasswordLayout } from './SettingPasswordLayout'; | ||
| 2 | + | ||
| 3 | +@Entry | ||
| 4 | +@Component | ||
| 5 | +struct SettingPasswordPage { | ||
| 6 | + @State message: string = 'Hello World' | ||
| 7 | + | ||
| 8 | + build() { | ||
| 9 | + Row() { | ||
| 10 | + Column() { | ||
| 11 | + SettingPasswordLayout() | ||
| 12 | + } | ||
| 13 | + .width('100%') | ||
| 14 | + } | ||
| 15 | + .height('100%') | ||
| 16 | + } | ||
| 17 | +} |
No preview for this file type
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | "pages/Index", | 3 | "pages/Index", |
| 4 | "pages/login/LoginPage", | 4 | "pages/login/LoginPage", |
| 5 | "pages/login/ForgetPasswordPage", | 5 | "pages/login/ForgetPasswordPage", |
| 6 | - "pages/login/LoginProtocolWebview" | 6 | + "pages/login/LoginProtocolWebview", |
| 7 | + "pages/login/SettingPasswordPage" | ||
| 7 | ] | 8 | ] |
| 8 | } | 9 | } |
| 1 | +)x." Mb |
No preview for this file type
| 1 | +RH>8S\ |
| 1 | +1'PbW gpM |
| 1 | +Kq )̒c |
| 1 | { | 1 | { |
| 2 | - "name": "sight_harmony", | ||
| 3 | - "version": "1.0.0", | ||
| 4 | - "description": "Please describe the basic information.", | ||
| 5 | - "main": "", | ||
| 6 | - "author": "", | ||
| 7 | "license": "", | 2 | "license": "", |
| 8 | - "dependencies": { | ||
| 9 | - }, | ||
| 10 | "devDependencies": { | 3 | "devDependencies": { |
| 11 | "@ohos/hypium": "1.0.16" | 4 | "@ohos/hypium": "1.0.16" |
| 12 | - } | 5 | + }, |
| 6 | + "author": "", | ||
| 7 | + "name": "sight_harmony", | ||
| 8 | + "description": "Please describe the basic information.", | ||
| 9 | + "main": "", | ||
| 10 | + "version": "1.0.0", | ||
| 11 | + "dependencies": {} | ||
| 13 | } | 12 | } |
| 1 | import { ENewspaperPageComponent } from 'wdComponent'; | 1 | import { ENewspaperPageComponent } from 'wdComponent'; |
| 2 | -import { Logger } from 'wdKit' | 2 | +import { Logger } from 'wdKit'; |
| 3 | +import common from '@ohos.app.ability.common'; | ||
| 4 | +import window from '@ohos.window'; | ||
| 3 | 5 | ||
| 4 | const TAG = 'ENewspaper'; | 6 | const TAG = 'ENewspaper'; |
| 5 | 7 | ||
| 6 | @Entry | 8 | @Entry |
| 7 | @Component | 9 | @Component |
| 8 | struct ENewspaper { | 10 | struct ENewspaper { |
| 11 | + // 获取UIAbility上下文 | ||
| 12 | + context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext | ||
| 13 | + | ||
| 14 | + async setSystemBar(color: string) { | ||
| 15 | + // 获取当前应用窗口 | ||
| 16 | + let windowClass: window.Window = await window.getLastWindow(this.context) | ||
| 17 | + // 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色 | ||
| 18 | + await windowClass.setWindowSystemBarProperties({ | ||
| 19 | + navigationBarColor: color, | ||
| 20 | + statusBarColor: color, | ||
| 21 | + // navigationBarContentColor: "#00FF00", | ||
| 22 | + // statusBarContentColor: "#00FF00" | ||
| 23 | + }) | ||
| 24 | + } | ||
| 9 | 25 | ||
| 10 | build() { | 26 | build() { |
| 11 | Column() { | 27 | Column() { |
| @@ -13,7 +29,7 @@ struct ENewspaper { | @@ -13,7 +29,7 @@ struct ENewspaper { | ||
| 13 | } | 29 | } |
| 14 | } | 30 | } |
| 15 | 31 | ||
| 16 | - pageTransition(){ | 32 | + pageTransition() { |
| 17 | // 定义页面进入时的效果,从底侧滑入 | 33 | // 定义页面进入时的效果,从底侧滑入 |
| 18 | PageTransitionEnter({ type: RouteType.None, duration: 300 }) | 34 | PageTransitionEnter({ type: RouteType.None, duration: 300 }) |
| 19 | .slide(SlideEffect.Bottom) | 35 | .slide(SlideEffect.Bottom) |
| @@ -31,10 +47,12 @@ struct ENewspaper { | @@ -31,10 +47,12 @@ struct ENewspaper { | ||
| 31 | } | 47 | } |
| 32 | 48 | ||
| 33 | onPageShow() { | 49 | onPageShow() { |
| 50 | + this.setSystemBar('#80000000') | ||
| 34 | Logger.info(TAG, 'onPageShow'); | 51 | Logger.info(TAG, 'onPageShow'); |
| 35 | } | 52 | } |
| 36 | 53 | ||
| 37 | onPageHide() { | 54 | onPageHide() { |
| 55 | + this.setSystemBar('#FFFFFFFF') | ||
| 38 | Logger.info(TAG, 'onPageHide'); | 56 | Logger.info(TAG, 'onPageHide'); |
| 39 | } | 57 | } |
| 40 | 58 |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "pages/web/DefaultWebPage", | 4 | "pages/web/DefaultWebPage", |
| 5 | "pages/ENewspaper", | 5 | "pages/ENewspaper", |
| 6 | "pages/ImageAndTextDetailPage", | 6 | "pages/ImageAndTextDetailPage", |
| 7 | - "pages/MorningEveningPaperPage" | 7 | + "pages/MorningEveningPaperPage", |
| 8 | + "pages/detail/MultiPictureDetailPage" | ||
| 8 | ] | 9 | ] |
| 9 | } | 10 | } |
| 1 | +{ | ||
| 2 | + "code": "0", | ||
| 3 | + "data": { | ||
| 4 | + "hasNext": 0, | ||
| 5 | + "list": [ | ||
| 6 | + { | ||
| 7 | + "avatarFrame": "", | ||
| 8 | + "checkStatus": 0, | ||
| 9 | + "commentContent": "车得修,歌也得唱不唱心里那口气儿就没了你哥我以前心里也有这股劲儿那时候我想的是什么想的是每天什么时候开始现在心里这股劲儿泄了我想的是每天什么时候结束心里有这股劲儿的时候你哥也摇滚过现在这股劲儿没了我天天想的都是这个是这个但你不能这样只要咱们继续唱大吉他就还在不唱就真的没了——《缝纫机乐队》", | ||
| 10 | + "commentContentSensitive": "", | ||
| 11 | + "commentLevel": 1, | ||
| 12 | + "commentPics": "", | ||
| 13 | + "commentSensitive": "", | ||
| 14 | + "commentType": "2", | ||
| 15 | + "createTime": "2024-03-21 13:37:13", | ||
| 16 | + "fromCreatorId": "", | ||
| 17 | + "fromDeviceId": "", | ||
| 18 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 19 | + "fromUserId": "567387477063621", | ||
| 20 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 21 | + "fromUserType": 1, | ||
| 22 | + "h5Url": "", | ||
| 23 | + "id": 303323, | ||
| 24 | + "keyArticle": 0, | ||
| 25 | + "likeNum": 0, | ||
| 26 | + "parentCommentVo": null, | ||
| 27 | + "parentId": -1, | ||
| 28 | + "rootCommentId": 303323, | ||
| 29 | + "sensitiveExist": 0, | ||
| 30 | + "sensitiveShow": 1, | ||
| 31 | + "shareInfo": { | ||
| 32 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231012/image/content/7f1a342a809d4276aa975ba9e7fe2313.png", | ||
| 33 | + "shareSummary": "这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是", | ||
| 34 | + "shareTitle": "这是一个开始、请持续关注这是一个开始、请", | ||
| 35 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000633703-500000008559" | ||
| 36 | + }, | ||
| 37 | + "targetId": "30000633703", | ||
| 38 | + "targetRelId": "500000008559", | ||
| 39 | + "targetRelObjectId": "2002", | ||
| 40 | + "targetRelType": 1, | ||
| 41 | + "targetStatus": 0, | ||
| 42 | + "targetTitle": "这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注这是一个开始、请持续关注", | ||
| 43 | + "targetType": 8, | ||
| 44 | + "topicType": null, | ||
| 45 | + "uuid": "a1944aa3-e598-44ea-b2c5-45a4fe0ba91f" | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + "avatarFrame": "", | ||
| 49 | + "checkStatus": 0, | ||
| 50 | + "commentContent": "我们都很好", | ||
| 51 | + "commentContentSensitive": "", | ||
| 52 | + "commentLevel": 1, | ||
| 53 | + "commentPics": "", | ||
| 54 | + "commentSensitive": "", | ||
| 55 | + "commentType": "2", | ||
| 56 | + "createTime": "2024-03-14 17:56:14", | ||
| 57 | + "fromCreatorId": "", | ||
| 58 | + "fromDeviceId": "", | ||
| 59 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 60 | + "fromUserId": "567387477063621", | ||
| 61 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 62 | + "fromUserType": 1, | ||
| 63 | + "h5Url": "", | ||
| 64 | + "id": 403449, | ||
| 65 | + "keyArticle": 0, | ||
| 66 | + "likeNum": 0, | ||
| 67 | + "parentCommentVo": null, | ||
| 68 | + "parentId": -1, | ||
| 69 | + "rootCommentId": 403449, | ||
| 70 | + "sensitiveExist": 0, | ||
| 71 | + "sensitiveShow": 1, | ||
| 72 | + "shareInfo": { | ||
| 73 | + "shareCoverUrl": "", | ||
| 74 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 75 | + "shareTitle": "丝路之美", | ||
| 76 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000654108-500000017213" | ||
| 77 | + }, | ||
| 78 | + "targetId": "30000654108", | ||
| 79 | + "targetRelId": "500000017213", | ||
| 80 | + "targetRelObjectId": "2002", | ||
| 81 | + "targetRelType": 1, | ||
| 82 | + "targetStatus": 0, | ||
| 83 | + "targetTitle": "丝路之美", | ||
| 84 | + "targetType": 8, | ||
| 85 | + "topicType": null, | ||
| 86 | + "uuid": "1706ec91-8fb3-4704-bde3-fb454386e419" | ||
| 87 | + }, | ||
| 88 | + { | ||
| 89 | + "avatarFrame": "", | ||
| 90 | + "checkStatus": 0, | ||
| 91 | + "commentContent": "大家好", | ||
| 92 | + "commentContentSensitive": "", | ||
| 93 | + "commentLevel": 1, | ||
| 94 | + "commentPics": "", | ||
| 95 | + "commentSensitive": "", | ||
| 96 | + "commentType": "2", | ||
| 97 | + "createTime": "2024-03-14 17:56:04", | ||
| 98 | + "fromCreatorId": "", | ||
| 99 | + "fromDeviceId": "", | ||
| 100 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 101 | + "fromUserId": "567387477063621", | ||
| 102 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 103 | + "fromUserType": 1, | ||
| 104 | + "h5Url": "", | ||
| 105 | + "id": 403448, | ||
| 106 | + "keyArticle": 0, | ||
| 107 | + "likeNum": 0, | ||
| 108 | + "parentCommentVo": null, | ||
| 109 | + "parentId": -1, | ||
| 110 | + "rootCommentId": 403448, | ||
| 111 | + "sensitiveExist": 0, | ||
| 112 | + "sensitiveShow": 1, | ||
| 113 | + "shareInfo": { | ||
| 114 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231012/image/content/b7170ff0d0954b389e7e9f8c3c1d777a.png", | ||
| 115 | + "shareSummary": "人民日报,有品质的新闻", | ||
| 116 | + "shareTitle": "展示发", | ||
| 117 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000633589-500000008382" | ||
| 118 | + }, | ||
| 119 | + "targetId": "30000633589", | ||
| 120 | + "targetRelId": "500000008382", | ||
| 121 | + "targetRelObjectId": "2002", | ||
| 122 | + "targetRelType": 1, | ||
| 123 | + "targetStatus": 0, | ||
| 124 | + "targetTitle": "展示发", | ||
| 125 | + "targetType": 13, | ||
| 126 | + "topicType": null, | ||
| 127 | + "uuid": "17c5a8d9-622c-4b7a-bcd2-afc792fb8fb7" | ||
| 128 | + }, | ||
| 129 | + { | ||
| 130 | + "avatarFrame": "", | ||
| 131 | + "checkStatus": 0, | ||
| 132 | + "commentContent": "你好", | ||
| 133 | + "commentContentSensitive": "", | ||
| 134 | + "commentLevel": 1, | ||
| 135 | + "commentPics": "", | ||
| 136 | + "commentSensitive": "", | ||
| 137 | + "commentType": "2", | ||
| 138 | + "createTime": "2024-03-14 17:55:55", | ||
| 139 | + "fromCreatorId": "", | ||
| 140 | + "fromDeviceId": "", | ||
| 141 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 142 | + "fromUserId": "567387477063621", | ||
| 143 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 144 | + "fromUserType": 1, | ||
| 145 | + "h5Url": "", | ||
| 146 | + "id": 403447, | ||
| 147 | + "keyArticle": 0, | ||
| 148 | + "likeNum": 0, | ||
| 149 | + "parentCommentVo": null, | ||
| 150 | + "parentId": -1, | ||
| 151 | + "rootCommentId": 403447, | ||
| 152 | + "sensitiveExist": 0, | ||
| 153 | + "sensitiveShow": 1, | ||
| 154 | + "shareInfo": { | ||
| 155 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png", | ||
| 156 | + "shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读", | ||
| 157 | + "shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿", | ||
| 158 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900" | ||
| 159 | + }, | ||
| 160 | + "targetId": "30000637972", | ||
| 161 | + "targetRelId": "500000010900", | ||
| 162 | + "targetRelObjectId": "2002", | ||
| 163 | + "targetRelType": 1, | ||
| 164 | + "targetStatus": 0, | ||
| 165 | + "targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然", | ||
| 166 | + "targetType": 8, | ||
| 167 | + "topicType": null, | ||
| 168 | + "uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e" | ||
| 169 | + }, | ||
| 170 | + { | ||
| 171 | + "avatarFrame": "", | ||
| 172 | + "checkStatus": 0, | ||
| 173 | + "commentContent": "你好", | ||
| 174 | + "commentContentSensitive": "", | ||
| 175 | + "commentLevel": 1, | ||
| 176 | + "commentPics": "", | ||
| 177 | + "commentSensitive": "", | ||
| 178 | + "commentType": "2", | ||
| 179 | + "createTime": "2024-03-14 17:55:55", | ||
| 180 | + "fromCreatorId": "", | ||
| 181 | + "fromDeviceId": "", | ||
| 182 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 183 | + "fromUserId": "567387477063621", | ||
| 184 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 185 | + "fromUserType": 1, | ||
| 186 | + "h5Url": "", | ||
| 187 | + "id": 403447, | ||
| 188 | + "keyArticle": 0, | ||
| 189 | + "likeNum": 0, | ||
| 190 | + "parentCommentVo": null, | ||
| 191 | + "parentId": -1, | ||
| 192 | + "rootCommentId": 403447, | ||
| 193 | + "sensitiveExist": 0, | ||
| 194 | + "sensitiveShow": 1, | ||
| 195 | + "shareInfo": { | ||
| 196 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png", | ||
| 197 | + "shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读", | ||
| 198 | + "shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿", | ||
| 199 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900" | ||
| 200 | + }, | ||
| 201 | + "targetId": "30000637972", | ||
| 202 | + "targetRelId": "500000010900", | ||
| 203 | + "targetRelObjectId": "2002", | ||
| 204 | + "targetRelType": 1, | ||
| 205 | + "targetStatus": 0, | ||
| 206 | + "targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然", | ||
| 207 | + "targetType": 8, | ||
| 208 | + "topicType": null, | ||
| 209 | + "uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e" | ||
| 210 | + }, | ||
| 211 | + { | ||
| 212 | + "avatarFrame": "", | ||
| 213 | + "checkStatus": 0, | ||
| 214 | + "commentContent": "你好", | ||
| 215 | + "commentContentSensitive": "", | ||
| 216 | + "commentLevel": 1, | ||
| 217 | + "commentPics": "", | ||
| 218 | + "commentSensitive": "", | ||
| 219 | + "commentType": "2", | ||
| 220 | + "createTime": "2024-03-14 17:55:55", | ||
| 221 | + "fromCreatorId": "", | ||
| 222 | + "fromDeviceId": "", | ||
| 223 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 224 | + "fromUserId": "567387477063621", | ||
| 225 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 226 | + "fromUserType": 1, | ||
| 227 | + "h5Url": "", | ||
| 228 | + "id": 403447, | ||
| 229 | + "keyArticle": 0, | ||
| 230 | + "likeNum": 0, | ||
| 231 | + "parentCommentVo": null, | ||
| 232 | + "parentId": -1, | ||
| 233 | + "rootCommentId": 403447, | ||
| 234 | + "sensitiveExist": 0, | ||
| 235 | + "sensitiveShow": 1, | ||
| 236 | + "shareInfo": { | ||
| 237 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png", | ||
| 238 | + "shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读", | ||
| 239 | + "shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿", | ||
| 240 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900" | ||
| 241 | + }, | ||
| 242 | + "targetId": "30000637972", | ||
| 243 | + "targetRelId": "500000010900", | ||
| 244 | + "targetRelObjectId": "2002", | ||
| 245 | + "targetRelType": 1, | ||
| 246 | + "targetStatus": 0, | ||
| 247 | + "targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然", | ||
| 248 | + "targetType": 8, | ||
| 249 | + "topicType": null, | ||
| 250 | + "uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e" | ||
| 251 | + }, | ||
| 252 | + { | ||
| 253 | + "avatarFrame": "", | ||
| 254 | + "checkStatus": 0, | ||
| 255 | + "commentContent": "你好", | ||
| 256 | + "commentContentSensitive": "", | ||
| 257 | + "commentLevel": 1, | ||
| 258 | + "commentPics": "", | ||
| 259 | + "commentSensitive": "", | ||
| 260 | + "commentType": "2", | ||
| 261 | + "createTime": "2024-03-14 17:55:55", | ||
| 262 | + "fromCreatorId": "", | ||
| 263 | + "fromDeviceId": "", | ||
| 264 | + "fromUserHeader": "https://sitcontentjdcdn.aikan.pdnews.cn//img/user/2024031215/48d5bd53227d436b9faa937b3ac14600.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg", | ||
| 265 | + "fromUserId": "567387477063621", | ||
| 266 | + "fromUserName": "人民日报网友aPrtq5", | ||
| 267 | + "fromUserType": 1, | ||
| 268 | + "h5Url": "", | ||
| 269 | + "id": 403447, | ||
| 270 | + "keyArticle": 0, | ||
| 271 | + "likeNum": 0, | ||
| 272 | + "parentCommentVo": null, | ||
| 273 | + "parentId": -1, | ||
| 274 | + "rootCommentId": 403447, | ||
| 275 | + "sensitiveExist": 0, | ||
| 276 | + "sensitiveShow": 1, | ||
| 277 | + "shareInfo": { | ||
| 278 | + "shareCoverUrl": "http://sitcontentjdcdn.aikan.pdnews.cn/zhbj-20231103/image/content/046db0ef912f43dda639009e2b78a774.png", | ||
| 279 | + "shareSummary": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然-导读", | ||
| 280 | + "shareTitle": "复测-坐船观鸟,骑行散步,通州125处湿", | ||
| 281 | + "shareUrl": "https://pd-people-sit.pdnews.cn/column/30000637972-500000010900" | ||
| 282 | + }, | ||
| 283 | + "targetId": "30000637972", | ||
| 284 | + "targetRelId": "500000010900", | ||
| 285 | + "targetRelObjectId": "2002", | ||
| 286 | + "targetRelType": 1, | ||
| 287 | + "targetStatus": 0, | ||
| 288 | + "targetTitle": "复测-坐船观鸟,骑行散步,通州125处湿地邀您亲近自然", | ||
| 289 | + "targetType": 8, | ||
| 290 | + "topicType": null, | ||
| 291 | + "uuid": "f809d73f-a66c-4dd6-a4cf-99e3a9c9621e" | ||
| 292 | + } | ||
| 293 | + ], | ||
| 294 | + "pageNum": 1, | ||
| 295 | + "pageSize": 20, | ||
| 296 | + "totalCommentNum": 4, | ||
| 297 | + "totalCount": 4 | ||
| 298 | + }, | ||
| 299 | + "message": "Success", | ||
| 300 | + "meta": null, | ||
| 301 | + "requestId": "", | ||
| 302 | + "success": true, | ||
| 303 | + "timestamp": 1711092987342 | ||
| 304 | +} |
-
Please register or login to post a comment