Browse Source

feat(merchant): 优化设计师详情页面积分相关功能

- 新增设计师积分订单接口和相关页面- 优化设计师详情页面的积分统计展示
- 添加新的弧形底图资源
- 调整页面布局和样式
EvilDragon 3 months ago
parent
commit
31cf225c77

+ 3 - 0
packages/assets/src/assets/arc-bottom-blue.svg

@@ -0,0 +1,3 @@
+<svg width="17" height="6" viewBox="0 0 17 6" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M14.8449 0.390247C13.176 2.15093 10.9238 3.12167 8.50003 3.12167C6.07669 3.12167 3.82377 2.15087 2.15515 0.390247C1.6808 -0.111353 0.890391 -0.131751 0.390316 0.34262C-0.110686 0.815756 -0.132203 1.60618 0.342091 2.10668C2.48682 4.37124 5.38445 5.61796 8.49996 5.61796C11.6161 5.61796 14.5131 4.37117 16.6578 2.10668C17.1322 1.60614 17.1106 0.815679 16.6102 0.34262C16.1097 -0.131731 15.3199 -0.110157 14.8449 0.390247Z" fill="#2357E9"/>
+</svg>

+ 2 - 0
packages/assets/src/libs/assets/arcBottomBlue.ts

@@ -0,0 +1,2 @@
+import arcBottomBlue from '../../assets/arc-bottom-blue.svg' 
+ export default arcBottomBlue

+ 14 - 19
packages/merchant/src/core/libs/agent-requests.ts

@@ -11,7 +11,9 @@ import {
   AgentPoint,
   DesignerAward,
   DesignerPointsStatistics,
+  PointsOrder,
 } from '@designer-hub/app/src/core/libs/models'
+import dayjs from 'dayjs'
 /**
  * 通过ID获取用户信息
  */
@@ -201,18 +203,11 @@ export const getSalesOrders = (query = {}) =>
  */
 export const getPointsCount = (query = {}) =>
   httpGet<DesignerPointsStatistics>('/app-api/member/points-details/getPointsCount', query)
-// { name: '当前剩余积分', des: '最近', value: 220 },
-// { name: '累计获得积分', des: '本年', value: 220 },
-// { name: '累计消耗积分', des: '本年', value: 220 },
-// { name: '累计跟进次数', des: '本年', value: 220 },
-// { name: '累计消耗次数', des: '本年', value: 220 },
-// { name: '累计获得次数', des: '本年', value: 220 },
-// Object.entries(res.data).map((it) => ({
-//   title: '',
-//   value: 0,
-//   subTitle: '',
-//   subValue: 0,
-// }))
+/**
+ * /app-api/member/points-order/pageDitch 设计师积分订单
+ */
+export const getPointsOrders = (query = {}) =>
+  httpGet<ResPageData<PointsOrder>>('/app-api/member/points-order/pageDitch', query)
 /**
  * 获取设计师积分统计数组
  */
@@ -224,42 +219,42 @@ export const getPointsCounts = (query = {}) =>
         userId: '',
         title: '当前剩余积分',
         value: res.data.points ?? 0,
-        subTitle: '年新增',
-        subValue: res.data.gainPointsYear ?? 0,
+        subTitle: '最近',
+        subValue: dayjs(res.data.pointsTime).format('YYYY/MM/DD'),
       },
       {
         userId: '',
         title: '累计获得积分',
         value: res.data.gainPoints ?? 0,
-        subTitle: '年新增',
+        subTitle: '年',
         subValue: res.data.gainPointsYear ?? 0,
       },
       {
         userId: '',
         title: '累计消耗积分',
         value: res.data.usePoints ?? 0,
-        subTitle: '年新增',
+        subTitle: '年',
         subValue: res.data.usePointsYear ?? 0,
       },
       {
         userId: '',
         title: '累计跟进次数',
         value: res.data.followUpCount ?? 0,
-        subTitle: '年新增',
+        subTitle: '年',
         subValue: res.data.followUpYearCount ?? 0,
       },
       {
         userId: '',
         title: '累计消耗次数',
         value: res.data.usageCount ?? 0,
-        subTitle: '年新增',
+        subTitle: '年',
         subValue: res.data.usageYearCount ?? 0,
       },
       {
         userId: '',
         title: '累计获得次数',
         value: res.data.obtainedCount ?? 0,
-        subTitle: '年新增',
+        subTitle: '年',
         subValue: res.data.obtainedYearCount ?? 0,
       },
     ],

+ 15 - 15
packages/merchant/src/pages/agent/designer/detail.vue

@@ -10,9 +10,9 @@ import NavbarEvo from '@/components/navbar-evo.vue'
 import {
   getFollowUpPage,
   getPointsCounts,
-  getPointsCountToArray,
   getUserInfoById,
-} from '../../../core/libs/agent-requests'
+  getPointsOrders,
+} from '@/core/libs/agent-requests'
 import {
   desinTopBg,
   rightArrowIcon,
@@ -27,9 +27,9 @@ import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { dayjs } from 'wot-design-uni'
 import { toHomePage } from '@/core/libs/actions'
 import arcBottom from '@designer-hub/assets/src/libs/assets/arcBottom'
+import arcBottomBlue from '@designer-hub/assets/src/libs/assets/arcBottomBlue'
 import { useMemberLevelsStore } from '@/store/member-levles'
-import TaskCard from '@/pages/agent/components/task-card.vue'
-import { getDesignerPointsActivities, getPointsOrders } from '@/core/libs/requests'
+import { getDesignerPointsActivities } from '@/core/libs/requests'
 import { useUserStore } from '@/store'
 import { storeToRefs } from 'pinia'
 import Card from '@designer-hub/app/src/components/card.vue'
@@ -41,7 +41,7 @@ const memberLevelsStore = useMemberLevelsStore()
 const { getMemberLevelLogo } = memberLevelsStore
 const id = ref()
 const { data, run: setData } = useRequest(() => getUserInfoById(id.value))
-const active = ref('integral')
+const active = ref('product')
 const tabs = ref([
   { label: '数据动态', value: 'integral' },
   { label: '跟进记录', value: 'followUp' },
@@ -50,7 +50,7 @@ const tabs = ref([
 ])
 const status = ref({ '0': '已报名', '1': '已完成', '2': '未核销', '3': '已取消', '4': '待交付' })
 const followUpQuery = ref({})
-const pointsActivitiesQuery = computed(() => ({ brokerId: userInfo.value.userId }))
+const pointsActivitiesQuery = computed(() => ({ stylistId: id.value }))
 const toPointsDetails = () => {
   uni.navigateTo({ url: `/pages/agent/designer/points/index?id=${id.value}` })
 }
@@ -89,10 +89,10 @@ onLoad((query) => {
                 </div>
 
                 <wd-img
-                  v-if="data.levelId"
+                  v-if="data?.levelId"
                   width="63"
                   height="18.6"
-                  :src="getMemberLevelLogo(data.levelId)"
+                  :src="getMemberLevelLogo(data?.levelId)"
                 ></wd-img>
               </div>
               <div
@@ -119,7 +119,7 @@ onLoad((query) => {
       <div>
         <div class="flex items-center justify-around">
           <template v-for="(it, i) in tabs" :key="i">
-            <div class="flex flex-col items-center gap-1" @click="active = it.value">
+            <div class="flex flex-col items-center gap-0" @click="active = it.value">
               <div
                 class="text-center font-normal font-['PingFang_SC'] visible"
                 :class="`${it.value === active ? 'text-black text-lg leading-relaxed ' : 'text-black/60 text-base leading-normal'}`"
@@ -130,7 +130,7 @@ onLoad((query) => {
                 :style="{ visibility: it.value === active ? 'visible' : 'hidden' }"
                 width="17"
                 height="5.6"
-                :src="arcBottom"
+                :src="arcBottomBlue"
               ></wd-img>
             </div>
           </template>
@@ -150,14 +150,14 @@ onLoad((query) => {
                 <wd-icon size="12" name="arrow-right" color="rgba(0,0,0,.3)"></wd-icon>
               </div>
             </div>
-
+            <div class="mt-2 w-full h-.25 bg-[#f9f9f9]"></div>
             <ListHelperEvo
               :request="getPointsCounts"
               :query="{ userId: id }"
-              content-class="grid grid-cols-3 gap-2.5"
+              content-class="grid grid-cols-3 gap-7 py-4"
             >
               <template #default="{ item }">
-                <div class="rounded-lg aspect-[1/1] flex flex-col justify-around p-2.5">
+                <div class="rounded-lg aspect-[1/1] flex flex-col justify-around">
                   <div class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-none">
                     {{ item.title }}
                   </div>
@@ -404,11 +404,11 @@ onLoad((query) => {
         </view>
 
         <view class="content mt-[20px]" v-if="active === 'product'">
-          <div class="flex-grow flex flex-col gap-4 px-3.5 py-5">
+          <div class="flex-grow flex flex-col gap-4">
             <PageHelperEvo
               ref="pageHelperRef"
               :request="getPointsOrders"
-              :query="{}"
+              :query="{ orderType: 2 }"
               class="flex-grow flex flex-col"
             >
               <template #default="{ source }">