Browse Source

feature: 添加点击事件和触发方式

Damon 1 year ago
parent
commit
88a94b94ab
2 changed files with 8 additions and 1 deletions
  1. 7 0
      pages/piano/detail/detail.js
  2. 1 1
      pages/piano/detail/detail.wxml

+ 7 - 0
pages/piano/detail/detail.js

@@ -20,6 +20,7 @@ Page({
       showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
       title: '设备详情', //导航栏 中间的标题
     },
+    powerSwitch:false,
   },
 
   /**
@@ -43,6 +44,7 @@ Page({
 
   },
 
+  ///点击顶部
   clickTopItem(e) {
     var that = this;
     switch (e.currentTarget.dataset.index) {
@@ -62,6 +64,11 @@ Page({
     // console.log("获取当前数据=====" + JSON.stringify(index) + "====" + JSON.stringify(e));
   },
 
+  ///省电模式选择
+  powerSwitchChange(){
+
+  },
+
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 1 - 1
pages/piano/detail/detail.wxml

@@ -18,7 +18,7 @@
     <text class="bottom_public_text">省电模式</text>
     <view class="bottom_item">
       <image class="bottom_item_image" mode="heightFix" src="./../../../img/min.png"></image>
-      <switch class="bottom_item_switch" checked="{{switchChecked}}" bindchange="switchChange"></switch>
+      <switch class="bottom_item_switch" checked="{{powerSwitch}}" bindchange="powerSwitchChange"></switch>
     </view>
   </view>