selectDevice.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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"></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. }
  55. .line {
  56. width: 56vw;
  57. height: 1px;
  58. opacity: 0.2;
  59. margin-left: auto;
  60. margin-right: auto;
  61. background-image: linear-gradient(to right, #c8c8c8, #484848, #979797);
  62. }
  63. .box {
  64. display: flex;
  65. flex-direction: column;
  66. width: 50vw;
  67. height: 50vw;
  68. margin-left: auto;
  69. margin-right: auto;
  70. align-items: center;
  71. }
  72. .img {
  73. width: 37.33vw;
  74. height: 34.4vw;
  75. }
  76. .top {
  77. margin-top: 3.3vh;
  78. justify-content: flex-start;
  79. }
  80. .bottom {
  81. margin-bottom: 3.3vh;
  82. justify-content: flex-end;
  83. }
  84. .text {
  85. margin-top: 30rpx;
  86. font-size: 24rpx;
  87. }
  88. .location {
  89. position: fixed;
  90. top: 0;
  91. }
  92. </style>