Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
# Conflicts: # sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
Showing
16 changed files
with
450 additions
and
681 deletions
| @@ -5,13 +5,13 @@ | @@ -5,13 +5,13 @@ | ||
| 5 | "name": "default", | 5 | "name": "default", |
| 6 | "type": "HarmonyOS", | 6 | "type": "HarmonyOS", |
| 7 | "material": { | 7 | "material": { |
| 8 | - "certpath": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.cer", | ||
| 9 | - "storePassword": "0000001B1B59DAB22B389A8BCD25A2C43C89DE581FD6AC3EEE1D3FC227D46727A7763AAE553A50B5E81310", | 8 | + "certpath": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.cer", |
| 9 | + "storePassword": "0000001AB256FAF47AA4D68E4841C95D357490DE9FBB26A3A9161AD3069E31B3623E25CB49409CCA9CF7", | ||
| 10 | "keyAlias": "debugKey", | 10 | "keyAlias": "debugKey", |
| 11 | - "keyPassword": "0000001B2B0EDD642E43906A1B9A6B72A79F40316E908829B79DD96467FE5C3A8D1DF9E40957DA733DF77F", | ||
| 12 | - "profile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p7b", | 11 | + "keyPassword": "0000001AFB06818C2BC8DC275326668AAC62B91EBF7D3F84E8BE0F156D02623AA0F4F8C6B73F362CB371", |
| 12 | + "profile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p7b", | ||
| 13 | "signAlg": "SHA256withECDSA", | 13 | "signAlg": "SHA256withECDSA", |
| 14 | - "storeFile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p12" | 14 | + "storeFile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p12" |
| 15 | } | 15 | } |
| 16 | } | 16 | } |
| 17 | ], | 17 | ], |
| @@ -144,10 +144,12 @@ export class HttpUrlUtils { | @@ -144,10 +144,12 @@ export class HttpUrlUtils { | ||
| 144 | * 个人中心 我的关注列表 | 144 | * 个人中心 我的关注列表 |
| 145 | */ | 145 | */ |
| 146 | static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list"; | 146 | static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list"; |
| 147 | + | ||
| 147 | /** | 148 | /** |
| 148 | * 预约操作 | 149 | * 预约操作 |
| 149 | */ | 150 | */ |
| 150 | static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe"; | 151 | static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe"; |
| 152 | + | ||
| 151 | /** | 153 | /** |
| 152 | * 点赞操作 | 154 | * 点赞操作 |
| 153 | */ | 155 | */ |
| @@ -167,7 +169,11 @@ export class HttpUrlUtils { | @@ -167,7 +169,11 @@ export class HttpUrlUtils { | ||
| 167 | * */ | 169 | * */ |
| 168 | static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; | 170 | static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; |
| 169 | static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; | 171 | static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; |
| 170 | - private static hostUrl: string = HttpUrlUtils.HOST_UAT; | 172 | + private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; |
| 173 | + | ||
| 174 | + public static set hostUrl(value: string) { | ||
| 175 | + HttpUrlUtils._hostUrl = value; | ||
| 176 | + } | ||
| 171 | private static userId = '' | 177 | private static userId = '' |
| 172 | private static userType = '' | 178 | private static userType = '' |
| 173 | private static token = '' | 179 | private static token = '' |
| @@ -183,8 +189,8 @@ export class HttpUrlUtils { | @@ -183,8 +189,8 @@ export class HttpUrlUtils { | ||
| 183 | headers.set('timestamp', HttpUrlUtils.getTimestamp()) | 189 | headers.set('timestamp', HttpUrlUtils.getTimestamp()) |
| 184 | headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken()) | 190 | headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken()) |
| 185 | headers.set('device_id', HttpUrlUtils.getDeviceId()) | 191 | headers.set('device_id', HttpUrlUtils.getDeviceId()) |
| 186 | - if (HttpUrlUtils.getXToken() != '') { | ||
| 187 | - headers.set('cookie', 'RMRB-X-TOKEN=' + HttpUrlUtils.getXToken()) | 192 | + if(HttpUrlUtils.getXToken()!=''){ |
| 193 | + headers.set('cookie', 'RMRB-X-TOKEN='+HttpUrlUtils.getXToken()) | ||
| 188 | } | 194 | } |
| 189 | headers.set('build_version', HttpUrlUtils.getVersion()) | 195 | headers.set('build_version', HttpUrlUtils.getVersion()) |
| 190 | headers.set('adcode', HttpUrlUtils.getAdCode()) | 196 | headers.set('adcode', HttpUrlUtils.getAdCode()) |
| @@ -213,7 +219,7 @@ export class HttpUrlUtils { | @@ -213,7 +219,7 @@ export class HttpUrlUtils { | ||
| 213 | } | 219 | } |
| 214 | 220 | ||
| 215 | static addSpecialHeaders(headers: HashMap<string, string>) { | 221 | static addSpecialHeaders(headers: HashMap<string, string>) { |
| 216 | - switch (HttpUrlUtils.hostUrl) { | 222 | + switch (HttpUrlUtils._hostUrl) { |
| 217 | case HttpUrlUtils.HOST_UAT: | 223 | case HttpUrlUtils.HOST_UAT: |
| 218 | // TODO 待优化到常量类里 | 224 | // TODO 待优化到常量类里 |
| 219 | headers.set('X-Ca-Stage', 'PRE'); | 225 | headers.set('X-Ca-Stage', 'PRE'); |
| @@ -241,7 +247,7 @@ export class HttpUrlUtils { | @@ -241,7 +247,7 @@ export class HttpUrlUtils { | ||
| 241 | } | 247 | } |
| 242 | 248 | ||
| 243 | static getHost() { | 249 | static getHost() { |
| 244 | - return HttpUrlUtils.hostUrl; | 250 | + return HttpUrlUtils._hostUrl; |
| 245 | } | 251 | } |
| 246 | 252 | ||
| 247 | private static getCity() { | 253 | private static getCity() { |
| @@ -265,20 +271,20 @@ export class HttpUrlUtils { | @@ -265,20 +271,20 @@ export class HttpUrlUtils { | ||
| 265 | } | 271 | } |
| 266 | 272 | ||
| 267 | private static getXToken() { | 273 | private static getXToken() { |
| 268 | - if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { | 274 | + if(StringUtils.isNotEmpty(HttpUrlUtils.token)){ |
| 269 | return HttpUrlUtils.token | 275 | return HttpUrlUtils.token |
| 270 | } | 276 | } |
| 271 | - HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string | ||
| 272 | - if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { | ||
| 273 | - return HttpUrlUtils.token | 277 | + HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN,"") as string |
| 278 | + if(StringUtils.isNotEmpty(HttpUrlUtils.token)) { | ||
| 279 | + return HttpUrlUtils.token | ||
| 274 | } | 280 | } |
| 275 | return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; | 281 | return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; |
| 276 | } | 282 | } |
| 277 | 283 | ||
| 278 | - static getRefreshToken() { | ||
| 279 | - let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "") | ||
| 280 | - if (StringUtils.isNotEmpty(refreshToken)) { | ||
| 281 | - return refreshToken as string; | 284 | + static getRefreshToken() { |
| 285 | + let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN,"") | ||
| 286 | + if(StringUtils.isNotEmpty(refreshToken)) { | ||
| 287 | + return refreshToken as string; | ||
| 282 | } | 288 | } |
| 283 | return ''; | 289 | return ''; |
| 284 | } | 290 | } |
| @@ -341,55 +347,55 @@ export class HttpUrlUtils { | @@ -341,55 +347,55 @@ export class HttpUrlUtils { | ||
| 341 | 347 | ||
| 342 | public static getUserId() { | 348 | public static getUserId() { |
| 343 | // TODO 对接登录 | 349 | // TODO 对接登录 |
| 344 | - if (StringUtils.isNotEmpty(HttpUrlUtils.userId)) { | 350 | + if(StringUtils.isNotEmpty(HttpUrlUtils.userId)){ |
| 345 | return HttpUrlUtils.userId | 351 | return HttpUrlUtils.userId |
| 346 | } | 352 | } |
| 347 | - HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | 353 | + HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID,"") as string |
| 348 | return HttpUrlUtils.userId; | 354 | return HttpUrlUtils.userId; |
| 349 | } | 355 | } |
| 350 | 356 | ||
| 351 | - public static getUserType() { | ||
| 352 | - if (StringUtils.isNotEmpty(HttpUrlUtils.userType)) { | 357 | + public static getUserType() { |
| 358 | + if(StringUtils.isNotEmpty(HttpUrlUtils.userType)){ | ||
| 353 | return HttpUrlUtils.userType | 359 | return HttpUrlUtils.userType |
| 354 | } | 360 | } |
| 355 | - HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string | 361 | + HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string |
| 356 | return HttpUrlUtils.userType; | 362 | return HttpUrlUtils.userType; |
| 357 | } | 363 | } |
| 358 | 364 | ||
| 359 | static getVerifyCodeUrl() { | 365 | static getVerifyCodeUrl() { |
| 360 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode"; | 366 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode"; |
| 361 | return url; | 367 | return url; |
| 362 | } | 368 | } |
| 363 | 369 | ||
| 364 | static getVerifyCodeByTokenUrl() { | 370 | static getVerifyCodeByTokenUrl() { |
| 365 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken"; | 371 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken"; |
| 366 | return url; | 372 | return url; |
| 367 | } | 373 | } |
| 368 | 374 | ||
| 369 | 375 | ||
| 370 | static getForgetPasswordUrl() { | 376 | static getForgetPasswordUrl() { |
| 371 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword"; | 377 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword"; |
| 372 | return url; | 378 | return url; |
| 373 | } | 379 | } |
| 374 | 380 | ||
| 375 | static getLogoutUrl() { | 381 | static getLogoutUrl() { |
| 376 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/logout"; | 382 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logout"; |
| 377 | return url; | 383 | return url; |
| 378 | } | 384 | } |
| 379 | 385 | ||
| 380 | 386 | ||
| 381 | static getResetPassworddUrl() { | 387 | static getResetPassworddUrl() { |
| 382 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; | 388 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; |
| 383 | return url; | 389 | return url; |
| 384 | } | 390 | } |
| 385 | 391 | ||
| 386 | static queryUserDetail() { | 392 | static queryUserDetail() { |
| 387 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail"; | 393 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail"; |
| 388 | return url; | 394 | return url; |
| 389 | } | 395 | } |
| 390 | 396 | ||
| 391 | static editUserDetail() { | 397 | static editUserDetail() { |
| 392 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail"; | 398 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail"; |
| 393 | return url; | 399 | return url; |
| 394 | } | 400 | } |
| 395 | 401 | ||
| @@ -399,17 +405,17 @@ export class HttpUrlUtils { | @@ -399,17 +405,17 @@ export class HttpUrlUtils { | ||
| 399 | } | 405 | } |
| 400 | 406 | ||
| 401 | static getCheckVerifyCodeUrl() { | 407 | static getCheckVerifyCodeUrl() { |
| 402 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode"; | 408 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode"; |
| 403 | return url; | 409 | return url; |
| 404 | } | 410 | } |
| 405 | 411 | ||
| 406 | static getCheckVerifyByTokenCodeUrl() { | 412 | static getCheckVerifyByTokenCodeUrl() { |
| 407 | - let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken"; | 413 | + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken"; |
| 408 | return url; | 414 | return url; |
| 409 | } | 415 | } |
| 410 | 416 | ||
| 411 | static getAppointmentListDataUrl() { | 417 | static getAppointmentListDataUrl() { |
| 412 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH | 418 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH |
| 413 | return url | 419 | return url |
| 414 | } | 420 | } |
| 415 | 421 | ||
| @@ -419,77 +425,77 @@ export class HttpUrlUtils { | @@ -419,77 +425,77 @@ export class HttpUrlUtils { | ||
| 419 | } | 425 | } |
| 420 | 426 | ||
| 421 | static getFollowListDetailDataUrl() { | 427 | static getFollowListDetailDataUrl() { |
| 422 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH | 428 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH |
| 423 | return url | 429 | return url |
| 424 | } | 430 | } |
| 425 | 431 | ||
| 426 | static getFollowListDataUrl() { | 432 | static getFollowListDataUrl() { |
| 427 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH | 433 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH |
| 428 | return url | 434 | return url |
| 429 | } | 435 | } |
| 430 | 436 | ||
| 431 | static getMineFollowListDataUrl() { | 437 | static getMineFollowListDataUrl() { |
| 432 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH | 438 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH |
| 433 | return url | 439 | return url |
| 434 | } | 440 | } |
| 435 | 441 | ||
| 436 | static getFollowListStatusDataUrl() { | 442 | static getFollowListStatusDataUrl() { |
| 437 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH | 443 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH |
| 438 | return url | 444 | return url |
| 439 | } | 445 | } |
| 440 | 446 | ||
| 441 | static getCommentListStatusDataUrl() { | 447 | static getCommentListStatusDataUrl() { |
| 442 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH | 448 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH |
| 443 | return url | 449 | return url |
| 444 | } | 450 | } |
| 445 | 451 | ||
| 446 | static getMineCommentListDataUrl() { | 452 | static getMineCommentListDataUrl() { |
| 447 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH | 453 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH |
| 448 | return url | 454 | return url |
| 449 | } | 455 | } |
| 450 | 456 | ||
| 451 | static getMineUserLevelDataUrl() { | 457 | static getMineUserLevelDataUrl() { |
| 452 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH | 458 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH |
| 453 | return url | 459 | return url |
| 454 | } | 460 | } |
| 455 | 461 | ||
| 456 | static getOtherUserLevelDataUrl() { | 462 | static getOtherUserLevelDataUrl() { |
| 457 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH | 463 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH |
| 458 | return url | 464 | return url |
| 459 | } | 465 | } |
| 460 | 466 | ||
| 461 | static getMineUserDetailDataUrl() { | 467 | static getMineUserDetailDataUrl() { |
| 462 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH | 468 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH |
| 463 | return url | 469 | return url |
| 464 | } | 470 | } |
| 465 | 471 | ||
| 466 | static getOtherUserDetailDataUrl() { | 472 | static getOtherUserDetailDataUrl() { |
| 467 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH | 473 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH |
| 468 | return url | 474 | return url |
| 469 | } | 475 | } |
| 470 | 476 | ||
| 471 | static getOtherCommentListDataUrl() { | 477 | static getOtherCommentListDataUrl() { |
| 472 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH | 478 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH |
| 473 | return url | 479 | return url |
| 474 | } | 480 | } |
| 475 | 481 | ||
| 476 | static getOtherUserFollowListDataUrl() { | 482 | static getOtherUserFollowListDataUrl() { |
| 477 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH | 483 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH |
| 478 | return url | 484 | return url |
| 479 | } | 485 | } |
| 480 | 486 | ||
| 481 | static getAppointmentOperationUrl() { | 487 | static getAppointmentOperationUrl() { |
| 482 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH | 488 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH |
| 483 | return url | 489 | return url |
| 484 | } | 490 | } |
| 485 | 491 | ||
| 486 | static getCommentLikeOperationUrl() { | 492 | static getCommentLikeOperationUrl() { |
| 487 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH | 493 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH |
| 488 | return url | 494 | return url |
| 489 | } | 495 | } |
| 490 | 496 | ||
| 491 | static getFollowOperationUrl() { | 497 | static getFollowOperationUrl() { |
| 492 | - let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH | 498 | + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH |
| 493 | return url | 499 | return url |
| 494 | } | 500 | } |
| 495 | 501 |
| @@ -53,3 +53,5 @@ export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPic | @@ -53,3 +53,5 @@ export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPic | ||
| 53 | export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent" | 53 | export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent" |
| 54 | 54 | ||
| 55 | export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" | 55 | export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent" |
| 56 | + | ||
| 57 | +export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent" |
| 1 | +import { Logger } from 'wdKit'; | ||
| 2 | +import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | ||
| 3 | +import { ContentDetailDTO, PhotoListBean } from 'wdBean'; | ||
| 4 | +import media from '@ohos.multimedia.media'; | ||
| 5 | +import { OperRowListView } from './view/OperRowListView'; | ||
| 6 | +const TAG = 'AudioDetailComponent' | ||
| 7 | +@Component | ||
| 8 | +export struct AudioDetailComponent { | ||
| 9 | + private relId: string = '' | ||
| 10 | + private contentId: string = '' | ||
| 11 | + private relType: string = '' | ||
| 12 | + // private avPlayer:media.AVPlayer | ||
| 13 | + | ||
| 14 | + @State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[] | ||
| 15 | + @State iocClock: string = '定时'; | ||
| 16 | + @State iconTheOriginal: string = '原文'; | ||
| 17 | + @State iconList: string = '列表'; | ||
| 18 | + @State text: string = '' | ||
| 19 | + @State coverImage:string = 'app.media.audio' | ||
| 20 | + @State newsTitle:string = '夜读' | ||
| 21 | + | ||
| 22 | + @State palyIcon:string = "app.media.playicon" | ||
| 23 | + | ||
| 24 | + @State showList: boolean = false | ||
| 25 | + @State outSetValueOne:number = 40 | ||
| 26 | + // | ||
| 27 | + // @State @Watch('onIsPlayChanged')isPlay: boolean = false | ||
| 28 | + // onIsPlayChanged(){ | ||
| 29 | + // if(this.isPlay){ | ||
| 30 | + // this.avPlayer.play() | ||
| 31 | + // this.palyIcon = "app.media.suspend" | ||
| 32 | + // }else{ | ||
| 33 | + // this.avPlayer.pause() | ||
| 34 | + // this.palyIcon = "app.media.playicon" | ||
| 35 | + // } | ||
| 36 | + // } | ||
| 37 | + // | ||
| 38 | + async aboutToAppear() { | ||
| 39 | + this.getContentDetailData() | ||
| 40 | + // // 创建avPlayer实例对象 | ||
| 41 | + // this.avPlayer = await media.createAVPlayer() | ||
| 42 | + // // 创建状态机变化回调函数 | ||
| 43 | + // this.setAVPlayerCallback() | ||
| 44 | + } | ||
| 45 | + // | ||
| 46 | + // // 注册avplayer回调函数 | ||
| 47 | + // setAVPlayerCallback() { | ||
| 48 | + // // seek操作结果回调函数 | ||
| 49 | + // this.avPlayer.on('seekDone', (seekDoneTime) => { | ||
| 50 | + // console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`); | ||
| 51 | + // }) | ||
| 52 | + // // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程 | ||
| 53 | + // this.avPlayer.on('error', (err) => { | ||
| 54 | + // console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); | ||
| 55 | + // this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 | ||
| 56 | + // }) | ||
| 57 | + // // 状态机变化回调函数 | ||
| 58 | + // this.avPlayer.on('stateChange', async (state, reason) => { | ||
| 59 | + // switch (state) { | ||
| 60 | + // case 'idle': // 成功调用reset接口后触发该状态机上报 | ||
| 61 | + // console.info('AVPlayer state idle called.'); | ||
| 62 | + // this.avPlayer.release(); // 调用release接口销毁实例对象 | ||
| 63 | + // this.isPlay = false | ||
| 64 | + // break; | ||
| 65 | + // case 'initialized': // avplayer 设置播放源后触发该状态上报 | ||
| 66 | + // console.info('AVPlayerstate initialized called.'); | ||
| 67 | + // this.avPlayer.prepare().then(() => { | ||
| 68 | + // console.info('AVPlayer prepare succeeded.'); | ||
| 69 | + // }) | ||
| 70 | + // this.isPlay = false | ||
| 71 | + // break; | ||
| 72 | + // case 'prepared': // prepare调用成功后上报该状态机 | ||
| 73 | + // console.info('AVPlayer state prepared called.'); | ||
| 74 | + // this.isPlay = false | ||
| 75 | + // this.avPlayer.play(); // 调用播放接口开始播放 | ||
| 76 | + // break; | ||
| 77 | + // case 'playing': // play成功调用后触发该状态机上报 | ||
| 78 | + // console.info('AVPlayer state playing called.'); | ||
| 79 | + // this.isPlay = true | ||
| 80 | + // break; | ||
| 81 | + // case 'paused': // pause成功调用后触发该状态机上报 | ||
| 82 | + // console.info('AVPlayer state paused called.'); | ||
| 83 | + // this.avPlayer.play(); // 再次播放接口开始播放 | ||
| 84 | + // this.isPlay = false | ||
| 85 | + // break; | ||
| 86 | + // case 'completed': // 播放结束后触发该状态机上报 | ||
| 87 | + // console.info('AVPlayer state completed called.'); | ||
| 88 | + // this.avPlayer.stop(); //调用播放结束接口 | ||
| 89 | + // break; | ||
| 90 | + // case 'stopped': // stop接口成功调用后触发该状态机上报 | ||
| 91 | + // console.info('AVPlayer state stopped called.'); | ||
| 92 | + // this.avPlayer.reset(); // 调用reset接口初始化avplayer状态 | ||
| 93 | + // this.isPlay = false | ||
| 94 | + // break; | ||
| 95 | + // case 'released': | ||
| 96 | + // console.info('AVPlayer state released called.'); | ||
| 97 | + // break; | ||
| 98 | + // default: | ||
| 99 | + // console.info('AVPlayer state unknown called.'); | ||
| 100 | + // break; | ||
| 101 | + // } | ||
| 102 | + // }) | ||
| 103 | + // } | ||
| 104 | + // gotoPlay(){ | ||
| 105 | + // this.avPlayer.url = this.contentDetailData[0].audioList[0].audioUrl | ||
| 106 | + // } | ||
| 107 | + build() { | ||
| 108 | + Row() { | ||
| 109 | + Column() { | ||
| 110 | + // 封面 | ||
| 111 | + Row() { | ||
| 112 | + Image($r('app.media.audio')) | ||
| 113 | + .width(240) | ||
| 114 | + .height(160) | ||
| 115 | + .borderRadius('0') | ||
| 116 | + } | ||
| 117 | + .justifyContent(FlexAlign.Center) | ||
| 118 | + .width('100%') | ||
| 119 | + .margin({ top: 64 }) | ||
| 120 | + // 标题 | ||
| 121 | + Row() { | ||
| 122 | + Text(this.newsTitle) | ||
| 123 | + .fontSize(20) | ||
| 124 | + .fontWeight(FontWeight.Bold) | ||
| 125 | + .fontColor('#ffffff') | ||
| 126 | + .textAlign(TextAlign.Center) | ||
| 127 | + .lineHeight(28) | ||
| 128 | + .fontFamily('PingFang SC, PingFang SC') | ||
| 129 | + } | ||
| 130 | + .padding({ left: 34, right: 34 }) | ||
| 131 | + .margin({ top: 32 }) | ||
| 132 | + | ||
| 133 | + // 操作矩阵 | ||
| 134 | + Row() { | ||
| 135 | + // 定时 | ||
| 136 | + Column() { | ||
| 137 | + Image($r('app.media.clock')) | ||
| 138 | + .width(28) | ||
| 139 | + .height(28) | ||
| 140 | + Text(this.iocClock) | ||
| 141 | + .fontColor('#fff') | ||
| 142 | + .fontSize(12) | ||
| 143 | + .lineHeight(16) | ||
| 144 | + .margin(2) | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + // 原文 | ||
| 148 | + Column() { | ||
| 149 | + Image($r('app.media.theOriginal')) | ||
| 150 | + .width(28) | ||
| 151 | + .height(28) | ||
| 152 | + Text(this.iconTheOriginal) | ||
| 153 | + .fontColor('#fff') | ||
| 154 | + .fontSize(12) | ||
| 155 | + .lineHeight(16) | ||
| 156 | + .margin(2) | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + // 列表 | ||
| 160 | + Column() { | ||
| 161 | + Image($r('app.media.list')) | ||
| 162 | + .width(28) | ||
| 163 | + .height(28) | ||
| 164 | + Text(this.iconList) | ||
| 165 | + .fontColor('#fff') | ||
| 166 | + .fontSize(12) | ||
| 167 | + .lineHeight(16) | ||
| 168 | + .margin(2) | ||
| 169 | + } | ||
| 170 | + .onClick(() => { | ||
| 171 | + this.showList = !this.showList | ||
| 172 | + Logger.info(TAG,'这里') | ||
| 173 | + console.log('列表', this.showList) | ||
| 174 | + }) | ||
| 175 | + } | ||
| 176 | + .width('100%') | ||
| 177 | + .padding({ left: 49, right: 49 }) | ||
| 178 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 179 | + .margin({ top: 60 }) | ||
| 180 | + | ||
| 181 | + Column(){ | ||
| 182 | + // 进度条 | ||
| 183 | + Row(){ | ||
| 184 | + Slider({ | ||
| 185 | + value: this.outSetValueOne, | ||
| 186 | + min: 0, | ||
| 187 | + max: 100, | ||
| 188 | + style: SliderStyle.OutSet | ||
| 189 | + }) | ||
| 190 | + .trackColor('rgba(0,0,0,0.5)') | ||
| 191 | + .selectedColor('#ED2800') | ||
| 192 | + .showTips(true) | ||
| 193 | + .onChange((value: number, mode: SliderChangeMode) => { | ||
| 194 | + this.outSetValueOne = value | ||
| 195 | + console.info('value:' + value + 'mode:' + mode.toString()) | ||
| 196 | + }) | ||
| 197 | + } | ||
| 198 | + .width('100%') | ||
| 199 | + .padding({left:24,right:24}) | ||
| 200 | + .margin({top:110}) | ||
| 201 | + // 播放按钮 | ||
| 202 | + Row(){ | ||
| 203 | + Image($r('app.media.loop')) | ||
| 204 | + .width(24) | ||
| 205 | + .height(24) | ||
| 206 | + Image($r('app.media.Backward')) | ||
| 207 | + .width(24) | ||
| 208 | + .height(24) | ||
| 209 | + Stack(){ | ||
| 210 | + Image($r('app.media.playicon')) | ||
| 211 | + .width(32) | ||
| 212 | + .height(32) | ||
| 213 | + | ||
| 214 | + } | ||
| 215 | + .backgroundColor('rgba(255,255,255,0.1)') | ||
| 216 | + .width(60) | ||
| 217 | + .height(60) | ||
| 218 | + .borderRadius(50) | ||
| 219 | + .alignContent(Alignment.Center) | ||
| 220 | + .onClick(()=>{ | ||
| 221 | + // this.gotoPlay() | ||
| 222 | + console.log('播放') | ||
| 223 | + this.getContentDetailData() | ||
| 224 | + }) | ||
| 225 | + | ||
| 226 | + Image($r('app.media.fastForward')) | ||
| 227 | + .width(24) | ||
| 228 | + .height(24) | ||
| 229 | + Image($r('app.media.doubleSpeed')) | ||
| 230 | + .width(24) | ||
| 231 | + .height(24) | ||
| 232 | + } | ||
| 233 | + .width('100%') | ||
| 234 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 235 | + .margin({top:56}) | ||
| 236 | + .padding({left:32,right:32}) | ||
| 237 | + } | ||
| 238 | + // OperRowListView() | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + private async getContentDetailData() { | ||
| 245 | + try { | ||
| 246 | + let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) | ||
| 247 | + this.contentDetailData = data; | ||
| 248 | + this.coverImage = this.contentDetailData[0].audioList[0].fullColumnImgUrls[0].url | ||
| 249 | + this.newsTitle = this.contentDetailData[0].newsTitle | ||
| 250 | + Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | ||
| 251 | + console.log(JSON.stringify(this.contentDetailData)) | ||
| 252 | + console.log(this.newsTitle) | ||
| 253 | + console.log(this.coverImage) | ||
| 254 | + | ||
| 255 | + } catch (exception) { | ||
| 256 | + | ||
| 257 | + } | ||
| 258 | + } | ||
| 259 | +} |
| @@ -229,6 +229,7 @@ export struct MorningEveningPaperComponent { | @@ -229,6 +229,7 @@ export struct MorningEveningPaperComponent { | ||
| 229 | // console.info(TAG, `onClick listen_right_bg`); | 229 | // console.info(TAG, `onClick listen_right_bg`); |
| 230 | }) | 230 | }) |
| 231 | } | 231 | } |
| 232 | + .margin({ left: 12, right: 12 }) | ||
| 232 | // .width('100%') | 233 | // .width('100%') |
| 233 | .height(56) | 234 | .height(56) |
| 234 | .alignItems(VerticalAlign.Center) | 235 | .alignItems(VerticalAlign.Center) |
| @@ -33,17 +33,20 @@ export struct topicInfoView { | @@ -33,17 +33,20 @@ export struct topicInfoView { | ||
| 33 | 33 | ||
| 34 | Row() { | 34 | Row() { |
| 35 | Text("查看详情") | 35 | Text("查看详情") |
| 36 | - .fontSize(16) | 36 | + .fontSize(14) |
| 37 | .fontColor($r('app.color.white')) | 37 | .fontColor($r('app.color.white')) |
| 38 | .maxLines(1) | 38 | .maxLines(1) |
| 39 | - .backgroundColor($r('app.color.color_99636363')) | ||
| 40 | .borderRadius(2) | 39 | .borderRadius(2) |
| 40 | + .padding({ left: 6, top: 4, bottom: 4 }) | ||
| 41 | 41 | ||
| 42 | - Image($r('app.media.more')) | ||
| 43 | - .height($r('app.float.top_arrow_size')) | ||
| 44 | - .width(20) | 42 | + Image($r('app.media.more'))// .height($r('app.float.top_arrow_size')) |
| 43 | + .width(12) | ||
| 44 | + .height(12) | ||
| 45 | + .margin({ left: 4, right: 7 }) | ||
| 45 | } | 46 | } |
| 46 | - .margin({ top: 10, left: 16, right: 16 }) | 47 | + .backgroundColor($r('app.color.color_99636363')) |
| 48 | + .margin({ top: 8, left: 16, right: 16, bottom: 16 }) | ||
| 49 | + .borderRadius(2) | ||
| 47 | // .backgroundColor(Color.Red) | 50 | // .backgroundColor(Color.Red) |
| 48 | .alignRules({ | 51 | .alignRules({ |
| 49 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 52 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| @@ -61,6 +64,7 @@ export struct topicInfoView { | @@ -61,6 +64,7 @@ export struct topicInfoView { | ||
| 61 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 64 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 62 | bottom: { anchor: "row_detail", align: VerticalAlign.Top } | 65 | bottom: { anchor: "row_detail", align: VerticalAlign.Top } |
| 63 | }) | 66 | }) |
| 67 | + .margin({ left: 16, right: 16 }) | ||
| 64 | .id('txt_summary') | 68 | .id('txt_summary') |
| 65 | 69 | ||
| 66 | Text(this.frontLinkObject?.title ?? "") | 70 | Text(this.frontLinkObject?.title ?? "") |
| @@ -71,6 +75,7 @@ export struct topicInfoView { | @@ -71,6 +75,7 @@ export struct topicInfoView { | ||
| 71 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 75 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 72 | bottom: { anchor: "txt_summary", align: VerticalAlign.Top } | 76 | bottom: { anchor: "txt_summary", align: VerticalAlign.Top } |
| 73 | }) | 77 | }) |
| 78 | + .margin({ left: 16, right: 16, bottom: 8 }) | ||
| 74 | .id('txt_title') | 79 | .id('txt_title') |
| 75 | } | 80 | } |
| 76 | .width("100%") | 81 | .width("100%") |
| @@ -23,6 +23,7 @@ export struct MultiPictureDetailItemComponent { | @@ -23,6 +23,7 @@ export struct MultiPictureDetailItemComponent { | ||
| 23 | .width('100%') | 23 | .width('100%') |
| 24 | .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height) | 24 | .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height) |
| 25 | .objectFit(ImageFit.Fill) | 25 | .objectFit(ImageFit.Fill) |
| 26 | + .interpolation(ImageInterpolation.High) | ||
| 26 | } | 27 | } |
| 27 | .height('100%') | 28 | .height('100%') |
| 28 | .width('100%') | 29 | .width('100%') |
| @@ -13,15 +13,14 @@ const LOCAL_CHANNEL: string = '地方频道' | @@ -13,15 +13,14 @@ const LOCAL_CHANNEL: string = '地方频道' | ||
| 13 | struct ChannelDialog { | 13 | struct ChannelDialog { |
| 14 | @State indexSettingTabIndex: number = 1 | 14 | @State indexSettingTabIndex: number = 1 |
| 15 | @State isEditIng: boolean = false | 15 | @State isEditIng: boolean = false |
| 16 | - @Link currentTopNavSelectedIndex : number | ||
| 17 | - @Link myChannelList: Array<TopNavDTO> | ||
| 18 | - @Link moreChannelList: Array<TopNavDTO> | ||
| 19 | - @Link localChannelList: Array<TopNavDTO> | ||
| 20 | - @Link indexSettingArray: Array<string> | ||
| 21 | - @Link topNavList: Array<TopNavDTO> | 16 | + @Link currentTopNavSelectedIndex: number |
| 17 | + @Link myChannelList: TopNavDTO[] | ||
| 18 | + @Link moreChannelList: TopNavDTO[] | ||
| 19 | + @Link localChannelList: TopNavDTO[] | ||
| 20 | + @Link indexSettingArray: string[] | ||
| 21 | + controller?: CustomDialogController | ||
| 22 | myChannelItemEditHandle = (index: number): void => { | 22 | myChannelItemEditHandle = (index: number): void => { |
| 23 | let item = this.myChannelList.splice(index, 1)[0] | 23 | let item = this.myChannelList.splice(index, 1)[0] |
| 24 | - console.info(`itemitemitem${JSON.stringify(item)}`) | ||
| 25 | if (item.moreChannel === '1') { | 24 | if (item.moreChannel === '1') { |
| 26 | this.moreChannelList.unshift(item) | 25 | this.moreChannelList.unshift(item) |
| 27 | } | 26 | } |
| @@ -29,7 +28,6 @@ struct ChannelDialog { | @@ -29,7 +28,6 @@ struct ChannelDialog { | ||
| 29 | this.localChannelList.unshift(item) | 28 | this.localChannelList.unshift(item) |
| 30 | } | 29 | } |
| 31 | } | 30 | } |
| 32 | - controller?: CustomDialogController | ||
| 33 | 31 | ||
| 34 | build() { | 32 | build() { |
| 35 | Column() { | 33 | Column() { |
| @@ -108,7 +106,7 @@ struct ChannelDialog { | @@ -108,7 +106,7 @@ struct ChannelDialog { | ||
| 108 | Row() { | 106 | Row() { |
| 109 | Text(item.name) | 107 | Text(item.name) |
| 110 | .fontSize(14) | 108 | .fontSize(14) |
| 111 | - .fontColor( this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222')) | 109 | + .fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222')) |
| 112 | 110 | ||
| 113 | if (this.isEditIng && item.myChannel !== '1') { | 111 | if (this.isEditIng && item.myChannel !== '1') { |
| 114 | Image($r('app.media.icon_audio_close')) | 112 | Image($r('app.media.icon_audio_close')) |
| @@ -122,10 +120,11 @@ struct ChannelDialog { | @@ -122,10 +120,11 @@ struct ChannelDialog { | ||
| 122 | .backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '') | 120 | .backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '') |
| 123 | .onClick(() => { | 121 | .onClick(() => { |
| 124 | if (this.isEditIng) { | 122 | if (this.isEditIng) { |
| 125 | - if(item.myChannel !== '1'){ | 123 | + if (item.myChannel !== '1') { |
| 126 | this.myChannelItemEditHandle(index) | 124 | this.myChannelItemEditHandle(index) |
| 127 | } | 125 | } |
| 128 | - }else{ | 126 | + } else { |
| 127 | + this.currentTopNavSelectedIndex = index | ||
| 129 | this.controller?.close() | 128 | this.controller?.close() |
| 130 | } | 129 | } |
| 131 | }) | 130 | }) |
| @@ -234,306 +233,35 @@ struct ChannelDialog { | @@ -234,306 +233,35 @@ struct ChannelDialog { | ||
| 234 | .padding(16) | 233 | .padding(16) |
| 235 | .backgroundColor('#ffffff') | 234 | .backgroundColor('#ffffff') |
| 236 | } | 235 | } |
| 237 | - | ||
| 238 | - onTopNavigationDataUpdated() { | ||
| 239 | - } | ||
| 240 | } | 236 | } |
| 241 | 237 | ||
| 242 | -@Entry | ||
| 243 | @Component | 238 | @Component |
| 244 | struct ChannelSubscriptionLayout { | 239 | struct ChannelSubscriptionLayout { |
| 240 | + @State indexSettingArray: string [] = ['推荐', '热点'] | ||
| 245 | //当前选中的频道 | 241 | //当前选中的频道 |
| 246 | - @Prop currentTopNavSelectedIndex?: number; | 242 | + @Link currentTopNavSelectedIndex: number; |
| 243 | + @Link myChannelList: TopNavDTO [] | ||
| 244 | + @Link moreChannelList: TopNavDTO [] | ||
| 245 | + @Link localChannelList: TopNavDTO [] | ||
| 247 | 246 | ||
| 248 | - @State indexSettingArray: Array<string> = ['推荐', '热点'] | ||
| 249 | - @State myChannelList: Array<TopNavDTO> = [ | ||
| 250 | - // { | ||
| 251 | - // channelId: 0, | ||
| 252 | - // channelStyle: 1, | ||
| 253 | - // channelType: 1, | ||
| 254 | - // defaultPermitted: 1, | ||
| 255 | - // delPermitted: 1, | ||
| 256 | - // fontCColor: '#000000', | ||
| 257 | - // fontColor: '#000000', | ||
| 258 | - // headlinesOn: 0, | ||
| 259 | - // homeChannel: '1', | ||
| 260 | - // iconCUrl: '', | ||
| 261 | - // iconCUrlSize: '', | ||
| 262 | - // iconUrl: '', | ||
| 263 | - // iconUrlSize: '', | ||
| 264 | - // localChannel: '', | ||
| 265 | - // moreChannel: '', | ||
| 266 | - // movePermitted: 0, | ||
| 267 | - // myChannel: '1', | ||
| 268 | - // name: '推荐', | ||
| 269 | - // num: 0, | ||
| 270 | - // pageId: 21212, | ||
| 271 | - // pageType: '', | ||
| 272 | - // underlineCColor: '' | ||
| 273 | - // }, | ||
| 274 | - // { | ||
| 275 | - // channelId: 1, | ||
| 276 | - // channelStyle: 1, | ||
| 277 | - // channelType: 1, | ||
| 278 | - // defaultPermitted: 1, | ||
| 279 | - // delPermitted: 1, | ||
| 280 | - // fontCColor: '#000000', | ||
| 281 | - // fontColor: '#000000', | ||
| 282 | - // headlinesOn: 0, | ||
| 283 | - // homeChannel: '1', | ||
| 284 | - // iconCUrl: '', | ||
| 285 | - // iconCUrlSize: '', | ||
| 286 | - // iconUrl: '', | ||
| 287 | - // iconUrlSize: '', | ||
| 288 | - // localChannel: '', | ||
| 289 | - // moreChannel: '', | ||
| 290 | - // movePermitted: 0, | ||
| 291 | - // myChannel: '1', | ||
| 292 | - // name: '热点', | ||
| 293 | - // num: 0, | ||
| 294 | - // pageId: 21212, | ||
| 295 | - // pageType: '', | ||
| 296 | - // underlineCColor: '' | ||
| 297 | - // }, | ||
| 298 | - // { | ||
| 299 | - // channelId: 2, | ||
| 300 | - // channelStyle: 1, | ||
| 301 | - // channelType: 1, | ||
| 302 | - // defaultPermitted: 1, | ||
| 303 | - // delPermitted: 1, | ||
| 304 | - // fontCColor: '#000000', | ||
| 305 | - // fontColor: '#000000', | ||
| 306 | - // headlinesOn: 0, | ||
| 307 | - // homeChannel: '', | ||
| 308 | - // iconCUrl: '', | ||
| 309 | - // iconCUrlSize: '', | ||
| 310 | - // iconUrl: '', | ||
| 311 | - // iconUrlSize: '', | ||
| 312 | - // localChannel: '', | ||
| 313 | - // moreChannel: '', | ||
| 314 | - // movePermitted: 0, | ||
| 315 | - // myChannel: '1', | ||
| 316 | - // name: '视频', | ||
| 317 | - // num: 0, | ||
| 318 | - // pageId: 21212, | ||
| 319 | - // pageType: '', | ||
| 320 | - // underlineCColor: '' | ||
| 321 | - // }, | ||
| 322 | - // { | ||
| 323 | - // channelId: 3, | ||
| 324 | - // channelStyle: 1, | ||
| 325 | - // channelType: 1, | ||
| 326 | - // defaultPermitted: 1, | ||
| 327 | - // delPermitted: 1, | ||
| 328 | - // fontCColor: '#000000', | ||
| 329 | - // fontColor: '#000000', | ||
| 330 | - // headlinesOn: 0, | ||
| 331 | - // homeChannel: '', | ||
| 332 | - // iconCUrl: '', | ||
| 333 | - // iconCUrlSize: '', | ||
| 334 | - // iconUrl: '', | ||
| 335 | - // iconUrlSize: '', | ||
| 336 | - // localChannel: '', | ||
| 337 | - // moreChannel: '', | ||
| 338 | - // movePermitted: 0, | ||
| 339 | - // myChannel: '1', | ||
| 340 | - // name: '云课堂', | ||
| 341 | - // num: 0, | ||
| 342 | - // pageId: 21212, | ||
| 343 | - // pageType: '', | ||
| 344 | - // underlineCColor: '' | ||
| 345 | - // }, | ||
| 346 | - ] | ||
| 347 | - @State moreChannelList: Array<TopNavDTO> = [ | ||
| 348 | - // { | ||
| 349 | - // channelId: 4, | ||
| 350 | - // channelStyle: 1, | ||
| 351 | - // channelType: 1, | ||
| 352 | - // defaultPermitted: 1, | ||
| 353 | - // delPermitted: 1, | ||
| 354 | - // fontCColor: '#000000', | ||
| 355 | - // fontColor: '#000000', | ||
| 356 | - // headlinesOn: 0, | ||
| 357 | - // homeChannel: '', | ||
| 358 | - // iconCUrl: '', | ||
| 359 | - // iconCUrlSize: '', | ||
| 360 | - // iconUrl: '', | ||
| 361 | - // iconUrlSize: '', | ||
| 362 | - // localChannel: '', | ||
| 363 | - // moreChannel: '1', | ||
| 364 | - // movePermitted: 0, | ||
| 365 | - // myChannel: '', | ||
| 366 | - // name: '房产', | ||
| 367 | - // num: 0, | ||
| 368 | - // pageId: 21212, | ||
| 369 | - // pageType: '', | ||
| 370 | - // underlineCColor: '' | ||
| 371 | - // }, | ||
| 372 | - // { | ||
| 373 | - // channelId: 5, | ||
| 374 | - // channelStyle: 1, | ||
| 375 | - // channelType: 1, | ||
| 376 | - // defaultPermitted: 1, | ||
| 377 | - // delPermitted: 1, | ||
| 378 | - // fontCColor: '#000000', | ||
| 379 | - // fontColor: '#000000', | ||
| 380 | - // headlinesOn: 0, | ||
| 381 | - // homeChannel: '', | ||
| 382 | - // iconCUrl: '', | ||
| 383 | - // iconCUrlSize: '', | ||
| 384 | - // iconUrl: '', | ||
| 385 | - // iconUrlSize: '', | ||
| 386 | - // localChannel: '', | ||
| 387 | - // moreChannel: '1', | ||
| 388 | - // movePermitted: 0, | ||
| 389 | - // myChannel: '', | ||
| 390 | - // name: '生态', | ||
| 391 | - // num: 0, | ||
| 392 | - // pageId: 21212, | ||
| 393 | - // pageType: '', | ||
| 394 | - // underlineCColor: '' | ||
| 395 | - // }, | ||
| 396 | - // { | ||
| 397 | - // channelId: 6, | ||
| 398 | - // channelStyle: 1, | ||
| 399 | - // channelType: 1, | ||
| 400 | - // defaultPermitted: 1, | ||
| 401 | - // delPermitted: 1, | ||
| 402 | - // fontCColor: '#000000', | ||
| 403 | - // fontColor: '#000000', | ||
| 404 | - // headlinesOn: 0, | ||
| 405 | - // homeChannel: '', | ||
| 406 | - // iconCUrl: '', | ||
| 407 | - // iconCUrlSize: '', | ||
| 408 | - // iconUrl: '', | ||
| 409 | - // iconUrlSize: '', | ||
| 410 | - // localChannel: '', | ||
| 411 | - // moreChannel: '1', | ||
| 412 | - // movePermitted: 0, | ||
| 413 | - // myChannel: '', | ||
| 414 | - // name: '健康', | ||
| 415 | - // num: 0, | ||
| 416 | - // pageId: 21212, | ||
| 417 | - // pageType: '', | ||
| 418 | - // underlineCColor: '' | ||
| 419 | - // } | ||
| 420 | - ] | ||
| 421 | - @State localChannelList: Array<TopNavDTO> = [ | ||
| 422 | - // { | ||
| 423 | - // channelId: 7, | ||
| 424 | - // channelStyle: 1, | ||
| 425 | - // channelType: 1, | ||
| 426 | - // defaultPermitted: 1, | ||
| 427 | - // delPermitted: 1, | ||
| 428 | - // fontCColor: '#000000', | ||
| 429 | - // fontColor: '#000000', | ||
| 430 | - // headlinesOn: 0, | ||
| 431 | - // homeChannel: '', | ||
| 432 | - // iconCUrl: '', | ||
| 433 | - // iconCUrlSize: '', | ||
| 434 | - // iconUrl: '', | ||
| 435 | - // iconUrlSize: '', | ||
| 436 | - // localChannel: '1', | ||
| 437 | - // moreChannel: '', | ||
| 438 | - // movePermitted: 0, | ||
| 439 | - // myChannel: '', | ||
| 440 | - // name: '北京', | ||
| 441 | - // num: 0, | ||
| 442 | - // pageId: 21212, | ||
| 443 | - // pageType: '', | ||
| 444 | - // underlineCColor: '' | ||
| 445 | - // }, | ||
| 446 | - // { | ||
| 447 | - // channelId: 8, | ||
| 448 | - // channelStyle: 1, | ||
| 449 | - // channelType: 1, | ||
| 450 | - // defaultPermitted: 1, | ||
| 451 | - // delPermitted: 1, | ||
| 452 | - // fontCColor: '#000000', | ||
| 453 | - // fontColor: '#000000', | ||
| 454 | - // headlinesOn: 0, | ||
| 455 | - // homeChannel: '', | ||
| 456 | - // iconCUrl: '', | ||
| 457 | - // iconCUrlSize: '', | ||
| 458 | - // iconUrl: '', | ||
| 459 | - // iconUrlSize: '', | ||
| 460 | - // localChannel: '1', | ||
| 461 | - // moreChannel: '', | ||
| 462 | - // movePermitted: 0, | ||
| 463 | - // myChannel: '', | ||
| 464 | - // name: '上海', | ||
| 465 | - // num: 0, | ||
| 466 | - // pageId: 21212, | ||
| 467 | - // pageType: '', | ||
| 468 | - // underlineCColor: '' | ||
| 469 | - // }, | ||
| 470 | - // { | ||
| 471 | - // channelId: 9, | ||
| 472 | - // channelStyle: 1, | ||
| 473 | - // channelType: 1, | ||
| 474 | - // defaultPermitted: 1, | ||
| 475 | - // delPermitted: 1, | ||
| 476 | - // fontCColor: '#000000', | ||
| 477 | - // fontColor: '#000000', | ||
| 478 | - // headlinesOn: 0, | ||
| 479 | - // homeChannel: '', | ||
| 480 | - // iconCUrl: '', | ||
| 481 | - // iconCUrlSize: '', | ||
| 482 | - // iconUrl: '', | ||
| 483 | - // iconUrlSize: '', | ||
| 484 | - // localChannel: '1', | ||
| 485 | - // moreChannel: '', | ||
| 486 | - // movePermitted: 0, | ||
| 487 | - // myChannel: '', | ||
| 488 | - // name: '江苏', | ||
| 489 | - // num: 0, | ||
| 490 | - // pageId: 21212, | ||
| 491 | - // pageType: '', | ||
| 492 | - // underlineCColor: '' | ||
| 493 | - // } | ||
| 494 | - ] | ||
| 495 | - // 顶导数据 | ||
| 496 | - @State topNavList: TopNavDTO[] = [] | ||
| 497 | dialogController: CustomDialogController | null = new CustomDialogController({ | 247 | dialogController: CustomDialogController | null = new CustomDialogController({ |
| 498 | builder: ChannelDialog({ | 248 | builder: ChannelDialog({ |
| 499 | - currentTopNavSelectedIndex:this.currentTopNavSelectedIndex, | ||
| 500 | - indexSettingArray: this.indexSettingArray, | ||
| 501 | - topNavList: this.topNavList, | ||
| 502 | - myChannelList: this.myChannelList, | ||
| 503 | - moreChannelList: this.moreChannelList, | ||
| 504 | - localChannelList: this.localChannelList, | 249 | + currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 250 | + indexSettingArray: $indexSettingArray, | ||
| 251 | + myChannelList: $myChannelList, | ||
| 252 | + moreChannelList: $moreChannelList, | ||
| 253 | + localChannelList: $localChannelList | ||
| 505 | }), | 254 | }), |
| 506 | - cancel: this.exitApp, | ||
| 507 | alignment: DialogAlignment.TopEnd, | 255 | alignment: DialogAlignment.TopEnd, |
| 508 | customStyle: true, | 256 | customStyle: true, |
| 509 | }) | 257 | }) |
| 510 | - aboutToAppear() { | ||
| 511 | - this.topNavList.forEach((item,index)=>{ | ||
| 512 | - if(item.myChannel === '1'){ | ||
| 513 | - this.myChannelList.push(item) | ||
| 514 | - } | ||
| 515 | - if(item.moreChannel === '1'){ | ||
| 516 | - this.moreChannelList.push(item) | ||
| 517 | - } | ||
| 518 | - if(item.localChannel === '1'){ | ||
| 519 | - this.localChannelList.push(item) | ||
| 520 | - } | ||
| 521 | - }) | ||
| 522 | - } | ||
| 523 | - aboutToDisappear() { | ||
| 524 | - this.dialogController = null // 将dialogController置空 | ||
| 525 | - } | ||
| 526 | 258 | ||
| 527 | - onCancel() { | ||
| 528 | - console.info('Callback when the first button is clicked') | ||
| 529 | - } | 259 | + aboutToAppear() { |
| 530 | 260 | ||
| 531 | - onAccept() { | ||
| 532 | - console.info('Callback when the second button is clicked') | ||
| 533 | } | 261 | } |
| 534 | 262 | ||
| 535 | - exitApp() { | ||
| 536 | - console.info('Click the callback in the blank area') | 263 | + aboutToDisappear() { |
| 264 | + this.dialogController = null // 将dialogController置空 | ||
| 537 | } | 265 | } |
| 538 | 266 | ||
| 539 | build() { | 267 | build() { |
| @@ -101,6 +101,7 @@ export struct PageComponent { | @@ -101,6 +101,7 @@ export struct PageComponent { | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | onChange() { | 103 | onChange() { |
| 104 | + Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 104 | if (this.navIndex === this.currentTopNavSelectedIndex) { | 105 | if (this.navIndex === this.currentTopNavSelectedIndex) { |
| 105 | this.getData(); | 106 | this.getData(); |
| 106 | } | 107 | } |
| @@ -17,46 +17,63 @@ export struct TopNavigationComponent { | @@ -17,46 +17,63 @@ export struct TopNavigationComponent { | ||
| 17 | // 顶导数据 | 17 | // 顶导数据 |
| 18 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] | 18 | @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] |
| 19 | @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); | 19 | @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); |
| 20 | - @State handledTopNavList: TopNavDTO[] = [] | 20 | + //我的频道id缓存列表 |
| 21 | + @State channelIds: number[] = [] | ||
| 22 | + // 我的频道列表 | ||
| 23 | + @State myChannelList: TopNavDTO[] = [] | ||
| 24 | + // 更多频道列表 | ||
| 25 | + @State moreChannelList: TopNavDTO[] = [] | ||
| 26 | + // 地方频道列表 | ||
| 27 | + @State localChannelList: TopNavDTO[] = [] | ||
| 21 | readonly MAX_LINE: number = 1; | 28 | readonly MAX_LINE: number = 1; |
| 22 | 29 | ||
| 23 | topNavListHandle() { | 30 | topNavListHandle() { |
| 24 | let defaultMyChannelList: TopNavDTO[] = [] | 31 | let defaultMyChannelList: TopNavDTO[] = [] |
| 25 | - this.handledTopNavList = [...this.topNavList] | ||
| 26 | - this.handledTopNavList.sort((a, b) => { | 32 | + let handledTopNavList = [...this.topNavList] |
| 33 | + handledTopNavList.sort((a, b) => { | ||
| 27 | return a.num - b.num; | 34 | return a.num - b.num; |
| 28 | }); | 35 | }); |
| 29 | - Logger.info(TAG, `aboutToAppear this.handledTopNavListsort : ${JSON.stringify(this.handledTopNavList)}`); | ||
| 30 | - for (let i = 0; i < this.handledTopNavList.length; i++) { | ||
| 31 | - if (this.handledTopNavList[i].defaultPermitted === 0 || this.handledTopNavList[i].movePermitted === 0 || this.handledTopNavList[i].delPermitted === 0 || this.handledTopNavList[i].headlinesOn === 1) { | ||
| 32 | - defaultMyChannelList.push(this.handledTopNavList.splice(i, 1)[0]); | 36 | + handledTopNavList.forEach(item => { |
| 37 | + if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) { | ||
| 38 | + defaultMyChannelList.push(item); | ||
| 33 | } | 39 | } |
| 34 | - } | 40 | + }) |
| 41 | + defaultMyChannelList.forEach(item => { | ||
| 42 | + item.myChannel = '1' | ||
| 43 | + if (item.defaultPermitted === 1) { | ||
| 44 | + item.homeChannel = '1' | ||
| 45 | + } | ||
| 46 | + let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId) | ||
| 47 | + if (index !== -1) { | ||
| 48 | + handledTopNavList.splice(index, 1) | ||
| 49 | + } | ||
| 50 | + }) | ||
| 35 | 51 | ||
| 36 | - Logger.info(TAG, `aboutToAppear defaultMyChannelListsort : ${JSON.stringify(defaultMyChannelList)}`); | 52 | + handledTopNavList.unshift(...defaultMyChannelList) |
| 53 | + handledTopNavList.forEach((item, index) => { | ||
| 54 | + if (item.channelType === 2) { | ||
| 55 | + item.localChannel = '1' | ||
| 56 | + } | ||
| 57 | + if (index >= 11) { | ||
| 58 | + if (item.channelType === 1) { | ||
| 59 | + item.moreChannel = '1' | ||
| 60 | + } | ||
| 61 | + } else { | ||
| 62 | + if (item.channelType === 1 && item.myChannel !== '1') { | ||
| 63 | + item.moreChannel = '1' | ||
| 64 | + } | ||
| 65 | + } | ||
| 37 | 66 | ||
| 38 | - for (const element of defaultMyChannelList) { | ||
| 39 | - element.myChannel = '1' | ||
| 40 | - if (element.defaultPermitted === 1) { | ||
| 41 | - element.homeChannel = '1' | 67 | + if (item.myChannel === '1') { |
| 68 | + this.myChannelList.push(item) | ||
| 42 | } | 69 | } |
| 43 | - } | ||
| 44 | - this.handledTopNavList.unshift(...defaultMyChannelList) | ||
| 45 | - for (let i = 0; i < this.handledTopNavList.length; i++) { | ||
| 46 | - if(this.handledTopNavList[i].channelType === 2){ | ||
| 47 | - this.handledTopNavList[i].localChannel = '1' | 70 | + if (item.moreChannel === '1') { |
| 71 | + this.moreChannelList.push(item) | ||
| 48 | } | 72 | } |
| 49 | - if(i>=11){ | ||
| 50 | - if(this.handledTopNavList[i].channelType === 1){ | ||
| 51 | - this.handledTopNavList[i].moreChannel = '1' | ||
| 52 | - } | ||
| 53 | - }else{ | ||
| 54 | - if(this.handledTopNavList[i].channelType === 1 && this.handledTopNavList[i].myChannel !== '1'){ | ||
| 55 | - this.handledTopNavList[i].moreChannel = '1' | ||
| 56 | - } | 73 | + if (item.localChannel === '1') { |
| 74 | + this.localChannelList.push(item) | ||
| 57 | } | 75 | } |
| 58 | - } | ||
| 59 | - console.info(`handledTopNavList:${JSON.stringify(this.handledTopNavList)}`) | 76 | + }) |
| 60 | } | 77 | } |
| 61 | 78 | ||
| 62 | build() { | 79 | build() { |
| @@ -150,7 +167,7 @@ export struct TopNavigationComponent { | @@ -150,7 +167,7 @@ export struct TopNavigationComponent { | ||
| 150 | Stack({ alignContent: Alignment.TopEnd }) { | 167 | Stack({ alignContent: Alignment.TopEnd }) { |
| 151 | 168 | ||
| 152 | Tabs() { | 169 | Tabs() { |
| 153 | - ForEach(this.handledTopNavList, (navItem: TopNavDTO, index: number) => { | 170 | + ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => { |
| 154 | TabContent() { | 171 | TabContent() { |
| 155 | PageComponent({ | 172 | PageComponent({ |
| 156 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 173 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| @@ -171,8 +188,10 @@ export struct TopNavigationComponent { | @@ -171,8 +188,10 @@ export struct TopNavigationComponent { | ||
| 171 | }) | 188 | }) |
| 172 | 189 | ||
| 173 | ChannelSubscriptionLayout({ | 190 | ChannelSubscriptionLayout({ |
| 174 | - topNavList: this.handledTopNavList, | ||
| 175 | - currentTopNavSelectedIndex: this.currentTopNavSelectedIndex | 191 | + myChannelList: $myChannelList, |
| 192 | + moreChannelList: $moreChannelList, | ||
| 193 | + localChannelList: $localChannelList, | ||
| 194 | + currentTopNavSelectedIndex: $currentTopNavSelectedIndex | ||
| 176 | }) | 195 | }) |
| 177 | } | 196 | } |
| 178 | 197 | ||
| @@ -208,7 +227,6 @@ export struct TopNavigationComponent { | @@ -208,7 +227,6 @@ export struct TopNavigationComponent { | ||
| 208 | bottom: $r('app.float.top_tab_item_padding_bottom') | 227 | bottom: $r('app.float.top_tab_item_padding_bottom') |
| 209 | }) | 228 | }) |
| 210 | .id(`col_tabBar${index}`) | 229 | .id(`col_tabBar${index}`) |
| 211 | - | ||
| 212 | } | 230 | } |
| 213 | 231 | ||
| 214 | aboutToAppear() { | 232 | aboutToAppear() { |
| 1 | import { Action, CompDTO, Params } from 'wdBean'; | 1 | import { Action, CompDTO, Params } from 'wdBean'; |
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 3 | import { DateTimeUtils, Logger } from 'wdKit'; | 4 | import { DateTimeUtils, Logger } from 'wdKit'; |
| 4 | import { WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterRule } from 'wdRouter'; |
| 5 | 6 | ||
| @@ -23,15 +24,12 @@ export struct AlbumCardComponent { | @@ -23,15 +24,12 @@ export struct AlbumCardComponent { | ||
| 23 | .fontColor(0x222222) | 24 | .fontColor(0x222222) |
| 24 | .lineHeight(25) | 25 | .lineHeight(25) |
| 25 | .maxLines(3) | 26 | .maxLines(3) |
| 26 | - .margin({ top: 6, | ||
| 27 | - left: 16, | ||
| 28 | - right: 16 }) | ||
| 29 | - .width(343) | 27 | + .width(CommonConstants.FULL_WIDTH) |
| 30 | 28 | ||
| 31 | RelativeContainer() { | 29 | RelativeContainer() { |
| 32 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url) | 30 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url) |
| 33 | - .width(229) | ||
| 34 | - .height(154) | 31 | + .width('66.6%') |
| 32 | + .aspectRatio(16/9) | ||
| 35 | .alignRules({ | 33 | .alignRules({ |
| 36 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 34 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 37 | left: { anchor: "__container__", align: HorizontalAlign.Start } | 35 | left: { anchor: "__container__", align: HorizontalAlign.Start } |
| @@ -39,8 +37,8 @@ export struct AlbumCardComponent { | @@ -39,8 +37,8 @@ export struct AlbumCardComponent { | ||
| 39 | .id('mainImage') | 37 | .id('mainImage') |
| 40 | 38 | ||
| 41 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url) | 39 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url) |
| 42 | - .width(112) | ||
| 43 | - .height(76) | 40 | + .width('33%') |
| 41 | + .aspectRatio(16/9) | ||
| 44 | .alignRules({ | 42 | .alignRules({ |
| 45 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 43 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 46 | right: { anchor: "__container__", align: HorizontalAlign.End } | 44 | right: { anchor: "__container__", align: HorizontalAlign.End } |
| @@ -48,14 +46,14 @@ export struct AlbumCardComponent { | @@ -48,14 +46,14 @@ export struct AlbumCardComponent { | ||
| 48 | .id('subTopImage') | 46 | .id('subTopImage') |
| 49 | 47 | ||
| 50 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url) | 48 | Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url) |
| 51 | - .width(112) | ||
| 52 | - .height(76) | 49 | + .width('33%') |
| 50 | + .aspectRatio(16/9) | ||
| 53 | .alignRules({ | 51 | .alignRules({ |
| 54 | right: { anchor: "__container__", align: HorizontalAlign.End }, | 52 | right: { anchor: "__container__", align: HorizontalAlign.End }, |
| 55 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 53 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| 56 | }) | 54 | }) |
| 57 | .id('subBottomImage') | 55 | .id('subBottomImage') |
| 58 | - | 56 | + // 下面是渲染右下角图标 |
| 59 | Shape() { | 57 | Shape() { |
| 60 | Rect().width(33).height(18) | 58 | Rect().width(33).height(18) |
| 61 | } | 59 | } |
| @@ -97,8 +95,8 @@ export struct AlbumCardComponent { | @@ -97,8 +95,8 @@ export struct AlbumCardComponent { | ||
| 97 | .width(17) | 95 | .width(17) |
| 98 | .height(17) | 96 | .height(17) |
| 99 | } | 97 | } |
| 100 | - .width(343) | ||
| 101 | - .height(154) | 98 | + .width(CommonConstants.FULL_WIDTH) |
| 99 | + .aspectRatio(24/9) | ||
| 102 | .onClick((event: ClickEvent) => { | 100 | .onClick((event: ClickEvent) => { |
| 103 | let taskAction: Action = { | 101 | let taskAction: Action = { |
| 104 | type: 'JUMP_DETAIL_PAGE', | 102 | type: 'JUMP_DETAIL_PAGE', |
| @@ -134,13 +132,17 @@ export struct AlbumCardComponent { | @@ -134,13 +132,17 @@ export struct AlbumCardComponent { | ||
| 134 | .margin({ | 132 | .margin({ |
| 135 | left: 6 | 133 | left: 6 |
| 136 | }) | 134 | }) |
| 137 | - }.margin({ left: 24 }) | ||
| 138 | - .width(375) | 135 | + } |
| 136 | + .width(CommonConstants.FULL_WIDTH) | ||
| 139 | .height(16) | 137 | .height(16) |
| 140 | .id('label') | 138 | .id('label') |
| 141 | } | 139 | } |
| 142 | - .width(375) | ||
| 143 | - | ||
| 144 | - // .backgroundColor(0x000000) | 140 | + .width(CommonConstants.FULL_WIDTH) |
| 141 | + .padding({ | ||
| 142 | + top: 14, | ||
| 143 | + left: 16, | ||
| 144 | + right: 16, | ||
| 145 | + bottom: 14 | ||
| 146 | + }) | ||
| 145 | } | 147 | } |
| 146 | } | 148 | } |
| @@ -44,6 +44,7 @@ export struct OperRowListView { | @@ -44,6 +44,7 @@ export struct OperRowListView { | ||
| 44 | .width(24) | 44 | .width(24) |
| 45 | .height(24) | 45 | .height(24) |
| 46 | .aspectRatio(1) | 46 | .aspectRatio(1) |
| 47 | + .interpolation(ImageInterpolation.High) | ||
| 47 | } | 48 | } |
| 48 | .margin({ | 49 | .margin({ |
| 49 | top: 0, | 50 | top: 0, |
| @@ -74,14 +75,12 @@ export struct OperRowListView { | @@ -74,14 +75,12 @@ export struct OperRowListView { | ||
| 74 | .width('45.5%') | 75 | .width('45.5%') |
| 75 | .alignItems(VerticalAlign.Center) | 76 | .alignItems(VerticalAlign.Center) |
| 76 | .justifyContent(FlexAlign.Start) | 77 | .justifyContent(FlexAlign.Start) |
| 77 | - Row() { | 78 | + Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) { |
| 78 | ForEach(this.operationList, (item: OperationItem, index: number) => { | 79 | ForEach(this.operationList, (item: OperationItem, index: number) => { |
| 79 | this.buildOperationItem(item, index) | 80 | this.buildOperationItem(item, index) |
| 80 | }, (item: OperationItem, index: number) => JSON.stringify(item)) | 81 | }, (item: OperationItem, index: number) => JSON.stringify(item)) |
| 81 | } | 82 | } |
| 82 | .width('54.5%') | 83 | .width('54.5%') |
| 83 | - .alignItems(VerticalAlign.Center) | ||
| 84 | - .justifyContent(FlexAlign.Center) | ||
| 85 | } | 84 | } |
| 86 | .width('100%') | 85 | .width('100%') |
| 87 | .height(56) | 86 | .height(56) |
| @@ -100,6 +99,7 @@ export struct OperRowListView { | @@ -100,6 +99,7 @@ export struct OperRowListView { | ||
| 100 | .width(24) | 99 | .width(24) |
| 101 | .height(24) | 100 | .height(24) |
| 102 | .aspectRatio(1) | 101 | .aspectRatio(1) |
| 102 | + .interpolation(ImageInterpolation.High) | ||
| 103 | } | 103 | } |
| 104 | .margin(5) | 104 | .margin(5) |
| 105 | .alignItems(HorizontalAlign.Center) | 105 | .alignItems(HorizontalAlign.Center) |
| @@ -108,6 +108,5 @@ export struct OperRowListView { | @@ -108,6 +108,5 @@ export struct OperRowListView { | ||
| 108 | Logger.info(TAG, `buildOperationItem onClick event index: ${index}`); | 108 | Logger.info(TAG, `buildOperationItem onClick event index: ${index}`); |
| 109 | ToastUtils.showToast('体验版,本功能暂未开发', 1000); | 109 | ToastUtils.showToast('体验版,本功能暂未开发', 1000); |
| 110 | }) | 110 | }) |
| 111 | - .width('19%') | ||
| 112 | } | 111 | } |
| 113 | } | 112 | } |
| @@ -102,6 +102,7 @@ export class PageRepository { | @@ -102,6 +102,7 @@ export class PageRepository { | ||
| 102 | * 早晚报pageInfo请求 TODO 现网无数据写死测试环境 | 102 | * 早晚报pageInfo请求 TODO 现网无数据写死测试环境 |
| 103 | * */ | 103 | * */ |
| 104 | static getMorningEveningPageInfoUrl(pageId: string) { | 104 | static getMorningEveningPageInfoUrl(pageId: string) { |
| 105 | + HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV | ||
| 105 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; | 106 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; |
| 106 | url = url + "?pageId=" + pageId; | 107 | url = url + "?pageId=" + pageId; |
| 107 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) | 108 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| @@ -122,6 +123,7 @@ export class PageRepository { | @@ -122,6 +123,7 @@ export class PageRepository { | ||
| 122 | * topicId:专题id | 123 | * topicId:专题id |
| 123 | * */ | 124 | * */ |
| 124 | static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { | 125 | static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { |
| 126 | + HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV | ||
| 125 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; | 127 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; |
| 126 | url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId=" | 128 | url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId=" |
| 127 | + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize; | 129 | + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize; |
| 1 | -@Component | ||
| 2 | -export struct AVPlayer { | ||
| 3 | - @State outSetValueOne:number = 40 | ||
| 4 | - | ||
| 5 | - build() { | ||
| 6 | - Column(){ | ||
| 7 | - // 进度条 | ||
| 8 | - Row(){ | ||
| 9 | - Slider({ | ||
| 10 | - value: this.outSetValueOne, | ||
| 11 | - min: 0, | ||
| 12 | - max: 100, | ||
| 13 | - style: SliderStyle.OutSet | ||
| 14 | - }) | ||
| 15 | - .trackColor('rgba(0,0,0,0.5)') | ||
| 16 | - .selectedColor('#ED2800') | ||
| 17 | - .showTips(true) | ||
| 18 | - .onChange((value: number, mode: SliderChangeMode) => { | ||
| 19 | - this.outSetValueOne = value | ||
| 20 | - console.info('value:' + value + 'mode:' + mode.toString()) | ||
| 21 | - }) | ||
| 22 | - } | ||
| 23 | - .width('100%') | ||
| 24 | - .padding({left:24,right:24}) | ||
| 25 | - .margin({top:110}) | ||
| 26 | - // 播放按钮 | ||
| 27 | - Row(){ | ||
| 28 | - Image($r('app.media.loop')) | ||
| 29 | - .width(24) | ||
| 30 | - .height(24) | ||
| 31 | - Image($r('app.media.Backward')) | ||
| 32 | - .width(24) | ||
| 33 | - .height(24) | ||
| 34 | - Stack(){ | ||
| 35 | - Image($r("app.media.playicon")) | ||
| 36 | - .width(32) | ||
| 37 | - .height(32) | ||
| 38 | - } | ||
| 39 | - .backgroundColor('rgba(255,255,255,0.1)') | ||
| 40 | - .width(60) | ||
| 41 | - .height(60) | ||
| 42 | - .padding(14) | ||
| 43 | - .borderRadius(50) | ||
| 44 | - .onClick(()=>{ | ||
| 45 | - // this.avPlayerUrl() | ||
| 46 | - }) | ||
| 47 | - | ||
| 48 | - Image($r('app.media.fastForward')) | ||
| 49 | - .width(24) | ||
| 50 | - .height(24) | ||
| 51 | - Image($r('app.media.doubleSpeed')) | ||
| 52 | - .width(24) | ||
| 53 | - .height(24) | ||
| 54 | - } | ||
| 55 | - .width('100%') | ||
| 56 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 57 | - .margin({top:56}) | ||
| 58 | - .padding({left:32,right:32}) | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - } | ||
| 62 | -} |
| 1 | -import media from '@ohos.multimedia.media'; | ||
| 2 | -import { Song } from '../viewModel/Song' | ||
| 3 | -import { AVPlayer } from '../../components/AVPlayer' | ||
| 4 | - | 1 | +import { Logger } from 'wdKit'; |
| 2 | +import { AudioDetailComponent } from 'wdComponent'; | ||
| 3 | +import router from '@ohos.router'; | ||
| 4 | +import { Params, Action } from 'wdBean'; | ||
| 5 | +const TAG = 'AudioDetail'; | ||
| 5 | @Entry | 6 | @Entry |
| 6 | @Component | 7 | @Component |
| 7 | struct AudioDetail { | 8 | struct AudioDetail { |
| 8 | - @State message: string = '大自然的奇迹展览在中国国家博物馆拉开帷幕'; | ||
| 9 | - @State iocClock: string = '定时'; | ||
| 10 | - @State iconTheOriginal: string = '原文'; | ||
| 11 | - @State iconList: string = '列表'; | ||
| 12 | - @State text: string = '' | ||
| 13 | - @State showList: boolean = false | ||
| 14 | - controller: TextInputController = new TextInputController() | ||
| 15 | - // 音频 | ||
| 16 | - @State songs: Song[] = [] | ||
| 17 | - | ||
| 18 | - // private avPlayer:media.AVPlayer | ||
| 19 | - | ||
| 20 | - async aboutToAppear() { | ||
| 21 | - //加载音乐列表 | ||
| 22 | - // let response = await axios({ | ||
| 23 | - // method:'get', | ||
| 24 | - // url:'' | ||
| 25 | - // }) | ||
| 26 | - // //创建avPlayer实例对象 | ||
| 27 | - // this.avPlayer = await media.createAVPlayer() | ||
| 28 | - // //创建状态机变化回调函数 | ||
| 29 | - // this.setAVPlayerCallback() | ||
| 30 | - // // this.avPlayer.url = | ||
| 31 | - } | ||
| 32 | 9 | ||
| 33 | - // 注册avplayer回调函数 | ||
| 34 | - // setAVPlayerCallback() { | ||
| 35 | - // // seek操作结果回调函数 | ||
| 36 | - // this.avPlayer.on('seekDone', (seekDoneTime) => { | ||
| 37 | - // console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`); | ||
| 38 | - // }) | ||
| 39 | - // // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程 | ||
| 40 | - // this.avPlayer.on('error', (err) => { | ||
| 41 | - // console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`); | ||
| 42 | - // this.avPlayer.reset(); // 调用reset重置资源,触发idle状态 | ||
| 43 | - // }) | ||
| 44 | - // // 状态机变化回调函数 | ||
| 45 | - // this.avPlayer.on('stateChange', async (state, reason) => { | ||
| 46 | - // switch (state) { | ||
| 47 | - // case 'idle': // 成功调用reset接口后触发该状态机上报 | ||
| 48 | - // console.info('AVPlayer state idle called.'); | ||
| 49 | - // this.avPlayer.release(); // 调用release接口销毁实例对象 | ||
| 50 | - // break; | ||
| 51 | - // case 'initialized': // avplayer 设置播放源后触发该状态上报 | ||
| 52 | - // console.info('AVPlayerstate initialized called.'); | ||
| 53 | - // this.avPlayer.prepare().then(() => { | ||
| 54 | - // console.info('AVPlayer prepare succeeded.'); | ||
| 55 | - // }) | ||
| 56 | - // break; | ||
| 57 | - // case 'prepared': // prepare调用成功后上报该状态机 | ||
| 58 | - // console.info('AVPlayer state prepared called.'); | ||
| 59 | - // this.avPlayer.play(); // 调用播放接口开始播放 | ||
| 60 | - // break; | ||
| 61 | - // case 'playing': // play成功调用后触发该状态机上报 | ||
| 62 | - // console.info('AVPlayer state playing called.'); | ||
| 63 | - // break; | ||
| 64 | - // case 'paused': // pause成功调用后触发该状态机上报 | ||
| 65 | - // console.info('AVPlayer state paused called.'); | ||
| 66 | - // this.avPlayer.play(); // 再次播放接口开始播放 | ||
| 67 | - // break; | ||
| 68 | - // case 'completed': // 播放结束后触发该状态机上报 | ||
| 69 | - // console.info('AVPlayer state completed called.'); | ||
| 70 | - // this.avPlayer.stop(); //调用播放结束接口 | ||
| 71 | - // break; | ||
| 72 | - // case 'stopped': // stop接口成功调用后触发该状态机上报 | ||
| 73 | - // console.info('AVPlayer state stopped called.'); | ||
| 74 | - // this.avPlayer.reset(); // 调用reset接口初始化avplayer状态 | ||
| 75 | - // break; | ||
| 76 | - // case 'released': | ||
| 77 | - // console.info('AVPlayer state released called.'); | ||
| 78 | - // break; | ||
| 79 | - // default: | ||
| 80 | - // console.info('AVPlayer state unknown called.'); | ||
| 81 | - // break; | ||
| 82 | - // } | ||
| 83 | - // }) | ||
| 84 | - // } | 10 | + @State relId: string = '' |
| 11 | + @State contentId: string = '' | ||
| 12 | + @State relType: string = '' | ||
| 85 | 13 | ||
| 86 | build() { | 14 | build() { |
| 87 | Column() { | 15 | Column() { |
| 88 | - Row() { | ||
| 89 | - Column() { | ||
| 90 | - // 封面 | ||
| 91 | - Row() { | ||
| 92 | - Image($r('app.media.audio')) | ||
| 93 | - .width(240) | ||
| 94 | - .height(160) | ||
| 95 | - .borderRadius('0.00vp') | ||
| 96 | - } | ||
| 97 | - .justifyContent(FlexAlign.Center) | ||
| 98 | - .width('100%') | ||
| 99 | - .margin({ top: 64 }) | ||
| 100 | - | ||
| 101 | - // 标题 | ||
| 102 | - Row() { | ||
| 103 | - Text(this.message) | ||
| 104 | - .fontSize(20) | ||
| 105 | - .fontWeight(FontWeight.Bold) | ||
| 106 | - .fontColor('#ffffff') | ||
| 107 | - .textAlign(TextAlign.Center) | ||
| 108 | - .lineHeight(28) | ||
| 109 | - .fontFamily('PingFang SC, PingFang SC') | ||
| 110 | - } | ||
| 111 | - .padding({ left: 34, right: 34 }) | ||
| 112 | - .margin({ top: 32 }) | ||
| 113 | - | ||
| 114 | - // 操作矩阵 | ||
| 115 | - Row() { | ||
| 116 | - // 定时 | ||
| 117 | - Column() { | ||
| 118 | - Image($r('app.media.clock')) | ||
| 119 | - .width(28) | ||
| 120 | - .height(28) | ||
| 121 | - Text(this.iocClock) | ||
| 122 | - .fontColor('#fff') | ||
| 123 | - .fontSize(12) | ||
| 124 | - .lineHeight(16) | ||
| 125 | - .margin(2) | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - // 原文 | ||
| 129 | - Column() { | ||
| 130 | - Image($r('app.media.theOriginal')) | ||
| 131 | - .width(28) | ||
| 132 | - .height(28) | ||
| 133 | - Text(this.iconTheOriginal) | ||
| 134 | - .fontColor('#fff') | ||
| 135 | - .fontSize(12) | ||
| 136 | - .lineHeight(16) | ||
| 137 | - .margin(2) | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - // 列表 | ||
| 141 | - Column() { | ||
| 142 | - Image($r('app.media.list')) | ||
| 143 | - .width(28) | ||
| 144 | - .height(28) | ||
| 145 | - Text(this.iconList) | ||
| 146 | - .fontColor('#fff') | ||
| 147 | - .fontSize(12) | ||
| 148 | - .lineHeight(16) | ||
| 149 | - .margin(2) | ||
| 150 | - } | ||
| 151 | - .onClick(() => { | ||
| 152 | - this.showList = !this.showList | ||
| 153 | - console.log('列表', this.showList) | ||
| 154 | - }) | ||
| 155 | - } | ||
| 156 | - .width('100%') | ||
| 157 | - .padding({ left: 49, right: 49 }) | ||
| 158 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 159 | - .margin({ top: 60 }) | ||
| 160 | - | ||
| 161 | - AVPlayer() | ||
| 162 | - } | ||
| 163 | - } | ||
| 164 | - .height('100%-56') | ||
| 165 | - | ||
| 166 | - Row() { | ||
| 167 | - Image($r('app.media.leftArrow')) | ||
| 168 | - .width(24) | ||
| 169 | - .height(24) | ||
| 170 | - TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) | ||
| 171 | - .placeholderColor('#999999') | ||
| 172 | - .placeholderFont({ size: 12, weight: 400 }) | ||
| 173 | - .caretColor(Color.White) | ||
| 174 | - .height(30) | ||
| 175 | - .width(115) | ||
| 176 | - .fontSize(12) | ||
| 177 | - .fontColor('#999999') | ||
| 178 | - .backgroundColor('rgba(255,255,255,0.1)') | ||
| 179 | - .borderRadius(0) | ||
| 180 | - .backgroundColor('[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor') | ||
| 181 | - .onChange((value: string) => { | ||
| 182 | - this.text = value | ||
| 183 | - }) | ||
| 184 | - // 消息 | ||
| 185 | - Badge({ | ||
| 186 | - count: 100, | ||
| 187 | - style: { fontSize: 12, badgeColor: '#FA2A2D' }, | ||
| 188 | - }) { | ||
| 189 | - Image($r('app.media.news')) | ||
| 190 | - .width(24) | ||
| 191 | - .height(24) | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - // 点赞 | ||
| 195 | - Badge({ | ||
| 196 | - count: 100, | ||
| 197 | - style: { fontSize: 12, badgeColor: '#FA2A2D' }, | ||
| 198 | - }) { | ||
| 199 | - Image($r('app.media.like')) | ||
| 200 | - .width(24) | ||
| 201 | - .height(24) | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - // 收藏 | ||
| 205 | - Image($r('app.media.collection')) | ||
| 206 | - .width(24) | ||
| 207 | - .height(24) | ||
| 208 | - // 分享 | ||
| 209 | - Image($r('app.media.share')) | ||
| 210 | - .width(24) | ||
| 211 | - .height(24) | ||
| 212 | - } | ||
| 213 | - .height(56) | ||
| 214 | - .width('100%') | ||
| 215 | - .padding(13) | ||
| 216 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 217 | - | ||
| 218 | - // 播放列表 | 16 | + AudioDetailComponent({ |
| 17 | + relId: this.relId, | ||
| 18 | + contentId: this.contentId, | ||
| 19 | + relType: this.relType | ||
| 20 | + }) | ||
| 219 | } | 21 | } |
| 220 | .height('100%') | 22 | .height('100%') |
| 23 | + .width('100%') | ||
| 221 | .backgroundColor('#20272E') | 24 | .backgroundColor('#20272E') |
| 222 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 223 | - | 25 | + } |
| 26 | + aboutToAppear() { | ||
| 27 | + let par:Action = router.getParams() as Action; | ||
| 28 | + let params = par?.params; | ||
| 29 | + this.relId = params?.extra?.relId || ''; | ||
| 30 | + this.relType = params?.extra?.relType || ''; | ||
| 31 | + this.contentId = params?.contentID || ''; | ||
| 32 | + Logger.info(TAG, 'aboutToAppear'); | ||
| 33 | + Logger.info(TAG, 'params', JSON.stringify(params)); | ||
| 224 | } | 34 | } |
| 225 | } | 35 | } |
-
Please register or login to post a comment