zhangbo1_wd

新增页面跳转接口

  1 +export class ContentConstants {
  2 + /* content#objectType,跳转类型:0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 */
  3 + /**
  4 + * 0:不跳转
  5 + */
  6 + static readonly TYPE_NONE: string = "0";
  7 + /**
  8 + * 1:点播
  9 + */
  10 + static readonly TYPE_VOD: string = "1";
  11 + /**
  12 + * 8:图文详情,这里是h5页面
  13 + */
  14 + static readonly TYPE_TELETEXT: string = "8";
  15 +}
@@ -34,4 +34,9 @@ export interface ContentDTO { @@ -34,4 +34,9 @@ export interface ContentDTO {
34 vImageUrl: string; 34 vImageUrl: string;
35 screenType: string; 35 screenType: string;
36 source:string; 36 source:string;
  37 + objectId:string;
  38 + objectType:string;
  39 + channelId:string;
  40 + relId:string;
  41 + relType:string;
37 } 42 }
  1 +import { Logger } from 'wdKit';
  2 +import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
  3 +import { ContentConstants } from '../constants/ContentConstants';
  4 +import { ContentDTO } from '../repository/bean/ContentDTO';
  5 +
  6 +/**
  7 + * 页面跳转业务封装
  8 + */
  9 +export class ProcessUtils {
  10 + static readonly TAG: string = "ProcessUtils";
  11 + /**
  12 + * 页面跳转
  13 + */
  14 + static processPage(content: ContentDTO) {
  15 + if (content == null) {
  16 + Logger.error(this.TAG, "processPage, content is null");
  17 + return;
  18 + }
  19 + if (StringUtils.isEmpty(content.objectType)) {
  20 + Logger.error(this.TAG, "processPage, objectType is empty");
  21 + return;
  22 + }
  23 + let type = content.objectType;
  24 + switch (type) {
  25 + case ContentConstants.TYPE_NONE:
  26 + Logger.debug(this.TAG, "processPage, do nothing");
  27 + break;
  28 + case ContentConstants.TYPE_VOD:
  29 + Logger.debug(this.TAG, "processPage, nonsupport!!!");
  30 + // TODO 待对接更多页面
  31 + break;
  32 + case ContentConstants.TYPE_TELETEXT:
  33 + // 图文详情,跳转h5
  34 + this.gotoWeb(content);
  35 + break;
  36 + default:
  37 + break;
  38 + }
  39 + }
  40 +
  41 + private static gotoWeb(content: ContentDTO) {
  42 + // // topicId
  43 + // content.channelId;
  44 + // content.linkUrl;
  45 + // content.objectId;
  46 + // // CompId
  47 + // content.relId;
  48 + // content.relType;
  49 + // // ScrollToBottom
  50 + // // FromPage
  51 + // TODO 对接路由
  52 + Logger.debug(this.TAG, `gotoWeb, ${content.objectId}`);
  53 + }
  54 +}