deviceDetail.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="flex-column">
  3. <device-item showBtn="true" :device="device ? device : defaultDevice" @onclick="goDeviceInfo()"></device-item>
  4. <text class="black-mudium-30rpx mt10 ml32">定时设置</text>
  5. <view class="flex-row alarm-layout">
  6. <view class="alarm">
  7. <image
  8. class="alarm-png"
  9. src="https://airsmart-photo1.oss-cn-shanghai.aliyuncs.com/wx/bg_device-alarm.png"
  10. mode="aspectFit"
  11. />
  12. <view class="alarm-content" hover-class="view-hover radius16">
  13. <text class="black-mudium-30rpx mb20">定时唤醒</text>
  14. <text class="black-normal-24rpx alarm-time">去设置</text>
  15. <image
  16. class="alarm-rightic right-ic"
  17. src="../../../../static/common/right.svg"
  18. mode="aspectFit"
  19. />
  20. </view>
  21. </view>
  22. <view class="alarm ml26" >
  23. <image
  24. class="alarm-png"
  25. src="https://airsmart-photo1.oss-cn-shanghai.aliyuncs.com/wx/bg_device-alarm.png"
  26. mode="aspectFit"
  27. />
  28. <view class="alarm-content" hover-class="view-hover radius16">
  29. <text class="black-mudium-30rpx mb20">定时休眠</text>
  30. <text class="black-normal-24rpx alarm-time">去设置</text>
  31. <image
  32. class="alarm-rightic right-ic"
  33. src="../../../../static/common/right.svg"
  34. mode="aspectFit"
  35. />
  36. </view>
  37. </view>
  38. </view>
  39. <view class="flex-row item mt20" hover-class="view-hover">
  40. <text class="black-mudium-28rpx">网络</text>
  41. <view class="item-right">
  42. <image
  43. class="right-ic"
  44. src="../../../../static/common/right.svg"
  45. mode="aspectFit"
  46. />
  47. </view>
  48. </view>
  49. <view class="line align-center"></view>
  50. <view class="flex-row item">
  51. <text class="black-mudium-28rpx">IMEI</text>
  52. <text class="gray-normal-24rpx mr34">{{device ? device.imei : ""}}</text>
  53. </view>
  54. <view class="line align-center"></view>
  55. <view class="flex-row item">
  56. <text class="black-mudium-28rpx">序列号</text>
  57. <text class="gray-normal-24rpx mr34">{{uuid}}</text>
  58. </view>
  59. <view class="line align-center"></view>
  60. <view class="flex-row item" hover-class="view-hover">
  61. <text class="black-mudium-28rpx">数据流量</text>
  62. <view class="item-right">
  63. <image
  64. class="right-ic"
  65. src="../../../../static/common/right.svg"
  66. mode="aspectFit"
  67. />
  68. <text class="gray-normal-24rpx mr18">unKnow</text>
  69. </view>
  70. </view>
  71. <view class="line align-center"></view>
  72. <view class="flex-row item" hover-class="view-hover">
  73. <text class="black-mudium-28rpx">发现设备</text>
  74. <view class="item-right">
  75. <image
  76. class="right-ic"
  77. src="../../../../static/common/right.svg"
  78. mode="aspectFit"
  79. />
  80. </view>
  81. </view>
  82. <view class="line align-center"></view>
  83. <view class="flex-row item">
  84. <text class="black-mudium-28rpx">当前固件版本</text>
  85. <text class="gray-normal-24rpx mr34">{{device ? device.Firmware : ""}}</text>
  86. </view>
  87. <view class="line align-center"></view>
  88. <view class="flex-row item">
  89. <text class="black-mudium-28rpx">最新固件版本</text>
  90. <text class="gray-normal-24rpx mr34">1.0</text>
  91. </view>
  92. <button class="btn btn-primary mt28 mb20" hover-class="btn-primary-hover">更新设备固件</button>
  93. </view>
  94. </template>
  95. <script>
  96. import deviceItem from "../../../../components/device-manager/deviceItem/deviceItem.vue";
  97. export default {
  98. components: { deviceItem },
  99. data() {
  100. return {
  101. uuid:'',
  102. defaultDevice:{
  103. devName: "猫王音响.Mate3",
  104. ProdModel: "MW-M3",
  105. }
  106. };
  107. },
  108. methods: {
  109. goDeviceInfo(){
  110. uni.navigateTo({
  111. url:`../../../demo/mqtt/deviceInfo?uuid=${this.uuid}`
  112. })
  113. }
  114. },
  115. computed:{
  116. device(){
  117. // let device = this.$store.moduleMqtt.getters.getDeviceById(this.uuid)
  118. let device = this.$store.getters['moduleMqtt/getDeviceById'](this.uuid)
  119. console.log(device);
  120. return device
  121. }
  122. },
  123. onLoad(option){
  124. this.uuid = option.uuid
  125. this.defaultDevice.devName = option.devName
  126. this.defaultDevice.ProdModel = option.model
  127. }
  128. };
  129. </script>
  130. <style>
  131. .mt10 {
  132. margin-top: 10rpx;
  133. }
  134. .ml32{
  135. margin-left: 32rpx;
  136. }
  137. .alarm-layout {
  138. margin-top: 12rpx;
  139. justify-content: center;
  140. }
  141. .alarm {
  142. width: 44vw;
  143. height: 120rpx;
  144. background: #ffffff;
  145. box-shadow: 0px 0px 20px 0px rgba(213, 212, 212, 0.6);
  146. border-radius: 16rpx;
  147. filter: blur(0px);
  148. position: relative;
  149. }
  150. .radius16{
  151. border-radius: 16rpx;
  152. }
  153. .alarm-content {
  154. position: absolute;
  155. top: 0;
  156. left: 0;
  157. width: 100%;
  158. height: 100%;
  159. display: flex;
  160. flex-direction: column-reverse;
  161. position: relative;
  162. align-items: center;
  163. }
  164. .ml100 {
  165. margin-left: 100rpx;
  166. }
  167. .ml26 {
  168. margin-left: 26rpx;
  169. }
  170. .mb20 {
  171. margin-bottom: 20rpx;
  172. }
  173. .mt20{
  174. margin-top: 20rpx;
  175. }
  176. .alarm-rightic {
  177. position: absolute;
  178. bottom: 28rpx;
  179. right: 80rpx;
  180. }
  181. .alarm-time {
  182. align-self: center;
  183. margin-bottom: 6rpx;
  184. }
  185. .alarm-png {
  186. position: absolute;
  187. top: 0;
  188. left: 0;
  189. width: 100%;
  190. height: 100%;
  191. }
  192. .item{
  193. height: 100rpx;
  194. justify-content: space-between;
  195. padding-left: 34rpx;
  196. padding-right: 34rpx;
  197. align-items: center;
  198. }
  199. .item-right{
  200. display: flex;
  201. flex-direction: row-reverse;
  202. }
  203. .right-ic{
  204. width: 13rpx;
  205. height: 21rpx;
  206. align-self: center;
  207. }
  208. .mr34{
  209. margin-right: 34rpx;
  210. }
  211. .mr18{
  212. margin-right: 18rpx;
  213. }
  214. .mt28{
  215. margin-top: 28rpx;
  216. }
  217. .align-center{
  218. align-self: center;
  219. }
  220. </style>