Przeglądaj źródła

refactor(app): 重构消息详情页面

- 移除未使用的代码片段
- 添加新的 API 请求函数
- 更新数据处理逻辑
- 调整页面展示内容
EvilDragon 1 miesiąc temu
rodzic
commit
e6bd573b53

+ 4 - 0
packages/app/src/core/libs/requests.ts

@@ -977,6 +977,10 @@ export const getAgents = () =>
   >('/app-api/member/user/getCustomerServiceList')
 export const fakeThis = (query: { agreement: AgreementType }) =>
   httpGet<string>('/app-api/infra/file/download', query)
+export const fuckYouMom = (query: { id: string }) =>
+  httpGet('/app-api/member/message-manage/get', query)
+export const fuckYou = (data: { id: number }) =>
+  httpPost('/app-api/member/message-manage/isRead', data)
 export const refreshToken = (refreshToken: string) =>
   httpPost<any>('/app-api/member/auth/refresh-token', {}, { refreshToken })
 export const httpGetMock = <T>(data: T) =>

+ 1 - 0
packages/app/src/pages/messages/components/message-card.vue

@@ -60,6 +60,7 @@ const handleJump = () => {
   const query: Record<string, string> = {}
   switch (props.options.messageSubType) {
     case 5:
+      query.id = props.options.id
       query.title = props.options.title
       query.contentDetail = props.options.detailBody
       query.createTime = String(props.options.createTime)

+ 10 - 21
packages/app/src/pages/messages/detail/index.vue

@@ -10,30 +10,19 @@
 import { logo } from '../../../core/libs/svgs'
 import Article from '../../home/components/article.vue'
 import { Content } from '@/core/libs/models'
+import { fuckYou, fuckYouMom } from '@/core/libs/requests'
 
 const id = ref()
 const type = ref()
 const request = ref<() => Promise<IResData<Partial<Content>>>>()
-const data = ref()
+
+const { data, run: setData } = useRequest(() => fuckYouMom({ id: id.value }))
 onLoad(async (query?: { id: string; type?: 'banner' }) => {
-  data.value = query
-  // id.value = query.id
-  // type.value = query.type
-  // if (type.value === 'banner') {
-  //   request.value = () =>
-  //     getBanner(id.value).then((res) => ({
-  //       ...res,
-  //       data: {
-  //         title: res.data?.name,
-  //         contentDetail: res.data?.bannerDetailsContent,
-  //         createTime: res.data?.createTime.toString(),
-  //         viewsCount: res.data?.viewCount,
-  //       },
-  //     }))
-  // } else {
-  //   request.value = () => getContent({ id: id.value })
-  // }
-  // await run()
+  if (query.id) {
+    id.value = query.id
+  }
+  await setData()
+  await fuckYou({ id: Number(id.value) })
 })
 </script>
 <template>
@@ -41,9 +30,9 @@ onLoad(async (query?: { id: string; type?: 'banner' }) => {
     <Article
       :title="data?.title"
       :author="{ name: '筑巢荟' }"
-      :content="data?.contentDetail"
+      :content="data?.detailBody"
       :createAt="data?.createTime"
-      :viewNum="data?.viewsCount || 0"
+      :viewNum="data?.viewCount || 0"
     >
       <template #avatar><wd-img width="28" height="28" :src="logo"></wd-img></template>
     </Article>

+ 29 - 0
packages/merchant/src/pages/mine/merchant/orders/detail/index.vue

@@ -10,6 +10,8 @@
 import { getPointsOrder } from '../../../../../core/libs/requests'
 import dayjs from 'dayjs'
 import { ref } from 'vue'
+import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
+
 const collapseValue = ref<string[]>(['item1'])
 const id = ref()
 const { data, run: setData } = useRequest(() => getPointsOrder(id.value), { initialData: {} })
@@ -112,6 +114,33 @@ onLoad(async (query: { id: string }) => {
           积分支付
         </div>
       </div>
+
+      <template v-if="String(data?.orderStatus) === '3'">
+        <div class="flex mt-[20px] items-center justify-between">
+          <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            取消时间
+          </div>
+          <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            {{ dayjs(data?.cancelTime).format('YYYY-MM-DD HH:mm') }}
+          </div>
+        </div>
+        <div class="flex mt-[20px] items-center justify-between">
+          <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            返还积分
+          </div>
+          <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            {{ `${data?.payPoints}` }}
+          </div>
+        </div>
+        <div class="flex mt-[20px] items-center justify-between">
+          <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            取消人
+          </div>
+          <div class="text-black/90 text-sm font-normal font-['PingFang_SC'] leading-normal">
+            {{ data?.cancelUser }}
+          </div>
+        </div>
+      </template>
       <div style="height: 1px; background-color: #f2f2f2" class="mt-[16px]"></div>
       <template v-if="['1'].includes(String(data?.orderStatus))">
         <div