import { config } from '../../config/index';
import {
  request
} from '../_utils/request';


/** 获取商品详情页评论数 */
export function getGoodsDetailsCommentsCount(spuId) {
  return new Promise((resolve, reject) => {
    request({
      url: `GoodsCommentApi/GetGoodsDetailsCommentsCount`,
      data: {SpuId: spuId},
      method: 'GET',
      success: function (res) {
        let data = res.data;
        
        resolve(data);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}

/** 获取商品详情页评论 */
export function getGoodsDetailsCommentList(spuId) {
  return new Promise((resolve, reject) => {
    request({
      url: `GoodsCommentApi/getGoodsDetailsComments`,
      data: {SpuId: spuId},
      method: 'GET',
      success: function (res) {
        let data = res.data;
        
        resolve(data);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}
