You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.0 KiB
83 lines
2.0 KiB
/*
|
|
* @Author: ch
|
|
* @Date: 2022-06-20 11:38:48
|
|
* @LastEditors: ch
|
|
* @LastEditTime: 2022-06-29 16:03:36
|
|
* @Description: file content
|
|
*/
|
|
|
|
import {axiosTk} from "../axiosTk";
|
|
import {axios} from "../axios";
|
|
import { ToAsyncAwait } from "../utils";
|
|
import ENV from '../config/env';
|
|
|
|
const BASE_URL = `${ENV.base_url}/mall/comment`;
|
|
|
|
/**
|
|
* 根据商品获取评论列表未
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetCommentList = (params) =>
|
|
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment`, {
|
|
params: {
|
|
...params,
|
|
notVerifyToken : true
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* 根据商品获取评论总数
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetCommentCount = ({productId}) =>
|
|
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/getAllCommentCountByProductId/${productId}`,{
|
|
params: {
|
|
notVerifyToken : true
|
|
}
|
|
}));
|
|
/**
|
|
* 根据商品获取标签评论总数
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetCommentTabCount = ({productId}) =>
|
|
ToAsyncAwait(axios.get(`${BASE_URL}/app/comment/listCommentLabel/${productId}`));
|
|
/**
|
|
* 获取订单评论详情
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetOrderCommentDetail = ({orderId}) =>
|
|
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/listOrderCommentByOrderId/${orderId}`));
|
|
/**
|
|
* 获取商品满意度
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetProductSatisfaction = ({productId}) =>
|
|
ToAsyncAwait(axios.get(`${BASE_URL}/app/comment/getProductSatisfaction/${productId}`));
|
|
/**
|
|
* 获取评论详情
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiGetCommentDetail = ({commentId}) =>
|
|
ToAsyncAwait(axiosTk.get(`${BASE_URL}/app/comment/getCommentDetail/${commentId}`, {
|
|
params: {
|
|
notVerifyToken : true
|
|
}
|
|
}));
|
|
/**
|
|
* 新增评论
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiPostComment = (data) =>
|
|
ToAsyncAwait(axiosTk.post(`${BASE_URL}/app/comment`, data));
|
|
|
|
|
|
/**
|
|
* 更新评论有用数
|
|
* @param {*} param0
|
|
*/
|
|
export const ApiPutCommentUseful = (data) =>
|
|
ToAsyncAwait(axiosTk.put(`${BASE_URL}/app/comment/updateUsefulCount`, data));
|
|
|
|
|
|
|