zheng 2 zile în urmă
părinte
comite
8138e70ca2

+ 12 - 6
12.小程序/pages/home/home.js

@@ -30,46 +30,52 @@ Page({
       score: this.data.score + 10
     })
   },
+  handleBox: function() {
+    console.log("box")
+  },
+  handleBox1: function() {
+    console.log("box1")
+  },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    console.log("111")
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+    console.log("222")
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    console.log("333")
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide() {
-
+    console.log("444")
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload() {
-
+    console.log("555")
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh() {
-
+    console.log("666")
   },
 
   /**

+ 2 - 1
12.小程序/pages/home/home.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
     "headers":"../../components/header/header"
-  }
+  },
+  "enablePullDownRefresh": true
 }

+ 7 - 2
12.小程序/pages/home/home.wxml

@@ -1,7 +1,7 @@
 <!--pages/home/home.wxml-->
 <view>
 <headers></headers>
-  <view>我叫:{{name}}</view>
+  <view class="names">我叫:{{name}}</view>
   <button bind:tap="handleChange">修改</button>
   <view wx:for="{{list}}" wx:key="index">
     <view>我叫{{item.name}},我使用{{item.desc}}</view>
@@ -14,8 +14,13 @@
     <view wx:else>优秀</view>
   </view>
 
-  <button bind:tap="handleScore">修改分数</button>
+  <button bind:tap="handleScore" class="btn">修改分数</button>
+  <!-- home -->
   <template name="aaa">
     <view>姓名:{{names}}</view>
   </template>
+</view>
+
+<view class="box" bind:tap="handleBox"> 
+  <view class="box1" catch:tap="handleBox1"> </view>
 </view>

+ 20 - 1
12.小程序/pages/home/home.wxss

@@ -1 +1,20 @@
-/* pages/home/home.wxss */
+/* pages/home/home.wxss */
+@import '../list/list.wxss';
+.names {
+  color: red;
+  width: 200rpx;
+  height: 300rpx;
+  border: 3rpx solid #ff0;
+}
+.box {
+  width: 500rpx;
+  height: 500rpx;
+  background: #00f;
+}
+
+.box1 {
+  width: 300rpx;
+  height: 300rpx;
+  background: #0ff;
+}
+

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

@@ -12,7 +12,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    console.log("onLoad")
   },
 
   /**

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

@@ -1 +1,7 @@
-/* pages/list/list.wxss */
+/* pages/list/list.wxss */
+.btn {
+  background: red;
+  color: #ff0;
+  text-align: center;
+  font-size: 50rpx;
+}

+ 2 - 0
12.小程序/pages/my/my.wxml

@@ -1,5 +1,7 @@
 <!--pages/my/my.wxml-->
 <include src="/pages/list/list"></include>
+
+
 <import src="/pages/home/home"/>
 <text>这是我的页面</text>
 <template is="aaa" data="{{names:'小明'}}"/>