import request, { Response } from "~/api/request"

export interface GetLeaseGoodsDetailParams {
  goodsId: number
}

export interface GetLeaseGoodsDetailResp {
  id: number;
  images: Image[];
  goodsVideo?: any;
  goodsVideoId?: any;
  goodsName: string;
  goodsNo: string;
  goodsDetail: GoodsDetail;
  directoryId: number;
  categoryByOne: number;
  categoryByTwo?: any;
  tag?: any;
  shelfStatus: number;
  goodsSpec: GoodsSpec[];
  otherService: OtherService[];
  price?: any;
}

export interface OtherService {
  id: number;
  saleServiceId: number;
  serviceName: string;
}

export interface GoodsSpec {
  id: number;
  goodsSpecName: string;
  categoryId: number;
  typeName: string;
  skuId: number;
  brandInfoId?: any;
  skuName: string;
  productSpecList: ProductSpecList[];
  industrySpecList?: any;
  chooseType: number;
  skuUnitId: number;
  unitName: string;
  must: number;
  flag: number;
}

export interface ProductSpecList {
  id: number;
  productSpec: number;
  productSkuId: number;
  specName: string;
  specImage: string;
  partNo: string;
  versionDesc: string;
  createTime?: any;
  productSpecCPQVO: ProductSpecCPQVO;
}

export interface ProductSpecCPQVO {
  productSpecId: number;
  type: number;
  leaseTerm?: any;
  specPrice: any[];
}

export interface GoodsDetail {
  id: number;
  goodsDesc: string;
  content: string;
  remark?: any;
}

export interface Image {
  id: number;
  imgUrl: string;
  imgType: number;
}


export default {
  //web-获取商品详细信息--共多少种选择
  getLeaseGoodsDetail(params: GetLeaseGoodsDetailParams): Promise<Response<GetLeaseGoodsDetailResp>> {
    return request('/pms/product/mall/getLeaseGoodsDetail', 'get', params)
  }
}