Kaynağa Gözat

feature: 适配图片大小展示

Damon 8 ay önce
ebeveyn
işleme
6cbf84caae
3 değiştirilmiş dosya ile 12 ekleme ve 14 silme
  1. 10 13
      pages/index/index.js
  2. 1 1
      pages/index/index.wxml
  3. 1 0
      pages/index/index.wxss

+ 10 - 13
pages/index/index.js

@@ -564,16 +564,6 @@ Page({
     })
   },
 
-  goWake() {
-    if (this.data.deviceListIndex === null) {
-      return;
-    };
-
-    wx.navigateTo({
-      url: './../deviceWake/deviceWake?deviceId=' + this.data.deviceList[this.data.deviceListIndex].deviceId + "&clientType=" + this.data.deviceList[this.data.deviceListIndex].ProdModel,
-    });
-  },
-
   goChnnel() {
     wx.setStorage({
       key: "channelDeta",
@@ -680,13 +670,20 @@ Page({
     var item = e.currentTarget.dataset.item;
     var devName = item.devName;
     if (devName == "猫王小王子OTR-X") {
-      that.setData({
-        indexPage: 1
-      });
+      that.goWake();
       return;
     }
   },
 
+  goWake() {
+    if (this.data.deviceListIndex === null) {
+      return;
+    };
+    wx.navigateTo({
+      url: './../deviceWake/deviceWake?deviceId=' + this.data.deviceList[this.data.deviceListIndex].deviceId + "&clientType=" + this.data.deviceList[this.data.deviceListIndex].ProdModel,
+    });
+  },
+
   deleteDevice(e) {
     wx.showModal({
       title: '确定删除?',

+ 1 - 1
pages/index/index.wxml

@@ -29,7 +29,7 @@
       <view wx:if="{{deviceList}}">
         <block wx:key="key" wx:for-item="item" wx:for-index="index" wx:for="{{deviceList}}">
           <view class="item_public" style="border: {{item.state && item.state === 'online'&&deviceListIndex === index  ? '4rpx solid #6546A3' : item.state && item.state === 'online'?'2rpx solid #6546A3':'2rpx solid #F2F5F7'}};" data-item="{{item}}" bind:tap="{{item.state && item.state === 'online' ? 'onTapIem' : ''}}">
-            <image class="item_public_image" mode="heightFix" src="./../../img/min.png" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};"></image>
+            <image class="item_public_image" src="./../../img/min.png" style="opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};"></image>
             <view class="item_public_right" style="margin-right: 26rpx; opacity: {{item.state && item.state === 'online' ? '1' : '0.5'}};">
               <view style="height: 190rpx; margin-top: 37rpx; margin-left: 32rpx; flex-direction: column; display: flex;">
                 <view style="flex: 1;">

+ 1 - 0
pages/index/index.wxss

@@ -797,6 +797,7 @@
 
  .item_public_image {
    height: 200rpx;
+   width: 200rpx;
    margin-left: 32rpx;
    margin-top: 32rpx;
  }