zhuli vor 2 Monaten
Ursprung
Commit
c76ccfaa6b

+ 97 - 1
src/api/modules/newLoginApi.ts

@@ -28,6 +28,15 @@ export const registerCheck = params => {
 export const loginAccount = params => {
   return httpLogin.get(`/alienStorePlatform/storePlatformLogin/login`, params, { loading: false });
 };
+// 拉黑用户
+export const blockUser = (params: {
+  blockerType: number; // 拉黑者类型:1表示商家
+  blockedType: number; // 被拉黑者类型:1表示商家
+  blockerId: number | string; // 拉黑者ID
+  blockedId: number | string; // 被拉黑者ID
+}) => {
+  return httpLogin.post("/alienStore/life-blacklist/blackList", params);
+};
 // 忘记密码 /storePlatformLogin/updatePassword
 export const forgetPassword = params => {
   return httpLogin.get(`/alienStorePlatform/storePlatformLogin/updatePassword`, params, { loading: false });
@@ -56,6 +65,22 @@ export const getDistrict = params => {
 export const uploadImg = (params: FormData) => {
   return httpLogin.post<Upload.ResFileUrl>(`/alienStore/file/uploadMore`, params, { cancel: false });
 };
+// 发布/更新动态(新接口)
+export const addOrUpdateDynamic = (params: {
+  address?: string; // 经纬度
+  addressName?: string; // 地址名称
+  addressProvince?: string; // 省市
+  context: string; // 正文内容
+  createId: number | string; // 创建者ID
+  draft: number; // 0表示发布,1表示草稿
+  imagePath: string; // 图片/视频路径(多个用逗号分隔)
+  phoneId: string; // 店铺ID
+  title: string; // 标题
+  type: string; // "2" 表示动态类型
+  id?: number | string; // 动态ID(更新时需要)
+}) => {
+  return httpLogin.post(`/alienStore/userDynamics/addOrUpdate`, params);
+};
 //验证验证码
 export const getCheckSmsCode = params => {
   return httpLogin.get(`/alienStore/ali/checkSmsCode`, params);
@@ -175,7 +200,30 @@ export const commentList = (params: any) => {
 export const getUserDynamics = (params: any) => {
   return httpLogin.get(`/alienStore/userDynamics/getUserDynamics`, params);
 };
-
+// 点赞动态(新接口)- 表单方式提交
+export const likeDynamicNew = (params: {
+  userId: string; // 当前用户phoneId
+  huifuId: number; // 动态ID
+  type: number; // 类型:2表示点赞
+}) => {
+  const formData = new FormData();
+  formData.append("userId", params.userId);
+  formData.append("huifuId", String(params.huifuId));
+  formData.append("type", String(params.type));
+  return httpLogin.post("/alienStore/comment/like", formData);
+};
+// 取消点赞动态(新接口)- 表单方式提交
+export const unlikeDynamicNew = (params: {
+  userId: string; // 当前用户phoneId
+  huifuId: number; // 动态ID
+  type: number; // 类型:2表示点赞
+}) => {
+  const formData = new FormData();
+  formData.append("userId", params.userId);
+  formData.append("huifuId", String(params.huifuId));
+  formData.append("type", String(params.type));
+  return httpLogin.post("/alienStore/comment/cancelLike", formData);
+};
 //本地草稿
 export const getUserDraftDynamics = (params: any) => {
   return httpLogin.get(`/alienStore/userDynamics/getUserDraftDynamics`, params);
@@ -198,3 +246,51 @@ export const addTransferCount = (params: any) => {
 export const deleteDynamicsById = (params: any) => {
   return httpLogin.get(`/alienStore/userDynamics/deleteDynamicsById`, params);
 };
+// 根据手机号获取用户ID
+export const getUserByPhone = (params: {
+  phone: string; // 手机号
+}) => {
+  return httpLogin.get(`/alienStore/store/user/getUserByPhone`, params);
+};
+// 举报动态(新接口)
+export const reportUserViolation = (params: {
+  dynamicsId: number | string;
+  otherReasonContent: string;
+  reportContextType: string;
+  reportEvidenceImg: string;
+  reportedUserId: string | number;
+  reportedUserType: number;
+  reportingUserId: string | number;
+  reportingUserType: number;
+  violationType: number;
+}) => {
+  return httpLogin.post(`/alienStore/user-violation/reporting`, params);
+};
+
+// 关注/取消关注用户(新接口)
+export const toggleFollowUser = (params: {
+  followedId: string | number; // 被关注用户phoneId
+  fansId: string; // 当前用户phoneId
+  fansType: number; // 2表示关注
+}) => {
+  return httpLogin.post(`/alienStore/user/addFans`, params);
+};
+
+// 获取他人动态列表
+export const getUserDynamicsList = (params: {
+  myselfPhoneId: string; // 当前登录用户的phoneId
+  phoneId: string; // 目标用户的phoneId
+  type: number; // 2 表示动态类型
+  page: number;
+  size: number;
+}) => {
+  return httpLogin.get(`/alienStore/userDynamics/getUserDynamicsList`, params);
+};
+
+// 取消关注用户
+export const cancelFollewed = (params: {
+  followedId: string; // 被关注用户phoneId
+  fansId: string; // 当前用户phoneId
+}) => {
+  return httpLogin.post(`/alienStore/user/cancelFollewed`, params);
+};

+ 0 - 20
src/views/dynamicManagement/friendCoupon.vue

@@ -215,10 +215,6 @@ const friendMessageColumns = reactive<ColumnProps<any>[]>([
     }
   },
   {
-    prop: "acName",
-    label: "赠送人"
-  },
-  {
     prop: "couponNum",
     label: "优惠券数量"
   },
@@ -253,25 +249,9 @@ const myGiftColumns = reactive<ColumnProps<any>[]>([
     }
   },
   {
-    prop: "acName",
-    label: "接收人"
-  },
-  {
     prop: "couponNum",
     label: "优惠券数量"
   },
-  {
-    prop: "status",
-    label: "状态",
-    render: (scope: any) => {
-      const statusMap: Record<string, string> = {
-        "0": "未使用",
-        "1": "已使用",
-        "2": "已过期"
-      };
-      return statusMap[scope.row.status] || "--";
-    }
-  },
   { prop: "operation", label: "操作", fixed: "right", width: 200 }
 ]);
 

+ 65 - 26
src/views/dynamicManagement/index.vue

@@ -158,7 +158,16 @@
             </div>
 
             <div class="detail-description">
-              <p>{{ currentDetail.context }}</p>
+              <p :class="{ 'text-ellipsis': !isDescriptionExpanded }">
+                {{ currentDetail.context }}
+              </p>
+              <span
+                v-if="currentDetail.context && currentDetail.context.length > 100"
+                class="expand-btn"
+                @click="toggleDescription"
+              >
+                {{ isDescriptionExpanded ? "收起" : "展开" }}
+              </span>
             </div>
           </div>
         </div>
@@ -366,29 +375,29 @@
         <!-- 举报原因选项 -->
         <div class="report-reasons">
           <el-radio-group v-model="reportForm.reason">
-            <el-radio label="用户头像"> 用户头像 </el-radio>
-            <el-radio label="名称/昵称"> 名称/昵称 </el-radio>
+            <el-radio label="用户违规"> 用户违规 </el-radio>
+            <el-radio label="色情低俗"> 色情低俗 </el-radio>
             <el-radio label="违法违规"> 违法违规 </el-radio>
-            <el-radio label="低俗色情、暴力恐怖、政治谣言"> 低俗色情、暴力恐怖、政治谣言 </el-radio>
+            <el-radio label="侮辱谩骂、煽动对立"> 侮辱谩骂、煽动对立 </el-radio>
             <el-radio label="涉嫌诈骗"> 涉嫌诈骗 </el-radio>
             <el-radio label="人身攻击"> 人身攻击 </el-radio>
-            <el-radio label="侵犯版权"> 侵犯版权 </el-radio>
-            <el-radio label="恶意骚扰"> 恶意骚扰 </el-radio>
-            <el-radio label="虚假/过度宣传"> 虚假/过度宣传 </el-radio>
-            <el-radio label="诱导点赞分享"> 诱导点赞分享 </el-radio>
-            <el-radio label="传播人身安全"> 传播人身安全 </el-radio>
-            <el-radio label="侵权举报"> 侵权举报 </el-radio>
-            <el-radio label="其他举报"> 其他举报 </el-radio>
+            <el-radio label="种族歧视"> 种族歧视 </el-radio>
+            <el-radio label="政治敏感"> 政治敏感 </el-radio>
+            <el-radio label="虚假、不实内容"> 虚假、不实内容 </el-radio>
+            <el-radio label="违反公德秩序"> 违反公德秩序 </el-radio>
+            <el-radio label="危害人身安全"> 危害人身安全 </el-radio>
+            <el-radio label="网络暴力"> 网络暴力 </el-radio>
+            <el-radio label="其他原因"> 其他原因 </el-radio>
           </el-radio-group>
         </div>
 
         <!-- 详细描述(仅"其他举报"时显示) -->
-        <div v-if="reportForm.reason === '其他举报'" class="report-description">
+        <div v-if="reportForm.reason === '其他原因'" class="report-description">
           <el-input
             v-model="reportForm.description"
             type="textarea"
             :rows="4"
-            placeholder="请描述任何涉及举报内容的其体情况,我们会综合一判断合举政采!(必填)"
+            placeholder="请您在此处填写具体原因,我们会在第一时间为您处理!(必填)"
             maxlength="300"
             show-word-limit
           />
@@ -507,23 +516,22 @@ import {
   CircleCheck
 } from "@element-plus/icons-vue";
 import {
-  getUserDynamics,
-  likeDynamic,
-  unlikeDynamic,
-  reportUserViolation,
-  blockUser,
-  getUserByPhone,
   toggleFollowUser,
-  cancelFollowed,
+  blockUser,
+  uploadImg,
+  saveComment,
+  commentList,
+  getMutualAttention,
+  addTransferCount,
+  deleteDynamicsById,
+  getUserDynamics,
   likeDynamicNew,
   unlikeDynamicNew,
-  likeDynamicList,
-  likeComment,
-  unlikeComment
-} from "@/api/modules/dynamicManagement";
+  getUserByPhone,
+  reportUserViolation
+} from "@/api/modules/newLoginApi";
 
-import { saveComment, commentList, getMutualAttention, addTransferCount, deleteDynamicsById } from "@/api/modules/newLoginApi";
-import { uploadImg } from "@/api/modules/upload";
+// import { uploadImg } from "@/api/modules/upload";
 import { useUserStore } from "@/stores/modules/user";
 
 const router = useRouter();
@@ -599,6 +607,9 @@ const isfollowed = ref(0); // 0: 推荐, 1: 关注
 const detailDrawerVisible = ref(false);
 const currentDetail = ref<DetailItem | null>(null);
 
+// 描述展开/收起状态
+const isDescriptionExpanded = ref(false);
+
 // 轮播相关
 const currentCarouselIndex = ref(0);
 const videoRefs = ref<Map<number, HTMLVideoElement>>(new Map());
@@ -830,6 +841,8 @@ const handleCardClick = async (item: DynamicItem) => {
   console.log("点击动态:", item);
   console.log("isFollowThis值:", item.isFollowThis, "(0=未关注显示按钮, 1=已关注隐藏按钮)");
   console.log("isMyDynamic:", isMyDynamic.value);
+  // 重置描述展开状态
+  isDescriptionExpanded.value = false;
   // 直接使用列表数据构建详情
   currentDetail.value = {
     ...item,
@@ -938,6 +951,11 @@ const handleDetailLike = async () => {
   }
 };
 
+// 切换描述展开/收起
+const toggleDescription = () => {
+  isDescriptionExpanded.value = !isDescriptionExpanded.value;
+};
+
 // 显示评论
 // 评论相关
 const commentDrawerVisible = ref(false);
@@ -1850,11 +1868,32 @@ onMounted(() => {
             }
           }
           .detail-description {
+            position: relative;
             font-size: 15px;
             line-height: 1.6;
             color: #ffffff;
             p {
               margin: 0;
+              word-break: break-word;
+              &.text-ellipsis {
+                display: -webkit-box;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                -webkit-line-clamp: 2;
+                line-clamp: 2;
+                -webkit-box-orient: vertical;
+              }
+            }
+            .expand-btn {
+              display: inline-block;
+              margin-top: 8px;
+              font-size: 14px;
+              color: #409eff;
+              cursor: pointer;
+              user-select: none;
+              &:hover {
+                color: #66b1ff;
+              }
             }
           }
         }

+ 62 - 7
src/views/dynamicManagement/myDynamic.vue

@@ -216,7 +216,16 @@
             </div>
 
             <div class="detail-description">
-              <p>{{ currentDetail.description }}</p>
+              <p :class="{ 'text-ellipsis': !isDescriptionExpanded }">
+                {{ currentDetail.description }}
+              </p>
+              <span
+                v-if="currentDetail.description && currentDetail.description.length > 100"
+                class="expand-btn"
+                @click="toggleDescription"
+              >
+                {{ isDescriptionExpanded ? "收起" : "展开" }}
+              </span>
             </div>
           </div>
         </div>
@@ -642,9 +651,12 @@ import {
   getMutualAttention,
   getMyFollowed,
   addTransferCount,
-  getMyUserFans
+  getMyUserFans,
+  blockUser,
+  likeDynamicNew,
+  unlikeDynamicNew
 } from "@/api/modules/newLoginApi";
-import { blockUser, likeDynamicNew, unlikeDynamicNew } from "@/api/modules/dynamicManagement";
+import {} from "@/api/modules/dynamicManagement";
 import { useUserStore } from "@/stores/modules/user";
 import FriendCoupon from "./friendCoupon.vue";
 
@@ -722,10 +734,18 @@ const draftCount = ref(0); // 草稿数量
 const detailDrawerVisible = ref(false);
 const currentDetail = ref<DetailItem | null>(null);
 
+// 描述展开/收起状态
+const isDescriptionExpanded = ref(false);
+
 // 视频轮播相关
 const videoRefs = ref<HTMLVideoElement[]>([]);
 const currentCarouselIndex = ref(0);
 
+// 切换描述展开/收起
+const toggleDescription = () => {
+  isDescriptionExpanded.value = !isDescriptionExpanded.value;
+};
+
 // 评论相关
 const commentDrawerVisible = ref(false);
 const commentListData = ref<any[]>([]);
@@ -842,6 +862,8 @@ const handleTabClick = (pane: any) => {
 // 点击卡片
 const handleCardClick = async (item: any) => {
   try {
+    // 重置描述展开状态
+    isDescriptionExpanded.value = false;
     // 解析媒体列表(支持多张图片和视频)
     const mediaUrl = item.imagePath || "";
     const mediaUrls = mediaUrl
@@ -1911,11 +1933,32 @@ onMounted(() => {
           }
         }
         .detail-description {
+          position: relative;
           font-size: 15px;
           line-height: 1.6;
           color: #ffffff;
           p {
             margin: 0;
+            word-break: break-word;
+            &.text-ellipsis {
+              display: -webkit-box;
+              overflow: hidden;
+              text-overflow: ellipsis;
+              -webkit-line-clamp: 2;
+              line-clamp: 2;
+              -webkit-box-orient: vertical;
+            }
+          }
+          .expand-btn {
+            display: inline-block;
+            margin-top: 8px;
+            font-size: 14px;
+            color: #409eff;
+            cursor: pointer;
+            user-select: none;
+            &:hover {
+              color: #66b1ff;
+            }
           }
         }
       }
@@ -2352,19 +2395,31 @@ onMounted(() => {
             }
           }
           .detail-description {
+            position: relative;
             font-size: 15px;
             line-height: 1.6;
             color: #ffffff;
             p {
-              display: inline;
               margin: 0;
+              word-break: break-word;
+              &.text-ellipsis {
+                display: -webkit-box;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                -webkit-line-clamp: 2;
+                line-clamp: 2;
+                -webkit-box-orient: vertical;
+              }
             }
             .expand-btn {
-              margin-left: 4px;
-              color: rgb(255 255 255 / 60%);
+              display: inline-block;
+              margin-top: 8px;
+              font-size: 14px;
+              color: #409eff;
               cursor: pointer;
+              user-select: none;
               &:hover {
-                color: #ffffff;
+                color: #66b1ff;
               }
             }
           }

+ 2 - 2
src/views/dynamicManagement/publishDynamic.vue

@@ -129,8 +129,8 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import { ArrowLeft, Plus, Location, Search, ZoomIn, Delete } from "@element-plus/icons-vue";
 import type { FormInstance, FormRules, UploadUserFile, UploadFile } from "element-plus";
 // import { publishDynamic, saveDraft, uploadDynamicImage } from "@/api/modules/dynamicManagement";
-import { addOrUpdateDynamic } from "@/api/modules/dynamicManagement";
-import { uploadImg } from "@/api/modules/upload";
+// import { addOrUpdateDynamic } from "@/api/modules/dynamicManagement";
+import { uploadImg, addOrUpdateDynamic } from "@/api/modules/newLoginApi";
 import { useUserStore } from "@/stores/modules/user";
 import { getUserDraftDynamics, getInputPrompt } from "@/api/modules/newLoginApi";
 

+ 2 - 4
src/views/dynamicManagement/userDynamic.vue

@@ -522,15 +522,13 @@ import {
   CircleCheck
 } from "@element-plus/icons-vue";
 import {
-  getUserDynamicsList,
-  toggleFollowUser,
-  cancelFollowed,
   reportUserViolation,
   blockUser,
   getUserByPhone,
   likeDynamicNew,
   unlikeDynamicNew
 } from "@/api/modules/dynamicManagement";
+import { getUserDynamicsList, cancelFollewed, toggleFollowUser } from "@/api/modules/newLoginApi";
 import { uploadImg } from "@/api/modules/upload";
 import { useUserStore } from "@/stores/modules/user";
 import { saveComment, commentList, getMutualAttention, addTransferCount } from "@/api/modules/newLoginApi";
@@ -1041,7 +1039,7 @@ const handleFollow = async () => {
     // 根据当前状态调用不同接口
     if (isFollowed.value) {
       // 已关注 → 取消关注
-      await cancelFollowed({
+      await cancelFollewed({
         followedId: targetPhoneId.value, // 被关注用户phoneId
         fansId: currentUserPhoneId // 当前用户phoneId (格式: store_xxx)
       });