index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div class="l_box box">
  3. <div class="l_top adfacjb">
  4. <!-- <div class="lt_l">{{item.alias||item.board||''}}</div> -->
  5. <div class="lt_l">{{item.id||''}}</div>
  6. <div class="lt_r adfac">
  7. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/8a203ba4-2e9e-4379-89ec-dc7fc9caa3d4.png" v-if="item.state===1"></image>
  8. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/5ed3a1fc-9a05-4f13-8449-fd3183b00355.png" v-else-if="item.state===0"></image>
  9. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/c6d13477-ae1d-4f52-b835-3411a57fc4d7.png" v-if="item.state===1"></image>
  10. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/e26bd236-46db-4283-a1f7-9dd3b4f8ef33.png" v-else-if="item.state===0"></image>
  11. <div class="ltr_zt" :class="{'zx':item.state===1,'lx':item.state===0}">{{item.state===1?'在线':'离线'}}</div>
  12. </div>
  13. </div>
  14. <div class="l_content">
  15. <div class="lc_role adfac">
  16. <image class="lcr_l" :src="item.agent.avatar||'https://transcend.ringzle.com/xiaozhi-app/profile/2025/06/03/b755d53e-c307-4a59-ac2a-2690c326f980.png'"></image>
  17. <div class="lcr_r">
  18. <p>{{item.agent.agentName||''}}</p>
  19. <div class="text">角色模板:{{item.roleModelName||''}}</div>
  20. <div class="text">绑定时间:{{item.createDate||''}}</div>
  21. </div>
  22. </div>
  23. <div class="lc_info" v-if="showInfo">
  24. <u--text :lines="3" :text="item.agent.systemPrompt||''" size="24rpx" color="#7C8592" lineHeight="40rpx"></u--text>
  25. </div>
  26. <div class="lc_btns adfac">
  27. <!-- <div class="lcb_pre" @tap="editRole(item)">角色编辑</div> -->
  28. <div class="lcb_pre" @tap="dislogRecord(item)">对话记录</div>
  29. <div class="lcb_pre" @tap="changeWifi(item)">配置网络</div>
  30. <div class="lcb_pre" @tap="unbindDevice(item)">解绑设备</div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. props:{
  38. item:{
  39. typeof:Object
  40. },
  41. showInfo:{
  42. typeof:Boolean,
  43. default:false
  44. }
  45. },
  46. data(){
  47. return {
  48. }
  49. },
  50. methods:{
  51. dislogRecord(item){
  52. uni.navigateTo({
  53. url:`/pagesHome/dialogRecord?agentId=${item.agentId}&deviceId=${item.id}`
  54. })
  55. },
  56. editRole(item){
  57. this.$emit('editRole');
  58. uni.navigateTo({
  59. url:`/pagesRole/addRole?agentId=${item.agentId}&deviceId=${item.id}`
  60. })
  61. },
  62. changeWifi(item){
  63. uni.navigateTo({
  64. url:'/pagesMy/wifiSearch'
  65. })
  66. },
  67. unbindDevice(item){
  68. uni.showModal({
  69. title:'温馨提示',
  70. content:'确定要解绑该设备吗?',
  71. success: (res) => {
  72. if(res.confirm){
  73. this.$api.post('/device/unbind',{deviceId:item.id}).then(res=>{
  74. if(res.data.code!==0) return this.$showToast(res.data.msg)
  75. this.$showToast('解绑成功');
  76. setTimeout(()=>{
  77. this.$emit('unbindSuccess')
  78. },1000)
  79. })
  80. }
  81. }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped lang="less">
  88. .box{
  89. position: relative;
  90. width: calc(100% - 60rpx);
  91. background: #FFFFFF;
  92. box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0,0,0,0.04);
  93. border-radius: 32rpx;
  94. border: 1rpx solid #D9F159;
  95. box-sizing: border-box;
  96. }
  97. .l_box{
  98. width: 100%;
  99. padding: 49rpx 30rpx 40rpx;
  100. margin-top: 20rpx;
  101. .l_top{
  102. .lt_l{
  103. font-family: PingFang-SC, PingFang-SC;
  104. font-weight: bold;
  105. font-size: 32rpx;
  106. color: #111111;
  107. line-height: 40rpx;
  108. }
  109. .lt_r{
  110. image{
  111. width: 42rpx;
  112. height: 42rpx;
  113. margin-right: 34rpx;
  114. }
  115. .ltr_zt{
  116. font-family: PingFangSC, PingFang SC;
  117. font-weight: 400;
  118. font-size: 26rpx;
  119. line-height: 37rpx;
  120. padding-left: 22rpx;
  121. position: relative;
  122. &::before{
  123. content: '';
  124. width: 12rpx;
  125. height: 12rpx;
  126. border-radius: 50%;
  127. position: absolute;
  128. left: 0;
  129. top: 50%;
  130. margin-top: -6rpx;
  131. }
  132. &.zx{
  133. color: #1B50FF;
  134. &::before{
  135. background: #1B50FF;
  136. }
  137. }
  138. &.lx{
  139. color: #C7C7C7;
  140. &::before{
  141. background: #C7C7C7;
  142. }
  143. }
  144. }
  145. }
  146. }
  147. .l_content{
  148. border-top: 1rpx solid #E2E2E2;
  149. margin-top: 37rpx;
  150. padding-top: 36rpx;
  151. overflow: hidden;
  152. .lc_role{
  153. .lcr_l{
  154. width: 148rpx;
  155. height: 148rpx;
  156. border-radius: 50%;
  157. }
  158. .lcr_r{
  159. width: calc(100% - 148rpx);
  160. padding-left: 30rpx;
  161. box-sizing: border-box;
  162. p{
  163. font-family: PingFang-SC, PingFang-SC;
  164. font-weight: bold;
  165. font-size: 32rpx;
  166. color: #111111;
  167. line-height: 32rpx;
  168. overflow: hidden;
  169. white-space: nowrap;
  170. text-overflow: ellipsis;
  171. }
  172. .text{
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 24rpx;
  176. color: #7C8592;
  177. line-height: 24rpx;
  178. margin-top: 24rpx;
  179. }
  180. }
  181. }
  182. .lc_info{
  183. margin-top: 36rpx;
  184. font-family: PingFangSC, PingFang SC;
  185. font-weight: 400;
  186. font-size: 24rpx;
  187. color: #7C8592;
  188. line-height: 40rpx;
  189. }
  190. .lc_btns{
  191. margin-top: 62rpx;
  192. margin-left: -1rpx;
  193. overflow: hidden;
  194. .lcb_pre{
  195. width: calc(100% / 3);
  196. height: 37rpx;
  197. border-left: 1rpx solid #72832B;
  198. font-family: PingFang-SC, PingFang-SC;
  199. font-weight: bold;
  200. font-size: 26rpx;
  201. color: #72832B;
  202. line-height: 37rpx;
  203. text-align: center;
  204. }
  205. }
  206. }
  207. }
  208. </style>