dialogRecord.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='对话记录'></cus-header>
  4. <template v-if="list.length">
  5. <div class="list">
  6. <div class="item adfacjb" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  7. <div class="i_l adfac">
  8. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/bcde7118-fc4e-4fa6-96ca-ebe1e0beba2f.png"></image>
  9. <div class="info">
  10. <p>{{item.createdAt}}</p>
  11. <p class="name">{{'玩具名称'}}</p>
  12. </div>
  13. </div>
  14. <div class="i_r adfac">
  15. <text>{{item.chatCount}}条</text>
  16. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/05/29/e84d58ee-1cc7-4457-bf65-4849a9a22acb.png"></image>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <template v-else>
  22. <page-empty :height="'calc(100vh - 72rpx)'"></page-empty>
  23. </template>
  24. </view>
  25. </template>
  26. <script>
  27. import pageEmpty from '@/components/pageEmpty/index.vue'
  28. export default {
  29. components:{pageEmpty},
  30. data(){
  31. return {
  32. agentId:'',
  33. deviceId:'',
  34. page:1,
  35. limit:10,
  36. list:[],
  37. isOver:false
  38. }
  39. },
  40. onLoad(option) {
  41. this.agentId = option?.agentId;
  42. this.deviceId = option?.deviceId;
  43. this.getList()
  44. },
  45. onReachBottom() {
  46. if(this.isOver) return
  47. this.getList();
  48. },
  49. methods:{
  50. getList(){
  51. this.$api.get(`/agent/${this.agentId}/${this.deviceId}/sessions`,{page:this.page,limit:this.limit}).then(res=>{
  52. if(res.data.code!==0) return this.$showToast(res.data.msg)
  53. if(this.list.length<res.data.data.total){
  54. this.page++;
  55. this.list = [...this.list,...res.data.data.list];
  56. }else this.isOver = true
  57. })
  58. },
  59. toDetail(item){
  60. uni.navigateTo({
  61. url:`/pagesHome/dialogDetail?agentId=${this.agentId}&deviceId=${this.deviceId}&sessionId=${item.sessionId}`
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped lang="less">
  68. .page{
  69. background: #FFFFFF;
  70. padding: 0 30rpx 30rpx;
  71. box-sizing: border-box;
  72. .list{
  73. .item{
  74. margin-top: 72rpx;
  75. &:first-child{
  76. margin-top: 36rpx;
  77. }
  78. .i_l{
  79. image{
  80. width: 78rpx;
  81. height: 78rpx;
  82. border-radius: 50%;
  83. }
  84. .info{
  85. padding-left: 28rpx;
  86. p{
  87. font-family: PingFang-SC, PingFang-SC;
  88. font-weight: bold;
  89. font-size: 32rpx;
  90. color: #333333;
  91. line-height: 34rpx;
  92. &.name{
  93. font-weight: 400;
  94. font-size: 24rpx;
  95. color: #8D8D8D;
  96. line-height: 24rpx;
  97. margin-top: 20rpx;
  98. }
  99. }
  100. }
  101. }
  102. .i_r{
  103. text{
  104. font-family: PingFang-SC, PingFang-SC;
  105. font-weight: bold;
  106. font-size: 30rpx;
  107. color: #72832B;
  108. line-height: 30rpx;
  109. }
  110. image{
  111. width: 36rpx;
  112. height: 36rpx;
  113. margin-left: 10rpx;
  114. }
  115. }
  116. }
  117. }
  118. }
  119. </style>