浏览代码

小程序

e 9 月之前
父节点
当前提交
9a3d5d6cdb

+ 13 - 2
小程序/pages/home/home.js

@@ -25,7 +25,18 @@ Page({
       },
     ]
   },
-
+  getMain:function() {
+    console.log("你好")
+  },
+  getAA:function() {
+    console.log("11")
+  },
+  getBB:function() {
+    console.log("22")
+  },
+  getCC:function(event) {
+    console.log(event)
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -75,7 +86,7 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh() {
-
+    console.log("开启下拉")
   },
 
   /**

+ 1 - 0
小程序/pages/home/home.json

@@ -1,3 +1,4 @@
 {
+  "enablePullDownRefresh": true,
   "usingComponents": {}
 }

+ 6 - 3
小程序/pages/home/home.wxml

@@ -17,12 +17,15 @@
 <view wx:elif="{{obj.age == 18}}">刚成年</view>
 <view wx:else="{{obj.age > 18}}">成年人</view>
 <!-- 内置组件 -->
-<button>哈哈哈</button>
-<input type="text" class="inp"/>
+<button bind:tap="getMain">哈哈哈</button>
+<input type="text" class="inp" bindtap="getCC" />
 <!-- 引用 -->
 <template name="news">
   <view>今天天气真好,今天是星期{{hoilday}}</view>
 </template>
 <template name="aa">
   <view>哈哈哈哈哈</view>
-</template>
+</template>
+<view class="aa" catch:tap="getAA">
+  <view class="bb" catch:tap="getBB"></view>
+</view>

+ 12 - 0
小程序/pages/home/home.wxss

@@ -3,4 +3,16 @@
   width: 200rpx;
   height: 50rpx;
   border: 1rpx solid #f00;
+}
+.aa {
+  width: 400rpx;
+  height: 500rpx;
+  background-color: yellowgreen;
+  margin-top: 20rpx;
+}
+
+.bb {
+  width: 200rpx;
+  height: 200rpx;
+  background: #f00;
 }

+ 1 - 1
小程序/pages/list/list.js

@@ -33,7 +33,7 @@ Page({
    * 生命周期函数--监听页面隐藏
    */
   onHide() {
-
+    console.log("哈哈")
   },
 
   /**

+ 1 - 1
小程序/pages/list/list.wxss

@@ -1 +1 @@
-/* pages/list/list.wxss */
+/* pages/list/list.wxss */