/* eslint-disable no-param-reassign */

const send_request = require('../utils/sendRequest')

/** 获取商品分类列表 */
export function getGoodCategoryList() {
  return send_request({
    url: '/shop/good/miniprogram/cateList',
    method: "GET"
  })
}

/** 获取商品列表 */
export function getGoodList(goodCategoryId, searchText) {
  return send_request({
    url: '/shop/good/miniprogram/list',
    method: "GET",
    data: {
      cateId: goodCategoryId,
      searchText: searchText.trim(),
    }
  })
}

/** 获取商品详情 */
export function getGoodDetail(id) {
  return send_request({
    url: '/shop/good/miniprogram/detail',
    method: "GET",
    data: {
      id: id,
    }
  })
}
