dialogDetail.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='对话记录' bgColor="transparent"></cus-header>
  4. <div class="list">
  5. <div v-for="(item,index) in list">
  6. <div class="time">{{item.createdAt}}</div>
  7. <div class="adf my" v-if="item.chatType===1">
  8. <div class="text my">{{item.content}}</div>
  9. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/6edb131a-66f9-4a2a-a865-7b74e3dd52ed.png"></image>
  10. </div>
  11. <div class="adf ai" v-else-if="item.chatType===2">
  12. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/bcde7118-fc4e-4fa6-96ca-ebe1e0beba2f.png"></image>
  13. <div class="text ai">{{item.content}}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data(){
  22. return {
  23. agentId:'',
  24. deviceId:'',
  25. sessionId:'',
  26. list:[]
  27. }
  28. },
  29. onLoad(option) {
  30. this.agentId = option?.agentId;
  31. this.deviceId = option?.deviceId;
  32. this.sessionId = option?.sessionId;
  33. this.getList();
  34. },
  35. methods:{
  36. getList(){
  37. this.$api.get(`/agent/${this.agentId}/${this.deviceId}/chat-history/${this.sessionId}`).then(res=>{
  38. if(res.data.code!==0) return this.$showToast(res.data.msg)
  39. this.list = res.data.data;
  40. })
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped lang="less">
  46. .page{
  47. background: #F7F6F9;
  48. padding: 0 30rpx 40rpx;
  49. box-sizing: border-box;
  50. .list{
  51. }
  52. }
  53. </style>