Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
# Conflicts: # sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
Showing
46 changed files
with
1593 additions
and
399 deletions
Too many changes to show.
To preserve performance only 46 of 46+ files are displayed.
| @@ -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获取页面楼层列表 |
| @@ -320,6 +325,11 @@ export class HttpUrlUtils { | @@ -320,6 +325,11 @@ export class HttpUrlUtils { | ||
| 320 | return url | 325 | return url |
| 321 | } | 326 | } |
| 322 | 327 | ||
| 328 | + static getMineCommentListDataUrl() { | ||
| 329 | + let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH | ||
| 330 | + return url | ||
| 331 | + } | ||
| 332 | + | ||
| 323 | static getYcgCommonHeaders(): HashMap<string, string> { | 333 | static getYcgCommonHeaders(): HashMap<string, string> { |
| 324 | let headers: HashMap<string, string> = new HashMap<string, string>() | 334 | let headers: HashMap<string, string> = new HashMap<string, string>() |
| 325 | 335 |
| @@ -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 | ||
| @@ -46,9 +48,13 @@ export class WDRouterPage { | @@ -46,9 +48,13 @@ export class WDRouterPage { | ||
| 46 | static editUserNikeNamePage = new WDRouterPage("wdComponent", "ets/components/page/EditUserNikeNamePage"); | 48 | static editUserNikeNamePage = new WDRouterPage("wdComponent", "ets/components/page/EditUserNikeNamePage"); |
| 47 | //修改简介 | 49 | //修改简介 |
| 48 | static editUserIntroductionPage = new WDRouterPage("wdComponent", "ets/components/page/EditUserIntroductionPage"); | 50 | static editUserIntroductionPage = new WDRouterPage("wdComponent", "ets/components/page/EditUserIntroductionPage"); |
| 49 | - | 51 | + //浏览历史 |
| 52 | + static browsingHistoryPage = new WDRouterPage("wdComponent", "ets/components/page/BrowsingHistoryPage"); | ||
| 53 | + //我的收藏 | ||
| 54 | + static myCollectionListPagePage = new WDRouterPage("wdComponent", "ets/components/page/MyCollectionListPage"); | ||
| 50 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | 55 | static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); |
| 51 | - | 56 | + //我的主页 |
| 57 | + static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage"); | ||
| 52 | // 隐私设置页 | 58 | // 隐私设置页 |
| 53 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); | 59 | static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); |
| 54 | // 关于页 | 60 | // 关于页 |
| @@ -58,4 +64,5 @@ export class WDRouterPage { | @@ -58,4 +64,5 @@ export class WDRouterPage { | ||
| 58 | // 设置密码页、设置手机号页等等 (需要传参) | 64 | // 设置密码页、设置手机号页等等 (需要传参) |
| 59 | static settingPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/SettingPasswordPage"); | 65 | static settingPasswordPage = new WDRouterPage("wdLogin", "ets/pages/login/SettingPasswordPage"); |
| 60 | 66 | ||
| 67 | + // static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); | ||
| 61 | } | 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() { |
| @@ -16,31 +16,38 @@ export struct ENewspaperPageComponent { | @@ -16,31 +16,38 @@ export struct ENewspaperPageComponent { | ||
| 16 | private picWidth: number = 0 | 16 | private picWidth: number = 0 |
| 17 | @State picHeight: number = 0 | 17 | @State picHeight: number = 0 |
| 18 | @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean | 18 | @State newspaperListBean: NewspaperListBean = {} as NewspaperListBean |
| 19 | - @State currentPageNum: string = '01' | 19 | + @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' |
| 20 | @State pageDialogShow: boolean = false | 20 | @State pageDialogShow: boolean = false |
| 21 | @State calendarDialogShow: boolean = false | 21 | @State calendarDialogShow: boolean = false |
| 22 | @State calendarDate: string = '' | 22 | @State calendarDate: string = '' |
| 23 | private swiperController: SwiperController = new SwiperController() | 23 | private swiperController: SwiperController = new SwiperController() |
| 24 | @State swiperIndex: number = 0; | 24 | @State swiperIndex: number = 0; |
| 25 | + //当前选择的日期标记 | ||
| 26 | + @State selectDate: Date = new Date() | ||
| 27 | + | ||
| 25 | //watch监听报纸页码回调 | 28 | //watch监听报纸页码回调 |
| 26 | - // onCurrentPageNumUpdated(): void { | ||
| 27 | - // console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "date:", this.currentPageNum) | ||
| 28 | - // let _swiperIndex = Number.parseInt(this.currentPageNum) | ||
| 29 | - // console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex) | ||
| 30 | - // this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | ||
| 31 | - // } | 29 | + onCurrentPageNumUpdated(): void { |
| 30 | + console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | ||
| 31 | + let _swiperIndex = Number.parseInt(this.currentPageNum) | ||
| 32 | + console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex) | ||
| 33 | + this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | ||
| 34 | + } | ||
| 32 | 35 | ||
| 33 | //日历选择弹框 | 36 | //日历选择弹框 |
| 34 | calendarDialogController: CustomDialogController = new CustomDialogController({ | 37 | calendarDialogController: CustomDialogController = new CustomDialogController({ |
| 35 | - builder: ENewspaperCalendarDialog({ onDateChange: (date: RMCalendarBean) => { | ||
| 36 | - console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date)) | ||
| 37 | - if (date.fullYear && date.month && date.date) { | ||
| 38 | - this.calendarDate = `${date.fullYear}-${date.month > 9 ? date.month + 1 : '0' + (date.month + 1)}-${date.date > 9 ? date.date : '0' + date.date}` | ||
| 39 | - this.currentPageNum = '01' | ||
| 40 | - this.getNewspaperTime() | ||
| 41 | - this.getNewspaperList() | 38 | + builder: ENewspaperCalendarDialog({ |
| 39 | + selectDate: this.selectDate, | ||
| 40 | + onDateChange: (date: RMCalendarBean) => { | ||
| 41 | + console.log("onDateChange-日历选择弹框", "date:", JSON.stringify(date)) | ||
| 42 | + if (date.fullYear && date.month && date.date) { | ||
| 43 | + let month: number = date.month + 1 | ||
| 44 | + this.calendarDate = `${date.fullYear}-${month > 9 ? month : '0' + month}-${date.date > 9 ? date.date : '0' + date.date}` | ||
| 45 | + this.getNewspaperTime() | ||
| 46 | + this.getNewspaperList() | ||
| 47 | + this.selectDate = new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) | ||
| 48 | + } | ||
| 42 | } | 49 | } |
| 43 | - } }), | 50 | + }), |
| 44 | alignment: DialogAlignment.Top, | 51 | alignment: DialogAlignment.Top, |
| 45 | offset: { dx: 0, dy: 80 }, | 52 | offset: { dx: 0, dy: 80 }, |
| 46 | customStyle: true, | 53 | customStyle: true, |
| @@ -48,16 +55,8 @@ export struct ENewspaperPageComponent { | @@ -48,16 +55,8 @@ export struct ENewspaperPageComponent { | ||
| 48 | //图片版选择弹框 | 55 | //图片版选择弹框 |
| 49 | pageDialogController: CustomDialogController = new CustomDialogController({ | 56 | pageDialogController: CustomDialogController = new CustomDialogController({ |
| 50 | builder: ENewspaperPageDialog({ | 57 | builder: ENewspaperPageDialog({ |
| 51 | - currentPageNum: this.currentPageNum, | ||
| 52 | dialogType: 0, | 58 | dialogType: 0, |
| 53 | newspaperListBean: this.newspaperListBean, | 59 | newspaperListBean: this.newspaperListBean, |
| 54 | - onDateChange: (date: string, dialogType: number) => { | ||
| 55 | - if (dialogType == 0) { | ||
| 56 | - let _swiperIndex = Number.parseInt(this.currentPageNum) | ||
| 57 | - console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex) | ||
| 58 | - this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | }), | 60 | }), |
| 62 | alignment: DialogAlignment.BottomStart, | 61 | alignment: DialogAlignment.BottomStart, |
| 63 | offset: { dx: 0, dy: -90 }, | 62 | offset: { dx: 0, dy: -90 }, |
| @@ -66,20 +65,45 @@ export struct ENewspaperPageComponent { | @@ -66,20 +65,45 @@ export struct ENewspaperPageComponent { | ||
| 66 | //文字报纸弹框 | 65 | //文字报纸弹框 |
| 67 | listDialogController: CustomDialogController = new CustomDialogController({ | 66 | listDialogController: CustomDialogController = new CustomDialogController({ |
| 68 | builder: ENewspaperListDialog({ | 67 | builder: ENewspaperListDialog({ |
| 69 | - currentPageNum: this.currentPageNum, | ||
| 70 | - newspaperListBean: this.newspaperListBean }), | 68 | + newspaperListBean: this.newspaperListBean |
| 69 | + }), | ||
| 71 | alignment: DialogAlignment.Bottom, | 70 | alignment: DialogAlignment.Bottom, |
| 72 | offset: { dx: 0, dy: 0 } | 71 | offset: { dx: 0, dy: 0 } |
| 73 | }) | 72 | }) |
| 74 | 73 | ||
| 74 | + async aboutToAppear() { | ||
| 75 | + //获取宽高尺寸 | ||
| 76 | + this.screenWidth = this.displayTool.width | ||
| 77 | + this.picWidth = this.screenWidth - vp2px(52) | ||
| 78 | + this.picHeight = this.picWidth * 566 / 378 | ||
| 79 | + //注册字体 | ||
| 80 | + font.registerFont({ | ||
| 81 | + familyName: 'BebasNeue_Regular', | ||
| 82 | + familySrc: $rawfile('font/BebasNeue_Regular.otf') | ||
| 83 | + }) | ||
| 84 | + this.getNewspaperTime() | ||
| 85 | + this.getNewspaperList() | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + aboutToDisappear() { | ||
| 89 | + // if (this.calendarDialogController) { | ||
| 90 | + // this.calendarDialogController = null | ||
| 91 | + // } | ||
| 92 | + // if (this.listDialogController) { | ||
| 93 | + // this.listDialogController = null | ||
| 94 | + // } | ||
| 95 | + } | ||
| 96 | + | ||
| 75 | build() { | 97 | build() { |
| 76 | RelativeContainer() { | 98 | RelativeContainer() { |
| 77 | RelativeContainer() { | 99 | RelativeContainer() { |
| 78 | Image($r('app.media.icon_arrow_down')) | 100 | Image($r('app.media.icon_arrow_down')) |
| 79 | .height($r('app.float.top_arrow_size')) | 101 | .height($r('app.float.top_arrow_size')) |
| 80 | .width($r('app.float.top_arrow_size')) | 102 | .width($r('app.float.top_arrow_size')) |
| 81 | - .alignRules({ left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 82 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 103 | + .alignRules({ |
| 104 | + left: { anchor: "__container__", align: HorizontalAlign.Start }, | ||
| 105 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 106 | + }) | ||
| 83 | .id('e_newspaper_back') | 107 | .id('e_newspaper_back') |
| 84 | .onClick((event: ClickEvent) => { | 108 | .onClick((event: ClickEvent) => { |
| 85 | router.back() | 109 | router.back() |
| @@ -98,8 +122,10 @@ export struct ENewspaperPageComponent { | @@ -98,8 +122,10 @@ export struct ENewspaperPageComponent { | ||
| 98 | .margin({ left: 2, bottom: 5 }) | 122 | .margin({ left: 2, bottom: 5 }) |
| 99 | } | 123 | } |
| 100 | .alignItems(VerticalAlign.Bottom) | 124 | .alignItems(VerticalAlign.Bottom) |
| 101 | - .alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center }, | ||
| 102 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 125 | + .alignRules({ |
| 126 | + middle: { anchor: "__container__", align: HorizontalAlign.Center }, | ||
| 127 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 128 | + }) | ||
| 103 | .id('e_newspaper_date') | 129 | .id('e_newspaper_date') |
| 104 | .onClick(() => { | 130 | .onClick(() => { |
| 105 | this.calendarDialogShow = !this.calendarDialogShow | 131 | this.calendarDialogShow = !this.calendarDialogShow |
| @@ -113,15 +139,19 @@ export struct ENewspaperPageComponent { | @@ -113,15 +139,19 @@ export struct ENewspaperPageComponent { | ||
| 113 | Image($r('app.media.icon_share')) | 139 | Image($r('app.media.icon_share')) |
| 114 | .height($r('app.float.top_arrow_size')) | 140 | .height($r('app.float.top_arrow_size')) |
| 115 | .width($r('app.float.top_arrow_size')) | 141 | .width($r('app.float.top_arrow_size')) |
| 116 | - .alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 117 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 142 | + .alignRules({ |
| 143 | + right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 144 | + center: { anchor: "__container__", align: VerticalAlign.Center } | ||
| 145 | + }) | ||
| 118 | .id('e_newspaper_share') | 146 | .id('e_newspaper_share') |
| 119 | } | 147 | } |
| 120 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 148 | .margin({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 121 | .height($r('app.float.top_bar_height')) | 149 | .height($r('app.float.top_bar_height')) |
| 122 | - .alignRules({ top: { anchor: '__container__', align: VerticalAlign.Top }, | 150 | + .alignRules({ |
| 151 | + top: { anchor: '__container__', align: VerticalAlign.Top }, | ||
| 123 | left: { anchor: '__container__', align: HorizontalAlign.Start }, | 152 | left: { anchor: '__container__', align: HorizontalAlign.Start }, |
| 124 | - right: { anchor: '__container__', align: HorizontalAlign.End } }) | 153 | + right: { anchor: '__container__', align: HorizontalAlign.End } |
| 154 | + }) | ||
| 125 | .id('e_newspaper_top') | 155 | .id('e_newspaper_top') |
| 126 | 156 | ||
| 127 | if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 157 | if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| @@ -140,19 +170,24 @@ export struct ENewspaperPageComponent { | @@ -140,19 +170,24 @@ export struct ENewspaperPageComponent { | ||
| 140 | .displayCount(1) | 170 | .displayCount(1) |
| 141 | .margin({ top: 35, left: 10, right: 10 }) | 171 | .margin({ top: 35, left: 10, right: 10 }) |
| 142 | .id('e_newspaper_content') | 172 | .id('e_newspaper_content') |
| 143 | - .alignRules({ top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 144 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } }) | 173 | + .alignRules({ |
| 174 | + top: { anchor: "e_newspaper_top", align: VerticalAlign.Bottom }, | ||
| 175 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 176 | + }) | ||
| 145 | .onChange((index: number) => { | 177 | .onChange((index: number) => { |
| 146 | this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum | 178 | this.currentPageNum = this.newspaperListBean?.list[index]?.pageNum |
| 179 | + this.swiperIndex = index | ||
| 147 | }) | 180 | }) |
| 148 | 181 | ||
| 149 | Image($r('app.media.newspaper_shadow')) | 182 | Image($r('app.media.newspaper_shadow')) |
| 150 | .height($r('app.float.vp_12')) | 183 | .height($r('app.float.vp_12')) |
| 151 | .margin({ left: 20, right: 20, top: -1 }) | 184 | .margin({ left: 20, right: 20, top: -1 }) |
| 152 | .objectFit(ImageFit.Contain) | 185 | .objectFit(ImageFit.Contain) |
| 153 | - .alignRules({ top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | 186 | + .alignRules({ |
| 187 | + top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom }, | ||
| 154 | left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, | 188 | left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start }, |
| 155 | - right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } }) | 189 | + right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End } |
| 190 | + }) | ||
| 156 | .id('e_newspaper_shadow') | 191 | .id('e_newspaper_shadow') |
| 157 | 192 | ||
| 158 | Row() { | 193 | Row() { |
| @@ -165,8 +200,10 @@ export struct ENewspaperPageComponent { | @@ -165,8 +200,10 @@ export struct ENewspaperPageComponent { | ||
| 165 | } | 200 | } |
| 166 | .justifyContent(FlexAlign.Center) | 201 | .justifyContent(FlexAlign.Center) |
| 167 | .margin({ top: $r('app.float.margin_16') }) | 202 | .margin({ top: $r('app.float.margin_16') }) |
| 168 | - .alignRules({ top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 169 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } }) | 203 | + .alignRules({ |
| 204 | + top: { anchor: "e_newspaper_shadow", align: VerticalAlign.Bottom }, | ||
| 205 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 206 | + }) | ||
| 170 | .id('e_newspaper_next') | 207 | .id('e_newspaper_next') |
| 171 | .onClick((event: ClickEvent) => { | 208 | .onClick((event: ClickEvent) => { |
| 172 | this.swiperController.showNext() | 209 | this.swiperController.showNext() |
| @@ -190,8 +227,10 @@ export struct ENewspaperPageComponent { | @@ -190,8 +227,10 @@ export struct ENewspaperPageComponent { | ||
| 190 | } | 227 | } |
| 191 | .alignItems(VerticalAlign.Bottom) | 228 | .alignItems(VerticalAlign.Bottom) |
| 192 | .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | 229 | .margin({ left: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) |
| 193 | - .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 194 | - left: { anchor: '__container__', align: HorizontalAlign.Start } }) | 230 | + .alignRules({ |
| 231 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 232 | + left: { anchor: '__container__', align: HorizontalAlign.Start } | ||
| 233 | + }) | ||
| 195 | .id('e_newspaper_page_num') | 234 | .id('e_newspaper_page_num') |
| 196 | .onClick((event: ClickEvent) => { | 235 | .onClick((event: ClickEvent) => { |
| 197 | this.pageDialogShow = !this.pageDialogShow | 236 | this.pageDialogShow = !this.pageDialogShow |
| @@ -219,8 +258,10 @@ export struct ENewspaperPageComponent { | @@ -219,8 +258,10 @@ export struct ENewspaperPageComponent { | ||
| 219 | } | 258 | } |
| 220 | .alignItems(VerticalAlign.Center) | 259 | .alignItems(VerticalAlign.Center) |
| 221 | .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) | 260 | .margin({ right: $r('app.float.margin_16'), bottom: $r('app.float.top_tab_bar_height') }) |
| 222 | - .alignRules({ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 223 | - right: { anchor: '__container__', align: HorizontalAlign.End } }) | 261 | + .alignRules({ |
| 262 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 263 | + right: { anchor: '__container__', align: HorizontalAlign.End } | ||
| 264 | + }) | ||
| 224 | .id('e_newspaper_read') | 265 | .id('e_newspaper_read') |
| 225 | .onClick((event: ClickEvent) => { | 266 | .onClick((event: ClickEvent) => { |
| 226 | this.listDialogController.open() | 267 | this.listDialogController.open() |
| @@ -232,24 +273,11 @@ export struct ENewspaperPageComponent { | @@ -232,24 +273,11 @@ export struct ENewspaperPageComponent { | ||
| 232 | .id('e_newspaper_container') | 273 | .id('e_newspaper_container') |
| 233 | } | 274 | } |
| 234 | 275 | ||
| 235 | - async aboutToAppear() { | ||
| 236 | - //获取宽高尺寸 | ||
| 237 | - this.screenWidth = this.displayTool.width | ||
| 238 | - this.picWidth = this.screenWidth - vp2px(52) | ||
| 239 | - this.picHeight = this.picWidth * 566 / 378 | ||
| 240 | - //注册字体 | ||
| 241 | - font.registerFont({ | ||
| 242 | - familyName: 'BebasNeue_Regular', | ||
| 243 | - familySrc: $rawfile('font/BebasNeue_Regular.otf') | ||
| 244 | - }) | ||
| 245 | - this.getNewspaperTime() | ||
| 246 | - this.getNewspaperList() | ||
| 247 | - } | ||
| 248 | - | ||
| 249 | private async getNewspaperTime() { | 276 | private async getNewspaperTime() { |
| 250 | let newspaperTimes = await NewspaperViewModel.getNewspaperTime(this.calendarDate) | 277 | let newspaperTimes = await NewspaperViewModel.getNewspaperTime(this.calendarDate) |
| 251 | if (newspaperTimes && newspaperTimes.length > 0) { | 278 | if (newspaperTimes && newspaperTimes.length > 0) { |
| 252 | this.calendarDate = newspaperTimes[0].date | 279 | this.calendarDate = newspaperTimes[0].date |
| 280 | + this.currentPageNum = '01' | ||
| 253 | } | 281 | } |
| 254 | } | 282 | } |
| 255 | 283 |
| 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: { |
| @@ -41,7 +44,7 @@ export struct MorningEveningPaperComponent { | @@ -41,7 +44,7 @@ export struct MorningEveningPaperComponent { | ||
| 41 | Logger.info(TAG, "currentTime = " + currentTime) | 44 | Logger.info(TAG, "currentTime = " + currentTime) |
| 42 | Logger.info(TAG, `currentTime = ${currentTime}`) | 45 | Logger.info(TAG, `currentTime = ${currentTime}`) |
| 43 | try { | 46 | try { |
| 44 | - let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28927") | 47 | + let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("28949") |
| 45 | this.pageInfoBean = pageInfoBean; | 48 | this.pageInfoBean = pageInfoBean; |
| 46 | this.title = this.pageInfoBean?.topicInfo?.title | 49 | this.title = this.pageInfoBean?.topicInfo?.title |
| 47 | 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); |
| @@ -52,7 +55,12 @@ export struct MorningEveningPaperComponent { | @@ -52,7 +55,12 @@ export struct MorningEveningPaperComponent { | ||
| 52 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 55 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 53 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 56 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 54 | 57 | ||
| 55 | - 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 | + | ||
| 56 | Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) | 64 | Logger.info(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) |
| 57 | } catch (exception) { | 65 | } catch (exception) { |
| 58 | 66 | ||
| @@ -67,32 +75,33 @@ export struct MorningEveningPaperComponent { | @@ -67,32 +75,33 @@ export struct MorningEveningPaperComponent { | ||
| 67 | ListItem() { | 75 | ListItem() { |
| 68 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 76 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 69 | } | 77 | } |
| 70 | - } | ||
| 71 | 78 | ||
| 72 | - ListItem() { | ||
| 73 | - AudioBarView() | 79 | + ListItem() { |
| 80 | + AudioBarView() | ||
| 81 | + } | ||
| 74 | } | 82 | } |
| 75 | 83 | ||
| 76 | ListItem() { | 84 | ListItem() { |
| 77 | - SingleColumn999Component() | 85 | + SingleColumn999Component({ compListItem: this.compListItem }).margin({ top: $r('app.float.top_bar_height') }) |
| 78 | } | 86 | } |
| 79 | } | 87 | } |
| 80 | // .backgroundColor('#FFF1F3F5') | 88 | // .backgroundColor('#FFF1F3F5') |
| 81 | // .backgroundColor(Color.Blue) | 89 | // .backgroundColor(Color.Blue) |
| 82 | .height('100%') | 90 | .height('100%') |
| 83 | - .margin({ left: 14, right: 14 }) | ||
| 84 | 91 | ||
| 85 | - PaperTitleComponent() | ||
| 86 | - // PaperTitleComponent({ | ||
| 87 | - // // title: this.morningEveningPaperDTO?.topicInfo?.title ?? "", | ||
| 88 | - // title: this.title ?? "", | ||
| 89 | - // // subtitle: this.morningEveningPaperDTO?.topicInfo?.topicDate ?? '' | ||
| 90 | - // subtitle: this.subTitle | ||
| 91 | - // }) | 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 | + // }) | ||
| 92 | .margin({ left: 14, right: 14 }) | 100 | .margin({ left: 14, right: 14 }) |
| 93 | } | 101 | } |
| 94 | .width('100%') | 102 | .width('100%') |
| 95 | // .backgroundColor('#000080') | 103 | // .backgroundColor('#000080') |
| 96 | - .backgroundColor(Color.Black) | 104 | + // .backgroundColor(Color.Black) |
| 105 | + .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | ||
| 97 | } | 106 | } |
| 98 | } | 107 | } |
| @@ -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 |
| @@ -36,12 +36,14 @@ export struct topicInfoView { | @@ -36,12 +36,14 @@ export struct topicInfoView { | ||
| 36 | .fontSize(16) | 36 | .fontSize(16) |
| 37 | .fontColor($r('app.color.white')) | 37 | .fontColor($r('app.color.white')) |
| 38 | .maxLines(1) | 38 | .maxLines(1) |
| 39 | + .backgroundColor($r('app.color.color_99636363')) | ||
| 40 | + .borderRadius(2) | ||
| 39 | 41 | ||
| 40 | Image($r('app.media.more')) | 42 | Image($r('app.media.more')) |
| 41 | .height($r('app.float.top_arrow_size')) | 43 | .height($r('app.float.top_arrow_size')) |
| 42 | .width(20) | 44 | .width(20) |
| 43 | } | 45 | } |
| 44 | - .margin({ top: 10 }) | 46 | + .margin({ top: 10, left: 16, right: 16 }) |
| 45 | // .backgroundColor(Color.Red) | 47 | // .backgroundColor(Color.Red) |
| 46 | .alignRules({ | 48 | .alignRules({ |
| 47 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 49 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| @@ -6,17 +6,18 @@ const TAG = "RMCalendar" | @@ -6,17 +6,18 @@ const TAG = "RMCalendar" | ||
| 6 | @Component | 6 | @Component |
| 7 | export struct RMCalendar { | 7 | export struct RMCalendar { |
| 8 | @State selectItem: RMCalendarBean = new RMCalendarBean() | 8 | @State selectItem: RMCalendarBean = new RMCalendarBean() |
| 9 | - private today: Date = new Date() // 当天 | 9 | + //选中的日期 |
| 10 | + private selectDay: Date = new Date() | ||
| 10 | // 开始日期 | 11 | // 开始日期 |
| 11 | startDate: Date = new Date() | 12 | startDate: Date = new Date() |
| 12 | // 截止日期 | 13 | // 截止日期 |
| 13 | endDate: Date = new Date() | 14 | endDate: Date = new Date() |
| 14 | //当前日期-当前显示的月份的第一天 | 15 | //当前日期-当前显示的月份的第一天 |
| 15 | - private startDay: Date = new Date( | ||
| 16 | - this.today.getFullYear(), | ||
| 17 | - this.today.getMonth(), | ||
| 18 | - 1 | ||
| 19 | - ) | 16 | + // private startDay: Date = new Date( |
| 17 | + // this.selectDay.getFullYear(), | ||
| 18 | + // this.selectDay.getMonth(), | ||
| 19 | + // 1 | ||
| 20 | + // ) | ||
| 20 | // 是否有上一个月 | 21 | // 是否有上一个月 |
| 21 | @State private hasPre: boolean = true | 22 | @State private hasPre: boolean = true |
| 22 | // 是否有下一个月 | 23 | // 是否有下一个月 |
| @@ -42,12 +43,12 @@ export struct RMCalendar { | @@ -42,12 +43,12 @@ export struct RMCalendar { | ||
| 42 | itemFontColor: ResourceColor = "#333333" | 43 | itemFontColor: ResourceColor = "#333333" |
| 43 | itemFontWeight: FontWeight = FontWeight.Bold | 44 | itemFontWeight: FontWeight = FontWeight.Bold |
| 44 | // 今日字体颜色 | 45 | // 今日字体颜色 |
| 45 | - todayFontColor: ResourceColor = "#ED2800" | 46 | + selectDayFontColor: ResourceColor = "#ED2800" |
| 46 | // 不能使用的日期字体颜色 | 47 | // 不能使用的日期字体颜色 |
| 47 | disabledFontColor: ResourceColor = "#CCCCCC" | 48 | disabledFontColor: ResourceColor = "#CCCCCC" |
| 48 | // 选中日期字体颜色 | 49 | // 选中日期字体颜色 |
| 49 | selectFontColor: ResourceColor = "#FFFFFF" | 50 | selectFontColor: ResourceColor = "#FFFFFF" |
| 50 | - // 选中日期背景颜色, 默认与todayFontColor一致 | 51 | + // 选中日期背景颜色, 默认与selectDayFontColor一致 |
| 51 | selectItemBgColor: ResourceColor = "#ED2800" | 52 | selectItemBgColor: ResourceColor = "#ED2800" |
| 52 | @State private title: string = '' | 53 | @State private title: string = '' |
| 53 | // 计算的总加载 | 54 | // 计算的总加载 |
| @@ -57,7 +58,7 @@ export struct RMCalendar { | @@ -57,7 +58,7 @@ export struct RMCalendar { | ||
| 57 | // 自定义每一项布局 | 58 | // 自定义每一项布局 |
| 58 | public cellLayout?: (item: RMCalendarBean) => void | 59 | public cellLayout?: (item: RMCalendarBean) => void |
| 59 | // 仅自定义 今日 样式,当使用cellLayout时,tadayLayout无效 | 60 | // 仅自定义 今日 样式,当使用cellLayout时,tadayLayout无效 |
| 60 | - todayLayout?: (item: RMCalendarBean) => void | 61 | + selectDayLayout?: (item: RMCalendarBean) => void |
| 61 | // 计算item时,如需添加更多自定义属性时使用 | 62 | // 计算item时,如需添加更多自定义属性时使用 |
| 62 | reBuildDateItem?: (item: RMCalendarBean) => RMCalendarBean | 63 | reBuildDateItem?: (item: RMCalendarBean) => RMCalendarBean |
| 63 | // 选择变化监听, | 64 | // 选择变化监听, |
| @@ -84,10 +85,10 @@ export struct RMCalendar { | @@ -84,10 +85,10 @@ export struct RMCalendar { | ||
| 84 | cellLayout: this.cellLayout, | 85 | cellLayout: this.cellLayout, |
| 85 | itemFontSize: this.itemFontSize, | 86 | itemFontSize: this.itemFontSize, |
| 86 | itemFontColor: this.itemFontColor, | 87 | itemFontColor: this.itemFontColor, |
| 87 | - today: this.today.getTime(), | 88 | + selectDay: this.selectDay.getTime(), |
| 88 | itemFontWeight: this.itemFontWeight, | 89 | itemFontWeight: this.itemFontWeight, |
| 89 | - todayFontColor: this.todayFontColor, | ||
| 90 | - todayLayout: this.todayLayout, | 90 | + selectDayFontColor: this.selectDayFontColor, |
| 91 | + selectDayLayout: this.selectDayLayout, | ||
| 91 | selectItem: $selectItem, | 92 | selectItem: $selectItem, |
| 92 | selectFontColor: this.selectFontColor, | 93 | selectFontColor: this.selectFontColor, |
| 93 | selectItemBgColor: this.selectItemBgColor, | 94 | selectItemBgColor: this.selectItemBgColor, |
| @@ -123,12 +124,12 @@ export struct RMCalendar { | @@ -123,12 +124,12 @@ export struct RMCalendar { | ||
| 123 | */ | 124 | */ |
| 124 | initAttr() { | 125 | initAttr() { |
| 125 | if (!this.selectItemBgColor) { | 126 | if (!this.selectItemBgColor) { |
| 126 | - this.selectItemBgColor = this.todayFontColor | 127 | + this.selectItemBgColor = this.selectDayFontColor |
| 127 | } | 128 | } |
| 128 | - this.today = new Date( | ||
| 129 | - this.today.getFullYear(), | ||
| 130 | - this.today.getMonth(), | ||
| 131 | - this.today.getDate(), | 129 | + this.selectDay = new Date( |
| 130 | + this.selectDay.getFullYear(), | ||
| 131 | + this.selectDay.getMonth(), | ||
| 132 | + this.selectDay.getDate(), | ||
| 132 | ) | 133 | ) |
| 133 | 134 | ||
| 134 | // 开始日期 | 135 | // 开始日期 |
| @@ -137,24 +138,24 @@ export struct RMCalendar { | @@ -137,24 +138,24 @@ export struct RMCalendar { | ||
| 137 | } | 138 | } |
| 138 | // 截止日期 | 139 | // 截止日期 |
| 139 | if (!this.endDate) { | 140 | if (!this.endDate) { |
| 140 | - this.endDate = new Date(this.today.getFullYear() + 10, 11, 31) | 141 | + this.endDate = new Date(this.selectDay.getFullYear() + 10, 11, 31) |
| 141 | } | 142 | } |
| 142 | 143 | ||
| 143 | - if (this.today.getTime() < this.startDate.getTime()) { | ||
| 144 | - this.startDay.setTime(this.startDate.getTime()) | ||
| 145 | - } else if (this.today.getTime() > this.endDate.getTime()) { | ||
| 146 | - this.startDay.setTime(this.endDate.getTime()) | 144 | + if (this.selectDay.getTime() < this.startDate.getTime()) { |
| 145 | + this.selectDay.setTime(this.startDate.getTime()) | ||
| 146 | + } else if (this.selectDay.getTime() > this.endDate.getTime()) { | ||
| 147 | + this.selectDay.setTime(this.endDate.getTime()) | ||
| 147 | } else { | 148 | } else { |
| 148 | - this.startDay.setTime(this.today.getTime()) | 149 | + this.selectDay.setTime(this.selectDay.getTime()) |
| 149 | } | 150 | } |
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | aboutToAppear() { | 153 | aboutToAppear() { |
| 153 | this.initAttr() | 154 | this.initAttr() |
| 154 | let temp = new RMCalendarBean() | 155 | let temp = new RMCalendarBean() |
| 155 | - temp.time = this.today.getTime() | 156 | + temp.time = this.selectDay.getTime() |
| 156 | this.selectItem = temp | 157 | this.selectItem = temp |
| 157 | - this.calcDatas() | 158 | + this.calcData() |
| 158 | } | 159 | } |
| 159 | 160 | ||
| 160 | /** | 161 | /** |
| @@ -163,12 +164,12 @@ export struct RMCalendar { | @@ -163,12 +164,12 @@ export struct RMCalendar { | ||
| 163 | private nextMonth() { | 164 | private nextMonth() { |
| 164 | // this.dates.slice(0, this.dates.length) | 165 | // this.dates.slice(0, this.dates.length) |
| 165 | this.dates = [] | 166 | this.dates = [] |
| 166 | - const beforDate = new Date(this.startDay.getFullYear(), this.startDay.getMonth()) | ||
| 167 | - this.startDay.setMonth(this.startDay.getMonth() + 1) | 167 | + const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()) |
| 168 | + this.selectDay.setMonth(this.selectDay.getMonth() + 1) | ||
| 168 | if (this.onMonthChange) { | 169 | if (this.onMonthChange) { |
| 169 | - this.onMonthChange(new Date(this.startDay.getFullYear(), this.startDay.getMonth()), beforDate) | 170 | + this.onMonthChange(new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()), beforDate) |
| 170 | } | 171 | } |
| 171 | - this.calcDatas() | 172 | + this.calcData() |
| 172 | } | 173 | } |
| 173 | 174 | ||
| 174 | /** | 175 | /** |
| @@ -177,60 +178,57 @@ export struct RMCalendar { | @@ -177,60 +178,57 @@ export struct RMCalendar { | ||
| 177 | private preMonth() { | 178 | private preMonth() { |
| 178 | // this.dates.slice(0, this.dates.length) | 179 | // this.dates.slice(0, this.dates.length) |
| 179 | this.dates = [] | 180 | this.dates = [] |
| 180 | - const beforDate = new Date(this.startDay.getFullYear(), this.startDay.getMonth()) | ||
| 181 | - this.startDay.setMonth(this.startDay.getMonth() - 1) | 181 | + const beforDate = new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()) |
| 182 | + this.selectDay.setMonth(this.selectDay.getMonth() - 1) | ||
| 182 | if (this.onMonthChange) { | 183 | if (this.onMonthChange) { |
| 183 | - this.onMonthChange(new Date(this.startDay.getFullYear(), this.startDay.getMonth()), beforDate) | 184 | + this.onMonthChange(new Date(this.selectDay.getFullYear(), this.selectDay.getMonth()), beforDate) |
| 184 | } | 185 | } |
| 185 | - this.calcDatas() | 186 | + this.calcData() |
| 186 | } | 187 | } |
| 187 | 188 | ||
| 188 | /** | 189 | /** |
| 189 | * 具体计算 | 190 | * 具体计算 |
| 190 | */ | 191 | */ |
| 191 | - private calcDatas() { | ||
| 192 | - const startDay = this.startDay | ||
| 193 | - this.title = `${startDay.getFullYear()}年${startDay.getMonth() + 1}月` | ||
| 194 | - startDay.setDate(1) | 192 | + private calcData() { |
| 195 | 193 | ||
| 196 | - if (startDay.getFullYear() < this.startDate.getFullYear() | ||
| 197 | - || (startDay.getFullYear() == this.startDate.getFullYear() && startDay.getMonth() <= this.startDate.getMonth())) { | 194 | + this.title = `${this.selectDay.getFullYear()}年${this.selectDay.getMonth() + 1}月` |
| 195 | + this.selectDay.setDate(1) | ||
| 196 | + | ||
| 197 | + if (this.selectDay.getFullYear() < this.startDate.getFullYear() | ||
| 198 | + || (this.selectDay.getFullYear() == this.startDate.getFullYear() && this.selectDay.getMonth() <= this.startDate.getMonth())) { | ||
| 198 | this.hasPre = false | 199 | this.hasPre = false |
| 199 | } else { | 200 | } else { |
| 200 | this.hasPre = true | 201 | this.hasPre = true |
| 201 | } | 202 | } |
| 202 | 203 | ||
| 203 | - if (startDay.getFullYear() > this.endDate.getFullYear() | ||
| 204 | - || (startDay.getFullYear() == this.endDate.getFullYear() && startDay.getMonth() >= this.endDate.getMonth())) { | 204 | + if (this.selectDay.getFullYear() > this.endDate.getFullYear() |
| 205 | + || (this.selectDay.getFullYear() == this.endDate.getFullYear() && this.selectDay.getMonth() >= this.endDate.getMonth())) { | ||
| 205 | this.hasNext = false | 206 | this.hasNext = false |
| 206 | } else { | 207 | } else { |
| 207 | this.hasNext = true | 208 | this.hasNext = true |
| 208 | } | 209 | } |
| 209 | - | ||
| 210 | - // 计算第一个月 | ||
| 211 | - // 获取第一个月总天数 | ||
| 212 | - let endDay: Date = new Date( | ||
| 213 | - startDay.getFullYear(), | ||
| 214 | - startDay.getMonth() + 1, | 210 | + // 创建一个整月的日期,获取一个月总天数 |
| 211 | + let selectDate: Date = new Date( | ||
| 212 | + this.selectDay.getFullYear(), | ||
| 213 | + this.selectDay.getMonth() + 1, | ||
| 215 | 0, 23, 59, 59) | 214 | 0, 23, 59, 59) |
| 216 | 215 | ||
| 217 | let tempDate: Date = new Date( | 216 | let tempDate: Date = new Date( |
| 218 | - startDay.getFullYear(), | ||
| 219 | - startDay.getMonth(), | ||
| 220 | - startDay.getDate() | 217 | + this.selectDay.getFullYear(), |
| 218 | + this.selectDay.getMonth(), | ||
| 219 | + this.selectDay.getDate() | ||
| 221 | ) | 220 | ) |
| 221 | + //获取当月的总天数 | ||
| 222 | + const count = selectDate.getDate() | ||
| 223 | + //当前日期是周几 | ||
| 224 | + const preCount = this.selectDay.getDay() | ||
| 225 | + const totalCount = count + preCount | ||
| 222 | 226 | ||
| 223 | - const count = endDay.getDate() | ||
| 224 | - const preCount = startDay.getDay() | ||
| 225 | - // const nextCount = 6 - endDay.getDay() | ||
| 226 | - const nextCount = 0 | ||
| 227 | - const finilCount = count + preCount + nextCount | ||
| 228 | - | ||
| 229 | - // 补齐上一个月 | ||
| 230 | - tempDate.setDate(tempDate.getDate() - preCount) | 227 | + // 补齐上一个月差的天数,需要在当月展示的部分,下面计算日期循环加1天 |
| 228 | + tempDate.setDate(this.selectDay.getDate() - preCount) | ||
| 231 | 229 | ||
| 232 | - // 添加日期 | ||
| 233 | - for (let index = 0; index < finilCount; index++) { | 230 | + // 添加当月需要展示的日期 |
| 231 | + for (let index = 0; index < totalCount; index++) { | ||
| 234 | let item = new RMCalendarBean( | 232 | let item = new RMCalendarBean( |
| 235 | tempDate.getFullYear(), | 233 | tempDate.getFullYear(), |
| 236 | tempDate.getMonth(), | 234 | tempDate.getMonth(), |
| @@ -7,12 +7,12 @@ export struct RMCalenderCell { | @@ -7,12 +7,12 @@ export struct RMCalenderCell { | ||
| 7 | itemFontSize: Length = 0 | 7 | itemFontSize: Length = 0 |
| 8 | itemFontColor: ResourceColor = {} as ResourceColor | 8 | itemFontColor: ResourceColor = {} as ResourceColor |
| 9 | itemFontWeight: FontWeight = FontWeight.Normal | 9 | itemFontWeight: FontWeight = FontWeight.Normal |
| 10 | - todayFontColor: ResourceColor = {} as ResourceColor | 10 | + selectDayFontColor: ResourceColor = {} as ResourceColor |
| 11 | selectFontColor: ResourceColor = {} as ResourceColor | 11 | selectFontColor: ResourceColor = {} as ResourceColor |
| 12 | selectItemBgColor: ResourceColor = {} as ResourceColor | 12 | selectItemBgColor: ResourceColor = {} as ResourceColor |
| 13 | disabledFontColor: ResourceColor = {} as ResourceColor | 13 | disabledFontColor: ResourceColor = {} as ResourceColor |
| 14 | // 今日时间戳 | 14 | // 今日时间戳 |
| 15 | - today: number = 0 | 15 | + selectDay: number = 0 |
| 16 | @Link selectItem: RMCalendarBean | 16 | @Link selectItem: RMCalendarBean |
| 17 | @Link selectedDates: Array<RMCalendarBean> | 17 | @Link selectedDates: Array<RMCalendarBean> |
| 18 | @Prop hasPre: boolean | 18 | @Prop hasPre: boolean |
| @@ -20,7 +20,7 @@ export struct RMCalenderCell { | @@ -20,7 +20,7 @@ export struct RMCalenderCell { | ||
| 20 | @ObjectLink item: RMCalendarBean | 20 | @ObjectLink item: RMCalendarBean |
| 21 | // 自定义每一项布局 | 21 | // 自定义每一项布局 |
| 22 | cellLayout?: (item: RMCalendarBean) => void | 22 | cellLayout?: (item: RMCalendarBean) => void |
| 23 | - todayLayout?: (item: RMCalendarBean) => void | 23 | + selectDayLayout?: (item: RMCalendarBean) => void |
| 24 | cellClick?: (item: RMCalendarBean) => void | 24 | cellClick?: (item: RMCalendarBean) => void |
| 25 | disableClick?: (item: RMCalendarBean) => void | 25 | disableClick?: (item: RMCalendarBean) => void |
| 26 | 26 | ||
| @@ -43,8 +43,6 @@ export struct RMCalenderCell { | @@ -43,8 +43,6 @@ export struct RMCalenderCell { | ||
| 43 | return this.disabledFontColor | 43 | return this.disabledFontColor |
| 44 | } else if (this.selectItem && this.selectItem.time == this.item.time) { | 44 | } else if (this.selectItem && this.selectItem.time == this.item.time) { |
| 45 | return this.selectFontColor | 45 | return this.selectFontColor |
| 46 | - } else if (this.item.time == this.today) { | ||
| 47 | - return this.todayFontColor | ||
| 48 | } | 46 | } |
| 49 | return this.itemFontColor | 47 | return this.itemFontColor |
| 50 | } | 48 | } |
| @@ -140,4 +138,5 @@ export struct RMCalenderCell { | @@ -140,4 +138,5 @@ export struct RMCalenderCell { | ||
| 140 | } | 138 | } |
| 141 | }) | 139 | }) |
| 142 | } | 140 | } |
| 141 | + | ||
| 143 | } | 142 | } |
| @@ -45,7 +45,11 @@ export default struct MinePagePersonFunctionUI { | @@ -45,7 +45,11 @@ export default struct MinePagePersonFunctionUI { | ||
| 45 | break; | 45 | break; |
| 46 | } | 46 | } |
| 47 | case "收藏":{ | 47 | case "收藏":{ |
| 48 | - WDRouterRule.jumpWithPage(WDRouterPage.editUserInfoPage) | 48 | + WDRouterRule.jumpWithPage(WDRouterPage.myCollectionListPagePage) |
| 49 | + break; | ||
| 50 | + } | ||
| 51 | + case "历史":{ | ||
| 52 | + WDRouterRule.jumpWithPage(WDRouterPage.browsingHistoryPage) | ||
| 49 | break; | 53 | break; |
| 50 | } | 54 | } |
| 51 | } | 55 | } |
| 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 | +} |
| 1 | -import { ResourcesUtils } from 'wdKit' | ||
| 2 | -import { ResponseDTO } from 'wdNetwork' | ||
| 3 | -import { MyCollectionModel } from '../../model/MyCollectionModel' | ||
| 4 | import { CustomTitleUI } from '../reusable/CustomTitleUI' | 1 | import { CustomTitleUI } from '../reusable/CustomTitleUI' |
| 2 | +import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | ||
| 3 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | +import { CommonConstants, ViewType } from 'wdConstant' | ||
| 5 | +import { EmptyComponent } from '../view/EmptyComponent' | ||
| 6 | +import { ErrorComponent } from '../view/ErrorComponent' | ||
| 7 | +import RefreshLayout from './RefreshLayout' | ||
| 8 | +import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 9 | +import { CompDTO } from 'wdBean' | ||
| 10 | +import LoadMoreLayout from './LoadMoreLayout' | ||
| 11 | +import NoMoreLayout from './NoMoreLayout' | ||
| 12 | +import { CompParser } from '../CompParser' | ||
| 13 | +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 14 | +import { listTouchEvent } from '../../utils/PullDownRefresh'; | ||
| 5 | 15 | ||
| 6 | @Entry | 16 | @Entry |
| 7 | @Component | 17 | @Component |
| 8 | struct BrowsingHistoryPage { | 18 | struct BrowsingHistoryPage { |
| 9 | - private browsingHistoryList:MyCollectionModel[] = [] | 19 | + @State private browSingModel: PageModel = new PageModel() |
| 10 | 20 | ||
| 11 | aboutToAppear(){ | 21 | aboutToAppear(){ |
| 12 | - ResourcesUtils.getResourcesJson<ResponseDTO<MyCollectionModel[]>>(getContext(this),'browsingHistory_list_data.json').then((success)=>{ | ||
| 13 | - success.data?.forEach(element => { | ||
| 14 | - this.browsingHistoryList.push(element) | ||
| 15 | - }); | ||
| 16 | - console.log("ycg",this.browsingHistoryList.length.toString()); | ||
| 17 | - }) | 22 | + // this.getData() |
| 18 | } | 23 | } |
| 19 | 24 | ||
| 20 | build() { | 25 | build() { |
| 21 | Column(){ | 26 | Column(){ |
| 22 | CustomTitleUI({titleName:'浏览历史'}) | 27 | CustomTitleUI({titleName:'浏览历史'}) |
| 23 | - List({}){ | ||
| 24 | - ForEach( | ||
| 25 | - this.browsingHistoryList, | ||
| 26 | - (item: MyCollectionModel) =>{ | ||
| 27 | - ListItem(){ | ||
| 28 | - this.HistoryItem(item) | ||
| 29 | - } | ||
| 30 | - } | ||
| 31 | - ) | 28 | + if (this.browSingModel.viewType == ViewType.LOADING){ |
| 29 | + this.LoadingLayout() | ||
| 30 | + }else if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 31 | + ErrorComponent() | ||
| 32 | + }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 33 | + EmptyComponent() | ||
| 34 | + }else { | ||
| 35 | + this.ListLayout() | ||
| 32 | } | 36 | } |
| 33 | } | 37 | } |
| 34 | - .height('100%') | 38 | + .width(CommonConstants.FULL_WIDTH) |
| 39 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 40 | + .onTouch((event: TouchEvent | undefined) => { | ||
| 41 | + if (event) { | ||
| 42 | + if (this.browSingModel.viewType === ViewType.LOADED) { | ||
| 43 | + listTouchEvent(this.browSingModel, event); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + }) | ||
| 35 | } | 47 | } |
| 36 | 48 | ||
| 37 | - @Builder | ||
| 38 | - HistoryItem(item: MyCollectionModel){ | ||
| 39 | - Column(){ | ||
| 40 | - Row(){ | ||
| 41 | - Column(){ | ||
| 42 | - Text('就像是一场不断升级的权亡。') | ||
| 43 | - .maxLines(3) | ||
| 44 | - Text('2024-03-14') | ||
| 45 | - .margin({top:10,bottom:0}) | ||
| 46 | - } | ||
| 47 | - .width('60%') | ||
| 48 | - .alignItems(HorizontalAlign.Start) | 49 | + @Builder ListLayout() { |
| 50 | + List() { | ||
| 51 | + // 下拉刷新 | ||
| 52 | + ListItem() { | ||
| 53 | + RefreshLayout({ | ||
| 54 | + refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullDown, this.browSingModel.pullDownRefreshImage, | ||
| 55 | + this.browSingModel.pullDownRefreshText, this.browSingModel.pullDownRefreshHeight) | ||
| 56 | + }) | ||
| 57 | + } | ||
| 49 | 58 | ||
| 50 | - Blank() | 59 | + LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { |
| 60 | + ListItem() { | ||
| 61 | + Column() { | ||
| 62 | + CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + }) | ||
| 51 | 66 | ||
| 52 | - Image('') | ||
| 53 | - .backgroundColor(Color.Orange) | ||
| 54 | - .width('30%') | ||
| 55 | - .height(80) | ||
| 56 | - .margin({top:10}) | 67 | + // 加载更多 |
| 68 | + ListItem() { | ||
| 69 | + if (this.browSingModel.hasMore) { | ||
| 70 | + LoadMoreLayout({ | ||
| 71 | + refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage, | ||
| 72 | + this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight) | ||
| 73 | + }) | ||
| 74 | + } else { | ||
| 75 | + NoMoreLayout() | ||
| 76 | + } | ||
| 57 | } | 77 | } |
| 58 | - Blank() | ||
| 59 | - Divider() | ||
| 60 | - .width('90%') | ||
| 61 | } | 78 | } |
| 62 | - .width('100%') | ||
| 63 | - .height(100) | 79 | + .height(CommonConstants.FULL_PARENT) |
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Builder LoadingLayout() { | ||
| 83 | + CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, | ||
| 84 | + $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + async getData() { | ||
| 88 | + this.browSingModel.currentPage = 1 | ||
| 89 | + MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => { | ||
| 90 | + if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | ||
| 91 | + this.browSingModel.viewType = ViewType.LOADED; | ||
| 92 | + this.browSingModel.compList.push(...pageDto.compList) | ||
| 93 | + if (pageDto.compList.length === this.browSingModel.pageSize) { | ||
| 94 | + this.browSingModel.currentPage++; | ||
| 95 | + this.browSingModel.hasMore = true; | ||
| 96 | + } else { | ||
| 97 | + this.browSingModel.hasMore = false; | ||
| 98 | + } | ||
| 99 | + } else { | ||
| 100 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 101 | + } | ||
| 102 | + }) | ||
| 64 | } | 103 | } |
| 65 | } | 104 | } |
| @@ -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 { CustomTitleUI } from '../reusable/CustomTitleUI' | ||
| 2 | +import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | ||
| 3 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | +import { CommonConstants, ViewType } from 'wdConstant' | ||
| 5 | +import { EmptyComponent } from '../view/EmptyComponent' | ||
| 6 | +import { ErrorComponent } from '../view/ErrorComponent' | ||
| 7 | +import RefreshLayout from './RefreshLayout' | ||
| 8 | +import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 9 | +import { CompDTO } from 'wdBean' | ||
| 10 | +import LoadMoreLayout from './LoadMoreLayout' | ||
| 11 | +import NoMoreLayout from './NoMoreLayout' | ||
| 12 | +import { CompParser } from '../CompParser' | ||
| 13 | +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 14 | + | ||
| 15 | +@Entry | ||
| 16 | +@Component | ||
| 17 | +struct MyCollectionListPage { | ||
| 18 | + @State private browSingModel: PageModel = new PageModel() | ||
| 19 | + isloading : boolean = false | ||
| 20 | + | ||
| 21 | + aboutToAppear(){ | ||
| 22 | + // this.getData() | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + build() { | ||
| 26 | + Column(){ | ||
| 27 | + CustomTitleUI({titleName:'我的收藏'}) | ||
| 28 | + if (this.browSingModel.viewType == ViewType.LOADING){ | ||
| 29 | + this.LoadingLayout() | ||
| 30 | + }else if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 31 | + ErrorComponent() | ||
| 32 | + }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 33 | + EmptyComponent() | ||
| 34 | + }else { | ||
| 35 | + this.ListLayout() | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + .width(CommonConstants.FULL_WIDTH) | ||
| 39 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Builder ListLayout() { | ||
| 43 | + List() { | ||
| 44 | + // 下拉刷新 | ||
| 45 | + ListItem() { | ||
| 46 | + RefreshLayout({ | ||
| 47 | + refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullDown, this.browSingModel.pullDownRefreshImage, | ||
| 48 | + this.browSingModel.pullDownRefreshText, this.browSingModel.pullDownRefreshHeight) | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => { | ||
| 53 | + ListItem() { | ||
| 54 | + Column() { | ||
| 55 | + CompParser({ compDTO: compDTO, compIndex: compIndex }); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + }) | ||
| 59 | + | ||
| 60 | + // 加载更多 | ||
| 61 | + ListItem() { | ||
| 62 | + if (this.browSingModel.hasMore) { | ||
| 63 | + LoadMoreLayout({ | ||
| 64 | + refreshBean: new RefreshLayoutBean(this.browSingModel.isVisiblePullUpLoad, this.browSingModel.pullUpLoadImage, | ||
| 65 | + this.browSingModel.pullUpLoadText, this.browSingModel.pullUpLoadHeight) | ||
| 66 | + }) | ||
| 67 | + } else { | ||
| 68 | + NoMoreLayout() | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + .height(CommonConstants.FULL_PARENT) | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + @Builder LoadingLayout() { | ||
| 76 | + CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true, | ||
| 77 | + $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) }) | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + async getData() { | ||
| 81 | + this.browSingModel.currentPage = 1 | ||
| 82 | + MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => { | ||
| 83 | + if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | ||
| 84 | + this.browSingModel.viewType = ViewType.LOADED; | ||
| 85 | + this.browSingModel.compList.push(...pageDto.compList) | ||
| 86 | + if (pageDto.compList.length === this.browSingModel.pageSize) { | ||
| 87 | + this.browSingModel.currentPage++; | ||
| 88 | + this.browSingModel.hasMore = true; | ||
| 89 | + } else { | ||
| 90 | + this.browSingModel.hasMore = false; | ||
| 91 | + } | ||
| 92 | + } else { | ||
| 93 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 94 | + } | ||
| 95 | + }) | ||
| 96 | + } | ||
| 97 | +} |
| 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) { |
| @@ -6,11 +6,14 @@ export struct ENewspaperCalendarDialog { | @@ -6,11 +6,14 @@ export struct ENewspaperCalendarDialog { | ||
| 6 | calendarDialogController?: CustomDialogController | 6 | calendarDialogController?: CustomDialogController |
| 7 | // 选择变化监听, | 7 | // 选择变化监听, |
| 8 | onDateChange?: (date: RMCalendarBean) => void | 8 | onDateChange?: (date: RMCalendarBean) => void |
| 9 | + //当前选择的日期标记 | ||
| 10 | + @Prop selectDate: Date = new Date() | ||
| 9 | 11 | ||
| 10 | build() { | 12 | build() { |
| 11 | RMCalendar({ | 13 | RMCalendar({ |
| 12 | // 开始日期 | 14 | // 开始日期 |
| 13 | - startDate: new Date(2023, 8, 1), | 15 | + startDate: new Date(2000, 1, 1), |
| 16 | + selectDay: this.selectDate, | ||
| 14 | // 截止日期 | 17 | // 截止日期 |
| 15 | endDate: new Date(), | 18 | endDate: new Date(), |
| 16 | // 日期选择变化监听 | 19 | // 日期选择变化监听 |
| @@ -7,7 +7,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' | @@ -7,7 +7,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog' | ||
| 7 | */ | 7 | */ |
| 8 | @CustomDialog | 8 | @CustomDialog |
| 9 | export struct ENewspaperListDialog { | 9 | export struct ENewspaperListDialog { |
| 10 | - @Link currentPageNum: string | 10 | + @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string |
| 11 | @State pageDialogShow: boolean = false | 11 | @State pageDialogShow: boolean = false |
| 12 | @State scrollIndex: number = 0 | 12 | @State scrollIndex: number = 0 |
| 13 | newspaperListBean: NewspaperListBean = {} as NewspaperListBean | 13 | newspaperListBean: NewspaperListBean = {} as NewspaperListBean |
| @@ -15,18 +15,8 @@ export struct ENewspaperListDialog { | @@ -15,18 +15,8 @@ export struct ENewspaperListDialog { | ||
| 15 | //文字版选择弹框 | 15 | //文字版选择弹框 |
| 16 | pageListDialogController: CustomDialogController = new CustomDialogController({ | 16 | pageListDialogController: CustomDialogController = new CustomDialogController({ |
| 17 | builder: ENewspaperPageDialog({ | 17 | builder: ENewspaperPageDialog({ |
| 18 | - currentPageNum: this.currentPageNum, | ||
| 19 | dialogType: 1, | 18 | dialogType: 1, |
| 20 | newspaperListBean: this.newspaperListBean, | 19 | newspaperListBean: this.newspaperListBean, |
| 21 | - onDateChange: (date: string, dialogType: number) => { | ||
| 22 | - if (dialogType == 1) { | ||
| 23 | - console.log("ENewspaperListDialog-pageListDialogController", "date:", this.currentPageNum) | ||
| 24 | - let _scrollIndex = Number.parseInt(this.currentPageNum) | ||
| 25 | - console.log("ENewspaperListDialog-pageListDialogController", "_swiperIndex:", _scrollIndex) | ||
| 26 | - this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex | ||
| 27 | - this.listScroller.scrollToIndex(this.scrollIndex) | ||
| 28 | - } | ||
| 29 | - } | ||
| 30 | }), | 20 | }), |
| 31 | alignment: DialogAlignment.TopStart, | 21 | alignment: DialogAlignment.TopStart, |
| 32 | offset: { dx: 0, dy: 214 }, | 22 | offset: { dx: 0, dy: 214 }, |
| @@ -37,14 +27,39 @@ export struct ENewspaperListDialog { | @@ -37,14 +27,39 @@ export struct ENewspaperListDialog { | ||
| 37 | // 那么此处需要将指向自己的controller放在所有controller的后面 | 27 | // 那么此处需要将指向自己的controller放在所有controller的后面 |
| 38 | listDialogController: CustomDialogController | 28 | listDialogController: CustomDialogController |
| 39 | 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 | + let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex | ||
| 36 | + this.listScroller.scrollToIndex(scrollIndexEnd) | ||
| 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 | + } | ||
| 52 | + | ||
| 40 | build() { | 53 | build() { |
| 41 | Column() { | 54 | Column() { |
| 42 | Row() | 55 | Row() |
| 43 | .width(43) | 56 | .width(43) |
| 44 | .height(4) | 57 | .height(4) |
| 45 | .backgroundColor('#EDEDED') | 58 | .backgroundColor('#EDEDED') |
| 46 | - .margin({ top: 10, | ||
| 47 | - bottom: 10 }) | 59 | + .margin({ |
| 60 | + top: 10, | ||
| 61 | + bottom: 10 | ||
| 62 | + }) | ||
| 48 | Row() { | 63 | Row() { |
| 49 | Text(this.currentPageNum) | 64 | Text(this.currentPageNum) |
| 50 | .fontSize($r('app.float.font_size_36')) | 65 | .fontSize($r('app.float.font_size_36')) |
| @@ -78,57 +93,61 @@ export struct ENewspaperListDialog { | @@ -78,57 +93,61 @@ export struct ENewspaperListDialog { | ||
| 78 | .margin({ top: 20, left: 16, right: 16 }) | 93 | .margin({ top: 20, left: 16, right: 16 }) |
| 79 | .objectFit(ImageFit.Contain) | 94 | .objectFit(ImageFit.Contain) |
| 80 | 95 | ||
| 81 | - List({ scroller: this.listScroller }) { | 96 | + List({ scroller: this.listScroller, initialIndex: this.scrollIndex }) { |
| 82 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { | 97 | ForEach(this.newspaperListBean?.list, (item: NewspaperListItemBean, index: number) => { |
| 83 | - ForEach(item.items, (positionItem: NewspaperPositionItemBean, itemIndex: number) => { | ||
| 84 | - ListItem() { | ||
| 85 | - Column() { | ||
| 86 | - if (itemIndex == 0) { | ||
| 87 | - Text(item.pageNum + item.pageName) | ||
| 88 | - .fontSize($r('app.float.font_size_14')) | ||
| 89 | - .fontColor($r('app.color.color_ED2800')) | ||
| 90 | - .fontWeight(600) | ||
| 91 | - .margin({ top: 16, bottom: 16 }) | ||
| 92 | - .maxLines(1) | ||
| 93 | - } | 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 | + } | ||
| 94 | 111 | ||
| 95 | - if (positionItem.shortTitle) { | ||
| 96 | - Text(positionItem.shortTitle) | ||
| 97 | - .fontSize($r('app.float.font_size_14')) | ||
| 98 | - .fontColor($r('app.color.color_222222')) | ||
| 99 | - .fontWeight(600) | ||
| 100 | - .maxLines(2) | ||
| 101 | - } | 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 | + } | ||
| 102 | 119 | ||
| 103 | - if (positionItem.title) { | ||
| 104 | - Text(positionItem.title) | ||
| 105 | - .fontSize($r('app.float.font_size_17')) | ||
| 106 | - .fontColor($r('app.color.color_222222')) | ||
| 107 | - .margin({ top: 8 }) | ||
| 108 | - .maxLines(2) | ||
| 109 | - } | 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 | + } | ||
| 110 | 127 | ||
| 111 | - if (positionItem.downTitle) { | ||
| 112 | - Text(positionItem.downTitle) | ||
| 113 | - .fontSize($r('app.float.font_size_14')) | ||
| 114 | - .fontColor($r('app.color.color_222222')) | ||
| 115 | - .fontWeight(600) | ||
| 116 | - .margin({ top: 8 }) | ||
| 117 | - .maxLines(2) | ||
| 118 | - } | 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 | + } | ||
| 119 | 136 | ||
| 120 | - if (positionItem.newsTxt) { | ||
| 121 | - Text(positionItem.newsTxt) | ||
| 122 | - .fontSize($r('app.float.font_size_14')) | ||
| 123 | - .fontColor($r('app.color.color_999999')) | ||
| 124 | - .margin({ top: 15, bottom: 15 }) | ||
| 125 | - .maxLines(5) | 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) | ||
| 126 | } | 146 | } |
| 127 | - } | ||
| 128 | - .alignItems(HorizontalAlign.Start) | ||
| 129 | - } | ||
| 130 | 147 | ||
| 131 | - }) | 148 | + }) |
| 149 | + } | ||
| 150 | + } | ||
| 132 | }) | 151 | }) |
| 133 | } | 152 | } |
| 134 | .width('100%') | 153 | .width('100%') |
| @@ -139,7 +158,17 @@ export struct ENewspaperListDialog { | @@ -139,7 +158,17 @@ export struct ENewspaperListDialog { | ||
| 139 | color: '#EDEDED' | 158 | color: '#EDEDED' |
| 140 | }) | 159 | }) |
| 141 | .onScrollIndex((firstIndex: number) => { | 160 | .onScrollIndex((firstIndex: number) => { |
| 142 | - 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) | ||
| 143 | }) | 172 | }) |
| 144 | } | 173 | } |
| 145 | .width('100%') | 174 | .width('100%') |
| @@ -7,10 +7,12 @@ import { NewspaperListBean, NewspaperListItemBean } from 'wdBean/Index' | @@ -7,10 +7,12 @@ import { NewspaperListBean, NewspaperListItemBean } from 'wdBean/Index' | ||
| 7 | export struct ENewspaperPageDialog { | 7 | export struct ENewspaperPageDialog { |
| 8 | dialogType: number = 0 //0:图片版,1:文字版 | 8 | dialogType: number = 0 //0:图片版,1:文字版 |
| 9 | pageDialogController?: CustomDialogController | 9 | pageDialogController?: CustomDialogController |
| 10 | - @Link currentPageNum: string | 10 | + @Consume @Watch('onCurrentPageNumUpdated') currentPageNum: string |
| 11 | @Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean | 11 | @Prop newspaperListBean: NewspaperListBean = {} as NewspaperListBean |
| 12 | - // 选择变化监听, | ||
| 13 | - onDateChange?: (date: string, dialogType: number) => void | 12 | + |
| 13 | + onCurrentPageNumUpdated(): void { | ||
| 14 | + console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum) | ||
| 15 | + } | ||
| 14 | 16 | ||
| 15 | build() { | 17 | build() { |
| 16 | Column() { | 18 | Column() { |
| @@ -36,9 +38,6 @@ export struct ENewspaperPageDialog { | @@ -36,9 +38,6 @@ export struct ENewspaperPageDialog { | ||
| 36 | .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800')) | 38 | .backgroundColor(this.currentPageNum != item.pageNum ? Color.White : $r('app.color.color_ED2800')) |
| 37 | .onClick((event: ClickEvent) => { | 39 | .onClick((event: ClickEvent) => { |
| 38 | this.currentPageNum = item.pageNum | 40 | this.currentPageNum = item.pageNum |
| 39 | - if (this.onDateChange) { | ||
| 40 | - this.onDateChange(item.pageNum, this.dialogType) | ||
| 41 | - } | ||
| 42 | if (this.pageDialogController) { | 41 | if (this.pageDialogController) { |
| 43 | this.pageDialogController.close() | 42 | this.pageDialogController.close() |
| 44 | } | 43 | } |
| @@ -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 | +import router from '@ohos.router' | ||
| 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter'; | ||
| 3 | +import { HomePageBottomComponent } from '../components/mine/home/HomePageBottomComponent'; | ||
| 4 | + | ||
| 5 | +@Entry | ||
| 6 | +@Component | ||
| 7 | +struct MineHomePage { | ||
| 8 | + @State tileOpacity: number = 0; | ||
| 9 | + firstPositionY:number = 0; | ||
| 10 | + @State isHasIntroduction: boolean = true | ||
| 11 | + @State desc:string = "点击添加简介,让大家认识你" //text 搞两个样式,如果三行,就显示 另外一个text 没有显示高度的 | ||
| 12 | + fontColor: string = '#999999' | ||
| 13 | + selectedFontColor: string = '#000000' | ||
| 14 | + @State currentIndex: number = 0 | ||
| 15 | + private controller: TabsController = new TabsController() | ||
| 16 | + isChangeToUserEdit = false; | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + build() { | ||
| 20 | + Stack({ alignContent: Alignment.Top }){ | ||
| 21 | + Image($r('app.media.title_bg')) | ||
| 22 | + .width('100%') | ||
| 23 | + .height('355lpx') | ||
| 24 | + .objectFit(ImageFit.Cover) | ||
| 25 | + | ||
| 26 | + Column(){ | ||
| 27 | + Stack({ alignContent: Alignment.Top }){ | ||
| 28 | + this.MineHomeTitleTransparent() | ||
| 29 | + this.MineHomeTitleWhite() | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + Scroll() { | ||
| 33 | + Column() { | ||
| 34 | + //用户信息区域 | ||
| 35 | + Row() { | ||
| 36 | + Image($r('app.media.default_head')) | ||
| 37 | + .width('115lpx') | ||
| 38 | + .height('115lpx') | ||
| 39 | + .objectFit(ImageFit.Cover) | ||
| 40 | + .borderRadius(50) | ||
| 41 | + | ||
| 42 | + Column() { | ||
| 43 | + Row() { | ||
| 44 | + Text("人民日报6G") | ||
| 45 | + .fontColor($r('app.color.white')) | ||
| 46 | + .maxLines(1) | ||
| 47 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 48 | + .fontSize('38lpx') | ||
| 49 | + .lineHeight('50lpx') | ||
| 50 | + .fontWeight('500lpx') | ||
| 51 | + | ||
| 52 | + Text("等级8") | ||
| 53 | + .textAlign(TextAlign.Center) | ||
| 54 | + .fontColor($r('app.color.color_ED2800')) | ||
| 55 | + .backgroundColor($r('app.color.white')) | ||
| 56 | + .fontSize('19lpx') | ||
| 57 | + .width('96lpx') | ||
| 58 | + .height('35lpx') | ||
| 59 | + .margin({ left: '10lpx' }) | ||
| 60 | + Blank() | ||
| 61 | + }.width('507lpx') | ||
| 62 | + | ||
| 63 | + Row() { | ||
| 64 | + Row() { | ||
| 65 | + Text("3.6万") | ||
| 66 | + .textStyle() | ||
| 67 | + Text("阅读") | ||
| 68 | + .textStyle2() | ||
| 69 | + } | ||
| 70 | + .margin({ right: '15lpx' }) | ||
| 71 | + | ||
| 72 | + Divider() | ||
| 73 | + .height('19lpx') | ||
| 74 | + .width('2lpx') | ||
| 75 | + .color($r('app.color.white')) | ||
| 76 | + .vertical(true) | ||
| 77 | + .opacity(0.4) | ||
| 78 | + Row() { | ||
| 79 | + Text("6242") | ||
| 80 | + .textStyle() | ||
| 81 | + Text("评论") | ||
| 82 | + .textStyle2() | ||
| 83 | + }.margin({ right: '15lpx', left: '15lpx' }) | ||
| 84 | + | ||
| 85 | + Divider() | ||
| 86 | + .height('19lpx') | ||
| 87 | + .width('2lpx') | ||
| 88 | + .color($r('app.color.white')) | ||
| 89 | + .vertical(true) | ||
| 90 | + .opacity(0.4) | ||
| 91 | + Row() { | ||
| 92 | + Text("86") | ||
| 93 | + .textStyle() | ||
| 94 | + Text("关注") | ||
| 95 | + .textStyle2() | ||
| 96 | + }.margin({ left: '15lpx' }) | ||
| 97 | + }.margin({ top: '23lpx' }) | ||
| 98 | + }.alignItems(HorizontalAlign.Start) | ||
| 99 | + .margin({ left: '32lpx' }) | ||
| 100 | + } | ||
| 101 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 102 | + if (this.firstPositionY === 0) { | ||
| 103 | + this.firstPositionY = newValue.globalPosition.y as number | ||
| 104 | + }else{ | ||
| 105 | + let persent = (this.firstPositionY - Number(newValue.globalPosition.y)) / (this.firstPositionY * 0.3) | ||
| 106 | + if(persent > 1){ | ||
| 107 | + persent = 1 | ||
| 108 | + } | ||
| 109 | + this.tileOpacity = persent | ||
| 110 | + } | ||
| 111 | + }) | ||
| 112 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 113 | + .height('184lpx') | ||
| 114 | + .width('100%') | ||
| 115 | + .padding({ left: '35lpx' }) | ||
| 116 | + //用户简介区域 | ||
| 117 | + Column() { | ||
| 118 | + Row() { | ||
| 119 | + Text(this.desc) | ||
| 120 | + .fontSize('27lpx') | ||
| 121 | + .maxLines(3) | ||
| 122 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 123 | + .lineHeight('40lpx') | ||
| 124 | + .fontWeight('400lpx') | ||
| 125 | + .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) | ||
| 126 | + .textAlign(TextAlign.Start) | ||
| 127 | + | ||
| 128 | + if(!this.isHasIntroduction){ | ||
| 129 | + Image($r('app.media.user_info_edit_icon')) | ||
| 130 | + .width('27lpx') | ||
| 131 | + .height('27lpx') | ||
| 132 | + .objectFit(ImageFit.Auto) | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + Text("来到人民日报365天") | ||
| 136 | + .fontSize('23lpx') | ||
| 137 | + .lineHeight('25lpx') | ||
| 138 | + .fontWeight('400lpx') | ||
| 139 | + .fontColor($r('app.color.color_999999')) | ||
| 140 | + .textAlign(TextAlign.Start) | ||
| 141 | + .margin({ top: '15lpx' }) | ||
| 142 | + | ||
| 143 | + }.padding({ left: '31lpx',right:'31lpx',top:'19lpx',bottom:'31lpx'}) | ||
| 144 | + .alignItems(HorizontalAlign.Start) | ||
| 145 | + .justifyContent(FlexAlign.Center) | ||
| 146 | + .width('100%') | ||
| 147 | + .backgroundColor($r('app.color.white')) | ||
| 148 | + //间隔符 | ||
| 149 | + | ||
| 150 | + Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | ||
| 151 | + | ||
| 152 | + //tab 页面 | ||
| 153 | + Tabs({controller: this.controller}) { | ||
| 154 | + TabContent() { | ||
| 155 | + HomePageBottomComponent({style:0}) | ||
| 156 | + }.tabBar(this.TabBuilder(0,"评论")) | ||
| 157 | + TabContent() { | ||
| 158 | + HomePageBottomComponent({style:1}) | ||
| 159 | + }.tabBar(this.TabBuilder(1,"关注")) | ||
| 160 | + } | ||
| 161 | + .backgroundColor($r('app.color.white')) | ||
| 162 | + .animationDuration(0) | ||
| 163 | + .onChange((index: number) => { | ||
| 164 | + this.currentIndex = index | ||
| 165 | + }) | ||
| 166 | + .vertical(false) | ||
| 167 | + .height("100%") | ||
| 168 | + }.width("100%") | ||
| 169 | + } | ||
| 170 | + .edgeEffect(EdgeEffect.None) | ||
| 171 | + .scrollBar(BarState.Off) | ||
| 172 | + .width('100%') | ||
| 173 | + .height('100%') | ||
| 174 | + } | ||
| 175 | + }.width('100%') | ||
| 176 | + .height('100%') | ||
| 177 | + | ||
| 178 | + } | ||
| 179 | + @Builder MineHomeTitleTransparent() { | ||
| 180 | + RelativeContainer() { | ||
| 181 | + //标题栏目 | ||
| 182 | + Image($r('app.media.icon_arrow_left_white') ) | ||
| 183 | + .width('46lpx') | ||
| 184 | + .height('46lpx') | ||
| 185 | + .objectFit(ImageFit.Auto) | ||
| 186 | + .id("back_icon") | ||
| 187 | + .alignRules({ | ||
| 188 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 189 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 190 | + }) | ||
| 191 | + .margin({ left: '31lpx' }) | ||
| 192 | + .onClick(() => { | ||
| 193 | + router.back() | ||
| 194 | + }) | ||
| 195 | + | ||
| 196 | + Text("编辑资料") | ||
| 197 | + .height('42lpx') | ||
| 198 | + .maxLines(1) | ||
| 199 | + .id("rightText") | ||
| 200 | + .fontSize('35lpx') | ||
| 201 | + .fontWeight('400lpx') | ||
| 202 | + .fontColor($r('app.color.white') ) | ||
| 203 | + .lineHeight('42lpx') | ||
| 204 | + .alignRules({ | ||
| 205 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 206 | + right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 207 | + }) | ||
| 208 | + .margin({ right: '31lpx' }) | ||
| 209 | + .onClick(()=>{ | ||
| 210 | + this.editUserInfo() | ||
| 211 | + }) | ||
| 212 | + } | ||
| 213 | + .visibility(this.tileOpacity > 0 ? 1 : 0) | ||
| 214 | + .height('84lpx') | ||
| 215 | + .width('100%') | ||
| 216 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 217 | + } | ||
| 218 | + | ||
| 219 | + | ||
| 220 | + @Builder MineHomeTitleWhite() { | ||
| 221 | + RelativeContainer() { | ||
| 222 | + //标题栏目 | ||
| 223 | + Image($r('app.media.back_icon')) | ||
| 224 | + .width('46lpx') | ||
| 225 | + .height('46lpx') | ||
| 226 | + .objectFit(ImageFit.Auto) | ||
| 227 | + .id("back_icon") | ||
| 228 | + .alignRules({ | ||
| 229 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 230 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 231 | + }) | ||
| 232 | + .margin({ left: '31lpx' }) | ||
| 233 | + .onClick(() => { | ||
| 234 | + router.back() | ||
| 235 | + }) | ||
| 236 | + Image($r('app.media.default_head')) | ||
| 237 | + .width('60lpx') | ||
| 238 | + .height('60lpx') | ||
| 239 | + .objectFit(ImageFit.Auto) | ||
| 240 | + .id("head_icon") | ||
| 241 | + .alignRules({ | ||
| 242 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 243 | + left: { anchor: "back_icon", align: HorizontalAlign.End } | ||
| 244 | + }) | ||
| 245 | + .margin({ left: '31lpx' }) | ||
| 246 | + .onClick(() => { | ||
| 247 | + router.back() | ||
| 248 | + }) | ||
| 249 | + | ||
| 250 | + Text("我的昵称") | ||
| 251 | + .height('42lpx') | ||
| 252 | + .maxLines(1) | ||
| 253 | + .id("title") | ||
| 254 | + .fontSize('35lpx') | ||
| 255 | + .fontWeight('400lpx') | ||
| 256 | + .fontColor($r('app.color.color_222222')) | ||
| 257 | + .lineHeight('42lpx') | ||
| 258 | + .alignRules({ | ||
| 259 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 260 | + left: { anchor: "head_icon", align: HorizontalAlign.End } | ||
| 261 | + }) | ||
| 262 | + .margin({ left: '12lpx' }) | ||
| 263 | + | ||
| 264 | + Text("编辑资料") | ||
| 265 | + .height('42lpx') | ||
| 266 | + .maxLines(1) | ||
| 267 | + .id("rightText") | ||
| 268 | + .fontSize('35lpx') | ||
| 269 | + .fontWeight('400lpx') | ||
| 270 | + .fontColor($r('app.color.color_222222')) | ||
| 271 | + .lineHeight('42lpx') | ||
| 272 | + .alignRules({ | ||
| 273 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 274 | + right: { anchor: "__container__", align: HorizontalAlign.End } | ||
| 275 | + }) | ||
| 276 | + .margin({ right: '31lpx' }) | ||
| 277 | + .onClick(()=>{ | ||
| 278 | + this.editUserInfo() | ||
| 279 | + }) | ||
| 280 | + } | ||
| 281 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 282 | + .height('84lpx') | ||
| 283 | + .width('100%') | ||
| 284 | + .backgroundColor($r('app.color.white')) | ||
| 285 | + .opacity(this.tileOpacity ) | ||
| 286 | + | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + @Builder TabBuilder(index: number, title: string) { | ||
| 290 | + Stack(){ | ||
| 291 | + Text(title) | ||
| 292 | + .height('38lpx') | ||
| 293 | + .fontSize('33lpx') | ||
| 294 | + .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 295 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 296 | + .lineHeight('38lpx') | ||
| 297 | + | ||
| 298 | + if(this.currentIndex === index){ | ||
| 299 | + Divider() | ||
| 300 | + .width('31lpx') | ||
| 301 | + .height('4lpx') | ||
| 302 | + .color('#ED2800') | ||
| 303 | + .strokeWidth('4lpx') | ||
| 304 | + .margin({top:'50lpx'}) | ||
| 305 | + .id("divTag") | ||
| 306 | + } | ||
| 307 | + }.onClick(()=>{ | ||
| 308 | + this.currentIndex = index | ||
| 309 | + this.controller.changeIndex(this.currentIndex) | ||
| 310 | + }) | ||
| 311 | + .height('100%') | ||
| 312 | + .width('100%') | ||
| 313 | + .margin({right:'9lpx'}) | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + /** | ||
| 317 | + * 跳转编辑资料(防止二次点击) | ||
| 318 | + */ | ||
| 319 | + editUserInfo(){ | ||
| 320 | + if(!this.isChangeToUserEdit){ | ||
| 321 | + this.isChangeToUserEdit = true; | ||
| 322 | + let c = setInterval(() => { | ||
| 323 | + this.isChangeToUserEdit = false | ||
| 324 | + }, 1000); | ||
| 325 | + //route 跳转写这里 TODO | ||
| 326 | + WDRouterRule.jumpWithPage(WDRouterPage.editUserInfoPage) | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | +} | ||
| 331 | + | ||
| 332 | +@Extend(Text) function textStyle() { | ||
| 333 | + .fontColor($r('app.color.white')) | ||
| 334 | + .textStyleDefault() | ||
| 335 | + .margin({ right: '10lpx' }) | ||
| 336 | +} | ||
| 337 | + | ||
| 338 | +@Extend(Text) function textStyle2() { | ||
| 339 | + .textStyleDefault() | ||
| 340 | + .fontColor($r('app.color.color_B2FFFFFF')) | ||
| 341 | +} | ||
| 342 | + | ||
| 343 | +@Extend(Text) function textStyleDefault() { | ||
| 344 | + .textAlign(TextAlign.Start) | ||
| 345 | + .fontSize('23lpx') | ||
| 346 | + .fontWeight('400lpx') | ||
| 347 | + .lineHeight('31lpx') | ||
| 348 | +} | ||
| 349 | + |
| @@ -14,6 +14,7 @@ import { | @@ -14,6 +14,7 @@ import { | ||
| 14 | } from 'wdBean'; | 14 | } from 'wdBean'; |
| 15 | 15 | ||
| 16 | const TAG = 'HttpRequest'; | 16 | const TAG = 'HttpRequest'; |
| 17 | + | ||
| 17 | export class PageRepository { | 18 | export class PageRepository { |
| 18 | static getBottomNavGroupUrl() { | 19 | static getBottomNavGroupUrl() { |
| 19 | // 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 |
| @@ -30,7 +31,7 @@ export class PageRepository { | @@ -30,7 +31,7 @@ export class PageRepository { | ||
| 30 | + "&refreshTime=" + DateTimeUtils.getTimeStamp() | 31 | + "&refreshTime=" + DateTimeUtils.getTimeStamp() |
| 31 | + "&pageId=" + pageId | 32 | + "&pageId=" + pageId |
| 32 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 33 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 33 | - Logger.info(TAG,"getPageInfoUrl url = "+url) | 34 | + Logger.info(TAG, "getPageInfoUrl url = " + url) |
| 34 | return url; | 35 | return url; |
| 35 | } | 36 | } |
| 36 | 37 | ||
| @@ -48,29 +49,29 @@ export class PageRepository { | @@ -48,29 +49,29 @@ export class PageRepository { | ||
| 48 | + "&pageSize=" + pageSize | 49 | + "&pageSize=" + pageSize |
| 49 | + "&pageNum=" + currentPage; | 50 | + "&pageNum=" + currentPage; |
| 50 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 51 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 51 | - Logger.info(TAG,"getCompInfoUrl url = "+url) | 52 | + Logger.info(TAG, "getCompInfoUrl url = " + url) |
| 52 | return url; | 53 | return url; |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { | 56 | static getDetailInfoUrl(relId: string, contentId: string, relType: string) { |
| 56 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; | 57 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH; |
| 57 | url = url + "?relId=" + relId | 58 | url = url + "?relId=" + relId |
| 58 | - + "&contentId=" + contentId | ||
| 59 | - + "&relType=" + relType; | 59 | + + "&contentId=" + contentId |
| 60 | + + "&relType=" + relType; | ||
| 60 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | 61 | // Logger.debug("TAG", 'getCompInfoUrl url: '+url); |
| 61 | - Logger.info(TAG,"getDetailInfoUrl url = "+url) | 62 | + Logger.info(TAG, "getDetailInfoUrl url = " + url) |
| 62 | return url; | 63 | return url; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 65 | static getInteractDataUrl() { | 66 | static getInteractDataUrl() { |
| 66 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; | 67 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; |
| 67 | - Logger.info(TAG,"getInteractDataUrl url = "+url) | 68 | + Logger.info(TAG, "getInteractDataUrl url = " + url) |
| 68 | return url; | 69 | return url; |
| 69 | } | 70 | } |
| 70 | 71 | ||
| 71 | static getNewspaperInfoUrl(date: string) { | 72 | static getNewspaperInfoUrl(date: string) { |
| 72 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_INFO_PATH + "?date=" + date; | 73 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_INFO_PATH + "?date=" + date; |
| 73 | - Logger.info(TAG,"getNewspaperInfoUrl url = "+url) | 74 | + Logger.info(TAG, "getNewspaperInfoUrl url = " + url) |
| 74 | return url; | 75 | return url; |
| 75 | } | 76 | } |
| 76 | 77 | ||
| @@ -78,7 +79,7 @@ export class PageRepository { | @@ -78,7 +79,7 @@ export class PageRepository { | ||
| 78 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_LIST_PATH; | 79 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.E_NEWSPAPER_LIST_PATH; |
| 79 | url = url + "?date=" + date | 80 | url = url + "?date=" + date |
| 80 | + "&pagesSize=" + pageSize; | 81 | + "&pagesSize=" + pageSize; |
| 81 | - Logger.info(TAG,"getNewspaperListUrl url = "+url) | 82 | + Logger.info(TAG, "getNewspaperListUrl url = " + url) |
| 82 | return url; | 83 | return url; |
| 83 | } | 84 | } |
| 84 | 85 | ||
| @@ -88,7 +89,7 @@ export class PageRepository { | @@ -88,7 +89,7 @@ export class PageRepository { | ||
| 88 | static getMorningEveningPageInfoUrl(pageId: string) { | 89 | static getMorningEveningPageInfoUrl(pageId: string) { |
| 89 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; | 90 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; |
| 90 | url = url + "?pageId=" + pageId; | 91 | url = url + "?pageId=" + pageId; |
| 91 | - Logger.info(TAG,"getMorningEveningPageInfoUrl url = "+url) | 92 | + Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| 92 | return url; | 93 | return url; |
| 93 | } | 94 | } |
| 94 | 95 | ||
| @@ -105,11 +106,11 @@ export class PageRepository { | @@ -105,11 +106,11 @@ export class PageRepository { | ||
| 105 | * channelStrategy:频道策略 | 106 | * channelStrategy:频道策略 |
| 106 | * topicId:专题id | 107 | * topicId:专题id |
| 107 | * */ | 108 | * */ |
| 108 | - 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) { |
| 109 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; | 110 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; |
| 110 | - url = url + "?loadStrategy=first_load&pageNum="+pageNum+"&refreshTime="+refreshTime+"&pageId=" | ||
| 111 | - +pageId+"&channelStrategy=2&groupId="+groupId+"&topicId=10000009445&pageSize="+pageSize; | ||
| 112 | - 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) | ||
| 113 | return url; | 114 | return url; |
| 114 | } | 115 | } |
| 115 | 116 | ||
| @@ -176,8 +177,8 @@ export class PageRepository { | @@ -176,8 +177,8 @@ export class PageRepository { | ||
| 176 | /** | 177 | /** |
| 177 | * 获取早晚报compInfo | 178 | * 获取早晚报compInfo |
| 178 | * */ | 179 | * */ |
| 179 | - static fetchMorningEveningCompInfo(pageId: number,groupId:number,refreshTime:string,pageNum:number,pageSize:number) { | ||
| 180 | - 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) | ||
| 181 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 182 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 182 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) | 183 | return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) |
| 183 | }; | 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 | +} |
| @@ -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 | } |
| 1 | import { MyCollectionListModel } from '../model/MyCollectionModel'; | 1 | import { MyCollectionListModel } from '../model/MyCollectionModel'; |
| 2 | import HashMap from '@ohos.util.HashMap'; | 2 | import HashMap from '@ohos.util.HashMap'; |
| 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 4 | -import { Logger } from 'wdKit'; | 4 | +import { Logger, ResourcesUtils } from 'wdKit'; |
| 5 | +import { PageDTO } from 'wdBean'; | ||
| 5 | 6 | ||
| 6 | const TAG = "MyCollectionViewModel" | 7 | const TAG = "MyCollectionViewModel" |
| 7 | 8 | ||
| @@ -28,22 +29,77 @@ class MyCollectionViewModel { | @@ -28,22 +29,77 @@ class MyCollectionViewModel { | ||
| 28 | return WDHttp.get<ResponseDTO<MyCollectionListModel>>(url, headers) | 29 | return WDHttp.get<ResponseDTO<MyCollectionListModel>>(url, headers) |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 32 | + async getAppointmentListDataLocal(context: Context): Promise<MyCollectionListModel> { | ||
| 33 | + Logger.info(TAG, `getBottomNavDataMock start`); | ||
| 34 | + let compRes: ResponseDTO<MyCollectionListModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MyCollectionListModel>>(context,'browsingHistory_list_data.json' ); | ||
| 35 | + if (!compRes || !compRes.data) { | ||
| 36 | + Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | ||
| 37 | + return new MyCollectionListModel() | ||
| 38 | + } | ||
| 39 | + Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 40 | + return compRes.data | ||
| 41 | + } | ||
| 42 | + | ||
| 31 | //Type 1 收藏 2 浏览历史 | 43 | //Type 1 收藏 2 浏览历史 |
| 32 | //tagId 收藏界面 标签筛选 | 44 | //tagId 收藏界面 标签筛选 |
| 33 | - fetchMyCollectList(type:number,tagId:string,pageNum:string):Promise<MyCollectionListModel>{ | 45 | + fetchMyCollectList(type:number,tagId:string,pageNum:string,context: Context):Promise<MyCollectionListModel>{ |
| 34 | return new Promise<MyCollectionListModel>((success,error) => { | 46 | return new Promise<MyCollectionListModel>((success,error) => { |
| 35 | this.BaseGetRequest(type,tagId,pageNum).then((navResDTO: ResponseDTO<MyCollectionListModel>) => { | 47 | this.BaseGetRequest(type,tagId,pageNum).then((navResDTO: ResponseDTO<MyCollectionListModel>) => { |
| 36 | - if (navResDTO) { | ||
| 37 | - let listData = navResDTO.data as MyCollectionListModel | ||
| 38 | - success(listData) | ||
| 39 | - }else{ | ||
| 40 | - Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 41 | - error("page data invalid"); | 48 | + if (!navResDTO || navResDTO.code != 0) { |
| 49 | + success(this.getAppointmentListDataLocal(context)) | ||
| 50 | + return | ||
| 42 | } | 51 | } |
| 52 | + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 53 | + let listData = navResDTO.data as MyCollectionListModel | ||
| 54 | + success(listData) | ||
| 43 | }).catch((err: Error) => { | 55 | }).catch((err: Error) => { |
| 44 | Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | 56 | Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); |
| 45 | error("page data invalid"); | 57 | error("page data invalid"); |
| 46 | }) | 58 | }) |
| 47 | }) | 59 | }) |
| 48 | } | 60 | } |
| 49 | -} | ||
| 61 | + | ||
| 62 | + | ||
| 63 | + newBaseGetRequest(type:number,tagId:string,pageNum:number){ | ||
| 64 | + let url = HttpUrlUtils.getMyCollectionListDataUrl()+ `?type=${type}&operateTag=${1}&pageSize=${20}&pageNum=${pageNum.toString()}` | ||
| 65 | + if (tagId.length > 0) { | ||
| 66 | + url = url + `&tagId=${tagId}` | ||
| 67 | + } | ||
| 68 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() | ||
| 69 | + return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + newFetchMyCollectList(type:number,tagId:string,pageNum:number,context: Context):Promise<PageDTO>{ | ||
| 73 | + return new Promise<PageDTO>((success,error) => { | ||
| 74 | + success(this.newGetAppointmentListDataLocal(type,context)) | ||
| 75 | + return | ||
| 76 | + this.newBaseGetRequest(type,tagId,pageNum).then((navResDTO: ResponseDTO<PageDTO>) => { | ||
| 77 | + if (!navResDTO || navResDTO.code != 0) { | ||
| 78 | + success(this.newGetAppointmentListDataLocal(type,context)) | ||
| 79 | + return | ||
| 80 | + } | ||
| 81 | + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); | ||
| 82 | + let listData = navResDTO.data as PageDTO | ||
| 83 | + success(listData) | ||
| 84 | + }).catch((err: Error) => { | ||
| 85 | + Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 86 | + error("page data invalid"); | ||
| 87 | + }) | ||
| 88 | + }) | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + async newGetAppointmentListDataLocal(type:number, context: Context): Promise<PageDTO> { | ||
| 92 | + Logger.info(TAG, `getBottomNavDataMock start`); | ||
| 93 | + let compRes: ResponseDTO<PageDTO> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<PageDTO>>(context,type == 1?'MyCollection_list_data.json':'browsingHistory_list_data.json'); | ||
| 94 | + if (!compRes || !compRes.data) { | ||
| 95 | + Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`); | ||
| 96 | + return {} as PageDTO | ||
| 97 | + } | ||
| 98 | + Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`); | ||
| 99 | + return compRes.data | ||
| 100 | + } | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +const collectionViewModel = MyCollectionViewModel.getInstance(); | ||
| 104 | + | ||
| 105 | +export default collectionViewModel as MyCollectionViewModel |
| @@ -81,27 +81,44 @@ | @@ -81,27 +81,44 @@ | ||
| 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" | ||
| 118 | + }, | ||
| 119 | + { | ||
| 120 | + "name": "color_99636363", | ||
| 121 | + "value": "#99636363" | ||
| 105 | } | 122 | } |
| 106 | ] | 123 | ] |
| 107 | } | 124 | } |
370 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/icon_arrow_left_white.png
0 → 100644
570 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/mine_head_icon.png
deleted
100644 → 0
165 KB
322 Bytes
| @@ -3,11 +3,14 @@ | @@ -3,11 +3,14 @@ | ||
| 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", | ||
| 6 | "components/page/SettingPage", | 7 | "components/page/SettingPage", |
| 7 | "components/page/SettingAboutPage", | 8 | "components/page/SettingAboutPage", |
| 8 | "components/page/PrivacySettingPage", | 9 | "components/page/PrivacySettingPage", |
| 9 | "components/page/EditUserInfoPage", | 10 | "components/page/EditUserInfoPage", |
| 10 | "components/page/EditUserNikeNamePage", | 11 | "components/page/EditUserNikeNamePage", |
| 11 | - "components/page/EditUserIntroductionPage" | 12 | + "components/page/EditUserIntroductionPage", |
| 13 | + "components/page/BrowsingHistoryPage", | ||
| 14 | + "components/page/MyCollectionListPage" | ||
| 12 | ] | 15 | ] |
| 13 | } | 16 | } |
| @@ -39,15 +39,17 @@ struct ForgetPasswordPage { | @@ -39,15 +39,17 @@ struct ForgetPasswordPage { | ||
| 39 | isCodeSend: $isCodeSend | 39 | isCodeSend: $isCodeSend |
| 40 | }) | 40 | }) |
| 41 | Row() { | 41 | Row() { |
| 42 | - Button("确认", { type: ButtonType.Normal }) | 42 | + Text("确认") |
| 43 | .layoutWeight(1) | 43 | .layoutWeight(1) |
| 44 | + .fontColor(this.isSubmit ?"#FFFFFFFF":"#66FFFFFF") | ||
| 44 | .borderRadius(4) | 45 | .borderRadius(4) |
| 45 | - .fontSize(16) | 46 | + .fontSize(18) |
| 47 | + .textAlign(TextAlign.Center) | ||
| 46 | .fontWeight(FontWeight.Medium) | 48 | .fontWeight(FontWeight.Medium) |
| 47 | .margin({ top: 26 }) | 49 | .margin({ top: 26 }) |
| 48 | .height(44) | 50 | .height(44) |
| 49 | - .backgroundColor("#ED2800") | ||
| 50 | - .opacity(this.isSubmit ? 1 : 0.6) | 51 | + .backgroundColor(this.isSubmit ?"#ED2800":"#99ED2800") |
| 52 | + .enabled(this.isSubmit ? true : false) | ||
| 51 | .onClick(() => { | 53 | .onClick(() => { |
| 52 | this.checkVerifyCode() | 54 | this.checkVerifyCode() |
| 53 | 55 |
| @@ -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, "手机号为空") |
No preview for this file type
| @@ -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 | } |
-
Please register or login to post a comment