import NewAxiosInstanceFunc from '../Service/NewAxiosInstance'
import { INewResponse } from '../Service/INewResponse'
import { IPaging } from 'Material/Material.service'
import { IAuthInfo, IReportBillboardIndustryItem } from 'Indepth/Indepth.service'
import { IAudioDetail, IListndustrialItem } from 'Activity/Activity.service'
import { IRoadshowistItem } from 'Material/MicroRoadshow.service'
export interface IMyActivityItem {
  ActiveState: string //活动进行状态 未开始：1、进行中2、已结束3
  ActivityId: number
  ActivityName: string //活动名称
  ActivityTime: string //活动时间
  ActivityTimeText: string //活动预期时间带文字
  ActivityType: number // 活动线上线下类型 1线上，0 线下，2线下
  ActivityTypeId: number
  ActivityTypeName: string
  ArticleList: null
  AudioLink?: boolean //是否展示回放按钮
  AuthInfo: IAuthInfo
  ChartPermissionId: number
  ChartPermissionName: string //行业名称
  City: string //城市
  Description: string //研选内容说明
  DistinguishedGuest: string //嘉宾
  Expert: string //专家
  Explain: string // 说明
  FileType: number //类型: 1-音频; 2-视频
  Host: string //主持人
  ImgUrl: string //行业图片链接
  ImgUrlText: string //活动类型图片链接
  IsAppointment: number //是否已预约纪要 1是 ，0 否
  IsCClassMeeting: boolean //是否是c类电话会
  IsCancelMeetingReminder: number //是否添加了消息消息提醒   1是 ，0 否
  IsHideAppointment: number //是否隐藏预约纪要按钮  1是，0 否
  IsLimitPeople: number
  IsResearch: boolean //是否属于研选
  IsShowAppointment: boolean //是否展示预约纪要
  IsShowDetails: boolean //是否展示查看详情按钮
  IsShowMeetingReminder: boolean //是否展示会议提醒
  IsShowOutboundCall: boolean //是否展示预约外呼
  IsShowSignup: boolean //是否展示我要报名
  IsShowSustainable: boolean
  IsSignup: number //是否已报名（感兴趣） 1是 ，0 否
  Label: string
  LastUpdatedTime: string
  LimitPeopleNum: number //限制的人数数量
  Listndustrial: IListndustrialItem
  OnlineParticipation: string //网络参会
  ParticipationCode: string //参会密码
  Remarks: string // 备注
  SignupNum: number
  SourceType: number // 活动来源。 1：活动 、2：专项产业调研
  Speaker: string //主讲人
  Theme: string
  VoiceDetail?: IAudioDetail //音频数据
  VideoDetail?: {
    ActivityId: number //活动ID
    Id: number //视频id
    Title: string //视频名称
    ResourceUrl: string //视频地址
    VideoDuration: number //视频时长
  } //视频数据
  YidongActivityUrl: string // 易懂活动链接
  IsShowHelpSsk: boolean //是否展示帮我带问
  TripStatus: number //行程进行状态 1：预报名，2：确定行程
  IsTrip: number //确定行程是否报名 1是 ，0 否
  TripImgLink: string //行程图片链接
  IsExternalLabel: boolean // 是否仅展示外部资源
  IsResearchPoints: boolean // 是否仅展示研选扣点
  LabelKeywordImgLink: string //标签关键词图片链接
}
export interface IMyCollectionItem {
  ArticleId: number
  Title: string //报告标题
  PublishDate: string //发布时间
  PermissionName: string //权限名称
  DepartmentId: number
  NickName: string
  IsCollect: boolean
  Pv: number //观看数
  CollectNum: number //收藏数
  Source: number // 来源 1:弘则资源包（报告）、2：研选主题（报告）
  List: IReportBillboardIndustryItem[]
  IsResearch: boolean // 是否属于研选
  ArticleTypeId: number // 文章类型id -1为研选专栏
  ArticleTypeName: string // 文章类型名称
  IsSpecial: boolean // 是否是专栏
  // MyCollectNum: number
  // SpecialTags: string
  // SpecialType: number
  // UserId: number
  SpecialColumnId: number
  IndustryTags: string[]
  CompanyTags: string[]
  ImgUrlPc: string
  Annotation: string
  LabelKeywordImgLink: string
}
export interface IMyCommentItem {
  Id: number
  UserId: number
  ArticleId: number
  IndustryId: number
  ActivityId: number
  ChartPermissionId: number
  VideoId: number // 视频Id
  CreateTime: string
  Mobile: string //手机号
  Email: string
  CompanyId: number
  CompanyName: string //公司名
  Content: string //留言内容
  Title: string //报告标题
  RedirectType: number //跳转类型 1文章 2活动以及活动音频 3产业视频 4活动视频
}
export interface IMyQuestionItem {
  ReportOrActivityId: number
  Title: string //标题
  Content: string //内容
  AskType: string // 类型 Activity 活动 、Report 文章报告
  CreateTime: string
}
export interface IProductInteriorItem {
  ProductInteriorId: number //ID
  PublishTime: string //发布日期
  CreateTime: string //创建时间
  ModifyTime: string //更新时间
  Title: string //标题
  ColumnName: string //栏目名称
  Body: string //内容
  BodySlice: IBodySlice[] //内容切片
  IsCancel: number //是否取消，1是，0否
  VisibleRange: number //设置可见范围1全部，0内部
  Abstract: string //摘要
  Department: string //作者
  Pv: number //浏览量
  ShareImg: string //分享图片
}
export interface IProductInteriorDetail {
  Detail: IProductInteriorItem
  HasPermission: number //1:有该行业权限,正常展示，2：无该行业权限，不存在权益客户下，3:无该品类权限,已提交过申请，4：无该行业权限,未提交过申请，5：潜在客户，未提交过申请，6：潜在客户,已提交过申请
  IsShow: boolean // 是否展示
}
export interface IBodySlice {
  ChartPermissionId: number //行业id
  SourceId: number //资源ID
  Type: number //类型：1普通文本，2：文章、3：活动、4：产业
  Body: string //内容
}
export interface IOrderListItem {
  LabelKeyword: string //标签关键词
  CreateTime: string //创建时间
  EndDate: string //结束日期
  LabelKeywordImgLink: string //标签关键词ico
  OrderCode: string //订单编号
  OrderMoney: number //订单总价
  OrderStatus: number //订单状态,0:已取消、1:待支付、2:已支付、3:退款成功、4：退款处理中、5：退款异常、6：退款关闭
  OrderStatusText: string //订单状态描述
  Source: string //来源\n报告 ：article\n活动 ：activity
  SourceId: number //文章ID
  SourceTitle: string //来源名称，活动或者报告标题
  StartDate: string //开始日期
}

export const PersonalService = {
  getMyActivityList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IMyActivityItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/activity/scheduleList`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getMyCollectionList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IMyCollectionItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/user/collect/list`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getMyRoadShowList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IRoadshowistItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/user/collect/microRoadShow`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getFootPrintList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IMyCollectionItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/user/browse/history/list`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getMessageList: (PageSize: number, CurrentIndex: number): INewResponse<{ List: IMyCommentItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/user/comment/list`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getQuestionList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IMyQuestionItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/user/ask/list`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getConfigIsShow: (): INewResponse<{ IsBelongRai: boolean; IsShowResearchPoints: boolean }> =>
    NewAxiosInstanceFunc({
      url: `/config/isShow`,
      method: 'get'
    }),
  getProductInteriorList: (
    PageSize: number,
    CurrentIndex: number
  ): INewResponse<{ List: IProductInteriorItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/product_interior/list`,
      method: 'get',
      params: { PageSize, CurrentIndex }
    }),
  getProductInteriorDetail: (ProductInteriorId: number): INewResponse<IProductInteriorDetail> =>
    NewAxiosInstanceFunc({
      url: `/product_interior/detail`,
      method: 'get',
      params: { ProductInteriorId }
    }),
  getAboutUs: (): INewResponse<{ Title: string; Url: string }> =>
    NewAxiosInstanceFunc({
      url: `/config/aboutUs`,
      method: 'get'
    }),
  getOrderList: (
    PageSize: number,
    CurrentIndex: number,
    OrderType: number
  ): INewResponse<{ List: IOrderListItem[]; Paging: IPaging }> =>
    NewAxiosInstanceFunc({
      url: `/order/user/orderList`,
      method: 'get',
      params: { PageSize, CurrentIndex, OrderType } // 订单类型 1：畅读卡订单，2：单场付费订单
    }),

  // getActivityPermissionList: (): INewResponse<{ List: IPermissionItem[]; CheckList: number[] }> =>
  //   NewAxiosInstanceFunc({
  //     url: `/permission/listByActivity`,
  //     method: 'get'
  //   }),

  postHeadImgUpdate: (Headimgurl: string): INewResponse =>
    NewAxiosInstanceFunc({
      url: `/user/headimgurl/update`,
      method: 'post',
      data: { Headimgurl }
    }),
  postAdiviceAdd: (Advice: string, AdviceImgUrl: string[]): INewResponse =>
    NewAxiosInstanceFunc({
      url: `/advice/add`,
      method: 'post',
      data: { Advice, AdviceImgUrl }
    }),
  postOutboundMobile: (OutboundCountryCode: string, OutboundMobile: string): INewResponse =>
    NewAxiosInstanceFunc({
      url: `/user/countryCcode/addOutboundMobile`,
      method: 'post',
      data: { OutboundCountryCode, OutboundMobile }
    }),
  postAboutUsHistory: (): INewResponse =>
    NewAxiosInstanceFunc({
      url: `/config/aboutUs/addHistory`,
      method: 'post'
    })
}
