home.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="tabPage" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <image class="topbg" src="http://106.54.209.120:8188/static/home_topbg.png"></image>
  4. <template v-if="list.length">
  5. <div class="list" :style="{'margin-top':(360-mt-61)+'px'}">
  6. <u-list @scrolltolower="scrolltolower">
  7. <u-list-item v-for="(item, index) in list" :key="index">
  8. <div class="l_box box">
  9. <div class="l_top adfacjb">
  10. <div class="lt_l">我的设备:{{1}}</div>
  11. <div class="lt_r adfac">
  12. <image src="http://106.54.209.120:8188/static/wifi_on_mini.png" v-if="index===0"></image>
  13. <image src="http://106.54.209.120:8188/static/wifi_off_mini.png" v-else></image>
  14. <image src="http://106.54.209.120:8188/static/online_mini.png" v-if="index===0"></image>
  15. <image src="http://106.54.209.120:8188/static/offline_mini.png" v-else></image>
  16. <div class="ltr_zt" :class="{'zx':index===0,'lx':index===1}">{{index===0?'在线':'离线'}}</div>
  17. </div>
  18. </div>
  19. <div class="l_content">
  20. <div class="lc_role adfac">
  21. <image class="lcr_l" src="http://106.54.209.120:8188/static/avatar_default.png"></image>
  22. <div class="lcr_r">
  23. <p>{{'角色昵称'}}</p>
  24. <div class="text">角色模板:{{'英语老师'}}</div>
  25. <div class="text">绑定时间:{{'2025-05-25'}}</div>
  26. </div>
  27. </div>
  28. <div class="lc_info">
  29. {{'一个充满活力与好奇心的年轻人。性格开朗乐观,对生活充满热情。你喜欢在公园等自由自在的地方与朋友们一起探索乐趣…'}}
  30. </div>
  31. <div class="lc_btns adfac">
  32. <div class="lcb_pre">角色编辑</div>
  33. <div class="lcb_pre">更换网络</div>
  34. <div class="lcb_pre">解绑设备</div>
  35. </div>
  36. </div>
  37. </div>
  38. </u-list-item>
  39. </u-list>
  40. </div>
  41. </template>
  42. <template v-else>
  43. <div class="empty box">
  44. <image src="http://106.54.209.120:8188/static/empty_device.png"></image>
  45. <p>暂无设备,快去添加开始聊天吧~</p>
  46. <div class="zt_btn" @tap="addDevice"> + 添加新设备</div>
  47. </div>
  48. </template>
  49. <cus-tabbar :tabbarIndex="0"></cus-tabbar>
  50. <bind-device ref="bdRef"></bind-device>
  51. </view>
  52. </template>
  53. <script>
  54. import cusTabbar from '@/components/CusTabbar/index.vue'
  55. import bindDevice from '@/components/bindDevice/index.vue'
  56. export default {
  57. components:{
  58. cusTabbar,
  59. bindDevice
  60. },
  61. data(){
  62. return {
  63. list:[]
  64. }
  65. },
  66. methods:{
  67. addDevice(){
  68. this.$refs.bdRef.show = true;
  69. },
  70. scrolltolower(){
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped lang="less">
  76. .tabPage{
  77. background: #FFFFFF;
  78. padding-bottom: 192rpx;
  79. box-sizing: border-box;
  80. .topbg{
  81. width: 100%;
  82. height: 720rpx;
  83. position: fixed;
  84. top: 0;
  85. left: 0;
  86. }
  87. .box{
  88. position: relative;
  89. width: calc(100% - 60rpx);
  90. background: #FFFFFF;
  91. box-shadow: 0rpx 4rpx 20rpx 0rpx rgba(0,0,0,0.04);
  92. border-radius: 32rpx;
  93. border: 1rpx solid #D9F159;
  94. box-sizing: border-box;
  95. }
  96. .list{
  97. position: relative;
  98. margin: 0 30rpx 0;
  99. width: calc(100% - 60rpx);
  100. height: calc(100vh - 740rpx);
  101. ::v-deep .u-list{
  102. width: 100%;
  103. height: 100% !important;
  104. }
  105. ::v-deep .u-list-item{
  106. width: 100%;
  107. }
  108. .l_box{
  109. width: 100%;
  110. padding: 49rpx 30rpx 40rpx;
  111. margin-top: 20rpx;
  112. .l_top{
  113. .lt_l{
  114. font-family: PingFang-SC, PingFang-SC;
  115. font-weight: bold;
  116. font-size: 32rpx;
  117. color: #111111;
  118. line-height: 40rpx;
  119. }
  120. .lt_r{
  121. image{
  122. width: 42rpx;
  123. height: 42rpx;
  124. margin-right: 34rpx;
  125. }
  126. .ltr_zt{
  127. font-family: PingFangSC, PingFang SC;
  128. font-weight: 400;
  129. font-size: 26rpx;
  130. line-height: 37rpx;
  131. padding-left: 22rpx;
  132. position: relative;
  133. &::before{
  134. content: '';
  135. width: 12rpx;
  136. height: 12rpx;
  137. border-radius: 50%;
  138. position: absolute;
  139. left: 0;
  140. top: 50%;
  141. margin-top: -6rpx;
  142. }
  143. &.zx{
  144. color: #1B50FF;
  145. &::before{
  146. background: #1B50FF;
  147. }
  148. }
  149. &.lx{
  150. color: #C7C7C7;
  151. &::before{
  152. background: #C7C7C7;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. .l_content{
  159. border-top: 1rpx solid #E2E2E2;
  160. margin-top: 37rpx;
  161. padding-top: 36rpx;
  162. overflow: hidden;
  163. .lc_role{
  164. .lcr_l{
  165. width: 148rpx;
  166. height: 148rpx;
  167. border-radius: 50%;
  168. }
  169. .lcr_r{
  170. width: calc(100% - 148rpx);
  171. padding-left: 30rpx;
  172. box-sizing: border-box;
  173. p{
  174. font-family: PingFang-SC, PingFang-SC;
  175. font-weight: bold;
  176. font-size: 32rpx;
  177. color: #111111;
  178. line-height: 32rpx;
  179. overflow: hidden;
  180. white-space: nowrap;
  181. text-overflow: ellipsis;
  182. }
  183. .text{
  184. font-family: PingFangSC, PingFang SC;
  185. font-weight: 400;
  186. font-size: 24rpx;
  187. color: #7C8592;
  188. line-height: 24rpx;
  189. margin-top: 24rpx;
  190. }
  191. }
  192. }
  193. .lc_info{
  194. margin-top: 36rpx;
  195. font-family: PingFangSC, PingFang SC;
  196. font-weight: 400;
  197. font-size: 24rpx;
  198. color: #7C8592;
  199. line-height: 40rpx;
  200. }
  201. .lc_btns{
  202. margin-top: 62rpx;
  203. margin-left: -1rpx;
  204. overflow: hidden;
  205. .lcb_pre{
  206. width: calc(100% / 3);
  207. height: 37rpx;
  208. border-left: 1rpx solid #72832B;
  209. font-family: PingFang-SC, PingFang-SC;
  210. font-weight: bold;
  211. font-size: 26rpx;
  212. color: #72832B;
  213. line-height: 37rpx;
  214. text-align: center;
  215. }
  216. }
  217. }
  218. }
  219. }
  220. .empty{
  221. display: flex;
  222. flex-direction: column;
  223. align-items: center;
  224. margin: 392rpx 30rpx 0;
  225. padding: 84rpx 40rpx 64rpx;
  226. image{
  227. width: 64rpx;
  228. height: 66rpx;
  229. }
  230. p{
  231. font-family: PingFangSC, PingFang SC;
  232. font-weight: 400;
  233. font-size: 30rpx;
  234. color: #A6A6A6;
  235. line-height: 42rpx;
  236. text-align: center;
  237. margin-top: 30rpx;
  238. }
  239. .zt_btn{
  240. margin-top: 80rpx;
  241. }
  242. }
  243. }
  244. </style>