enterpriseCard.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="titleClass">您好,我是赢伟达智能客服小助手,很高兴为您服务</view>
  3. <view class="log-card">
  4. <view class="log-card__content">
  5. <view @click="handleClick(item)" class="log-card__text-wrapper" v-for="item in productSpuPageData" :key="item.id">
  6. <text class="log-card__text">
  7. {{ item.name }}
  8. </text>
  9. <scroll-view class="log-card__image-group" scroll-x>
  10. <image class="log-card__image" mode="aspectFill" :src="item.picUrl" />
  11. </scroll-view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import { ref, inject } from "vue";
  18. import AiApi from '@/sheep/api/aiApi/index.js'
  19. import KeFuApi from '@/sheep/api/promotion/kefu';
  20. import { onLoad } from "@dcloudio/uni-app";
  21. const props = defineProps({
  22. item: {
  23. type: Object,
  24. default: () => ({}),
  25. },
  26. });
  27. console.log(props.item, 33333222);
  28. const productSpuPageData = ref([])
  29. const productSpuPageAxios = async () => {
  30. const res = await AiApi.productSpuPage({
  31. page: 1,
  32. pageSize: 10,
  33. categoryIds: props.item.id,
  34. });
  35. productSpuPageData.value = res.data.list
  36. console.log(res, 33333222);
  37. };
  38. const route = ref({})
  39. onLoad((options) => {
  40. route.value = options
  41. });
  42. const EventSourceFun = inject('EventSourceFun');
  43. const loadingInput = inject('loadingInput');
  44. const handleClick = async (item) => {
  45. const data = {
  46. conversationId: route.value.conversationId,
  47. contentType: '1',
  48. content: JSON.stringify({ text: `components|<enterpriseDetailCard id="${item.id}"></enterpriseDetailCard>` }),
  49. relUserId: route.value.relUserId
  50. };
  51. console.log(data, 33333222);
  52. loadingInput.value = true;
  53. EventSourceFun(data, false)
  54. // EventSourceFun.value.send(data)
  55. // await KeFuApi.sendKefuMessageNew(data);
  56. }
  57. productSpuPageAxios();
  58. </script>
  59. <style lang="scss" scoped>
  60. .titleClass {
  61. font-size: 15px;
  62. color: #444444;
  63. margin-bottom: 12px;
  64. margin-left: 12px;
  65. }
  66. .log-card {
  67. display: flex;
  68. flex-direction: column;
  69. justify-content: flex-start;
  70. align-items: flex-start;
  71. padding: 30rpx;
  72. border-radius: 16rpx;
  73. border: 1px solid var(--N3-, #ebedf0);
  74. background-color: #ffffff;
  75. position: relative;
  76. height: auto;
  77. &__content {
  78. width: 100%;
  79. display: flex;
  80. flex-direction: column;
  81. justify-content: flex-start;
  82. align-items: flex-start;
  83. gap: 24rpx;
  84. flex-shrink: 0;
  85. position: relative;
  86. }
  87. &__text-wrapper {
  88. width: 100%;
  89. display: flex;
  90. flex-direction: column;
  91. justify-content: flex-start;
  92. align-items: flex-start;
  93. gap: 24rpx;
  94. flex-shrink: 0;
  95. text-align: justify;
  96. font-size: 32rpx;
  97. font-family: "Source Han Sans";
  98. font-weight: 400;
  99. line-height: 46rpx;
  100. color: var(---1, #222222);
  101. position: relative;
  102. }
  103. &__text {
  104. flex-shrink: 0;
  105. }
  106. &__image-group {
  107. display: flex;
  108. width: 100%;
  109. flex-direction: row;
  110. white-space: nowrap;
  111. }
  112. &__image {
  113. width: 186rpx;
  114. height: 186rpx;
  115. flex-shrink: 0;
  116. border-radius: 8rpx;
  117. margin-right: 16rpx;
  118. }
  119. &__tags {
  120. display: flex;
  121. flex-direction: row;
  122. justify-content: flex-start;
  123. align-items: flex-start;
  124. gap: 16rpx;
  125. flex-shrink: 0;
  126. position: relative;
  127. }
  128. &__tag {
  129. display: flex;
  130. flex-direction: row;
  131. justify-content: flex-start;
  132. align-items: flex-start;
  133. // padding: 6rpx 16rpx;
  134. flex-shrink: 0;
  135. border-radius: 24rpx;
  136. background-color: var(--, #f3f4f4);
  137. line-height: 36rpx;
  138. white-space: pre;
  139. background: #f1f2f2;
  140. padding: 5px 16px;
  141. border-radius: 12px;
  142. display: flex;
  143. align-items: center;
  144. &--primary {
  145. flex-direction: row;
  146. align-items: center;
  147. gap: 4rpx;
  148. color: #773df7;
  149. }
  150. }
  151. &__tag-icon {
  152. width: 28rpx;
  153. height: 28rpx;
  154. position: relative;
  155. flex-shrink: 0;
  156. }
  157. &__tag-text {
  158. font-size: 24rpx;
  159. font-family: "Source Han Sans";
  160. line-height: 36rpx;
  161. font-weight: 400;
  162. color: #3d3d3d;
  163. &--gradient {
  164. -webkit-background-clip: text;
  165. background-clip: text;
  166. -webkit-text-fill-color: transparent;
  167. text-fill-color: transparent;
  168. }
  169. }
  170. }
  171. </style>