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

export interface ListPageGoodsInfoParams {
  pageNo: number
  pageSize: number
  categoryId?: any[]
  provinceId?: number
  type: 0
}

export interface Goods {
  goodsName: string
  id: number
  images: string
  price: number | null
}

export interface ListPageGoodsInfoResp {
  pageNo: 1
  pageSize: 10
  list: Array<Goods>
  totalCount: 0
  totalPage: 0
}

export interface Ad {
  id: number
  imageUrl: string
}

export default {
  //web-商品信息-分页
  listPageGoodsInfo: (
    params: ListPageGoodsInfoParams,
    options = {}
  ): Promise<Response<ListPageGoodsInfoResp>> => {
    return request('/pms/product/mall/deviceList', 'post', params, options)
  },
  //产品商城广告位
  ad: (): Promise<Response<Array<Ad>>> => {
    return request('/pms/webProductMall/ad')
  },
}
