export default null;

export const openExternalLink = (
  platformLabel: string,
  isLinkSingle: boolean,
  linkID: string
) => {
  let finalLink = '';
  if (!isLinkSingle) {
    switch (platformLabel) {
      case '淘宝':
        finalLink = `tbopen://m.taobao.com/tbopen/index.html?h5Url=https%3A%2F%2Fh5.m.taobao.com%2Fawp%2Fcore%2Fdetail.htm%3Fid%3D${linkID}`;
        break;
      case '京东':
        finalLink = `openapp.jdmobile://virtual?params=%7B%22des%22:%22m%22,%22url%22:%22${linkID}?ad_od=share&utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL%22,%22category%22:%22jump%22%7D`;
        break;
      case '抖音':
        finalLink = `snssdk1128://ec_goods_detail?promotion_id=${linkID}`;
        break;
      case '拼多多':
        finalLink = `pinduoduo://com.xunmeng.pinduoduo/https_detail.html?goods_id=${linkID}`;
        break;
      default:
        break;
    }
  }
  if (finalLink === '') {
    finalLink = linkID;
  }
  return finalLink;
};
