zhengyiming
2025-02-10 0f686ea1fe4700a909a6159efcf1fcb0e1f88a17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
  <InnerFriendMessage
    :current-use-id="userDetail?.userId"
    :useAccessPersonalInfo="useAccessPersonalInfo"
    @go-user-home-page="goUserHomePage"
    @click="handleClick"
    v-bind="props"
  ></InnerFriendMessage>
</template>
 
<script setup lang="ts">
import { useUser, useAccessPersonalInfo } from '@/hooks';
import { FriendMessage as InnerFriendMessage } from '@12333/components';
import { ListActionsType } from '@12333/hooks';
import { CircleFriendRelationalTypeEnum } from '@12333/constants';
import Taro from '@tarojs/taro';
 
defineOptions({
  name: 'FriendMessage',
});
 
type Props = {
  data: API.CircleFriendDto;
  groupIndex?: number;
  itemIndex?: number;
  listActions?: ListActionsType;
};
 
const props = withDefaults(defineProps<Props>(), {});
 
const { userDetail } = useUser();
 
const goUserHomePage = (userId: string) => {
  Taro.navigateTo({
    url: `${RouterPath.userHomePage}?userId=${userId}`,
  });
};
 
function handleClick() {
  if (props.data.relationalType == CircleFriendRelationalTypeEnum.Order) {
    Taro.navigateTo({
      url: `${RouterPath.orderDetail}?id=${props.data.relationalId}`,
    });
  } else if (props.data.relationalType == CircleFriendRelationalTypeEnum.Resource) {
    Taro.navigateTo({
      url: `${RouterPath.resourceDetail}?id=${props.data.relationalId}`,
    });
  }
}
</script>