Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
49 changed files
with
215 additions
and
107 deletions
| @@ -22,3 +22,6 @@ export { ScreenType } from './src/main/ets/enum/ScreenType'; | @@ -22,3 +22,6 @@ export { ScreenType } from './src/main/ets/enum/ScreenType'; | ||
| 22 | export { SpConstants } from './src/main/ets/constants/SpConstants'; | 22 | export { SpConstants } from './src/main/ets/constants/SpConstants'; |
| 23 | 23 | ||
| 24 | export { DisplayDirection } from './src/main/ets/constants/VideoConstants'; | 24 | export { DisplayDirection } from './src/main/ets/constants/VideoConstants'; |
| 25 | + | ||
| 26 | +export { ContentConstants } from './src/main/ets/constants/ContentConstants'; | ||
| 27 | + |
| 1 | +export class ContentConstants { | ||
| 2 | + /* content#objectType,跳转类型:0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 */ | ||
| 3 | + /** | ||
| 4 | + * 0:不跳转 | ||
| 5 | + */ | ||
| 6 | + static readonly TYPE_NONE: string = "0"; | ||
| 7 | + /** | ||
| 8 | + * 1:点播 | ||
| 9 | + */ | ||
| 10 | + static readonly TYPE_VOD: string = "1"; | ||
| 11 | + /** | ||
| 12 | + * 2:直播 | ||
| 13 | + */ | ||
| 14 | + static readonly TYPE_LIVE: string = "2"; | ||
| 15 | + /** | ||
| 16 | + * 5:专题详情 | ||
| 17 | + */ | ||
| 18 | + static readonly TYPE_SPECIAL_TOPIC: string = "5"; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 6:链接 | ||
| 22 | + */ | ||
| 23 | + static readonly TYPE_LINK: string = "6"; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 8:图文详情,这里是h5页面 | ||
| 27 | + */ | ||
| 28 | + static readonly TYPE_TELETEXT: string = "8"; | ||
| 29 | + /** | ||
| 30 | + * 9:图集 | ||
| 31 | + */ | ||
| 32 | + static readonly TYPE_NINE: string = "9"; | ||
| 33 | + /** | ||
| 34 | + * 13:音频详情 | ||
| 35 | + */ | ||
| 36 | + static readonly TYPE_AUDIO: string = "13"; | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 14:动态图文 | ||
| 40 | + */ | ||
| 41 | + static readonly TYPE_FOURTEEN: string = "14"; | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 15:动态视频 | ||
| 45 | + */ | ||
| 46 | + static readonly TYPE_FIFTEEN: string = "15"; | ||
| 47 | + | ||
| 48 | + | ||
| 49 | +} |
| @@ -3,3 +3,5 @@ export { WDRouterRule } from './src/main/ets/router/WDRouterRule' | @@ -3,3 +3,5 @@ export { WDRouterRule } from './src/main/ets/router/WDRouterRule' | ||
| 3 | export { WDRouterPage } from './src/main/ets/router/WDRouterPage' | 3 | export { WDRouterPage } from './src/main/ets/router/WDRouterPage' |
| 4 | 4 | ||
| 5 | export { registerRouter } from './src/main/ets/router/Action2Page' | 5 | export { registerRouter } from './src/main/ets/router/Action2Page' |
| 6 | + | ||
| 7 | +export { ProcessUtils } from './src/main/ets/utils/ProcessUtils' |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | "wdKit": "file:../wdKit", | 10 | "wdKit": "file:../wdKit", |
| 11 | "wdBean": "file:../../features/wdBean", | 11 | "wdBean": "file:../../features/wdBean", |
| 12 | - "wdNetwork": "file:../../commons/wdNetwork" | 12 | + "wdNetwork": "file:../../commons/wdNetwork", |
| 13 | + "wdConstant": "file:../../commons/wdConstant" | ||
| 13 | } | 14 | } |
| 14 | } | 15 | } |
| @@ -2,9 +2,9 @@ import { Action, ContentDTO, Params } from 'wdBean'; | @@ -2,9 +2,9 @@ import { Action, ContentDTO, Params } from 'wdBean'; | ||
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | import { Logger } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; | 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; |
| 5 | -import { WDRouterRule } from 'wdRouter'; | ||
| 6 | -import { ContentConstants } from '../constants/ContentConstants'; | ||
| 7 | -import { LiveModel } from '../viewmodel/LiveModel'; | 5 | +import { WDRouterRule } from '../router/WDRouterRule'; |
| 6 | +import { ContentConstants } from 'wdConstant'; | ||
| 7 | +// import { LiveModel } from '../viewmodel/LiveModel'; | ||
| 8 | 8 | ||
| 9 | const TAG = 'ProcessUtils'; | 9 | const TAG = 'ProcessUtils'; |
| 10 | 10 | ||
| @@ -57,9 +57,10 @@ export class ProcessUtils { | @@ -57,9 +57,10 @@ export class ProcessUtils { | ||
| 57 | break; | 57 | break; |
| 58 | //动态详情页(动态图文) | 58 | //动态详情页(动态图文) |
| 59 | case ContentConstants.TYPE_FOURTEEN: | 59 | case ContentConstants.TYPE_FOURTEEN: |
| 60 | + break; | ||
| 60 | //动态详情页(动态视频) | 61 | //动态详情页(动态视频) |
| 61 | case ContentConstants.TYPE_FIFTEEN: | 62 | case ContentConstants.TYPE_FIFTEEN: |
| 62 | - ProcessUtils.gotoDynamicDetailPage(content); | 63 | + ProcessUtils.gotoWeb(content); |
| 63 | break; | 64 | break; |
| 64 | default: | 65 | default: |
| 65 | break; | 66 | break; |
| @@ -74,7 +75,7 @@ export class ProcessUtils { | @@ -74,7 +75,7 @@ export class ProcessUtils { | ||
| 74 | let taskAction: Action = { | 75 | let taskAction: Action = { |
| 75 | type: 'JUMP_DETAIL_PAGE', | 76 | type: 'JUMP_DETAIL_PAGE', |
| 76 | params: { | 77 | params: { |
| 77 | - detailPageType: Number.parseInt(content.objectType), | 78 | + detailPageType: 14, |
| 78 | contentID: content?.objectId, | 79 | contentID: content?.objectId, |
| 79 | extra: { | 80 | extra: { |
| 80 | relType: content?.relType, | 81 | relType: content?.relType, |
| @@ -129,15 +130,6 @@ export class ProcessUtils { | @@ -129,15 +130,6 @@ export class ProcessUtils { | ||
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | private static gotoWeb(content: ContentDTO) { | 132 | private static gotoWeb(content: ContentDTO) { |
| 132 | - // // topicId | ||
| 133 | - // content.channelId; | ||
| 134 | - // content.linkUrl; | ||
| 135 | - // content.objectId; | ||
| 136 | - // // CompId | ||
| 137 | - // content.relId; | ||
| 138 | - // content.relType; | ||
| 139 | - // // ScrollToBottom | ||
| 140 | - // // FromPage | ||
| 141 | let taskAction: Action = { | 133 | let taskAction: Action = { |
| 142 | type: 'JUMP_INNER_NEW_PAGE', | 134 | type: 'JUMP_INNER_NEW_PAGE', |
| 143 | params: { | 135 | params: { |
| @@ -172,20 +164,15 @@ export class ProcessUtils { | @@ -172,20 +164,15 @@ export class ProcessUtils { | ||
| 172 | } | 164 | } |
| 173 | 165 | ||
| 174 | private static async gotoLive(content: ContentDTO) { | 166 | private static async gotoLive(content: ContentDTO) { |
| 175 | - const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') | ||
| 176 | - const liveStyle = liveDetail[0].liveInfo.liveStyle | ||
| 177 | - const liveState = liveDetail[0].liveInfo.liveState | ||
| 178 | - | ||
| 179 | - | ||
| 180 | - console.error('liveDetail===', liveDetail) | ||
| 181 | - | ||
| 182 | - | 167 | + // const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') |
| 168 | + // const liveStyle = liveDetail[0].liveInfo.liveStyle | ||
| 169 | + // const liveState = liveDetail[0].liveInfo.liveState | ||
| 183 | let taskAction: Action = { | 170 | let taskAction: Action = { |
| 184 | type: 'JUMP_DETAIL_PAGE', | 171 | type: 'JUMP_DETAIL_PAGE', |
| 185 | params: { | 172 | params: { |
| 186 | detailPageType: 2, | 173 | detailPageType: 2, |
| 187 | contentID: content?.objectId, | 174 | contentID: content?.objectId, |
| 188 | - liveStyle: liveState === 'wait' ? 0 : liveStyle, | 175 | + // liveStyle: liveState === 'wait' ? 0 : liveStyle, |
| 189 | extra: { | 176 | extra: { |
| 190 | relType: content?.relType, | 177 | relType: content?.relType, |
| 191 | relId: content?.relId, | 178 | relId: content?.relId, |
| @@ -3,8 +3,7 @@ import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | @@ -3,8 +3,7 @@ import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | ||
| 3 | import { Logger } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { H5CallNativeType } from './H5CallNativeType'; | 4 | import { H5CallNativeType } from './H5CallNativeType'; |
| 5 | import { ContentDTO } from 'wdBean'; | 5 | import { ContentDTO } from 'wdBean'; |
| 6 | -//TODO 这里引用了 features模块,是否考虑将跳转抽到公共模块 | ||
| 7 | -import { ProcessUtils } from '../../../../../../features/wdComponent/src/main/ets/utils/ProcessUtils'; | 6 | +import { ProcessUtils } from 'wdRouter/src/main/ets/utils/ProcessUtils'; |
| 8 | 7 | ||
| 9 | const TAG = 'JsBridgeBiz' | 8 | const TAG = 'JsBridgeBiz' |
| 10 | 9 |
| @@ -7,7 +7,7 @@ import { performJSCallNative } from './JsBridgeBiz'; | @@ -7,7 +7,7 @@ import { performJSCallNative } from './JsBridgeBiz'; | ||
| 7 | import { H5CallNativeType } from './H5CallNativeType'; | 7 | import { H5CallNativeType } from './H5CallNativeType'; |
| 8 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 8 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 9 | 9 | ||
| 10 | -const TAG = 'WdWebLocalComponent'; | 10 | +const TAG = 'WdWebComponent'; |
| 11 | 11 | ||
| 12 | @Component | 12 | @Component |
| 13 | export struct WdWebComponent { | 13 | export struct WdWebComponent { |
| @@ -85,9 +85,10 @@ export struct WdWebComponent { | @@ -85,9 +85,10 @@ export struct WdWebComponent { | ||
| 85 | onPageBegin: (url?: string) => void = () => { | 85 | onPageBegin: (url?: string) => void = () => { |
| 86 | Logger.debug(TAG, 'onPageBegin'); | 86 | Logger.debug(TAG, 'onPageBegin'); |
| 87 | this.registerHandlers(); | 87 | this.registerHandlers(); |
| 88 | - // setTimeout(() => { | 88 | + //有时序问题 必须延时执行 |
| 89 | + setTimeout(() => { | ||
| 89 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | 90 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) |
| 90 | - // }, 100) | 91 | + }, 200) |
| 91 | } | 92 | } |
| 92 | onPageEnd: (url?: string) => void = () => { | 93 | onPageEnd: (url?: string) => void = () => { |
| 93 | Logger.debug(TAG, 'onPageEnd'); | 94 | Logger.debug(TAG, 'onPageEnd'); |
| @@ -102,9 +102,10 @@ export struct WdWebLocalComponent { | @@ -102,9 +102,10 @@ export struct WdWebLocalComponent { | ||
| 102 | onPageBegin: (url?: string) => void = () => { | 102 | onPageBegin: (url?: string) => void = () => { |
| 103 | Logger.debug(TAG, 'onPageBegin'); | 103 | Logger.debug(TAG, 'onPageBegin'); |
| 104 | this.registerHandlers(); | 104 | this.registerHandlers(); |
| 105 | - // setTimeout(() => { | 105 | + //有时序问题 必须延时执行 |
| 106 | + setTimeout(() => { | ||
| 106 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | 107 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) |
| 107 | - // }, 100) | 108 | + }, 200) |
| 108 | } | 109 | } |
| 109 | onPageEnd: (url?: string) => void = () => { | 110 | onPageEnd: (url?: string) => void = () => { |
| 110 | Logger.debug(TAG, 'onPageEnd'); | 111 | Logger.debug(TAG, 'onPageEnd'); |
| @@ -8,7 +8,7 @@ import media from '@ohos.multimedia.media'; | @@ -8,7 +8,7 @@ import media from '@ohos.multimedia.media'; | ||
| 8 | import { OperRowListView } from './view/OperRowListView'; | 8 | import { OperRowListView } from './view/OperRowListView'; |
| 9 | import { WDPlayerController } from 'wdPlayer/Index'; | 9 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 10 | import { ContentConstants } from '../constants/ContentConstants'; | 10 | import { ContentConstants } from '../constants/ContentConstants'; |
| 11 | -import { ProcessUtils } from '../utils/ProcessUtils'; | 11 | +import { ProcessUtils } from 'wdRouter'; |
| 12 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; | 12 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; |
| 13 | 13 | ||
| 14 | const TAG = 'DynamicDetailComponent' | 14 | const TAG = 'DynamicDetailComponent' |
| 1 | import { CompInfoBean, CompDTO, CompList } from 'wdBean' | 1 | import { CompInfoBean, CompDTO, CompList } from 'wdBean' |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | /** | 4 | /** |
| 5 | * 播报--今日推荐列表 | 5 | * 播报--今日推荐列表 |
| 6 | */ | 6 | */ |
| 1 | import { CompInfoBean, CompDTO } from 'wdBean' | 1 | import { CompInfoBean, CompDTO } from 'wdBean' |
| 2 | import { DateTimeUtils } from 'wdKit/Index' | 2 | import { DateTimeUtils } from 'wdKit/Index' |
| 3 | import { CommonConstants } from 'wdConstant'; | 3 | import { CommonConstants } from 'wdConstant'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | /** | 5 | /** |
| 6 | * 精选栏目 | 6 | * 精选栏目 |
| 7 | */ | 7 | */ |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 5 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | 7 |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | import { ContentDTO } from 'wdBean' | 3 | import { ContentDTO } from 'wdBean' |
| 4 | import { DateTimeUtils } from 'wdKit' | 4 | import { DateTimeUtils } from 'wdKit' |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 7 | const TAG = 'Card11Component'; | 7 | const TAG = 'Card11Component'; |
| 8 | 8 |
| @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | ||
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | 6 | ||
| 7 | const TAG = 'Card12Component'; | 7 | const TAG = 'Card12Component'; |
| 8 | 8 |
| @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | ||
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | 6 | ||
| 7 | const TAG = 'Card14Component'; | 7 | const TAG = 'Card14Component'; |
| 8 | 8 |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 2 | +import { ProcessUtils } from 'wdRouter'; |
| 3 | import { RmhTitle } from '../cardCommon/RmhTitle' | 3 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 5 | import { CommonConstants } from 'wdConstant/Index'; | 5 | import { CommonConstants } from 'wdConstant/Index'; |
| @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | ||
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | 6 | ||
| 7 | const TAG = 'Card16Component'; | 7 | const TAG = 'Card16Component'; |
| 8 | 8 |
| @@ -29,7 +29,8 @@ export struct Card17Component { | @@ -29,7 +29,8 @@ export struct Card17Component { | ||
| 29 | // 三个图, | 29 | // 三个图, |
| 30 | GridRow({ gutter: 2 }) { | 30 | GridRow({ gutter: 2 }) { |
| 31 | GridCol({ span: { xs: 8 } }) { | 31 | GridCol({ span: { xs: 8 } }) { |
| 32 | - Image(this.contentDTO.fullColumnImgUrls[0].url) | 32 | + Image(this.contentDTO.fullColumnImgUrls.length > 0 ?this.contentDTO.fullColumnImgUrls[0].url:'') |
| 33 | + .backgroundColor('#f5f5f5') | ||
| 33 | .width(CommonConstants.FULL_WIDTH) | 34 | .width(CommonConstants.FULL_WIDTH) |
| 34 | .aspectRatio(16 / 9) | 35 | .aspectRatio(16 / 9) |
| 35 | .borderRadius({ | 36 | .borderRadius({ |
| @@ -39,7 +40,8 @@ export struct Card17Component { | @@ -39,7 +40,8 @@ export struct Card17Component { | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | GridCol({ span: { xs: 4 } }) { | 42 | GridCol({ span: { xs: 4 } }) { |
| 42 | - Image(this.contentDTO.fullColumnImgUrls[1].url) | 43 | + Image(this.contentDTO.fullColumnImgUrls.length > 1? this.contentDTO.fullColumnImgUrls[1].url:'') |
| 44 | + .backgroundColor('#f5f5f5') | ||
| 43 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 44 | .aspectRatio(16 / 9) | 46 | .aspectRatio(16 / 9) |
| 45 | .margin({ bottom: 1 }) | 47 | .margin({ bottom: 1 }) |
| @@ -54,7 +56,8 @@ export struct Card17Component { | @@ -54,7 +56,8 @@ export struct Card17Component { | ||
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | GridCol({ span: { xs: 4 } }) { | 58 | GridCol({ span: { xs: 4 } }) { |
| 57 | - Image(this.contentDTO.fullColumnImgUrls[2].url) | 59 | + Image(this.contentDTO.fullColumnImgUrls.length > 2? this.contentDTO.fullColumnImgUrls[2].url:'') |
| 60 | + .backgroundColor('#f5f5f5') | ||
| 58 | .width(CommonConstants.FULL_WIDTH) | 61 | .width(CommonConstants.FULL_WIDTH) |
| 59 | .aspectRatio(16 / 9) | 62 | .aspectRatio(16 / 9) |
| 60 | .margin({ top: 1 }) | 63 | .margin({ top: 1 }) |
| 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; | 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | 5 | ||
| 6 | const TAG = 'Card19Component'; | 6 | const TAG = 'Card19Component'; |
| @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | @@ -2,7 +2,7 @@ import { ContentDTO } from 'wdBean'; | ||
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | const TAG = 'Card20Component'; | 6 | const TAG = 'Card20Component'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { RmhTitle } from '../cardCommon/RmhTitle' | 4 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | 6 |
| 1 | //全标题 "appStyle":"2", | 1 | //全标题 "appStyle":"2", |
| 2 | import { ContentDTO } from 'wdBean'; | 2 | import { ContentDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 7 | const TAG: string = 'Card2Component'; | 7 | const TAG: string = 'Card2Component'; |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; | 1 | import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | const TAG: string = 'Card4Component'; | 5 | const TAG: string = 'Card4Component'; |
| 6 | 6 |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | 4 | ||
| 5 | const TAG: string = 'Card5Component'; | 5 | const TAG: string = 'Card5Component'; |
| 6 | 6 |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | const TAG: string = 'Card6Component-Card13Component'; | 6 | const TAG: string = 'Card6Component-Card13Component'; |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * 时间链卡--CompStyle: 09 | 7 | * 时间链卡--CompStyle: 09 |
| @@ -2,7 +2,7 @@ import { CompDTO, ContentDTO, } from 'wdBean'; | @@ -2,7 +2,7 @@ import { CompDTO, ContentDTO, } from 'wdBean'; | ||
| 2 | import { BreakpointConstants, CommonConstants, DurationEnum } from 'wdConstant'; | 2 | import { BreakpointConstants, CommonConstants, DurationEnum } from 'wdConstant'; |
| 3 | import { BreakPointType, Logger } from 'wdKit'; | 3 | import { BreakPointType, Logger } from 'wdKit'; |
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 4 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | import { EmptyComponent } from '../view/EmptyComponent'; | 6 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 7 | 7 | ||
| 8 | const TAG = 'Zh_Carousel_Layout-01'; | 8 | const TAG = 'Zh_Carousel_Layout-01'; |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | import { Logger } from 'wdKit/Index'; | 3 | import { Logger } from 'wdKit/Index'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | import PageViewModel from '../../viewmodel/PageViewModel'; | 5 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 6 | 6 | ||
| 7 | const TAG = 'Zh_Grid_Layout-02'; | 7 | const TAG = 'Zh_Grid_Layout-02'; |
| @@ -2,7 +2,7 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean'; | @@ -2,7 +2,7 @@ import { Action, CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | import { CompStyle } from 'wdConstant'; | 2 | import { CompStyle } from 'wdConstant'; |
| 3 | import { Logger } from 'wdKit'; | 3 | import { Logger } from 'wdKit'; |
| 4 | import { WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterRule } from 'wdRouter'; |
| 5 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 5 | +import { ProcessUtils } from 'wdRouter'; |
| 6 | 6 | ||
| 7 | const TAG = 'Zh_Grid_Layout-03'; | 7 | const TAG = 'Zh_Grid_Layout-03'; |
| 8 | const FULL_PARENT: string = '100%'; | 8 | const FULL_PARENT: string = '100%'; |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | 4 | ||
| 5 | const TAG = 'Zh_Single_Column-04'; | 5 | const TAG = 'Zh_Single_Column-04'; |
| 6 | 6 |
| @@ -4,7 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | @@ -4,7 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 7 | +import { ProcessUtils } from 'wdRouter'; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * 小视频横划卡 | 10 | * 小视频横划卡 |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 4 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | 5 | ||
| 6 | /** | 6 | /** |
| 7 | * 本地精选卡 | 7 | * 本地精选卡 |
| @@ -5,7 +5,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | @@ -5,7 +5,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { DateTimeUtils } from 'wdKit/Index'; | 6 | import { DateTimeUtils } from 'wdKit/Index'; |
| 7 | import { CommonConstants } from 'wdConstant/Index'; | 7 | import { CommonConstants } from 'wdConstant/Index'; |
| 8 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 8 | +import { ProcessUtils } from 'wdRouter'; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 精选评论卡 | 11 | * 精选评论卡 |
| 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' | 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' |
| 2 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 2 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 3 | -import { Action, Params } from 'wdBean'; | ||
| 4 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 3 | +import { Params } from 'wdBean'; |
| 5 | 4 | ||
| 6 | @Component | 5 | @Component |
| 7 | export default struct MinePageMoreFunctionUI { | 6 | export default struct MinePageMoreFunctionUI { |
| @@ -70,18 +69,12 @@ export default struct MinePageMoreFunctionUI { | @@ -70,18 +69,12 @@ export default struct MinePageMoreFunctionUI { | ||
| 70 | } | 69 | } |
| 71 | .onClick(() => { | 70 | .onClick(() => { |
| 72 | console.log(index + "") | 71 | console.log(index + "") |
| 73 | - if (index == 0) { | ||
| 74 | - // WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 75 | - } else if (index == 1) { | ||
| 76 | - // WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 77 | - } else if (index == 2) { | ||
| 78 | - | ||
| 79 | - } else if (index == 3) { //设置 | 72 | + if (item.msg == "设置") { //设置 |
| 80 | let params: Params = { | 73 | let params: Params = { |
| 81 | pageID: 'mainSetting' | 74 | pageID: 'mainSetting' |
| 82 | } | 75 | } |
| 83 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | 76 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) |
| 84 | - }else if (index == 4) { // 关于 | 77 | + }else if (item.msg == "关于") { // 关于 |
| 85 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) | 78 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) |
| 86 | } | 79 | } |
| 87 | }) | 80 | }) |
| @@ -83,9 +83,11 @@ export default struct MinePagePersonFunctionUI { | @@ -83,9 +83,11 @@ export default struct MinePagePersonFunctionUI { | ||
| 83 | .height('117lpx') | 83 | .height('117lpx') |
| 84 | }) | 84 | }) |
| 85 | } | 85 | } |
| 86 | - .rowsTemplate('1fr 1fr') | 86 | + // .rowsTemplate('1fr 1fr') |
| 87 | + .rowsTemplate('1fr') | ||
| 87 | .columnsTemplate('1fr 1fr 1fr 1fr') | 88 | .columnsTemplate('1fr 1fr 1fr 1fr') |
| 88 | - .height('234lpx') | 89 | + // .height('234lpx') |
| 90 | + .height('167lpx') | ||
| 89 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | 91 | .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) |
| 90 | } | 92 | } |
| 91 | } | 93 | } |
| @@ -119,6 +119,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -119,6 +119,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 119 | .width('50lpx') | 119 | .width('50lpx') |
| 120 | .height('50lpx') | 120 | .height('50lpx') |
| 121 | }.width('131lpx') | 121 | }.width('131lpx') |
| 122 | + .visibility(Visibility.Hidden) | ||
| 122 | }.backgroundColor($r('app.color.white')) | 123 | }.backgroundColor($r('app.color.white')) |
| 123 | .setFullWidth() | 124 | .setFullWidth() |
| 124 | .padding({top:'31lpx',left:'46lpx'}) | 125 | .padding({top:'31lpx',left:'46lpx'}) |
| @@ -3,7 +3,7 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | @@ -3,7 +3,7 @@ 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 { ProcessUtils } from '../../utils/ProcessUtils'; | 6 | +import { ProcessUtils } from 'wdRouter'; |
| 7 | 7 | ||
| 8 | const TAG: string = 'CardView'; | 8 | const TAG: string = 'CardView'; |
| 9 | 9 |
| @@ -51,11 +51,7 @@ struct EditUserIntroductionPage { | @@ -51,11 +51,7 @@ struct EditUserIntroductionPage { | ||
| 51 | .borderRadius(5) | 51 | .borderRadius(5) |
| 52 | .margin(30) | 52 | .margin(30) |
| 53 | .onClick(()=>{ | 53 | .onClick(()=>{ |
| 54 | - let currentUserInfo:editModel = new editModel() | ||
| 55 | - currentUserInfo.userExtend.introduction = this.introduction | ||
| 56 | - currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | ||
| 57 | - this.updateEditModel(currentUserInfo) | ||
| 58 | - | 54 | + this.updateEditModel() |
| 59 | let params: editModelParams = { | 55 | let params: editModelParams = { |
| 60 | introduction: this.introduction | 56 | introduction: this.introduction |
| 61 | } | 57 | } |
| @@ -68,7 +64,10 @@ struct EditUserIntroductionPage { | @@ -68,7 +64,10 @@ struct EditUserIntroductionPage { | ||
| 68 | } | 64 | } |
| 69 | 65 | ||
| 70 | 66 | ||
| 71 | - updateEditModel(Info:editModel){ | ||
| 72 | - EditInfoViewModel.updateUserInfo(Info) | 67 | + updateEditModel(){ |
| 68 | + let currentUserInfo:editModel = new editModel() | ||
| 69 | + currentUserInfo.userExtend.introduction = this.introduction | ||
| 70 | + currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro | ||
| 71 | + EditInfoViewModel.updateUserInfo(currentUserInfo) | ||
| 73 | } | 72 | } |
| 74 | } | 73 | } |
| @@ -2,6 +2,8 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI' | @@ -2,6 +2,8 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI' | ||
| 2 | import router from '@ohos.router' | 2 | import router from '@ohos.router' |
| 3 | import { editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel' | 3 | import { editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel' |
| 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; |
| 5 | +// import { encryptMessage } from '../../../utils/cryptoUtil' | ||
| 6 | +import { encryptMessage } from 'wdLogin/src/main/ets/utils/cryptoUtil' | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct EditUserNikeNamePage { | 9 | struct EditUserNikeNamePage { |
| @@ -51,13 +53,17 @@ struct EditUserNikeNamePage { | @@ -51,13 +53,17 @@ struct EditUserNikeNamePage { | ||
| 51 | .borderRadius(5) | 53 | .borderRadius(5) |
| 52 | .margin(30) | 54 | .margin(30) |
| 53 | .onClick(()=>{ | 55 | .onClick(()=>{ |
| 54 | - | ||
| 55 | ///内部更新 | 56 | ///内部更新 |
| 57 | + this.updateEditModel() | ||
| 58 | + }) | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + async updateEditModel(){ | ||
| 56 | let currentUserInfo:editModel = new editModel() | 63 | let currentUserInfo:editModel = new editModel() |
| 57 | - currentUserInfo.userExtend.introduction = this.nikeName | 64 | + currentUserInfo.userName = await encryptMessage(this.nikeName); |
| 58 | currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname | 65 | currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname |
| 59 | - this.updateEditModel(currentUserInfo) | ||
| 60 | - | 66 | + EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{ |
| 61 | let params: editModelParams = { | 67 | let params: editModelParams = { |
| 62 | userName: this.nikeName | 68 | userName: this.nikeName |
| 63 | } | 69 | } |
| @@ -67,9 +73,4 @@ struct EditUserNikeNamePage { | @@ -67,9 +73,4 @@ struct EditUserNikeNamePage { | ||
| 67 | }) | 73 | }) |
| 68 | }) | 74 | }) |
| 69 | } | 75 | } |
| 70 | - } | ||
| 71 | - | ||
| 72 | - updateEditModel(Info:editModel){ | ||
| 73 | - EditInfoViewModel.updateUserInfo(Info) | ||
| 74 | - } | ||
| 75 | } | 76 | } |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 2 | +import { ProcessUtils } from 'wdRouter'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import PageViewModel from '../../viewmodel/PageViewModel'; | 4 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 5 | import RefreshLayout from '../page/RefreshLayout'; | 5 | import RefreshLayout from '../page/RefreshLayout'; |
| 1 | import { ContentDTO } from 'wdBean'; | 1 | import { ContentDTO } from 'wdBean'; |
| 2 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 2 | +import { ProcessUtils } from 'wdRouter'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import PageViewModel from '../../viewmodel/PageViewModel'; | 4 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 5 | import RefreshLayout from '../page/RefreshLayout'; | 5 | import RefreshLayout from '../page/RefreshLayout'; |
| @@ -7,6 +7,7 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean'; | @@ -7,6 +7,7 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean'; | ||
| 7 | import PageModel from '../../viewmodel/PageModel'; | 7 | import PageModel from '../../viewmodel/PageModel'; |
| 8 | import { LazyDataSource } from 'wdKit/Index'; | 8 | import { LazyDataSource } from 'wdKit/Index'; |
| 9 | import { router } from '@kit.ArkUI'; | 9 | import { router } from '@kit.ArkUI'; |
| 10 | +import { LiveModel } from '../../viewmodel/LiveModel'; | ||
| 10 | 11 | ||
| 11 | const TAG: string = 'ReserveMorePage'; | 12 | const TAG: string = 'ReserveMorePage'; |
| 12 | 13 | ||
| @@ -29,6 +30,8 @@ struct ReserveMorePage { | @@ -29,6 +30,8 @@ struct ReserveMorePage { | ||
| 29 | pageSize: number = 20; | 30 | pageSize: number = 20; |
| 30 | operDataList: ContentDTO[] = []; | 31 | operDataList: ContentDTO[] = []; |
| 31 | title: string = '预约列表' | 32 | title: string = '预约列表' |
| 33 | + //是否预约过直播 | ||
| 34 | + @State isAppointmentLive: boolean = false | ||
| 32 | @State contentDTO: ContentDTO = { | 35 | @State contentDTO: ContentDTO = { |
| 33 | // appStyle: '15', | 36 | // appStyle: '15', |
| 34 | // coverType: 1, | 37 | // coverType: 1, |
| @@ -86,9 +89,8 @@ struct ReserveMorePage { | @@ -86,9 +89,8 @@ struct ReserveMorePage { | ||
| 86 | // .title('直播列表') | 89 | // .title('直播列表') |
| 87 | 90 | ||
| 88 | Column() { | 91 | Column() { |
| 89 | - Column() { | ||
| 90 | this.TabbarNormal() | 92 | this.TabbarNormal() |
| 91 | - | 93 | + Column() { |
| 92 | this.ListLayout() | 94 | this.ListLayout() |
| 93 | } | 95 | } |
| 94 | .padding({ | 96 | .padding({ |
| @@ -200,7 +202,7 @@ struct ReserveMorePage { | @@ -200,7 +202,7 @@ struct ReserveMorePage { | ||
| 200 | .margin(12) | 202 | .margin(12) |
| 201 | 203 | ||
| 202 | Flex({ justifyContent: FlexAlign.Center }) { | 204 | Flex({ justifyContent: FlexAlign.Center }) { |
| 203 | - Text('预约') | 205 | + Text(this.isAppointmentLive ? '已预约' : '预约') |
| 204 | .fontSize(12) | 206 | .fontSize(12) |
| 205 | .fontWeight(400) | 207 | .fontWeight(400) |
| 206 | .fontFamily('PingFang SC-Regular') | 208 | .fontFamily('PingFang SC-Regular') |
| @@ -208,6 +210,9 @@ struct ReserveMorePage { | @@ -208,6 +210,9 @@ struct ReserveMorePage { | ||
| 208 | .height(24) | 210 | .height(24) |
| 209 | .fontColor(Color.White) | 211 | .fontColor(Color.White) |
| 210 | .textAlign(TextAlign.Center) | 212 | .textAlign(TextAlign.Center) |
| 213 | + .onClick(() => { | ||
| 214 | + this.liveAppointment(item) | ||
| 215 | + }) | ||
| 211 | } | 216 | } |
| 212 | .width(52) | 217 | .width(52) |
| 213 | .backgroundColor('#ED2800') | 218 | .backgroundColor('#ED2800') |
| @@ -255,6 +260,22 @@ struct ReserveMorePage { | @@ -255,6 +260,22 @@ struct ReserveMorePage { | ||
| 255 | } | 260 | } |
| 256 | } | 261 | } |
| 257 | 262 | ||
| 263 | + async liveAppointment(item: ContentDTO) { | ||
| 264 | + // this.liveViewModel.liveAppointment( | ||
| 265 | + // this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', | ||
| 266 | + // this.liveDetailsBean.newsId, | ||
| 267 | + // !this.isAppointmentLive).then( | ||
| 268 | + // (data) => { | ||
| 269 | + // if (data.success) { | ||
| 270 | + // this.isAppointmentLive = !this.isAppointmentLive | ||
| 271 | + // } | ||
| 272 | + // }, | ||
| 273 | + // () => { | ||
| 274 | + // | ||
| 275 | + // }) | ||
| 276 | + const liveDetail = await LiveModel.liveAppointment(item?.relId || '', item?.objectId || '', this.isAppointmentLive || false) | ||
| 277 | + } | ||
| 278 | + | ||
| 258 | /*导航栏*/ | 279 | /*导航栏*/ |
| 259 | @Builder | 280 | @Builder |
| 260 | TabbarNormal() { | 281 | TabbarNormal() { |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 2 | +import { ProcessUtils } from 'wdRouter'; |
| 3 | import { CardParser } from '../CardParser'; | 3 | import { CardParser } from '../CardParser'; |
| 4 | 4 | ||
| 5 | const TAG: string = 'BigPicCardComponent'; | 5 | const TAG: string = 'BigPicCardComponent'; |
| 1 | import { CommonConstants } from 'wdConstant' | 1 | import { CommonConstants } from 'wdConstant' |
| 2 | import { ContentDTO, CompDTO } from 'wdBean' | 2 | import { ContentDTO, CompDTO } from 'wdBean' |
| 3 | -import { ProcessUtils } from '../../utils/ProcessUtils'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | 6 | export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { |
| @@ -6,6 +6,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | @@ -6,6 +6,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 7 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 8 | import { LiveModel } from '../../viewmodel/LiveModel' | 8 | import { LiveModel } from '../../viewmodel/LiveModel' |
| 9 | +import { ContentConstants } from '../../constants/ContentConstants' | ||
| 10 | +import { ProcessUtils } from 'wdRouter'; | ||
| 9 | 11 | ||
| 10 | @Component | 12 | @Component |
| 11 | export struct LiveHorizontalCardComponent { | 13 | export struct LiveHorizontalCardComponent { |
| @@ -25,7 +27,7 @@ export struct LiveHorizontalCardComponent { | @@ -25,7 +27,7 @@ export struct LiveHorizontalCardComponent { | ||
| 25 | .fontWeight(600) | 27 | .fontWeight(600) |
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | - if (this.compDTO.operDataList.length > 2) { | 30 | + if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING') { |
| 29 | Row() { | 31 | Row() { |
| 30 | Text("更多") | 32 | Text("更多") |
| 31 | .fontSize($r("app.float.font_size_14")) | 33 | .fontSize($r("app.float.font_size_14")) |
| @@ -118,13 +120,14 @@ export struct LiveHorizontalCardComponent { | @@ -118,13 +120,14 @@ export struct LiveHorizontalCardComponent { | ||
| 118 | 120 | ||
| 119 | async gotoLive(content: ContentDTO) { | 121 | async gotoLive(content: ContentDTO) { |
| 120 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') | 122 | const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') |
| 123 | + if (content && content.objectType) { | ||
| 124 | + if (content.objectType === ContentConstants.TYPE_LIVE) { | ||
| 125 | + if (liveDetail && liveDetail[0] && liveDetail[0].liveInfo) { | ||
| 121 | const liveStyle = liveDetail[0].liveInfo.liveStyle | 126 | const liveStyle = liveDetail[0].liveInfo.liveStyle |
| 122 | const liveState = liveDetail[0].liveInfo.liveState | 127 | const liveState = liveDetail[0].liveInfo.liveState |
| 123 | 128 | ||
| 124 | - | ||
| 125 | console.error('liveDetail===', liveDetail) | 129 | console.error('liveDetail===', liveDetail) |
| 126 | 130 | ||
| 127 | - | ||
| 128 | let taskAction: Action = { | 131 | let taskAction: Action = { |
| 129 | type: 'JUMP_DETAIL_PAGE', | 132 | type: 'JUMP_DETAIL_PAGE', |
| 130 | params: { | 133 | params: { |
| @@ -140,4 +143,11 @@ export struct LiveHorizontalCardComponent { | @@ -140,4 +143,11 @@ export struct LiveHorizontalCardComponent { | ||
| 140 | WDRouterRule.jumpWithAction(taskAction) | 143 | WDRouterRule.jumpWithAction(taskAction) |
| 141 | // Logger.debug(TAG, `gotoLive, ${content.objectId}`); | 144 | // Logger.debug(TAG, `gotoLive, ${content.objectId}`); |
| 142 | } | 145 | } |
| 146 | + } else if (content.objectType === ContentConstants.TYPE_TELETEXT) { | ||
| 147 | + ProcessUtils.processPage(content) | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + | ||
| 152 | + } | ||
| 143 | } | 153 | } |
| @@ -26,7 +26,7 @@ export struct LiveHorizontalReservationComponent { | @@ -26,7 +26,7 @@ export struct LiveHorizontalReservationComponent { | ||
| 26 | .fontWeight(600) | 26 | .fontWeight(600) |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | - if (this.compDTO.operDataList.length > 2) { | 29 | + if (this.compDTO.dataSourceType === 'LIVE_RESERVATION') { |
| 30 | Row() { | 30 | Row() { |
| 31 | Text("更多") | 31 | Text("更多") |
| 32 | .fontSize($r("app.float.font_size_14")) | 32 | .fontSize($r("app.float.font_size_14")) |
| @@ -62,10 +62,10 @@ class MinePageDatasModel{ | @@ -62,10 +62,10 @@ class MinePageDatasModel{ | ||
| 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) | 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) |
| 63 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) | 63 | this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 65 | - this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | ||
| 66 | - this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 67 | - this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) | ||
| 68 | - this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) | 65 | + // this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 66 | + // this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | ||
| 67 | + // this.personalData.push(new MinePagePersonalFunctionsItem("留言板",$r('app.media.mine_msgboard_icon'))) | ||
| 68 | + // this.personalData.push(new MinePagePersonalFunctionsItem("预约",$r('app.media.mine_order_icon'))) | ||
| 69 | return this.personalData | 69 | return this.personalData |
| 70 | } | 70 | } |
| 71 | 71 | ||
| @@ -93,9 +93,9 @@ class MinePageDatasModel{ | @@ -93,9 +93,9 @@ class MinePageDatasModel{ | ||
| 93 | if(this.moreData.length === 5){ | 93 | if(this.moreData.length === 5){ |
| 94 | return this.moreData | 94 | return this.moreData |
| 95 | } | 95 | } |
| 96 | - this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) | ||
| 97 | - this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) | ||
| 98 | - this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) | 96 | + // this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) |
| 97 | + // this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) | ||
| 98 | + // this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) | ||
| 99 | this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) | 99 | this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) |
| 100 | this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) | 100 | this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) |
| 101 | return this.moreData | 101 | return this.moreData |
| 1 | import HashMap from '@ohos.util.HashMap'; | 1 | import HashMap from '@ohos.util.HashMap'; |
| 2 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 2 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 3 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 3 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 4 | -import { Logger } from 'wdKit'; | 4 | +import { Logger, ToastUtils } from 'wdKit'; |
| 5 | import { LiveDetailsBean } from 'wdBean/Index'; | 5 | import { LiveDetailsBean } from 'wdBean/Index'; |
| 6 | 6 | ||
| 7 | const TAG = 'LiveModel' | 7 | const TAG = 'LiveModel' |
| @@ -35,5 +35,36 @@ export class LiveModel { | @@ -35,5 +35,36 @@ export class LiveModel { | ||
| 35 | }) | 35 | }) |
| 36 | }) | 36 | }) |
| 37 | } | 37 | } |
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 直播预约/取消预约 | ||
| 41 | + * @param relationId | ||
| 42 | + * @param mLiveId | ||
| 43 | + * @param isSubscribe | ||
| 44 | + * @returns | ||
| 45 | + */ | ||
| 46 | + static liveAppointment(relationId: string, liveId: string, isSubscribe: boolean) { | ||
| 47 | + let params: Record<string, string> = {}; | ||
| 48 | + params['relationId'] = relationId | ||
| 49 | + params['liveId'] = liveId | ||
| 50 | + params['isSubscribe'] = `${isSubscribe}` | ||
| 51 | + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | ||
| 52 | + return new Promise<ResponseDTO<string>>((success, fail) => { | ||
| 53 | + HttpRequest.post<ResponseDTO<string>>( | ||
| 54 | + HttpUrlUtils.getLiveAppointmentUrl(), | ||
| 55 | + params, | ||
| 56 | + headers).then((data: ResponseDTO<string>) => { | ||
| 57 | + if (data.code != 0) { | ||
| 58 | + fail(data.message) | ||
| 59 | + ToastUtils.shortToast(data.message) | ||
| 60 | + return | ||
| 61 | + } | ||
| 62 | + success(data) | ||
| 63 | + }, (error: Error) => { | ||
| 64 | + fail(error.message) | ||
| 65 | + Logger.debug(TAG + ":error ", error.toString()) | ||
| 66 | + }) | ||
| 67 | + }) | ||
| 68 | + } | ||
| 38 | } | 69 | } |
| 39 | 70 |
| @@ -53,8 +53,12 @@ class MyCollectionViewModel { | @@ -53,8 +53,12 @@ class MyCollectionViewModel { | ||
| 53 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() | 53 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders() |
| 54 | WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => { | 54 | WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => { |
| 55 | if (navResDTO.code == 0) { | 55 | if (navResDTO.code == 0) { |
| 56 | + if(params.status === 1){ | ||
| 57 | + promptAction.showToast({ message: '收藏成功' }) | ||
| 58 | + } else { | ||
| 56 | promptAction.showToast({ message: '删除成功' }) | 59 | promptAction.showToast({ message: '删除成功' }) |
| 57 | } | 60 | } |
| 61 | + } | ||
| 58 | }) | 62 | }) |
| 59 | .catch((error: Error) => { | 63 | .catch((error: Error) => { |
| 60 | Logger.info(TAG,'executeCollcet','ResponseDTO') | 64 | Logger.info(TAG,'executeCollcet','ResponseDTO') |
-
Please register or login to post a comment