index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <ul class="group-introduction-list select">
  3. <li
  4. v-for="(item, index) in type"
  5. :key="index"
  6. class="select-item"
  7. :class="[selectType === item.type && 'selected']"
  8. @click="selected(item)"
  9. >
  10. <main class="select-item-type">
  11. <div class="select-item-header">
  12. <aside class="left">
  13. <Icon
  14. class="icon"
  15. :file="item.icon"
  16. />
  17. <span class="select-item-label">{{ TUITranslateService.t(`TUIGroup.${item.label}`) }}</span>
  18. </aside>
  19. <Icon
  20. v-if="selectType === item.type"
  21. :file="selectedIcon"
  22. />
  23. </div>
  24. <span class="select-item-detail">{{ TUITranslateService.t(`TUIGroup.${item.detail}`) }}</span>
  25. <a
  26. class="link"
  27. :href="documentLink.product.url"
  28. target="_blank"
  29. @click="openUrl(documentLink.product.url)"
  30. >{{
  31. TUITranslateService.t(`TUIGroup.${item.src}`) }}</a>
  32. </main>
  33. </li>
  34. </ul>
  35. </template>
  36. <script lang="ts" setup>
  37. import { ref, watchEffect } from '../../../../adapter-vue';
  38. import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
  39. import { TUIGlobal } from '@tencentcloud/universal-api';
  40. import documentLink from '../../../../utils/documentLink';
  41. import Icon from '../../../common/Icon.vue';
  42. import selectedIcon from '../../../../assets/icon/selected.svg';
  43. import { groupIntroConfig } from './config';
  44. import { isUniFrameWork } from '../../../../utils/env';
  45. const props = defineProps({
  46. groupType: {
  47. type: String,
  48. default: '',
  49. },
  50. });
  51. const type = groupIntroConfig;
  52. const selectType = ref();
  53. const emit = defineEmits(['selectType']);
  54. watchEffect(() => {
  55. selectType.value = props.groupType;
  56. });
  57. const selected = (item: any) => {
  58. selectType.value = item.type;
  59. emit('selectType', item.type);
  60. };
  61. const openUrl = (link: string) => {
  62. if (!isUniFrameWork) {
  63. TUIGlobal?.open(link);
  64. }
  65. };
  66. </script>
  67. <style lang="scss" scoped src="../style/index.scss"></style>