ProcessUtils.ets 1.39 KB
import { ContentDTO } from 'wdBean';
import { Logger } from 'wdKit';
import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
import { ContentConstants } from '../constants/ContentConstants';

const TAG = 'ProcessUtils';

/**
 * 页面跳转业务封装
 */
export class ProcessUtils {
  /**
   * 页面跳转
   */
  static processPage(content: ContentDTO) {
    if (content == null) {
      Logger.error(TAG, "processPage, content is null");
      return;
    }
    if (StringUtils.isEmpty(content.objectType)) {
      Logger.error(TAG, "processPage, objectType is empty");
      return;
    }
    let type = content.objectType;
    switch (type) {
      case ContentConstants.TYPE_NONE:
        Logger.debug(TAG, "processPage, do nothing");
        break;
      case ContentConstants.TYPE_VOD:
        Logger.debug(TAG, "processPage, nonsupport!!!");
      // TODO 待对接更多页面
        break;
      case ContentConstants.TYPE_TELETEXT:
      // 图文详情,跳转h5
        ProcessUtils.gotoWeb(content);
        break;
      default:
        break;
    }
  }

  private static gotoWeb(content: ContentDTO) {
    //  // topicId
    // content.channelId;
    // content.linkUrl;
    // content.objectId;
    // // CompId
    // content.relId;
    // content.relType;
    // // ScrollToBottom
    // // FromPage
    // TODO 对接路由
    Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
  }
}