Kaynağa Gözat

feature: 处理wifi连接多次请求的问题

Damon 7 ay önce
ebeveyn
işleme
3e98b1ce79
3 değiştirilmiş dosya ile 202 ekleme ve 287 silme
  1. 2 24
      app.js
  2. 195 259
      pages/index/index.js
  3. 5 4
      pages/index/index.wxml

+ 2 - 24
app.js

@@ -268,29 +268,7 @@ App({
         if (getCurrentPages()[getCurrentPages().length - 1].getBluetoothStatusCallck) {
           getCurrentPages()[getCurrentPages().length - 1].getBluetoothStatusCallck(that.globalData.scopeBluetooth);
         }
-        // res.authSetting = {
-        //   "scope.userInfo": true,
-        //   "scope.userLocation": true
-        // }
       }
-    })
+    });
   },
-})
-
-
-// "tabBar": {
-//   "borderStyle": "black",
-//   "list": [{
-//       "pagePath": "pages/index/index",
-//       "text": "首页",
-//       "iconPath": "./img/index_unaction.png",
-//       "selectedIconPath": "./img/index_action.png"
-//     },
-//     {
-//       "pagePath": "pages/me/me",
-//       "text": "我的",
-//       "iconPath": "./img/me_unaction.png",
-//       "selectedIconPath": "./img/me_action.png"
-//     }
-//   ]
-// },
+})

Dosya farkı çok büyük olduğundan ihmal edildi
+ 195 - 259
pages/index/index.js


+ 5 - 4
pages/index/index.wxml

@@ -21,7 +21,8 @@
     <scroll-view scroll-y="true" style="height: calc(100vh - 118rpx - 14rpx - 20rpx  - 88rpx - 64rpx - 58rpx - {{bannerList.length>0?296:0}}rpx -  {{navBarHeight}}px);margin-top: 22rpx;padding-top: 10rpx; width: 100%;">
       <view wx:if="{{deviceList}}">
         <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
-          <view class="item_public" style="width: calc(100vw - {{item.state && item.state === 'online'&&deviceListIndex === index ?76:70}}rpx);border: {{item.state && item.state === 'online'&&deviceListIndex === index  ? '8rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}}; margin-left: {{item.state && item.state === 'online'&&deviceListIndex === index  ?0:4}}rpx;" data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
+
+          <view class="item_public" style="width: calc(100vw - {{item.state && item.state === 'online'&&deviceListSelect === index ?76:70}}rpx);border: {{item.state && item.state === 'online'&&deviceListSelect === index  ? '8rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}}; margin-left: {{item.state && item.state === 'online'&&deviceListSelect === index  ?0:4}}rpx;" data-item="{{item}}" data-index="{{index}}" bind:tap="onTapItem">
 
             <image wx:if="{{item.connectType==3}}" class="item_public_image" src="./../../img/min.png" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};"></image>
             <image wx:else class="item_public_image" src="{{item.img}}" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};" mode="aspectFit" lazy-load="true" webp="true"></image>
@@ -33,7 +34,7 @@
                       {{item.devName}}
                     </view>
 
-                    <image mode="heightFix" src="./../../img/add_device_arrow.png" style="width: 48rxp;height: 48rpx; opacity: {{item.state && item.state === 'online'&&deviceListIndex === index ? '1' : '0'}};"></image>
+                    <image mode="heightFix" src="./../../img/add_device_arrow.png" style="width: 48rxp;height: 48rpx; opacity: {{item.state && item.state === 'online'&&deviceListSelect === index ? '1' : '0'}};"></image>
 
                   </view>
                   <view style="color: #666666; font-size: 24rpx;display: flex; flex-direction: row; align-items: center;">
@@ -53,7 +54,7 @@
   </view>
   <view wx:else>
     <!-- 连接设备启用以下版本 -->
-    <view wx:if="{{indexPage==1&&deviceListIndex!=null&&deviceList.length>deviceListIndex&&deviceList[deviceListIndex].connectType===3}}" class="mair" style="height: calc(100vh - 118rpx - {{navBarHeight}}px);">
+    <view wx:if="{{indexPage==1&&deviceListSelect!=null&&deviceList.length>deviceListSelect&&deviceList[deviceListSelect].connectType===3}}" class="mair" style="height: calc(100vh - 118rpx - {{navBarHeight}}px);">
       <view class="play-info">
         <view class="info">
           <image src="./../../img/blak.png" class="black" mode="scaleToFill"></image>
@@ -169,7 +170,7 @@
           首页
         </view>
       </view>
-      <view wx:if="{{deviceListIndex!=null&&deviceList.length>deviceListIndex&&deviceList[deviceListIndex].connectType===3}}" class="bottom_view" data-index="1" bind:tap="onTapIndex">
+      <view wx:if="{{deviceListSelect!=null&&deviceList.length>deviceListSelect&&deviceList[deviceListSelect].connectType===3}}" class="bottom_view" data-index="1" bind:tap="onTapIndex">
         <image class="bottom_image" mode="widthFix" src="{{indexPage==1?'./../../img/channel_action.png':'./../../img/channel_unaction.png'}}"></image>
         <view style="font-size: 20rpx;color: {{indexPage==1?'#A4D099':'black'}};">频道</view>
       </view>