Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (29 commits) ref |> 修改评论列表评论内容行高 ref |> 补充推送内链跳转与设置别名问题解决 ref |> 修复子评论 查看更多和收起交互UI 底导换肤修改 feat:展会广告,点击图片没有跳转到百度 fix:bug[17921]互动消息中的点赞显示内容鸿蒙与安卓不一致 音频悬浮窗配置子窗口透明(无效),布局调整 feat:广告 feat: 17390 UI还原问题--健康频道-时间轴专题_时间节点样式与安卓不一致,点偏大 切环境,清除首页缓存 feat: 16997 搜索结果页-稿件发布日期展示错误 fix:bug[17752] 消息中的预约消息在无网络时的缺省图与安卓不一致 fix:bug[17754] 消息下的预约消息鸿蒙与安卓的标题显示不一致 fix:bug[17795] 早晚报>多图类型稿件详情页,进入号主页_顶部展示与安卓效果不一致 fix:bug[17051] UI还原问题--编辑资料背景图鸿蒙版未能全铺 fix:somebug feat: 17492 功能缺陷-【uat】进入精选评论卡,点击点赞,未变成已点赞 分页加载ui,消失逻辑修改 全屏调试 feat: 17492 功能缺陷-【uat】进入精选评论卡,点击点赞,未变成已点赞 ...
Showing
63 changed files
with
534 additions
and
154 deletions
| @@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
| 34 | { | 34 | { |
| 35 | "name": "default", | 35 | "name": "default", |
| 36 | "signingConfig": "default", | 36 | "signingConfig": "default", |
| 37 | + "compileSdkVersion": "5.0.0(12)", | ||
| 37 | "compatibleSdkVersion": "5.0.0(12)", | 38 | "compatibleSdkVersion": "5.0.0(12)", |
| 38 | "runtimeOS": "HarmonyOS", | 39 | "runtimeOS": "HarmonyOS", |
| 39 | } | 40 | } |
| @@ -89,6 +89,15 @@ export class KVStoreHelper { | @@ -89,6 +89,15 @@ export class KVStoreHelper { | ||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | + deleteAll() { | ||
| 93 | + this.kvManager?.deleteKVStore(AppUtils.getPackageName(getContext()), KVStoreHelper._default_store_id) | ||
| 94 | + .then(() => { | ||
| 95 | + Logger.error(TAG, 'deleteAll success') | ||
| 96 | + }).catch((e: object) => { | ||
| 97 | + Logger.error(TAG, 'deleteAll error: ' + JSON.stringify(e)) | ||
| 98 | + }) | ||
| 99 | + } | ||
| 100 | + | ||
| 92 | private checkStoreCreated() { | 101 | private checkStoreCreated() { |
| 93 | if (!this.kvManager) { | 102 | if (!this.kvManager) { |
| 94 | this.createKVManager() | 103 | this.createKVManager() |
| @@ -93,10 +93,8 @@ export class HttpBizUtil { | @@ -93,10 +93,8 @@ export class HttpBizUtil { | ||
| 93 | */ | 93 | */ |
| 94 | static refreshToken(): Promise<string> { | 94 | static refreshToken(): Promise<string> { |
| 95 | let url = HttpUrlUtils.getRefreshTokenUrl(); | 95 | let url = HttpUrlUtils.getRefreshTokenUrl(); |
| 96 | - let params: HashMap<string, string> = new HashMap<string, string>() | ||
| 97 | - params.set('refreshToken', HttpUtils.getRefreshToken()) | ||
| 98 | - params.set('deviceId', HttpUtils.getDeviceId()) | ||
| 99 | - // Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken()) | 96 | + let params: RefreshTokenParam = |
| 97 | + new RefreshTokenParam(HttpUtils.getRefreshToken(), HttpUtils.getDeviceId()) | ||
| 100 | // 请求刷新token接口 | 98 | // 请求刷新token接口 |
| 101 | return new Promise<string>((success, error) => { | 99 | return new Promise<string>((success, error) => { |
| 102 | WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => { | 100 | WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => { |
| @@ -124,3 +122,13 @@ export class HttpBizUtil { | @@ -124,3 +122,13 @@ export class HttpBizUtil { | ||
| 124 | }) | 122 | }) |
| 125 | } | 123 | } |
| 126 | } | 124 | } |
| 125 | + | ||
| 126 | +export class RefreshTokenParam { | ||
| 127 | + refreshToken: string = '' | ||
| 128 | + deviceId: string = '' | ||
| 129 | + | ||
| 130 | + constructor(refreshToken: string, deviceId: string) { | ||
| 131 | + this.refreshToken = refreshToken | ||
| 132 | + this.deviceId = deviceId | ||
| 133 | + } | ||
| 134 | +} |
| 1 | import { url } from '@kit.ArkTS' | 1 | import { url } from '@kit.ArkTS' |
| 2 | import App from '@system.app' | 2 | import App from '@system.app' |
| 3 | +import { Action, Params } from 'wdBean/Index' | ||
| 4 | +import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 3 | import { Logger } from 'wdKit/Index' | 5 | import { Logger } from 'wdKit/Index' |
| 6 | +import { WDRouterRule } from '../router/WDRouterRule' | ||
| 7 | +import { ProcessUtils } from './ProcessUtils' | ||
| 4 | 8 | ||
| 5 | const TAG = "AppInnerLink" | 9 | const TAG = "AppInnerLink" |
| 6 | 10 | ||
| @@ -8,7 +12,7 @@ export class AppInnerLink { | @@ -8,7 +12,7 @@ export class AppInnerLink { | ||
| 8 | 12 | ||
| 9 | static readonly INNER_LINK_PROTCOL = "rmrbapp:" | 13 | static readonly INNER_LINK_PROTCOL = "rmrbapp:" |
| 10 | static readonly INNER_LINK_HOSTNAME = "rmrb.app" | 14 | static readonly INNER_LINK_HOSTNAME = "rmrb.app" |
| 11 | - static readonly INNER_LINK_PATHNAME = "openwith" | 15 | + static readonly INNER_LINK_PATHNAME = "/openwith" |
| 12 | 16 | ||
| 13 | // 内链跳转 | 17 | // 内链跳转 |
| 14 | // 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1 | 18 | // 内链地址例如:rmrbapp://rmrb.app/openwith?type=article&subType=h5_template_article&contentId=30000762651&relId=500000038702&skipType=1&relType=1 |
| @@ -48,19 +52,110 @@ export class AppInnerLink { | @@ -48,19 +52,110 @@ export class AppInnerLink { | ||
| 48 | } | 52 | } |
| 49 | 53 | ||
| 50 | private static jumpParams(params: InnerLinkParam) { | 54 | private static jumpParams(params: InnerLinkParam) { |
| 55 | + if (!AppInnerLink.validTypes(params.type)) { | ||
| 56 | + return | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + const contentType = AppInnerLink.contentTypeWithType(params.type) | ||
| 60 | + | ||
| 61 | + if (params.type == "article") { | ||
| 62 | + let taskAction: Action = { | ||
| 63 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 64 | + params: { | ||
| 65 | + contentID: params.contentId, | ||
| 66 | + pageID: 'IMAGE_TEXT_DETAIL', | ||
| 67 | + extra: { | ||
| 68 | + relType: params.relType, | ||
| 69 | + relId: params.relId, | ||
| 70 | + sourcePage: '5', // ??? | ||
| 71 | + } as ExtraDTO | ||
| 72 | + } as Params, | ||
| 73 | + }; | ||
| 74 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 75 | + return | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + if (params.type == "video" | ||
| 79 | + || params.type == "dynamic" | ||
| 80 | + || params.type == "live" | ||
| 81 | + || params.type == "audio" | ||
| 82 | + || params.type == "picture") { | ||
| 83 | + let taskAction: Action = { | ||
| 84 | + type: 'JUMP_DETAIL_PAGE', | ||
| 85 | + params: { | ||
| 86 | + detailPageType: contentType, | ||
| 87 | + contentID: params.contentId, | ||
| 88 | + extra: { | ||
| 89 | + relType: params.relType, | ||
| 90 | + relId: params.relId, | ||
| 91 | + } as ExtraDTO | ||
| 92 | + } as Params, | ||
| 93 | + }; | ||
| 94 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 95 | + return | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + if (params.type == "owner_page" && params.creatorId) { | ||
| 99 | + ProcessUtils.gotoPeopleShipHomePage(params.creatorId) | ||
| 100 | + return | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + if (params.type == "topic") { | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + if (params.type == "channel") { | ||
| 108 | + | ||
| 109 | + } | ||
| 51 | 110 | ||
| 52 | } | 111 | } |
| 112 | + private static contentTypeWithType(type?: string) : number | undefined { | ||
| 113 | + switch (type) { | ||
| 114 | + case "video": return 1 | ||
| 115 | + case "dynamic": return 14 | ||
| 116 | + case "live": return 2 | ||
| 117 | + case "audio": return 13 | ||
| 118 | + case "picture": return 9 | ||
| 119 | + case "article": return 8 | ||
| 120 | + case "ask": return 16 | ||
| 121 | + } | ||
| 122 | + return | ||
| 123 | + } | ||
| 124 | + private static validTypes(type?: string) : boolean { | ||
| 125 | + if (!type) { | ||
| 126 | + return false | ||
| 127 | + } | ||
| 128 | + let typeArray = ["article", "dynamic", "live", "video", "topic", "audio", "ask", "picture", "owner_page", "topic", "channel"] | ||
| 129 | + return typeArray.indexOf(type) != -1 | ||
| 130 | + } | ||
| 131 | + | ||
| 53 | private static jumpNoParams(params: InnerLinkParam) { | 132 | private static jumpNoParams(params: InnerLinkParam) { |
| 133 | + if (!params.type || params.type != "app" || !params.subType) { | ||
| 134 | + return | ||
| 135 | + } | ||
| 136 | + if (params.subType == "login") { | ||
| 137 | + ProcessUtils.gotoLoginPage(); | ||
| 138 | + } else if (params.subType == "search") { | ||
| 139 | + | ||
| 140 | + } else if (params.subType == "home") { | ||
| 141 | + | ||
| 142 | + } else if (params.subType == "mine") { | ||
| 54 | 143 | ||
| 55 | } | 144 | } |
| 56 | - private static jumpAppH5(params: InnerLinkParam) { | 145 | + } |
| 57 | 146 | ||
| 147 | + private static jumpAppH5(params: InnerLinkParam) { | ||
| 148 | + if (params.type && params.type == "h5" && params.url) { | ||
| 149 | + ProcessUtils.gotoDefaultWebPage(params.url); | ||
| 150 | + } | ||
| 58 | } | 151 | } |
| 59 | private static jumpOutH5(params: InnerLinkParam) { | 152 | private static jumpOutH5(params: InnerLinkParam) { |
| 60 | - | 153 | + if (params.type && params.type == "h5" && params.url) { |
| 154 | + ProcessUtils.jumpExternalWebPage(params.url); | ||
| 155 | + } | ||
| 61 | } | 156 | } |
| 62 | private static jumpThirdApp(params: InnerLinkParam) { | 157 | private static jumpThirdApp(params: InnerLinkParam) { |
| 63 | - | 158 | + //TODO: |
| 64 | } | 159 | } |
| 65 | 160 | ||
| 66 | static parseParams(link: string) : InnerLinkParam | undefined { | 161 | static parseParams(link: string) : InnerLinkParam | undefined { |
| @@ -90,7 +90,7 @@ export struct WdWebComponent { | @@ -90,7 +90,7 @@ export struct WdWebComponent { | ||
| 90 | } | 90 | } |
| 91 | onReloadStateChanged() { | 91 | onReloadStateChanged() { |
| 92 | Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); | 92 | Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); |
| 93 | - if (this.reload > 0) { | 93 | + if (this.reload > 0 && this.isPageEnd) { |
| 94 | this.webviewControl.refresh() | 94 | this.webviewControl.refresh() |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| @@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO'; | @@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO'; | ||
| 7 | export class NavigationBodyDTO { | 7 | export class NavigationBodyDTO { |
| 8 | backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道) | 8 | backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道) |
| 9 | bottomNavList: BottomNavDTO[] = []; | 9 | bottomNavList: BottomNavDTO[] = []; |
| 10 | - // greyBottomNav: GreyBottomNav; // 灰度皮肤 | ||
| 11 | immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道) | 10 | immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道) |
| 12 | nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式) | 11 | nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式) |
| 13 | - | 12 | + greyBottomNav?: GreyBottomNavBean; // 灰度皮肤 |
| 14 | md5: string = '' | 13 | md5: string = '' |
| 15 | } | 14 | } |
| 16 | 15 | ||
| 16 | +export class GreyBottomNavBean { | ||
| 17 | + bottomNavList: BottomNavDTO[] = []; | ||
| 18 | + greyUserList: string[] = []; | ||
| 19 | +} | ||
| 20 | + | ||
| 17 | export class NavigationDetailDTO { | 21 | export class NavigationDetailDTO { |
| 18 | id: string = ''; // 迭代二新增-底部导航背景色(信息流频道) | 22 | id: string = ''; // 迭代二新增-底部导航背景色(信息流频道) |
| 19 | bottomNavCompList: BottomNavCompDTO[] = []; | 23 | bottomNavCompList: BottomNavCompDTO[] = []; |
| 20 | topNavChannelList: TopNavDTO[] = []; | 24 | topNavChannelList: TopNavDTO[] = []; |
| 21 | - | ||
| 22 | md5: string = '' | 25 | md5: string = '' |
| 23 | } | 26 | } |
| @@ -121,15 +121,15 @@ export struct CompParser { | @@ -121,15 +121,15 @@ export struct CompParser { | ||
| 121 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | 121 | CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); |
| 122 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 122 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 123 | } else { | 123 | } else { |
| 124 | - Text(this.compDTO.compStyle) | ||
| 125 | - .width(CommonConstants.FULL_PARENT) | ||
| 126 | - .padding(10) | ||
| 127 | - .onClick(() => { | ||
| 128 | - if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论 | ||
| 129 | - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 130 | - } | ||
| 131 | - }) | ||
| 132 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 124 | + // Text(this.compDTO.compStyle) |
| 125 | + // .width(CommonConstants.FULL_PARENT) | ||
| 126 | + // .padding(10) | ||
| 127 | + // .onClick(() => { | ||
| 128 | + // if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论 | ||
| 129 | + // WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 130 | + // } | ||
| 131 | + // }) | ||
| 132 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | 135 |
| @@ -5,7 +5,6 @@ import { | @@ -5,7 +5,6 @@ import { | ||
| 5 | EmitterUtils, | 5 | EmitterUtils, |
| 6 | EmitterEventId, | 6 | EmitterEventId, |
| 7 | NetworkUtil, | 7 | NetworkUtil, |
| 8 | - DisplayUtils | ||
| 9 | } from 'wdKit'; | 8 | } from 'wdKit'; |
| 10 | import { | 9 | import { |
| 11 | Action, | 10 | Action, |
| @@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent' | @@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent' | ||
| 33 | import { HttpUtils } from 'wdNetwork/Index'; | 32 | import { HttpUtils } from 'wdNetwork/Index'; |
| 34 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 35 | import { common } from '@kit.AbilityKit'; | 34 | import { common } from '@kit.AbilityKit'; |
| 35 | +import { componentUtils, window } from '@kit.ArkUI'; | ||
| 36 | 36 | ||
| 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 38 | 38 | ||
| @@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent { | @@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent { | ||
| 58 | @State likeNum: number = 0 | 58 | @State likeNum: number = 0 |
| 59 | @State reachEndIncreament: number = 0 | 59 | @State reachEndIncreament: number = 0 |
| 60 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 60 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 61 | + @State isScrollTop: boolean = true | ||
| 62 | + @State offsetY: number = 0 | ||
| 63 | + | ||
| 61 | build() { | 64 | build() { |
| 62 | Stack({ alignContent: Alignment.Top }) { | 65 | Stack({ alignContent: Alignment.Top }) { |
| 63 | Stack({ alignContent: Alignment.Bottom }) { | 66 | Stack({ alignContent: Alignment.Bottom }) { |
| @@ -125,9 +128,11 @@ export struct ImageAndTextPageComponent { | @@ -125,9 +128,11 @@ export struct ImageAndTextPageComponent { | ||
| 125 | fixedHeightMode: false, | 128 | fixedHeightMode: false, |
| 126 | reachEndIncreament: this.reachEndIncreament, | 129 | reachEndIncreament: this.reachEndIncreament, |
| 127 | reachEndLoadMoreFinish: () => { | 130 | reachEndLoadMoreFinish: () => { |
| 128 | - | ||
| 129 | } | 131 | } |
| 130 | - }).onAreaChange((oldValue: Area, newValue: Area) => { | 132 | + |
| 133 | + }).id('comment') | ||
| 134 | + | ||
| 135 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 131 | this.info = newValue | 136 | this.info = newValue |
| 132 | }) | 137 | }) |
| 133 | // .onMeasureSize() | 138 | // .onMeasureSize() |
| @@ -135,6 +140,7 @@ export struct ImageAndTextPageComponent { | @@ -135,6 +140,7 @@ export struct ImageAndTextPageComponent { | ||
| 135 | } | 140 | } |
| 136 | } | 141 | } |
| 137 | } | 142 | } |
| 143 | + .id('imgTextContainer') | ||
| 138 | } | 144 | } |
| 139 | .width(CommonConstants.FULL_WIDTH) | 145 | .width(CommonConstants.FULL_WIDTH) |
| 140 | .height(CommonConstants.FULL_HEIGHT) | 146 | .height(CommonConstants.FULL_HEIGHT) |
| @@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent { | @@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent { | ||
| 163 | publishCommentModel: this.publishCommentModel, | 169 | publishCommentModel: this.publishCommentModel, |
| 164 | operationButtonList: this.operationButtonList, | 170 | operationButtonList: this.operationButtonList, |
| 165 | styleType: 1, | 171 | styleType: 1, |
| 172 | + onCommentIconClick: () => { | ||
| 173 | + const info = componentUtils.getRectangleById('comment'); | ||
| 174 | + console.log(JSON.stringify(info)) | ||
| 175 | + | ||
| 176 | + if (!this.offsetY) { | ||
| 177 | + this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y | ||
| 178 | + } | ||
| 179 | + // 定位到评论区域 | ||
| 180 | + if (this.isScrollTop) { | ||
| 181 | + this.scroller.scrollTo({ | ||
| 182 | + xOffset: 0, | ||
| 183 | + yOffset: this.offsetY, | ||
| 184 | + animation: true | ||
| 185 | + }) | ||
| 186 | + } else { | ||
| 187 | + this.scroller.scrollEdge(Edge.Top) | ||
| 188 | + } | ||
| 189 | + this.isScrollTop = !this.isScrollTop | ||
| 190 | + } | ||
| 166 | }) | 191 | }) |
| 167 | - .position({y: '100%'}) | 192 | + .position({ y: '100%' }) |
| 168 | } | 193 | } |
| 169 | .width(CommonConstants.FULL_WIDTH) | 194 | .width(CommonConstants.FULL_WIDTH) |
| 170 | .height(CommonConstants.FULL_HEIGHT) | 195 | .height(CommonConstants.FULL_HEIGHT) |
| @@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent { | @@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent { | ||
| 174 | // 发布时间 | 199 | // 发布时间 |
| 175 | Column() { | 200 | Column() { |
| 176 | Row() { | 201 | Row() { |
| 177 | - if(this.isNetConnected && !this.detailContentEmpty) { | 202 | + if (this.isNetConnected && !this.detailContentEmpty) { |
| 178 | Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | 203 | Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) |
| 179 | .width(80) | 204 | .width(80) |
| 180 | .height(28) | 205 | .height(28) |
| @@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent { | @@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent { | ||
| 207 | 232 | ||
| 208 | private async getDetail() { | 233 | private async getDetail() { |
| 209 | this.isNetConnected = NetworkUtil.isNetConnected() | 234 | this.isNetConnected = NetworkUtil.isNetConnected() |
| 210 | - if(!this.isNetConnected) { | 235 | + if (!this.isNetConnected) { |
| 211 | this.emptyType = 1 | 236 | this.emptyType = 1 |
| 212 | } | 237 | } |
| 213 | let contentId: string = '' | 238 | let contentId: string = '' |
| @@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent { | @@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent { | ||
| 229 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | 254 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) |
| 230 | // 判断内容是否已下线,空数组表示下线 | 255 | // 判断内容是否已下线,空数组表示下线 |
| 231 | this.detailContentEmpty = detailBeans.length === 0 ? true : false | 256 | this.detailContentEmpty = detailBeans.length === 0 ? true : false |
| 232 | - if(this.detailContentEmpty) { | 257 | + if (this.detailContentEmpty) { |
| 233 | this.emptyType = 18 | 258 | this.emptyType = 18 |
| 234 | } | 259 | } |
| 235 | console.log(TAG, JSON.stringify(detailBeans)) | 260 | console.log(TAG, JSON.stringify(detailBeans)) |
| @@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent { | @@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent { | ||
| 270 | } | 295 | } |
| 271 | 296 | ||
| 272 | //意图上报 | 297 | //意图上报 |
| 273 | - private viewBlogInsightIntentShare(){ | 298 | + private viewBlogInsightIntentShare() { |
| 274 | let context = getContext(this) as common.UIAbilityContext; | 299 | let context = getContext(this) as common.UIAbilityContext; |
| 275 | - viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactData) | 300 | + viewBlogItemInsightIntentShare(context, this.contentDetailData, this.interactData) |
| 276 | } | 301 | } |
| 277 | 302 | ||
| 278 | - | ||
| 279 | private async getRecommend() { | 303 | private async getRecommend() { |
| 280 | let params: postRecommendListParams = { | 304 | let params: postRecommendListParams = { |
| 281 | imei: HttpUtils.getImei(), | 305 | imei: HttpUtils.getImei(), |
| @@ -90,6 +90,9 @@ export struct SpacialTopicPageComponent { | @@ -90,6 +90,9 @@ export struct SpacialTopicPageComponent { | ||
| 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 92 | // } | 92 | // } |
| 93 | + if (this.contentDetailData[0]?.openComment) { | ||
| 94 | + this.operationButtonList = ['collect', 'share'] | ||
| 95 | + } | ||
| 93 | this.trySendData2H5() | 96 | this.trySendData2H5() |
| 94 | } | 97 | } |
| 95 | } | 98 | } |
| @@ -45,13 +45,18 @@ export struct CardMediaInfo { | @@ -45,13 +45,18 @@ export struct CardMediaInfo { | ||
| 45 | .mediaLogo() | 45 | .mediaLogo() |
| 46 | Text('回看') | 46 | Text('回看') |
| 47 | .mediaText() | 47 | .mediaText() |
| 48 | - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | ||
| 49 | - ?.replayUri) { | ||
| 50 | - // Image($r('app.media.card_live')) | ||
| 51 | - // .mediaLogo() | ||
| 52 | - Text('直播结束') | 48 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo |
| 49 | + ?.replayUri){ | ||
| 50 | + Text('已结束') | ||
| 53 | .mediaText() | 51 | .mediaText() |
| 54 | } | 52 | } |
| 53 | + // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | ||
| 54 | + // ?.replayUri) { | ||
| 55 | + // // Image($r('app.media.card_live')) | ||
| 56 | + // // .mediaLogo() | ||
| 57 | + // Text('直播结束') | ||
| 58 | + // .mediaText() | ||
| 59 | + // } | ||
| 55 | } | 60 | } |
| 56 | } else if (this.contentDTO.objectType === '9') { | 61 | } else if (this.contentDTO.objectType === '9') { |
| 57 | // 显示组图;图片数量 | 62 | // 显示组图;图片数量 |
| @@ -53,7 +53,7 @@ export struct CardSourceInfo { | @@ -53,7 +53,7 @@ export struct CardSourceInfo { | ||
| 53 | // .flexShrink(0); | 53 | // .flexShrink(0); |
| 54 | // } | 54 | // } |
| 55 | if (this.contentDTO.source) { | 55 | if (this.contentDTO.source) { |
| 56 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | 56 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(new Date(this.contentDTO.publishTime).getTime().toString()))) |
| 57 | .fontSize($r("app.float.font_size_11")) | 57 | .fontSize($r("app.float.font_size_11")) |
| 58 | .fontColor($r("app.color.color_B0B0B0")) | 58 | .fontColor($r("app.color.color_B0B0B0")) |
| 59 | .flexShrink(0); | 59 | .flexShrink(0); |
| @@ -22,6 +22,8 @@ export struct AdvCardParser { | @@ -22,6 +22,8 @@ export struct AdvCardParser { | ||
| 22 | @State compDTO: CompDTO = {} as CompDTO; | 22 | @State compDTO: CompDTO = {} as CompDTO; |
| 23 | pageModel: PageModel = new PageModel(); | 23 | pageModel: PageModel = new PageModel(); |
| 24 | 24 | ||
| 25 | + | ||
| 26 | + | ||
| 25 | build() { | 27 | build() { |
| 26 | this.contentBuilder(this.pageModel, this.compDTO); | 28 | this.contentBuilder(this.pageModel, this.compDTO); |
| 27 | } | 29 | } |
| 1 | import { CompDTO } from 'wdBean'; | 1 | import { CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 4 | import PageModel from '../../viewmodel/PageModel'; | 5 | import PageModel from '../../viewmodel/PageModel'; |
| 5 | import { CardAdvBottom } from './CardAdvBottom'; | 6 | import { CardAdvBottom } from './CardAdvBottom'; |
| 6 | 7 | ||
| @@ -17,8 +18,11 @@ const TAG: string = 'Card2Component'; | @@ -17,8 +18,11 @@ const TAG: string = 'Card2Component'; | ||
| 17 | @Component | 18 | @Component |
| 18 | export struct CardAdvBigImageComponent { | 19 | export struct CardAdvBigImageComponent { |
| 19 | @State compDTO: CompDTO = {} as CompDTO | 20 | @State compDTO: CompDTO = {} as CompDTO |
| 21 | + | ||
| 22 | + @State loadImg: boolean = false; | ||
| 20 | pageModel: PageModel = new PageModel(); | 23 | pageModel: PageModel = new PageModel(); |
| 21 | - aboutToAppear(): void { | 24 | + async aboutToAppear(): Promise<void> { |
| 25 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 22 | 26 | ||
| 23 | } | 27 | } |
| 24 | 28 | ||
| @@ -33,7 +37,8 @@ export struct CardAdvBigImageComponent { | @@ -33,7 +37,8 @@ export struct CardAdvBigImageComponent { | ||
| 33 | //新闻标题 | 37 | //新闻标题 |
| 34 | Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, }) | 38 | Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, }) |
| 35 | //大图 | 39 | //大图 |
| 36 | - Image(this.compDTO.matInfo.matImageUrl[0]) | 40 | + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '') |
| 41 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 37 | .width(CommonConstants.FULL_WIDTH) | 42 | .width(CommonConstants.FULL_WIDTH) |
| 38 | .aspectRatio(16 / 9) | 43 | .aspectRatio(16 / 9) |
| 39 | .borderRadius(4) | 44 | .borderRadius(4) |
| @@ -4,6 +4,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | @@ -4,6 +4,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | ||
| 4 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 4 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| 5 | import { CommonConstants } from 'wdConstant/Index'; | 5 | import { CommonConstants } from 'wdConstant/Index'; |
| 6 | import { ProcessUtils } from 'wdRouter'; | 6 | import { ProcessUtils } from 'wdRouter'; |
| 7 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 7 | import PageModel from '../../viewmodel/PageModel'; | 8 | import PageModel from '../../viewmodel/PageModel'; |
| 8 | import { CardAdvTop } from './CardAdvTop'; | 9 | import { CardAdvTop } from './CardAdvTop'; |
| 9 | 10 | ||
| @@ -23,14 +24,14 @@ export struct CardAdvGanMiComponent { | @@ -23,14 +24,14 @@ export struct CardAdvGanMiComponent { | ||
| 23 | @State advExtraData: AdvExtraData = {} as AdvExtraData | 24 | @State advExtraData: AdvExtraData = {} as AdvExtraData |
| 24 | @State advLength: number = 0; | 25 | @State advLength: number = 0; |
| 25 | pageModel: PageModel = new PageModel(); | 26 | pageModel: PageModel = new PageModel(); |
| 27 | + @State loadImg: boolean = false; | ||
| 26 | 28 | ||
| 27 | - aboutToAppear(): void { | 29 | + async aboutToAppear(): Promise<void> { |
| 30 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 28 | 31 | ||
| 29 | let extraData = this.compDTO.matInfo.extraData | 32 | let extraData = this.compDTO.matInfo.extraData |
| 30 | let labelDTO = JSON.parse(extraData) as AdvExtraData | 33 | let labelDTO = JSON.parse(extraData) as AdvExtraData |
| 31 | this.advExtraData = labelDTO | 34 | this.advExtraData = labelDTO |
| 32 | - //this.advExtraData.item = [this.advExtraData.item[0]] | ||
| 33 | - // this.advExtraData.item[2].title ="我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国" | ||
| 34 | this.advLength = this.advExtraData.item.length | 35 | this.advLength = this.advExtraData.item.length |
| 35 | } | 36 | } |
| 36 | 37 | ||
| @@ -46,8 +47,9 @@ export struct CardAdvGanMiComponent { | @@ -46,8 +47,9 @@ export struct CardAdvGanMiComponent { | ||
| 46 | Row() { | 47 | Row() { |
| 47 | Stack() { | 48 | Stack() { |
| 48 | //长图 | 49 | //长图 |
| 49 | - Image(this.advExtraData.itemTopImage) | 50 | + Image(this.loadImg ? this.advExtraData.itemTopImage : '') |
| 50 | .width(CommonConstants.FULL_WIDTH) | 51 | .width(CommonConstants.FULL_WIDTH) |
| 52 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 51 | .aspectRatio(343 / 40) | 53 | .aspectRatio(343 / 40) |
| 52 | .borderRadius(4) | 54 | .borderRadius(4) |
| 53 | .borderWidth(0.5) | 55 | .borderWidth(0.5) |
| @@ -73,8 +75,9 @@ export struct CardAdvGanMiComponent { | @@ -73,8 +75,9 @@ export struct CardAdvGanMiComponent { | ||
| 73 | // 广告列表信息 | 75 | // 广告列表信息 |
| 74 | Column() { | 76 | Column() { |
| 75 | 77 | ||
| 76 | - Image(content.image) | 78 | + Image(this.loadImg ? content.image : '') |
| 77 | .width('100%') | 79 | .width('100%') |
| 80 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 78 | .aspectRatio(150 / 84) | 81 | .aspectRatio(150 / 84) |
| 79 | .borderWidth(0.5) | 82 | .borderWidth(0.5) |
| 80 | .borderColor($r('app.color.color_0D000000')) | 83 | .borderColor($r('app.color.color_0D000000')) |
| @@ -84,7 +87,7 @@ export struct CardAdvGanMiComponent { | @@ -84,7 +87,7 @@ export struct CardAdvGanMiComponent { | ||
| 84 | .fontSize('16fp') | 87 | .fontSize('16fp') |
| 85 | .fontColor($r('app.color.color_222222')) | 88 | .fontColor($r('app.color.color_222222')) |
| 86 | .fontSize('15fp') | 89 | .fontSize('15fp') |
| 87 | - .maxLines(3) | 90 | + .maxLines(2) |
| 88 | .lineHeight(20) | 91 | .lineHeight(20) |
| 89 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 92 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 90 | .width('100%') | 93 | .width('100%') |
| @@ -121,7 +124,7 @@ export struct CardAdvGanMiComponent { | @@ -121,7 +124,7 @@ export struct CardAdvGanMiComponent { | ||
| 121 | }) | 124 | }) |
| 122 | 125 | ||
| 123 | // 更多按钮 | 126 | // 更多按钮 |
| 124 | - commonButton(this.advExtraData) | 127 | + this.commonButton() |
| 125 | 128 | ||
| 126 | } | 129 | } |
| 127 | .width(CommonConstants.FULL_WIDTH) | 130 | .width(CommonConstants.FULL_WIDTH) |
| @@ -131,19 +134,21 @@ export struct CardAdvGanMiComponent { | @@ -131,19 +134,21 @@ export struct CardAdvGanMiComponent { | ||
| 131 | }) | 134 | }) |
| 132 | 135 | ||
| 133 | } | 136 | } |
| 134 | -} | ||
| 135 | 137 | ||
| 136 | -/* | 138 | + /* |
| 137 | 标题样式 | 139 | 标题样式 |
| 138 | */ | 140 | */ |
| 139 | -@Builder | ||
| 140 | -function commonButton(advExtraData: AdvExtraData) { | 141 | + @Builder |
| 142 | + commonButton() { | ||
| 141 | 143 | ||
| 142 | 144 | ||
| 143 | Row() { | 145 | Row() { |
| 144 | Row() { | 146 | Row() { |
| 145 | Blank() | 147 | Blank() |
| 146 | - Text('查看更多').fontColor('#222222').fontSize('14fp') | 148 | + Text(this.advExtraData.itemMore == undefined ? $r('app.string.look_more') : |
| 149 | + this.advExtraData.itemMore.title == undefined ? $r('app.string.look_more') : this.advExtraData.itemMore.title) | ||
| 150 | + .fontColor('#222222') | ||
| 151 | + .fontSize('14fp') | ||
| 147 | Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) | 152 | Image($r('app.media.icon_comp_more_right_red')).width(16).height(16) |
| 148 | Blank() | 153 | Blank() |
| 149 | 154 | ||
| @@ -153,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) { | @@ -153,11 +158,14 @@ function commonButton(advExtraData: AdvExtraData) { | ||
| 153 | .borderRadius(3) | 158 | .borderRadius(3) |
| 154 | .padding({ top: 10, bottom: 10, }) | 159 | .padding({ top: 10, bottom: 10, }) |
| 155 | .onClick(() => { | 160 | .onClick(() => { |
| 161 | + if (this.advExtraData.itemMore != undefined) { | ||
| 156 | let matInfo: CompAdvMatInfoBean = { | 162 | let matInfo: CompAdvMatInfoBean = { |
| 157 | - linkUrl: advExtraData.itemMore.linkUrl, | ||
| 158 | - linkType: advExtraData.itemMore.linkType | 163 | + linkUrl: this.advExtraData.itemMore.linkUrl, |
| 164 | + linkType: this.advExtraData.itemMore.linkType | ||
| 159 | } as CompAdvMatInfoBean; | 165 | } as CompAdvMatInfoBean; |
| 160 | ProcessUtils.openAdvDetail(matInfo) | 166 | ProcessUtils.openAdvDetail(matInfo) |
| 167 | + } | ||
| 168 | + | ||
| 161 | }) | 169 | }) |
| 162 | }.width('100%').padding({ | 170 | }.width('100%').padding({ |
| 163 | left: $r('app.float.card_comp_pagePadding_lf'), | 171 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -165,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) { | @@ -165,4 +173,6 @@ function commonButton(advExtraData: AdvExtraData) { | ||
| 165 | 173 | ||
| 166 | }) | 174 | }) |
| 167 | 175 | ||
| 176 | + } | ||
| 168 | } | 177 | } |
| 178 | + |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvLongImageComponent.ets
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import { CompDTO } from 'wdBean'; | 2 | import { CompDTO } from 'wdBean'; |
| 3 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; | 3 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 5 | import PageModel from '../../viewmodel/PageModel'; | 6 | import PageModel from '../../viewmodel/PageModel'; |
| 6 | import { CardAdvBottom } from './CardAdvBottom'; | 7 | import { CardAdvBottom } from './CardAdvBottom'; |
| 7 | 8 | ||
| @@ -20,8 +21,10 @@ export struct CardAdvLongImageComponent { | @@ -20,8 +21,10 @@ export struct CardAdvLongImageComponent { | ||
| 20 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 21 | @State haveTitle: boolean = true | 22 | @State haveTitle: boolean = true |
| 22 | pageModel: PageModel = new PageModel(); | 23 | pageModel: PageModel = new PageModel(); |
| 24 | + @State loadImg: boolean = false; | ||
| 23 | 25 | ||
| 24 | - aboutToAppear(): void { | 26 | + async aboutToAppear(): Promise<void> { |
| 27 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 25 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; | 28 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; |
| 26 | } | 29 | } |
| 27 | 30 | ||
| @@ -37,7 +40,8 @@ export struct CardAdvLongImageComponent { | @@ -37,7 +40,8 @@ export struct CardAdvLongImageComponent { | ||
| 37 | Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) | 40 | Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) |
| 38 | } | 41 | } |
| 39 | //长图 | 42 | //长图 |
| 40 | - Image(this.compDTO.matInfo.matImageUrl[0]) | 43 | + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '') |
| 44 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 41 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 42 | .aspectRatio(343 / 96) | 46 | .aspectRatio(343 / 96) |
| 43 | .borderRadius(4) | 47 | .borderRadius(4) |
| @@ -6,6 +6,7 @@ import measure from '@ohos.measure'; | @@ -6,6 +6,7 @@ import measure from '@ohos.measure'; | ||
| 6 | import { DisplayUtils } from 'wdKit/Index'; | 6 | import { DisplayUtils } from 'wdKit/Index'; |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 7 | import { CardAdvBottom } from './CardAdvBottom'; |
| 8 | import PageModel from '../../viewmodel/PageModel'; | 8 | import PageModel from '../../viewmodel/PageModel'; |
| 9 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 9 | 10 | ||
| 10 | const TAG: string = 'CardAdvSmallImageComponent'; | 11 | const TAG: string = 'CardAdvSmallImageComponent'; |
| 11 | 12 | ||
| @@ -22,7 +23,10 @@ export struct CardAdvSmallImageComponent { | @@ -22,7 +23,10 @@ export struct CardAdvSmallImageComponent { | ||
| 22 | @State compDTO: CompDTO = {} as CompDTO | 23 | @State compDTO: CompDTO = {} as CompDTO |
| 23 | @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true | 24 | @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true |
| 24 | pageModel: PageModel = new PageModel(); | 25 | pageModel: PageModel = new PageModel(); |
| 25 | - aboutToAppear(): void { | 26 | + @State loadImg: boolean = false; |
| 27 | + | ||
| 28 | + async aboutToAppear(): Promise<void> { | ||
| 29 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 26 | 30 | ||
| 27 | // 计算标题文本行数 | 31 | // 计算标题文本行数 |
| 28 | let screenWith = DisplayUtils.getDeviceWidth(); | 32 | let screenWith = DisplayUtils.getDeviceWidth(); |
| @@ -54,14 +58,14 @@ export struct CardAdvSmallImageComponent { | @@ -54,14 +58,14 @@ export struct CardAdvSmallImageComponent { | ||
| 54 | .id("title_name") | 58 | .id("title_name") |
| 55 | 59 | ||
| 56 | // 广告图 | 60 | // 广告图 |
| 57 | - Image(this.compDTO.matInfo.matImageUrl[0]) | 61 | + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '') |
| 58 | .width('34%') | 62 | .width('34%') |
| 59 | .aspectRatio(3 / 2) | 63 | .aspectRatio(3 / 2) |
| 60 | .id('adv_imag') | 64 | .id('adv_imag') |
| 65 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 61 | .borderWidth(0.5) | 66 | .borderWidth(0.5) |
| 62 | .borderColor($r('app.color.color_0D000000')) | 67 | .borderColor($r('app.color.color_0D000000')) |
| 63 | - .borderRadius(4) | ||
| 64 | - //.alt('wwww.baidu.com') | 68 | + .borderRadius(4)//.alt('wwww.baidu.com') |
| 65 | .alignRules({ | 69 | .alignRules({ |
| 66 | top: { anchor: 'title_name', align: VerticalAlign.Top }, | 70 | top: { anchor: 'title_name', align: VerticalAlign.Top }, |
| 67 | left: { anchor: 'title_name', align: HorizontalAlign.End }, | 71 | left: { anchor: 'title_name', align: HorizontalAlign.End }, |
| @@ -69,7 +73,7 @@ export struct CardAdvSmallImageComponent { | @@ -69,7 +73,7 @@ export struct CardAdvSmallImageComponent { | ||
| 69 | .margin({ left: 12 }) | 73 | .margin({ left: 12 }) |
| 70 | 74 | ||
| 71 | 75 | ||
| 72 | - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('62%').id('bottom_adv').alignRules({ | 76 | + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('62%').id('bottom_adv').alignRules({ |
| 73 | bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom }, | 77 | bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom }, |
| 74 | right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start }, | 78 | right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start }, |
| 75 | top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom }, | 79 | top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom }, |
| @@ -94,13 +98,15 @@ export struct CardAdvSmallImageComponent { | @@ -94,13 +98,15 @@ export struct CardAdvSmallImageComponent { | ||
| 94 | } | 98 | } |
| 95 | 99 | ||
| 96 | // 获取文本几行 | 100 | // 获取文本几行 |
| 97 | - private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { | 101 | + private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, |
| 102 | + fontSize: number | string | Resource) { | ||
| 98 | let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) | 103 | let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) |
| 99 | let height: number = Number(size.height) | 104 | let height: number = Number(size.height) |
| 100 | return Math.ceil(px2vp(height) / lineHeight) | 105 | return Math.ceil(px2vp(height) / lineHeight) |
| 101 | } | 106 | } |
| 102 | 107 | ||
| 103 | - private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { | 108 | + private topMeasureText(text: string, constraintWidth: number, lineHeight: number, |
| 109 | + fontSize: number | string | Resource) { | ||
| 104 | return measure.measureTextSize({ | 110 | return measure.measureTextSize({ |
| 105 | textContent: text, | 111 | textContent: text, |
| 106 | fontSize: fontSize, | 112 | fontSize: fontSize, |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import { CompDTO } from 'wdBean'; | 2 | import { CompDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 5 | import PageModel from '../../viewmodel/PageModel'; | 6 | import PageModel from '../../viewmodel/PageModel'; |
| 6 | import { CardAdvBottom } from './CardAdvBottom'; | 7 | import { CardAdvBottom } from './CardAdvBottom'; |
| 7 | 8 | ||
| @@ -18,9 +19,11 @@ const TAG: string = 'Card2Component'; | @@ -18,9 +19,11 @@ const TAG: string = 'Card2Component'; | ||
| 18 | @Component | 19 | @Component |
| 19 | export struct CardAdvThreeImageComponent { | 20 | export struct CardAdvThreeImageComponent { |
| 20 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | + @State loadImg: boolean = false; | ||
| 21 | pageModel: PageModel = new PageModel(); | 23 | pageModel: PageModel = new PageModel(); |
| 22 | - aboutToAppear(): void { | ||
| 23 | 24 | ||
| 25 | + async aboutToAppear(): Promise<void> { | ||
| 26 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 24 | } | 27 | } |
| 25 | 28 | ||
| 26 | aboutToDisappear(): void { | 29 | aboutToDisappear(): void { |
| @@ -43,7 +46,8 @@ export struct CardAdvThreeImageComponent { | @@ -43,7 +46,8 @@ export struct CardAdvThreeImageComponent { | ||
| 43 | ForEach(this.compDTO.matInfo.matImageUrl, (url: string, index: number) => { | 46 | ForEach(this.compDTO.matInfo.matImageUrl, (url: string, index: number) => { |
| 44 | if (index < 3) { | 47 | if (index < 3) { |
| 45 | GridCol({ span: { xs: 4 } }) { | 48 | GridCol({ span: { xs: 4 } }) { |
| 46 | - Image(url) | 49 | + Image(this.loadImg ? url : '') |
| 50 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 47 | .width('100%') | 51 | .width('100%') |
| 48 | .aspectRatio(113 / 75) | 52 | .aspectRatio(113 / 75) |
| 49 | .borderRadius({ | 53 | .borderRadius({ |
| @@ -62,7 +66,7 @@ export struct CardAdvThreeImageComponent { | @@ -62,7 +66,7 @@ export struct CardAdvThreeImageComponent { | ||
| 62 | .margin({ top: 8 }) | 66 | .margin({ top: 8 }) |
| 63 | 67 | ||
| 64 | // 广告工具组件 | 68 | // 广告工具组件 |
| 65 | - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('100%').margin({ top: 8 }) | 69 | + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).width('100%').margin({ top: 8 }) |
| 66 | } | 70 | } |
| 67 | .width('100%') | 71 | .width('100%') |
| 68 | .justifyContent(FlexAlign.Start) | 72 | .justifyContent(FlexAlign.Start) |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import { CompDTO, ContentDTO } from 'wdBean'; | 2 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 5 | import PageModel from '../../viewmodel/PageModel'; | 6 | import PageModel from '../../viewmodel/PageModel'; |
| 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 8 | import { CardAdvBottom } from './CardAdvBottom'; |
| @@ -20,11 +21,11 @@ const TAG: string = 'Card2Component'; | @@ -20,11 +21,11 @@ const TAG: string = 'Card2Component'; | ||
| 20 | export struct CardAdvVideoComponent { | 21 | export struct CardAdvVideoComponent { |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | @State contentDTO: ContentDTO = new ContentDTO() | 23 | @State contentDTO: ContentDTO = new ContentDTO() |
| 24 | + @State loadImg: boolean = false; | ||
| 23 | pageModel: PageModel = new PageModel(); | 25 | pageModel: PageModel = new PageModel(); |
| 24 | - aboutToAppear(): void { | ||
| 25 | 26 | ||
| 26 | - // this.contentDTO.objectType = '1' | ||
| 27 | - // this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO | 27 | + async aboutToAppear(): Promise<void> { |
| 28 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | aboutToDisappear(): void { | 31 | aboutToDisappear(): void { |
| @@ -39,7 +40,8 @@ export struct CardAdvVideoComponent { | @@ -39,7 +40,8 @@ export struct CardAdvVideoComponent { | ||
| 39 | Text(this.compDTO.matInfo.advTitle).bottomTextStyle() | 40 | Text(this.compDTO.matInfo.advTitle).bottomTextStyle() |
| 40 | //大图 | 41 | //大图 |
| 41 | Stack() { | 42 | Stack() { |
| 42 | - Image(this.compDTO.matInfo.matImageUrl[0]) | 43 | + Image(this.loadImg ? this.compDTO.matInfo.matImageUrl[0] : '') |
| 44 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 43 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 44 | .aspectRatio(16 / 9) | 46 | .aspectRatio(16 / 9) |
| 45 | .borderRadius(4) | 47 | .borderRadius(4) |
| @@ -54,7 +56,7 @@ export struct CardAdvVideoComponent { | @@ -54,7 +56,7 @@ export struct CardAdvVideoComponent { | ||
| 54 | .width(CommonConstants.FULL_WIDTH) | 56 | .width(CommonConstants.FULL_WIDTH) |
| 55 | .margin({ top: 8 }) | 57 | .margin({ top: 8 }) |
| 56 | 58 | ||
| 57 | - CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({ | 59 | + CardAdvBottom({ pageModel: this.pageModel, compDTO: this.compDTO }).margin({ |
| 58 | top: 8, | 60 | top: 8, |
| 59 | }) | 61 | }) |
| 60 | } | 62 | } |
| @@ -3,6 +3,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | @@ -3,6 +3,7 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | ||
| 3 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 3 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 6 | import PageModel from '../../viewmodel/PageModel'; | 7 | import PageModel from '../../viewmodel/PageModel'; |
| 7 | import { CardAdvTop } from './CardAdvTop'; | 8 | import { CardAdvTop } from './CardAdvTop'; |
| 8 | 9 | ||
| @@ -21,9 +22,10 @@ export struct CardAdvVideoExComponent { | @@ -21,9 +22,10 @@ export struct CardAdvVideoExComponent { | ||
| 21 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | @State advExtraData: AdvExtraData = {} as AdvExtraData | 23 | @State advExtraData: AdvExtraData = {} as AdvExtraData |
| 23 | pageModel: PageModel = new PageModel(); | 24 | pageModel: PageModel = new PageModel(); |
| 25 | + @State loadImg: boolean = false; | ||
| 24 | 26 | ||
| 25 | - aboutToAppear(): void { | ||
| 26 | - | 27 | + async aboutToAppear(): Promise<void> { |
| 28 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 27 | 29 | ||
| 28 | let extraData = this.compDTO.matInfo.extraData | 30 | let extraData = this.compDTO.matInfo.extraData |
| 29 | let labelDTO = JSON.parse(extraData) as AdvExtraData | 31 | let labelDTO = JSON.parse(extraData) as AdvExtraData |
| @@ -40,13 +42,17 @@ export struct CardAdvVideoExComponent { | @@ -40,13 +42,17 @@ export struct CardAdvVideoExComponent { | ||
| 40 | 42 | ||
| 41 | Stack() { | 43 | Stack() { |
| 42 | //长图 | 44 | //长图 |
| 43 | - Image(this.advExtraData.itemTopImage) | 45 | + Image(this.loadImg ? this.advExtraData.itemTopImage : '') |
| 44 | .width(CommonConstants.FULL_WIDTH) | 46 | .width(CommonConstants.FULL_WIDTH) |
| 47 | + .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | ||
| 45 | .aspectRatio(343 / 80) | 48 | .aspectRatio(343 / 80) |
| 46 | .borderRadius(4) | 49 | .borderRadius(4) |
| 47 | .borderWidth(0.5) | 50 | .borderWidth(0.5) |
| 48 | .borderColor($r('app.color.color_0D000000')) | 51 | .borderColor($r('app.color.color_0D000000')) |
| 52 | + .onClick(() => { | ||
| 53 | + ProcessUtils.openAdvDetail(this.compDTO.matInfo) | ||
| 49 | 54 | ||
| 55 | + }) | ||
| 50 | 56 | ||
| 51 | CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO }) | 57 | CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 52 | } | 58 | } |
| @@ -74,7 +80,7 @@ export struct CardAdvVideoExComponent { | @@ -74,7 +80,7 @@ export struct CardAdvVideoExComponent { | ||
| 74 | }.width('100%').listDirection(Axis.Vertical).margin({ top: 10, bottom: 10 }) | 80 | }.width('100%').listDirection(Axis.Vertical).margin({ top: 10, bottom: 10 }) |
| 75 | 81 | ||
| 76 | // 更多按钮 | 82 | // 更多按钮 |
| 77 | - commonButton(this.advExtraData) | 83 | + this.commonButton() |
| 78 | 84 | ||
| 79 | } | 85 | } |
| 80 | .width(CommonConstants.FULL_WIDTH) | 86 | .width(CommonConstants.FULL_WIDTH) |
| @@ -86,14 +92,12 @@ export struct CardAdvVideoExComponent { | @@ -86,14 +92,12 @@ export struct CardAdvVideoExComponent { | ||
| 86 | }) | 92 | }) |
| 87 | 93 | ||
| 88 | } | 94 | } |
| 89 | -} | ||
| 90 | 95 | ||
| 91 | -/* | 96 | + /* |
| 92 | 标题样式 | 97 | 标题样式 |
| 93 | */ | 98 | */ |
| 94 | -@Builder | ||
| 95 | -function commonButton(advExtraData: AdvExtraData) { | ||
| 96 | - | 99 | + @Builder |
| 100 | + commonButton() { | ||
| 97 | 101 | ||
| 98 | Row() { | 102 | Row() { |
| 99 | Blank() | 103 | Blank() |
| @@ -108,9 +112,11 @@ function commonButton(advExtraData: AdvExtraData) { | @@ -108,9 +112,11 @@ function commonButton(advExtraData: AdvExtraData) { | ||
| 108 | .padding({ top: 10, bottom: 10, }) | 112 | .padding({ top: 10, bottom: 10, }) |
| 109 | .onClick(() => { | 113 | .onClick(() => { |
| 110 | let matInfo: CompAdvMatInfoBean = { | 114 | let matInfo: CompAdvMatInfoBean = { |
| 111 | - linkUrl: advExtraData.itemMore.linkUrl, | ||
| 112 | - linkType: advExtraData.itemMore.linkType | 115 | + linkUrl: this.advExtraData.itemMore.linkUrl, |
| 116 | + linkType: this.advExtraData.itemMore.linkType | ||
| 113 | } as CompAdvMatInfoBean; | 117 | } as CompAdvMatInfoBean; |
| 114 | ProcessUtils.openAdvDetail(matInfo) | 118 | ProcessUtils.openAdvDetail(matInfo) |
| 115 | }) | 119 | }) |
| 120 | + } | ||
| 116 | } | 121 | } |
| 122 | + |
| @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant'; | @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card11Component'; | 10 | const TAG = 'Card11Component'; |
| 10 | 11 | ||
| @@ -23,6 +24,7 @@ export struct Card11Component { | @@ -23,6 +24,7 @@ export struct Card11Component { | ||
| 23 | 24 | ||
| 24 | async aboutToAppear(): Promise<void> { | 25 | async aboutToAppear(): Promise<void> { |
| 25 | this.titleInit(); | 26 | this.titleInit(); |
| 27 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | titleInit() { | 30 | titleInit() { |
| @@ -76,8 +78,8 @@ export struct Card11Component { | @@ -76,8 +78,8 @@ export struct Card11Component { | ||
| 76 | }) | 78 | }) |
| 77 | .backgroundColor($r("app.color.white")) | 79 | .backgroundColor($r("app.color.white")) |
| 78 | .onClick((event: ClickEvent) => { | 80 | .onClick((event: ClickEvent) => { |
| 79 | - | ||
| 80 | this.clicked = true; | 81 | this.clicked = true; |
| 82 | + persistentStorage(this.contentDTO.objectId); | ||
| 81 | ProcessUtils.processPage(this.contentDTO) | 83 | ProcessUtils.processPage(this.contentDTO) |
| 82 | }) | 84 | }) |
| 83 | } | 85 | } |
| @@ -4,6 +4,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | @@ -4,6 +4,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 7 | 8 | ||
| 8 | const TAG = 'Card12Component'; | 9 | const TAG = 'Card12Component'; |
| 9 | 10 | ||
| @@ -21,6 +22,7 @@ export struct Card12Component { | @@ -21,6 +22,7 @@ export struct Card12Component { | ||
| 21 | 22 | ||
| 22 | aboutToAppear(): void { | 23 | aboutToAppear(): void { |
| 23 | this.titleInit(); | 24 | this.titleInit(); |
| 25 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | titleInit() { | 28 | titleInit() { |
| @@ -69,6 +71,7 @@ export struct Card12Component { | @@ -69,6 +71,7 @@ export struct Card12Component { | ||
| 69 | }) | 71 | }) |
| 70 | .onClick((event: ClickEvent) => { | 72 | .onClick((event: ClickEvent) => { |
| 71 | this.clicked = true; | 73 | this.clicked = true; |
| 74 | + persistentStorage(this.contentDTO.objectId); | ||
| 72 | ProcessUtils.processPage(this.contentDTO) | 75 | ProcessUtils.processPage(this.contentDTO) |
| 73 | }) | 76 | }) |
| 74 | } | 77 | } |
| @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card14Component'; | 10 | const TAG = 'Card14Component'; |
| 10 | 11 | ||
| @@ -23,6 +24,7 @@ export struct Card14Component { | @@ -23,6 +24,7 @@ export struct Card14Component { | ||
| 23 | 24 | ||
| 24 | async aboutToAppear(): Promise<void> { | 25 | async aboutToAppear(): Promise<void> { |
| 25 | this.titleInit(); | 26 | this.titleInit(); |
| 27 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 26 | this.loadImg = await onlyWifiLoadImg(); | 28 | this.loadImg = await onlyWifiLoadImg(); |
| 27 | } | 29 | } |
| 28 | 30 | ||
| @@ -88,6 +90,7 @@ export struct Card14Component { | @@ -88,6 +90,7 @@ export struct Card14Component { | ||
| 88 | }) | 90 | }) |
| 89 | .onClick((event: ClickEvent) => { | 91 | .onClick((event: ClickEvent) => { |
| 90 | this.clicked = true; | 92 | this.clicked = true; |
| 93 | + persistentStorage(this.contentDTO.objectId); | ||
| 91 | ProcessUtils.processPage(this.contentDTO) | 94 | ProcessUtils.processPage(this.contentDTO) |
| 92 | }) | 95 | }) |
| 93 | } | 96 | } |
| @@ -5,6 +5,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | @@ -5,6 +5,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 5 | import { CommonConstants } from 'wdConstant/Index'; | 5 | import { CommonConstants } from 'wdConstant/Index'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG: string = 'Card15Component'; | 10 | const TAG: string = 'Card15Component'; |
| 10 | 11 | ||
| @@ -27,6 +28,7 @@ export struct Card15Component { | @@ -27,6 +28,7 @@ export struct Card15Component { | ||
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 29 | this.titleInit(); | 30 | this.titleInit(); |
| 31 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 30 | this.loadImg = await onlyWifiLoadImg(); | 32 | this.loadImg = await onlyWifiLoadImg(); |
| 31 | } | 33 | } |
| 32 | 34 | ||
| @@ -85,6 +87,7 @@ export struct Card15Component { | @@ -85,6 +87,7 @@ export struct Card15Component { | ||
| 85 | }) | 87 | }) |
| 86 | .onClick((event: ClickEvent) => { | 88 | .onClick((event: ClickEvent) => { |
| 87 | this.clicked = true; | 89 | this.clicked = true; |
| 90 | + persistentStorage(this.contentDTO.objectId); | ||
| 88 | ProcessUtils.processPage(this.contentDTO) | 91 | ProcessUtils.processPage(this.contentDTO) |
| 89 | }) | 92 | }) |
| 90 | } | 93 | } |
| @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card16Component'; | 10 | const TAG = 'Card16Component'; |
| 10 | 11 | ||
| @@ -28,6 +29,7 @@ export struct Card16Component { | @@ -28,6 +29,7 @@ export struct Card16Component { | ||
| 28 | 29 | ||
| 29 | async aboutToAppear(): Promise<void> { | 30 | async aboutToAppear(): Promise<void> { |
| 30 | this.titleInit(); | 31 | this.titleInit(); |
| 32 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | } | 34 | } |
| 33 | 35 | ||
| @@ -87,6 +89,7 @@ export struct Card16Component { | @@ -87,6 +89,7 @@ export struct Card16Component { | ||
| 87 | }) | 89 | }) |
| 88 | .onClick((event: ClickEvent) => { | 90 | .onClick((event: ClickEvent) => { |
| 89 | this.clicked = true; | 91 | this.clicked = true; |
| 92 | + persistentStorage(this.contentDTO.objectId); | ||
| 90 | ProcessUtils.processPage(this.contentDTO) | 93 | ProcessUtils.processPage(this.contentDTO) |
| 91 | }) | 94 | }) |
| 92 | } | 95 | } |
| @@ -5,6 +5,7 @@ import { WDRouterRule } from 'wdRouter'; | @@ -5,6 +5,7 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 5 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 5 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card17Component'; | 10 | const TAG = 'Card17Component'; |
| 10 | 11 | ||
| @@ -24,6 +25,7 @@ export struct Card17Component { | @@ -24,6 +25,7 @@ export struct Card17Component { | ||
| 24 | 25 | ||
| 25 | async aboutToAppear(): Promise<void> { | 26 | async aboutToAppear(): Promise<void> { |
| 26 | this.titleInit(); | 27 | this.titleInit(); |
| 28 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 27 | this.loadImg = await onlyWifiLoadImg(); | 29 | this.loadImg = await onlyWifiLoadImg(); |
| 28 | } | 30 | } |
| 29 | 31 | ||
| @@ -105,6 +107,7 @@ export struct Card17Component { | @@ -105,6 +107,7 @@ export struct Card17Component { | ||
| 105 | .width(CommonConstants.FULL_WIDTH) | 107 | .width(CommonConstants.FULL_WIDTH) |
| 106 | .onClick((event: ClickEvent) => { | 108 | .onClick((event: ClickEvent) => { |
| 107 | this.clicked = true; | 109 | this.clicked = true; |
| 110 | + persistentStorage(this.contentDTO.objectId); | ||
| 108 | let taskAction: Action = { | 111 | let taskAction: Action = { |
| 109 | type: 'JUMP_DETAIL_PAGE', | 112 | type: 'JUMP_DETAIL_PAGE', |
| 110 | params: { | 113 | params: { |
| @@ -4,6 +4,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -4,6 +4,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { CarderInteraction } from '../CarderInteraction' | 5 | import { CarderInteraction } from '../CarderInteraction' |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 7 | 8 | ||
| 8 | const TAG = 'Card19Component'; | 9 | const TAG = 'Card19Component'; |
| 9 | 10 | ||
| @@ -21,6 +22,7 @@ export struct Card19Component { | @@ -21,6 +22,7 @@ export struct Card19Component { | ||
| 21 | 22 | ||
| 22 | async aboutToAppear(): Promise<void> { | 23 | async aboutToAppear(): Promise<void> { |
| 23 | this.titleInit(); | 24 | this.titleInit(); |
| 25 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 24 | console.log('card19',JSON.stringify(this.contentDTO)) | 26 | console.log('card19',JSON.stringify(this.contentDTO)) |
| 25 | } | 27 | } |
| 26 | 28 | ||
| @@ -74,6 +76,7 @@ export struct Card19Component { | @@ -74,6 +76,7 @@ export struct Card19Component { | ||
| 74 | }) | 76 | }) |
| 75 | .onClick((event: ClickEvent) => { | 77 | .onClick((event: ClickEvent) => { |
| 76 | this.clicked = true; | 78 | this.clicked = true; |
| 79 | + persistentStorage(this.contentDTO.objectId); | ||
| 77 | ProcessUtils.processPage(this.contentDTO) | 80 | ProcessUtils.processPage(this.contentDTO) |
| 78 | }) | 81 | }) |
| 79 | } | 82 | } |
| @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -5,6 +5,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card20Component'; | 10 | const TAG = 'Card20Component'; |
| 10 | 11 | ||
| @@ -22,6 +23,7 @@ export struct Card20Component { | @@ -22,6 +23,7 @@ export struct Card20Component { | ||
| 22 | 23 | ||
| 23 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 24 | this.titleInit(); | 25 | this.titleInit(); |
| 26 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | titleInit() { | 29 | titleInit() { |
| @@ -71,6 +73,7 @@ export struct Card20Component { | @@ -71,6 +73,7 @@ export struct Card20Component { | ||
| 71 | }) | 73 | }) |
| 72 | .onClick((event: ClickEvent) => { | 74 | .onClick((event: ClickEvent) => { |
| 73 | this.clicked = true; | 75 | this.clicked = true; |
| 76 | + persistentStorage(this.contentDTO.objectId); | ||
| 74 | ProcessUtils.processPage(this.contentDTO) | 77 | ProcessUtils.processPage(this.contentDTO) |
| 75 | }) | 78 | }) |
| 76 | } | 79 | } |
| @@ -5,6 +5,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle' | @@ -5,6 +5,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle' | ||
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | 9 | ||
| 9 | const TAG: string = 'Card6Component-Card13Component'; | 10 | const TAG: string = 'Card6Component-Card13Component'; |
| 10 | 11 | ||
| @@ -23,6 +24,7 @@ export struct Card21Component { | @@ -23,6 +24,7 @@ export struct Card21Component { | ||
| 23 | 24 | ||
| 24 | async aboutToAppear(): Promise<void> { | 25 | async aboutToAppear(): Promise<void> { |
| 25 | this.titleInit(); | 26 | this.titleInit(); |
| 27 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 26 | this.loadImg = await onlyWifiLoadImg(); | 28 | this.loadImg = await onlyWifiLoadImg(); |
| 27 | } | 29 | } |
| 28 | 30 | ||
| @@ -79,6 +81,7 @@ export struct Card21Component { | @@ -79,6 +81,7 @@ export struct Card21Component { | ||
| 79 | } | 81 | } |
| 80 | .onClick((event: ClickEvent) => { | 82 | .onClick((event: ClickEvent) => { |
| 81 | this.clicked = true; | 83 | this.clicked = true; |
| 84 | + persistentStorage(this.contentDTO.objectId); | ||
| 82 | ProcessUtils.processPage(this.contentDTO) | 85 | ProcessUtils.processPage(this.contentDTO) |
| 83 | }) | 86 | }) |
| 84 | .padding({ | 87 | .padding({ |
| @@ -7,7 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | @@ -7,7 +7,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | ||
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | 9 | ||
| 10 | -// import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 10 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 11 | const TAG: string = 'Card2Component'; | 11 | const TAG: string = 'Card2Component'; |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| @@ -29,9 +29,9 @@ export struct Card2Component { | @@ -29,9 +29,9 @@ export struct Card2Component { | ||
| 29 | @State str03: string = ''; | 29 | @State str03: string = ''; |
| 30 | 30 | ||
| 31 | async aboutToAppear(): Promise<void> { | 31 | async aboutToAppear(): Promise<void> { |
| 32 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 32 | this.titleInit(); | 33 | this.titleInit(); |
| 33 | this.loadImg = await onlyWifiLoadImg(); | 34 | this.loadImg = await onlyWifiLoadImg(); |
| 34 | - // this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | titleInit() { | 37 | titleInit() { |
| @@ -109,7 +109,7 @@ export struct Card2Component { | @@ -109,7 +109,7 @@ export struct Card2Component { | ||
| 109 | }) | 109 | }) |
| 110 | .onClick((event: ClickEvent) => { | 110 | .onClick((event: ClickEvent) => { |
| 111 | this.clicked = true; | 111 | this.clicked = true; |
| 112 | - // persistentStorage(this.contentDTO.objectId); | 112 | + persistentStorage(this.contentDTO.objectId); |
| 113 | ProcessUtils.processPage(this.contentDTO) | 113 | ProcessUtils.processPage(this.contentDTO) |
| 114 | }) | 114 | }) |
| 115 | } | 115 | } |
| @@ -3,6 +3,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; | @@ -3,6 +3,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 卡片样式:"appStyle":"3" | 9 | * 卡片样式:"appStyle":"3" |
| @@ -20,7 +21,7 @@ export struct Card3Component { | @@ -20,7 +21,7 @@ export struct Card3Component { | ||
| 20 | 21 | ||
| 21 | async aboutToAppear(): Promise<void> { | 22 | async aboutToAppear(): Promise<void> { |
| 22 | this.titleInit(); | 23 | this.titleInit(); |
| 23 | - // this.clicked = hasClicked(this.contentDTO.objectId) | 24 | + this.clicked = hasClicked(this.contentDTO.objectId) |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | titleInit() { | 27 | titleInit() { |
| @@ -71,6 +72,7 @@ export struct Card3Component { | @@ -71,6 +72,7 @@ export struct Card3Component { | ||
| 71 | }) | 72 | }) |
| 72 | .onClick((event: ClickEvent) => { | 73 | .onClick((event: ClickEvent) => { |
| 73 | this.clicked = true; | 74 | this.clicked = true; |
| 75 | + persistentStorage(this.contentDTO.objectId); | ||
| 74 | ProcessUtils.processPage(this.contentDTO) | 76 | ProcessUtils.processPage(this.contentDTO) |
| 75 | }) | 77 | }) |
| 76 | } | 78 | } |
| @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 8 | const TAG: string = 'Card4Component'; | 9 | const TAG: string = 'Card4Component'; |
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| @@ -26,6 +27,7 @@ export struct Card4Component { | @@ -26,6 +27,7 @@ export struct Card4Component { | ||
| 26 | @ObjectLink compDTO: CompDTO | 27 | @ObjectLink compDTO: CompDTO |
| 27 | 28 | ||
| 28 | async aboutToAppear(): Promise<void> { | 29 | async aboutToAppear(): Promise<void> { |
| 30 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 29 | this.titleInit(); | 31 | this.titleInit(); |
| 30 | this.loadImg = await onlyWifiLoadImg(); | 32 | this.loadImg = await onlyWifiLoadImg(); |
| 31 | } | 33 | } |
| @@ -102,6 +104,7 @@ export struct Card4Component { | @@ -102,6 +104,7 @@ export struct Card4Component { | ||
| 102 | .alignItems(HorizontalAlign.Start) | 104 | .alignItems(HorizontalAlign.Start) |
| 103 | .onClick((event: ClickEvent) => { | 105 | .onClick((event: ClickEvent) => { |
| 104 | this.clicked = true; | 106 | this.clicked = true; |
| 107 | + persistentStorage(this.contentDTO.objectId); | ||
| 105 | ProcessUtils.processPage(this.contentDTO) | 108 | ProcessUtils.processPage(this.contentDTO) |
| 106 | }) | 109 | }) |
| 107 | //bottom 评论等信息 | 110 | //bottom 评论等信息 |
| @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant'; | @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant'; | ||
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 6 | 7 | ||
| 7 | const TAG: string = 'Card5Component'; | 8 | const TAG: string = 'Card5Component'; |
| 8 | 9 | ||
| @@ -21,6 +22,7 @@ export struct Card5Component { | @@ -21,6 +22,7 @@ export struct Card5Component { | ||
| 21 | @State str03: string = ''; | 22 | @State str03: string = ''; |
| 22 | 23 | ||
| 23 | async aboutToAppear(): Promise<void> { | 24 | async aboutToAppear(): Promise<void> { |
| 25 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 24 | this.loadImg = await onlyWifiLoadImg(); | 26 | this.loadImg = await onlyWifiLoadImg(); |
| 25 | 27 | ||
| 26 | this.titleInit(); | 28 | this.titleInit(); |
| @@ -95,6 +97,7 @@ export struct Card5Component { | @@ -95,6 +97,7 @@ export struct Card5Component { | ||
| 95 | }) | 97 | }) |
| 96 | .onClick((event: ClickEvent) => { | 98 | .onClick((event: ClickEvent) => { |
| 97 | this.clicked = true; | 99 | this.clicked = true; |
| 100 | + persistentStorage(this.contentDTO.objectId); | ||
| 98 | ProcessUtils.processPage(this.contentDTO) | 101 | ProcessUtils.processPage(this.contentDTO) |
| 99 | }) | 102 | }) |
| 100 | 103 |
| @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | ||
| 6 | import { Notes } from './notes'; | 6 | import { Notes } from './notes'; |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { Logger } from 'wdKit/Index'; | 8 | import { Logger } from 'wdKit/Index'; |
| 9 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 9 | 10 | ||
| 10 | const TAG: string = 'Card6Component-Card13Component'; | 11 | const TAG: string = 'Card6Component-Card13Component'; |
| 11 | 12 | ||
| @@ -26,7 +27,7 @@ export struct Card6Component { | @@ -26,7 +27,7 @@ export struct Card6Component { | ||
| 26 | async aboutToAppear(): Promise<void> { | 27 | async aboutToAppear(): Promise<void> { |
| 27 | this.titleInit(); | 28 | this.titleInit(); |
| 28 | this.loadImg = await onlyWifiLoadImg(); | 29 | this.loadImg = await onlyWifiLoadImg(); |
| 29 | - // this.clicked = hasClicked(this.contentDTO.objectId) | 30 | + this.clicked = hasClicked(this.contentDTO.objectId) |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | titleInit() { | 33 | titleInit() { |
| @@ -104,7 +105,7 @@ export struct Card6Component { | @@ -104,7 +105,7 @@ export struct Card6Component { | ||
| 104 | } | 105 | } |
| 105 | .onClick((event: ClickEvent) => { | 106 | .onClick((event: ClickEvent) => { |
| 106 | this.clicked = true; | 107 | this.clicked = true; |
| 107 | - // persistentStorage(this.contentDTO.objectId); | 108 | + persistentStorage(this.contentDTO.objectId); |
| 108 | ProcessUtils.processPage(this.contentDTO) | 109 | ProcessUtils.processPage(this.contentDTO) |
| 109 | }) | 110 | }) |
| 110 | .padding({ | 111 | .padding({ |
| @@ -4,6 +4,7 @@ import { DateTimeUtils } from 'wdKit'; | @@ -4,6 +4,7 @@ import { DateTimeUtils } from 'wdKit'; | ||
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | +import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 时间链卡--CompStyle: 09 | 10 | * 时间链卡--CompStyle: 09 |
| @@ -23,6 +24,7 @@ export struct Card9Component { | @@ -23,6 +24,7 @@ export struct Card9Component { | ||
| 23 | async aboutToAppear(): Promise<void> { | 24 | async aboutToAppear(): Promise<void> { |
| 24 | this.titleInit(); | 25 | this.titleInit(); |
| 25 | // this.loadImg = await onlyWifiLoadImg(); | 26 | // this.loadImg = await onlyWifiLoadImg(); |
| 27 | + this.clicked = hasClicked(this.contentDTO.objectId) | ||
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | titleInit() { | 30 | titleInit() { |
| @@ -111,6 +113,7 @@ export struct Card9Component { | @@ -111,6 +113,7 @@ export struct Card9Component { | ||
| 111 | .margin({ bottom: 8 }) | 113 | .margin({ bottom: 8 }) |
| 112 | .onClick((event: ClickEvent) => { | 114 | .onClick((event: ClickEvent) => { |
| 113 | this.clicked = true; | 115 | this.clicked = true; |
| 116 | + persistentStorage(this.contentDTO.objectId); | ||
| 114 | ProcessUtils.processPage(this.contentDTO) | 117 | ProcessUtils.processPage(this.contentDTO) |
| 115 | }) | 118 | }) |
| 116 | } | 119 | } |
| @@ -140,7 +143,7 @@ export struct Card9Component { | @@ -140,7 +143,7 @@ export struct Card9Component { | ||
| 140 | // 标题 | 143 | // 标题 |
| 141 | Image($r("app.media.timeAxis")) | 144 | Image($r("app.media.timeAxis")) |
| 142 | .width(9) | 145 | .width(9) |
| 143 | - .height(9) | 146 | + .height(6) |
| 144 | .margin({ right: 5 }) | 147 | .margin({ right: 5 }) |
| 145 | .fillColor(item.newsTitleColor) | 148 | .fillColor(item.newsTitleColor) |
| 146 | 149 | ||
| @@ -163,6 +166,7 @@ export struct Card9Component { | @@ -163,6 +166,7 @@ export struct Card9Component { | ||
| 163 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 166 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 164 | .alignSelf(ItemAlign.Center) | 167 | .alignSelf(ItemAlign.Center) |
| 165 | .margin({ left: 12 }) | 168 | .margin({ left: 12 }) |
| 169 | + // .padding({bottom: 20}) | ||
| 166 | // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | 170 | // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { |
| 167 | // Image(this.loadImg? item.fullColumnImgUrls[0].url : '') | 171 | // Image(this.loadImg? item.fullColumnImgUrls[0].url : '') |
| 168 | // .backgroundColor(0xf5f5f5) | 172 | // .backgroundColor(0xf5f5f5) |
| @@ -175,7 +179,7 @@ export struct Card9Component { | @@ -175,7 +179,7 @@ export struct Card9Component { | ||
| 175 | } | 179 | } |
| 176 | .alignContent(Alignment.TopStart) | 180 | .alignContent(Alignment.TopStart) |
| 177 | } | 181 | } |
| 178 | - .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78) | 182 | + .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50) |
| 179 | .alignItems(HorizontalAlign.Start) | 183 | .alignItems(HorizontalAlign.Start) |
| 180 | } | 184 | } |
| 181 | } | 185 | } |
| @@ -422,12 +422,13 @@ struct footerExpandedView { | @@ -422,12 +422,13 @@ struct footerExpandedView { | ||
| 422 | build() { | 422 | build() { |
| 423 | Row() { | 423 | Row() { |
| 424 | if (this.item.expanded) { | 424 | if (this.item.expanded) { |
| 425 | - if (this.item.childsHasMore) { | ||
| 426 | Row() { | 425 | Row() { |
| 427 | Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) | 426 | Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) |
| 428 | - Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 }) | 427 | + if (this.item.childsHasMore) { |
| 428 | + Row() { | ||
| 429 | + Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14) | ||
| 429 | Image($r('app.media.comment_unfold')).width(12).height(12) | 430 | Image($r('app.media.comment_unfold')).width(12).height(12) |
| 430 | - }.margin({ left: 53 }) | 431 | + }.margin({ left: 6 }) |
| 431 | .onClick(() => { | 432 | .onClick(() => { |
| 432 | if (this.item.isLoading) { | 433 | if (this.item.isLoading) { |
| 433 | return | 434 | return |
| @@ -439,13 +440,14 @@ struct footerExpandedView { | @@ -439,13 +440,14 @@ struct footerExpandedView { | ||
| 439 | Row() { | 440 | Row() { |
| 440 | Text('收起').fontColor($r('app.color.color_222222')).fontSize(14) | 441 | Text('收起').fontColor($r('app.color.color_222222')).fontSize(14) |
| 441 | Image($r('app.media.comment_pickUp')).width(12).height(12) | 442 | Image($r('app.media.comment_pickUp')).width(12).height(12) |
| 442 | - }.margin({ left: this.item.childsHasMore ? 32 : 213 }) | 443 | + }.margin({ left: 6 }) |
| 443 | .onClick(() => { | 444 | .onClick(() => { |
| 444 | this.item.pageNum = 1 | 445 | this.item.pageNum = 1 |
| 445 | this.item.expanded = false | 446 | this.item.expanded = false |
| 446 | this.item.childComments = [] | 447 | this.item.childComments = [] |
| 447 | this.item.childCommentsLazyDataSource.clear() | 448 | this.item.childCommentsLazyDataSource.clear() |
| 448 | }) | 449 | }) |
| 450 | + }.margin({ left: 53 }) | ||
| 449 | } else { | 451 | } else { |
| 450 | Row() { | 452 | Row() { |
| 451 | Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) | 453 | Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1) |
| @@ -568,6 +570,7 @@ struct commentHeaderView { | @@ -568,6 +570,7 @@ struct commentHeaderView { | ||
| 568 | publishCommentModel: this.publishCommentModel | 570 | publishCommentModel: this.publishCommentModel |
| 569 | }).margin({ left: 59, right: 16 }) | 571 | }).margin({ left: 59, right: 16 }) |
| 570 | }.alignItems(HorizontalAlign.Start) | 572 | }.alignItems(HorizontalAlign.Start) |
| 573 | + .padding({bottom: 8}) | ||
| 571 | } | 574 | } |
| 572 | 575 | ||
| 573 | replyComment() { | 576 | replyComment() { |
| @@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index' | @@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index' | ||
| 9 | export struct CommentTabComponent { | 9 | export struct CommentTabComponent { |
| 10 | private onCommentFocus: () => void = () => { | 10 | private onCommentFocus: () => void = () => { |
| 11 | } | 11 | } |
| 12 | - private onLoad: (dialogController: CustomDialogController) => void = () => { | 12 | + private onLoad: (dialogController: CustomDialogController | null) => void = () => { |
| 13 | } | 13 | } |
| 14 | @ObjectLink publishCommentModel: publishCommentModel | 14 | @ObjectLink publishCommentModel: publishCommentModel |
| 15 | @Prop contentDetail: ContentDetailDTO | 15 | @Prop contentDetail: ContentDetailDTO |
| @@ -129,8 +129,10 @@ export struct CommentText { | @@ -129,8 +129,10 @@ export struct CommentText { | ||
| 129 | // Stack({ alignContent: Alignment.BottomEnd }) { | 129 | // Stack({ alignContent: Alignment.BottomEnd }) { |
| 130 | Text(this.longMessage) { | 130 | Text(this.longMessage) { |
| 131 | Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) | 131 | Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) |
| 132 | + .lineHeight(this.lineHeight) | ||
| 132 | Span(this.collapseText) | 133 | Span(this.collapseText) |
| 133 | .fontColor("#999999") | 134 | .fontColor("#999999") |
| 135 | + .lineHeight(this.lineHeight) | ||
| 134 | .onClick(() => { | 136 | .onClick(() => { |
| 135 | if (this.collapseText == collapseString) { | 137 | if (this.collapseText == collapseString) { |
| 136 | this.collapseText = uncollapseString; | 138 | this.collapseText = uncollapseString; |
| @@ -171,6 +173,7 @@ export struct CommentText { | @@ -171,6 +173,7 @@ export struct CommentText { | ||
| 171 | else { | 173 | else { |
| 172 | Text(this.longMessage) | 174 | Text(this.longMessage) |
| 173 | .width('100%') | 175 | .width('100%') |
| 176 | + .lineHeight(this.lineHeight) | ||
| 174 | .fontSize(this.fontSize) | 177 | .fontSize(this.fontSize) |
| 175 | .fontWeight(this.fontWeight) | 178 | .fontWeight(this.fontWeight) |
| 176 | .fontColor(this.fontColor) | 179 | .fontColor(this.fontColor) |
| @@ -139,7 +139,7 @@ export struct ZhSingleRow06 { | @@ -139,7 +139,7 @@ export struct ZhSingleRow06 { | ||
| 139 | .height(16) | 139 | .height(16) |
| 140 | .margin({right: 3}) | 140 | .margin({right: 3}) |
| 141 | 141 | ||
| 142 | - Text('点赞') | 142 | + Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞') |
| 143 | .fontSize(15) | 143 | .fontSize(15) |
| 144 | .fontColor(0x999999) | 144 | .fontColor(0x999999) |
| 145 | .onClick(() => { | 145 | .onClick(() => { |
| @@ -48,8 +48,8 @@ export struct MessageListUI { | @@ -48,8 +48,8 @@ export struct MessageListUI { | ||
| 48 | this.msgData.forEach((item) => { | 48 | this.msgData.forEach((item) => { |
| 49 | if (item.title == "预约消息") { | 49 | if (item.title == "预约消息") { |
| 50 | if (value.subscribeInfo != null) { | 50 | if (value.subscribeInfo != null) { |
| 51 | - if (value.subscribeInfo.title) { | ||
| 52 | - item.desc = value.subscribeInfo.title | 51 | + if (value.subscribeInfo.message) { |
| 52 | + item.desc = value.subscribeInfo.message | ||
| 53 | } | 53 | } |
| 54 | if (value.subscribeInfo.time) { | 54 | if (value.subscribeInfo.time) { |
| 55 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.subscribeInfo.time)+"") | 55 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.subscribeInfo.time)+"") |
| @@ -64,7 +64,7 @@ export struct MessageListUI { | @@ -64,7 +64,7 @@ export struct MessageListUI { | ||
| 64 | } | 64 | } |
| 65 | if (value.activeInfo != null) { | 65 | if (value.activeInfo != null) { |
| 66 | if (value.activeInfo.title) { | 66 | if (value.activeInfo.title) { |
| 67 | - item.desc = value.activeInfo.title | 67 | + item.desc = value.activeInfo.title.replace("null","") |
| 68 | } | 68 | } |
| 69 | if (value.activeInfo.time) { | 69 | if (value.activeInfo.time) { |
| 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") | 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") |
| @@ -72,8 +72,8 @@ export struct MessageListUI { | @@ -72,8 +72,8 @@ export struct MessageListUI { | ||
| 72 | } | 72 | } |
| 73 | }/*else if (item.title == "系统消息") { | 73 | }/*else if (item.title == "系统消息") { |
| 74 | if (value.systemInfo != null) { | 74 | if (value.systemInfo != null) { |
| 75 | - if (value.systemInfo.title) { | ||
| 76 | - item.desc = value.systemInfo.title | 75 | + if (value.systemInfo.message) { |
| 76 | + item.desc = value.systemInfo.message | ||
| 77 | } | 77 | } |
| 78 | if (value.systemInfo.time) { | 78 | if (value.systemInfo.time) { |
| 79 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "") | 79 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.systemInfo.time) + "") |
| @@ -84,11 +84,13 @@ export struct SubscribeListChildComponent{ | @@ -84,11 +84,13 @@ export struct SubscribeListChildComponent{ | ||
| 84 | 84 | ||
| 85 | }.backgroundColor($r('app.color.white')) | 85 | }.backgroundColor($r('app.color.white')) |
| 86 | .borderRadius("8lpx") | 86 | .borderRadius("8lpx") |
| 87 | + .height("336lpx") | ||
| 87 | .width("100%") | 88 | .width("100%") |
| 88 | .padding({left:"23lpx",right:"23lpx"}) | 89 | .padding({left:"23lpx",right:"23lpx"}) |
| 89 | } | 90 | } |
| 90 | .backgroundColor($r('app.color.color_F5F5F5')) | 91 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 91 | .width("100%") | 92 | .width("100%") |
| 93 | + .height("423lpx") | ||
| 92 | .padding({left:"31lpx",right:"31lpx"}) | 94 | .padding({left:"31lpx",right:"31lpx"}) |
| 93 | .alignItems(HorizontalAlign.Center) | 95 | .alignItems(HorizontalAlign.Center) |
| 94 | } | 96 | } |
| 1 | -import { LazyDataSource, StringUtils } from 'wdKit/Index'; | 1 | +import { LazyDataSource, NetworkUtil, StringUtils } from 'wdKit/Index'; |
| 2 | import { Remark, SubscribeMessageModel, | 2 | import { Remark, SubscribeMessageModel, |
| 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; | 3 | WDMessageCenterMessageType } from '../../../../model/InteractMessageModel'; |
| 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../../model/MinePageDatasModel'; |
| @@ -21,6 +21,8 @@ export struct SubscribeMessageComponent{ | @@ -21,6 +21,8 @@ export struct SubscribeMessageComponent{ | ||
| 21 | curPageNum: number = 1; | 21 | curPageNum: number = 1; |
| 22 | @State isGetRequest: boolean = false | 22 | @State isGetRequest: boolean = false |
| 23 | private scroller: Scroller = new Scroller(); | 23 | private scroller: Scroller = new Scroller(); |
| 24 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 25 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 24 | 26 | ||
| 25 | aboutToAppear() { | 27 | aboutToAppear() { |
| 26 | this.getNewPageData() | 28 | this.getNewPageData() |
| @@ -32,9 +34,27 @@ export struct SubscribeMessageComponent{ | @@ -32,9 +34,27 @@ export struct SubscribeMessageComponent{ | ||
| 32 | CustomTitleUI({ titleName: "预约消息" }) | 34 | CustomTitleUI({ titleName: "预约消息" }) |
| 33 | if (this.count == 0) { | 35 | if (this.count == 0) { |
| 34 | if (this.isGetRequest == true) { | 36 | if (this.isGetRequest == true) { |
| 37 | + if(this.isConnectNetwork){ | ||
| 35 | EmptyComponent({ emptyType: 5 }) | 38 | EmptyComponent({ emptyType: 5 }) |
| 36 | .height('100%') | 39 | .height('100%') |
| 37 | .width('100%') | 40 | .width('100%') |
| 41 | + }else{ | ||
| 42 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 43 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 44 | + if(this.isConnectNetwork){ | ||
| 45 | + this.curPageNum = 1; | ||
| 46 | + this.hasMore = true | ||
| 47 | + this.isGetRequest = false | ||
| 48 | + this.data.clear() | ||
| 49 | + | ||
| 50 | + if (!this.isLoading) { | ||
| 51 | + this.getNewPageData() | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + },}) | ||
| 55 | + .layoutWeight(1) | ||
| 56 | + .width('100%') | ||
| 57 | + } | ||
| 38 | } | 58 | } |
| 39 | } else { | 59 | } else { |
| 40 | CustomPullToRefresh({ | 60 | CustomPullToRefresh({ |
| @@ -60,6 +80,8 @@ export struct SubscribeMessageComponent{ | @@ -60,6 +80,8 @@ export struct SubscribeMessageComponent{ | ||
| 60 | } | 80 | } |
| 61 | } | 81 | } |
| 62 | }) | 82 | }) |
| 83 | + .width('100%') | ||
| 84 | + .margin({bottom:px2vp(this.bottomSafeHeight)}) | ||
| 63 | } | 85 | } |
| 64 | } | 86 | } |
| 65 | .backgroundColor($r('app.color.color_F9F9F9')) | 87 | .backgroundColor($r('app.color.color_F9F9F9')) |
| @@ -94,7 +116,7 @@ export struct SubscribeMessageComponent{ | @@ -94,7 +116,7 @@ export struct SubscribeMessageComponent{ | ||
| 94 | } | 116 | } |
| 95 | } | 117 | } |
| 96 | }.width('100%') | 118 | }.width('100%') |
| 97 | - .cachedCount(4) | 119 | + .height("100%") |
| 98 | .scrollBar(BarState.Off) | 120 | .scrollBar(BarState.Off) |
| 99 | .layoutWeight(1) | 121 | .layoutWeight(1) |
| 100 | } | 122 | } |
| 1 | import { BottomNavi, CommonConstants } from 'wdConstant'; | 1 | import { BottomNavi, CommonConstants } from 'wdConstant'; |
| 2 | -import { BottomNavDTO, NavigationBodyDTO, TopNavDTO } from 'wdBean'; | ||
| 3 | -import { EmitterEventId, EmitterUtils, Logger } from 'wdKit'; | 2 | +import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean'; |
| 3 | +import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit'; | ||
| 4 | import { TopNavigationComponent } from './TopNavigationComponent'; | 4 | import { TopNavigationComponent } from './TopNavigationComponent'; |
| 5 | import { MinePageComponent } from './MinePageComponent'; | 5 | import { MinePageComponent } from './MinePageComponent'; |
| 6 | import { CompUtils } from '../../utils/CompUtils'; | 6 | import { CompUtils } from '../../utils/CompUtils'; |
| 7 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; | 7 | import ChannelViewModel from '../../viewmodel/ChannelViewModel'; |
| 8 | import HomeChannelUtils, { AssignChannelParam } from 'wdRouter'; | 8 | import HomeChannelUtils, { AssignChannelParam } from 'wdRouter'; |
| 9 | import { VideoChannelPage } from './VideoChannelPage'; | 9 | import { VideoChannelPage } from './VideoChannelPage'; |
| 10 | +import { HttpUtils } from 'wdNetwork/Index'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'BottomNavigationComponent'; | 12 | const TAG = 'BottomNavigationComponent'; |
| 12 | let storage = LocalStorage.getShared(); | 13 | let storage = LocalStorage.getShared(); |
| @@ -98,6 +99,7 @@ export struct BottomNavigationComponent { | @@ -98,6 +99,7 @@ export struct BottomNavigationComponent { | ||
| 98 | }); | 99 | }); |
| 99 | 100 | ||
| 100 | } | 101 | } |
| 102 | + .zIndex(10) | ||
| 101 | .scrollable(false) | 103 | .scrollable(false) |
| 102 | .animationDuration(0) | 104 | .animationDuration(0) |
| 103 | .barHeight($r('app.float.bottom_navigation_barHeight')) | 105 | .barHeight($r('app.float.bottom_navigation_barHeight')) |
| @@ -132,6 +134,7 @@ export struct BottomNavigationComponent { | @@ -132,6 +134,7 @@ export struct BottomNavigationComponent { | ||
| 132 | .fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor) | 134 | .fontColor(this.currentNavIndex === index ? navItem.nameCColor : navItem.nameColor) |
| 133 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) | 135 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) |
| 134 | } | 136 | } |
| 137 | + .zIndex(10) | ||
| 135 | .height($r('app.float.bottom_navigation_barHeight')) | 138 | .height($r('app.float.bottom_navigation_barHeight')) |
| 136 | .hoverEffect(HoverEffect.Highlight) | 139 | .hoverEffect(HoverEffect.Highlight) |
| 137 | .onClick(() => { | 140 | .onClick(() => { |
| @@ -223,7 +226,7 @@ export struct BottomNavigationComponent { | @@ -223,7 +226,7 @@ export struct BottomNavigationComponent { | ||
| 223 | } | 226 | } |
| 224 | 227 | ||
| 225 | private getBottomDetail() { | 228 | private getBottomDetail() { |
| 226 | - // 1、获取顶导缓存数据 | 229 | + // // 1、获取顶导缓存数据 |
| 227 | // this.bottomNavList.forEach((value) => { | 230 | // this.bottomNavList.forEach((value) => { |
| 228 | // // 先用底导带回的list初始化 | 231 | // // 先用底导带回的list初始化 |
| 229 | // this.topNavMap[value.id] = value.topNavChannelList | 232 | // this.topNavMap[value.id] = value.topNavChannelList |
| @@ -247,11 +250,32 @@ export struct BottomNavigationComponent { | @@ -247,11 +250,32 @@ export struct BottomNavigationComponent { | ||
| 247 | 250 | ||
| 248 | private setData(data: NavigationBodyDTO) { | 251 | private setData(data: NavigationBodyDTO) { |
| 249 | Logger.debug(TAG, 'setData') | 252 | Logger.debug(TAG, 'setData') |
| 250 | - if (data && data.bottomNavList != null) { | ||
| 251 | - Logger.info(TAG, `setData, bottomNav.length: ${data.bottomNavList.length}`); | 253 | + if (data == null) { |
| 254 | + return | ||
| 255 | + } | ||
| 256 | + let list: BottomNavDTO[] = [] | ||
| 257 | + let userId: string = HttpUtils.getUserId() | ||
| 258 | + // 先匹配换肤 | ||
| 259 | + if (data.greyBottomNav != null && data.greyBottomNav.greyUserList != null && | ||
| 260 | + data.greyBottomNav.greyUserList.length > 0) { | ||
| 261 | + // data.greyBottomNav.greyUserList.includes(userId)不生效,直接用循环匹配 | ||
| 262 | + for (let i = 0; i < data.greyBottomNav.greyUserList.length; i++) { | ||
| 263 | + let id = data.greyBottomNav.greyUserList[i] | ||
| 264 | + if (id == userId) { | ||
| 265 | + list = data.greyBottomNav.bottomNavList | ||
| 266 | + break | ||
| 267 | + } | ||
| 268 | + } | ||
| 269 | + } | ||
| 270 | + // 没有匹配到换肤,则直接用data.bottomNavList | ||
| 271 | + if (list.length <= 0) { | ||
| 272 | + list = data.bottomNavList | ||
| 273 | + } | ||
| 274 | + if (list.length > 0) { | ||
| 275 | + Logger.info(TAG, `setData, bottomNav.length: ${list.length}`); | ||
| 252 | // 使用filter方法移除name为'服务'的项 | 276 | // 使用filter方法移除name为'服务'的项 |
| 253 | - data.bottomNavList = data.bottomNavList.filter(item => item.name !== '服务'); | ||
| 254 | - this.bottomNavList = data.bottomNavList | 277 | + list = list.filter(item => item.name !== '服务'); |
| 278 | + this.bottomNavList = list | ||
| 255 | } | 279 | } |
| 256 | } | 280 | } |
| 257 | } | 281 | } |
| @@ -12,7 +12,7 @@ export default struct NoMoreLayout { | @@ -12,7 +12,7 @@ export default struct NoMoreLayout { | ||
| 12 | Text($r('app.string.footer_text')) | 12 | Text($r('app.string.footer_text')) |
| 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) | 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) |
| 14 | .textAlign(TextAlign.Center) | 14 | .textAlign(TextAlign.Center) |
| 15 | - .fontColor('#CCCCCC') | 15 | + .fontColor('#999999') |
| 16 | .margin({bottom:40}) | 16 | .margin({bottom:40}) |
| 17 | } | 17 | } |
| 18 | .width(RefreshConstants.FULL_WIDTH) | 18 | .width(RefreshConstants.FULL_WIDTH) |
| @@ -38,9 +38,11 @@ struct PeopleShipHomePage { | @@ -38,9 +38,11 @@ struct PeopleShipHomePage { | ||
| 38 | @State attentionOpacity: boolean = false | 38 | @State attentionOpacity: boolean = false |
| 39 | @Provide topHeight: number = 286 | 39 | @Provide topHeight: number = 286 |
| 40 | @State isLoading: boolean = true | 40 | @State isLoading: boolean = true |
| 41 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 41 | 42 | ||
| 42 | build() { | 43 | build() { |
| 43 | Stack({ alignContent: Alignment.TopStart }) { | 44 | Stack({ alignContent: Alignment.TopStart }) { |
| 45 | + Stack({ alignContent: Alignment.Top }){ | ||
| 44 | // 顶部图片 | 46 | // 顶部图片 |
| 45 | Image($r('app.media.home_page_bg')) | 47 | Image($r('app.media.home_page_bg')) |
| 46 | .width('100%') | 48 | .width('100%') |
| @@ -48,6 +50,18 @@ struct PeopleShipHomePage { | @@ -48,6 +50,18 @@ struct PeopleShipHomePage { | ||
| 48 | .objectFit(ImageFit.Fill) | 50 | .objectFit(ImageFit.Fill) |
| 49 | .backgroundColor(Color.White) | 51 | .backgroundColor(Color.White) |
| 50 | .visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 52 | .visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 53 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 54 | + | ||
| 55 | + Row() | ||
| 56 | + .height(px2vp(this.topSafeHeight)) | ||
| 57 | + .width("100%") | ||
| 58 | + .backgroundColor($r('app.color.white')) | ||
| 59 | + .visibility(this.attentionOpacity ? 1 : 0) | ||
| 60 | + .opacity(this.topOpacity ) | ||
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + | ||
| 51 | 65 | ||
| 52 | Column(){ | 66 | Column(){ |
| 53 | // 头部返回 | 67 | // 头部返回 |
| @@ -109,7 +123,7 @@ struct PeopleShipHomePage { | @@ -109,7 +123,7 @@ struct PeopleShipHomePage { | ||
| 109 | }) | 123 | }) |
| 110 | } | 124 | } |
| 111 | 125 | ||
| 112 | - } | 126 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 113 | .alignItems(HorizontalAlign.Start) | 127 | .alignItems(HorizontalAlign.Start) |
| 114 | .justifyContent(FlexAlign.Start) | 128 | .justifyContent(FlexAlign.Start) |
| 115 | .width('100%') | 129 | .width('100%') |
| @@ -78,9 +78,12 @@ export struct PeopleShipHomeArticleListComponent { | @@ -78,9 +78,12 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 78 | 78 | ||
| 79 | List({scroller: this.scroller}) { | 79 | List({scroller: this.scroller}) { |
| 80 | // 下拉刷新 | 80 | // 下拉刷新 |
| 81 | - ForEach(this.arr, (item: ContentDTO) => { | 81 | + ForEach(this.arr, (item: ContentDTO, index: number) => { |
| 82 | ListItem() { | 82 | ListItem() { |
| 83 | + Column() { | ||
| 83 | CardParser({compDTO:new CompDTO, contentDTO: item }) | 84 | CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 85 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 86 | + } | ||
| 84 | }.width("100%") | 87 | }.width("100%") |
| 85 | .backgroundColor(Color.Transparent) | 88 | .backgroundColor(Color.Transparent) |
| 86 | }, (item: ContentDTO, index: number) => item.objectId + index.toString()) | 89 | }, (item: ContentDTO, index: number) => item.objectId + index.toString()) |
| 1 | -import { SPHelper } from 'wdKit/Index'; | 1 | +import { KVStoreHelper, SPHelper } from 'wdKit/Index'; |
| 2 | import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index'; | 2 | import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index'; |
| 3 | 3 | ||
| 4 | @CustomDialog | 4 | @CustomDialog |
| @@ -86,11 +86,16 @@ export struct EnvironmentCustomDialog { | @@ -86,11 +86,16 @@ export struct EnvironmentCustomDialog { | ||
| 86 | Button('确认') | 86 | Button('确认') |
| 87 | .margin({ top: 20 }) | 87 | .margin({ top: 20 }) |
| 88 | .onClick(() => { | 88 | .onClick(() => { |
| 89 | + new Promise<void>(() => { | ||
| 89 | // HttpUrlUtils.hostUrl = this.currentEnvironment | 90 | // HttpUrlUtils.hostUrl = this.currentEnvironment |
| 90 | SPHelper.default.saveSync('hostUrl', this.currentEnvironment); | 91 | SPHelper.default.saveSync('hostUrl', this.currentEnvironment); |
| 92 | + // 清首页缓存 | ||
| 93 | + KVStoreHelper.default.deleteAll() | ||
| 94 | + // TODO 清sp相关 | ||
| 91 | this.controller.close() | 95 | this.controller.close() |
| 92 | this.confirm() | 96 | this.confirm() |
| 93 | }) | 97 | }) |
| 98 | + }) | ||
| 94 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') | 99 | }.height(261).backgroundColor(Color.White).borderRadius(6).width('74%') |
| 95 | 100 | ||
| 96 | } | 101 | } |
| @@ -64,6 +64,7 @@ export struct OperRowListView { | @@ -64,6 +64,7 @@ export struct OperRowListView { | ||
| 64 | /** | 64 | /** |
| 65 | * 用于区分页面类型,在哪个页面嵌套就传相应的值 | 65 | * 用于区分页面类型,在哪个页面嵌套就传相应的值 |
| 66 | * 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页 | 66 | * 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页 |
| 67 | + * 8: 评论弹框内 | ||
| 67 | */ | 68 | */ |
| 68 | @Prop pageComponentType?: number = -1 | 69 | @Prop pageComponentType?: number = -1 |
| 69 | @Prop showBackIcon?: boolean = true | 70 | @Prop showBackIcon?: boolean = true |
| @@ -208,7 +209,7 @@ export struct OperRowListView { | @@ -208,7 +209,7 @@ export struct OperRowListView { | ||
| 208 | contentDetail: this.contentDetailData, | 209 | contentDetail: this.contentDetailData, |
| 209 | onCommentFocus: this.onCommentFocus, | 210 | onCommentFocus: this.onCommentFocus, |
| 210 | pageComponentType: this.pageComponentType, | 211 | pageComponentType: this.pageComponentType, |
| 211 | - onLoad: (dialogController: CustomDialogController) => { | 212 | + onLoad: (dialogController: CustomDialogController | null) => { |
| 212 | this.dialogController = dialogController | 213 | this.dialogController = dialogController |
| 213 | } | 214 | } |
| 214 | }) | 215 | }) |
| @@ -36,6 +36,7 @@ struct MineHomePage { | @@ -36,6 +36,7 @@ struct MineHomePage { | ||
| 36 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 36 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 37 | @State isCommentEnter:string = ""; | 37 | @State isCommentEnter:string = ""; |
| 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 39 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 39 | 40 | ||
| 40 | onPageShow(): void { | 41 | onPageShow(): void { |
| 41 | this.getUserInfo() | 42 | this.getUserInfo() |
| @@ -52,10 +53,21 @@ struct MineHomePage { | @@ -52,10 +53,21 @@ struct MineHomePage { | ||
| 52 | build() { | 53 | build() { |
| 53 | if(this.isConnectNetwork){ | 54 | if(this.isConnectNetwork){ |
| 54 | Stack({ alignContent: Alignment.Top }){ | 55 | Stack({ alignContent: Alignment.Top }){ |
| 56 | + Stack({ alignContent: Alignment.Top }){ | ||
| 55 | Image($r('app.media.title_bg')) | 57 | Image($r('app.media.title_bg')) |
| 56 | .width('100%') | 58 | .width('100%') |
| 57 | .height('355lpx') | 59 | .height('355lpx') |
| 58 | .objectFit(ImageFit.Cover) | 60 | .objectFit(ImageFit.Cover) |
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + | ||
| 63 | + Row() | ||
| 64 | + .height(px2vp(this.topSafeHeight)) | ||
| 65 | + .width("100%") | ||
| 66 | + .backgroundColor($r('app.color.white')) | ||
| 67 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 68 | + .opacity(this.tileOpacity ) | ||
| 69 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 70 | + } | ||
| 59 | 71 | ||
| 60 | Column(){ | 72 | Column(){ |
| 61 | Stack({ alignContent: Alignment.Top }){ | 73 | Stack({ alignContent: Alignment.Top }){ |
| @@ -262,7 +274,7 @@ struct MineHomePage { | @@ -262,7 +274,7 @@ struct MineHomePage { | ||
| 262 | .scrollBar(BarState.Off) | 274 | .scrollBar(BarState.Off) |
| 263 | .width('100%') | 275 | .width('100%') |
| 264 | .layoutWeight(1) | 276 | .layoutWeight(1) |
| 265 | - } | 277 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 266 | }.width('100%') | 278 | }.width('100%') |
| 267 | .layoutWeight(1) | 279 | .layoutWeight(1) |
| 268 | }else{ | 280 | }else{ |
| @@ -385,10 +397,10 @@ struct MineHomePage { | @@ -385,10 +397,10 @@ struct MineHomePage { | ||
| 385 | this.editUserInfo() | 397 | this.editUserInfo() |
| 386 | }) | 398 | }) |
| 387 | } | 399 | } |
| 388 | - .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 389 | .height('84lpx') | 400 | .height('84lpx') |
| 390 | .width('100%') | 401 | .width('100%') |
| 391 | .backgroundColor($r('app.color.white')) | 402 | .backgroundColor($r('app.color.white')) |
| 403 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 392 | .opacity(this.tileOpacity ) | 404 | .opacity(this.tileOpacity ) |
| 393 | 405 | ||
| 394 | } | 406 | } |
| @@ -15,6 +15,7 @@ const TAG = "OtherNormalUserHomePage" | @@ -15,6 +15,7 @@ const TAG = "OtherNormalUserHomePage" | ||
| 15 | struct OtherNormalUserHomePage { | 15 | struct OtherNormalUserHomePage { |
| 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 17 | @Watch('change') @State curUserId: string = '-1'; | 17 | @Watch('change') @State curUserId: string = '-1'; |
| 18 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 18 | 19 | ||
| 19 | onPageShow() { | 20 | onPageShow() { |
| 20 | this.curUserId = this.params?.['userId']; | 21 | this.curUserId = this.params?.['userId']; |
| @@ -52,10 +53,21 @@ struct OtherNormalUserHomePage { | @@ -52,10 +53,21 @@ struct OtherNormalUserHomePage { | ||
| 52 | build() { | 53 | build() { |
| 53 | if(this.isConnectNetwork){ | 54 | if(this.isConnectNetwork){ |
| 54 | Stack({ alignContent: Alignment.Top }){ | 55 | Stack({ alignContent: Alignment.Top }){ |
| 56 | + Stack({ alignContent: Alignment.Top }){ | ||
| 55 | Image($r('app.media.title_bg')) | 57 | Image($r('app.media.title_bg')) |
| 56 | .width('100%') | 58 | .width('100%') |
| 57 | .height('355lpx') | 59 | .height('355lpx') |
| 58 | .objectFit(ImageFit.Cover) | 60 | .objectFit(ImageFit.Cover) |
| 61 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 62 | + | ||
| 63 | + Row() | ||
| 64 | + .height(px2vp(this.topSafeHeight)) | ||
| 65 | + .width("100%") | ||
| 66 | + .backgroundColor($r('app.color.white')) | ||
| 67 | + .visibility(this.tileOpacity > 0 ? 0 : 1) | ||
| 68 | + .opacity(this.tileOpacity ) | ||
| 69 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 70 | + } | ||
| 59 | 71 | ||
| 60 | Column(){ | 72 | Column(){ |
| 61 | Stack({ alignContent: Alignment.Top }){ | 73 | Stack({ alignContent: Alignment.Top }){ |
| @@ -229,7 +241,7 @@ struct OtherNormalUserHomePage { | @@ -229,7 +241,7 @@ struct OtherNormalUserHomePage { | ||
| 229 | .scrollBar(BarState.Off) | 241 | .scrollBar(BarState.Off) |
| 230 | .width('100%') | 242 | .width('100%') |
| 231 | .layoutWeight(1) | 243 | .layoutWeight(1) |
| 232 | - } | 244 | + }.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 233 | }.width('100%') | 245 | }.width('100%') |
| 234 | .layoutWeight(1) | 246 | .layoutWeight(1) |
| 235 | }else{ | 247 | }else{ |
| @@ -29,7 +29,7 @@ export function touchUpLoadMore(model: PageModel) { | @@ -29,7 +29,7 @@ export function touchUpLoadMore(model: PageModel) { | ||
| 29 | if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) { | 29 | if ((self.isCanLoadMore === true) && (self.hasMore === true) && (self.isLoading === false)) { |
| 30 | self.isLoading = true; | 30 | self.isLoading = true; |
| 31 | setTimeout(() => { | 31 | setTimeout(() => { |
| 32 | - closeLoadMore(model); | 32 | + // closeLoadMore(model); |
| 33 | PageHelper.loadMore(self) | 33 | PageHelper.loadMore(self) |
| 34 | }, Const.DELAY_TIME); | 34 | }, Const.DELAY_TIME); |
| 35 | } else { | 35 | } else { |
| @@ -13,7 +13,7 @@ export class RefreshConstants { | @@ -13,7 +13,7 @@ export class RefreshConstants { | ||
| 13 | /** | 13 | /** |
| 14 | * The delay time. | 14 | * The delay time. |
| 15 | */ | 15 | */ |
| 16 | - static readonly DELAY_TIME: number = 200; | 16 | + static readonly DELAY_TIME: number = 50; |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * The animation duration. | 19 | * The animation duration. |
| 1 | -// PersistentStorage.persistProp('clickedIds', []); | ||
| 2 | -// | ||
| 3 | -// function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') { | ||
| 4 | -// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || []; | ||
| 5 | -// let index = clickedIds.indexOf(id.toString()) | ||
| 6 | -// if (type === 'add') { | ||
| 7 | -// if (index >= 0) return; | ||
| 8 | -// clickedIds.push(id.toString()); | ||
| 9 | -// } else if (type === 'remove') { | ||
| 10 | -// clickedIds.splice(index, 1); | ||
| 11 | -// } | ||
| 12 | -// AppStorage.set('clickedIds', clickedIds.join(',')); | ||
| 13 | -// } | ||
| 14 | -// | ||
| 15 | -// function hasClicked(id: string | number) { | ||
| 16 | -// let clickedIds = AppStorage.get<string>('clickedIds')?.split(',') || []; | ||
| 17 | -// let index = clickedIds.indexOf(id.toString()) | ||
| 18 | -// if (index >= 0) return true; | ||
| 19 | -// return false; | ||
| 20 | -// } | ||
| 21 | -// | ||
| 22 | -// export { persistentStorage, hasClicked } | ||
| 1 | +PersistentStorage.persistProp('clickedIds', []); | ||
| 2 | + | ||
| 3 | +function persistentStorage(id: string | number, type: 'add' | 'remove' | undefined = 'add') { | ||
| 4 | + let _clickedIds = AppStorage.get<string[]>('clickedIds'); | ||
| 5 | + let clickedIds = _clickedIds?.toString()?.split(',') || []; | ||
| 6 | + let index = clickedIds.indexOf(id.toString()) | ||
| 7 | + if (type === 'add') { | ||
| 8 | + if (index >= 0) return; | ||
| 9 | + clickedIds.push(id.toString()); | ||
| 10 | + } else if (type === 'remove') { | ||
| 11 | + clickedIds.splice(index, 1); | ||
| 12 | + } | ||
| 13 | + AppStorage.set('clickedIds', clickedIds.join(',')); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +function hasClicked(id: string | number) { | ||
| 17 | + let _clickedIds = AppStorage.get<string[]>('clickedIds'); | ||
| 18 | + let clickedIds = _clickedIds?.toString()?.split(',') || []; | ||
| 19 | + let index = clickedIds.indexOf(id.toString()) | ||
| 20 | + if (index >= 0) return true; | ||
| 21 | + return false; | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +export { persistentStorage, hasClicked } |
| @@ -14,6 +14,7 @@ import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | @@ -14,6 +14,7 @@ import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | ||
| 14 | import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' | 14 | import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' |
| 15 | import { common } from '@kit.AbilityKit'; | 15 | import { common } from '@kit.AbilityKit'; |
| 16 | import { CacheData } from 'wdNetwork/Index'; | 16 | import { CacheData } from 'wdNetwork/Index'; |
| 17 | +import { closeLoadMore } from '../utils/PullUpLoadMore'; | ||
| 17 | 18 | ||
| 18 | const TAG = 'PageHelper'; | 19 | const TAG = 'PageHelper'; |
| 19 | 20 | ||
| @@ -37,7 +38,7 @@ export class PageHelper { | @@ -37,7 +38,7 @@ export class PageHelper { | ||
| 37 | if (!netStatus) { | 38 | if (!netStatus) { |
| 38 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 39 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| 39 | setTimeout(() => { | 40 | setTimeout(() => { |
| 40 | - closeRefresh(pageModel, false) | 41 | + this.refreshUIEnd(pageModel, false) |
| 41 | }, 500) | 42 | }, 500) |
| 42 | return | 43 | return |
| 43 | } | 44 | } |
| @@ -46,6 +47,10 @@ export class PageHelper { | @@ -46,6 +47,10 @@ export class PageHelper { | ||
| 46 | this.getPageInfo(pageModel, pageAdvModel) | 47 | this.getPageInfo(pageModel, pageAdvModel) |
| 47 | } | 48 | } |
| 48 | 49 | ||
| 50 | + private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) { | ||
| 51 | + closeRefresh(pageModel, isRefreshSuccess) | ||
| 52 | + } | ||
| 53 | + | ||
| 49 | /** | 54 | /** |
| 50 | * 分页加载 | 55 | * 分页加载 |
| 51 | */ | 56 | */ |
| @@ -60,6 +65,10 @@ export class PageHelper { | @@ -60,6 +65,10 @@ export class PageHelper { | ||
| 60 | this.compLoadMore(pageModel) | 65 | this.compLoadMore(pageModel) |
| 61 | } | 66 | } |
| 62 | 67 | ||
| 68 | + private loadMoreEnd(pageModel: PageModel) { | ||
| 69 | + closeLoadMore(pageModel) | ||
| 70 | + } | ||
| 71 | + | ||
| 63 | /** | 72 | /** |
| 64 | * 进页面请求数据 | 73 | * 进页面请求数据 |
| 65 | */ | 74 | */ |
| @@ -105,7 +114,7 @@ export class PageHelper { | @@ -105,7 +114,7 @@ export class PageHelper { | ||
| 105 | } else { | 114 | } else { |
| 106 | //更新数据 | 115 | //更新数据 |
| 107 | pageModel.compList.addItems(liveReviewDTO.list); | 116 | pageModel.compList.addItems(liveReviewDTO.list); |
| 108 | - closeRefresh(pageModel, true); | 117 | + this.refreshUIEnd(pageModel, true); |
| 109 | } | 118 | } |
| 110 | }).catch((err: string | Resource) => { | 119 | }).catch((err: string | Resource) => { |
| 111 | promptAction.showToast({ message: err }); | 120 | promptAction.showToast({ message: err }); |
| @@ -233,7 +242,7 @@ export class PageHelper { | @@ -233,7 +242,7 @@ export class PageHelper { | ||
| 233 | // | 242 | // |
| 234 | pageModel.currentPage++ | 243 | pageModel.currentPage++ |
| 235 | pageModel.viewType = ViewType.LOADED | 244 | pageModel.viewType = ViewType.LOADED |
| 236 | - closeRefresh(pageModel, true) | 245 | + this.refreshUIEnd(pageModel, true) |
| 237 | 246 | ||
| 238 | if (pageModel.compList.isEmpty()) { | 247 | if (pageModel.compList.isEmpty()) { |
| 239 | // 没数据,展示空页面 | 248 | // 没数据,展示空页面 |
| @@ -277,6 +286,7 @@ export class PageHelper { | @@ -277,6 +286,7 @@ export class PageHelper { | ||
| 277 | //聚合页 | 286 | //聚合页 |
| 278 | if (pageModel.pageType == 1) { | 287 | if (pageModel.pageType == 1) { |
| 279 | PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { | 288 | PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { |
| 289 | + this.loadMoreEnd(pageModel) | ||
| 280 | if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | 290 | if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { |
| 281 | pageModel.hasMore = false; | 291 | pageModel.hasMore = false; |
| 282 | return; | 292 | return; |
| @@ -290,6 +300,7 @@ export class PageHelper { | @@ -290,6 +300,7 @@ export class PageHelper { | ||
| 290 | } | 300 | } |
| 291 | }).catch((err: string | Resource) => { | 301 | }).catch((err: string | Resource) => { |
| 292 | promptAction.showToast({ message: err }); | 302 | promptAction.showToast({ message: err }); |
| 303 | + this.loadMoreEnd(pageModel) | ||
| 293 | }) | 304 | }) |
| 294 | } else { | 305 | } else { |
| 295 | 306 | ||
| @@ -301,7 +312,7 @@ export class PageHelper { | @@ -301,7 +312,7 @@ export class PageHelper { | ||
| 301 | // 默认加载更多走 楼层接口 | 312 | // 默认加载更多走 楼层接口 |
| 302 | PageViewModel.getPageGroupCompData(pageModel.bizCopy()) | 313 | PageViewModel.getPageGroupCompData(pageModel.bizCopy()) |
| 303 | .then((data: PageDTO) => { | 314 | .then((data: PageDTO) => { |
| 304 | - | 315 | + this.loadMoreEnd(pageModel) |
| 305 | if (data == null || data.compList == null || data.compList.length == 0) { | 316 | if (data == null || data.compList == null || data.compList.length == 0) { |
| 306 | pageModel.hasMore = false; | 317 | pageModel.hasMore = false; |
| 307 | } else { | 318 | } else { |
| @@ -316,6 +327,7 @@ export class PageHelper { | @@ -316,6 +327,7 @@ export class PageHelper { | ||
| 316 | } | 327 | } |
| 317 | }).catch((err: string | Resource) => { | 328 | }).catch((err: string | Resource) => { |
| 318 | promptAction.showToast({ message: err }); | 329 | promptAction.showToast({ message: err }); |
| 330 | + this.loadMoreEnd(pageModel) | ||
| 319 | }) | 331 | }) |
| 320 | } | 332 | } |
| 321 | } | 333 | } |
| @@ -651,6 +663,7 @@ export class PageHelper { | @@ -651,6 +663,7 @@ export class PageHelper { | ||
| 651 | let pageSize = Normal_Page_Size | 663 | let pageSize = Normal_Page_Size |
| 652 | 664 | ||
| 653 | PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => { | 665 | PageViewModel.getLiveReviewUrl(currentPage, pageSize).then((liveReviewDTO) => { |
| 666 | + this.loadMoreEnd(pageModel) | ||
| 654 | if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | 667 | if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { |
| 655 | pageModel.hasMore = false; | 668 | pageModel.hasMore = false; |
| 656 | } else { | 669 | } else { |
| @@ -696,9 +709,9 @@ export class PageHelper { | @@ -696,9 +709,9 @@ export class PageHelper { | ||
| 696 | this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray()) | 709 | this.getLiveRoomDataInfo(pageInfo.oneRequestPageGroupCompList.convertToArray()) |
| 697 | 710 | ||
| 698 | } | 711 | } |
| 699 | - | ||
| 700 | }).catch((err: string | Resource) => { | 712 | }).catch((err: string | Resource) => { |
| 701 | promptAction.showToast({ message: err }); | 713 | promptAction.showToast({ message: err }); |
| 714 | + this.loadMoreEnd(pageModel) | ||
| 702 | }) | 715 | }) |
| 703 | } | 716 | } |
| 704 | 717 |
| @@ -17,6 +17,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView'; | @@ -17,6 +17,7 @@ import { PlayerBottomView } from '../view/PlayerBottomView'; | ||
| 17 | import { PlayerRightView } from '../view/PlayerRightView'; | 17 | import { PlayerRightView } from '../view/PlayerRightView'; |
| 18 | import { DisplayDirection } from 'wdConstant/Index'; | 18 | import { DisplayDirection } from 'wdConstant/Index'; |
| 19 | import { CommentDialogView } from '../view/CommentDialogView'; | 19 | import { CommentDialogView } from '../view/CommentDialogView'; |
| 20 | +import { window } from '@kit.ArkUI'; | ||
| 20 | 21 | ||
| 21 | const TAG = 'DetailPlayShortVideoPage'; | 22 | const TAG = 'DetailPlayShortVideoPage'; |
| 22 | 23 | ||
| @@ -294,6 +295,15 @@ export struct DetailPlayShortVideoPage { | @@ -294,6 +295,15 @@ export struct DetailPlayShortVideoPage { | ||
| 294 | .margin({ top: 280 }) | 295 | .margin({ top: 280 }) |
| 295 | .onClick(() => { | 296 | .onClick(() => { |
| 296 | // 全屏方案待定 | 297 | // 全屏方案待定 |
| 298 | + // this.displayDirection = DisplayDirection.VERTICAL | ||
| 299 | + this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 300 | + DisplayDirection.VIDEO_HORIZONTAL : | ||
| 301 | + DisplayDirection.VERTICAL | ||
| 302 | + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 303 | + window.Orientation.PORTRAIT : | ||
| 304 | + window.Orientation.LANDSCAPE_INVERTED) | ||
| 305 | + | ||
| 306 | + | ||
| 297 | }) | 307 | }) |
| 298 | 308 | ||
| 299 | } | 309 | } |
| @@ -91,6 +91,7 @@ export struct DetailDialog { | @@ -91,6 +91,7 @@ export struct DetailDialog { | ||
| 91 | 91 | ||
| 92 | OperRowListView({ | 92 | OperRowListView({ |
| 93 | componentType: 1, | 93 | componentType: 1, |
| 94 | + pageComponentType: 8, | ||
| 94 | showBackIcon: false, | 95 | showBackIcon: false, |
| 95 | operationButtonList: ['comment', 'like', 'collect', 'share'], | 96 | operationButtonList: ['comment', 'like', 'collect', 'share'], |
| 96 | contentDetailData: this.contentDetailData, | 97 | contentDetailData: this.contentDetailData, |
| @@ -149,6 +149,9 @@ export class GetuiPush { | @@ -149,6 +149,9 @@ export class GetuiPush { | ||
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) { | 151 | setAlias(bind: boolean, alias: string, sn: string = this.ALIAS_SN_USERID) { |
| 152 | + if (typeof alias == "number") { | ||
| 153 | + alias = `${alias}` | ||
| 154 | + } | ||
| 152 | if (!this.initialed) { return } | 155 | if (!this.initialed) { return } |
| 153 | if (bind) { | 156 | if (bind) { |
| 154 | Logger.debug(TAG, "推送 绑定别名 " + alias) | 157 | Logger.debug(TAG, "推送 绑定别名 " + alias) |
| @@ -56,9 +56,15 @@ export class PushContentParser { | @@ -56,9 +56,15 @@ export class PushContentParser { | ||
| 56 | },*/ | 56 | },*/ |
| 57 | let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object> | 57 | let gtData = want.parameters[PushContentParser.LAUNCH_PARAM_GETUI_DATA] as Record<string, string | number | object> |
| 58 | if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) { | 58 | if (gtData[PushContentParser.LAUNCH_PARAM_GETUI_TASKID] != undefined) { |
| 59 | - let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number> | ||
| 60 | - if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) { | ||
| 61 | - const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string | 59 | + // let json = JSON.parse(gtData["wantUri"] as string) as Record<string, string | number> |
| 60 | + // if (json && json[PushContentParser.PUSH_PARAM_PUSH_LINK] != null) { | ||
| 61 | + // const pushLink = json[PushContentParser.PUSH_PARAM_PUSH_LINK] as string | ||
| 62 | + // return { | ||
| 63 | + // isPush: true, online: true, pushLink: pushLink, want: want | ||
| 64 | + // } | ||
| 65 | + // } | ||
| 66 | + if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { | ||
| 67 | + let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string | ||
| 62 | return { | 68 | return { |
| 63 | isPush: true, online: true, pushLink: pushLink, want: want | 69 | isPush: true, online: true, pushLink: pushLink, want: want |
| 64 | } | 70 | } |
| @@ -96,6 +96,7 @@ export struct WDPlayerRenderView { | @@ -96,6 +96,7 @@ export struct WDPlayerRenderView { | ||
| 96 | this.onLoad(event) | 96 | this.onLoad(event) |
| 97 | } | 97 | } |
| 98 | }) | 98 | }) |
| 99 | + .zIndex(1000) | ||
| 99 | .width(this.selfSize.width) | 100 | .width(this.selfSize.width) |
| 100 | .height(this.selfSize.height) | 101 | .height(this.selfSize.height) |
| 101 | } | 102 | } |
| @@ -117,6 +117,12 @@ export default class EntryAbility extends UIAbility { | @@ -117,6 +117,12 @@ export default class EntryAbility extends UIAbility { | ||
| 117 | return; | 117 | return; |
| 118 | } | 118 | } |
| 119 | console.info('floatWindowClass Succeeded in loading the content.'); | 119 | console.info('floatWindowClass Succeeded in loading the content.'); |
| 120 | + let color: string = 'rgba(0,0,0,0)'; | ||
| 121 | + try { | ||
| 122 | + (floatWindowClass as window.Window).setWindowBackgroundColor(color); | ||
| 123 | + } catch (exception) { | ||
| 124 | + console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception)); | ||
| 125 | + }; | ||
| 120 | }); | 126 | }); |
| 121 | 127 | ||
| 122 | floatWindowClass.on('windowEvent', (data) => { | 128 | floatWindowClass.on('windowEvent', (data) => { |
| @@ -88,7 +88,6 @@ struct Index { | @@ -88,7 +88,6 @@ struct Index { | ||
| 88 | .height(20) | 88 | .height(20) |
| 89 | .fontColor('#222222') | 89 | .fontColor('#222222') |
| 90 | .fontSize(14) | 90 | .fontSize(14) |
| 91 | - .margin({ top: 10, left: 10 }) | ||
| 92 | .alignSelf(ItemAlign.Start) | 91 | .alignSelf(ItemAlign.Start) |
| 93 | .onStart(() => { | 92 | .onStart(() => { |
| 94 | console.info('Marquee animation complete onStart') | 93 | console.info('Marquee animation complete onStart') |
| @@ -115,7 +114,7 @@ struct Index { | @@ -115,7 +114,7 @@ struct Index { | ||
| 115 | } | 114 | } |
| 116 | .width("100%") | 115 | .width("100%") |
| 117 | .height(16) | 116 | .height(16) |
| 118 | - .margin({ top: 4, left: 10 }) | 117 | + .margin({ top: 4}) |
| 119 | 118 | ||
| 120 | Progress({ value: this.progressVal, total: 100, type: ProgressType.Capsule }) | 119 | Progress({ value: this.progressVal, total: 100, type: ProgressType.Capsule }) |
| 121 | .color("#ED2800") | 120 | .color("#ED2800") |
| @@ -194,7 +193,13 @@ struct Index { | @@ -194,7 +193,13 @@ struct Index { | ||
| 194 | ) | 193 | ) |
| 195 | .width('100%') | 194 | .width('100%') |
| 196 | .height('100%') | 195 | .height('100%') |
| 196 | + .borderRadius(4) | ||
| 197 | + .padding({ | ||
| 198 | + top: 10, | ||
| 199 | + bottom: 10, | ||
| 200 | + left: 10, | ||
| 201 | + right: 0 | ||
| 202 | + }) | ||
| 197 | .backgroundColor(Color.White) | 203 | .backgroundColor(Color.White) |
| 198 | - .borderRadius(2) | ||
| 199 | } | 204 | } |
| 200 | } | 205 | } |
-
Please register or login to post a comment