selectDevice.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="content">
  3. <view class="box bottom" @click="deviceClick('MW-M3')">
  4. <image src="https://airsmart-photo1.oss-cn-shanghai.aliyuncs.com/wx/productModel/3X/MW-M3.png"
  5. mode="aspectFit" class="img" />
  6. <text class="text">猫王·MW-M3</text>
  7. </view>
  8. <view class="line line1"></view>
  9. <view class="box top" @click="deviceClick('MW-M4')">
  10. <image src="https://airsmart-photo1.oss-cn-shanghai.aliyuncs.com/wx/productModel/3X/MW-M4.png"
  11. mode="aspectFit" class="img" />
  12. <text class="text">猫王·MW-M4</text>
  13. </view>
  14. <view style="height: 60rpx"></view>
  15. <bt-alert v-if="show" @close="btAlertClose" />
  16. </view>
  17. </template>
  18. <script>
  19. import BtAlert from '../../../components/btAlert/btAlert.vue';
  20. export default {
  21. components: {
  22. BtAlert
  23. },
  24. data() {
  25. return {
  26. show: false,
  27. };
  28. },
  29. methods: {
  30. deviceClick(model) {
  31. if (model == 'MW-M3') {
  32. uni.navigateTo({
  33. url: `../connectDevice/connectDevice?model=MW-M3&name=猫王·MW-M3`,
  34. })
  35. } else if (model == 'MW-M4') {
  36. uni.navigateTo({
  37. url: `../connectDevice/connectDevice?model=MW-M4&name=猫王·MW-M4`,
  38. })
  39. }
  40. },
  41. btAlertClose() {
  42. this.show = false
  43. }
  44. },
  45. };
  46. </script>
  47. <style>
  48. .content {
  49. display: flex;
  50. flex-direction: column;
  51. width: 100vw;
  52. height: 100vh;
  53. justify-content: center;
  54. align-items: center;
  55. }
  56. .line1 {
  57. width: 56vw;
  58. }
  59. .box {
  60. display: flex;
  61. flex-direction: column;
  62. width: 50vw;
  63. height: 50vw;
  64. margin-left: auto;
  65. margin-right: auto;
  66. align-items: center;
  67. }
  68. .img {
  69. width: 37.33vw;
  70. height: 34.4vw;
  71. }
  72. .top {
  73. margin-top: 3.3vh;
  74. justify-content: flex-start;
  75. }
  76. .bottom {
  77. margin-bottom: 3.3vh;
  78. justify-content: flex-end;
  79. }
  80. .text {
  81. margin-top: 30rpx;
  82. font-size: 24rpx;
  83. }
  84. </style>