devices-category.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!-- 蓝牙平台限制 todo https://uniapp.dcloud.io/api/system/bluetooth?id=stopbluetoothdevicesdiscovery -->
  2. <template>
  3. <view>
  4. <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" title="选择设备类型" color="#000000" fixed="true" :border="false">
  5. <view slot="left">
  6. <view class=" flex align-center margin-left">
  7. <image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
  8. </view>
  9. </view>
  10. </uni-nav-bar>
  11. <view class="flex justify-start align-center margin-top ">
  12. <image style="margin: 0 20rpx 0 100rpx; width: 30rpx;height: 30rpx;" src="/static/devicesOther/link.png" mode="aspectFit"></image>
  13. <text style="font-size: 15px; color: #999999;">请选择设备类型开始绑定</text>
  14. </view>
  15. <view class="card-view padding-top padding-bottom" v-for="(item,index) in devicesList" :key="index">
  16. <view class="flex justify-between align-center" @tap="_onConnectDevice(item,$event)">
  17. <text style="margin-left: 70rpx; font-weight: bold; font-size: 18px; color: #565656;">{{item.cname}}</text>
  18. <image style="margin-right: 30rpx; width: 20rpx;height: 90rpx;" src="/static/devicesOther/deviceright.png" mode="aspectFit"></image>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapState
  26. } from 'vuex';
  27. export default {
  28. computed: mapState([]),
  29. data() {
  30. return {
  31. // 列表
  32. devicesList: [{
  33. cname: "手柄盒子",
  34. deviceType: 'BLEHandle',
  35. //type: 'boxingMode'
  36. },
  37. // {
  38. // cname: "跳跃模式",
  39. // type: 'jumpMode'
  40. // },
  41. // {
  42. // cname: "跳跑模式",
  43. // type: 'jumpRunMode'
  44. // }
  45. ]
  46. }
  47. },
  48. onLoad() {
  49. },
  50. onShow() {},
  51. onHide() {},
  52. methods: {
  53. onBack() {
  54. uni.navigateBack({
  55. delta: 1
  56. })
  57. },
  58. // 提示点击连接设备
  59. _onConnectDevice(item, event) {
  60. // console.log(item, event);
  61. uni.navigateTo({
  62. url: '../devices-hardware/devices-hardware?deviceType='+item.deviceType
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style>
  69. </style>