connected.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <script>
  2. export default {
  3. name: "connected",
  4. props: ['device_bg', 'device_power'],
  5. methods: {
  6. /**
  7. * 修改设备连接状态
  8. * @param $status 设备状态 0为未连接,1:连接中,2:已连接 3:连接失败
  9. */
  10. setDeviceStatus($status = 0) {
  11. this.$emit("deviceStatus", $status);
  12. },
  13. /**
  14. * 打开教具选择
  15. */
  16. openToyList() {
  17. this.$emit('openToys')
  18. },
  19. }
  20. }
  21. </script>
  22. <template>
  23. <div>
  24. <van-row class="padding">
  25. <van-col span="5">
  26. <div class="device_bg flex flex-direction align-center justify-center">
  27. <img src="https://img.shuimuai.com/web/phone.png" alt="" class="device_phone">
  28. <view>
  29. <text class="text-gray device_text"> 我的手机</text>
  30. </view>
  31. </div>
  32. </van-col>
  33. <van-col span="3" offset="1">
  34. <div class="dot_container flex align-center">
  35. <div class="dot_wait">
  36. <img src="https://img.shuimuai.com/m_sign_gou%402x.png" alt="" class="moving_dot">
  37. </div>
  38. </div>
  39. </van-col>
  40. <van-col span="5" offset="0">
  41. <div class="device_bg flex flex-direction align-center justify-center">
  42. <img src="https://img.shuimuai.com/web/sign_green.png" alt="" class="sign_green" v-if="device_bg == true">
  43. <img src="https://img.shuimuai.com/web/sign_red.png" class="sign_green" alt="" v-else>
  44. <img src="https://img.shuimuai.com/web/brain.png" alt="" class="device_brain">
  45. <view>
  46. <text class="text-gray device_text second_device_text">水母智脑机({{device_power}}%)</text>
  47. </view>
  48. </div>
  49. </van-col>
  50. </van-row>
  51. <!-- 按钮组合-->
  52. <van-row>
  53. <van-col span="9" offset="1">
  54. <button class="cu-btn bg-red lg text-white" @click="setDeviceStatus(0)">
  55. <img src="https://img.shuimuai.com/m_duankainaohuan.png" class="cut_brain_icon" alt="">
  56. <text class="padding-lr cut_text">断开脑机</text>
  57. </button>
  58. </van-col>
  59. <van-col span="12" offset="1">
  60. <button class="cu-btn bg-red lg cu-btn-primary" @click="openToyList">
  61. <img src="https://img.shuimuai.com/m_xuanzewanju.png" alt="" class="cut_brain_icon">
  62. <text class="padding-lr cut_text">选择教具</text>
  63. </button>
  64. </van-col>
  65. </van-row>
  66. </div>
  67. </template>
  68. <style scoped>
  69. .cut_text {
  70. padding: 0px 5px;
  71. font-size: 11px;
  72. }
  73. .device_elc {
  74. height: 5px;
  75. border-radius: 2.5px;
  76. bottom: 1.5px;
  77. }
  78. </style>