|
@@ -183,6 +183,7 @@ export const addAppealNew = (params: FormData | Record<string, unknown>) => {
|
|
|
return httpLogin.post(`/alienStore/storeCommentAppeal/addAppealNew`, params);
|
|
return httpLogin.post(`/alienStore/storeCommentAppeal/addAppealNew`, params);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 动态-------------------------------------------------------------------------------------
|
|
|
/** 商家端 commonComment/addComment:发表评论/回复(评价回复 sourceType=1,动态评论 sourceType=2) */
|
|
/** 商家端 commonComment/addComment:发表评论/回复(评价回复 sourceType=1,动态评论 sourceType=2) */
|
|
|
// 发表评论 - 表单形式提交(字符串键值对,非 JSON 对象)
|
|
// 发表评论 - 表单形式提交(字符串键值对,非 JSON 对象)
|
|
|
export const addComment = (data: {
|
|
export const addComment = (data: {
|
|
@@ -215,16 +216,6 @@ export const addComment = (data: {
|
|
|
export const saveComment = (params: any) => {
|
|
export const saveComment = (params: any) => {
|
|
|
const businessType = Number(params.businessType ?? 0);
|
|
const businessType = Number(params.businessType ?? 0);
|
|
|
const isRating = businessType === 1;
|
|
const isRating = businessType === 1;
|
|
|
- // const payload = {
|
|
|
|
|
- // sourceType: isRating ? 1 : 2,
|
|
|
|
|
- // sourceId: isRating ? params.replyId : params.businessId,
|
|
|
|
|
- // userId: String(params.userId ?? params.phoneId ?? ""),
|
|
|
|
|
- // parentId: isRating ? 0 : Number(params.replyId || 0),
|
|
|
|
|
- // content: String(params.commentContent ?? params.content ?? ""),
|
|
|
|
|
- // commentType: 2,
|
|
|
|
|
- // merchantId: String(params.merchantId ?? params.storeId ?? params.businessId ?? ""),
|
|
|
|
|
- // isAnonymous: 0
|
|
|
|
|
- // };
|
|
|
|
|
const payload = {
|
|
const payload = {
|
|
|
commentContent: String(params.commentContent ?? params.content ?? ""),
|
|
commentContent: String(params.commentContent ?? params.content ?? ""),
|
|
|
businessType: 2,
|
|
businessType: 2,
|
|
@@ -238,6 +229,38 @@ export const saveComment = (params: any) => {
|
|
|
return addComment(payload);
|
|
return addComment(payload);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 评价-------------------------------------------------------------------------------------
|
|
|
|
|
+export const addComment2 = (data: {
|
|
|
|
|
+ sourceType: number; // 1-评价的评论 2-动态等
|
|
|
|
|
+ sourceId: string | number; // 评价ID或动态ID
|
|
|
|
|
+ userId: string;
|
|
|
|
|
+ parentId: number; // 0-根评论
|
|
|
|
|
+ content: string;
|
|
|
|
|
+ commentType: number; // 2-商户评论
|
|
|
|
|
+ merchantId: string;
|
|
|
|
|
+ isAnonymous?: number;
|
|
|
|
|
+}) => {
|
|
|
|
|
+ return httpLogin.post(`/alienStore/commonComment/addComment`, {
|
|
|
|
|
+ ...data,
|
|
|
|
|
+ isAnonymous: data.isAnonymous ?? 0
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+export const saveComment2 = (params: any) => {
|
|
|
|
|
+ const businessType = Number(params.businessType ?? 0);
|
|
|
|
|
+ const isRating = businessType === 1;
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ sourceType: isRating ? 1 : 2,
|
|
|
|
|
+ sourceId: isRating ? params.replyId : params.businessId,
|
|
|
|
|
+ userId: String(params.userId ?? params.phoneId ?? ""),
|
|
|
|
|
+ parentId: isRating ? 0 : Number(params.replyId || 0),
|
|
|
|
|
+ content: String(params.commentContent ?? params.content ?? ""),
|
|
|
|
|
+ commentType: 2,
|
|
|
|
|
+ merchantId: String(params.merchantId ?? params.storeId ?? params.businessId ?? ""),
|
|
|
|
|
+ isAnonymous: 0
|
|
|
|
|
+ };
|
|
|
|
|
+ return addComment2(payload);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
//评论列表
|
|
//评论列表
|
|
|
export const commentList = (params: any) => {
|
|
export const commentList = (params: any) => {
|
|
|
return httpLogin.get(`/alienStore/storeComment/getList`, params);
|
|
return httpLogin.get(`/alienStore/storeComment/getList`, params);
|