Prechádzať zdrojové kódy

feat: 添加重点跟进功能;更新设计师页面以支持重点跟进和取消操作

EvilDragon 3 mesiacov pred
rodič
commit
8c11891fb0

+ 5 - 0
packages/merchant/src/core/libs/agent-requests.ts

@@ -89,3 +89,8 @@ export const getFollowUpPage = (query = {}) =>
  */
  */
 export const updateFollowUp = (data: Partial<FollowUp>) =>
 export const updateFollowUp = (data: Partial<FollowUp>) =>
   httpPut('/app-api/member/stylist-follow-up/update', data)
   httpPut('/app-api/member/stylist-follow-up/update', data)
+/**
+ * /app-api/member/user-auth-info/focus 重点跟进或取消
+ */
+export const focusOrCancel = (data: { brokerId: number; userId: number }) =>
+  httpPost('/app-api/member/user-auth-info/focus', data)

+ 32 - 19
packages/merchant/src/pages/designer/index.vue

@@ -11,7 +11,7 @@
 import Card from '@/components/card.vue'
 import Card from '@/components/card.vue'
 import DataForm from '@/components/data-form.vue'
 import DataForm from '@/components/data-form.vue'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
-import { getDesigners, updateFollowUp } from '../../core/libs/agent-requests'
+import { focusOrCancel, getDesigners, updateFollowUp } from '../../core/libs/agent-requests'
 import { vipIcon, rightArrowIcon, filterIcon } from '@designer-hub/assets/src/svgs'
 import { vipIcon, rightArrowIcon, filterIcon } from '@designer-hub/assets/src/svgs'
 import { toHomePage } from '../../core/libs/actions'
 import { toHomePage } from '../../core/libs/actions'
 import { Designer, FollowUp } from '@designer-hub/app/src/core/libs/models'
 import { Designer, FollowUp } from '@designer-hub/app/src/core/libs/models'
@@ -72,20 +72,20 @@ const filterData = () => {
   filterState.value = true
   filterState.value = true
 }
 }
 const handleImportant = async (designer: Designer) => {
 const handleImportant = async (designer: Designer) => {
-  // const { code } = await requestToast(
-  //   () =>
-  //     updateFollowUp({
-  //       ...pick(designer, ['id']),
-  //       isFollowFocus: true,
-  //     }),
-  //   {
-  //     success: true,
-  //     successTitle: '重点跟进成功',
-  //   },
-  // )
-  // if (code === 0) {
-  //   await pageHelperRef.value?.refresh()
-  // }
+  const { code } = await requestToast(
+    () =>
+      focusOrCancel({
+        brokerId: userInfo.value.userId,
+        userId: Number(designer.id),
+      }),
+    {
+      success: true,
+      successTitle: '重点跟进成功',
+    },
+  )
+  if (code === 0) {
+    await pageHelperRef.value?.refresh()
+  }
 }
 }
 const handleSubmit = () => {
 const handleSubmit = () => {
   query.value = {
   query.value = {
@@ -135,9 +135,7 @@ const handleReset = () => {
                     <div class="flex flex-col flex-1">
                     <div class="flex flex-col flex-1">
                       <div class="flex-row flex items-center justify-between w-full">
                       <div class="flex-row flex items-center justify-between w-full">
                         <div class="flex-row flex items-center">
                         <div class="flex-row flex items-center">
-                          <div
-                            class="text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]"
-                          >
+                          <div class="text-black/90 text-base font-normal font-['PingFang_SC']">
                             <!-- 苏小萌 -->
                             <!-- 苏小萌 -->
                             {{ it.name }}
                             {{ it.name }}
                           </div>
                           </div>
@@ -212,10 +210,12 @@ const handleReset = () => {
                   class="row-start-5 col-start-2 col-end-4 flex items-center mt-[26px] justify-around"
                   class="row-start-5 col-start-2 col-end-4 flex items-center mt-[26px] justify-around"
                 >
                 >
                   <div
                   <div
+                    v-if="!it.focus"
                     class="px-3 py-1.5 rounded-[30px] border border-solid border-[#ff2d2d] justify-center items-center gap-1 flex"
                     class="px-3 py-1.5 rounded-[30px] border border-solid border-[#ff2d2d] justify-center items-center gap-1 flex"
                     @click.stop="handleImportant(it)"
                     @click.stop="handleImportant(it)"
                   >
                   >
-                    <span style="color: #ff2d2d" class="flex items-center">+</span>
+                    <!-- <span style="color: #ff2d2d" class="flex items-center">+</span> -->
+                    <wd-icon name="add" color="#ff2d2d" size="10"></wd-icon>
                     <div
                     <div
                       class="text-[#ff2d2d] text-xs font-normal font-['PingFang_SC'] leading-none"
                       class="text-[#ff2d2d] text-xs font-normal font-['PingFang_SC'] leading-none"
                     >
                     >
@@ -223,6 +223,19 @@ const handleReset = () => {
                     </div>
                     </div>
                   </div>
                   </div>
                   <div
                   <div
+                    v-else
+                    class="px-3 py-1.5 rounded-[30px] border border-solid border-[#dcdcdc] justify-center items-center gap-1 inline-flex"
+                    @click.stop="handleImportant(it)"
+                  >
+                    <!-- 对号图标 -->
+                    <wd-icon name="check-bold" color="#8b8b8b" size="14"></wd-icon>
+                    <div
+                      class="text-[#8b8b8b] text-xs font-normal font-['PingFang_SC'] leading-none"
+                    >
+                      已重点跟进
+                    </div>
+                  </div>
+                  <div
                     class="px-5 py-1 bg-[#e1ecff] rounded-[30px] border border-[#2357e9] justify-center items-center gap-1 inline-flex"
                     class="px-5 py-1 bg-[#e1ecff] rounded-[30px] border border-[#2357e9] justify-center items-center gap-1 inline-flex"
                     @click.stop="callPhone(it.mobile)"
                     @click.stop="callPhone(it.mobile)"
                   >
                   >