Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
7 changed files
with
204 additions
and
124 deletions
| @@ -27,6 +27,10 @@ | @@ -27,6 +27,10 @@ | ||
| 27 | { | 27 | { |
| 28 | "name": "location_reason", | 28 | "name": "location_reason", |
| 29 | "value": " " | 29 | "value": " " |
| 30 | + }, | ||
| 31 | + { | ||
| 32 | + "name": "STORE_PERSISTENT_DATA", | ||
| 33 | + "value": "STORE_PERSISTENT_DATASTORE_PERSISTENT_DATASTORE_PERSISTENT_DATA" | ||
| 30 | } | 34 | } |
| 31 | ] | 35 | ] |
| 32 | } | 36 | } |
| @@ -24,8 +24,8 @@ interface dataObject { | @@ -24,8 +24,8 @@ interface dataObject { | ||
| 24 | // 9、活动投稿 视频跳转 | 24 | // 9、活动投稿 视频跳转 |
| 25 | // 10、活动投稿 动态跳转 | 25 | // 10、活动投稿 动态跳转 |
| 26 | // 11、活动投稿 图集跳转 | 26 | // 11、活动投稿 图集跳转 |
| 27 | - dataSource: WDH5WebDataSource | ||
| 28 | - operateType?: string | 27 | + dataSource?: WDH5WebDataSource |
| 28 | + operateType?: WDH5WebPageOperationType | ||
| 29 | webViewHeight?: string | 29 | webViewHeight?: string |
| 30 | dataJson?: string | 30 | dataJson?: string |
| 31 | appInnerLink?: string | 31 | appInnerLink?: string |
| @@ -39,6 +39,7 @@ interface dataObject { | @@ -39,6 +39,7 @@ interface dataObject { | ||
| 39 | positionTop?: string | 39 | positionTop?: string |
| 40 | videoLandscape?: string | 40 | videoLandscape?: string |
| 41 | imgListData?: string | 41 | imgListData?: string |
| 42 | + statusBarMode?: string | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | /** | 45 | /** |
| @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | ||
| 85 | WDH5WebDataSourcePartinActivityPublishVideo = 9, | 86 | WDH5WebDataSourcePartinActivityPublishVideo = 9, |
| 86 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, | 87 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, |
| 87 | WDH5WebDataSourcePartinActivityPublishPicture = 11, | 88 | WDH5WebDataSourcePartinActivityPublishPicture = 11, |
| 88 | -} | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +export enum WDH5WebPageOperationType { | ||
| 92 | + WDH5WebPageOperationTypeClose = '1', | ||
| 93 | + WDH5WebPageOperationTypeReload = '2', | ||
| 94 | + WDH5WebPageOperationTypeGoBack = '3', | ||
| 95 | + WDH5WebPageOperationTypePlayerVideoFor4G = '4', | ||
| 96 | + WDH5WebPageOperationTypeEmailSubscribeHasClosed = '5', | ||
| 97 | + WDH5WebPageOperationTypeHeightUpdate = '8', | ||
| 98 | + WDH5WebPageOperationTypeVideoPlay = '9', // 让App开始播放视频 | ||
| 99 | + WDH5WebPageOperationTypeAudioPlayed = '10', // H5开始播放音频 (做互斥用) | ||
| 100 | + WDH5WebPageOperationTypeCloseAppNavigationBar = '12', | ||
| 101 | + WDH5WebPageOperationTypeOpenAppNavigationBar = '13', | ||
| 102 | + WDH5WebPageOperationTypeCloseBottomBar = '14', | ||
| 103 | + WDH5WebPageOperationTypeOpenBottomBar = '15', | ||
| 104 | + WDH5WebPageOperationTypeShowNavigationShareButton = '16', | ||
| 105 | + WDH5WebPageOperationTypeHiddenNavigationShareButton = '17', | ||
| 106 | + WDH5WebPageOperationTypeSetTitle = '18', | ||
| 107 | + WDH5WebPageOperationTypeSetStatusBar = '19', | ||
| 108 | + WDH5WebPageOperationTypeBottomBarMaskViewShow = '20', | ||
| 109 | + WDH5WebPageOperationTypeBottomBarMaskViewHidden = '21', | ||
| 110 | + WDH5WebPageOperationTypeRetry = '22', | ||
| 111 | + WDH5WebPageOperationTypeCreatorFollowStatusChanged = '24', | ||
| 112 | + | ||
| 113 | + WDH5WebPageOperationTypeStartPopupAlert = '32', //(原生代码确保Webview底部到底) | ||
| 114 | + WDH5WebPageOperationTypeEndPopupAlert = '33', | ||
| 115 | + | ||
| 116 | + WDH5WebPageOperationTypeSkipHomePage = '40', | ||
| 117 | + WDH5WebPageOperationTypeSkipScoreCenterSign = '41', | ||
| 118 | + WDH5WebPageOperationTypeSkipFeedbackPage = '42', | ||
| 119 | + WDH5WebPageOperationTypeSkipFollowListPage = '43', | ||
| 120 | + | ||
| 121 | + WDH5WebPageOperationTypeShowLoading = '47', | ||
| 122 | + WDH5WebPageOperationTypeHiddenLoading = '48', | ||
| 123 | + | ||
| 124 | + WDH5WebPageOperationTypeVideoRectChange = '49', // 修改App视频尺寸 (暂未使用) | ||
| 125 | + | ||
| 126 | +}; |
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | "@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har", | 10 | "@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har", |
| 11 | "@umeng/common": "^1.0.21", | 11 | "@umeng/common": "^1.0.21", |
| 12 | "@umeng/analytics": "^1.0.19", | 12 | "@umeng/analytics": "^1.0.19", |
| 13 | - "@mpaas/udid": "0.0.2", | ||
| 14 | - "@mpaas/upgrade": "0.0.2", | ||
| 15 | - "@mpaas/framework": "0.0.2" | 13 | +// "@mpaas/udid": "0.0.3", |
| 14 | +// "@mpaas/upgrade": "0.0.3", | ||
| 15 | +// "@mpaas/framework": "0.0.3" | ||
| 16 | } | 16 | } |
| 17 | } | 17 | } |
| 1 | -import { MPUpgradeService } from '@mpaas/upgrade' | ||
| 2 | -import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a' | 1 | +// import { MPUpgradeService } from '@mpaas/upgrade' |
| 2 | +// import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a' | ||
| 3 | import { AppUtils } from '../utils/AppUtils' | 3 | import { AppUtils } from '../utils/AppUtils' |
| 4 | import { SPHelper } from '../utils/SPHelper' | 4 | import { SPHelper } from '../utils/SPHelper' |
| 5 | 5 | ||
| @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck { | @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck { | ||
| 16 | /// 默认提示框 | 16 | /// 默认提示框 |
| 17 | checkNewVersionAndShow() { | 17 | checkNewVersionAndShow() { |
| 18 | try { | 18 | try { |
| 19 | - MPUpgradeService.checkNewVersionAndShow() | 19 | + // MPUpgradeService.checkNewVersionAndShow() |
| 20 | } catch (error) { | 20 | } catch (error) { |
| 21 | console.log("mpaas upgrade fail", JSON.stringify(error)) | 21 | console.log("mpaas upgrade fail", JSON.stringify(error)) |
| 22 | } | 22 | } |
| @@ -25,69 +25,70 @@ export class MpaasUpgradeCheck { | @@ -25,69 +25,70 @@ export class MpaasUpgradeCheck { | ||
| 25 | checkNewVersion(): Promise<UpgradeTipContent | null> { | 25 | checkNewVersion(): Promise<UpgradeTipContent | null> { |
| 26 | 26 | ||
| 27 | return new Promise((resolve, fail) => { | 27 | return new Promise((resolve, fail) => { |
| 28 | - MPUpgradeService.checkNewVersion().then((response)=>{ | ||
| 29 | - let str = JSON.stringify(response) | ||
| 30 | - console.log("mpaas upgrade check", str) | ||
| 31 | - | ||
| 32 | - /* | ||
| 33 | - { | ||
| 34 | - "android64FileSize": 0, | ||
| 35 | - "downloadURL": "https://appgallery.huawei.com/#/app", | ||
| 36 | - "fileSize": 0, | ||
| 37 | - "fullMd5": "no md5", | ||
| 38 | - "guideMemo": "欢迎使用新版本", | ||
| 39 | - "isWifi": 0, | ||
| 40 | - "netType": "ALL", | ||
| 41 | - "newestVersion": "1.0.1", | ||
| 42 | - "resultStatus": 204, | ||
| 43 | - "silentType": 0, | ||
| 44 | - "upgradeVersion": "1.0.1" | ||
| 45 | - }*/ | ||
| 46 | - | ||
| 47 | - let res = response as upgradeRes | ||
| 48 | - | ||
| 49 | - // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/ | ||
| 50 | - // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/ | ||
| 51 | - // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/ | ||
| 52 | - // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/ | ||
| 53 | - // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/ | ||
| 54 | - // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/ | ||
| 55 | - | ||
| 56 | - const currentAppVersoin = AppUtils.getAppVersionName() | ||
| 57 | - | ||
| 58 | - if (res.resultStatus == 201) { | ||
| 59 | - resolve(null) | ||
| 60 | - return | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - // 单次升级控制 | ||
| 64 | - if (res.resultStatus == 202) { | ||
| 65 | - const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean | ||
| 66 | - if (true == oldOnceValue) { | ||
| 67 | - resolve(null) | ||
| 68 | - return | ||
| 69 | - } | ||
| 70 | - SPHelper.default.save("upgradeOnceKey", true) | ||
| 71 | - } else { | ||
| 72 | - SPHelper.default.save("upgradeOnceKey", false) | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) { | ||
| 76 | - let content: UpgradeTipContent = { | ||
| 77 | - content: res.guideMemo, | ||
| 78 | - newVersion: res.upgradeVersion, | ||
| 79 | - downloadUrl: res.downloadURL, | ||
| 80 | - forceUpgrade: res.resultStatus == 206 | ||
| 81 | - } | ||
| 82 | - resolve(content) | ||
| 83 | - return | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - resolve(null) | ||
| 87 | - }).catch((error: Error) => { | ||
| 88 | - console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`) | ||
| 89 | - fail("检测升级失败") | ||
| 90 | - }) | 28 | + fail("a") |
| 29 | + // MPUpgradeService.checkNewVersion().then((response)=>{ | ||
| 30 | + // let str = JSON.stringify(response) | ||
| 31 | + // console.log("mpaas upgrade check", str) | ||
| 32 | + // | ||
| 33 | + // /* | ||
| 34 | + // { | ||
| 35 | + // "android64FileSize": 0, | ||
| 36 | + // "downloadURL": "https://appgallery.huawei.com/#/app", | ||
| 37 | + // "fileSize": 0, | ||
| 38 | + // "fullMd5": "no md5", | ||
| 39 | + // "guideMemo": "欢迎使用新版本", | ||
| 40 | + // "isWifi": 0, | ||
| 41 | + // "netType": "ALL", | ||
| 42 | + // "newestVersion": "1.0.1", | ||
| 43 | + // "resultStatus": 204, | ||
| 44 | + // "silentType": 0, | ||
| 45 | + // "upgradeVersion": "1.0.1" | ||
| 46 | + // }*/ | ||
| 47 | + // | ||
| 48 | + // let res = response as upgradeRes | ||
| 49 | + // | ||
| 50 | + // // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/ | ||
| 51 | + // // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/ | ||
| 52 | + // // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/ | ||
| 53 | + // // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/ | ||
| 54 | + // // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/ | ||
| 55 | + // // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/ | ||
| 56 | + // | ||
| 57 | + // const currentAppVersoin = AppUtils.getAppVersionName() | ||
| 58 | + // | ||
| 59 | + // if (res.resultStatus == 201) { | ||
| 60 | + // resolve(null) | ||
| 61 | + // return | ||
| 62 | + // } | ||
| 63 | + // | ||
| 64 | + // // 单次升级控制 | ||
| 65 | + // if (res.resultStatus == 202) { | ||
| 66 | + // const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean | ||
| 67 | + // if (true == oldOnceValue) { | ||
| 68 | + // resolve(null) | ||
| 69 | + // return | ||
| 70 | + // } | ||
| 71 | + // SPHelper.default.save("upgradeOnceKey", true) | ||
| 72 | + // } else { | ||
| 73 | + // SPHelper.default.save("upgradeOnceKey", false) | ||
| 74 | + // } | ||
| 75 | + // | ||
| 76 | + // if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) { | ||
| 77 | + // let content: UpgradeTipContent = { | ||
| 78 | + // content: res.guideMemo, | ||
| 79 | + // newVersion: res.upgradeVersion, | ||
| 80 | + // downloadUrl: res.downloadURL, | ||
| 81 | + // forceUpgrade: res.resultStatus == 206 | ||
| 82 | + // } | ||
| 83 | + // resolve(content) | ||
| 84 | + // return | ||
| 85 | + // } | ||
| 86 | + // | ||
| 87 | + // resolve(null) | ||
| 88 | + // }).catch((error: Error) => { | ||
| 89 | + // console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`) | ||
| 90 | + // fail("检测升级失败") | ||
| 91 | + // }) | ||
| 91 | }) | 92 | }) |
| 92 | } | 93 | } |
| 93 | } | 94 | } |
| 1 | -import { MPFramework } from '@mpaas/framework' | 1 | +// import { MPFramework } from '@mpaas/framework' |
| 2 | import { common } from '@kit.AbilityKit'; | 2 | import { common } from '@kit.AbilityKit'; |
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| @@ -12,17 +12,18 @@ export class MpaasUtils { | @@ -12,17 +12,18 @@ export class MpaasUtils { | ||
| 12 | 12 | ||
| 13 | // 启动时onCreate()方法调用 | 13 | // 启动时onCreate()方法调用 |
| 14 | static initApp(context: common.UIAbilityContext) { | 14 | static initApp(context: common.UIAbilityContext) { |
| 15 | - MPFramework.create(context); | 15 | + // MPFramework.create(context); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | // 获取mPaaS utdid | 18 | // 获取mPaaS utdid |
| 19 | static async mpaasUtdid() { | 19 | static async mpaasUtdid() { |
| 20 | - let utdid = await MPFramework.instance.udid | 20 | + // let utdid = await MPFramework.instance.udid |
| 21 | + let utdid = "xxxxxxxxxx" | ||
| 21 | return utdid | 22 | return utdid |
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | // 登录和退出登录调用,用来管理白名单用 | 25 | // 登录和退出登录调用,用来管理白名单用 |
| 25 | static setupUserId(userId?: string) { | 26 | static setupUserId(userId?: string) { |
| 26 | - MPFramework.instance.userId = userId | 27 | + // MPFramework.instance.userId = userId |
| 27 | } | 28 | } |
| 28 | } | 29 | } |
| @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | ||
| 5 | import { Action } from 'wdBean'; | 5 | import { Action } from 'wdBean'; |
| 6 | import { performJSCallNative } from './JsBridgeBiz'; | 6 | import { performJSCallNative } from './JsBridgeBiz'; |
| 7 | import { H5CallNativeType } from './H5CallNativeType'; | 7 | import { H5CallNativeType } from './H5CallNativeType'; |
| 8 | -import { Message,WDH5WebDataSource } from 'wdJsBridge/src/main/ets/bean/Message'; | 8 | +import { Message,WDH5WebDataSource,WDH5WebPageOperationType } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 9 | import { JSON } from '@kit.ArkTS'; | 9 | import { JSON } from '@kit.ArkTS'; |
| 10 | +import { WindowModel } from 'wdKit'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'WdWebComponent'; | 12 | const TAG = 'WdWebComponent'; |
| 12 | 13 | ||
| @@ -84,7 +85,18 @@ export struct WdWebComponent { | @@ -84,7 +85,18 @@ export struct WdWebComponent { | ||
| 84 | } | 85 | } |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 88 | + if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { | ||
| 89 | + this.jsCall_currentPageOperate(data) | ||
| 90 | + return | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + private jsCall_currentPageOperate(data: Message) { | ||
| 95 | + if (data.data?.operateType == WDH5WebPageOperationType.WDH5WebPageOperationTypeSetStatusBar) { | ||
| 96 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: data.data?.statusBarMode =='2'?'#ffffff':'#000000'}) | ||
| 97 | + } | ||
| 87 | } | 98 | } |
| 99 | + | ||
| 88 | onPageBegin: (url?: string) => void = () => { | 100 | onPageBegin: (url?: string) => void = () => { |
| 89 | Logger.debug(TAG, 'onPageBegin'); | 101 | Logger.debug(TAG, 'onPageBegin'); |
| 90 | this.registerHandlers(); | 102 | this.registerHandlers(); |
| @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout { | @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout { | ||
| 46 | navItem: BottomNavDTO = {} as BottomNavDTO | 46 | navItem: BottomNavDTO = {} as BottomNavDTO |
| 47 | // 顶部导航栏是否有临时跳转频道数据不 | 47 | // 顶部导航栏是否有临时跳转频道数据不 |
| 48 | @Prop haveTempTabData: boolean | 48 | @Prop haveTempTabData: boolean |
| 49 | + | ||
| 49 | changeTab: (index: number) => void = () => { | 50 | changeTab: (index: number) => void = () => { |
| 50 | } | 51 | } |
| 51 | 52 | ||
| @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout { | @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout { | ||
| 272 | } | 273 | } |
| 273 | } | 274 | } |
| 274 | 275 | ||
| 276 | + | ||
| 277 | + @Builder | ||
| 278 | + firstSettingItemBuilder (item:TopNavDTO, index: number){ | ||
| 279 | + if (this.homeChannelList.length == 1) { | ||
| 280 | + Image('') | ||
| 281 | + .width('100%') | ||
| 282 | + .height('100%') | ||
| 283 | + .backgroundColor('#ED2800') | ||
| 284 | + .borderRadius(4) | ||
| 285 | + }else { | ||
| 286 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 287 | + $r('app.media.index_setting_button')) | ||
| 288 | + .objectFit(ImageFit.Contain) | ||
| 289 | + .rotate({ | ||
| 290 | + angle: index === 1 ? 180 : 0 | ||
| 291 | + }) | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | + | ||
| 275 | @Builder | 295 | @Builder |
| 276 | sheetBuilder() { | 296 | sheetBuilder() { |
| 277 | Column() { | 297 | Column() { |
| @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout { | @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout { | ||
| 290 | .padding({ bottom: 10 }) | 310 | .padding({ bottom: 10 }) |
| 291 | 311 | ||
| 292 | List() { | 312 | List() { |
| 293 | - ListItem() { | ||
| 294 | - Row() { | ||
| 295 | - Text(INDEX_SETTING_TITLE) | ||
| 296 | - .fontSize(16) | ||
| 297 | - .fontWeight(600) | ||
| 298 | - .margin({ right: 4 }) | ||
| 299 | - | ||
| 300 | - Text(INDEX_SETTING_SUBTITLE) | ||
| 301 | - .fontSize(12) | ||
| 302 | - .fontWeight(400) | ||
| 303 | - .fontColor('#80222222') | 313 | + |
| 314 | + if (this.homeChannelList.length > 0) { | ||
| 315 | + ListItem() { | ||
| 316 | + Row() { | ||
| 317 | + Text(INDEX_SETTING_TITLE) | ||
| 318 | + .fontSize(16) | ||
| 319 | + .fontWeight(600) | ||
| 320 | + .margin({ right: 4 }) | ||
| 321 | + | ||
| 322 | + Text(INDEX_SETTING_SUBTITLE) | ||
| 323 | + .fontSize(12) | ||
| 324 | + .fontWeight(400) | ||
| 325 | + .fontColor('#80222222') | ||
| 326 | + } | ||
| 327 | + .width('100%') | ||
| 328 | + .margin({ top: 22, bottom: 16 }) | ||
| 329 | + | ||
| 304 | } | 330 | } |
| 305 | - .width('100%') | ||
| 306 | - .margin({ top: 22, bottom: 16 }) | ||
| 307 | 331 | ||
| 308 | - } | 332 | + ListItem() { |
| 333 | + Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||
| 334 | + ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { | ||
| 335 | + Stack() { | ||
| 336 | + this.firstSettingItemBuilder(item,index) | ||
| 337 | + // Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 338 | + // $r('app.media.index_setting_button')) | ||
| 339 | + // .objectFit(ImageFit.Contain) | ||
| 340 | + // .rotate({ | ||
| 341 | + // angle: index === 1 ? 180 : 0 | ||
| 342 | + // }) | ||
| 343 | + Row() { | ||
| 344 | + if (index === 0) { | ||
| 345 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : | ||
| 346 | + $r('app.media.recommend_icon_active')) | ||
| 347 | + .width(20) | ||
| 348 | + } | ||
| 349 | + Text(item.name) | ||
| 350 | + .textAlign(TextAlign.Center) | ||
| 351 | + .fontSize(16) | ||
| 352 | + .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') | ||
| 309 | 353 | ||
| 310 | - ListItem() { | ||
| 311 | - Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||
| 312 | - ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { | ||
| 313 | - Stack() { | ||
| 314 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 315 | - $r('app.media.index_setting_button')) | ||
| 316 | - .objectFit(ImageFit.Auto) | ||
| 317 | - .rotate({ | ||
| 318 | - angle: index === 1 ? 180 : 0 | ||
| 319 | - }) | ||
| 320 | - Row() { | ||
| 321 | - if (index === 0) { | ||
| 322 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : | ||
| 323 | - $r('app.media.recommend_icon_active')) | ||
| 324 | - .width(20) | ||
| 325 | } | 354 | } |
| 326 | - Text(item.name) | ||
| 327 | - .textAlign(TextAlign.Center) | ||
| 328 | - .fontSize(16) | ||
| 329 | - .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') | ||
| 330 | - | 355 | + .width('100%') |
| 356 | + .justifyContent(FlexAlign.Center) | ||
| 331 | } | 357 | } |
| 332 | - .width('100%') | ||
| 333 | - .justifyContent(FlexAlign.Center) | ||
| 334 | - } | ||
| 335 | - .alignContent(Alignment.Start) | ||
| 336 | - .height(36) | ||
| 337 | - .onClick(() => { | ||
| 338 | - this.indexSettingChannelId = item.channelId | ||
| 339 | - AppStorage.set('indexSettingChannelId', item.channelId) | 358 | + .alignContent(Alignment.Start) |
| 359 | + .height(36) | ||
| 360 | + .layoutWeight(1) | ||
| 361 | + .onClick(() => { | ||
| 362 | + this.indexSettingChannelId = item.channelId | ||
| 363 | + AppStorage.set('indexSettingChannelId', item.channelId) | ||
| 364 | + }) | ||
| 340 | }) | 365 | }) |
| 341 | - }) | 366 | + } |
| 367 | + .height(36) | ||
| 368 | + .margin({ bottom: 36 }) | ||
| 342 | } | 369 | } |
| 343 | - .height(36) | ||
| 344 | - .margin({ bottom: 36 }) | ||
| 345 | } | 370 | } |
| 346 | - | ||
| 347 | ListItem() { | 371 | ListItem() { |
| 348 | Row() { | 372 | Row() { |
| 349 | Row() { | 373 | Row() { |
| @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout { | @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout { | ||
| 366 | } | 390 | } |
| 367 | .width('100%') | 391 | .width('100%') |
| 368 | .justifyContent(FlexAlign.SpaceBetween) | 392 | .justifyContent(FlexAlign.SpaceBetween) |
| 369 | - .margin({ bottom: 12 }) | 393 | + .margin({ top:this.homeChannelList.length > 0?0:22,bottom: 12 }) |
| 370 | } | 394 | } |
| 371 | 395 | ||
| 372 | // 我的频道列表 | 396 | // 我的频道列表 |
-
Please register or login to post a comment